2

Can you guys help me correctly structure a call to the update_operators in an FA2? I tried everything single combination I can think of, and it still doesn't work

It says the structure should be like this:

Typedef
$update_operators:
        [ $update_operators_item, … ]

$update_operators_item:
        { "add_operator": $add_operator } ||
        { "remove_operator": $remove_operator }

$remove_operator:
        {
          "owner": address,
          "operator": address,
          "token_id": nat
        }

$add_operator:
        {
          "owner": address,
          "operator": address,
          "token_id": nat
        }

$address:
        str  /* Base58 encoded tz or KT address */

$nat:
        int  /* Natural number */

This was my final attempt and I'm stuck:


add_op = token.update_operators({
    "update_operators_item" : {
        "add_operator": {
            "owner": 'tz1...',
            "operator": 'KT1...',
            "token_id": 0,     
        }
    },
})
2
  • I don't use pyTezos so I might not know the answer, but either way can you please explain "it still doesn't work". What does this mean? are you getting an error in your python IDE/texteditor? are you getting an RPC error? is the operation failing on-chain etc. Please update your question and add those details
    – Simon McLoughlin
    Jan 5 at 11:53
  • 2
    $update_operators is an array ;)
    – Groxan
    Jan 5 at 13:08

1 Answer 1

4

As @Groxan pointed out, update_operators entrypoint expects a list:

add_op = token.update_operators([{
    "add_operator": {
        "owner": 'tz1...',
        "operator": 'KT1...',
        "token_id": 0,     
    }
}])
1

Your Answer

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

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