Estimate a cross-chain transaction
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
Body
The EIP-155 ID of the chain on which the user wants to execute the transaction.
1
, 137
, 10
, 8453
, 42161
, 421613
An array of ERC-20 tokens expected to land in the user's wallet as a result of the overall transaction.
The EIP-155 ID of the chain from which the user will be funding the transaction.
1
, 137
, 10
, 8453
, 42161
, 421613
The contract address of the ERC-20 token being used to fund the transaction.
The amount of the source token used in the transaction.
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.
The wallet address of the user Peaze will relay the transaction for.
Response
The cost breakdown of the transaction.
The Peaze quote for the requested transaction.
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>"
}
}
}