API Reference
Straddl uses RPC-style API calls for some endpoints that correspond to contract function calls, and some REST-like API calls for other resources.
Bridge API
Use this API for workflows directly related to bridging actions. Integrators may use the endpoints to discover fees, routes, and liquidity when presenting quotes to users. There are also endpoints that assist with the construction of transactions for execution on-chain.
Documentation in progress 🚧
RFQ API
Use this API for workflows related to quotes and offchain intents. Integrators and solvers may use these endpoints to broadcast available liquidity or request liquidity for various bridge routes. This API supports quotes for cross chain swaps and arbitrary protocols.
Request a Quote
Requests a quote, which gives the user an offer for a deposit, fill, or a swap.
Endpoint
POST /rfq/quote
Request Body
The request body for a swap should be in JSON format with the following structure:
IMPORTANT
This request format is specifically for a swap.
{
originChainId: 10,
destinationChainId: 42161,
inputToken: "0x4200000000000000000000000000000000000006",
outputToken: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
inputAmount: "120000000000000009",
depositor: "0xEA6b76A8A89643C1AC425b90133CDe527C804e3f",
recipient: "0xEA6b76A8A89643C1AC425b90133CDe527C804e3f",
maker: "0xBe997242bAE790068804a35894EeB15b2a9e34EF", // optional
fillDeadline: 1728977749, // optional
expiry: 1728977689, // optional
txType: "swap",
}Request parameters
| Field | Type | Description | Required |
|---|---|---|---|
| originChainId | integer | The ID of the origin blockchain | Yes |
| destinationChainId | integer | The ID of the destination blockchain | Yes |
| inputToken | string | The contract address of the token to be sent | Yes |
| outputToken | string | The contract address of the token to be received | Yes |
| inputAmount | string | The amount of input tokens to be sent, in wei | Yes |
| depositor | string | The address of the account depositing the funds | Yes |
| recipient | string | The address of the account receiving the funds | Yes |
| maker | string | The address of the maker (liquidity provider) | No |
| fillDeadline | integer | The Unix timestamp deadline for filling the order | No |
| expiry | integer | The Unix timestamp when the quote expires | No |
| txType | string | The type of transaction (e.g., "swap") | Yes |
Response Body
{
isValid: true,
offer: {
originChainId: 10,
destinationChainId: 42161,
inputToken: "0x4200000000000000000000000000000000000006",
outputToken: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
inputAmount: "120000000000000009",
outputAmount: "313178791",
depositor: "0xEA6b76A8A89643C1AC425b90133CDe527C804e3f"
recipient: "0xEA6b76A8A89643C1AC425b90133CDe527C804e3f"
maker: "0xBe997242bAE790068804a35894EeB15b2a9e34EF"
fillDeadline: 1728977749,
expiry: 1728977689,
txType: "swap",
},
tx: {
isSameRecipient: true,
outputERC20: true,
to: "0x6f26Bf09B1C792e3228e5467807a900A503c0281",
from: "0xEA6b76A8A89643C1AC425b90133CDe527C804e3f",
data: "0x7b939232000000000000000000000000EA6b76A8A89643C1AC425b90133CDe527C804e3f000000000000000000000000EA6b76A8A89643C1AC425b90133CDe527C804e3f0000000000000000000000004200000000000000000000000000000000000006000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb900000000000000000000000000000000000000000000000001aa535d3d0c00090000000000000000000000000000000000000000000000000000000012aabaa7000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000Be997242bAE790068804a35894EeB15b2a9e34EF00000000000000000000000000000000000000000000000000000000670e1abf00000000000000000000000000000000000000000000000000000000670e1b5500000000000000000000000000000000000000000000000000000000670e1b55000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000001dc0de0007",
},
quoteId: "423ccff70068614ee9d9512f2d0ddc4b35a3ad29e050def0cc056eb87bdca531",
status: 1,
}Response parameters
| Field | Type | Description |
|---|---|---|
| isValid | boolean | Indicates if the quote is valid |
| offer | object | Contains details of the offer |
| offer.originChainId | integer | The ID of the origin blockchain |
| offer.destinationChainId | integer | The ID of the destination blockchain |
| offer.inputToken | string | The contract address of the input token |
| offer.outputToken | string | The contract address of the output token |
| offer.inputAmount | string | The amount of input tokens, in wei |
| offer.outputAmount | string | The amount of output tokens |
| offer.depositor | string | The address of the depositor |
| offer.recipient | string | The address of the recipient |
| offer.maker | string | The address of the maker (liquidity provider) |
| offer.fillDeadline | integer | The Unix timestamp deadline for filling the order |
| offer.expiry | integer | The Unix timestamp when the quote expires |
| offer.txType | string | The type of transaction (e.g., "swap") |
| tx | object | Contains transaction details |
| tx.isSameRecipient | boolean | Indicates if the recipient is the same as the depositor |
| tx.outputERC20 | boolean | Indicates if the output token is an ERC20 token |
| tx.to | string | The recipient address of the transaction |
| tx.from | string | The sender address of the transaction |
| tx.data | string | The transaction data in hexadecimal format |
| quoteId | string | A unique identifier for the quote |
| status | integer | The current status code of the quote |
Update a Quote
Change the status of a quote that has previously been requested
Endpoint
PUT /rfq/quote
Request Body
The request body for an update should be in JSON format with the following structure:
{
quoteId: "423ccff70068614ee9d9512f2d0ddc4b35a3ad29e050def0cc056eb87bdca531",
action: "canceled",
}Request parameters
| Field | Type | Description | Required |
|---|---|---|---|
| quoteId | string | A unique identifier for the quote | Yes |
| action | string | The current status of the quote | Yes |
Response Body
{
isValid: true
}Response parameters
| Field | Type | Description |
|---|---|---|
| isValid | boolean | Indicates if the update is valid |
Find Quotes
Find quotes on which to make and offer for a deposit, fill, or a swap.
Endpoint
GET /rfq/quotes
Query parameters
The request query parameters for a quote search should use the following structure:
/quotes?txType="deposit"&destinationChainId=42161&tokenSymbol="USDT"Request parameters
| Field | Type | Description | Required |
|---|---|---|---|
| originChainId | integer | The ID of the origin blockchain | No |
| destinationChainId | integer | The ID of the destination blockchain | No |
| tokenSymbol | string | The symbol name of the token to be sent | No |
| inputToken | string | The contract address of the token to be sent | No |
| outputToken | string | The contract address of the token to be received | No |
| inputAmount | string | The amount of input tokens to be sent, in wei | No |
| depositor | string | The address of the account depositing the funds | No |
| recipient | string | The address of the account receiving the funds | No |
| maker | string | The address of the maker (liquidity provider) | No |
| fillDeadline | integer | The Unix timestamp deadline for filling the order | No |
| expiry | integer | The Unix timestamp when the quote expires | No |
| txType | string | The type of transaction (e.g., "swap") | No |
Response parameters
| Field | Type | Description |
|---|---|---|
| n/a | array | Contains the quotes returned |
Make an Offer
Make an offer to complete an order for a deposit, fill, or a swap.
Endpoint
POST /rfq/offer
Request Body
The request body for a swap should be in JSON format with the following structure:
IMPORTANT
This request format is specifically for a fill.
{
quoteId: "95496fdd17f26d31eb18db62e283f9eafb939314969c01ecd4ce90867cf851da",
txType: "fill",
expiry: 1728682882,
fillDeadline: 1728683482,
amount: "1000000000000000000",
fee: "100000000000000",
maker: "0xBe997242bAE790068804a35894EeB15b2a9e34EF",
taker: "0xEA6b76A8A89643C1AC425b90133CDe527C804e3f",
tokenSymbol: "WETH",
originChainId: 42161,
destinationChainId: 8453,
inputToken: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
outputToken: "0x4200000000000000000000000000000000000006",
depositor: "0xEA6b76A8A89643C1AC425b90133CDe527C804e3f",
recipient: "0xEA6b76A8A89643C1AC425b90133CDe527C804e3f",
inputAmount: "1000000000000000000",
outputAmount: "999900000000000000",
}Rebalancer API
Documentation in progress 🚧
Solver API
Documentation in progress 🚧