Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which utxos to use? #2858

Open
maxlibin opened this issue May 30, 2022 · 1 comment
Open

Which utxos to use? #2858

maxlibin opened this issue May 30, 2022 · 1 comment
Assignees

Comments

@maxlibin
Copy link

maxlibin commented May 30, 2022

Hi guys, sorry for asking, I am trying to understand how to use the utxos, I am using the dapp connector where I can get list of utxos: cardanoApi.getUtxos(). this will return list of utxos, and I am creating a transaction with includeInputs, question how do I choose the right utxo to use? I put all utxos in the includeInputs since it takes an array, but I am getting some weird error, failed due to internal error: c: api.errors.NotEnoughMoneyToSendError: undefined

In my case I have 8 utxos:

[
  {
    "utxo_id": "xxx",
    "tx_hash": "xxx",
    "tx_index": 2,
    "receiver": "xxx",
    "amount": "1000000",
    "assets": []
  },
  {
    "utxo_id": "xxx",
    "tx_hash": "xxx",
    "tx_index": 5,
    "receiver": "xxx",
    "amount": "1000000",
    "assets": []
  },
  {
    "utxo_id": "xxx",
    "tx_hash": "xxx",
    "tx_index": 8,
    "receiver": "xxx",
    "amount": "1827546",
    "assets": [
      {
        "policyId": "xxx",
        "name": "xxx",
        "amount": "168",
        "assetId": "xxx"
      },
      {
        "policyId": "xxx",
        "name": "xxx",
        "amount": "1",
        "assetId": "xxx"
      },
      {
        "policyId": "xxx",
        "name": "xxx",
        "amount": "1",
        "assetId": "xxx"
      },
      {
        "policyId": "xxx",
        "name": "xxx",
        "amount": "1",
        "assetId": "xxx"
      },
      {
        "policyId": "xxx",
        "name": "xxx",
        "amount": "1",
        "assetId": "xxx"
      }
    ]
  },
  {
    "utxo_id": "xxx",
    "tx_hash": "xxx",
    "tx_index": 2,
    "receiver": "xxx",
    "amount": "1000000",
    "assets": []
  },
  {
    "utxo_id": "xxx",
    "tx_hash": "xxx",
    "tx_index": 2,
    "receiver": "xxx",
    "amount": "1000000",
    "assets": []
  },
  {
    "utxo_id": "xxx",
    "tx_hash": "xxx",
    "tx_index": 2,
    "receiver": "xxx",
    "amount": "1000000",
    "assets": []
  },
  {
    "utxo_id": "xxx",
    "tx_hash": "xxx",
    "tx_index": 2,
    "receiver": "xxx",
    "amount": "6999780",
    "assets": []
  },
  {
    "utxo_id": "xxx",
    "tx_hash": "xxx",
    "tx_index": 3,
    "receiver": "xxx",
    "amount": "908502140",
    "assets": []
  }
]
@vsubhuman
Copy link
Contributor

but I am getting some weird error, failed due to internal error: c: api.errors.NotEnoughMoneyToSendError: undefined

This means the funds present in the wallet are not enough to create a transaction with the output amount you are trying to get.

I am creating a transaction with includeInputs

Are you using the .experimental.createTx API?

Can you clarify two things?

  1. How exactly do you include the inputs in the includeInputs?
  2. What outputs or targets are you specifying for the request?

@vsubhuman vsubhuman self-assigned this Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants