Skip to main content

TokenApprovals

Calls

erc1155ApprovalForAll

Set approval for an account (or contract) to transfer any tokens from an SFT collection mapping(address => mapping(address => bool)) private _operatorApprovals;

Namespace

api.tx.tokenApprovals.erc1155ApprovalForAll

Type

function erc1155ApprovalForAll(
caller: SeedPrimitivesSignatureAccountId20,
operator_account: SeedPrimitivesSignatureAccountId20,
collection_uuid: u32,
approved: bool
)

erc20Approval

Set approval for an account to transfer an amount of tokens on behalf of the caller Mapping from caller to spender and amount mapping(address => mapping(address => uint256)) private _allowances;

Namespace

api.tx.tokenApprovals.erc20Approval

Type

function erc20Approval(
caller: SeedPrimitivesSignatureAccountId20,
spender: SeedPrimitivesSignatureAccountId20,
asset_id: u32,
amount: u128
)

erc20UpdateApproval

Removes an approval over an account and asset_id mapping(address => mapping(address => uint256)) private _allowances;

Namespace

api.tx.tokenApprovals.erc20UpdateApproval

Type

function erc20UpdateApproval(
caller: SeedPrimitivesSignatureAccountId20,
spender: SeedPrimitivesSignatureAccountId20,
asset_id: u32,
amount: u128
)

erc721Approval

Set approval for a single NFT Mapping from token_id to operator clears approval on transfer mapping(uint256 => address) private _tokenApprovals;

Namespace

api.tx.tokenApprovals.erc721Approval

Type

function erc721Approval(
caller: SeedPrimitivesSignatureAccountId20,
operator_account: SeedPrimitivesSignatureAccountId20,
token_id: (u32,u32)
)

erc721ApprovalForAll

Set approval for an account (or contract) to transfer any tokens from a collection mapping(address => mapping(address => bool)) private _operatorApprovals;

Namespace

api.tx.tokenApprovals.erc721ApprovalForAll

Type

function erc721ApprovalForAll(
caller: SeedPrimitivesSignatureAccountId20,
operator_account: SeedPrimitivesSignatureAccountId20,
collection_uuid: u32,
approved: bool
)

erc721RemoveApproval

Public method which allows users to remove approvals on a token they own

Namespace

api.tx.tokenApprovals.erc721RemoveApproval

Type

function erc721RemoveApproval(
token_id: (u32,u32)
)

Storage

eRC1155ApprovalsForAll

Namespace

api.query.tokenApprovals.eRC1155ApprovalsForAll

Type

function eRC1155ApprovalsForAll(
SeedPrimitivesSignatureAccountId20,
(u32,SeedPrimitivesSignatureAccountId20)
): Option<bool>

eRC20Approvals

Namespace

api.query.tokenApprovals.eRC20Approvals

Type

function eRC20Approvals(
(SeedPrimitivesSignatureAccountId20,u32),
SeedPrimitivesSignatureAccountId20
): Option<u128>

eRC721Approvals

Namespace

api.query.tokenApprovals.eRC721Approvals

Type

function eRC721Approvals(
(u32,u32)
): Option<SeedPrimitivesSignatureAccountId20>

eRC721ApprovalsForAll

Namespace

api.query.tokenApprovals.eRC721ApprovalsForAll

Type

function eRC721ApprovalsForAll(
SeedPrimitivesSignatureAccountId20,
(u32,SeedPrimitivesSignatureAccountId20)
): Option<bool>

undefined## Errors

AlreadyApproved

Address is already approved

Namespace

api.errors.tokenApprovals.AlreadyApproved

ApprovalDoesntExist

There is no approval set for this token

Namespace

api.errors.tokenApprovals.ApprovalDoesntExist

ApprovedAmountTooLow

The caller is not approved for the requested amount

Namespace

api.errors.tokenApprovals.ApprovedAmountTooLow

CallerNotApproved

The caller isn't approved for any amount

Namespace

api.errors.tokenApprovals.CallerNotApproved

CallerNotOperator

The caller account can't be the same as the operator account

Namespace

api.errors.tokenApprovals.CallerNotOperator

NoToken

The token doesn't exist

Namespace

api.errors.tokenApprovals.NoToken

NotTokenOwner

The account is not the owner of the token

Namespace

api.errors.tokenApprovals.NotTokenOwner

NotTokenOwnerOrApproved

The account is not the owner of the token or an approved account

Namespace

api.errors.tokenApprovals.NotTokenOwnerOrApproved

undefined