Bitcoin Intents
Prerequisites
Step 1: Request Route
const params = {
fromAddress: "bc1qzea6nfdfmztwjcn8htqn4tk9j3v2uawf4rck0g",
fromChain: "bitcoin",
fromToken: "satoshi",
fromAmount: "70000", // Amount in satoshis
toChain: "42161", // Arbitrum
toToken: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", // USDC
toAddress: "0xC601C9100f8420417A94F6D63e5712C21029525e",
quoteOnly: false
};
// API:
// const routeResult = await axios.post("https://v2.api.squidrouter.com/v2/route", params, { headers: { "x-integrator-id": integratorId } });
// const route = routeResult.data.route;
// const quoteId = route.quoteId;
// SDK:
// const { route, requestId } = await squid.getRoute(params);
// const quoteId = route.estimate.quoteId || route.quoteId;Step 2: Sign the PSBT
Browser Wallet Example (UniSat Wallet)
Node.js / Backend Example (bitcoinjs-lib)
bitcoinjs-lib)Step 3: Broadcast Transaction
Step 4: Status Polling
API Status Polling
SDK Status Polling
Complete Examples
Last updated