transfer
params of transferParams -> (list(op), storage upd)
Implementation of FA2 interface method, more info about FA2 transfer you can read in the link below.
Types
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)
Parameter
Type
Description
from_
address
account transfer tokens from
amount
nat
amount of tokens
to_
address
account transfer tokens to
token_id
nat
token identifier
Usage
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();
Errors
FA2_NOT_OPERATOR
-sender
is notoperator
offrom_
account.yToken/token-taken-as-collateral
- when user entered market (enterMarket) for this token.FA2_TOKEN_UNDEFINED
- token identifier is not assigned to any known tokens.FA2_INSUFFICIENT_BALANCE
- when transferamount
greater than accountfrom_
balance (alsounderflow/srcBalance
make the same check butunderflow
is unreachable)
Last updated