@paraspell/sdk 8.4.1 → 8.5.0
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 +4 -0
- package/dist/index.cjs +24 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +25 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -333,6 +333,10 @@ await getTransferableAmount({address, node, currency /*- {id: currencyID} | {sym
|
|
|
333
333
|
|
|
334
334
|
//Get all the information about XCM transfer
|
|
335
335
|
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 */})
|
|
336
|
+
|
|
337
|
+
//Get bridge and execution fee for transfer from Parachain to Ethereum. Returns as an object of 2 values
|
|
338
|
+
await getParaEthTransferFees(/*api - optional (Can also be WS port string or array o WS ports. Must be AssetHubPolkadot WS!)*/): [bridgeFee, executionFee]
|
|
339
|
+
|
|
336
340
|
```
|
|
337
341
|
|
|
338
342
|
## 💻 Tests
|
package/dist/index.cjs
CHANGED
|
@@ -1201,10 +1201,33 @@ var createPapiApiCall = function createPapiApiCall(apiCall) {
|
|
|
1201
1201
|
*/
|
|
1202
1202
|
var send = createPapiApiCall(sdkCore.send);
|
|
1203
1203
|
var getDryRun = createPapiApiCall(sdkCore.getDryRun);
|
|
1204
|
+
var getParaEthTransferFees = /*#__PURE__*/function () {
|
|
1205
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
|
|
1206
|
+
var papiApi;
|
|
1207
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1208
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1209
|
+
case 0:
|
|
1210
|
+
papiApi = new PapiApi();
|
|
1211
|
+
papiApi.setApi(ahApi);
|
|
1212
|
+
_context.next = 4;
|
|
1213
|
+
return papiApi.init('AssetHubPolkadot');
|
|
1214
|
+
case 4:
|
|
1215
|
+
return _context.abrupt("return", sdkCore.getParaEthTransferFees(papiApi));
|
|
1216
|
+
case 5:
|
|
1217
|
+
case "end":
|
|
1218
|
+
return _context.stop();
|
|
1219
|
+
}
|
|
1220
|
+
}, _callee);
|
|
1221
|
+
}));
|
|
1222
|
+
return function getParaEthTransferFees(_x) {
|
|
1223
|
+
return _ref.apply(this, arguments);
|
|
1224
|
+
};
|
|
1225
|
+
}();
|
|
1204
1226
|
|
|
1205
1227
|
var transfer = /*#__PURE__*/Object.freeze({
|
|
1206
1228
|
__proto__: null,
|
|
1207
1229
|
getDryRun: getDryRun,
|
|
1230
|
+
getParaEthTransferFees: getParaEthTransferFees,
|
|
1208
1231
|
send: send
|
|
1209
1232
|
});
|
|
1210
1233
|
|
|
@@ -1426,6 +1449,7 @@ exports.getDryRun = getDryRun;
|
|
|
1426
1449
|
exports.getMaxForeignTransferableAmount = getMaxForeignTransferableAmount;
|
|
1427
1450
|
exports.getMaxNativeTransferableAmount = getMaxNativeTransferableAmount;
|
|
1428
1451
|
exports.getOriginFeeDetails = getOriginFeeDetails;
|
|
1452
|
+
exports.getParaEthTransferFees = getParaEthTransferFees;
|
|
1429
1453
|
exports.getTransferInfo = getTransferInfo;
|
|
1430
1454
|
exports.getTransferableAmount = getTransferableAmount;
|
|
1431
1455
|
exports.send = send;
|
package/dist/index.d.ts
CHANGED
|
@@ -24,11 +24,13 @@ declare const send: (options: _paraspell_sdk_core.TSendBaseOptions & {
|
|
|
24
24
|
declare const getDryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<TPapiTransaction> & {
|
|
25
25
|
api?: TPapiApiOrUrl;
|
|
26
26
|
}) => Promise<_paraspell_sdk_core.TDryRunResult>;
|
|
27
|
+
declare const getParaEthTransferFees: (ahApi?: TPapiApiOrUrl) => Promise<[bigint, bigint]>;
|
|
27
28
|
|
|
28
29
|
declare const transfer_getDryRun: typeof getDryRun;
|
|
30
|
+
declare const transfer_getParaEthTransferFees: typeof getParaEthTransferFees;
|
|
29
31
|
declare const transfer_send: typeof send;
|
|
30
32
|
declare namespace transfer {
|
|
31
|
-
export { transfer_getDryRun as getDryRun, transfer_send as send };
|
|
33
|
+
export { transfer_getDryRun as getDryRun, transfer_getParaEthTransferFees as getParaEthTransferFees, transfer_send as send };
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
@@ -185,4 +187,4 @@ type IFinalBuilderWithOptions = IFinalBuilderWithOptions$1<TPapiApi, TPapiTransa
|
|
|
185
187
|
|
|
186
188
|
declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<polkadot_api.PolkadotClient>;
|
|
187
189
|
|
|
188
|
-
export { Builder, EvmBuilder, GeneralBuilder, type IFinalBuilderWithOptions, type TPapiApi, type TPapiApiOrUrl, type TPapiTransaction, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getTransferInfo, getTransferableAmount, send, transfer as xcmPallet };
|
|
190
|
+
export { Builder, EvmBuilder, GeneralBuilder, type IFinalBuilderWithOptions, type TPapiApi, type TPapiApiOrUrl, type TPapiTransaction, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, transfer as xcmPallet };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, send as send$1, getDryRun as getDryRun$1, 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, Foreign, ForeignAbstract, Native, Override, getAllAssetsSymbols, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, transferMoonbeamEvm, Builder as Builder$1, GeneralBuilder as GeneralBuilder$1 } from '@paraspell/sdk-core';
|
|
1
|
+
import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, send as send$1, getDryRun as getDryRun$1, getParaEthTransferFees as getParaEthTransferFees$1, 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, Foreign, ForeignAbstract, Native, Override, getAllAssetsSymbols, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, transferMoonbeamEvm, Builder as Builder$1, GeneralBuilder as GeneralBuilder$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { withPolkadotSdkCompat } from 'polkadot-api/polkadot-sdk-compat';
|
|
4
4
|
import { FixedSizeBinary, createClient } from 'polkadot-api';
|
|
@@ -1200,10 +1200,33 @@ var createPapiApiCall = function createPapiApiCall(apiCall) {
|
|
|
1200
1200
|
*/
|
|
1201
1201
|
var send = createPapiApiCall(send$1);
|
|
1202
1202
|
var getDryRun = createPapiApiCall(getDryRun$1);
|
|
1203
|
+
var getParaEthTransferFees = /*#__PURE__*/function () {
|
|
1204
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
|
|
1205
|
+
var papiApi;
|
|
1206
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1207
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1208
|
+
case 0:
|
|
1209
|
+
papiApi = new PapiApi();
|
|
1210
|
+
papiApi.setApi(ahApi);
|
|
1211
|
+
_context.next = 4;
|
|
1212
|
+
return papiApi.init('AssetHubPolkadot');
|
|
1213
|
+
case 4:
|
|
1214
|
+
return _context.abrupt("return", getParaEthTransferFees$1(papiApi));
|
|
1215
|
+
case 5:
|
|
1216
|
+
case "end":
|
|
1217
|
+
return _context.stop();
|
|
1218
|
+
}
|
|
1219
|
+
}, _callee);
|
|
1220
|
+
}));
|
|
1221
|
+
return function getParaEthTransferFees(_x) {
|
|
1222
|
+
return _ref.apply(this, arguments);
|
|
1223
|
+
};
|
|
1224
|
+
}();
|
|
1203
1225
|
|
|
1204
1226
|
var transfer = /*#__PURE__*/Object.freeze({
|
|
1205
1227
|
__proto__: null,
|
|
1206
1228
|
getDryRun: getDryRun,
|
|
1229
|
+
getParaEthTransferFees: getParaEthTransferFees,
|
|
1207
1230
|
send: send
|
|
1208
1231
|
});
|
|
1209
1232
|
|
|
@@ -1412,4 +1435,4 @@ var EvmBuilder = function EvmBuilder() {
|
|
|
1412
1435
|
return EvmBuilder$1(papiApi);
|
|
1413
1436
|
};
|
|
1414
1437
|
|
|
1415
|
-
export { Builder, EvmBuilder, GeneralBuilder, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getTransferInfo, getTransferableAmount, send, transfer as xcmPallet };
|
|
1438
|
+
export { Builder, EvmBuilder, GeneralBuilder, assets, claimAssets, createApiInstanceForNode, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTransferInfo, getTransferableAmount, send, transfer as xcmPallet };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"ethers": "^6.13.5",
|
|
27
27
|
"viem": "^2.22.22",
|
|
28
|
-
"@paraspell/sdk-core": "8.
|
|
28
|
+
"@paraspell/sdk-core": "8.5.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"polkadot-api": ">= 1.8.4 < 2"
|