📔Account
This component holds the base implementation for a tokenbound account. All functions contained within it is compulsory to maintain compatibility with SNIP-14.
The full contract code of the AccountComponent
can be found here.
Functions
owner
owner
fn owner(self: @ComponentState<TContractState>) -> ContractAddress
This function retrieves the owner of the associated NFT.
token
token
fn token(self: @ComponentState<TContractState>) -> (ContractAddress, u256, felt252);
This function returns the contract address and token ID of the associated NFT.
state
state
fn state(self: @ComponentState<TContractState>) -> u256
This function retrieves the current state of the account.
supports_interface
supports_interface
fn supports_interface( self: @ComponentState<TContractState>, interface_id: felt252) -> bool
This function checks if the account supports the tokenbound interface.
Parameters
Name
Type
Description
felt252
interface_id
The interface ID to be checked against.
Returns
bool
: Returns true
If the interface is supported, otherwise false.
Last updated