0

I get an unexpected arguments error while trying to make a transfer endpoint call.

my_contract.transfer([{
"transfer_item":
    {
      "from_": "tz1...",
      "txs": [{
            "txs_item": 
                {
                    "to_": "tz1...",
                    "token_id": 0,
                    "amount": 5
                }
        
        }]
    }
}])

The structure should look like this:

$transfer_item:
    {
      "from_": address,
      "txs": [ $txs_item, … ]
    }

$txs_item:
        {
          "to_": address,
          "token_id": nat,
          "amount": nat
        }

I'm unsure if I nested it wrong or where I made the mistake.

1
  • Just to confirm, you're trying to transfer an FA2 token, right? May 10, 2023 at 11:28

1 Answer 1

0

Here is the correct format of the argument to transfer an FA2 token:

my_contract.transfer([{
    "from_": "tz1...",
    "txs": [{
        "to_": "tz1...",
        "token_id": 0,
        "amount": 5
    }]
}])

So, you don't need to pass the names transfer_item and txs_item.

2
  • nice thank you so much!
    – Joel
    May 10, 2023 at 11:33
  • You're welcome :) May 10, 2023 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.