Skip to content

Commit 7781d74

Browse files
committed
add swap setup
1 parent 06bd5f4 commit 7781d74

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

docs/sdk/getting-started.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,29 @@ XCM SDK supports three different Javascript client providers. It is advised to u
5858
<InstallCommand pkg="@paraspell/sdk-dedot" />
5959

6060
## Install swap extension
61-
If you plan to do Swap XCMs 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.
61+
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.
6262

6363
> [!IMPORTANT]
64-
> - ⚠️ **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. Additionally, Hydration requires the use of the **augment package** (see: https://github.com/galacticcouncil/sdk/issues/114).
64+
> - ⚠️ **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.
65+
>
66+
> - ⚠️ Additionally, Hydration requires the use of the **augment package** (see: https://github.com/galacticcouncil/sdk/issues/114).
6567
66-
<InstallCommand pkg="@paraspell/swap" />
68+
<InstallCommand pkg="@paraspell/swap @galacticcouncil/api-augment" />
6769

68-
## Import package
70+
### Setup Swap extension
71+
72+
Add the `@paraspell/swap` import to your application's root component (Usually `App.tsx`). This ensures the extension is registered before using Builder.
73+
74+
```ts
75+
// Import swap extension here
76+
import '@paraspell/swap';
77+
78+
export default function App() {
79+
return {/* Your app here */};
80+
}
81+
```
82+
83+
## Import SDK functionality
6984
There are two ways to import package to your project. Importing builder or classic import.
7085

7186
### Named import

docs/sdk/xcmPallet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ await builder.disconnect()
460460
:::
461461

462462
## Swap
463-
If you installed [Swap package](https://paraspell.github.io/docs/sdk/getting-started.html#install-swap-extension) you can create Swap XCMs. Doing so, you can send one asset and receive another on the destination. The caveat to using this method is, that some transfers are one click (Like the rest of XCM Transfers) while others are two click (Majority - Send from origin to exchange is one signature and then exchange + transfer to destination is second signature). You need specialized method to build these - `.buildAll()`.
463+
If you [installed Swap package](https://paraspell.github.io/docs/sdk/getting-started.html#install-swap-extension) you can create Swap XCMs. Doing so, you can send one asset and receive another on the destination. The caveat to using this method is, that some transfers are one click (Like the rest of XCM Transfers) while others are two click (Majority - Send from origin to exchange is one signature and then exchange + transfer to destination is second signature). You need specialized method to build these - `.buildAll()`.
464464

465465
```ts
466466
const builder = Builder(/*client | builder_config |ws_url | [ws_url, ws_url,..] - Optional*/)

0 commit comments

Comments
 (0)