typescript-sdk

Home > @3rdweb/sdk > TokenModule > allowanceOf

TokenModule.allowanceOf() method

Get Token Allowance

Signature:

allowanceOf(owner: string, spender: string): Promise<BigNumber>;

Parameters

Parameter Type Description
owner string  
spender string  

Returns:

Promise<BigNumber>

The allowance of one wallet over anothers funds.

Remarks

Get the allowance of one wallet over another’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 connected wallet.

Example

// Address of the wallet who owns the funds
const address = "";

// Address of the wallet to check token allowance
const otherAddress = "0x...";

const allowance = await module.allowanceOf(address, otherAddress);
console.log(allowance);