@paraspell/sdk 8.12.1 → 8.13.1
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 +9 -8
- package/dist/index.cjs +16 -13
- package/dist/index.d.ts +9 -4
- package/dist/index.mjs +16 -14
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -91,8 +91,9 @@ const builder = Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
91
91
|
.from(NODE)
|
|
92
92
|
.to(NODE /*,customParaId - optional*/ | Multilocation object /*Only works for PolkadotXCM pallet*/)
|
|
93
93
|
.currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {multilocation: AssetMultilocationString, amount: amount | AssetMultilocationJson, amount: amount} | {multilocation: Override('Custom Multilocation'), amount: amount} | {multiasset: {currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or multilocation: multilocation*/, amount: amount}})
|
|
94
|
-
.address(address | Multilocation object /*If you are sending through xTokens, you need to pass the destination and address multilocation in one object (x2)
|
|
95
|
-
/*.
|
|
94
|
+
.address(address | Multilocation object /*If you are sending through xTokens, you need to pass the destination and address multilocation in one object (x2)*/)
|
|
95
|
+
/*.senderAddress(address) - OPTIONAL - used when origin is AssetHub and feeAsset parameter is provided
|
|
96
|
+
.feeAsset({symbol: 'symbol'} || {id: 'id'} || {multilocation: 'multilocation'}) // Optional parameter used when multiasset is provided or when origin is AssetHub - so user can pay in fees different than DOT
|
|
96
97
|
.xcmVersion(Version.V1/V2/V3/V4) //Optional parameter for manual override of XCM Version used in call
|
|
97
98
|
.customPallet('Pallet','pallet_function') //Optional parameter for manual override of XCM Pallet and function used in call (If they are named differently on some node but syntax stays the same). Both pallet name and function required. Pallet name must be CamelCase, function name snake_case.*/
|
|
98
99
|
|
|
@@ -216,10 +217,8 @@ const result = await Builder(API /*optional*/)
|
|
|
216
217
|
.to(NODE_2)
|
|
217
218
|
.currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {multilocation: AssetMultilocationString, amount: amount | AssetMultilocationJson, amount: amount} | {multilocation: Override('Custom Multilocation'), amount: amount} | {multiasset: {currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or multilocation: multilocation*/, amount: amount}})
|
|
218
219
|
.address(ADDRESS)
|
|
219
|
-
.
|
|
220
|
-
|
|
221
|
-
//Function pattern
|
|
222
|
-
await getDryRun({api /*optional*/, node, address /*sender address*/, tx /* Extrinsic object */})
|
|
220
|
+
.senderAddress(SENDER_ADDRESS)
|
|
221
|
+
.dryRun()
|
|
223
222
|
|
|
224
223
|
//Check Parachain for DryRun support - returns true/false
|
|
225
224
|
import { hasDryRunSupport } from "@paraspell/sdk-pjs";
|
|
@@ -242,7 +241,8 @@ const fee = await Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
242
241
|
.from(ORIGIN_CHAIN)
|
|
243
242
|
.to(DESTINATION_CHAIN)
|
|
244
243
|
.currency(CURRENCY)
|
|
245
|
-
.address(RECIPIENT_ADDRESS
|
|
244
|
+
.address(RECIPIENT_ADDRESS)
|
|
245
|
+
.senderAddress(SENDER_ADDRESS)
|
|
246
246
|
.getXcmFee({disableFallback: true / false}) //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.
|
|
247
247
|
```
|
|
248
248
|
|
|
@@ -258,7 +258,8 @@ const fee = await Builder(/*node api/ws_url_string/ws_url_array - optional*/)
|
|
|
258
258
|
.from(ORIGIN_CHAIN)
|
|
259
259
|
.to(DESTINATION_CHAIN)
|
|
260
260
|
.currency(CURRENCY)
|
|
261
|
-
.address(RECIPIENT_ADDRESS
|
|
261
|
+
.address(RECIPIENT_ADDRESS)
|
|
262
|
+
.senderAddress(SENDER_ADDRESS)
|
|
262
263
|
.getXcmFeeEstimate()
|
|
263
264
|
```
|
|
264
265
|
|
package/dist/index.cjs
CHANGED
|
@@ -956,9 +956,9 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
956
956
|
return getMythosForeignBalance;
|
|
957
957
|
}()
|
|
958
958
|
}, {
|
|
959
|
-
key: "
|
|
959
|
+
key: "getBalanceForeignAssetsPallet",
|
|
960
960
|
value: function () {
|
|
961
|
-
var
|
|
961
|
+
var _getBalanceForeignAssetsPallet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(address, multiLocation) {
|
|
962
962
|
var transformedMultiLocation, res;
|
|
963
963
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
964
964
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -975,10 +975,10 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
975
975
|
}
|
|
976
976
|
}, _callee9, this);
|
|
977
977
|
}));
|
|
978
|
-
function
|
|
979
|
-
return
|
|
978
|
+
function getBalanceForeignAssetsPallet(_x11, _x12) {
|
|
979
|
+
return _getBalanceForeignAssetsPallet.apply(this, arguments);
|
|
980
980
|
}
|
|
981
|
-
return
|
|
981
|
+
return getBalanceForeignAssetsPallet;
|
|
982
982
|
}()
|
|
983
983
|
}, {
|
|
984
984
|
key: "getForeignAssetsByIdBalance",
|
|
@@ -1096,9 +1096,9 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1096
1096
|
return getBalanceForeignXTokens;
|
|
1097
1097
|
}()
|
|
1098
1098
|
}, {
|
|
1099
|
-
key: "
|
|
1099
|
+
key: "getBalanceAssetsPallet",
|
|
1100
1100
|
value: function () {
|
|
1101
|
-
var
|
|
1101
|
+
var _getBalanceAssetsPallet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(address, assetId) {
|
|
1102
1102
|
var response;
|
|
1103
1103
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1104
1104
|
while (1) switch (_context12.prev = _context12.next) {
|
|
@@ -1114,10 +1114,10 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
}, _callee12, this);
|
|
1116
1116
|
}));
|
|
1117
|
-
function
|
|
1118
|
-
return
|
|
1117
|
+
function getBalanceAssetsPallet(_x22, _x23) {
|
|
1118
|
+
return _getBalanceAssetsPallet.apply(this, arguments);
|
|
1119
1119
|
}
|
|
1120
|
-
return
|
|
1120
|
+
return getBalanceAssetsPallet;
|
|
1121
1121
|
}()
|
|
1122
1122
|
}, {
|
|
1123
1123
|
key: "getFromRpc",
|
|
@@ -1612,7 +1612,8 @@ var EvmBuilder = function EvmBuilder() {
|
|
|
1612
1612
|
* @returns An extrinsic to be signed and sent.
|
|
1613
1613
|
*/
|
|
1614
1614
|
var send = createPapiApiCall(sdkCore.send);
|
|
1615
|
-
var
|
|
1615
|
+
var dryRun = createPapiApiCall(sdkCore.dryRun);
|
|
1616
|
+
var dryRunOrigin = createPapiApiCall(sdkCore.dryRunOrigin);
|
|
1616
1617
|
var getParaEthTransferFees = /*#__PURE__*/function () {
|
|
1617
1618
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
|
|
1618
1619
|
var papiApi;
|
|
@@ -1660,8 +1661,9 @@ var getBridgeStatus = /*#__PURE__*/function () {
|
|
|
1660
1661
|
|
|
1661
1662
|
var transfer = /*#__PURE__*/Object.freeze({
|
|
1662
1663
|
__proto__: null,
|
|
1664
|
+
dryRun: dryRun,
|
|
1665
|
+
dryRunOrigin: dryRunOrigin,
|
|
1663
1666
|
getBridgeStatus: getBridgeStatus,
|
|
1664
|
-
getDryRun: getDryRun,
|
|
1665
1667
|
getParaEthTransferFees: getParaEthTransferFees,
|
|
1666
1668
|
send: send
|
|
1667
1669
|
});
|
|
@@ -1671,11 +1673,12 @@ exports.EvmBuilder = EvmBuilder;
|
|
|
1671
1673
|
exports.assets = assets;
|
|
1672
1674
|
exports.claimAssets = claimAssets;
|
|
1673
1675
|
exports.createApiInstanceForNode = createApiInstanceForNode;
|
|
1676
|
+
exports.dryRun = dryRun;
|
|
1677
|
+
exports.dryRunOrigin = dryRunOrigin;
|
|
1674
1678
|
exports.getAssetBalance = getAssetBalance;
|
|
1675
1679
|
exports.getBalanceForeign = getBalanceForeign;
|
|
1676
1680
|
exports.getBalanceNative = getBalanceNative;
|
|
1677
1681
|
exports.getBridgeStatus = getBridgeStatus;
|
|
1678
|
-
exports.getDryRun = getDryRun;
|
|
1679
1682
|
exports.getMaxForeignTransferableAmount = getMaxForeignTransferableAmount;
|
|
1680
1683
|
exports.getMaxNativeTransferableAmount = getMaxNativeTransferableAmount;
|
|
1681
1684
|
exports.getOriginFeeDetails = getOriginFeeDetails;
|
package/dist/index.d.ts
CHANGED
|
@@ -204,23 +204,28 @@ declare const EvmBuilder: () => EvmBuilderCore<unknown, unknown, {
|
|
|
204
204
|
declare const send: (options: _paraspell_sdk_core.TSendBaseOptions & {
|
|
205
205
|
api?: TPapiApiOrUrl;
|
|
206
206
|
}) => Promise<TPapiTransaction>;
|
|
207
|
-
declare const
|
|
207
|
+
declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<TPapiTransaction> & {
|
|
208
208
|
api?: TPapiApiOrUrl;
|
|
209
209
|
}) => Promise<_paraspell_sdk_core.TDryRunResult>;
|
|
210
|
+
declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<TPapiTransaction> & {
|
|
211
|
+
api?: TPapiApiOrUrl;
|
|
212
|
+
}) => Promise<_paraspell_sdk_core.TDryRunNodeResult>;
|
|
210
213
|
declare const getParaEthTransferFees: (ahApi?: TPapiApiOrUrl) => Promise<[bigint, bigint]>;
|
|
211
214
|
/**
|
|
212
215
|
* Gets the Ethereum bridge status.
|
|
213
216
|
*/
|
|
214
217
|
declare const getBridgeStatus: (ahApi?: TPapiApiOrUrl) => Promise<_paraspell_sdk_core.TBridgeStatus>;
|
|
215
218
|
|
|
219
|
+
declare const transfer_dryRun: typeof dryRun;
|
|
220
|
+
declare const transfer_dryRunOrigin: typeof dryRunOrigin;
|
|
216
221
|
declare const transfer_getBridgeStatus: typeof getBridgeStatus;
|
|
217
|
-
declare const transfer_getDryRun: typeof getDryRun;
|
|
218
222
|
declare const transfer_getParaEthTransferFees: typeof getParaEthTransferFees;
|
|
219
223
|
declare const transfer_send: typeof send;
|
|
220
224
|
declare namespace transfer {
|
|
221
225
|
export {
|
|
226
|
+
transfer_dryRun as dryRun,
|
|
227
|
+
transfer_dryRunOrigin as dryRunOrigin,
|
|
222
228
|
transfer_getBridgeStatus as getBridgeStatus,
|
|
223
|
-
transfer_getDryRun as getDryRun,
|
|
224
229
|
transfer_getParaEthTransferFees as getParaEthTransferFees,
|
|
225
230
|
transfer_send as send,
|
|
226
231
|
};
|
|
@@ -228,5 +233,5 @@ declare namespace transfer {
|
|
|
228
233
|
|
|
229
234
|
declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<polkadot_api.PolkadotClient>;
|
|
230
235
|
|
|
231
|
-
export { Builder, EvmBuilder, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus,
|
|
236
|
+
export { Builder, EvmBuilder, assets, claimAssets, createApiInstanceForNode, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, verifyEdOnDestination, transfer as xcmPallet };
|
|
232
237
|
export type { GeneralBuilder, TEvmNodeFromPapi, TPapiApi, TPapiApiOrUrl, TPapiTransaction };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, Parents, Version, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getTransferInfo as getTransferInfo$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, getMaxNativeTransferableAmount as getMaxNativeTransferableAmount$1, getMaxForeignTransferableAmount as getMaxForeignTransferableAmount$1, getTransferableAmount as getTransferableAmount$1, verifyEdOnDestination as verifyEdOnDestination$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, send as send$1,
|
|
1
|
+
import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, Parents, Version, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getTransferInfo as getTransferInfo$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, getMaxNativeTransferableAmount as getMaxNativeTransferableAmount$1, getMaxForeignTransferableAmount as getMaxForeignTransferableAmount$1, getTransferableAmount as getTransferableAmount$1, verifyEdOnDestination as verifyEdOnDestination$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { blake2b } from '@noble/hashes/blake2b';
|
|
4
4
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
@@ -955,9 +955,9 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
955
955
|
return getMythosForeignBalance;
|
|
956
956
|
}()
|
|
957
957
|
}, {
|
|
958
|
-
key: "
|
|
958
|
+
key: "getBalanceForeignAssetsPallet",
|
|
959
959
|
value: function () {
|
|
960
|
-
var
|
|
960
|
+
var _getBalanceForeignAssetsPallet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(address, multiLocation) {
|
|
961
961
|
var transformedMultiLocation, res;
|
|
962
962
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
963
963
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -974,10 +974,10 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
974
974
|
}
|
|
975
975
|
}, _callee9, this);
|
|
976
976
|
}));
|
|
977
|
-
function
|
|
978
|
-
return
|
|
977
|
+
function getBalanceForeignAssetsPallet(_x11, _x12) {
|
|
978
|
+
return _getBalanceForeignAssetsPallet.apply(this, arguments);
|
|
979
979
|
}
|
|
980
|
-
return
|
|
980
|
+
return getBalanceForeignAssetsPallet;
|
|
981
981
|
}()
|
|
982
982
|
}, {
|
|
983
983
|
key: "getForeignAssetsByIdBalance",
|
|
@@ -1095,9 +1095,9 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1095
1095
|
return getBalanceForeignXTokens;
|
|
1096
1096
|
}()
|
|
1097
1097
|
}, {
|
|
1098
|
-
key: "
|
|
1098
|
+
key: "getBalanceAssetsPallet",
|
|
1099
1099
|
value: function () {
|
|
1100
|
-
var
|
|
1100
|
+
var _getBalanceAssetsPallet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(address, assetId) {
|
|
1101
1101
|
var response;
|
|
1102
1102
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1103
1103
|
while (1) switch (_context12.prev = _context12.next) {
|
|
@@ -1113,10 +1113,10 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
}, _callee12, this);
|
|
1115
1115
|
}));
|
|
1116
|
-
function
|
|
1117
|
-
return
|
|
1116
|
+
function getBalanceAssetsPallet(_x22, _x23) {
|
|
1117
|
+
return _getBalanceAssetsPallet.apply(this, arguments);
|
|
1118
1118
|
}
|
|
1119
|
-
return
|
|
1119
|
+
return getBalanceAssetsPallet;
|
|
1120
1120
|
}()
|
|
1121
1121
|
}, {
|
|
1122
1122
|
key: "getFromRpc",
|
|
@@ -1611,7 +1611,8 @@ var EvmBuilder = function EvmBuilder() {
|
|
|
1611
1611
|
* @returns An extrinsic to be signed and sent.
|
|
1612
1612
|
*/
|
|
1613
1613
|
var send = createPapiApiCall(send$1);
|
|
1614
|
-
var
|
|
1614
|
+
var dryRun = createPapiApiCall(dryRun$1);
|
|
1615
|
+
var dryRunOrigin = createPapiApiCall(dryRunOrigin$1);
|
|
1615
1616
|
var getParaEthTransferFees = /*#__PURE__*/function () {
|
|
1616
1617
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
|
|
1617
1618
|
var papiApi;
|
|
@@ -1659,10 +1660,11 @@ var getBridgeStatus = /*#__PURE__*/function () {
|
|
|
1659
1660
|
|
|
1660
1661
|
var transfer = /*#__PURE__*/Object.freeze({
|
|
1661
1662
|
__proto__: null,
|
|
1663
|
+
dryRun: dryRun,
|
|
1664
|
+
dryRunOrigin: dryRunOrigin,
|
|
1662
1665
|
getBridgeStatus: getBridgeStatus,
|
|
1663
|
-
getDryRun: getDryRun,
|
|
1664
1666
|
getParaEthTransferFees: getParaEthTransferFees,
|
|
1665
1667
|
send: send
|
|
1666
1668
|
});
|
|
1667
1669
|
|
|
1668
|
-
export { Builder, EvmBuilder, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus,
|
|
1670
|
+
export { Builder, EvmBuilder, assets, claimAssets, createApiInstanceForNode, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, verifyEdOnDestination, transfer as xcmPallet };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.1",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"ethers": "^6.13.7",
|
|
27
27
|
"viem": "^2.28.1",
|
|
28
28
|
"@noble/hashes": "^1.8.0",
|
|
29
|
-
"@paraspell/sdk-core": "8.
|
|
29
|
+
"@paraspell/sdk-core": "8.13.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"polkadot-api": ">= 1.10.
|
|
32
|
+
"polkadot-api": ">= 1.10.2 < 2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|