Reference
Estimate a single-chain transaction
POST
/
v1
/
single-chain
/
estimate
Authorization
Body
curl --request POST \
--url https://api.peaze.com/api/v1/single-chain/estimate \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '{
"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
headerrequiredBody
application/json
expectedERC20Tokens
string[]
requiredAn array of ERC-20 tokens expected to land in the user's wallet as a result of the overall transaction.
sourceChain
enum<number>
requiredThe 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
requiredThe amount of the source token used in the transaction.
transactions
object[]
requiredThe 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
requiredThe wallet address of the user Peaze will relay the transaction for.
Response
200 - application/json
costSummary
object
requiredThe cost breakdown of the transaction.
quote
object
requiredThe Peaze quote for the requested transaction.
curl --request POST \
--url https://api.peaze.com/api/v1/single-chain/estimate \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '{
"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>"
}
}
}