From 7754941e639f75d0e3882cc627103c0881d0c148 Mon Sep 17 00:00:00 2001 From: Dusan Morhac <55763425+dudo50@users.noreply.github.com> Date: Sun, 2 Jun 2024 21:06:23 +0200 Subject: [PATCH] chore(sdk): Add transfer info docs --- packages/sdk/README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/sdk/README.md b/packages/sdk/README.md index ef60b6c8..461d1ad7 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -73,7 +73,7 @@ NOTES: await Builder(/*node api - optional*/) .from(NODE) .to(NODE /*,customParaId - optional*/ | Multilocation object /*Only works for PolkadotXCM pallet*/) - .currency(CurrencyString| | CurrencyID | Multilocation object | MultilocationArray) + .currency(CurrencyString| CurrencyID | Multilocation object | MultilocationArray) /*.feeAsset(feeAsset) - Parameter required when using MultilocationArray*/ .amount(amount) // Overriden when using MultilocationArray .address(address | Multilocation object /*If you are sending through xTokens, you need to pass the destination and address multilocation in one object (x2)*/) @@ -292,6 +292,23 @@ import { getExistentialDeposit } from "@paraspell/sdk"; const ed = getExistentialDeposit('Acala') ``` +### XCM Transfer info +```ts +import { getTransferInfo, getBalanceForeign, getBalanceNative, getOriginFeeDetails } from "@paraspell/sdk"; + +//Get balance of foreign currency +await getBalanceForeign(address, Parachain name, currency) + +//Get balance of native currency +await getBalanceNative(address, Parachain name) + +//Get fee information regarding XCM call +await getOriginFeeDetails(from, to, currency, amount, originAddress) + +//Get all the information about XCM transfer +await getTransferInfo(from, to, address, destinationAddress, currency, amount) +``` + ## 💻 Tests - Run compilation using `pnpm compile`