@paraspell/sdk 7.2.5 → 7.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -4
- package/dist/index.cjs +2718 -2002
- package/dist/index.d.ts +76 -11
- package/dist/index.mjs +2715 -2002
- package/dist/papi/index.cjs +2409 -1692
- package/dist/papi/index.d.ts +76 -11
- package/dist/papi/index.mjs +2406 -1692
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -322,15 +322,17 @@ import { getExistentialDeposit } from "@paraspell/sdk";
|
|
|
322
322
|
//PAPI
|
|
323
323
|
import { getExistentialDeposit } from "@paraspell/sdk/papi";
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
//Currency is an optional parameter. If you wish to query native asset, currency parameter is not necessary.
|
|
326
|
+
//Currency can be either {symbol: assetSymbol}, {id: assetId}, {multilocation: assetMultilocation}.
|
|
327
|
+
const ed = getExistentialDeposit(node, currency?)
|
|
326
328
|
```
|
|
327
329
|
|
|
328
330
|
### XCM Transfer info
|
|
329
331
|
```ts
|
|
330
332
|
//PJS
|
|
331
|
-
import { getTransferInfo, getBalanceForeign, getBalanceNative, getOriginFeeDetails } from "@paraspell/sdk";
|
|
333
|
+
import { getTransferInfo, getBalanceForeign, getBalanceNative, getOriginFeeDetails, getMaxNativeTransferableAmount, getMaxForeignTransferableAmount, getTransferableAmount } from "@paraspell/sdk";
|
|
332
334
|
//PAPI
|
|
333
|
-
import { getTransferInfo, getBalanceForeign, getBalanceNative, getOriginFeeDetails } from "@paraspell/sdk/papi";
|
|
335
|
+
import { getTransferInfo, getBalanceForeign, getBalanceNative, getOriginFeeDetails, getMaxNativeTransferableAmount, getMaxForeignTransferableAmount, getTransferableAmount } from "@paraspell/sdk/papi";
|
|
334
336
|
|
|
335
337
|
//Get balance of foreign currency
|
|
336
338
|
await getBalanceForeign({address, node, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: AssetMultilocationString | AssetMultilocationJson}*/, api /* api/ws_url_string optional */})
|
|
@@ -341,9 +343,18 @@ await getBalanceNative({address, node, api /* api/ws_url_string optional */})
|
|
|
341
343
|
//Get fee information regarding XCM call
|
|
342
344
|
await getOriginFeeDetails({from, to, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: AssetMultilocationString | AssetMultilocationJson}*/, amount, originAddress, destinationAddress, api /* api/ws_url_string optional */, feeMargin /* 10% by default */})
|
|
343
345
|
|
|
344
|
-
//Retrieves the asset balance for a given account on a specified node.
|
|
346
|
+
//Retrieves the asset balance for a given account on a specified node. (You do not need to specify if it is native or foreign).
|
|
345
347
|
await getAssetBalance({address, node, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: AssetMultilocationString | AssetMultilocationJson}*/, api /* api/ws_url_string optional */});
|
|
346
348
|
|
|
349
|
+
//Retrieves maximal transferable balance of chain's native asset (Balance-AssetED) (If a node has more native assets, the asset selection has to be provided. Otherwise the parameter is optional).
|
|
350
|
+
await getMaxNativeTransferableAmount({address, node, currency /*- {symbol: currencySymbol} */})
|
|
351
|
+
|
|
352
|
+
//Retrives maximal transferable balance of chain's foreign asset (Balance-AssetED)
|
|
353
|
+
await getMaxForeignTransferableAmount({address, node, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: AssetMultilocationString | AssetMultilocationJson}*/});
|
|
354
|
+
|
|
355
|
+
//Combines the getMaxNative and getMaxForeign transferable amount functions into one, so you don't have to specify whether you want a native or foreign asset.
|
|
356
|
+
await getTransferableAmount({address, node, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: AssetMultilocationString | AssetMultilocationJson}*/});
|
|
357
|
+
|
|
347
358
|
//Get all the information about XCM transfer
|
|
348
359
|
await getTransferInfo({from, to, address, destinationAddress, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: AssetMultilocationString | AssetMultilocationJson}*/, amount, api /* api/ws_url_string optional */})
|
|
349
360
|
```
|