From c6bd688dd02482e62391e87d386f4da6f1f26d51 Mon Sep 17 00:00:00 2001 From: Dusan Morhac Date: Fri, 27 Mar 2026 10:57:12 +0100 Subject: [PATCH 1/8] v13 --- docs/.vitepress/config.js | 1 + docs/migration/v12-to-v13.md | 327 +++++++++++++++++++++++++++++++++++ docs/sdk/getting-started.md | 2 +- 3 files changed, 329 insertions(+), 1 deletion(-) create mode 100644 docs/migration/v12-to-v13.md diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 3979b168..00ac7553 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -77,6 +77,7 @@ export default { items: [ { text: 'From v10 to v11', link: '/migration/v10-to-v11' }, { text: 'From v11 to v12', link: '/migration/v11-to-v12' }, + { text: 'From v12 to v13', link: '/migration/v12-to-v13' }, ] } ] diff --git a/docs/migration/v12-to-v13.md b/docs/migration/v12-to-v13.md new file mode 100644 index 00000000..a1d33c9a --- /dev/null +++ b/docs/migration/v12-to-v13.md @@ -0,0 +1,327 @@ +# Migration Guide — v12 ➡ v13 + +This guide covers all **breaking changes**, **API updates**, and **new features** introduced in **v13** of ParaSpell XCM Tools. + +The update focuses on: +- Simplifying the **builder API** +- Removing deprecated and legacy functionality +- Unifying **Router & Swap integration into the SDK** +- Improving **asset handling and type consistency** + +--- + +# ⚠️ Breaking Changes + +## 1. Builder API renaming + +### What changed +- `.senderAddress()` → `.sender()` +- `.address()` → `.recipient()` + +This improves readability and aligns with natural terminology. + +--- + +### Before (v12) +```ts +builder + .senderAddress(sender) + .address(recipient) +``` + +--- + +### After (v13) +```ts +builder + .sender(sender) + .recipient(recipient) +``` + +--- + +### Migration +- Replace `.senderAddress()` → `.sender()` +- Replace `.address()` → `.recipient()` + +--- + +## 2. Fee estimation functions removed + +### What changed +All deprecated fee estimation functions (based on `paymentInfo`) have been **removed**. + +--- + +### Migration +- Remove any usage of fee estimation helpers +- Use [**XCM fee queries**](https://paraspell.github.io/docs/sdk/xcmUtils.html#xcm-fee-origin-and-dest) instead + +--- + +## 3. `/router` API endpoint removed + +### What changed +The `/router` API endpoint has been removed. + +Routing functionality is now fully integrated into the **SDK builder**. + +Available as [swap endpoint](https://paraspell.github.io/docs/api/xcmP.html#swap) in API. + +--- + +### Migration +- Replace `/router` endpoint with [swap endpoint](https://paraspell.github.io/docs/api/xcmP.html#swap) + +--- + +## 4. Router types removed + +### What changed +Router-specific types used for fee functions have been removed. + +The router now uses **SDK-native types**. + +--- + +### Migration +- Update any router-related typings to SDK equivalents + +--- + +## 5. RouterBuilder usage change + +### What changed +- `RouterBuilder` is now **generic** +- It is **no longer intended to be used directly from the swap package** + +--- + +### Migration +- Use swaps via the **SDK Builder** +- Do not import/use `RouterBuilder` directly from swap package + +--- + +## 6. `TSendOptions` renamed + +### What changed +```ts +TSendOptions → TTransferOptions +``` + +--- + +### Migration +- Replace all usages of `TSendOptions` with `TTransferOptions` + +--- + +## 7. Deprecated asset helpers + +### What changed +The following functions are now deprecated: +- `hasAssetSupport` → replaced by `findAssetInfo` +- `getAssetId` → replaced by `findAssetInfo` +- `getAssetDecimals` → replaced by `findAssetInfo` + +--- + +### Migration +```ts +// ❌ Old +hasAssetSupport(...) +getAssetId(...) +getAssetDecimals(...) + +// ✅ New (Has all three information in one place) +findAssetInfo(...) +``` + +--- + +## 8. `findAssetInfo` update + +### What changed +- Third parameter `destination` is now **optional** + +--- + +### Before (v12) +```ts +findAssetInfo(asset, origin, destination) +``` + +--- + +### After (v13) +```ts +//If not given, nothing changes (unless destination is Ethereum and you are searching by Asset symbol, make sure to provide it in that case because you can get duplicite asset error) +findAssetInfo(asset, origin, destination?) +``` + +--- + +### Impact +- Simpler API usage +- Backwards compatible if destination is still provided + +--- + +## 9. `getXcmFee` response change + +### What changed +- `isExchange` flag has been moved +- It now exists inside each `hop.result` + +--- + +### Before (v12) +```ts +result.isExchange +``` + +--- + +### After (v13) +```ts +result.hops[i].result.isExchange +``` + +--- + +### Migration +- Update any logic relying on `isExchange` to use the new location + +--- + +# ✨ New Defaults & Behavior Changes + +## 10. Abstract decimals enabled by default + +### What changed +- `abstractDecimals` is now **enabled by default** + +--- + +### Before (v12) +```ts +abstractDecimals: false +``` + +--- + +### After (v13) +```ts +abstractDecimals: true +``` + +--- + +### Impact +- Asset amounts are normalized automatically +- May affect: + - Fee calculations + - Displayed balances + - Precision-sensitive logic + +--- + +### Migration +If you rely on raw decimals: +```ts +abstractDecimals: false +``` + +--- + +# 🚀 New Features + +## 11. `signAndSubmitAll` + +### What changed +A new method has been introduced: + +```ts +signAndSubmitAll() +``` + +--- + +### Behavior +- Returns **array of transaction hexes** +- Allows tracking of all submitted transactions + +--- + +### Comparison + +```ts +// v13 +signAndSubmit() // Used in one click scenarios & basic transfers when signer is provided into sender() +signAndSubmitAll() // Used in two click swap scenarios when signer is provided into sender() +``` + +--- + +# 🧪 Testing Changes + +## Swap E2E tests + +### What changed +- Swap end-to-end tests must now be run from the **SDK package** instead of **Swap package** + +--- + +### Command +```bash +#example run from /packages/sdk folder +pnpm run test:e2e:swap +``` + +--- + +# 🧪 Testing Recommendations + +After upgrading to v13: + +- Re-test: + - Cross-chain transfers + - Swap flows (via SDK Builder) + - Fee calculations (new structure) + - Address handling + +- Verify: + - Asset resolution via `findAssetInfo` + - Decimal normalization behavior + - Transaction tracking (`signAndSubmitAll`) + +--- + +# ✅ Migration Checklist + +- [ ] Replace `.senderAddress()` → `.sender()` +- [ ] Replace `.address()` → `.recipient()` +- [ ] Remove deprecated fee estimation functions and use [xcm fee queries](https://paraspell.github.io/docs/sdk/xcmUtils.html#xcm-fee-origin-and-dest) instead +- [ ] Replace `/router` API usage to [swap endpoint](https://paraspell.github.io/docs/api/xcmP.html#swap) +- [ ] Update router typings to SDK types +- [ ] Replace `TSendOptions` → `TTransferOptions` +- [ ] Replace asset helpers with `findAssetInfo` +- [ ] Update `getXcmFee` response handling +- [ ] Review decimal handling (`abstractDecimals`) +- [ ] Migrate to SDK Builder for swaps +- [ ] Use `signAndSubmitAll` if tracking multiple txs + +--- + +# 💡 Notes + +This release simplifies the SDK by: +- Removing legacy APIs +- Consolidating routing and swaps into the builder +- Standardizing asset handling through `findAssetInfo` + +It also lays the groundwork for: +- Unified cross-chain + swap flows +- Multi-client SDK support +- Cleaner developer experience \ No newline at end of file diff --git a/docs/sdk/getting-started.md b/docs/sdk/getting-started.md index 307ba074..7d038544 100644 --- a/docs/sdk/getting-started.md +++ b/docs/sdk/getting-started.md @@ -58,7 +58,7 @@ XCM SDK supports three different Javascript client providers. It is advised to u ## Install swap extension -If you plan to [do Swap XCMs](https://paraspell.github.io/docs/sdk/xcmPallet.html#swap) you can install Swap package which allows you to do cross-chain swaps on popular Polkadot, Kusama, Paseo, Westend exchanges. Only available in **PAPI** version of SDK. +If you plan to [do Swap XCMs](https://paraspell.github.io/docs/sdk/xcmPallet.html#swap) you can install Swap package which allows you to do cross-chain swaps on popular Polkadot, Kusama, Paseo, Westend exchanges. Now available in **ALL** versions of SDK. > [!IMPORTANT] > - ⚠️ **WebAssembly (Wasm) must be enabled in your project** because of the Hydration SDK (One of the exchanges implemented in XCM Router). Wasm can be enabled either through the web application configuration or through the appropriate plugin. From 7cb960f592545251004ce95763a0659d89ebd00f Mon Sep 17 00:00:00 2001 From: Dusan Morhac Date: Fri, 27 Mar 2026 12:02:17 +0100 Subject: [PATCH 2/8] add changes --- docs/api/deploy.md | 2 +- docs/api/g-started.md | 2 +- docs/api/upgrade.md | 6 +- docs/api/xcmAnalyser.md | 8 +- docs/api/xcmP.md | 194 ++++++++++++++--------------- docs/migration/v12-to-v13.md | 231 +++++++++++++++++------------------ 6 files changed, 216 insertions(+), 227 deletions(-) diff --git a/docs/api/deploy.md b/docs/api/deploy.md index c21f4359..1e8ee683 100644 --- a/docs/api/deploy.md +++ b/docs/api/deploy.md @@ -78,7 +78,7 @@ Recently, LightSpell introduced the Sentry error tracking service implementation Open your REST API client, client we use is [Insomnia](https://insomnia.rest/). Paste in the following details and input the following link to test out Sentry: -`http://localhost:3001/v5/sentry-test` +`http://localhost:3001/v1/sentry-test` LightSpell has integrated this test for you so you can test out error 500 in localhost mode. Once you paste the link into the browser, Sentry should notify you about a new error 500. It should look like this in your project: diff --git a/docs/api/g-started.md b/docs/api/g-started.md index 7ca1d8fa..9fa59d8b 100644 --- a/docs/api/g-started.md +++ b/docs/api/g-started.md @@ -9,7 +9,7 @@ Getting started with

This section guides you on how to use our XCM API. -Deployed on [https://api.lightspell.xyz/v5](https://api.lightspell.xyz/v5) +Deployed on [https://api.paraspell.xyz/v1](https://api.lightspell.xyz/v1) [[Github repository]](https://github.com/paraspell/xcm-tools/tree/main/apps/xcm-api) diff --git a/docs/api/upgrade.md b/docs/api/upgrade.md index 3058afd3..f5ba1e87 100644 --- a/docs/api/upgrade.md +++ b/docs/api/upgrade.md @@ -20,7 +20,7 @@ Before you proceed with verification note the following: You can claim your token on the following site (API has to be running): -`http://localhost:3001/v5/app/generate-api-key` +`http://localhost:3001/v1/app/generate-api-key` The limit for this level is: `100 requests per minute` @@ -44,7 +44,7 @@ Before you proceed with the request note the following: Request for higher limit can be done in the following form (API and Database have to be running. Both need to be correctly configured): -`http://localhost:3001/v5/app/higher-request-limit` +`http://localhost:3001/v1/app/higher-request-limit` The limit for this level is: `Per request` @@ -78,7 +78,7 @@ Make sure to name the key as `X-API-KEY` otherwise your key won't be recognized. The following snippet can be observed. See the `Headers` section where the API key is inserted. ```ts const response = await fetch( - 'http://localhost:3001/v5/x-transfer?' + + 'http://localhost:3001/v1/x-transfer?' + new URLSearchParams({ //Method parameters should be here //For eg. from: 'Basilisk' diff --git a/docs/api/xcmAnalyser.md b/docs/api/xcmAnalyser.md index 5b463457..88f370e7 100644 --- a/docs/api/xcmAnalyser.md +++ b/docs/api/xcmAnalyser.md @@ -3,7 +3,7 @@ Following section covers implementation of XCM Analyser in LightSpell XCM API. Users can analyse either independent locations or entire XCM Calls. ## Analyse Location -**Endpoint**: `POST /v5/xcm-analyser` +**Endpoint**: `POST /v1/xcm-analyser` ::: details Parameters @@ -20,7 +20,7 @@ Following section covers implementation of XCM Analyser in LightSpell XCM API. U ::: ```ts -const response = await fetch("http://localhost:3001/v5/xcm-analyser", { +const response = await fetch("http://localhost:3001/v1/xcm-analyser", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -31,7 +31,7 @@ const response = await fetch("http://localhost:3001/v5/xcm-analyser", { }); ``` ## Analyse XCM call -**Endpoint**: `POST /v5/xcm-analyser` +**Endpoint**: `POST /v1/xcm-analyser` ::: details Parameters @@ -48,7 +48,7 @@ const response = await fetch("http://localhost:3001/v5/xcm-analyser", { ::: ```ts -const response = await fetch("http://localhost:3001/v5/xcm-analyser", { +const response = await fetch("http://localhost:3001/v1/xcm-analyser", { method: 'POST', headers: { 'Content-Type': 'application/json' diff --git a/docs/api/xcmP.md b/docs/api/xcmP.md index 5749256a..3ce0f18d 100644 --- a/docs/api/xcmP.md +++ b/docs/api/xcmP.md @@ -12,7 +12,7 @@ const provider = getWsProvider('YourChainWSPort') // Specify "YourChainWSPort" w const client = createClient(withPolkadotSdkCompat(provider)) const response = await fetch( - "http://localhost:3001/v5/x-transfer”, + "http://localhost:3001/v1/x-transfer”, { method: ‘POST’, body: JSON.stringify({ @@ -43,7 +43,7 @@ tx.signAndSubmit(signer) ### Substrate to Substrate (HRMP) The following endpoint enables the creation of a variety of `Substrate-to-Substrate` XCM calls. It provides a unified interface for constructing cross-chain messages between Substrate-based networks using XCM. This endpoint is intended to simplify interoperability workflows and reduce the complexity of composing XCM transactions programmatically. -**Endpoint**: `POST /v5/x-transfer` +**Endpoint**: `POST /v1/x-transfer` ::: details Parameters @@ -155,7 +155,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/x-transfer", { +const response = await fetch("http://localhost:3001/v1/x-transfer", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -174,7 +174,7 @@ const response = await fetch("http://localhost:3001/v5/x-transfer", { ## Local transfers The following endpoint allows creation of Local asset transfers for any chain and any currency registered on it. This call is specified by same Chain selected as origin - `from` and destination - `to` parameters. -**Endpoint**: `POST /v5/x-transfer` +**Endpoint**: `POST /v1/x-transfer` ::: details Parameters @@ -264,7 +264,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/x-transfer', { +const response = await fetch('http://localhost:3001/v1/x-transfer', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -282,7 +282,7 @@ const response = await fetch('http://localhost:3001/v5/x-transfer', { ## Transact The Api gives the ability to perform Transact, which enables execution of calls on a remote chain in the context of the destination environment. This allows applications to trigger cross-chain actions without direct interaction from users on the target chain. -**Endpoint**: `POST /v5/x-transfer` +**Endpoint**: `POST /v1/x-transfer` ::: details Parameters @@ -378,7 +378,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/x-transfer', { +const response = await fetch('http://localhost:3001/v1/x-transfer', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -401,7 +401,7 @@ const response = await fetch('http://localhost:3001/v5/x-transfer', { ## Swap This feature allows you to send Swap XCMs, meaning you send one currency and receive another at the destination chain. -**Endpoint**: `POST /v5/x-transfers` +**Endpoint**: `POST /v1/x-transfers` ::: details Parameters @@ -547,7 +547,7 @@ swapOptions:{ **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/x-transfers', { +const response = await fetch('http://localhost:3001/v1/x-transfers', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -571,7 +571,7 @@ const response = await fetch('http://localhost:3001/v5/x-transfers', { ## Dry run You can determine whether your XCM message will execute successfully or fail with an error. The XCM message dry run provides a concrete execution error, allowing you to validate the message before submission. This makes it possible to verify correct execution without ever submitting the XCM message on-chain. -**Endpoint**: `POST /v5/dry-run` +**Endpoint**: `POST /v1/dry-run` ::: details Parameters @@ -684,7 +684,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/dry-run', { +const response = await fetch('http://localhost:3001/v1/dry-run', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -701,7 +701,7 @@ const response = await fetch('http://localhost:3001/v5/dry-run', { ## Dry run preview By using preview with dry-run, you can determine the result of a call using a fictional currency amount. This effectively allows you to simulate and demo calls with custom asset values of assets you don't need to own. -**Endpoint**: `POST /v5/dry-run-preview` +**Endpoint**: `POST /v1/dry-run-preview` ::: details Parameters @@ -807,7 +807,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/dry-run-preview', { +const response = await fetch('http://localhost:3001/v1/dry-run-preview', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -853,7 +853,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/x-transfer", { +const response = await fetch("http://localhost:3001/v1/x-transfer", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -897,7 +897,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/x-transfer", { +const response = await fetch("http://localhost:3001/v1/x-transfer", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -940,7 +940,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/x-transfer", { +const response = await fetch("http://localhost:3001/v1/x-transfer", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -959,7 +959,7 @@ const response = await fetch("http://localhost:3001/v5/x-transfer", { ### Snowbridge health check Query for Snowbridge status -**Endpoint**: `GET /v5/x-transfer/eth-bridge-status` +**Endpoint**: `GET /v1/x-transfer/eth-bridge-status` - **Parameters**: @@ -971,13 +971,13 @@ Query for Snowbridge status **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/x-transfer/eth-bridge-status"); +const response = await fetch("http://localhost:3001/v1/x-transfer/eth-bridge-status"); ``` ## Batch call XCM API allows you to batch your XCM calls and send multiple at the same time via batch feature. -**Endpoint** `POST /v5/x-transfer-batch` +**Endpoint** `POST /v1/x-transfer-batch` ::: details Parameters @@ -1016,7 +1016,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/x-transfer-batch", { +const response = await fetch("http://localhost:3001/v1/x-transfer-batch", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -1051,7 +1051,7 @@ const response = await fetch("http://localhost:3001/v5/x-transfer-batch", { ## Asset claim Assets that have been trapped in the cross-chain transfers can be recovered through the asset claim feature. -**Endpoint**: `POST /v5/asset-claim` +**Endpoint**: `POST /v1/asset-claim` ::: details Parameters @@ -1073,7 +1073,7 @@ Assets that have been trapped in the cross-chain transfers can be recovered thro **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/asset-claim", { +const response = await fetch("http://localhost:3001/v1/asset-claim", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -1161,7 +1161,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/x-transfer", { +const response = await fetch("http://localhost:3001/v1/x-transfer", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -1191,7 +1191,7 @@ const response = await fetch("http://localhost:3001/v5/x-transfer", { API allows you to use prederived accounts for testing (As sender or receiver address). For example Alice, Bob, Charlie, Alith, Balthathar and others. -**Endpoint**: `POST /v5/sign-and-submit` +**Endpoint**: `POST /v1/sign-and-submit` ::: details Parameters @@ -1246,7 +1246,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/sign-and-submit", { +const response = await fetch("http://localhost:3001/v1/sign-and-submit", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -1277,7 +1277,7 @@ const response = await fetch("http://localhost:3001/v5/sign-and-submit", { The following endpoint allows is designed to retrieve you XCM fee at any cost, but fallbacking to Payment info if DryRun query fails or is not supported by either origin or destination. -**Endpoint**: `POST /v5/xcm-fee` +**Endpoint**: `POST /v1/xcm-fee` ::: details Parameters @@ -1399,7 +1399,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/xcm-fee", { +const response = await fetch("http://localhost:3001/v1/xcm-fee", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -1417,7 +1417,7 @@ const response = await fetch("http://localhost:3001/v5/xcm-fee", { ## XCM Fee (Origin only) Following queries allow you to query XCM fee from Origin chain. The query is designed to retrieve you XCM fee at any cost, but fallbacking to Payment info if DryRun query fails or is not supported by origin. -**Endpoint**: `POST /v5/origin-xcm-fee` +**Endpoint**: `POST /v1/origin-xcm-fee` ::: details Parameters @@ -1530,7 +1530,7 @@ options: ({ **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/origin-xcm-fee", { +const response = await fetch("http://localhost:3001/v1/origin-xcm-fee", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -1548,7 +1548,7 @@ const response = await fetch("http://localhost:3001/v5/origin-xcm-fee", { ## XCM Transfer info To comprehensively assess whether a message will execute successfully without failure, use this query. It provides detailed information on currency balances before and after the transaction, including all relevant fees. This data is essential for accurately evaluating potential balance or fee-related issues that could cause message failure. -**Endpoint**: `POST /v5/transfer-info` +**Endpoint**: `POST /v1/transfer-info` ::: details Parameters @@ -1657,7 +1657,7 @@ options: ({ **Example of request:** ```ts const response = await fetch( - 'http://localhost:3001/v5/transfer-info' , { + 'http://localhost:3001/v1/transfer-info' , { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -1673,7 +1673,7 @@ const response = await fetch( ## Transferable amount To retrieve information on how much of the selected currency can be transfered from specific account you can use transferable balance. -**Endpoint**: `POST /v5/transferable-amount` +**Endpoint**: `POST /v1/transferable-amount` ::: details Parameters @@ -1789,7 +1789,7 @@ options: ({ **Example of request:** ```ts const response = await fetch( - 'http://localhost:3001/v5/transferable-amount' , { + 'http://localhost:3001/v1/transferable-amount' , { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -1805,7 +1805,7 @@ const response = await fetch( ## Minimal transferable amount You can use the minimal transferable balance to retrieve information on minimum of the selected currency can be transferred from a specific account to specific destination, so that the Existential deposit and destination or origin fee is paid fully. -**Endpoint**: `POST /v5/min-transferable-amount` +**Endpoint**: `POST /v1/min-transferable-amount` ::: details Parameters @@ -1922,7 +1922,7 @@ options: ({ **Example of request:** ```ts const response = await fetch( - 'http://localhost:3001/v5/min-transferable-amount' , { + 'http://localhost:3001/v1/min-transferable-amount' , { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -1938,7 +1938,7 @@ const response = await fetch( ## Predicted received amount You can predict the amount to be received on destination, granted, that the destination chain and hops have dry-run. -**Endpoint**: `POST /v5/receivable-amount` +**Endpoint**: `POST /v1/receivable-amount` ::: details Parameters @@ -2035,7 +2035,7 @@ options: ({ **Example of request:** ```ts const response = await fetch( - 'http://localhost:3001/v5/receivable-amount' , { + 'http://localhost:3001/v1/receivable-amount' , { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -2051,7 +2051,7 @@ const response = await fetch( ## Verify ED on destination To retrieve information on whether the selected currency from specific account will meet existential deposit on destination chain you can use this query. -**Endpoint**: `POST /v5/verify-ed-on-destination` +**Endpoint**: `POST /v1/verify-ed-on-destination` ::: details Parameters @@ -2161,7 +2161,7 @@ options: ({ **Example of request:** ```ts const response = await fetch( - 'http://localhost:3001/v5/verify-ed-on-destination' , { + 'http://localhost:3001/v1/verify-ed-on-destination' , { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -2177,7 +2177,7 @@ const response = await fetch( ## Best amount out Following endpoint gives you best amount out for specific dex. Works with swapOptions defined only. -**Endpoint**: `POST /v5/best-amount-out` +**Endpoint**: `POST /v1/best-amount-out` ::: details Parameters @@ -2284,7 +2284,7 @@ options: ({ **Example of request:** ```ts const response = await fetch( - 'http://localhost:3001/v5/best-amount-out' , { + 'http://localhost:3001/v1/best-amount-out' , { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -2306,7 +2306,7 @@ const response = await fetch( ## SS58 Address conversion Following functionality allows you to convert any SS58 address to Chain specific address. - **Endpoint**: `GET /v5/convert-ss58?address=:address&chain=:chain` + **Endpoint**: `GET /v1/convert-ss58?address=:address&chain=:chain` ::: details Parameters @@ -2325,7 +2325,7 @@ Following functionality allows you to convert any SS58 address to Chain specific **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/convert-ss58?address=:address&chain=:chain'); +const response = await fetch('http://localhost:3001/v1/convert-ss58?address=:address&chain=:chain'); ``` ## Asset queries @@ -2335,7 +2335,7 @@ This functionality allows you to perform various asset queries with compatible C ```ts const response = await fetch( - "http://localhost:3001/v5/assets/" + //Replace "action" with your desired action eg. "Acala/native" + "http://localhost:3001/v1/assets/" + //Replace "action" with your desired action eg. "Acala/native" ); console.log(response) //use response data as necessary @@ -2344,7 +2344,7 @@ console.log(response) //use response data as necessary ### Query asset paths The following endpoint allows you to query the asset paths related to origin chain. -**Endpoint**: `POST /v5/assets/:chain/supported-destinations` +**Endpoint**: `POST /v1/assets/:chain/supported-destinations` ::: details Currency spec options @@ -2401,7 +2401,7 @@ Asset selection of multiple assets: **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/:chain/supported-destinations", { +const response = await fetch("http://localhost:3001/v1/assets/:chain/supported-destinations", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -2415,7 +2415,7 @@ const response = await fetch("http://localhost:3001/v5/assets/:chain/supported-d ### Query asset reserve The following endpoint allows you to query the asset reserve for specific asset on specific chain. -**Endpoint**: `POST /v5/assets/:chain/reserve-chain` +**Endpoint**: `POST /v1/assets/:chain/reserve-chain` ::: details Currency spec options @@ -2472,7 +2472,7 @@ Asset selection of multiple assets: **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/:chain/reserve-chain", { +const response = await fetch("http://localhost:3001/v1/assets/:chain/reserve-chain", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -2486,7 +2486,7 @@ const response = await fetch("http://localhost:3001/v5/assets/:chain/reserve-cha ### Query asset balance The following endpoint allows you to query asset balance for on specific chain. -**Endpoint**: `POST /v5/balance/:chain` +**Endpoint**: `POST /v1/balance/:chain` ::: details Parameters @@ -2546,7 +2546,7 @@ Asset selection of multiple assets: **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/balance/:chain/asset", { +const response = await fetch("http://localhost:3001/v1/balance/:chain/asset", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -2561,7 +2561,7 @@ const response = await fetch("http://localhost:3001/v5/balance/:chain/asset", { ### Query asset existential deposit The following endpoint allows you to query the existential deposit for currency in a specific chain. -**Endpoint**: `POST /v5/balance/:chain/existential-deposit` +**Endpoint**: `POST /v1/balance/:chain/existential-deposit` ::: details Parameters @@ -2619,7 +2619,7 @@ Asset selection of multiple assets: **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/balance/:chain/existential-deposit", { +const response = await fetch("http://localhost:3001/v1/balance/:chain/existential-deposit", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -2633,7 +2633,7 @@ const response = await fetch("http://localhost:3001/v5/balance/:chain/existentia ### Query Fee assets The following endpoint retrieves Fee asset queries (Assets accepted as XCM Fee on specific chain) -**Endpoint**: `GET /v5/assets/:chain/fee-assets` +**Endpoint**: `GET /v1/assets/:chain/fee-assets` ::: details Parameters @@ -2650,13 +2650,13 @@ The following endpoint retrieves Fee asset queries (Assets accepted as XCM Fee o **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/assets/:chain/fee-assets'); +const response = await fetch('http://localhost:3001/v1/assets/:chain/fee-assets'); ``` ### Query assets object The following endpoint retrieves all assets on a specific Chain as an object. -**Endpoint**: `GET /v5/assets/:chain` +**Endpoint**: `GET /v1/assets/:chain` ::: details Parameters @@ -2673,13 +2673,13 @@ The following endpoint retrieves all assets on a specific Chain as an object. **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/Moonbeam"); +const response = await fetch("http://localhost:3001/v1/assets/Moonbeam"); ``` ### Query asset Location The following endpoint retrieves asset location from the asset ID or asset symbol. -**Endpoint**: `POST /v5/assets/:chain/location` +**Endpoint**: `POST /v1/assets/:chain/location` ::: details Parameters @@ -2730,7 +2730,7 @@ Asset selection by asset Symbol: **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/:chain/location", { +const response = await fetch("http://localhost:3001/v1/assets/:chain/location", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -2744,7 +2744,7 @@ const response = await fetch("http://localhost:3001/v5/assets/:chain/location", ### Query asset Location The following endpoint retrieves asset location from the asset ID or asset symbol. -**Endpoint**: `POST /v5/assets/:chain/asset-info` +**Endpoint**: `POST /v1/assets/:chain/asset-info` ::: details Parameters @@ -2799,7 +2799,7 @@ Asset selection by asset Symbol: **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/:chain/asset-info", { +const response = await fetch("http://localhost:3001/v1/assets/:chain/asset-info", { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -2814,7 +2814,7 @@ const response = await fetch("http://localhost:3001/v5/assets/:chain/asset-info" ### Query asset ID The following endpoint returns the asset id for the specific asset on a specific Chain. -**Endpoint**: `GET /v5/assets/:chain/id?symbol=:symbol` +**Endpoint**: `GET /v1/assets/:chain/id?symbol=:symbol` ::: details Parameters @@ -2833,13 +2833,13 @@ The following endpoint returns the asset id for the specific asset on a specific **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/Interlay/id?symbol=USDT"); +const response = await fetch("http://localhost:3001/v1/assets/Interlay/id?symbol=USDT"); ``` ### Query Relay chain asset symbol The following endpoint returns the Relay chain asset symbol for a specific Chain. -**Endpoint**: `GET /v5/assets/:chain/relay-chain-symbol` +**Endpoint**: `GET /v1/assets/:chain/relay-chain-symbol` ::: details Parameters @@ -2856,13 +2856,13 @@ The following endpoint returns the Relay chain asset symbol for a specific Chain **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/Astar/relay-chain-symbol"); +const response = await fetch("http://localhost:3001/v1/assets/Astar/relay-chain-symbol"); ``` ### Query native assets The following endpoint returns native assets of specific Chain. -**Endpoint**: `GET /v5/assets/:chain/native` +**Endpoint**: `GET /v1/assets/:chain/native` ::: details Parameters @@ -2879,13 +2879,13 @@ The following endpoint returns native assets of specific Chain. **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/Hydration/native"); +const response = await fetch("http://localhost:3001/v1/assets/Hydration/native"); ``` ### Query foreign assets The following endpoint returns foreign assets of specific Chain. -**Endpoint**: `GET /v5/assets/:chain/other` +**Endpoint**: `GET /v1/assets/:chain/other` ::: details Parameters @@ -2902,13 +2902,13 @@ The following endpoint returns foreign assets of specific Chain. **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/Astar/other"); +const response = await fetch("http://localhost:3001/v1/assets/Astar/other"); ``` ### Query all asset symbols The following endpoint returns all asset symbols for specific Chain. -**Endpoint**: `GET /v5/assets/:chain/all-symbols` +**Endpoint**: `GET /v1/assets/:chain/all-symbols` ::: details Parameters @@ -2925,13 +2925,13 @@ The following endpoint returns all asset symbols for specific Chain. **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/Moonbeam/all-symbols"); +const response = await fetch("http://localhost:3001/v1/assets/Moonbeam/all-symbols"); ``` ### Query asset support The following endpoint returns a boolean value that confirms if the asset is registered on a specific Chain or not. -**Endpoint**: `GET /v5/assets/:chain/has-support?symbol=:symbol` +**Endpoint**: `GET /v1/assets/:chain/has-support?symbol=:symbol` ::: details Parameters @@ -2950,13 +2950,13 @@ The following endpoint returns a boolean value that confirms if the asset is reg **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/Hydration/has-support?symbol=DOT"); +const response = await fetch("http://localhost:3001/v1/assets/Hydration/has-support?symbol=DOT"); ``` ### Query asset support between two chains The following endpoint retrieves assets supported by both chains. -**Endpoint**: `GET /v5/supported-assets?origin=:chain&destination=:chain` +**Endpoint**: `GET /v1/supported-assets?origin=:chain&destination=:chain` ::: details Parameters @@ -2974,13 +2974,13 @@ The following endpoint retrieves assets supported by both chains. **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/supported-assets?origin=Acala&destination=Astar"); +const response = await fetch("http://localhost:3001/v1/supported-assets?origin=Acala&destination=Astar"); ``` ### Query asset decimals The following endpoint retrieves specific asset decimals on specific Chain. -**Endpoint**: `GET /v5/assets/:chain/decimals?symbol=:symbol` +**Endpoint**: `GET /v1/assets/:chain/decimals?symbol=:symbol` ::: details Parameters @@ -2999,13 +2999,13 @@ The following endpoint retrieves specific asset decimals on specific Chain. **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/assets/Basilisk/decimals?symbol=BSX"); +const response = await fetch("http://localhost:3001/v1/assets/Basilisk/decimals?symbol=BSX"); ``` ### Query Chain ws endpoints The following endpoint retrieves the Chain's WS endpoints. -**Endpoint**: `GET /v5/chains/:chain/ws-endpoints` +**Endpoint**: `GET /v1/chains/:chain/ws-endpoints` ::: details Parameters @@ -3022,13 +3022,13 @@ The following endpoint retrieves the Chain's WS endpoints. **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/chains/Acala/ws-endpoints"); +const response = await fetch("http://localhost:3001/v1/chains/Acala/ws-endpoints"); ``` ### Query Chain ID The following endpoint retrieves Chain's ID from Chain's name - **Endpoint**: `GET /v5/chains/:chain/para-id` + **Endpoint**: `GET /v1/chains/:chain/para-id` ::: details Parameters @@ -3045,13 +3045,13 @@ The following endpoint retrieves Chain's ID from Chain's name **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/chains/Acala/para-id"); +const response = await fetch("http://localhost:3001/v1/chains/Acala/para-id"); ``` ### Query Chain name The following endpoint retrieves the Chain's name from the Chain's ID. (Options for ecosystem - Polkadot, Kusama, Passeo, Westend, Ethereum) -**Endpoint**: `GET /v5/chains/:paraId?ecosystem=eco` +**Endpoint**: `GET /v1/chains/:paraId?ecosystem=eco` ::: details Parameters @@ -3068,13 +3068,13 @@ The following endpoint retrieves the Chain's name from the Chain's ID. (Options **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/chains/2090?ecosystem=Polkadot"); +const response = await fetch("http://localhost:3001/v1/chains/2090?ecosystem=Polkadot"); ``` ### Query list of implemented Chains The following endpoint retrieves an array of implemented Chains. -**Endpoint**: `GET /v5/chains` +**Endpoint**: `GET /v1/chains` - **Parameters**: None. - **Errors**: @@ -3083,7 +3083,7 @@ The following endpoint retrieves an array of implemented Chains. **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/chains"); +const response = await fetch("http://localhost:3001/v1/chains"); ``` ## XCM pallet queries @@ -3094,7 +3094,7 @@ This functionality allows you to query the `XCM pallets` that Chains currently s ```ts const response = await fetch( - "http://localhost:3001/v5/pallets/" + //Replace "action" with your desired action eg. "Acala/default" + "http://localhost:3001/v1/pallets/" + //Replace "action" with your desired action eg. "Acala/default" ); console.log(response) //use response data as necessary @@ -3103,7 +3103,7 @@ console.log(response) //use response data as necessary ### Get default XCM pallet The following endpoint returns the default pallet for specific Chain -**Endpoint**: `GET /v5/pallets/:chain/default` +**Endpoint**: `GET /v1/pallets/:chain/default` ::: details Parameters @@ -3120,13 +3120,13 @@ The following endpoint returns the default pallet for specific Chain **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/pallets/Acala/default"); +const response = await fetch("http://localhost:3001/v1/pallets/Acala/default"); ``` ### Get XCM pallet index The following endpoint returns the index of specific cross-chain pallet for specific chain. -**Endpoint**: `GET /v5/pallets/:chain/index` +**Endpoint**: `GET /v1/pallets/:chain/index` ::: details Parameters @@ -3145,13 +3145,13 @@ The following endpoint returns the index of specific cross-chain pallet for spec **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/pallets/Acala/index?pallet=XTokens'); +const response = await fetch('http://localhost:3001/v1/pallets/Acala/index?pallet=XTokens'); ``` ### Get all supported XCM pallets The following endpoint returns all XCM Pallets that are supported on specific Chain -**Endpoint**: `GET /v5/pallets/:chain` +**Endpoint**: `GET /v1/pallets/:chain` ::: details Parameters @@ -3168,13 +3168,13 @@ The following endpoint returns all XCM Pallets that are supported on specific Ch **Example of request:** ```ts -const response = await fetch("http://localhost:3001/v5/pallets/Basilisk"); +const response = await fetch("http://localhost:3001/v1/pallets/Basilisk"); ``` ### Get chain DryRun support The following endpoint returns whether selected Chain has DryRun support -**Endpoint**: `GET /v5/chains/:chain/has-dry-run-support` +**Endpoint**: `GET /v1/chains/:chain/has-dry-run-support` ::: details Parameters @@ -3191,13 +3191,13 @@ The following endpoint returns whether selected Chain has DryRun support **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/chains/:chain/has-dry-run-support'); +const response = await fetch('http://localhost:3001/v1/chains/:chain/has-dry-run-support'); ``` ### Print local pallets for native assets Following endpoint returns all pallets for local transfers of native assets for specific chain. -**Endpoint**: `GET /v5/pallets/:chain/native-assets` +**Endpoint**: `GET /v1/pallets/:chain/native-assets` ::: details Parameters @@ -3214,14 +3214,14 @@ Following endpoint returns all pallets for local transfers of native assets for **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/pallets/:chain/native-assets'); +const response = await fetch('http://localhost:3001/v1/pallets/:chain/native-assets'); ``` ### Print local pallets for foreign assets Following endpoint returns all pallets for local transfers of foreign assets for specific chain. -**Endpoint**: `GET /v5/pallets/:chain/other-assets` +**Endpoint**: `GET /v1/pallets/:chain/other-assets` ::: details Parameters @@ -3238,5 +3238,5 @@ Following endpoint returns all pallets for local transfers of foreign assets for **Example of request:** ```ts -const response = await fetch('http://localhost:3001/v5/pallets/:chain/other-assets'); +const response = await fetch('http://localhost:3001/v1/pallets/:chain/other-assets'); ``` diff --git a/docs/migration/v12-to-v13.md b/docs/migration/v12-to-v13.md index a1d33c9a..705ff2de 100644 --- a/docs/migration/v12-to-v13.md +++ b/docs/migration/v12-to-v13.md @@ -5,16 +5,26 @@ This guide covers all **breaking changes**, **API updates**, and **new features* The update focuses on: - Simplifying the **builder API** - Removing deprecated and legacy functionality -- Unifying **Router & Swap integration into the SDK** -- Improving **asset handling and type consistency** +- Unifying **Swap integration support for all XCM SDKs** + +### **Tracking issue (For deep dive code checking):** + +https://github.com/paraspell/xcm-tools/issues/1624 --- -# ⚠️ Breaking Changes +## ⚠️ Breaking Changes + +### 🛠️ Specific XCM API breaking changes changes + +XCM API is now moved under paraspell.xyz domain, so instead of `https://api.lightspell.xyz/v5/assets/Astar` you now use `https://api.paraspell.xyz/v1/assets/Astar`. + + +### 🛠️ XCM Tools related changes (SDKs + API) -## 1. Builder API renaming +#### 1. Builder API renaming -### What changed +##### What changed - `.senderAddress()` → `.sender()` - `.address()` → `.recipient()` @@ -22,7 +32,7 @@ This improves readability and aligns with natural terminology. --- -### Before (v12) +##### Before (v12) ```ts builder .senderAddress(sender) @@ -31,37 +41,37 @@ builder --- -### After (v13) +##### After (v13) ```ts builder .sender(sender) .recipient(recipient) ``` ---- -### Migration -- Replace `.senderAddress()` → `.sender()` -- Replace `.address()` → `.recipient()` +#### 2. Fee estimation functions removed ---- +##### What changed +All deprecated fee estimation functions (based on `paymentInfo`) have been **removed**. -## 2. Fee estimation functions removed +List of functions and what they should be replaced by: -### What changed -All deprecated fee estimation functions (based on `paymentInfo`) have been **removed**. +```ts +.getXcmFeeEstimate() -> .getXcmFee() +.getOriginXcmFeeEstimate() -> .getOriginXcmFee() +``` --- -### Migration +##### Migration - Remove any usage of fee estimation helpers - Use [**XCM fee queries**](https://paraspell.github.io/docs/sdk/xcmUtils.html#xcm-fee-origin-and-dest) instead --- -## 3. `/router` API endpoint removed +#### 3. `/router` API endpoint removed -### What changed +##### What changed The `/router` API endpoint has been removed. Routing functionality is now fully integrated into the **SDK builder**. @@ -70,64 +80,88 @@ Available as [swap endpoint](https://paraspell.github.io/docs/api/xcmP.html#swap --- -### Migration +##### Migration - Replace `/router` endpoint with [swap endpoint](https://paraspell.github.io/docs/api/xcmP.html#swap) --- -## 4. Router types removed - -### What changed -Router-specific types used for fee functions have been removed. - -The router now uses **SDK-native types**. - ---- - -### Migration -- Update any router-related typings to SDK equivalents - ---- +#### 4. RouterBuilder usage change -## 5. RouterBuilder usage change - -### What changed +##### What changed - `RouterBuilder` is now **generic** - It is **no longer intended to be used directly from the swap package** ---- -### Migration -- Use swaps via the **SDK Builder** -- Do not import/use `RouterBuilder` directly from swap package +##### Before (v12) +```ts +await RouterBuilder() + .from(TSubstrateChain) + .to(TChain) + .currencyFrom(currencyFrom) + .currencyTo(currencyTo) + .amount(amount) + .slippagePct(pct) + .senderAddress(injectorAddress) + .recipientAddress(recipientAddress) + .signer(signer) + .onStatusChange((status: TRouterEvent) => { + console.log(status.type); + console.log(status.routerPlan); + console.log(status.chain); + console.log(status.destinationChain); + console.log(status.currentStep); + }) + .buildAndSend() +``` --- -## 6. `TSendOptions` renamed +##### After (v13) +```ts +const builder = Builder() + .from(TSubstrateChain) + .to(TChain) + .currency(CURRENCY_SPEC) + .address(address) + .senderAddress(address) + .swap({ + currencyTo: CURRENCY_SPEC, + }) + +const tx = await builder.buildAll() + +await builder.disconnect() +``` + + +#### 5. `TSendOptions` renamed -### What changed +##### What changed ```ts TSendOptions → TTransferOptions ``` --- -### Migration +##### Migration - Replace all usages of `TSendOptions` with `TTransferOptions` --- -## 7. Deprecated asset helpers +#### 6. Deprecated asset helpers -### What changed +##### What changed The following functions are now deprecated: -- `hasAssetSupport` → replaced by `findAssetInfo` -- `getAssetId` → replaced by `findAssetInfo` -- `getAssetDecimals` → replaced by `findAssetInfo` +- `hasAssetSupport` +- `getAssetId` +- `getAssetDecimals` + + +In favor of `findAssetInfo`. --- -### Migration +##### Migration ```ts // ❌ Old hasAssetSupport(...) @@ -140,85 +174,85 @@ findAssetInfo(...) --- -## 8. `findAssetInfo` update +#### 7. `findAssetInfo` update -### What changed +##### What changed - Third parameter `destination` is now **optional** --- -### Before (v12) +##### Before (v12) ```ts -findAssetInfo(asset, origin, destination) +findAssetInfo(chain, CURRENCY_SPEC, destination) ``` --- -### After (v13) +##### After (v13) ```ts //If not given, nothing changes (unless destination is Ethereum and you are searching by Asset symbol, make sure to provide it in that case because you can get duplicite asset error) -findAssetInfo(asset, origin, destination?) +findAssetInfo(chain, CURRENCY_SPEC, destination?) ``` --- -### Impact +##### Impact - Simpler API usage - Backwards compatible if destination is still provided --- -## 9. `getXcmFee` response change +#### 8. `getXcmFee` response change -### What changed +##### What changed - `isExchange` flag has been moved - It now exists inside each `hop.result` --- -### Before (v12) +##### Before (v12) ```ts result.isExchange ``` --- -### After (v13) +##### After (v13) ```ts result.hops[i].result.isExchange ``` --- -### Migration +##### Migration - Update any logic relying on `isExchange` to use the new location --- -# ✨ New Defaults & Behavior Changes +## ✨ New Defaults & Behavior Changes -## 10. Abstract decimals enabled by default +#### 9. Abstract decimals enabled by default -### What changed +##### What changed - `abstractDecimals` is now **enabled by default** --- -### Before (v12) +##### Before (v12) ```ts abstractDecimals: false ``` --- -### After (v13) +##### After (v13) ```ts abstractDecimals: true ``` --- -### Impact +##### Impact - Asset amounts are normalized automatically - May affect: - Fee calculations @@ -227,7 +261,7 @@ abstractDecimals: true --- -### Migration +##### Migration If you rely on raw decimals: ```ts abstractDecimals: false @@ -235,11 +269,11 @@ abstractDecimals: false --- -# 🚀 New Features +## 🚀 New Features -## 11. `signAndSubmitAll` +### 10. `signAndSubmitAll` -### What changed +#### What changed A new method has been introduced: ```ts @@ -248,13 +282,13 @@ signAndSubmitAll() --- -### Behavior +#### Behavior - Returns **array of transaction hexes** - Allows tracking of all submitted transactions --- -### Comparison +#### Comparison ```ts // v13 @@ -264,64 +298,19 @@ signAndSubmitAll() // Used in two click swap scenarios when signer is provided --- -# 🧪 Testing Changes +## 🧪 Testing Changes -## Swap E2E tests +### 11. Swap E2E tests -### What changed +#### What changed - Swap end-to-end tests must now be run from the **SDK package** instead of **Swap package** --- -### Command +#### Command ```bash #example run from /packages/sdk folder pnpm run test:e2e:swap ``` --- - -# 🧪 Testing Recommendations - -After upgrading to v13: - -- Re-test: - - Cross-chain transfers - - Swap flows (via SDK Builder) - - Fee calculations (new structure) - - Address handling - -- Verify: - - Asset resolution via `findAssetInfo` - - Decimal normalization behavior - - Transaction tracking (`signAndSubmitAll`) - ---- - -# ✅ Migration Checklist - -- [ ] Replace `.senderAddress()` → `.sender()` -- [ ] Replace `.address()` → `.recipient()` -- [ ] Remove deprecated fee estimation functions and use [xcm fee queries](https://paraspell.github.io/docs/sdk/xcmUtils.html#xcm-fee-origin-and-dest) instead -- [ ] Replace `/router` API usage to [swap endpoint](https://paraspell.github.io/docs/api/xcmP.html#swap) -- [ ] Update router typings to SDK types -- [ ] Replace `TSendOptions` → `TTransferOptions` -- [ ] Replace asset helpers with `findAssetInfo` -- [ ] Update `getXcmFee` response handling -- [ ] Review decimal handling (`abstractDecimals`) -- [ ] Migrate to SDK Builder for swaps -- [ ] Use `signAndSubmitAll` if tracking multiple txs - ---- - -# 💡 Notes - -This release simplifies the SDK by: -- Removing legacy APIs -- Consolidating routing and swaps into the builder -- Standardizing asset handling through `findAssetInfo` - -It also lays the groundwork for: -- Unified cross-chain + swap flows -- Multi-client SDK support -- Cleaner developer experience \ No newline at end of file From ff86c4f76fe156176174716e4a2cf3ca7d12f175 Mon Sep 17 00:00:00 2001 From: Dusan Morhac Date: Fri, 27 Mar 2026 12:08:42 +0100 Subject: [PATCH 3/8] latest changes --- docs/migration/v12-to-v13.md | 70 +++++------------------------------- 1 file changed, 8 insertions(+), 62 deletions(-) diff --git a/docs/migration/v12-to-v13.md b/docs/migration/v12-to-v13.md index 705ff2de..9e6d5c68 100644 --- a/docs/migration/v12-to-v13.md +++ b/docs/migration/v12-to-v13.md @@ -7,11 +7,12 @@ The update focuses on: - Removing deprecated and legacy functionality - Unifying **Swap integration support for all XCM SDKs** +--- + ### **Tracking issue (For deep dive code checking):** https://github.com/paraspell/xcm-tools/issues/1624 ---- ## ⚠️ Breaking Changes @@ -30,8 +31,6 @@ XCM API is now moved under paraspell.xyz domain, so instead of `https://api.ligh This improves readability and aligns with natural terminology. ---- - ##### Before (v12) ```ts builder @@ -39,8 +38,6 @@ builder .address(recipient) ``` ---- - ##### After (v13) ```ts builder @@ -48,6 +45,7 @@ builder .recipient(recipient) ``` +--- #### 2. Fee estimation functions removed @@ -61,8 +59,6 @@ List of functions and what they should be replaced by: .getOriginXcmFeeEstimate() -> .getOriginXcmFee() ``` ---- - ##### Migration - Remove any usage of fee estimation helpers - Use [**XCM fee queries**](https://paraspell.github.io/docs/sdk/xcmUtils.html#xcm-fee-origin-and-dest) instead @@ -78,8 +74,6 @@ Routing functionality is now fully integrated into the **SDK builder**. Available as [swap endpoint](https://paraspell.github.io/docs/api/xcmP.html#swap) in API. ---- - ##### Migration - Replace `/router` endpoint with [swap endpoint](https://paraspell.github.io/docs/api/xcmP.html#swap) @@ -114,8 +108,6 @@ await RouterBuilder() .buildAndSend() ``` ---- - ##### After (v13) ```ts const builder = Builder() @@ -133,6 +125,7 @@ const tx = await builder.buildAll() await builder.disconnect() ``` +--- #### 5. `TSendOptions` renamed @@ -141,8 +134,6 @@ await builder.disconnect() TSendOptions → TTransferOptions ``` ---- - ##### Migration - Replace all usages of `TSendOptions` with `TTransferOptions` @@ -159,8 +150,6 @@ The following functions are now deprecated: In favor of `findAssetInfo`. ---- - ##### Migration ```ts // ❌ Old @@ -179,15 +168,12 @@ findAssetInfo(...) ##### What changed - Third parameter `destination` is now **optional** ---- ##### Before (v12) ```ts findAssetInfo(chain, CURRENCY_SPEC, destination) ``` ---- - ##### After (v13) ```ts //If not given, nothing changes (unless destination is Ethereum and you are searching by Asset symbol, make sure to provide it in that case because you can get duplicite asset error) @@ -196,38 +182,27 @@ findAssetInfo(chain, CURRENCY_SPEC, destination?) --- -##### Impact -- Simpler API usage -- Backwards compatible if destination is still provided - ---- - #### 8. `getXcmFee` response change ##### What changed - `isExchange` flag has been moved - It now exists inside each `hop.result` ---- ##### Before (v12) ```ts result.isExchange ``` ---- ##### After (v13) ```ts result.hops[i].result.isExchange ``` ---- - ##### Migration - Update any logic relying on `isExchange` to use the new location ---- ## ✨ New Defaults & Behavior Changes @@ -236,30 +211,21 @@ result.hops[i].result.isExchange ##### What changed - `abstractDecimals` is now **enabled by default** ---- + ##### Before (v12) ```ts abstractDecimals: false ``` ---- + ##### After (v13) ```ts abstractDecimals: true ``` ---- - -##### Impact -- Asset amounts are normalized automatically -- May affect: - - Fee calculations - - Displayed balances - - Precision-sensitive logic ---- ##### Migration If you rely on raw decimals: @@ -267,7 +233,6 @@ If you rely on raw decimals: abstractDecimals: false ``` ---- ## 🚀 New Features @@ -280,13 +245,13 @@ A new method has been introduced: signAndSubmitAll() ``` ---- + #### Behavior - Returns **array of transaction hexes** - Allows tracking of all submitted transactions ---- + #### Comparison @@ -295,22 +260,3 @@ signAndSubmitAll() signAndSubmit() // Used in one click scenarios & basic transfers when signer is provided into sender() signAndSubmitAll() // Used in two click swap scenarios when signer is provided into sender() ``` - ---- - -## 🧪 Testing Changes - -### 11. Swap E2E tests - -#### What changed -- Swap end-to-end tests must now be run from the **SDK package** instead of **Swap package** - ---- - -#### Command -```bash -#example run from /packages/sdk folder -pnpm run test:e2e:swap -``` - ---- From 09286bbf84d73d2ab9c412c59f1f7c5528d3d0d4 Mon Sep 17 00:00:00 2001 From: Dusan Morhac Date: Fri, 27 Mar 2026 12:10:08 +0100 Subject: [PATCH 4/8] Update v12-to-v13.md --- docs/migration/v12-to-v13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migration/v12-to-v13.md b/docs/migration/v12-to-v13.md index 9e6d5c68..bf530b30 100644 --- a/docs/migration/v12-to-v13.md +++ b/docs/migration/v12-to-v13.md @@ -191,7 +191,7 @@ findAssetInfo(chain, CURRENCY_SPEC, destination?) ##### Before (v12) ```ts -result.isExchange +result.hops[i].isExchange ``` From 3b9890aa24bdd7bd2780a88d94b958357f307a89 Mon Sep 17 00:00:00 2001 From: Dusan Morhac Date: Fri, 27 Mar 2026 12:11:53 +0100 Subject: [PATCH 5/8] Update v12-to-v13.md --- docs/migration/v12-to-v13.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/migration/v12-to-v13.md b/docs/migration/v12-to-v13.md index bf530b30..47659779 100644 --- a/docs/migration/v12-to-v13.md +++ b/docs/migration/v12-to-v13.md @@ -114,8 +114,8 @@ const builder = Builder() .from(TSubstrateChain) .to(TChain) .currency(CURRENCY_SPEC) - .address(address) - .senderAddress(address) + .recipient(address) + .sender(address) .swap({ currencyTo: CURRENCY_SPEC, }) @@ -245,14 +245,10 @@ A new method has been introduced: signAndSubmitAll() ``` - - #### Behavior - Returns **array of transaction hexes** - Allows tracking of all submitted transactions - - #### Comparison ```ts From 1a574b8109224e16a4f9899156f685cf6f15d6ea Mon Sep 17 00:00:00 2001 From: Dusan Morhac Date: Fri, 27 Mar 2026 13:05:31 +0100 Subject: [PATCH 6/8] Add v13 changes --- docs/api/g-started.md | 7 +- docs/api/xcmP.md | 285 +++++++++++++---------------------- docs/migration/v12-to-v13.md | 4 +- docs/sdk/AssetPallet.md | 44 +----- docs/sdk/xcmPallet.md | 81 +++++----- docs/sdk/xcmUtils.md | 48 +++--- 6 files changed, 174 insertions(+), 295 deletions(-) diff --git a/docs/api/g-started.md b/docs/api/g-started.md index 9fa59d8b..3940f464 100644 --- a/docs/api/g-started.md +++ b/docs/api/g-started.md @@ -1,10 +1,5 @@

-Getting started with -

- -

-LightSpell logo -

+Getting started with ParaSpell✨ XCM API

This section guides you on how to use our XCM API. diff --git a/docs/api/xcmP.md b/docs/api/xcmP.md index 3ce0f18d..a6791b5d 100644 --- a/docs/api/xcmP.md +++ b/docs/api/xcmP.md @@ -18,7 +18,7 @@ const response = await fetch( body: JSON.stringify({ "from": "origin", "to": "destination", - "address": "address", + "recipient": "recipient", "currency": {currencySpec, amount: amount /*Use "ALL" to transfer everything*/}, }) }); @@ -50,7 +50,7 @@ The following endpoint enables the creation of a variety of `Substrate-to-Substr - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. - `xcmVersion` (Inside JSON body): (optional): Specifies manually selected XCM version if pre-selected does not work. Format: Vx - where x = version number eg. V4. ::: @@ -64,7 +64,7 @@ The following endpoint enables the creation of a variety of `Substrate-to-Substr - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. ::: @@ -140,7 +140,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -164,8 +164,8 @@ const response = await fetch("http://localhost:3001/v1/x-transfer", { from: "TChain", // Replace "TChain" with sender Chain, for example, "Acala" or "Polkadot" to: "TChain", // Replace "TChain" with destination Chain, for example, "Hydration" or custom Location currency: {currency spec} //Refer to currency spec options above - address: "Address" // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: "senderAddress" //Optional but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT Existential deposit. + recipient: "Address" // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: "sender" //Optional but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT Existential deposit. //ahAddress: ahAddress //Optional parameter - used when origin is EVM chain and XCM goes through AssetHub (Multihop transfer where we are unable to convert Key20 to ID32 address eg. origin: Moonbeam & destination: Ethereum (Multihop goes from Moonbeam > AssetHub > BridgeHub > Ethereum) }) }); @@ -181,7 +181,7 @@ The following endpoint allows creation of Local asset transfers for any chain a - `from` (Inside JSON body): (required): Represents the Chain on which the asset is transfered locally. - `to` (Inside JSON body): (required): Represents the Chain on which the asset is transfered locally. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. ::: @@ -194,7 +194,7 @@ The following endpoint allows creation of Local asset transfers for any chain a - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `400` (Bad request exception) - Returned when query parameter 'keepAlive' does not have valid input - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. @@ -251,7 +251,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] } @@ -273,7 +273,7 @@ const response = await fetch('http://localhost:3001/v1/x-transfer', { from: 'Chain', // Replace "Chain" with sender Chain, e.g., "Acala" to: 'Chain' // Replace Chain with same parameter as "from" parameter currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location /* keepAlive: bool - Optional: Allows draining the account below the existential deposit. */ }), }); @@ -289,8 +289,8 @@ The Api gives the ability to perform Transact, which enables execution of calls - `from` (Inside JSON body): (required): Represents the Chain on which the asset is transfered locally. - `to` (Inside JSON body): (required): Represents the Chain on which the asset is transfered locally. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender. + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender. - `transact` (Inside JSON body): (required): Specifies the transact which should execute on destination. ::: @@ -304,7 +304,7 @@ The Api gives the ability to perform Transact, which enables execution of calls - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `400` (Bad request exception) - Returned when body of 'transact' is not a valid - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. @@ -365,7 +365,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] } @@ -387,8 +387,8 @@ const response = await fetch('http://localhost:3001/v1/x-transfer', { from: 'Chain', // Replace "Chain" with sender Chain, e.g., "Acala" to: 'Chain' // Replace Chain with same parameter as "from" parameter currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'SenderAddress' //Replace "SenderAddress" with sender wallet address (In AccountID32 or AccountKey20 Format) + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'SenderAddress' //Replace "SenderAddress" with sender wallet address (In AccountID32 or AccountKey20 Format) transact: { hex: Destination call hex //Function that should execute on destination /*originKind: "SovereignAccount" || "XCM" || "Native" || "SuperUser" - Optional, "SovereignAccount" by default @@ -408,8 +408,8 @@ This feature allows you to send Swap XCMs, meaning you send one currency and rec - `from` (Inside JSON body): (required): Represents the Chain on which the asset is transfered locally. - `to` (Inside JSON body): (required): Represents the Chain on which the asset is transfered locally. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender. + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender. - `swapOptions` (Inside JSON body): (required): Specifies the swap to currency that should occur during XCM. ::: @@ -423,7 +423,7 @@ This feature allows you to send Swap XCMs, meaning you send one currency and rec - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `400` (Bad request exception) - Returned when body of 'swapOptions' is not a valid - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. @@ -475,7 +475,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] } @@ -556,8 +556,8 @@ const response = await fetch('http://localhost:3001/v1/x-transfers', { from: 'Chain', // Replace "Chain" with sender Chain, e.g., "Acala" to: 'Chain' // Replace Chain with same parameter as "from" parameter currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'SenderAddress' //Replace "SenderAddress" with sender wallet address (In AccountID32 or AccountKey20 Format) + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'SenderAddress' //Replace "SenderAddress" with sender wallet address (In AccountID32 or AccountKey20 Format) swapOptions: { currencyTo: CURRENCY_SPEC, //Reffer to currency spec options above // exchange: ['AssetHubPolkadotDex'], - Optional parameter - 'HydrationDex' | 'AcalaDex' | 'AssetHubPolkadotDex' | ... @@ -578,8 +578,8 @@ You can determine whether your XCM message will execute successfully or fail wit - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). ::: @@ -592,7 +592,7 @@ You can determine whether your XCM message will execute successfully or fail wit - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue ::: @@ -669,7 +669,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -693,8 +693,8 @@ const response = await fetch('http://localhost:3001/v1/dry-run', { from: 'Chain', // Replace "Chain" with sender Chain or Relay chain, e.g., "Acala" to: 'Chain', // Replace "Chain" with destination Chain or Relay chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'Address' //Replace "Address" with sender address from origin chain + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'Address' //Replace "Address" with sender address from origin chain }), ``` @@ -708,8 +708,8 @@ By using preview with dry-run, you can determine the result of a call using a fi - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). ::: @@ -722,7 +722,7 @@ By using preview with dry-run, you can determine the result of a call using a fi - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue ::: @@ -793,7 +793,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] AssetHubPolkadot: // ws_url | [ws_url, ws_url,..] @@ -816,8 +816,8 @@ const response = await fetch('http://localhost:3001/v1/dry-run-preview', { from: 'Chain', // Replace "Chain" with sender Chain or Relay chain, e.g., "Acala" to: 'Chain', // Replace "Chain" with destination Chain or Relay chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'Address' //Replace "Address" with sender address from origin chain + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'Address' //Replace "Address" with sender address from origin chain }), ``` @@ -838,7 +838,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -862,7 +862,7 @@ const response = await fetch("http://localhost:3001/v1/x-transfer", { from: "AssetHubPolkadot", // Or AssetHubKusama to: "AssetHubKusama", // Or AssetHubPolkadot currency: {symbol: "KSM", amount: amount /*Use "ALL" to transfer everything*/}, // DOT | USDT | USDC - address: "Address" // AccountID 32 address + recipient: "Address" // AccountID 32 address }) }); ``` @@ -882,7 +882,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -906,7 +906,7 @@ const response = await fetch("http://localhost:3001/v1/x-transfer", { from: "AssetHubPolkadot", to: "Ethereum", currency: {symbol: "WETH", amount: amount /*Use "ALL" to transfer everything*/}, // Any supported asset - WBTC, WETH.. - {symbol: currencySymbol} | {id: currencyID} - address: "Address" // Ethereum Address + recipient: "Address" // Ethereum Address }) }); ``` @@ -925,7 +925,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -949,9 +949,9 @@ const response = await fetch("http://localhost:3001/v1/x-transfer", { from: "Chain", to: "Ethereum", currency: {symbol: "WETH", amount: amount /*Use "ALL" to transfer everything*/}, // Any supported asset - WBTC, WETH.. - {symbol: currencySymbol} | {id: currencyID} - address: "Address", // Ethereum Address + recipient: "Address", // Ethereum Address ahAddress: "Address", //Asset hub address (Needs to be sender address) - senderAddress: "Address" //Origin chain sender address + sender: "Address" //Origin chain sender address }) }); ``` @@ -1000,7 +1000,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -1033,13 +1033,13 @@ const response = await fetch("http://localhost:3001/v1/x-transfer-batch", { "from": "Kusama" "to": "Moonriver", "currency": { symbol: "DOT", amount: amount /*Use "ALL" to transfer everything*/}, - "address": "0x939229F9c6E2b97589c4a5A0B3Eb8664FFc00502" + "recipient": "0x939229F9c6E2b97589c4a5A0B3Eb8664FFc00502" }, { "from": "Kusama" "to": "Basilisk", "currency": { symbol: "DOT", amount: amount /*Use "ALL" to transfer everything*/}, - "address": "bXgnPigqWnUTb9PxgCvnt61bsQoRQFnzLYYyRPV1bvB6DLu87" + "recipient": "bXgnPigqWnUTb9PxgCvnt61bsQoRQFnzLYYyRPV1bvB6DLu87" } ], "options": { @@ -1056,7 +1056,7 @@ Assets that have been trapped in the cross-chain transfers can be recovered thro ::: details Parameters - `from` (Inside JSON body): (required): Represents the Chain on which the asset will be claimed. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. - `currency` (Inside JSON body): (required): Represents the asset being claimed. It should be a location. @@ -1065,7 +1065,7 @@ Assets that have been trapped in the cross-chain transfers can be recovered thro ::: details Errors - `400` (Bad request exception) - Returned when parameter 'from' is not provided - - `400` (Bad request exception) - Returned when parameter 'address' is not provided + - `400` (Bad request exception) - Returned when parameter 'recipient' is not provided - `400` (Bad request exception) - Returned when query parameter 'currency' is expected but not provided - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. @@ -1080,7 +1080,7 @@ const response = await fetch("http://localhost:3001/v1/asset-claim", { }, body: JSON.stringify({ from: "Chain", // Replace "from" with the numeric value you wish to transfer - address: "Address", // Replace "address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + recipient: "Address", // Replace "recipient" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location currency: "Asset Location array" //Replace "Asset location array" with specific asset location along with amount specification }) }); @@ -1146,7 +1146,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -1167,8 +1167,8 @@ const response = await fetch("http://localhost:3001/v1/x-transfer", { 'Content-Type': 'application/json' }, body: JSON.stringify({ - senderAddress: "1pze8UbJDcDAacrXcwkpqeRSYLphaAiXB8rUaC6Z3V1kBLq", - address: "0x1501C1413e4178c38567Ada8945A80351F7B8496", + sender: "1pze8UbJDcDAacrXcwkpqeRSYLphaAiXB8rUaC6Z3V1kBLq", + recipient: "0x1501C1413e4178c38567Ada8945A80351F7B8496", from: "Hydration", to: "Ethereum", currency: { @@ -1231,7 +1231,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -1252,8 +1252,8 @@ const response = await fetch("http://localhost:3001/v1/sign-and-submit", { 'Content-Type': 'application/json' }, body: JSON.stringify({ - senderAddress: "//Alice", //You can use prederived accounts - //Alice, //Bob... //Alith, //Balthathar... - address: "0x1501C1413e4178c38567Ada8945A80351F7B8496", //You can also use prederived accounts here - //Alice, //Bob... //Alith, //Balthathar... + sender: "//Alice", //You can use prederived accounts - //Alice, //Bob... //Alith, //Balthathar... + recipient: "0x1501C1413e4178c38567Ada8945A80351F7B8496", //You can also use prederived accounts here - //Alice, //Bob... //Alith, //Balthathar... from: "Hydration", to: "Moonbeam", currency: { @@ -1284,8 +1284,8 @@ The following endpoint allows is designed to retrieve you XCM fee at any cost, b - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the XCM sender. + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the XCM sender. ::: @@ -1298,7 +1298,7 @@ The following endpoint allows is designed to retrieve you XCM fee at any cost, b - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. ::: @@ -1384,7 +1384,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -1408,8 +1408,8 @@ const response = await fetch("http://localhost:3001/v1/xcm-fee", { from: "Chain", // Replace "Chain" with sender Chain, e.g., "Acala" to: "Chain", // Replace "Chain" with destination Chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: "Address" // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) - senderAddress: "Address" // Replace "Address" with sender wallet address (In AccountID32 or AccountKey20 Format) + recipient: "Address" // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) + sender: "Address" // Replace "Address" with sender wallet address (In AccountID32 or AccountKey20 Format) }) }); ``` @@ -1424,8 +1424,8 @@ Following queries allow you to query XCM fee from Origin chain. The query is des - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the XCM sender. + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the XCM sender. ::: @@ -1438,7 +1438,7 @@ Following queries allow you to query XCM fee from Origin chain. The query is des - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. ::: @@ -1515,7 +1515,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -1539,8 +1539,8 @@ const response = await fetch("http://localhost:3001/v1/origin-xcm-fee", { from: "Chain", // Replace "Chain" with sender Chain, e.g., "Acala" to: "Chain", // Replace "Chain" with destination Chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: "Address" // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) - senderAddress: "Address" // Replace "Address" with sender wallet address (In AccountID32 or AccountKey20 Format) + recipient: "Address" // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) + sender: "Address" // Replace "Address" with sender wallet address (In AccountID32 or AccountKey20 Format) }) }); ``` @@ -1555,8 +1555,8 @@ To comprehensively assess whether a message will execute successfully without fa - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). ::: @@ -1569,7 +1569,7 @@ To comprehensively assess whether a message will execute successfully without fa - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue ::: @@ -1641,7 +1641,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -1665,8 +1665,8 @@ const response = await fetch( from: 'Chain', // Replace "Chain" with sender Chain or Relay chain, e.g., "Acala" to: 'Chain', // Replace "Chain" with destination Chain or Relay chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'Address' //Replace "Address" with sender address from origin chain + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'Address' //Replace "Address" with sender address from origin chain }), ``` @@ -1680,8 +1680,8 @@ To retrieve information on how much of the selected currency can be transfered f - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). ::: @@ -1694,7 +1694,7 @@ To retrieve information on how much of the selected currency can be transfered f - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue ::: @@ -1773,7 +1773,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -1797,8 +1797,8 @@ const response = await fetch( from: 'Chain', // Replace "Chain" with sender Chain or Relay chain, e.g., "Acala" to: 'Chain', // Replace "Chain" with destination Chain or Relay chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'Address' //Replace "Address" with sender address from origin chain + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'Address' //Replace "Address" with sender address from origin chain }), ``` @@ -1812,8 +1812,8 @@ You can use the minimal transferable balance to retrieve information on minimum - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). ::: @@ -1826,7 +1826,7 @@ You can use the minimal transferable balance to retrieve information on minimum - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue ::: @@ -1906,7 +1906,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -1930,8 +1930,8 @@ const response = await fetch( from: 'Chain', // Replace "Chain" with sender Chain or Relay chain, e.g., "Acala" to: 'Chain', // Replace "Chain" with destination Chain or Relay chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'Address' //Replace "Address" with sender address from origin chain + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'Address' //Replace "Address" with sender address from origin chain }), ``` @@ -1945,8 +1945,8 @@ You can predict the amount to be received on destination, granted, that the dest - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). ::: @@ -1959,7 +1959,7 @@ You can predict the amount to be received on destination, granted, that the dest - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue ::: @@ -2020,7 +2020,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -2043,8 +2043,8 @@ const response = await fetch( from: 'Chain', // Replace "Chain" with sender Chain or Relay chain, e.g., "Acala" to: 'Chain', // Replace "Chain" with destination Chain or Relay chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'Address' //Replace "Address" with sender address from origin chain + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'Address' //Replace "Address" with sender address from origin chain }), ``` @@ -2058,8 +2058,8 @@ To retrieve information on whether the selected currency from specific account w - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). ::: @@ -2072,7 +2072,7 @@ To retrieve information on whether the selected currency from specific account w - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue ::: @@ -2145,7 +2145,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -2169,8 +2169,8 @@ const response = await fetch( from: 'Chain', // Replace "Chain" with sender Chain or Relay chain, e.g., "Acala" to: 'Chain', // Replace "Chain" with destination Chain or Relay chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'Address' //Replace "Address" with sender address from origin chain + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'Address' //Replace "Address" with sender address from origin chain }), ``` @@ -2184,8 +2184,8 @@ Following endpoint gives you best amount out for specific dex. Works with swapOp - `from` (Inside JSON body): (required): Represents the Chain from which the assets will be transferred. - `to` (Inside JSON body): (required): Represents the Chain to which the assets will be transferred. - `currency` (Inside JSON body): (required): Represents the asset being sent. It should be a string value. - - `address` (Inside JSON body): (required): Specifies the address of the recipient. - - `senderAddress` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). + - `recipient` (Inside JSON body): (required): Specifies the address of the recipient. + - `sender` (Inside JSON body): (required): Specifies the address of the sender (Origin chain one). - `swapOptions` (Inside JSON Body): (required): Specifies Swap to specific currency. ::: @@ -2199,7 +2199,7 @@ Following endpoint gives you best amount out for specific dex. Works with swapOp - `400` (Bad request exception) - Returned when entered chains 'from' and 'to' are not compatible for the transaction - `400` (Bad request exception) - Returned when query parameter 'amount' is expected but not provided - `400` (Bad request exception) - Returned when query parameter 'amount' is not a valid amount - - `400` (Bad request exception) - Returned when query parameter 'address' is not a valid address + - `400` (Bad request exception) - Returned when query parameter 'recipient' is not a valid address - `400` (Bad request exception) - Returned when query parameter 'swapOptions' is not a valid - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue @@ -2269,7 +2269,7 @@ You can customize following API settings, to further tailor your experience with ```ts options: ({ development: true, // Optional: Enforces WS overrides for all chains used - abstractDecimals: true, // Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 + abstractDecimals: true, // TURNED ON BY DEFAULT Abstracts decimals from amount - so 1 in amount for DOT equals 10_000_000_000 xcmFormatCheck: true, // Dryruns each call under the hood with dryrun bypass to confirm message passes with fictional balance apiOverrides: { Hydration: // ws_url | [ws_url, ws_url,..] @@ -2292,8 +2292,8 @@ const response = await fetch( from: 'Chain', // Replace "Chain" with sender Chain or Relay chain, e.g., "Acala" to: 'Chain', // Replace "Chain" with destination Chain or Relay chain, e.g., "Moonbeam" or custom Location currency: { currencySpec }, // Refer to currency spec options above - address: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location - senderAddress: 'Address', //Replace "Address" with sender address from origin chain + recipient: 'Address', // Replace "Address" with destination wallet address (In AccountID32 or AccountKey20 Format) or custom Location + sender: 'Address', //Replace "Address" with sender address from origin chain swapOptions: { currencyTo: CURRENCY_SPEC, //Reffer to currency spec options above // exchange: ['AssetHubPolkadotDex'], - Optional parameter - 'HydrationDex' | 'AcalaDex' | 'AssetHubPolkadotDex' | ... @@ -2311,7 +2311,7 @@ Following functionality allows you to convert any SS58 address to Chain specific ::: details Parameters - `chain` (query parameter): Specifies the name of the Chain. - - `address` (query parameter): Specifies the SS58 Address. + - `recipient` (query parameter): Specifies the SS58 Address. ::: @@ -2491,7 +2491,7 @@ The following endpoint allows you to query asset balance for on specific chain. ::: details Parameters - `chain` (Path parameter): Specifies the name of the Chain. - - `address` (Inside JSON body): (required): Specifies the address of the account. + - `recipient` (Inside JSON body): (required): Specifies the address of the account. - `currency` (Inside JSON body): (required): Specifies the currency to query. ::: @@ -2499,7 +2499,7 @@ The following endpoint allows you to query asset balance for on specific chain. ::: details Errors - `400` (Bad request exception) - Returned when parameter 'chain' is not provided - - `400` (Bad request exception) - Returned when body parameter 'address' is not provided + - `400` (Bad request exception) - Returned when body parameter 'recipient' is not provided - `400` (Bad request exception) - Returned when body parameter 'currency' is not provided - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. @@ -2552,7 +2552,7 @@ const response = await fetch("http://localhost:3001/v1/balance/:chain/asset", { 'Content-Type': 'application/json' }, body: JSON.stringify({ - address: "Address" // Replace "Address" with wallet address (In AccountID32 or AccountKey20 Format) + recipient: "Address" // Replace "Address" with wallet address (In AccountID32 or AccountKey20 Format) currency: {currencySpec}, // Refer to currency spec options above }) }); @@ -2811,31 +2811,6 @@ const response = await fetch("http://localhost:3001/v1/assets/:chain/asset-info" }); ``` -### Query asset ID -The following endpoint returns the asset id for the specific asset on a specific Chain. - -**Endpoint**: `GET /v1/assets/:chain/id?symbol=:symbol` - - ::: details Parameters - - - `chain` (path parameter): Specifies the name of the Chain. - - `symbol` (path parameter): Specifies the currency symbol of the asset. - - ::: - - ::: details Errors - - - `400` (Bad request): When a specified Chain does not exist. - - `404` (Bad request): When an asset with a specified currency symbol does not exist. - - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. - - ::: - -**Example of request:** -```ts -const response = await fetch("http://localhost:3001/v1/assets/Interlay/id?symbol=USDT"); -``` - ### Query Relay chain asset symbol The following endpoint returns the Relay chain asset symbol for a specific Chain. @@ -2928,31 +2903,6 @@ The following endpoint returns all asset symbols for specific Chain. const response = await fetch("http://localhost:3001/v1/assets/Moonbeam/all-symbols"); ``` -### Query asset support -The following endpoint returns a boolean value that confirms if the asset is registered on a specific Chain or not. - -**Endpoint**: `GET /v1/assets/:chain/has-support?symbol=:symbol` - - ::: details Parameters - - - `chain` (path parameter): Specifies the name of the Chain. - - `symbol` (path parameter): Specifies the symbol of the asset. - - ::: - - ::: details Errors - - - `400` (Bad request): When a specified Chain does not exist. - - `404` (Bad request): When an asset with a specified currency symbol does not exist. - - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. - - ::: - -**Example of request:** -```ts -const response = await fetch("http://localhost:3001/v1/assets/Hydration/has-support?symbol=DOT"); -``` - ### Query asset support between two chains The following endpoint retrieves assets supported by both chains. @@ -2977,31 +2927,6 @@ The following endpoint retrieves assets supported by both chains. const response = await fetch("http://localhost:3001/v1/supported-assets?origin=Acala&destination=Astar"); ``` -### Query asset decimals -The following endpoint retrieves specific asset decimals on specific Chain. - -**Endpoint**: `GET /v1/assets/:chain/decimals?symbol=:symbol` - - ::: details Parameters - - - `chain` (path parameter): Specifies the name of the Chain. - - `symbol` (path parameter): Specifies the currency symbol. - - ::: - - ::: details Errors - - - `400` (Bad request): When a specified Chain does not exist. - - `404` (Bad request): When an asset with a specified currency symbol does not exist. - - `500` (Internal server error) - Returned when an unknown error has occurred. In this case please open an issue. - - ::: - -**Example of request:** -```ts -const response = await fetch("http://localhost:3001/v1/assets/Basilisk/decimals?symbol=BSX"); -``` - ### Query Chain ws endpoints The following endpoint retrieves the Chain's WS endpoints. diff --git a/docs/migration/v12-to-v13.md b/docs/migration/v12-to-v13.md index 47659779..3adcecf7 100644 --- a/docs/migration/v12-to-v13.md +++ b/docs/migration/v12-to-v13.md @@ -143,7 +143,7 @@ TSendOptions → TTransferOptions ##### What changed The following functions are now deprecated: -- `hasAssetSupport` +- `hasSupportForAsset` - `getAssetId` - `getAssetDecimals` @@ -153,7 +153,7 @@ In favor of `findAssetInfo`. ##### Migration ```ts // ❌ Old -hasAssetSupport(...) +hasSupportForAsset(...) getAssetId(...) getAssetDecimals(...) diff --git a/docs/sdk/AssetPallet.md b/docs/sdk/AssetPallet.md index 15168625..bcbcef07 100644 --- a/docs/sdk/AssetPallet.md +++ b/docs/sdk/AssetPallet.md @@ -25,12 +25,10 @@ import { getSupportedAssets, getFeeAssets, getAssetsObject, - getAssetId, getRelayChainSymbol, getNativeAssets, getOtherAssets, getAllAssetsSymbols, - hasSupportForAsset, getAssetDecimals, getParaId, getTChain, @@ -556,20 +554,6 @@ getAssetsObject(TChain) } ``` -``` - -## Query asset ID -This function returns `assetId` for `particular Parachain` and `asset symbol`. Function uses [TChain](https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types) types. -```ts -getAssetId(TChain, ASSET_SYMBOL) -``` - -**Example output:** - -```json -"340282366920938463463374607431768211455" -``` - ## Query Relay chain asset symbol This function returns the `symbol` of the Relay chain for a particular Parachain. Either `DOT` or `KSM` or `WND` or `PAS`. Function uses [TChain](https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types) types. ```ts @@ -728,20 +712,7 @@ getAllAssetsSymbols(TChain) ] ``` -## Query asset support I -The function checks if Parachain supports a particular asset. (Both native and foreign assets are searched). Returns boolean. Function uses [TChain](https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types) types. - -```ts -hasSupportForAsset(TChain, ASSET_SYMBOL) -``` - -**Example output:** - -```json -true -``` - -## Query asset support II +## Query asset support The function checks if Parachain supports a particular asset. Returns asset object or null. `Destination` parameter is optional and should be set to Ethereum when using snowbridge assets. Function uses [TChain](https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types) types. ```ts @@ -804,19 +775,6 @@ findAssetInfoOrThrow(TChain, CURRENCY, DESTINATION?) } ``` - -## Query asset decimals -The function returns decimals for a specific asset. Function uses [TChain](https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types) types. -```ts -getAssetDecimals(TChain, ASSET_SYMBOL) -``` - -**Example output:** - -```json -12 -``` - ## Query Parachain ID The function returns specific Parachain id. Function uses [TChain](https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types) types. ```ts diff --git a/docs/sdk/xcmPallet.md b/docs/sdk/xcmPallet.md index 37896ab2..36d20e24 100644 --- a/docs/sdk/xcmPallet.md +++ b/docs/sdk/xcmPallet.md @@ -13,8 +13,8 @@ const builder = Builder(/*client | builder_config |ws_url | [ws_url, ws_url,..] .from(TSubstrateChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain /*,customParaId - optional*/ | Location object /*Only works for PolkadotXCM pallet*/) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(address | Location object /*If you are sending through xTokens, you need to pass the destination and address location in one object (x2)*/) - .senderAddress(address | PAPI_SIGNER /*Only in PAPI SDK*/ | {address, PJS_SIGNER} /*Only in PJS SDK*/) // - OPTIONAL but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub/Hydration with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT ED. + .recipient(address | Location object /*If you are sending through xTokens, you need to pass the destination and address location in one object (x2)*/) + .sender(address | PAPI_SIGNER /*Only in PAPI SDK*/ | {address, PJS_SIGNER} /*Only in PJS SDK*/) // - OPTIONAL but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub/Hydration with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT ED. const tx = await builder.build() // Or if you use signers in senderAddress: @@ -108,7 +108,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -164,9 +164,9 @@ const builder = Builder() .to('AssetHubPolkadot') .currency({ id: 10, - amount: '1000000' + amount: '1' }) - .address(address) + .recipient(address) const tx = await builder.build() @@ -182,7 +182,7 @@ const builder = Builder(/*client | builder_config | ws_url | [ws_url, ws_url,..] .from(TSubstrateChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) // Has to be same as origin (from) .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(address) + .recipient(address) const tx = await builder.build() @@ -262,7 +262,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -297,9 +297,9 @@ const builder = Builder() .to('Hydration') .currency({ symbol: 'DOT', - amount: '10000000000' + amount: '1' }) - .address(address) + .recipient(address) const tx = await builder.build() @@ -317,8 +317,8 @@ const builder = Builder(/*client | builder_config | ws_url | [ws_url, ws_url,..] .from(TSubstrateChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) // Has to be same as origin (from) .currency(CURRENCY_SPEC) // Refer to currency spec options below - .senderAddress(senderAddress) - .address(address) + .sender(senderAddress) + .recipient(address) .transact(hex, /* originType, TWeight - Optional */) // Reffer to transact spec below const tx = await builder.build() @@ -409,7 +409,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -444,10 +444,10 @@ const builder = Builder() .to('BifrostPolkadot') .currency({ symbol: 'DOT', - amount: '10000000000' + amount: '1' }) - .senderAddress(senderAddress) - .address(address) + .sender(senderAddress) + .recipient(address) .transact(0x0a040042ac083419496cb97115aff8f79eb7bb96ceaad18e99e310f526503fdd161b7500) @@ -467,8 +467,8 @@ const builder = Builder(/*client | builder_config |ws_url | [ws_url, ws_url,..] .from(TSubstrateChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain /*,customParaId - optional*/ | Location object /*Only works for PolkadotXCM pallet*/) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(address | Location object /*If you are sending through xTokens, you need to pass the destination and address location in one object (x2)*/) - .senderAddress(address | PAPI_SIGNER /*Only in PAPI SDK*/ | {address, PJS_SIGNER} /*Only in PJS SDK*/) // - OPTIONAL but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub/Hydration with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT ED. + .recipient(address | Location object /*If you are sending through xTokens, you need to pass the destination and address location in one object (x2)*/) + .sender(address | PAPI_SIGNER /*Only in PAPI SDK*/ | {address, PJS_SIGNER} /*Only in PJS SDK*/) // - OPTIONAL but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub/Hydration with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT ED. .swap({ currencyTo: CURRENCY_SPEC, //Reffer to currency spec options above // exchange: ['AssetHubPolkadotDex'], - Optional parameter - 'HydrationDex' | 'AcalaDex' | 'AssetHubPolkadotDex' | ... @@ -480,7 +480,8 @@ const builder = Builder(/*client | builder_config |ws_url | [ws_url, ws_url,..] const tx = await builder.buildAll() // Or if you use signers in senderAddress: -// await builder.signAndSubmit() - Signs and submits the transaction; returns TX hash for tracking +// await builder.signAndSubmit() - Signs and submits the transaction (only working in 1click scenarios); returns TX hash for tracking +// await builder.signAndSubmitAll() - Signs and submits transactions (required in 2click scenarios); returns array of TX hashes for tracking // Make sure to disconnect API after it is no longer used (eg. after transaction) await builder.disconnect() @@ -622,7 +623,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -678,9 +679,9 @@ const builder = Builder() .to('AssetHubPolkadot') .currency({ id: 10, - amount: '1000000' + amount: '1' }) - .address(address) + .recipient(address) .swap({ currencyTo: { symbol: 'USDC' } }) @@ -702,8 +703,8 @@ const result = await Builder(/*client | builder_config | ws_url | [ws_url, ws_ur .from(TSubstrateChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(ADDRESS) + .sender(SENDER_ADDRESS) .dryRun() ``` @@ -809,7 +810,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -1027,8 +1028,8 @@ const result = await Builder(/*client | builder_config | ws_url | [ws_url, ws_ur .from(TSubstrateChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(ADDRESS) + .sender(SENDER_ADDRESS) .dryRunPreview(/*{ mintFeeAssets: true } - false by default - Mints fee assets also, if user does not have enough to cover fees on origin.*/) ``` @@ -1109,7 +1110,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -1318,7 +1319,7 @@ await Builder(/*client | builder_config | ws_url | [ws_url, ws_url,..] - Optiona .from('AssetHubPolkadot') // 'AssetHubPolkadot' | 'AssetHubKusama' .to('AssetHubKusama') // 'AssetHubPolkadot' | 'AssetHubKusama' .currency({symbol: 'DOT', amount: amount /*Use "ALL" to transfer everything*/}) // 'KSM' | 'DOT' | 'USDC' | 'USDT' - .address(address) + .recipient(address) .build() ``` @@ -1354,7 +1355,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -1403,8 +1404,8 @@ await Builder(/*client | builder_config | ws_url | [ws_url, ws_url,..] - Optiona .from(TSubstrateChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to('Ethereum') .currency({symbol: 'WETH', amount: amount /*Use "ALL" to transfer everything*/}) // Any supported asset by bridge - WETH, WBTC, SHIB and more - {symbol: currencySymbol} | {id: currencyID} - .address(eth_address) // AccountKey20 recipient address - .senderAddress(sender_address) // Injector SS58 address + .recipient(eth_address) // AccountKey20 recipient address + .sender(sender_address) // Injector SS58 address .ahAddress(ahAddress) // Recommended! ahAddress is optional but should be used always, as in scenarios where it isn't necessary it will be ignored. It is used when origin chain is EVM style because we are unable to convert your sender Key20 address to ID32 address. .build() ``` @@ -1440,7 +1441,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -1491,7 +1492,7 @@ await EvmBuilder(provider) // Ethereum provider .from('Ethereum') .to(TChain) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency({symbol: 'WETH', amount: amount /*Use "ALL" to transfer everything*/}) // Any supported asset by bridge eg. WETH, WBTC, SHIB and more - {symbol: currencySymbol} | {id: currencyID} - .address(address) // AccountID32 recipient address + .recipient(address) // AccountID32 recipient address //.ahAddress(ahAddress) - ahAddress is optional and used in Ethereum>EVM Substrate chain (eg. Moonbeam) transfer. .signer(signer) // Ethereum signer address .build(); @@ -1523,13 +1524,13 @@ await Builder(/*CHAIN api/ws_url_string - optional*/) .from(TSubstrateChain) // Ensure, that origin CHAIN is the same in all batched XCM Calls. .to(Tchain2) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(address | Location object) + .recipient(address | Location object) .addToBatch() .from(TSubstrateChain) // Ensure, that origin CHAIN is the same in all batched XCM Calls. .to(TChain3) // 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(address | Location object) + .recipient(address | Location object) .addToBatch() .buildBatch({ // This settings object is optional and batch all is the default option @@ -1581,7 +1582,7 @@ const hash = await EvmBuilder() .from('Moonbeam') // 'Moonbeam' | 'Polkadot' | 'Moonriver' .to(TChain) // 'Polkadot' | 'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency({id: currencyID, amount: amount /*Use "ALL" to transfer everything*/} | {symbol: currencySymbol, amount: amount /*Use "ALL" to transfer everything*/}) //Select currency by ID or Symbol - .address(address) + .recipient(address) .signer(signer) // Ethers Signer or Viem Wallet Client .build() ``` @@ -1602,8 +1603,8 @@ const builder = await Builder({ .from(TSubstrateChain) .to(TChain) .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(address) //You can also use prederived accounts - //Alice, //Bob... //Alith, //Balthathar... - .senderAddress(address) //You can also use prederived accounts //Alice, //Bob... //Alith, //Balthathar... + .recipient(address) //You can also use prederived accounts - //Alice, //Bob... //Alith, //Balthathar... + .sender(address) //You can also use prederived accounts //Alice, //Bob... //Alith, //Balthathar... const tx = await builder.build() // Or if you use prederived account as senderAddress: @@ -1683,7 +1684,7 @@ const builder = await Builder({ .from('Hydration') .to('Ethereum') .currency({ symbol: 'USDC.e', amount: '1' }) - .address('0x24D18dbFBcEd732EAdF98EE520853e13909fE258') + .recipient('0x24D18dbFBcEd732EAdF98EE520853e13909fE258') const tx = await builder.build() @@ -1699,7 +1700,7 @@ Claim XCM trapped assets from the selected chain. const builder = Builder(/*client | ws_url | [ws_url, ws_url,..] - Optional*/) .claimfrom(TSubstrateChain) // 'AssetHubPolkadot' | 'AssetHubKusama' | 'Polkadot' | 'Kusama' .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(address | Location object) + .recipient(address | Location object) /*.xcmVersion(Version.V3) Optional parameter, by default chain specific version. XCM Version ENUM if a different XCM version is needed (Supported V3, V4, V5). Requires importing Version enum.*/ const tx = await builder.build() diff --git a/docs/sdk/xcmUtils.md b/docs/sdk/xcmUtils.md index 696a2bfd..602d3fe3 100644 --- a/docs/sdk/xcmUtils.md +++ b/docs/sdk/xcmUtils.md @@ -10,8 +10,8 @@ const fee = await Builder(/*client | builder_config | ws_url | [ws_url, ws_url,. .from(TSubstrateChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(RECIPIENT_ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(RECIPIENT_ADDRESS) + .sender(SENDER_ADDRESS) .getXcmFee(/*{disableFallback: true / false}*/) //Fallback is optional. When fallback is disabled, you only get notified of DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin or Destination chain do not support DryRun out of the box. ``` @@ -105,7 +105,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -228,8 +228,8 @@ const fee = await Builder(/*client | builder_config | ws_url | [ws_url, ws_url,. .from(TSubstrateChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(RECIPIENT_ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(RECIPIENT_ADDRESS) + .sender(SENDER_ADDRESS) .getOriginXcmFee(/*{disableFallback: true / false}*/) //Fallback is optional. When fallback is disabled, you only get notified of DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin do not support DryRun out of the box. ``` @@ -315,7 +315,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -567,8 +567,8 @@ const info = await Builder(/*client | builder_config | ws_url | [ws_url, ws_url, .from(TSubstrateChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(RECIPIENT_ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(RECIPIENT_ADDRESS) + .sender(SENDER_ADDRESS) .getTransferInfo() ``` @@ -652,7 +652,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -838,8 +838,8 @@ const transferable = await Builder(/*client | builder_config | ws_url | [ws_url, .from(TSubstrateChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(RECIPIENT_ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(RECIPIENT_ADDRESS) + .sender(SENDER_ADDRESS) .getTransferableAmount() ``` @@ -933,7 +933,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -1000,8 +1000,8 @@ const transferable = await Builder(/*client | builder_config | ws_url | [ws_url, .from(TSubstrateChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(RECIPIENT_ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(RECIPIENT_ADDRESS) + .sender(SENDER_ADDRESS) .getMinTransferableAmount() ``` @@ -1095,7 +1095,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -1162,8 +1162,8 @@ const ed = await Builder(/*client | builder_config | ws_url | [ws_url, ws_url,.. .from(TSubstrateChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(RECIPIENT_ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(RECIPIENT_ADDRESS) + .sender(SENDER_ADDRESS) .verifyEdOnDestination() ``` **Initial setup:** @@ -1248,7 +1248,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -1315,8 +1315,8 @@ const transferable = await Builder(/*client | builder_config | ws_url | [ws_url, .from(TSubstrateChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(RECIPIENT_ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(RECIPIENT_ADDRESS) + .sender(SENDER_ADDRESS) .getReceivableAmount() ``` @@ -1402,7 +1402,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. @@ -1456,8 +1456,8 @@ const result = await Builder(/*chain api/builder_config/ws_url_string/ws_url_arr .from(TSubstrateChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .to(TChain) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types .currency(CURRENCY_SPEC) // Refer to currency spec options below - .address(RECIPIENT_ADDRESS) - .senderAddress(SENDER_ADDRESS) + .recipient(RECIPIENT_ADDRESS) + .sender(SENDER_ADDRESS) .swap({ currencyTo: CURRENCY_SPEC, //Reffer to currency spec options above // exchange: ['AssetHubPolkadotDex'], - Optional parameter - 'HydrationDex' | 'AcalaDex' | 'AssetHubPolkadotDex' | ... @@ -1549,7 +1549,7 @@ const builder = await Builder({ **Decimal abstraction:** -Following setting will abstract decimals from the .currency builder functionality. +**TURNED ON BY DEFAULT** Following setting will abstract decimals from the .currency builder functionality. >[!Note] >Types in amount parameter are **(number | string | bigint)**. If bigint is provided and decimal abstraction is turned on, it will automatically turn it off as bigint does not support float numbers. From 5a5dbf9fd5900fded675982c0603e8a6a34e99dd Mon Sep 17 00:00:00 2001 From: Dusan Morhac Date: Fri, 27 Mar 2026 13:14:19 +0100 Subject: [PATCH 7/8] Update config.js --- docs/.vitepress/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 00ac7553..1192f7b7 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -34,7 +34,7 @@ export default { ] }, { - text: '
Lightspell logoXCM API
', + text: '
Lightspell logoXCM API
', items: [ { text: 'Getting started', link: '/api/g-started' }, { text: 'XCM SDK🪄', link: '/api/xcmP' }, From 9508c9cba6f0b678342e1a0afbcd93f2373caf7d Mon Sep 17 00:00:00 2001 From: Dusan Morhac Date: Fri, 27 Mar 2026 14:02:56 +0100 Subject: [PATCH 8/8] Update v12-to-v13.md --- docs/migration/v12-to-v13.md | 185 +++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) diff --git a/docs/migration/v12-to-v13.md b/docs/migration/v12-to-v13.md index 3adcecf7..ed472d3b 100644 --- a/docs/migration/v12-to-v13.md +++ b/docs/migration/v12-to-v13.md @@ -190,16 +190,201 @@ findAssetInfo(chain, CURRENCY_SPEC, destination?) ##### Before (v12) + +Accessing result: + ```ts result.hops[i].isExchange ``` +Example result: + +```ts +{ + "origin": { + "weight": { + "refTime": "18446744073709551615", + "proofSize": "22338" + }, + "fee": "14901746512880889", + "feeType": "dryRun", + "sufficient": false, + "asset": { + "symbol": "ASTR", + "isNative": true, + "decimals": 18, + "existentialDeposit": "1000000", + "location": { + "parents": 1, + "interior": { + "X1": [ + { + "Parachain": 2006 + } + ] + } + } + } + }, + "destination": { + "fee": "149", + "feeType": "dryRun", + "asset": { + "assetId": "10", + "symbol": "USDT", + "decimals": 6, + "existentialDeposit": "10000", + "location": { + "parents": 1, + "interior": { + "X3": [ + { + "Parachain": 1000 + }, + { + "PalletInstance": 50 + }, + { + "GeneralIndex": 1984 + } + ] + } + }, + "isFeeAsset": true, + "alias": "USDT1" + } + }, + "hops": [ + { + "chain": "AssetHubPolkadot", + "result": { + "fee": "327948830", + "feeType": "dryRun", + "sufficient": true, + "asset": { + "symbol": "DOT", + "isNative": true, + "decimals": 10, + "existentialDeposit": "100000000", + "location": { + "parents": 1, + "interior": { + "Here": null + } + }, + "isFeeAsset": true + }, + "forwardedXcms": [], + "weight": { + "refTime": "530928826", + "proofSize": "16264" + }, + "isExchange": true + }, + "isExchange": true + } + ] +} +``` + ##### After (v13) + +Accessing result: + ```ts result.hops[i].result.isExchange ``` +Example result: + +```ts +{ + "origin": { + "weight": { + "refTime": "18446744073709551615", + "proofSize": "22338" + }, + "fee": "14901746512880889", + "feeType": "dryRun", + "sufficient": false, + "asset": { + "symbol": "ASTR", + "isNative": true, + "decimals": 18, + "existentialDeposit": "1000000", + "location": { + "parents": 1, + "interior": { + "X1": [ + { + "Parachain": 2006 + } + ] + } + } + } + }, + "destination": { + "fee": "149", + "feeType": "dryRun", + "asset": { + "assetId": "10", + "symbol": "USDT", + "decimals": 6, + "existentialDeposit": "10000", + "location": { + "parents": 1, + "interior": { + "X3": [ + { + "Parachain": 1000 + }, + { + "PalletInstance": 50 + }, + { + "GeneralIndex": 1984 + } + ] + } + }, + "isFeeAsset": true, + "alias": "USDT1" + } + }, + "hops": [ + { + "chain": "AssetHubPolkadot", + "result": { + "fee": "327948830", + "feeType": "dryRun", + "sufficient": true, + "asset": { + "symbol": "DOT", + "isNative": true, + "decimals": 10, + "existentialDeposit": "100000000", + "location": { + "parents": 1, + "interior": { + "Here": null + } + }, + "isFeeAsset": true + }, + "forwardedXcms": [], + "weight": { + "refTime": "530928826", + "proofSize": "16264" + }, + "isExchange": true + }, + } + ] +} +``` + ##### Migration - Update any logic relying on `isExchange` to use the new location