POST
/
v1
/
cross-chain
/
estimate
Authorization
Body
curl --request POST \
  --url https://api.peaze.com/api/v1/cross-chain/estimate \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <x-api-key>' \
  --data '{
  "destinationChain": 1,
  "expectedERC20Tokens": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "sourceChain": 1,
  "sourceToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "tokenAmount": "10000",
  "transactions": [
    {
      "data": "0x2901320",
      "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "value": "10000"
    }
  ],
  "userAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}'
{
  "costSummary": {
    "baseAmount": 99,
    "gasCost": 0.5,
    "peazeFee": 0.5,
    "sourceToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "totalAmount": 100
  },
  "quote": {
    "fundingTypedData": {
      "domain": {
        "name": "<string>",
        "verifyingContract": "<string>",
        "version": "<string>"
      },
      "primaryType": "<string>"
    },
    "general": {
      "destinationChain": 1,
      "gasUsedOnDst": "<string>",
      "hmac": "<string>",
      "quoteDeadline": "<string>",
      "sourceChain": 1,
      "sourceToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "txValue": "<string>"
    },
    "peazeTypedData": {
      "domain": {
        "name": "<string>",
        "verifyingContract": "<string>",
        "version": "<string>"
      },
      "primaryType": "<string>"
    }
  }
}

Authorizations

X-Api-Key
string
headerrequired

Body

application/json
destinationChain
enum<number>
required

The EIP-155 ID of the chain on which the user wants to execute the transaction.

Available options:
1,
137,
10,
8453,
42161,
421613
expectedERC20Tokens
string[]
required

An array of ERC-20 tokens expected to land in the user's wallet as a result of the overall transaction.

sourceChain
enum<number>
required

The EIP-155 ID of the chain from which the user will be funding the transaction.

Available options:
1,
137,
10,
8453,
42161,
421613
sourceToken
string

The contract address of the ERC-20 token being used to fund the transaction.

tokenAmount
string
required

The amount of the source token used in the transaction.

transactions
object[]
required

The details of the transactions to be executed from the Peaze contract. The transaction will begin with funding the contract with the user's source token ERC-20 so that the protocol can execute the transaction and then send the output tokens to the user.

userAddress
string
required

The wallet address of the user Peaze will relay the transaction for.

Response

200 - application/json
costSummary
object
required

The cost breakdown of the transaction.

quote
object
required

The Peaze quote for the requested transaction.