Skip to content

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.

json
{
    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

FieldTypeDescriptionRequired
originChainIdintegerThe ID of the origin blockchainYes
destinationChainIdintegerThe ID of the destination blockchainYes
inputTokenstringThe contract address of the token to be sentYes
outputTokenstringThe contract address of the token to be receivedYes
inputAmountstringThe amount of input tokens to be sent, in weiYes
depositorstringThe address of the account depositing the fundsYes
recipientstringThe address of the account receiving the fundsYes
makerstringThe address of the maker (liquidity provider)No
fillDeadlineintegerThe Unix timestamp deadline for filling the orderNo
expiryintegerThe Unix timestamp when the quote expiresNo
txTypestringThe type of transaction (e.g., "swap")Yes

Response Body

json
{
  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

FieldTypeDescription
isValidbooleanIndicates if the quote is valid
offerobjectContains details of the offer
offer.originChainIdintegerThe ID of the origin blockchain
offer.destinationChainIdintegerThe ID of the destination blockchain
offer.inputTokenstringThe contract address of the input token
offer.outputTokenstringThe contract address of the output token
offer.inputAmountstringThe amount of input tokens, in wei
offer.outputAmountstringThe amount of output tokens
offer.depositorstringThe address of the depositor
offer.recipientstringThe address of the recipient
offer.makerstringThe address of the maker (liquidity provider)
offer.fillDeadlineintegerThe Unix timestamp deadline for filling the order
offer.expiryintegerThe Unix timestamp when the quote expires
offer.txTypestringThe type of transaction (e.g., "swap")
txobjectContains transaction details
tx.isSameRecipientbooleanIndicates if the recipient is the same as the depositor
tx.outputERC20booleanIndicates if the output token is an ERC20 token
tx.tostringThe recipient address of the transaction
tx.fromstringThe sender address of the transaction
tx.datastringThe transaction data in hexadecimal format
quoteIdstringA unique identifier for the quote
statusintegerThe 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:

json
{
    quoteId: "423ccff70068614ee9d9512f2d0ddc4b35a3ad29e050def0cc056eb87bdca531",
    action: "canceled",    
}

Request parameters

FieldTypeDescriptionRequired
quoteIdstringA unique identifier for the quoteYes
actionstringThe current status of the quoteYes

Response Body

json
{
  isValid: true
}

Response parameters

FieldTypeDescription
isValidbooleanIndicates 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:

http
/quotes?txType="deposit"&destinationChainId=42161&tokenSymbol="USDT"

Request parameters

FieldTypeDescriptionRequired
originChainIdintegerThe ID of the origin blockchainNo
destinationChainIdintegerThe ID of the destination blockchainNo
tokenSymbolstringThe symbol name of the token to be sentNo
inputTokenstringThe contract address of the token to be sentNo
outputTokenstringThe contract address of the token to be receivedNo
inputAmountstringThe amount of input tokens to be sent, in weiNo
depositorstringThe address of the account depositing the fundsNo
recipientstringThe address of the account receiving the fundsNo
makerstringThe address of the maker (liquidity provider)No
fillDeadlineintegerThe Unix timestamp deadline for filling the orderNo
expiryintegerThe Unix timestamp when the quote expiresNo
txTypestringThe type of transaction (e.g., "swap")No

Response parameters

FieldTypeDescription
n/aarrayContains 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.

json
{
    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 🚧