AddLiquidityETH

[blockchain/ethereum/Uniswap/v2/Router/AddLiquidityETH]


Calls "addLiquidityETH" method on Uniswap V2 Router contract


Input ports

  • tokenA:

    {"address": string, "desiredAmount": number, optional "minimalAmount": number}

    Receives parameters for tokenA.

    • address: the address of the token

    • desiredAmount: the (maximal) amount we want to add to the liquidity pool in tokenA

    • minimalAmount: the minimal amount we want to add to the liquidity pool in tokenA, if the current exchange ratio implies an amount smaller than that, the operation should fail

  • ETH:

    {"desiredAmount": number, optional "minimalAmount": number}

    Receives parameters for ETH.

    • desiredAmount: the (maximal) amount we want to add to the liquidity pool in ETH

    • minimalAmount: the minimal amount we want to add to the liquidity pool in tokenA, if the current exchange ratio implies an amount smaller than that, the operation should fail

  • liquidity token to: string

    Receives address to send liquidity tokens to

  • deadline: number

    Receives deadline for the transaction (future unix timestamp)

  • router contract: {"address": string, "abi": {string: any}[]}

    Receives parameters of the Uniswap V2 Router contract to interact with

  • 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 credentials for the operation

Output ports

  • result: any

    Sends out the result of addLiquiditiyETH call.

  • error: {"error": string}

    Sends out any error that happened during addLiquidityETH call.

Last updated