Simple Native ETH Transfer

This action performs a basic native currency (ETH) transfer. By setting isNativeTransfer: true, we indicate that this is a simple value transfer with no contract function call. Consequently, functionSignature must be an empty string and args must be an empty array. Setting populateCallValueDynamically: true ensures the entire ETH balance from the swap is sent to the specified target address.

Request Body

{
  "actions": [
    {
      "target": "0x718648C8c531F91b528A7757dD2bE813c3940608",
      "functionSignature": "",
      "args": [],
      "value": "0",
      "isNativeTransfer": true,
      "populateCallValueDynamically": true
    }
  ]
}

Create swap approval transaction for ETH transfer

post

Use this endpoint to initiate a crosschain swap from Optimism to Ethereum with a dynamic ETH transfer. It validates balances, approvals, and prepares swap/bridge execution steps. If isNativeTransfer is true and populateCallValueDynamically is true, the value is determined dynamically at execution.

Query parameters
tradeTypestring · enumRequiredExample: exactInputPossible values:
amountstringRequiredExample: 10000000
inputTokenstringRequiredExample: 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
outputTokenstringRequiredExample: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
originChainIdstringRequiredExample: 10
destinationChainIdstringRequiredExample: 1
depositorstringRequiredExample: 0xA4d353BBc130cbeF1811f27ac70989F9d568CeAB
recipientstringRequiredExample: 0xA4d353BBc130cbeF1811f27ac70989F9d568CeAB
Body
Responses
200

Successful response with approval transaction details

application/json
Responseobject
post
POST /api/swap/approval HTTP/1.1
Host: app.across.to
Content-Type: application/json
Accept: */*
Content-Length: 174

{
  "actions": [
    {
      "target": "0x718648C8c531F91b528A7757dD2bE813c3940608",
      "functionSignature": "",
      "args": [],
      "value": "0",
      "isNativeTransfer": true,
      "populateCallValueDynamically": true
    }
  ]
}
{
  "crossSwapType": "anyToBridgeable",
  "amountType": "exactInput",
  "checks": {
    "allowance": {
      "token": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
      "spender": "0x89415a82d909a7238d69094C3Dd1dCC1aCbDa85C",
      "actual": "0",
      "expected": "10000000"
    },
    "balance": {
      "token": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
      "actual": "169942",
      "expected": "10000000"
    }
  },
  "approvalTxns": [
    {
      "chainId": 10,
      "to": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
      "data": "0x095ea7b300000000000000000000000089415a82d909a7238d69094c3dd1dcc1acbda85cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
    }
  ],
  "steps": {
    "originSwap": {
      "tokenIn": {
        "decimals": 6,
        "symbol": "USDC",
        "address": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
        "name": "USD Coin",
        "chainId": 10
      },
      "tokenOut": {
        "address": "0x4200000000000000000000000000000000000006",
        "decimals": 18,
        "symbol": "ETH",
        "chainId": 10
      },
      "inputAmount": "10000000",
      "outputAmount": "2077167226903709",
      "minOutputAmount": "2056395554631000",
      "maxInputAmount": "10000000",
      "swapProvider": {
        "name": "0x",
        "sources": [
          "sushiswap_v3",
          "solidly_v3",
          "uniswap_v3",
          "uniswap_v4"
        ]
      }
    },
    "bridge": {
      "inputAmount": "2056395554631000",
      "outputAmount": "1981008340738506",
      "tokenIn": {
        "address": "0x4200000000000000000000000000000000000006",
        "decimals": 18,
        "symbol": "ETH",
        "chainId": 10
      },
      "tokenOut": {
        "decimals": 18,
        "symbol": "ETH",
        "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "name": "Ether",
        "chainId": 1
      },
      "fees": {
        "totalRelay": {
          "pct": "36659879818707104",
          "total": "75387213892494"
        },
        "relayerCapital": {
          "pct": "99914316852269",
          "total": "205463357018"
        },
        "relayerGas": {
          "pct": "36368594676461460",
          "total": "74788216420851"
        },
        "lp": {
          "pct": "191370825393375",
          "total": "393534114625"
        }
      }
    }
  },
  "inputToken": {
    "decimals": 6,
    "symbol": "USDC",
    "address": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
    "name": "USD Coin",
    "chainId": 10
  },
  "outputToken": {
    "decimals": 18,
    "symbol": "ETH",
    "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "name": "Ether",
    "chainId": 1
  },
  "refundToken": {
    "address": "0x4200000000000000000000000000000000000006",
    "decimals": 18,
    "symbol": "WETH",
    "chainId": 10
  },
  "fees": {
    "total": {
      "amount": "470201",
      "amountUsd": "0.470064117970601103",
      "pct": "47020188712352827",
      "token": {
        "decimals": 6,
        "symbol": "USDC",
        "address": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
        "name": "USD Coin",
        "chainId": 10
      }
    },
    "originGas": {
      "amount": "0",
      "amountUsd": "0.0",
      "token": {
        "chainId": 10,
        "address": "0x0000000000000000000000000000000000000000",
        "decimals": 18,
        "symbol": "ETH"
      }
    },
    "destinationGas": {
      "amount": "74788216420851",
      "amountUsd": "0.359502469042045469",
      "pct": "35960783413744771",
      "token": {
        "chainId": 1,
        "address": "0x0000000000000000000000000000000000000000",
        "decimals": 18,
        "symbol": "ETH"
      }
    },
    "relayerCapital": {
      "amount": "205463357018",
      "amountUsd": "0.000987650029384105",
      "pct": "98793949565633",
      "token": {
        "address": "0x4200000000000000000000000000000000000006",
        "decimals": 18,
        "symbol": "ETH",
        "chainId": 10
      }
    },
    "lpFee": {
      "amount": "393534114625",
      "amountUsd": "0.001891694876955497",
      "pct": "189224930600216",
      "token": {
        "address": "0x4200000000000000000000000000000000000006",
        "decimals": 18,
        "symbol": "ETH",
        "chainId": 10
      }
    },
    "relayerTotal": {
      "amount": "75387213892494",
      "amountUsd": "0.362381813948385034",
      "pct": "36248802293910615",
      "token": {
        "address": "0x4200000000000000000000000000000000000006",
        "decimals": 18,
        "symbol": "ETH",
        "chainId": 10
      }
    },
    "app": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "decimals": 18,
        "symbol": "ETH",
        "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "name": "Ether",
        "chainId": 1
      }
    }
  },
  "inputAmount": "10000000",
  "expectedOutputAmount": "1981008340738506",
  "minOutputAmount": "1981008340738506",
  "expectedFillTime": 8,
  "swapTx": {
    "simulationSuccess": false,
    "chainId": 10,
    "to": "0x89415a82d909a7238d69094C3Dd1dCC1aCbDa85C",
    "data": "0x110560ad000000000000000000000000000000000000000000000000000000000...",
    "maxFeePerGas": "1002303",
    "maxPriorityFeePerGas": "1000000"
  },
  "id": "wnd57-1755908371217-f4dbb194c569"
}

Last updated