update_operators
params of updateOperatorParams -> (list(op), storage upd)
Types
Parameter
Type
Description
Usage
Errors
Last updated
params of updateOperatorParams -> (list(op), storage upd)
Last updated
type tokenId is nat
type operatorParam is [@layout:comb] record [
owner : address;
operator : address;
token_id : tokenId;
]
type updateOperatorParam is
| Add_operator of operatorParam // adds operator
| Remove_operator of operatorParam // removes operator
type updateOperatorParams is list(updateOperatorParam)const tokenId = 0; // or new BigNumber(0) or "0"
const alice = "tz1..."
const bob = "tz2..."
const peter = "tz3..."
const yupana = await tezos.contract.at(yTokenAddress);
const operation = await yupana.methods.update_operators([
{
add_operator: {
owner: alice,
operator: peter,
token_id: tokenId,
},
},
{
remove_operator: {
owner: alice,
operator: bob,
token_id: tokenId,
},
}
]).send();
await operation.confirmation();token_id = 0
alice = "tz1..."
bob = "tz2..."
peter = "tz3..."
yupana = ContractInterface.from_michelson(code) # or client.contract(contract_address)...
call = yupana.update_operators([{
"add_operator": {
"owner": alice,
"operator": peter,
"token_id": token_id,
},
},
{
"remove_operator": {
"owner": alice,
"operator": bob,
"token_id": token_id,
},
}
])
opg = call.inject()