Calls the "approve" method on the ERC20 token contract

Keywords: erc20, smart contract, token, swap

Input ports

  • router address: string

    Receives the address of the router contract that is given the approval for the specified token.

  • amount: number

    Receives the amount of tokens to be approved

  • token address: string

    Receives the address of the token to be approved

  • credentials:

      "contract parameters": {
        "contract address": string,
        "abi": {string: any}[],
        "method name": string,
        "parameters": any[],
        "alters": boolean
      "web3_credentials": {"providerUrl": string, "privateKey": string},
      optional "transaction parameters": {string: any}
    }["web3 credentials"]

    Receives the credentials required to interact with the chain.

Output ports

  • result: any

    Sends out the result of approve call.

  • error: {"error": string}

    Sends out any error that happened during approve call.

Last updated