typescript-sdk

Home > @3rdweb/sdk > TokenModule

TokenModule class

Create a standard crypto token or crypto currency.

Signature:

export declare class TokenModule extends ModuleWithRoles<Coin> implements ITransferable 

Extends: ModuleWithRoles<Coin>

Implements: ITransferable

Example

import { ThirdwebSDK } from "@3rdweb/sdk";

// You can switch out this provider with any wallet or provider setup you like.
const provider = ethers.Wallet.createRandom();
const sdk = new ThirdwebSDK(provider);
const module = sdk.getTokenModule("");

Properties

Property Modifiers Type Description
moduleType static ModuleType  
roles static readonly [“admin”, “minter”, “pauser”, “transfer”]  

Methods

Method Modifiers Description
allowance(spender)    
allowanceOf(owner, spender)   Get Token Allowance
balance()    
balanceOf(address)   Get Token Balance
burn(amount)   Burn Tokens
burnFrom(from, amount)    
get()    
getAllHolderBalances()   (BETA) Lets you get a all token holders and their corresponding balances - This can be very slow for large numbers of token holders
getDelegation()   Get your voting delegatee address
getDelegationOf(account)    
getValue(value)    
getVoteBalance()   Get your wallet voting power for the current checkpoints
getVoteBalanceOf(account)    
isTransferRestricted()    
mint(amount)    
mintBatchTo(args)   Mint Tokens To Many Wallets
mintTo(to, amount)   Mint Tokens
setAllowance(spender, amount)    
setModuleMetadata(metadata)    
setRestrictedTransfer(restricted)    
totalSupply()    
transfer(to, amount)   Transfer Tokens
transferBatch(args)    
transferFrom(from, to, amount)   Transfer Tokens From Address
transferFromBatch(args)