Skip to main content

sdk.erc20base.approve

Home > @openformat/sdk > ERC20Base > approve

ERC20Base.approve() method

Approves a spender to spend a certain amount of tokens on behalf of the current account.

approve

Signature:

approve(params: ERC20ApproveParams): Promise<ContractReceipt>;

Parameters

ParameterTypeDescription
paramsERC20ApproveParams

Returns:

Promise<ContractReceipt>

{Promise<ContractReceipt>} The transaction receipt.

Exceptions

{Error} Throws an error if there was an issue with validating the wallet or the amount, or if there was an error processing the transaction.