@paraspell/sdk-core 9.2.4 → 9.2.5
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
|
@@ -2261,7 +2261,6 @@ exports.PolkadotXcmError = void 0;
|
|
|
2261
2261
|
exports.Version = void 0;
|
|
2262
2262
|
(function (Version) {
|
|
2263
2263
|
Version["V1"] = "V1";
|
|
2264
|
-
Version["V2"] = "V2";
|
|
2265
2264
|
Version["V3"] = "V3";
|
|
2266
2265
|
Version["V4"] = "V4";
|
|
2267
2266
|
})(exports.Version || (exports.Version = {}));
|
|
@@ -2473,13 +2472,13 @@ var createBeneficiaryMultiLocation = function createBeneficiaryMultiLocation(_re
|
|
|
2473
2472
|
interior: {
|
|
2474
2473
|
X2: [{
|
|
2475
2474
|
Parachain: paraId
|
|
2476
|
-
}, getAccountPayload(version === exports.Version.V1
|
|
2475
|
+
}, getAccountPayload(version === exports.Version.V1)]
|
|
2477
2476
|
}
|
|
2478
2477
|
};
|
|
2479
2478
|
} else if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
|
|
2480
2479
|
return {
|
|
2481
2480
|
parents: sdkCommon.Parents.ZERO,
|
|
2482
|
-
interior: createX1Payload(version, getAccountPayload(version === exports.Version.V1
|
|
2481
|
+
interior: createX1Payload(version, getAccountPayload(version === exports.Version.V1))
|
|
2483
2482
|
};
|
|
2484
2483
|
} else {
|
|
2485
2484
|
return {
|
|
@@ -5858,7 +5857,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
5858
5857
|
scenario = input.scenario,
|
|
5859
5858
|
destination = input.destination,
|
|
5860
5859
|
paraIdTo = input.paraIdTo;
|
|
5861
|
-
var version = exports.Version.
|
|
5860
|
+
var version = exports.Version.V3;
|
|
5862
5861
|
var paraId = resolveParaId(paraIdTo, destination);
|
|
5863
5862
|
var customMultiLocation = {
|
|
5864
5863
|
parents: sdkCommon.Parents.ONE,
|
|
@@ -5885,31 +5884,10 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
5885
5884
|
}, {
|
|
5886
5885
|
key: "patchInput",
|
|
5887
5886
|
value: function patchInput(input) {
|
|
5888
|
-
var _asset$symbol, _asset$symbol2;
|
|
5889
5887
|
var asset = input.asset,
|
|
5890
5888
|
destination = input.destination,
|
|
5891
|
-
paraIdTo = input.paraIdTo,
|
|
5892
|
-
scenario = input.scenario,
|
|
5893
|
-
api = input.api,
|
|
5894
5889
|
_input$version3 = input.version,
|
|
5895
|
-
version = _input$version3 === void 0 ? this.version : _input$version3
|
|
5896
|
-
address = input.address;
|
|
5897
|
-
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') {
|
|
5898
|
-
var _input$version4;
|
|
5899
|
-
var versionOrDefault = (_input$version4 = input.version) !== null && _input$version4 !== void 0 ? _input$version4 : exports.Version.V2;
|
|
5900
|
-
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
5901
|
-
header: this.createVersionedDestination(scenario, versionOrDefault, destination, paraIdTo),
|
|
5902
|
-
addressSelection: createVersionedBeneficiary({
|
|
5903
|
-
api: api,
|
|
5904
|
-
scenario: scenario,
|
|
5905
|
-
pallet: 'PolkadotXcm',
|
|
5906
|
-
recipientAddress: address,
|
|
5907
|
-
version: versionOrDefault,
|
|
5908
|
-
paraId: paraIdTo
|
|
5909
|
-
}),
|
|
5910
|
-
currencySelection: this.createCurrencySpec(asset.amount, scenario, versionOrDefault, asset)
|
|
5911
|
-
});
|
|
5912
|
-
}
|
|
5890
|
+
version = _input$version3 === void 0 ? this.version : _input$version3;
|
|
5913
5891
|
if ((destination === 'Hydration' || destination === 'Polimec' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && asset.symbol === 'DOT') {
|
|
5914
5892
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
5915
5893
|
currencySelection: createVersionedMultiAssets(version, asset.amount, DOT_MULTILOCATION)
|
|
@@ -7529,7 +7507,7 @@ var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7529
7507
|
var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
7530
7508
|
function Peaq() {
|
|
7531
7509
|
_classCallCheck(this, Peaq);
|
|
7532
|
-
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', exports.Version.
|
|
7510
|
+
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', exports.Version.V3]);
|
|
7533
7511
|
}
|
|
7534
7512
|
_inherits(Peaq, _ParachainNode);
|
|
7535
7513
|
return _createClass(Peaq, [{
|
|
@@ -7580,7 +7558,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7580
7558
|
var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
7581
7559
|
function Pendulum() {
|
|
7582
7560
|
_classCallCheck(this, Pendulum);
|
|
7583
|
-
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', exports.Version.
|
|
7561
|
+
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', exports.Version.V3]);
|
|
7584
7562
|
}
|
|
7585
7563
|
_inherits(Pendulum, _ParachainNode);
|
|
7586
7564
|
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;
|
|
@@ -1050,23 +1049,15 @@ declare class AssetHubKusama<TApi, TRes> extends ParachainNode<TApi, TRes> imple
|
|
|
1050
1049
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
1051
1050
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, asset?: TAsset, isOverridenAsset?: boolean): {
|
|
1052
1051
|
V1: _paraspell_assets.TMultiAsset[];
|
|
1053
|
-
V2?: undefined;
|
|
1054
|
-
V3?: undefined;
|
|
1055
|
-
V4?: undefined;
|
|
1056
|
-
} | {
|
|
1057
|
-
V2: _paraspell_assets.TMultiAsset[];
|
|
1058
|
-
V1?: undefined;
|
|
1059
1052
|
V3?: undefined;
|
|
1060
1053
|
V4?: undefined;
|
|
1061
1054
|
} | {
|
|
1062
1055
|
V3: _paraspell_assets.TMultiAsset[];
|
|
1063
1056
|
V1?: undefined;
|
|
1064
|
-
V2?: undefined;
|
|
1065
1057
|
V4?: undefined;
|
|
1066
1058
|
} | {
|
|
1067
1059
|
V4: _paraspell_assets.TMultiAsset[];
|
|
1068
1060
|
V1?: undefined;
|
|
1069
|
-
V2?: undefined;
|
|
1070
1061
|
V3?: undefined;
|
|
1071
1062
|
};
|
|
1072
1063
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
@@ -1086,23 +1077,15 @@ declare class AssetHubPolkadot<TApi, TRes> extends ParachainNode<TApi, TRes> imp
|
|
|
1086
1077
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
1087
1078
|
createCurrencySpec(amount: TAmount, scenario: TScenario, version: Version, asset?: TAsset, isOverriddenAsset?: boolean): {
|
|
1088
1079
|
V1: _paraspell_assets.TMultiAsset[];
|
|
1089
|
-
V2?: undefined;
|
|
1090
|
-
V3?: undefined;
|
|
1091
|
-
V4?: undefined;
|
|
1092
|
-
} | {
|
|
1093
|
-
V2: _paraspell_assets.TMultiAsset[];
|
|
1094
|
-
V1?: undefined;
|
|
1095
1080
|
V3?: undefined;
|
|
1096
1081
|
V4?: undefined;
|
|
1097
1082
|
} | {
|
|
1098
1083
|
V3: _paraspell_assets.TMultiAsset[];
|
|
1099
1084
|
V1?: undefined;
|
|
1100
|
-
V2?: undefined;
|
|
1101
1085
|
V4?: undefined;
|
|
1102
1086
|
} | {
|
|
1103
1087
|
V4: _paraspell_assets.TMultiAsset[];
|
|
1104
1088
|
V1?: undefined;
|
|
1105
|
-
V2?: undefined;
|
|
1106
1089
|
V3?: undefined;
|
|
1107
1090
|
};
|
|
1108
1091
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
@@ -1238,23 +1221,15 @@ declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPol
|
|
|
1238
1221
|
transferRelayToPara(): TSerializedApiCall;
|
|
1239
1222
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset): {
|
|
1240
1223
|
V1: _paraspell_assets.TMultiAsset[];
|
|
1241
|
-
V2?: undefined;
|
|
1242
|
-
V3?: undefined;
|
|
1243
|
-
V4?: undefined;
|
|
1244
|
-
} | {
|
|
1245
|
-
V2: _paraspell_assets.TMultiAsset[];
|
|
1246
|
-
V1?: undefined;
|
|
1247
1224
|
V3?: undefined;
|
|
1248
1225
|
V4?: undefined;
|
|
1249
1226
|
} | {
|
|
1250
1227
|
V3: _paraspell_assets.TMultiAsset[];
|
|
1251
1228
|
V1?: undefined;
|
|
1252
|
-
V2?: undefined;
|
|
1253
1229
|
V4?: undefined;
|
|
1254
1230
|
} | {
|
|
1255
1231
|
V4: _paraspell_assets.TMultiAsset[];
|
|
1256
1232
|
V1?: undefined;
|
|
1257
|
-
V2?: undefined;
|
|
1258
1233
|
V3?: undefined;
|
|
1259
1234
|
};
|
|
1260
1235
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
@@ -1284,23 +1259,15 @@ declare class Darwinia<TApi, TRes> extends ParachainNode<TApi, TRes> implements
|
|
|
1284
1259
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1285
1260
|
createCurrencySpec(amount: string, scenario: TScenario, version: Version, _asset?: TAsset): {
|
|
1286
1261
|
V1: _paraspell_assets.TMultiAsset[];
|
|
1287
|
-
V2?: undefined;
|
|
1288
|
-
V3?: undefined;
|
|
1289
|
-
V4?: undefined;
|
|
1290
|
-
} | {
|
|
1291
|
-
V2: _paraspell_assets.TMultiAsset[];
|
|
1292
|
-
V1?: undefined;
|
|
1293
1262
|
V3?: undefined;
|
|
1294
1263
|
V4?: undefined;
|
|
1295
1264
|
} | {
|
|
1296
1265
|
V3: _paraspell_assets.TMultiAsset[];
|
|
1297
1266
|
V1?: undefined;
|
|
1298
|
-
V2?: undefined;
|
|
1299
1267
|
V4?: undefined;
|
|
1300
1268
|
} | {
|
|
1301
1269
|
V4: _paraspell_assets.TMultiAsset[];
|
|
1302
1270
|
V1?: undefined;
|
|
1303
|
-
V2?: undefined;
|
|
1304
1271
|
V3?: undefined;
|
|
1305
1272
|
};
|
|
1306
1273
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
package/dist/index.mjs
CHANGED
|
@@ -2262,7 +2262,6 @@ var PolkadotXcmError;
|
|
|
2262
2262
|
var Version;
|
|
2263
2263
|
(function (Version) {
|
|
2264
2264
|
Version["V1"] = "V1";
|
|
2265
|
-
Version["V2"] = "V2";
|
|
2266
2265
|
Version["V3"] = "V3";
|
|
2267
2266
|
Version["V4"] = "V4";
|
|
2268
2267
|
})(Version || (Version = {}));
|
|
@@ -2474,13 +2473,13 @@ var createBeneficiaryMultiLocation = function createBeneficiaryMultiLocation(_re
|
|
|
2474
2473
|
interior: {
|
|
2475
2474
|
X2: [{
|
|
2476
2475
|
Parachain: paraId
|
|
2477
|
-
}, getAccountPayload(version === Version.V1
|
|
2476
|
+
}, getAccountPayload(version === Version.V1)]
|
|
2478
2477
|
}
|
|
2479
2478
|
};
|
|
2480
2479
|
} else if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
|
|
2481
2480
|
return {
|
|
2482
2481
|
parents: Parents.ZERO,
|
|
2483
|
-
interior: createX1Payload(version, getAccountPayload(version === Version.V1
|
|
2482
|
+
interior: createX1Payload(version, getAccountPayload(version === Version.V1))
|
|
2484
2483
|
};
|
|
2485
2484
|
} else {
|
|
2486
2485
|
return {
|
|
@@ -5859,7 +5858,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
5859
5858
|
scenario = input.scenario,
|
|
5860
5859
|
destination = input.destination,
|
|
5861
5860
|
paraIdTo = input.paraIdTo;
|
|
5862
|
-
var version = Version.
|
|
5861
|
+
var version = Version.V3;
|
|
5863
5862
|
var paraId = resolveParaId(paraIdTo, destination);
|
|
5864
5863
|
var customMultiLocation = {
|
|
5865
5864
|
parents: Parents.ONE,
|
|
@@ -5886,31 +5885,10 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
|
|
|
5886
5885
|
}, {
|
|
5887
5886
|
key: "patchInput",
|
|
5888
5887
|
value: function patchInput(input) {
|
|
5889
|
-
var _asset$symbol, _asset$symbol2;
|
|
5890
5888
|
var asset = input.asset,
|
|
5891
5889
|
destination = input.destination,
|
|
5892
|
-
paraIdTo = input.paraIdTo,
|
|
5893
|
-
scenario = input.scenario,
|
|
5894
|
-
api = input.api,
|
|
5895
5890
|
_input$version3 = input.version,
|
|
5896
|
-
version = _input$version3 === void 0 ? this.version : _input$version3
|
|
5897
|
-
address = input.address;
|
|
5898
|
-
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') {
|
|
5899
|
-
var _input$version4;
|
|
5900
|
-
var versionOrDefault = (_input$version4 = input.version) !== null && _input$version4 !== void 0 ? _input$version4 : Version.V2;
|
|
5901
|
-
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
5902
|
-
header: this.createVersionedDestination(scenario, versionOrDefault, destination, paraIdTo),
|
|
5903
|
-
addressSelection: createVersionedBeneficiary({
|
|
5904
|
-
api: api,
|
|
5905
|
-
scenario: scenario,
|
|
5906
|
-
pallet: 'PolkadotXcm',
|
|
5907
|
-
recipientAddress: address,
|
|
5908
|
-
version: versionOrDefault,
|
|
5909
|
-
paraId: paraIdTo
|
|
5910
|
-
}),
|
|
5911
|
-
currencySelection: this.createCurrencySpec(asset.amount, scenario, versionOrDefault, asset)
|
|
5912
|
-
});
|
|
5913
|
-
}
|
|
5891
|
+
version = _input$version3 === void 0 ? this.version : _input$version3;
|
|
5914
5892
|
if ((destination === 'Hydration' || destination === 'Polimec' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && asset.symbol === 'DOT') {
|
|
5915
5893
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
5916
5894
|
currencySelection: createVersionedMultiAssets(version, asset.amount, DOT_MULTILOCATION)
|
|
@@ -7530,7 +7508,7 @@ var Nodle = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7530
7508
|
var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
7531
7509
|
function Peaq() {
|
|
7532
7510
|
_classCallCheck(this, Peaq);
|
|
7533
|
-
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', Version.
|
|
7511
|
+
return _callSuper(this, Peaq, ['Peaq', 'peaq', 'polkadot', Version.V3]);
|
|
7534
7512
|
}
|
|
7535
7513
|
_inherits(Peaq, _ParachainNode);
|
|
7536
7514
|
return _createClass(Peaq, [{
|
|
@@ -7581,7 +7559,7 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
|
|
|
7581
7559
|
var Pendulum = /*#__PURE__*/function (_ParachainNode) {
|
|
7582
7560
|
function Pendulum() {
|
|
7583
7561
|
_classCallCheck(this, Pendulum);
|
|
7584
|
-
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', Version.
|
|
7562
|
+
return _callSuper(this, Pendulum, ['Pendulum', 'pendulum', 'polkadot', Version.V3]);
|
|
7585
7563
|
}
|
|
7586
7564
|
_inherits(Pendulum, _ParachainNode);
|
|
7587
7565
|
return _createClass(Pendulum, [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.5",
|
|
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": "9.2.
|
|
31
|
-
"@paraspell/
|
|
32
|
-
"@paraspell/
|
|
30
|
+
"@paraspell/assets": "9.2.5",
|
|
31
|
+
"@paraspell/sdk-common": "9.2.5",
|
|
32
|
+
"@paraspell/pallets": "9.2.5"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|