transfer
params of transferParams -> (list(op), storage upd)
Types
Parameter
Type
Description
Usage
Errors
Last updated
params of transferParams -> (list(op), storage upd)
Last updated
type tokenId is nat
type transferDestination is [@layout:comb] record [
to_ : address;
token_id : tokenId;
amount : nat;
]
type transferParam is [@layout:comb] record [
from_ : address;
txs : list(transferDestination);
]
type transferParams is list(transferParam)const tokenId = 0; // or new BigNumber(0) or "0"
const alice = "tz1..."
const bob = "tz2..."
const yupana = await tezos.contract.at(yTokenAddress);
const operation = await yupana.methods.transfer([
{
from_: alice,
txs: [
{ to_: bob, token_id: tokenId, amount: 0 },
{ to_: alice, token_id: tokenId, amount: 6_000 },
],
},
]).send();
await operation.confirmation();token_id = 0
alice = "tz1..."
bob = "tz2..."
yupana = ContractInterface.from_michelson(code) # or client.contract(contract_address)...
call = yupana.transfer([{ "from_" : alice,
"txs" : [
{
"amount": 0,
"to_": bob,
"token_id": token_id
},
{
"amount": 6_000,
"to_": alice,
"token_id": token_id
}
]
}])
opg = call.inject()