approveToken method
Future<ISendUserOperationResponse>
approveToken(
- EthereumAddress tokenAddress,
- EthereumAddress spender,
- BigInt amount, [
- TxOptions? options,
Approves the spender
to withdraw or transfer a certain amount
of tokens on behalf of the user's address.
tokenAddress
- Address of the token contract.
spender
- Address which will spend the tokens.
amount
- Amount of tokens to approve.
options
- Additional transaction options.
Implementation
Future<ISendUserOperationResponse> approveToken(
EthereumAddress tokenAddress,
EthereumAddress spender,
BigInt amount, [
TxOptions? options,
]) {
return _executeTokenOperation(
tokenAddress,
spender,
amount,
ContractsUtils.encodeERC20ApproveCall,
options,
);
}