Skip to content

Commit

Permalink
chore(sdk): Add transfer info docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dudo50 committed Jun 2, 2024
1 parent 13ee295 commit 7754941
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)*/)
Expand Down Expand Up @@ -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`

Expand Down

0 comments on commit 7754941

Please sign in to comment.