@paraspell/sdk-core 10.1.4 → 10.1.6
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/dist/index.cjs +6 -28
- package/dist/index.d.ts +1 -34
- package/dist/index.mjs +6 -28
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -2289,7 +2289,6 @@ exports.PolkadotXcmError = void 0;
|
|
|
2289
2289
|
exports.Version = void 0;
|
|
2290
2290
|
(function (Version) {
|
|
2291
2291
|
Version["V1"] = "V1";
|
|
2292
|
-
Version["V2"] = "V2";
|
|
2293
2292
|
Version["V3"] = "V3";
|
|
2294
2293
|
Version["V4"] = "V4";
|
|
2295
2294
|
})(exports.Version || (exports.Version = {}));
|
|
@@ -2501,13 +2500,13 @@ var createBeneficiaryMultiLocation = function createBeneficiaryMultiLocation(_re
|
|
|
2501
2500
|
interior: {
|
|
2502
2501
|
X2: [{
|
|
2503
2502
|
Parachain: paraId
|
|
2504
|
-
}, getAccountPayload(version === exports.Version.V1
|
|
2503
|
+
}, getAccountPayload(version === exports.Version.V1)]
|
|
2505
2504
|
}
|
|
2506
2505
|
};
|
|
2507
2506
|
} else if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
|
|
2508
2507
|
return {
|
|
2509
2508
|
parents: sdkCommon.Parents.ZERO,
|
|
2510
|
-
interior: createX1Payload(version, getAccountPayload(version === exports.Version.V1
|
|
2509
|
+
interior: createX1Payload(version, getAccountPayload(version === exports.Version.V1))
|
|
2511
2510
|
};
|
|
2512
2511
|
} else {
|
|
2513
2512
|
return {
|
|
@@ -6390,7 +6389,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6390
6389
|
scenario = input.scenario,
|
|
6391
6390
|
destination = input.destination,
|
|
6392
6391
|
paraIdTo = input.paraIdTo;
|
|
6393
|
-
var version = exports.Version.
|
|
6392
|
+
var version = exports.Version.V3;
|
|
6394
6393
|
var paraId = resolveParaId(paraIdTo, destination);
|
|
6395
6394
|
var customMultiLocation = {
|
|
6396
6395
|
parents: sdkCommon.Parents.ONE,
|
|
@@ -6417,31 +6416,10 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6417
6416
|
}, {
|
|
6418
6417
|
key: "patchInput",
|
|
6419
6418
|
value: function patchInput(input) {
|
|
6420
|
-
var _asset$symbol, _asset$symbol2;
|
|
6421
6419
|
var asset = input.asset,
|
|
6422
6420
|
destination = input.destination,
|
|
6423
|
-
paraIdTo = input.paraIdTo,
|
|
6424
|
-
scenario = input.scenario,
|
|
6425
|
-
api = input.api,
|
|
6426
6421
|
_input$version3 = input.version,
|
|
6427
|
-
version = _input$version3 === void 0 ? this.version : _input$version3
|
|
6428
|
-
address = input.address;
|
|
6429
|
-
if ((((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toUpperCase()) === 'USDT' || ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toUpperCase()) === 'USDC') && destination === 'BifrostPolkadot') {
|
|
6430
|
-
var _input$version4;
|
|
6431
|
-
var versionOrDefault = (_input$version4 = input.version) !== null && _input$version4 !== void 0 ? _input$version4 : exports.Version.V2;
|
|
6432
|
-
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
6433
|
-
header: this.createVersionedDestination(scenario, versionOrDefault, destination, paraIdTo),
|
|
6434
|
-
addressSelection: createVersionedBeneficiary({
|
|
6435
|
-
api: api,
|
|
6436
|
-
scenario: scenario,
|
|
6437
|
-
pallet: 'PolkadotXcm',
|
|
6438
|
-
recipientAddress: address,
|
|
6439
|
-
version: versionOrDefault,
|
|
6440
|
-
paraId: paraIdTo
|
|
6441
|
-
}),
|
|
6442
|
-
currencySelection: this.createCurrencySpec(asset.amount, scenario, versionOrDefault, asset)
|
|
6443
|
-
});
|
|
6444
|
-
}
|
|
6422
|
+
version = _input$version3 === void 0 ? this.version : _input$version3;
|
|
6445
6423
|
if ((destination === 'Hydration' || destination === 'Polimec' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && asset.symbol === 'DOT') {
|
|
6446
6424
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
6447
6425
|
currencySelection: createVersionedMultiAssets(version, asset.amount, DOT_MULTILOCATION)
|
|
@@ -8051,7 +8029,7 @@ var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8051
8029
|
var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
8052
8030
|
function Peaq() {
|
|
8053
8031
|
_classCallCheck(this, Peaq);
|
|
8054
|
-
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', exports.Version.
|
|
8032
|
+
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', exports.Version.V3]);
|
|
8055
8033
|
}
|
|
8056
8034
|
_inherits(Peaq, _ParachainNode);
|
|
8057
8035
|
return _createClass(Peaq, [{
|
|
@@ -8102,7 +8080,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8102
8080
|
var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
8103
8081
|
function Pendulum() {
|
|
8104
8082
|
_classCallCheck(this, Pendulum);
|
|
8105
|
-
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', exports.Version.
|
|
8083
|
+
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', exports.Version.V3]);
|
|
8106
8084
|
}
|
|
8107
8085
|
_inherits(Pendulum, _ParachainNode);
|
|
8108
8086
|
return _createClass(Pendulum, [{
|
package/dist/index.d.ts
CHANGED
|
@@ -121,14 +121,13 @@ type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
|
121
121
|
*/
|
|
122
122
|
declare enum Version {
|
|
123
123
|
V1 = "V1",
|
|
124
|
-
V2 = "V2",
|
|
125
124
|
V3 = "V3",
|
|
126
125
|
V4 = "V4"
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* The supported XCM versions for asset claims.
|
|
130
129
|
*/
|
|
131
|
-
type TVersionClaimAssets = Version.V3
|
|
130
|
+
type TVersionClaimAssets = Version.V3;
|
|
132
131
|
type TAddress = string | TMultiLocation;
|
|
133
132
|
type TDestination = TNodeWithRelayChains | TMultiLocation;
|
|
134
133
|
type TRelayToParaDestination = TNodePolkadotKusama | TMultiLocation;
|
|
@@ -1271,23 +1270,15 @@ declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> imple
|
|
|
1271
1270
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
1272
1271
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, isOverridenAsset?: boolean): {
|
|
1273
1272
|
V1: _paraspell_assets.TMultiAsset[];
|
|
1274
|
-
V2?: undefined;
|
|
1275
|
-
V3?: undefined;
|
|
1276
|
-
V4?: undefined;
|
|
1277
|
-
} | {
|
|
1278
|
-
V2: _paraspell_assets.TMultiAsset[];
|
|
1279
|
-
V1?: undefined;
|
|
1280
1273
|
V3?: undefined;
|
|
1281
1274
|
V4?: undefined;
|
|
1282
1275
|
} | {
|
|
1283
1276
|
V3: _paraspell_assets.TMultiAsset[];
|
|
1284
1277
|
V1?: undefined;
|
|
1285
|
-
V2?: undefined;
|
|
1286
1278
|
V4?: undefined;
|
|
1287
1279
|
} | {
|
|
1288
1280
|
V4: _paraspell_assets.TMultiAsset[];
|
|
1289
1281
|
V1?: undefined;
|
|
1290
|
-
V2?: undefined;
|
|
1291
1282
|
V3?: undefined;
|
|
1292
1283
|
};
|
|
1293
1284
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
@@ -1307,23 +1298,15 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
|
|
|
1307
1298
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
1308
1299
|
createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, asset?: TAsset, isOverriddenAsset?: boolean): {
|
|
1309
1300
|
V1: _paraspell_assets.TMultiAsset[];
|
|
1310
|
-
V2?: undefined;
|
|
1311
|
-
V3?: undefined;
|
|
1312
|
-
V4?: undefined;
|
|
1313
|
-
} | {
|
|
1314
|
-
V2: _paraspell_assets.TMultiAsset[];
|
|
1315
|
-
V1?: undefined;
|
|
1316
1301
|
V3?: undefined;
|
|
1317
1302
|
V4?: undefined;
|
|
1318
1303
|
} | {
|
|
1319
1304
|
V3: _paraspell_assets.TMultiAsset[];
|
|
1320
1305
|
V1?: undefined;
|
|
1321
|
-
V2?: undefined;
|
|
1322
1306
|
V4?: undefined;
|
|
1323
1307
|
} | {
|
|
1324
1308
|
V4: _paraspell_assets.TMultiAsset[];
|
|
1325
1309
|
V1?: undefined;
|
|
1326
|
-
V2?: undefined;
|
|
1327
1310
|
V3?: undefined;
|
|
1328
1311
|
};
|
|
1329
1312
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
@@ -1459,23 +1442,15 @@ declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPol
|
|
|
1459
1442
|
transferRelayToPara(): TSerializedApiCall;
|
|
1460
1443
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset): {
|
|
1461
1444
|
V1: _paraspell_assets.TMultiAsset[];
|
|
1462
|
-
V2?: undefined;
|
|
1463
|
-
V3?: undefined;
|
|
1464
|
-
V4?: undefined;
|
|
1465
|
-
} | {
|
|
1466
|
-
V2: _paraspell_assets.TMultiAsset[];
|
|
1467
|
-
V1?: undefined;
|
|
1468
1445
|
V3?: undefined;
|
|
1469
1446
|
V4?: undefined;
|
|
1470
1447
|
} | {
|
|
1471
1448
|
V3: _paraspell_assets.TMultiAsset[];
|
|
1472
1449
|
V1?: undefined;
|
|
1473
|
-
V2?: undefined;
|
|
1474
1450
|
V4?: undefined;
|
|
1475
1451
|
} | {
|
|
1476
1452
|
V4: _paraspell_assets.TMultiAsset[];
|
|
1477
1453
|
V1?: undefined;
|
|
1478
|
-
V2?: undefined;
|
|
1479
1454
|
V3?: undefined;
|
|
1480
1455
|
};
|
|
1481
1456
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
@@ -1505,23 +1480,15 @@ declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
1505
1480
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1506
1481
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset): {
|
|
1507
1482
|
V1: _paraspell_assets.TMultiAsset[];
|
|
1508
|
-
V2?: undefined;
|
|
1509
|
-
V3?: undefined;
|
|
1510
|
-
V4?: undefined;
|
|
1511
|
-
} | {
|
|
1512
|
-
V2: _paraspell_assets.TMultiAsset[];
|
|
1513
|
-
V1?: undefined;
|
|
1514
1483
|
V3?: undefined;
|
|
1515
1484
|
V4?: undefined;
|
|
1516
1485
|
} | {
|
|
1517
1486
|
V3: _paraspell_assets.TMultiAsset[];
|
|
1518
1487
|
V1?: undefined;
|
|
1519
|
-
V2?: undefined;
|
|
1520
1488
|
V4?: undefined;
|
|
1521
1489
|
} | {
|
|
1522
1490
|
V4: _paraspell_assets.TMultiAsset[];
|
|
1523
1491
|
V1?: undefined;
|
|
1524
|
-
V2?: undefined;
|
|
1525
1492
|
V3?: undefined;
|
|
1526
1493
|
};
|
|
1527
1494
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
package/dist/index.mjs
CHANGED
|
@@ -2290,7 +2290,6 @@ var PolkadotXcmError;
|
|
|
2290
2290
|
var Version;
|
|
2291
2291
|
(function (Version) {
|
|
2292
2292
|
Version["V1"] = "V1";
|
|
2293
|
-
Version["V2"] = "V2";
|
|
2294
2293
|
Version["V3"] = "V3";
|
|
2295
2294
|
Version["V4"] = "V4";
|
|
2296
2295
|
})(Version || (Version = {}));
|
|
@@ -2502,13 +2501,13 @@ var createBeneficiaryMultiLocation = function createBeneficiaryMultiLocation(_re
|
|
|
2502
2501
|
interior: {
|
|
2503
2502
|
X2: [{
|
|
2504
2503
|
Parachain: paraId
|
|
2505
|
-
}, getAccountPayload(version === Version.V1
|
|
2504
|
+
}, getAccountPayload(version === Version.V1)]
|
|
2506
2505
|
}
|
|
2507
2506
|
};
|
|
2508
2507
|
} else if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
|
|
2509
2508
|
return {
|
|
2510
2509
|
parents: Parents.ZERO,
|
|
2511
|
-
interior: createX1Payload(version, getAccountPayload(version === Version.V1
|
|
2510
|
+
interior: createX1Payload(version, getAccountPayload(version === Version.V1))
|
|
2512
2511
|
};
|
|
2513
2512
|
} else {
|
|
2514
2513
|
return {
|
|
@@ -6391,7 +6390,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6391
6390
|
scenario = input.scenario,
|
|
6392
6391
|
destination = input.destination,
|
|
6393
6392
|
paraIdTo = input.paraIdTo;
|
|
6394
|
-
var version = Version.
|
|
6393
|
+
var version = Version.V3;
|
|
6395
6394
|
var paraId = resolveParaId(paraIdTo, destination);
|
|
6396
6395
|
var customMultiLocation = {
|
|
6397
6396
|
parents: Parents.ONE,
|
|
@@ -6418,31 +6417,10 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
6418
6417
|
}, {
|
|
6419
6418
|
key: "patchInput",
|
|
6420
6419
|
value: function patchInput(input) {
|
|
6421
|
-
var _asset$symbol, _asset$symbol2;
|
|
6422
6420
|
var asset = input.asset,
|
|
6423
6421
|
destination = input.destination,
|
|
6424
|
-
paraIdTo = input.paraIdTo,
|
|
6425
|
-
scenario = input.scenario,
|
|
6426
|
-
api = input.api,
|
|
6427
6422
|
_input$version3 = input.version,
|
|
6428
|
-
version = _input$version3 === void 0 ? this.version : _input$version3
|
|
6429
|
-
address = input.address;
|
|
6430
|
-
if ((((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toUpperCase()) === 'USDT' || ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toUpperCase()) === 'USDC') && destination === 'BifrostPolkadot') {
|
|
6431
|
-
var _input$version4;
|
|
6432
|
-
var versionOrDefault = (_input$version4 = input.version) !== null && _input$version4 !== void 0 ? _input$version4 : Version.V2;
|
|
6433
|
-
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
6434
|
-
header: this.createVersionedDestination(scenario, versionOrDefault, destination, paraIdTo),
|
|
6435
|
-
addressSelection: createVersionedBeneficiary({
|
|
6436
|
-
api: api,
|
|
6437
|
-
scenario: scenario,
|
|
6438
|
-
pallet: 'PolkadotXcm',
|
|
6439
|
-
recipientAddress: address,
|
|
6440
|
-
version: versionOrDefault,
|
|
6441
|
-
paraId: paraIdTo
|
|
6442
|
-
}),
|
|
6443
|
-
currencySelection: this.createCurrencySpec(asset.amount, scenario, versionOrDefault, asset)
|
|
6444
|
-
});
|
|
6445
|
-
}
|
|
6423
|
+
version = _input$version3 === void 0 ? this.version : _input$version3;
|
|
6446
6424
|
if ((destination === 'Hydration' || destination === 'Polimec' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && asset.symbol === 'DOT') {
|
|
6447
6425
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
6448
6426
|
currencySelection: createVersionedMultiAssets(version, asset.amount, DOT_MULTILOCATION)
|
|
@@ -8052,7 +8030,7 @@ var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8052
8030
|
var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
8053
8031
|
function Peaq() {
|
|
8054
8032
|
_classCallCheck(this, Peaq);
|
|
8055
|
-
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', Version.
|
|
8033
|
+
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', Version.V3]);
|
|
8056
8034
|
}
|
|
8057
8035
|
_inherits(Peaq, _ParachainNode);
|
|
8058
8036
|
return _createClass(Peaq, [{
|
|
@@ -8103,7 +8081,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8103
8081
|
var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
8104
8082
|
function Pendulum() {
|
|
8105
8083
|
_classCallCheck(this, Pendulum);
|
|
8106
|
-
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', Version.
|
|
8084
|
+
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', Version.V3]);
|
|
8107
8085
|
}
|
|
8108
8086
|
_inherits(Pendulum, _ParachainNode);
|
|
8109
8087
|
return _createClass(Pendulum, [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.6",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@scure/base": "^1.2.5",
|
|
28
28
|
"ethers": "^6.13.7",
|
|
29
29
|
"viem": "^2.28.1",
|
|
30
|
-
"@paraspell/assets": "10.1.
|
|
31
|
-
"@paraspell/sdk-common": "10.1.
|
|
32
|
-
"@paraspell/pallets": "10.1.
|
|
30
|
+
"@paraspell/assets": "10.1.6",
|
|
31
|
+
"@paraspell/sdk-common": "10.1.6",
|
|
32
|
+
"@paraspell/pallets": "10.1.6"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|