Burn Tokens
Rest
...args: [amount: string | number]Burn tokens held by the connected wallet
// The amount of this token you want to burn
const amount = 1.2;
await contract.burnTokens(amount);
Rest
...args: [amount: string | number]Burn Tokens
Rest
...args: [holder: string, amount: string | number]Burn tokens held by the specified wallet
// Address of the wallet sending the tokens
const holderAddress = "{{wallet_address}}";
// The amount of this token you want to burn
const amount = 1.2;
await contract.burnFrom(holderAddress, amount);
Rest
...args: [holder: string, amount: string | number]Protected
contractAlpha
Lets you delegate your voting power to the delegateeAddress
Rest
...args: [delegateeAddress: string]Rest
...args: [delegateeAddress: string]Mint Tokens for the connected wallet
Rest
...args: [amount: string | number]See Token.mintTo
Rest
...args: [amount: string | number]Mint Tokens To Many Wallets
Rest
...args: [args: { Mint tokens to many wallets in one transaction.
// Data of the tokens you want to mint
const data = [
{
toAddress: "{{wallet_address}}", // Address to mint tokens to
amount: 0.2, // How many tokens to mint to specified address
},
{
toAddress: "0x...",
amount: 1.4,
}
]
await contract.mintBatchTo(data);
Rest
...args: [args: { Mint Tokens
Rest
...args: [to: string, amount: string | number]Mint tokens to a specified address.
const toAddress = "{{wallet_address}}"; // Address of the wallet you want to mint the tokens to
const amount = "1.5"; // The amount of this token you want to mint
await contract.mintTo(toAddress, amount);
Rest
...args: [to: string, amount: string | number]Allows 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]Signature Minting
Generate tokens that can be minted only with your own signature, attaching your own set of mint conditions.
// see how to craft a payload to sign in the `contract.signature.generate()` documentation
const signedPayload = contract.signature.generate(payload);
// now anyone can mint the tokens
const tx = contract.signature.mint(signedPayload);
const receipt = tx.receipt; // the mint transaction receipt
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]Static
contractGet 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);
Construct a mint transaction without executing it. This is useful for estimating the gas cost of a mint transaction, overriding transaction options and having fine grained control over the transaction execution.
The amount of tokens you want to mint
Use contract.mint.prepare(...args)
instead
Get your wallet voting power for the current checkpoints
the amount of voting power in tokens
The total supply for this token
Get how much supply has been minted
const balance = await contract.totalSupply();
Generated using TypeDoc
Create a standard crypto token or cryptocurrency.
Example