Skip to content

Commit c450ee4

Browse files
committed
feat: update docs to clarify usage of getCallsStatus versus
getCrossChainStatus
1 parent e38b313 commit c450ee4

File tree

4 files changed

+73
-17
lines changed

4 files changed

+73
-17
lines changed

docs/pages/transactions/cross-chain-swap-tokens/api.mdx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,52 @@ For other potential responses, [check out the API reference!](/docs/wallets/api-
166166

167167
</Step>
168168

169+
<Step title="Track the cross-chain swap">
170+
171+
<Tip>
172+
We recommend using `wallet_getCrossChainStatus_v0` for richer data including
173+
separate origin and destination transaction details. [See the tracking
174+
documentation](/wallets/transactions/cross-chain-swap-tokens#tracking-a-cross-chain-swap)
175+
for more details.
176+
</Tip>
177+
178+
You can use the `wallet_getCallsStatus` endpoint to check the status of your cross-chain swap. Cross-chain swaps may take longer than single-chain swaps due to cross-chain messaging.
179+
180+
```bash
181+
curl -X POST https://api.g.alchemy.com/v2/{API_KEY} \
182+
-H "Content-Type: application/json" \
183+
-d '{
184+
"jsonrpc": "2.0",
185+
"method": "wallet_getCallsStatus",
186+
"params": [
187+
[
188+
"{CALL_ID_FROM_STEP_2_OR_STEP_4}"
189+
]
190+
],
191+
"id": 1
192+
}'
193+
```
194+
195+
This returns:
196+
197+
```json
198+
{
199+
"id": "1",
200+
"jsonrpc": "2.0",
201+
"result": {
202+
"id": "CALL_ID",
203+
"chainId": "SOURCE_CHAIN_ID",
204+
"atomic": true,
205+
"status": 200,
206+
"receipts": [...]
207+
}
208+
}
209+
```
210+
211+
To get your transaction hash, you can access `result.receipts[0].transactionHash`.
212+
213+
For status codes and more details on tracking cross-chain swaps, see the [tracking documentation](/wallets/transactions/cross-chain-swap-tokens#tracking-a-cross-chain-swap).
214+
215+
</Step>
216+
169217
</Steps>

docs/pages/transactions/cross-chain-swap-tokens/client.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,7 @@ export const client = createSmartWalletClient({
106106
```
107107

108108
</CodeBlocks>
109+
110+
## Status codes
111+
112+
For status codes and more details on tracking cross-chain swaps, see the [tracking documentation](/wallets/transactions/cross-chain-swap-tokens#tracking-a-cross-chain-swap).

docs/pages/transactions/cross-chain-swap-tokens/index.mdx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ After sending your cross-chain swap, you can track its progress using the `walle
7878
via API only. SDK support coming soon.
7979
</Info>
8080

81+
<Tip>
82+
The `wallet_getCrossChainStatus_v0` endpoint is in beta. Note that there may
83+
be changes in the future to simplify the endpoint. We will let you know
84+
if/when that happens.
85+
</Tip>
86+
8187
## Use the status endpoint
8288

8389
Pass the `callId` from your swap request to check the current status:
@@ -210,11 +216,19 @@ The expiry is an informational indicator of when you can expect to be able to pr
210216

211217
## What are the different status codes for cross-chain swaps?
212218

213-
Cross-chain swaps may have additional status codes beyond standard transaction statuses to reflect the cross-chain nature of the transaction. These are:
219+
Cross-chain swaps support comprehensive status tracking. See the [tracking documentation](/wallets/transactions/cross-chain-swap-tokens#status-codes) for a complete list of status codes including:
214220

215-
- 120: Cross-chain in progress
216-
- 410: Cross-chain refund
221+
- 100: Pending
222+
- 110: Preconfirmed
223+
- 115: Preconfirmed Onchain Failure
224+
- 116: Preconfirmed Partial Onchain Failure
225+
- 120: Cross-Chain In Progress
226+
- 200: Confirmed
227+
- 400: Offchain Failure
228+
- 410: Cross-Chain Refunded
229+
- 500: Onchain Failure
230+
- 600: Partial Onchain Failure
217231

218232
## When is a CallId returned from `wallet_requestQuote_v0`?
219233

220-
Any time youre requesting a cross-chain quote via `wallet_requestQuote_v0` , a `callId` is returned. This `callId` includes important data for cross-chain tracking. You can use this just like any other `callId` in `wallet_getCallsStatus`!
234+
Any time you're requesting a cross-chain quote via `wallet_requestQuote_v0` , a `callId` is returned. This `callId` includes important data for cross-chain tracking. You can use this just like any other `callId` in `wallet_getCallsStatus` or `wallet_getCrossChainStatus_v0`!

docs/pages/transactions/cross-chain-swap-tokens/react.mdx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,9 @@ export default function CrossChainSwap() {
135135

136136
Cross-chain swaps take longer than single-chain swaps due to cross-chain messaging and confirmation requirements.
137137

138-
## Cross-chain status codes
139-
140-
Cross-chain swaps have additional status codes to reflect the cross-chain nature:
141-
142-
| Code | Status |
143-
| ------- | --------------------------- |
144-
| 100 | Pending |
145-
| **120** | **Cross-Chain In Progress** |
146-
| 200 | Confirmed |
147-
| 400 | Offchain Failure |
148-
| **410** | **Cross-chain Refund** |
149-
| 500 | Onchain Failure |
150-
| 600 | Partial Onchain Failure |
138+
## Status codes
139+
140+
For status codes and more details on tracking cross-chain swaps, see the [tracking documentation](/wallets/transactions/cross-chain-swap-tokens#tracking-a-cross-chain-swap).
151141

152142
## Swap options
153143

0 commit comments

Comments
 (0)