Erc20 class
Standard ERC20 Token functions
Example
const contract = await sdk.getContract("{{contract_address}}");
await contract.token.transfer(walletAddress, amount);
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(contractWrapper, storage, options) | Constructs a new instance of the Erc20 class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
burn | Erc20Burnable | undefined | ||
contractWrapper | ContractWrapper<T> | ||
drop | Erc20Droppable | undefined | ||
featureName | "ERC20" | ||
mint | Erc20Mintable | undefined | Mint tokens | |
options | SDKOptions | ||
signature | Erc20SignatureMintable | undefined | ||
storage | IStorage |
Methods
Method | Modifiers | Description |
---|---|---|
allowance(spender) | Get Token Allowance | |
allowanceOf(owner, spender) | Get Token Allowance | |
balance() | Get Token Balance for the currently connected wallet | |
balanceOf(address) | Get Token Balance | |
get() | Get the token Metadata (name, symbol, etc...) | |
setAllowance(spender, amount) | Allows the specified spender wallet to transfer the given amount of tokens to another wallet | |
totalSupply() | The total supply for this Token | |
transfer(to, amount) | Transfer Tokens | |
transferBatch(args) | Transfer Tokens To Many Wallets | |
transferFrom(from, to, amount) | Transfer Tokens From Address |
Signature:
export declare class Erc20<T extends TokenERC20 | DropERC20 | BaseERC20 = BaseERC20 | BaseSignatureMintERC20> implements UpdateableNetwork, DetectableFeature
Implements: UpdateableNetwork, DetectableFeature
Remarks
Basic functionality for a ERC20 contract that handles all unit transformation for you.