Introduction
What is Straddl?
Straddle is a service provider for integrators and solvers using intents. Intents are an extremely powerful and flexible way of abstracting complexity away from end users. Straddl brings integrators and solvers together to optimise their workflows and maximise efficiency.
Getting Started
Prerequisites
Basics of blockchain development using a library e.g. web3.js, viem, ethers etc...
Straddl uses a pure HTTP interface, use any API client libraries in your preferred programming language.
Step 1
To find the current fees for an instant bridge call the suggested-fees endpoint.
curl -X GET \
'https://********/v1/bridge/suggested-fees?token=0x4200000000000000000000000000000000000006&destinationChainId=42161&originChainId=10&amount=100000000000000000';Response Body
The response contains various details about the fees as well as additional data on bridge liquidity and solver availability.
{
"estimatedFillTimeSec": 5,
"relayFeeTotal": "28436113482982",
"timestamp": "1729035335",
"spokePoolAddress": "0x6f26Bf09B1C792e3228e5467807a900A503c0281",
"destinationSpokePoolAddress": "0xe35e9842fceaCA96570B734083f4a58e8F7C5f2A",
}Step 2
Call the deposit endpoint updating the parameters using your address and the fee parameters from the suggested-fees response.
curl -L \
'https://********/v1/bridge/functions/deposit?timestamp=<insert timestamp>&relayFeeTotal=<insert relay fee>&tokenSymbol=WETH&destinationChainId=10&originChainId=10&amount=100000000000000000&recipient=<insert your address>'Response Body
The response contains a transaction payload which includes the bridge contract and the calldata required for the deposit transaction.
{
"tx": {
"data": "0x7b93923200000000000000000000000....00000000000",
"to": "0x6f26Bf09B1C792e3228e5467807a900A503c0281"
}
}Step 3
Approve the bridge contract and send your deposit transaction.
import { account
, walletClient } from './config'
const hash = await walletClient.sendTransaction({
account,
to: tx.to,
value: 0n,
data: tx.data,
})Main Features
Flexible Bridge API
Integrators can leverage the bridge API to construct custom deposits tailored for cross chain intents. It supports features such as sending gas, token swaps, and multi-step actions using contract hooks. More advanced use cases are coming soon.
Dynamic Bridge Pricing
The API caters for situations where the cross chain intents execution cost cannot be determined ahead of time. It allows integrators with non-standard requirements to use out-of-band payments for scenarios where offchain oracles cannot be used for fee data.
Offchain RFQ and Private Order Flow
Documentation in progress 🚧
Intent-based Cross Chain Swaps
Documentation in progress 🚧