bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 27쪽 중 13쪽
## Step 4: Status Polling
You must poll the status API to confirm the completion of the swap.
> \[!WARNING] For all Squid Intent transactions, **you must include the `quoteId` in the status query parameters.** If `quoteId` is omitted, the transaction cannot be correlated with the Intent and will be automatically refunded on the Bitcoin chain after 15 minutes.
#### API Status Polling
```typescript
const getStatus = async (txHash: string, quoteId: string) => {
const result = await axios.get("https://v2.api.squidrouter.com/v2/status", {
params: {
transactionId: txHash,
fromChainId: "bitcoin",
toChainId: "42161",
quoteId: quoteId // Required for Squid Intents
},
headers: {
"x-integrator-id": integratorId
}
});
return result.data;
};
```
#### SDK Status Polling
```typescript
const status = await squid.getStatus({
transactionId: txHash,
requestId: requestId,
integratorId: integratorId,
fromChainId: "bitcoin",
toChainId: "42161",
quoteId: quoteId // Required for Squid Intents
});
```
***
## Complete Examples
Ready-to-run integration examples are available in our GitHub repository:
* **API Example**: [Bitcoin to EVM Intents API Sample](https://github.com/0xsquid/examples/tree/main/V2/api/bitcoinToEVM_Intents)
* **SDK Example**: [Bitcoin to EVM Intents SDK Sample](https://github.com/0xsquid/examples/tree/main/V2/sdk/bitcoinToEVM_Intents)
# XRPL Integration
Integrate cross-chain swaps to, from, and within the XRP Ledger using Squid. XRPL support is powered by [**Squid Intents**](/api-and-sdk-integration/coral-intent-swaps) — Squid's intent-based execution protocol for fast, solver-driven cross-chain settlement.
> **Squid Intents must be enabled on your integrator ID.** Reach out to the Squid team to request Squid Intents access before integrating with XRPL.
***
## XRPL Parameters
| Parameter | Value |
| ------------ | -------------- |
| **Chain ID** | `xrpl-mainnet` |
### Supported Tokens
The following tokens are currently supported on XRPL via Squid Intents:
| Token | Address |
| --------- | ----------------------------------------------------------------------------- |
| **XRP** | `xrp` |
| **RLUSD** | `524c555344000000000000000000000000000000.rmxckbedwqr76quhesumdegf4b9xj8m5de` |
| **SOIL** | `534F494C00000000000000000000000000000000.rfmS3zqrQrka8wVyhXifEeyTwe8AMz2Yhw` |
| **USDC** | `5553444300000000000000000000000000000000.rGm7WCVp9gb4jZHWTEtGUr4dd74z2XuWhE` |
***
## Integration Options
Choose the integration method that best fits your use case:
### [Swap Widget](/api-and-sdk-integration/chain-integration-guides/xrpl-integration/swap-widget)
A full-featured, drop-in cross-chain swap UI. The Swap Widget gives users complete flexibility to select their source chain and token, then swap into any supported XRPL token.
<figure><img src="https://4247625265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtXbXyuWIO2PwzNc5Dets%2Fuploads%2FFQwNR6TU2BUOhlQEuMTo%2FScreenshot%202026-06-11%20at%2012.34.54%E2%80%AFAM.png?alt=media&token=a9e7d2f6-117a-495b-8ee7-7791b26c9477" alt=""><figcaption></figcaption></figure>
**Best for:**
* dApps that want a ready-made swap interface with minimal dev effort
* Flows where the user chooses both the source and destination tokens
* Prototyping and testing XRPL swaps via [Widget Studio](https://studio.squidrouter.com/)
***
### [Payment Widget (Deposit Widget)](/api-and-sdk-integration/chain-integration-guides/xrpl-integration/payment-widget)
A streamlined deposit and payment flow where the destination is fixed to XRPL. The Payment Widget supports two modes: **deposit** (user-entered amount) for account funding, and **payment** (fixed amount) for checkout and invoice flows.
<figure><img src="https://4247625265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtXbXyuWIO2PwzNc5Dets%2Fuploads%2FSP5vCCHZcz46lkoHHOuu%2FScreenshot%202026-06-11%20at%2012.36.25%E2%80%AFAM.png?alt=media&token=3d2e948f-20bb-44b4-8931-6146d2f1d912" alt=""><figcaption></figcaption></figure>
**Best for:**
* Accepting cross-chain deposits into an XRPL address
* Checkout and invoice payment flows with a fixed amount (e.g., pay 50 RLUSD)
* On-ramp flows where users fund an XRPL account from any supported chain
***
### [API & SDK](/api-and-sdk-integration/chain-integration-guides/xrpl-integration/api-and-sdk)
Direct integration with Squid's routing API and TypeScript SDK for full control over the swap lifecycle. Build custom UIs and backend flows with complete flexibility over routing, execution, and status tracking.
**Best for:**
* Custom swap interfaces and backend integrations
* Programmatic routing (e.g., bots, automated flows)
* Advanced use cases requiring hooks, exact output, or custom transaction handling
***
## Transaction Types
XRPL routes use the `DEPOSIT_ADDRESS_CALLDATA` transaction type. This applies to:
* **EVM → XRPL** — Direct route, no DEX swap on source
* **XRPL → EVM** — Direct route from XRPL to any EVM chain
* **XRPL → XRPL** — Same-chain swaps between XRPL tokens
The route response will return a `transactionRequest` containing the deposit address and calldata. Transfer the specified amount to the deposit address to initiate the swap.
For a full reference of all transaction types across all chains, see the [Transaction Types](/api-and-sdk-integration/key-concepts/transaction-types) page.
# Swap Widget
The fastest way to add XRPL swaps to your application is through the Squid Swap Widget — a drop-in React component that provides a full cross-chain swap interface. Users can select any source chain and token and swap into XRPL tokens like XRP, RLUSD, or SOIL.
You can prototype and customize your widget configuration interactively using [**Widget Studio**](https://studio.squidrouter.com/).
***
## Locking Destination to XRPL
To configure the widget so the destination is always XRPL, use the `initialAssets`, `availableChains`, and `availableTokens` configuration options:
```jsx
<SquidWidget
config={{
integratorId: "<your-integrator-id>",
apiUrl: "https://v2.api.squidrouter.com",
initialAssets: {
to: {
address: "xrp",
chainId: "xrpl-mainnet",
},
},
availableChains: {
destination: ["xrpl-mainnet"],
},
availableTokens: {
destination: {
"xrpl-mainnet": [
"xrp",
"524c555344000000000000000000000000000000.rmxckbedwqr76quhesumdegf4b9xj8m5de",
"534F494C00000000000000000000000000000000.rfmS3zqrQrka8wVyhXifEeyTwe8AMz2Yhw",
"5553444300000000000000000000000000000000.rGm7WCVp9gb4jZHWTEtGUr4dd74z2XuWhE",
],
},
},
// ... other configuration options
}}
/>
```
This configuration:
* Sets the default destination token to XRP on XRPL
* Restricts the destination chain selector to XRPL only
* Limits destination token choices to XRP, RLUSD, and SOIL
* Leaves the source chain and token open for the user to select
***
## Locking Source to XRPL
To allow users to swap **from** XRPL to any destination, flip the configuration:
```jsx
<SquidWidget
config={{
integratorId: "<your-integrator-id>",
apiUrl: "https://v2.api.squidrouter.com",
initialAssets: {
from: {
address: "xrp",
chainId: "xrpl-mainnet",
},
},
availableChains: {
source: ["xrpl-mainnet"],
},
availableTokens: {
source: {
"xrpl-mainnet": [
"xrp",
"524c555344000000000000000000000000000000.rmxckbedwqr76quhesumdegf4b9xj8m5de",
"534F494C00000000000000000000000000000000.rfmS3zqrQrka8wVyhXifEeyTwe8AMz2Yhw",
"5553444300000000000000000000000000000000.rGm7WCVp9gb4jZHWTEtGUr4dd74z2XuWhE",
],
},
},
// ... other configuration options
}}
/>
```
***
## Installation & Setup
For full installation instructions, framework-specific guides, and theming options, see the main Swap Widget documentation:
* [Getting Started](/widget-integration/add-a-widget/widget/getting-started)
* [Installing the Widget](/widget-integration/add-a-widget/widget/installing-the-widget)
* [Customization Guide](/widget-integration/add-a-widget/widget/customization-guide)
***
## Next Steps
* Use [Widget Studio](https://studio.squidrouter.com/) to visually configure and preview your widget
* Need a fixed-amount payment or deposit flow instead? See the [Payment Widget](/api-and-sdk-integration/chain-integration-guides/xrpl-integration/payment-widget)
* For full programmatic control, see the [API & SDK](/api-and-sdk-integration/chain-integration-guides/xrpl-integration/api-and-sdk) guide
# Payment Widget
The Squid Deposit Widget provides a streamlined deposit and payment flow for accepting cross-chain funds into an XRPL address. Unlike the Swap Widget, the destination is fixed by you (the integrator) — users only choose their source chain and token.
The widget supports two modes:
* **`deposit`** — The user enters the amount to send. Use this for account funding, top-ups, and any open-ended deposit flow.
* **`payment`** — You fix the amount. Use this for checkout, invoices, and pay-this-amount flows.
You can prototype and customize your widget configuration interactively using the [**Widget Studio**](https://studio.squidrouter.com/).
***
## Installation
Install the Deposit Widget package:
```bash
npm install @0xsquid/deposit-widget
```
Or with yarn:
```bash
yarn add @0xsquid/deposit-widget
```
For framework-specific setup (React, Next.js, Vite), see the [Deposit Widget installation guides](/widget-integration/add-a-widget/deposit-widget/installing-the-widget).
***
## Configuration for XRPL
The Deposit Widget takes a single `config` prop, typed as `DepositConfig`. To target XRPL, set the `destinationToken.chainId` to `"xrpl-mainnet"` and the `destinationToken.address` to one of the supported XRPL token addresses.
### Supported XRPL Destination Tokens
| Token | Address |
| --------- | ----------------------------------------------------------------------------- |
| **XRP** | `xrp` |
| **RLUSD** | `524c555344000000000000000000000000000000.rmxckbedwqr76quhesumdegf4b9xj8m5de` |
| **SOIL** | `534F494C00000000000000000000000000000000.rfmS3zqrQrka8wVyhXifEeyTwe8AMz2Yhw` |
| **USDC** | `5553444300000000000000000000000000000000.rGm7WCVp9gb4jZHWTEtGUr4dd74z2XuWhE` |
### Config Fields
| Field | Type | Required | Description |
| -------------------------- | ------------------------ | --------------------- | --------------------------------------------------------------------------------------------------- |
| `mode` | `"deposit" \| "payment"` | ✅ | Selects the widget flow. In `"payment"` mode, `amount` is required. |
| `amount` | `string` | ✅ (payment mode only) | Fixed amount the user will pay, in destination-token units (human-readable string, e.g. `"50.00"`). |
| `destinationAddress` | `string` | ✅ | The XRPL address that receives the deposit (e.g. `"rYourXRPLAddress"`). |
| `destinationToken.address` | `string` | ✅ | Token address on XRPL (see table above). |
| `destinationToken.chainId` | `string` | ✅ | Set to `"xrpl-mainnet"` for XRPL. |
| `integrator.id` | `string` | ✅ | Your Integrator ID. |
| `integrator.name` | `string` | ✅ | Displayed in the widget header. |
| `integrator.logoUrl` | `string` | ✅ | URL of your logo, displayed alongside the name. |
| `apiUrl` | `string` | ❌ | Override the Squid API endpoint. Defaults to Squid's production API. |
| `theme` | `Theme` | ❌ | Theme object for visual customization. |
| `themeType` | `"light" \| "dark"` | ❌ | Base palette. Defaults to `"light"`. |
***
## Deposit Mode — Fund an XRPL Account
Use deposit mode when the user chooses how much to send. This is ideal for account funding, top-ups, or open-ended deposits.
### Deposit XRP
```tsx
import { DepositWidget, type DepositConfig } from "@0xsquid/deposit-widget";
const config: DepositConfig = {
mode: "deposit",
destinationAddress: "rYourXRPLAddress",
destinationToken: {
address: "xrp",
chainId: "xrpl-mainnet",
},
integrator: {
id: "<your-integrator-id>",
name: "Your App",
logoUrl: "https://your.app/logo.png",
},
};
function App() {
return <DepositWidget config={config} />;
}
```
### Deposit RLUSD
```tsx
const config: DepositConfig = {
mode: "deposit",
destinationAddress: "rYourXRPLAddress",
destinationToken: {
address: "524c555344000000000000000000000000000000.rmxckbedwqr76quhesumdegf4b9xj8m5de",
chainId: "xrpl-mainnet",
},
integrator: {
id: "<your-integrator-id>",
name: "Your App",
logoUrl: "https://your.app/logo.png",
},
};
```
***
## Payment Mode — Fixed-Amount Payments on XRPL
Use payment mode when you set the exact amount. This is ideal for checkout flows, invoices, and pay-this-amount scenarios.
### Pay 50 RLUSD to an XRPL Address
```tsx
import { DepositWidget, type DepositConfig } from "@0xsquid/deposit-widget";
const config: DepositConfig = {
mode: "payment",
amount: "50.00",
destinationAddress: "rYourXRPLAddress",
destinationToken: {
address: "524c555344000000000000000000000000000000.rmxckbedwqr76quhesumdegf4b9xj8m5de",
chainId: "xrpl-mainnet",
},
integrator: {
id: "<your-integrator-id>",
name: "Your App",
logoUrl: "https://your.app/logo.png",
},
};
function App() {
return <DepositWidget config={config} />;
}
```
### Pay 100 XRP
```tsx
const config: DepositConfig = {
mode: "payment",
amount: "100",
destinationAddress: "rYourXRPLAddress",
destinationToken: {
address: "xrp",
chainId: "xrpl-mainnet",
},
integrator: {
id: "<your-integrator-id>",
name: "Your App",
logoUrl: "https://your.app/logo.png",
},
};
```
***
## Theme Customization
To customize the widget's appearance:
1. Use the [Widget Studio](https://studio.squidrouter.com/) to generate a custom theme.
2. Copy the generated `theme` (and `themeType`) and paste them into your `config`.
```tsx
const config: DepositConfig = {
mode: "deposit",
destinationAddress: "rYourXRPLAddress",
destinationToken: {
address: "xrp",
chainId: "xrpl-mainnet",
},
integrator: {
id: "<your-integrator-id>",
name: "Your App",
logoUrl: "https://your.app/logo.png",
},
themeType: "dark",
theme: {
// Your custom theme overrides
},
};
```
***
## Next Steps
* For full Deposit Widget documentation (installation, theming, all config options), see the [Deposit Widget docs](/widget-integration/add-a-widget/deposit-widget)
* Need a full swap UI where the user picks both source and destination? See the [Swap Widget](/api-and-sdk-integration/chain-integration-guides/xrpl-integration/swap-widget)
* For programmatic control, see the [API & SDK](/api-and-sdk-integration/chain-integration-guides/xrpl-integration/api-and-sdk) guide
# API & SDK
Integrate XRPL cross-chain swaps directly using Squid's routing API or TypeScript SDK. This gives you full control over the swap lifecycle — routing, execution, and status tracking — so you can build custom UIs or backend flows.
***
## API Integration
### Route to XRPL (EVM → XRPL)
To route from an EVM chain to XRPL, set `toChain` to `xrpl-mainnet` and `toToken` to one of the supported XRPL token addresses.
```typescript
const params = {
fromAddress: "0xYourEVMAddress",
fromChain: "8453", // Base
fromToken: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // ETH
fromAmount: "1000000000000000", // Amount in wei
toChain: "xrpl-mainnet",
toToken: "xrp",
toAddress: "YourXRPLAddress",
quoteOnly: false,
};
const routeResult = await axios.post(
"https://v2.api.squidrouter.com/v2/route",
params,
{
headers: {
"x-integrator-id": "<your-integrator-id>",
"Content-Type": "application/json",
},
}
);
const route = routeResult.data.route;
const quoteId = route.quoteId; // Required for status tracking
```
**Transaction type:** `DEPOSIT_ADDRESS_CALLDATA` — The route response will include a deposit address and calldata. Transfer the specified amount to the deposit address to initiate the swap.
### Same-Chain Swap on XRPL (XRPL → XRPL)
You can also perform same-chain swaps between XRPL tokens.
```typescript
const params = {
fromAddress: "YourXRPLAddress",
fromChain: "xrpl-mainnet",
fromToken: "xrp",
fromAmount: "10000000", // Amount in drops (10 XRP)
toChain: "xrpl-mainnet",
toToken: "524c555344000000000000000000000000000000.rmxckbedwqr76quhesumdegf4b9xj8m5de", // RLUSD
toAddress: "rYourXRPLAddress",
quoteOnly: false,
};
```
**Transaction type:** `DEPOSIT_ADDRESS_CALLDATA`
### Route from XRPL (XRPL → EVM)
To route from XRPL to an EVM chain, set `fromChain` to `xrpl-mainnet`.
```typescript
const params = {
fromAddress: "YourXRPLAddress",
fromChain: "xrpl-mainnet",
fromToken: "xrp",
fromAmount: "10000000", // Amount in drops (10 XRP)
toChain: "42161", // Arbitrum
toToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", // USDC
toAddress: "0xYourEVMAddress",
quoteOnly: false,
};
```
**Transaction type:** `DEPOSIT_ADDRESS_CALLDATA`
### API Code Examples
| Route | Example |
| ----------- | --------------------------------------------------------------------------------------------- |
| EVM → XRPL | [baseToXrplSwap](https://github.com/0xsquid/examples/tree/main/V2/api/baseToXrplSwap) |
| XRPL → XRPL | [xrplSameChainSwap](https://github.com/0xsquid/examples/tree/main/V2/api/xrplSameChainSwap) |
| XRPL → EVM | [xrplToArbitrumSwap](https://github.com/0xsquid/examples/tree/main/V2/api/xrplToArbitrumSwap) |
***
## SDK Integration
The Squid SDK provides the same XRPL routing capabilities. After initializing the SDK with your integrator ID, use `squid.route()` with the same parameters as the API examples above, then execute using the returned transaction request.
For full SDK setup and execution details, see the [SDK documentation](/api-and-sdk-integration/sdk).
### SDK Code Examples
| Route | Example |
| ----------- | --------------------------------------------------------------------------------------------- |
| EVM → XRPL | [baseToXrplSwap](https://github.com/0xsquid/examples/tree/main/V2/sdk/baseToXrplSwap) |
| XRPL → XRPL | [xrplSameChainSwap](https://github.com/0xsquid/examples/tree/main/V2/sdk/xrplSameChainSwap) |
| XRPL → EVM | [xrplToArbitrumSwap](https://github.com/0xsquid/examples/tree/main/V2/sdk/xrplToArbitrumSwap) |
***
## Status Tracking
XRPL routes are powered by Squid Intents, which **requires** the `quoteId` for status polling. The `quoteId` is returned in the route response.
```typescript
const getStatus = async (params) => {
const result = await axios.get("https://v2.api.squidrouter.com/v2/status", {
params: {
transactionId: params.transactionId,
fromChainId: params.fromChainId,
toChainId: params.toChainId,
quoteId: params.quoteId, // Required for Squid Intents
},
headers: {
"x-integrator-id": "<your-integrator-id>",
},
});
return result.data;
};
```
> **Important:** A Squid Intent transaction will fail unless status is polled with the `quoteId`. See the [Integrating Squid Intents](/api-and-sdk-integration/coral-intent-swaps/integrating-squid-intents) guide for full status polling details.
# Stellar Integration
Integrate cross-chain swaps from Stellar to EVM chains using Squid. Stellar support is powered by [**Squid Intents**](/api-and-sdk-integration/coral-intent-swaps) — Squid's intent-based execution protocol for fast, solver-driven cross-chain settlement.
> **Squid Intents must be enabled on your integrator ID.** Reach out to the Squid team to request Squid Intents access before integrating with Stellar.
***
## Stellar Parameters
| Parameter | Value |
| ------------ | ----------------- |
| **Chain ID** | `stellar-mainnet` |
### Supported Tokens
The following tokens are currently supported on Stellar via Squid Intents:
| Token | Address |
| -------- | --------------------------------------------------------------- |
| **USDC** | `USDC-GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN` |
> Token addresses on Stellar follow the format `CODE-ISSUER` (e.g., `USDC-GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN`).
***
## Prerequisites
* **Stellar SDK** — Install `@stellar/stellar-sdk` to build and sign Stellar transactions.
* **Stellar Wallet** — A funded Stellar account with a secret key. The account must have a trustline for an프로젝트로 돌아가기