Private
_chainProtected
contractAllows the specified spender
wallet to transfer the given amount
of tokens to another wallet
Rest
...args: [spender: string, amount: string | number]// Address of the wallet to allow transfers from
const spenderAddress = "0x...";
// The number of tokens to give as allowance
const amount = 100
await contract.setAllowance(spenderAddress, amount);
Rest
...args: [spender: string, amount: string | number]Protected
storageTransfer Tokens
Rest
...args: [to: string, amount: string | number]Transfer tokens from the connected wallet to another wallet.
// Address of the wallet you want to send the tokens to
const toAddress = "0x...";
// The amount of tokens you want to send
const amount = 0.1;
await contract.transfer(toAddress, amount);
Rest
...args: [to: string, amount: string | number]Transfer Tokens To Many Wallets
Rest
...args: [args: { Mint tokens from the connected wallet to many wallets
// Data of the tokens you want to mint
const data = [
{
toAddress: "{{wallet_address}}", // Address to mint tokens to
amount: 100, // How many tokens to mint to specified address
},
{
toAddress: "0x...",
amount: 100,
}
]
await contract.transferBatch(data);
Rest
...args: [args: { Transfer Tokens From Address
Rest
...args: [from: string, to: string, amount: string | number]Transfer tokens from one wallet to another
// Address of the wallet sending the tokens
const fromAddress = "{{wallet_address}}";
// Address of the wallet you want to send the tokens to
const toAddress = "0x...";
// The number of tokens you want to send
const amount = 1.2
// Note that the connected wallet must have approval to transfer the tokens of the fromAddress
await contract.transferFrom(fromAddress, toAddress, amount);
Rest
...args: [from: string, to: string, amount: string | number]Get Token Allowance
The allowance of one wallet over anothers funds.
Get the allowance of a 'spender' wallet over the connected wallet's funds - the allowance of a different address for a token is the amount of tokens that the spender
wallet is allowed to spend on behalf of the connected wallet.
// Address of the wallet to check token allowance
const spenderAddress = "0x...";
const allowance = await contract.allowance(spenderAddress);
Get Token Allowance
The allowance of one wallet over anothers funds.
Get the allowance of one wallet over another wallet's funds - the allowance of a different address for a token is the amount of tokens that the wallet is allowed to spend on behalf of the specified wallet.
// Address of the wallet who owns the funds
const owner = "{{wallet_address}}";
// Address of the wallet to check token allowance
const spender = "0x...";
const allowance = await contract.allowanceOf(owner, spender);
Get Token Balance for the currently connected wallet
The balance of a specific wallet.
Get a wallets token balance.
const balance = await contract.balance();
Get Token Balance
The balance of a specific wallet.
Get a wallets token balance.
// Address of the wallet to check token balance
const walletAddress = "{{wallet_address}}";
const balance = await contract.balanceOf(walletAddress);
The total supply for this token
Get how much supply has been minted
const balance = await contract.totalSupply();
Generated using TypeDoc
Standard ERC20 Token functions
Remarks
Basic functionality for a ERC20 contract that handles all unit transformation for you.
Example