From 76e5cbc525f50705ae93ccc8d40cbd16a94ac636 Mon Sep 17 00:00:00 2001 From: Aimen Sahnoun Date: Mon, 2 Mar 2026 01:09:35 +0400 Subject: [PATCH] =?UTF-8?q?docs(api-features):=20align=20crosschain-paymen?= =?UTF-8?q?ts=20page=20with=20legacy=20docs=20flow=20Update=20`api-feature?= =?UTF-8?q?s/crosschain-payments.mdx`=20to=20follow=20legacy=20content=20s?= =?UTF-8?q?tructure=20and=20sequencing=20while=20keeping=20Mintlify-compat?= =?UTF-8?q?ible=20formatting.=20-=20Replaced=20mixed/rewritten=20content?= =?UTF-8?q?=20with=20legacy-aligned=20section=20flow=20-=20Removed=20non-l?= =?UTF-8?q?egacy=20=E2=80=9Cget=20in=20touch=E2=80=9D=20block=20-=20Kept?= =?UTF-8?q?=20supported=20chains/currencies=20explicitly=20on-page=20(cros?= =?UTF-8?q?schain-specific)=20-=20Converted=20=E2=80=9CHow=20It=20Works?= =?UTF-8?q?=E2=80=9D=20to=20step-based=20structure=20using=20Mintlify=20`S?= =?UTF-8?q?teps`=20-=20Kept=20endpoint=20links=20directly=20inside=20the?= =?UTF-8?q?=20relevant=20steps=20(legacy-style=20placement)=20-=20Restored?= =?UTF-8?q?=20signing=20code=20example=20in=20step=204=20-=20Removed=20ext?= =?UTF-8?q?ra=20=E2=80=9CUsed=20In=E2=80=9D=20section=20-=20Removed=20sepa?= =?UTF-8?q?rate=20endpoint=20dump=20section=20that=20made=20the=20page=20n?= =?UTF-8?q?oisy=20-=20Updated=20custom=20fee=20note=20to=20reflect=20curre?= =?UTF-8?q?nt=20availability=20and=20link=20to=20`/api-features/platform-f?= =?UTF-8?q?ees`=20(instead=20of=20=E2=80=9Cin=20development=E2=80=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api-features/crosschain-payments.mdx | 188 ++++++++++++++++++--------- 1 file changed, 130 insertions(+), 58 deletions(-) diff --git a/api-features/crosschain-payments.mdx b/api-features/crosschain-payments.mdx index 7e3ae2b..460c7a8 100644 --- a/api-features/crosschain-payments.mdx +++ b/api-features/crosschain-payments.mdx @@ -3,69 +3,141 @@ title: "Crosschain Payments" description: "Multi-network payment routing with automatic bridging and optimization" --- +## Overview + +Crosschain payments allow users to pay a request using a stablecoin from a different blockchain network than the one specified on the request. For example, a payer can pay a request for USDC on Base using USDT from their Optimism wallet. + +## Benefits + +- **Flexibility:** Payers can pay with their preferred currency. +- **Cost-Effective:** Automated routing balances cost and speed. +- **Time-Saving:** Payers don't need to swap or bridge tokens manually. +- **Simplified UX:** Payment settlement requires only 1 or 2 signatures from the payer. + +## Crosschain Payments Supported Chains and Currencies + +For crosschain (and samechain) payments, the Request Network API supports 12 stablecoins: USDC, USDT, and DAI on 4 chains (Ethereum, Arbitrum One, Base, OP Mainnet). + +### Crosschain Payments Supported Chains + +Crosschain payments are supported on the following blockchain networks: + +- Ethereum +- Arbitrum One +- Base +- OP Mainnet + +### Crosschain Payments Supported Currencies + -**AI-Generated Content** – This page was generated with AI assistance and may contain inaccuracies. While likely close to accurate, please verify critical details with the [stable documentation](https://docs.request.network) or [contact support](https://github.com/orgs/RequestNetwork/discussions). +Crosschain payments work only with mainnet funds (real money). Test networks are not supported. -## Overview +The following stablecoins are supported for crosschain payments on both the sending and receiving networks: -Crosschain payments enable seamless transactions across different blockchain networks, allowing payers to send from their preferred chain while payees receive on their preferred network. +- USDC +- USDT +- DAI ## How It Works - -```mermaid -graph LR - A[Payer: USDC on Polygon] --> B[Bridge Protocol] - B --> C[Payee: USDC on Base] + + +To enable crosschain payments, the request must be created with: + +- `paymentCurrency` in the supported stablecoins and supported networks +- `amount` greater than 1 (crosschain execution under 1 stablecoin is not allowed) + +Create the request via [POST /v2/request](https://api.request.network/open-api/#tag/v2request/POST/v2/request). + + + +Fetch possible routes with [GET /v2/request/{requestId}/routes](https://api.request.network/open-api/#tag/v2request/GET/v2/request/{requestId}/routes). The API returns routes based on payer balances. + +The API ranks routes by: + +- transaction fees +- processing speed + +Each route includes fee estimates and breakdowns: + +1. **Gas fees** for transfer/approval/execution on the processor side +2. **Service fees** for crosschain infrastructure + +For tokens that do not support EIP-2612, payer approval gas is paid directly by the payer and is not included in route total fees. + +The API may also return samechain routes when payer funds are on the same chain as `paymentCurrency`. + + + +Once a route is selected, fetch unsigned payloads using [GET /v2/request/{requestId}/pay](https://api.request.network/open-api/#tag/v2request/GET/v2/request/{requestId}/pay). + +- For crosschain routes: returns payment intent + approval payload (permit/calldata) +- For direct samechain routes: returns payment calldata and approval data only when needed + + + +Sign the returned payloads with the payer wallet. Approval handling depends on EIP-2612 support. + +```typescript +import { ethers } from "ethers"; + +const ethersProvider = new ethers.providers.Web3Provider( + walletProvider as ethers.providers.ExternalProvider, +); +const signer = await ethersProvider.getSigner(); + +const paymentIntent = JSON.parse(paymentData.paymentIntent); +const supportsEIP2612 = paymentData.metadata.supportsEIP2612; +let approvalSignature = undefined; +let approval = undefined; + +if (supportsEIP2612) { + approval = JSON.parse(paymentData.approvalPermitPayload); + + approvalSignature = await signer._signTypedData( + approval.domain, + approval.types, + approval.values, + ); +} else { + const tx = await signer.sendTransaction(paymentData.approvalCalldata); + await tx.wait(); +} + +const paymentIntentSignature = await signer._signTypedData( + paymentIntent.domain, + paymentIntent.types, + paymentIntent.values, +); + +const signedData = { + signedPaymentIntent: { + signature: paymentIntentSignature, + nonce: paymentIntent.values.nonce.toString(), + deadline: paymentIntent.values.deadline.toString(), + }, + signedApprovalPermit: approvalSignature + ? { + signature: approvalSignature, + nonce: approval.values.nonce.toString(), + deadline: approval?.values?.deadline + ? approval.values.deadline.toString() + : approval.values.expiry.toString(), + } + : undefined, +}; ``` + + + +Send signed payment data with [POST /v2/request/payment-intents/{paymentIntentId}](https://api.request.network/open-api/#tag/v2request/POST/v2/request/payment-intents/{paymentIntentId}). + +The API processes the payment and sends webhook lifecycle updates, including completion events. + + + +## Custom fee configuration + +Custom fee configuration is available. -**Benefits:** -- Access to funds across multiple chains -- Automatic routing optimization -- No manual bridging required - -## Samechain Payments - -A special case of crosschain infrastructure that converts currencies on the same network (e.g., ETH → USDC on Ethereum). - -## Supported Networks - - - - Ethereum, BSC, Avalanche, Fantom - - - - Polygon, Arbitrum, Base, Optimism - - - -## Bridge Protocols - -- **LayerZero:** Ultra Light Node security -- **Stargate:** Liquidity-based bridging -- **Automatic Selection:** Optimal route chosen - -## Used In - - - - Flexible payment options - - - - Accept from any chain - - - - Send to preferred networks - - - - Multi-chain employee payments - - - -## Implementation Details - -See [API Reference - Crosschain Payments](/api-reference/crosschain-payments) for complete technical documentation. \ No newline at end of file +See [Platform Fees](/api-features/platform-fees) for setup details (`feePercentage`, `feeAddress`) and implementation examples.