@paraspell/pallets 12.9.5 → 12.9.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.d.ts +22 -1
- package/dist/index.mjs +157 -48
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,18 @@ declare const ASSETS_PALLETS: readonly ["Balances", "Tokens", "Currencies", "Ass
|
|
|
5
5
|
declare const OTHER_PALLETS: readonly ["Utility"];
|
|
6
6
|
declare const PALLETS: readonly ["XTokens", "PolkadotXcm", "XcmPallet", "Balances", "Tokens", "Currencies", "Assets", "ForeignAssets", "AssetManager", "System", "Fungibles", "OrmlTokens", "Utility"];
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Used to inform user, that no XCM pallet was found on the specified chain.
|
|
10
|
+
*/
|
|
11
|
+
declare class XcmPalletNotFoundError extends Error {
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a new XcmPalletNotFoundError.
|
|
14
|
+
*
|
|
15
|
+
* @param chain - The chain for which no XCM pallet was found.
|
|
16
|
+
*/
|
|
17
|
+
constructor(chain: TSubstrateChain);
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
type TPallet = (typeof PALLETS)[number];
|
|
9
21
|
type TAssetsPallet = (typeof ASSETS_PALLETS)[number];
|
|
10
22
|
type TPalletDetails = {
|
|
@@ -37,6 +49,15 @@ declare const getSupportedPalletsDetails: (chain: TSubstrateChain) => TPalletDet
|
|
|
37
49
|
declare const getPalletIndex: (chain: TSubstrateChain, pallet: TPallet) => number | undefined;
|
|
38
50
|
declare const getNativeAssetsPallet: (chain: TSubstrateChain) => TAssetsPallet;
|
|
39
51
|
declare const getOtherAssetsPallets: (chain: TSubstrateChain) => TAssetsPallet[];
|
|
52
|
+
declare const hasPallet: (chain: TSubstrateChain, pallet: TPallet) => boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves the XCM pallet for a specified chain.
|
|
55
|
+
*
|
|
56
|
+
* @param chain - The chain for which to get the XCM pallet.
|
|
57
|
+
* @returns The XCM pallet found on the chain (XcmPallet or PolkadotXcm).
|
|
58
|
+
* @throws {@link XcmPalletNotFoundError} If no XCM pallet is found on the chain.
|
|
59
|
+
*/
|
|
60
|
+
declare const getXcmPallet: (chain: TSubstrateChain) => TPallet;
|
|
40
61
|
|
|
41
|
-
export { ASSETS_PALLETS, CROSSCHAIN_PALLETS, OTHER_PALLETS, PALLETS, getDefaultPallet, getNativeAssetsPallet, getOtherAssetsPallets, getPalletIndex, getSupportedPallets, getSupportedPalletsDetails };
|
|
62
|
+
export { ASSETS_PALLETS, CROSSCHAIN_PALLETS, OTHER_PALLETS, PALLETS, XcmPalletNotFoundError, getDefaultPallet, getNativeAssetsPallet, getOtherAssetsPallets, getPalletIndex, getSupportedPallets, getSupportedPalletsDetails, getXcmPallet, hasPallet };
|
|
42
63
|
export type { TAssetsPallet, TPallet, TPalletDetails, TPalletJsonMap, TPalletMap };
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,113 @@ var ASSETS_PALLETS = ['Balances', 'Tokens', 'Currencies', 'Assets', 'ForeignAsse
|
|
|
3
3
|
var OTHER_PALLETS = ['Utility'];
|
|
4
4
|
var PALLETS = [].concat(CROSSCHAIN_PALLETS, ASSETS_PALLETS, OTHER_PALLETS);
|
|
5
5
|
|
|
6
|
+
function _assertThisInitialized(e) {
|
|
7
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
8
|
+
return e;
|
|
9
|
+
}
|
|
10
|
+
function _callSuper(t, o, e) {
|
|
11
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
12
|
+
}
|
|
13
|
+
function _classCallCheck(a, n) {
|
|
14
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
15
|
+
}
|
|
16
|
+
function _construct(t, e, r) {
|
|
17
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
18
|
+
var o = [null];
|
|
19
|
+
o.push.apply(o, e);
|
|
20
|
+
var p = new (t.bind.apply(t, o))();
|
|
21
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
22
|
+
}
|
|
23
|
+
function _createClass(e, r, t) {
|
|
24
|
+
return Object.defineProperty(e, "prototype", {
|
|
25
|
+
writable: false
|
|
26
|
+
}), e;
|
|
27
|
+
}
|
|
28
|
+
function _getPrototypeOf(t) {
|
|
29
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
30
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
31
|
+
}, _getPrototypeOf(t);
|
|
32
|
+
}
|
|
33
|
+
function _inherits(t, e) {
|
|
34
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
35
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
36
|
+
constructor: {
|
|
37
|
+
value: t,
|
|
38
|
+
writable: true,
|
|
39
|
+
configurable: true
|
|
40
|
+
}
|
|
41
|
+
}), Object.defineProperty(t, "prototype", {
|
|
42
|
+
writable: false
|
|
43
|
+
}), e && _setPrototypeOf(t, e);
|
|
44
|
+
}
|
|
45
|
+
function _isNativeFunction(t) {
|
|
46
|
+
try {
|
|
47
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
48
|
+
} catch (n) {
|
|
49
|
+
return "function" == typeof t;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function _isNativeReflectConstruct() {
|
|
53
|
+
try {
|
|
54
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
55
|
+
} catch (t) {}
|
|
56
|
+
return (_isNativeReflectConstruct = function () {
|
|
57
|
+
return !!t;
|
|
58
|
+
})();
|
|
59
|
+
}
|
|
60
|
+
function _possibleConstructorReturn(t, e) {
|
|
61
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
62
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
63
|
+
return _assertThisInitialized(t);
|
|
64
|
+
}
|
|
65
|
+
function _setPrototypeOf(t, e) {
|
|
66
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
67
|
+
return t.__proto__ = e, t;
|
|
68
|
+
}, _setPrototypeOf(t, e);
|
|
69
|
+
}
|
|
70
|
+
function _wrapNativeSuper(t) {
|
|
71
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
72
|
+
return _wrapNativeSuper = function (t) {
|
|
73
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
74
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
75
|
+
if (void 0 !== r) {
|
|
76
|
+
if (r.has(t)) return r.get(t);
|
|
77
|
+
r.set(t, Wrapper);
|
|
78
|
+
}
|
|
79
|
+
function Wrapper() {
|
|
80
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
81
|
+
}
|
|
82
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
83
|
+
constructor: {
|
|
84
|
+
value: Wrapper,
|
|
85
|
+
enumerable: false,
|
|
86
|
+
writable: true,
|
|
87
|
+
configurable: true
|
|
88
|
+
}
|
|
89
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
90
|
+
}, _wrapNativeSuper(t);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Used to inform user, that no XCM pallet was found on the specified chain.
|
|
95
|
+
*/
|
|
96
|
+
var XcmPalletNotFoundError = /*#__PURE__*/function (_Error) {
|
|
97
|
+
/**
|
|
98
|
+
* Constructs a new XcmPalletNotFoundError.
|
|
99
|
+
*
|
|
100
|
+
* @param chain - The chain for which no XCM pallet was found.
|
|
101
|
+
*/
|
|
102
|
+
function XcmPalletNotFoundError(chain) {
|
|
103
|
+
var _this;
|
|
104
|
+
_classCallCheck(this, XcmPalletNotFoundError);
|
|
105
|
+
_this = _callSuper(this, XcmPalletNotFoundError, ["No XCM pallet found on chain ".concat(chain)]);
|
|
106
|
+
_this.name = 'XcmPalletNotFoundError';
|
|
107
|
+
return _this;
|
|
108
|
+
}
|
|
109
|
+
_inherits(XcmPalletNotFoundError, _Error);
|
|
110
|
+
return _createClass(XcmPalletNotFoundError);
|
|
111
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
112
|
+
|
|
6
113
|
var AssetHubPolkadot = {
|
|
7
114
|
defaultPallet: "PolkadotXcm",
|
|
8
115
|
supportedPallets: [
|
|
@@ -306,32 +413,6 @@ var Encointer = {
|
|
|
306
413
|
otherAssets: [
|
|
307
414
|
]
|
|
308
415
|
};
|
|
309
|
-
var Altair = {
|
|
310
|
-
defaultPallet: "XTokens",
|
|
311
|
-
supportedPallets: [
|
|
312
|
-
{
|
|
313
|
-
name: "Balances",
|
|
314
|
-
index: 20
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
name: "Tokens",
|
|
318
|
-
index: 97
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
name: "PolkadotXcm",
|
|
322
|
-
index: 121
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
name: "XTokens",
|
|
326
|
-
index: 124
|
|
327
|
-
}
|
|
328
|
-
],
|
|
329
|
-
nativeAssets: "Balances",
|
|
330
|
-
otherAssets: [
|
|
331
|
-
"Tokens",
|
|
332
|
-
"OrmlTokens"
|
|
333
|
-
]
|
|
334
|
-
};
|
|
335
416
|
var Basilisk = {
|
|
336
417
|
defaultPallet: "XTokens",
|
|
337
418
|
supportedPallets: [
|
|
@@ -634,22 +715,6 @@ var Manta = {
|
|
|
634
715
|
"AssetManager"
|
|
635
716
|
]
|
|
636
717
|
};
|
|
637
|
-
var Nodle = {
|
|
638
|
-
defaultPallet: "PolkadotXcm",
|
|
639
|
-
supportedPallets: [
|
|
640
|
-
{
|
|
641
|
-
name: "Balances",
|
|
642
|
-
index: 2
|
|
643
|
-
},
|
|
644
|
-
{
|
|
645
|
-
name: "PolkadotXcm",
|
|
646
|
-
index: 35
|
|
647
|
-
}
|
|
648
|
-
],
|
|
649
|
-
nativeAssets: "Balances",
|
|
650
|
-
otherAssets: [
|
|
651
|
-
]
|
|
652
|
-
};
|
|
653
718
|
var NeuroWeb = {
|
|
654
719
|
defaultPallet: "PolkadotXcm",
|
|
655
720
|
supportedPallets: [
|
|
@@ -837,6 +902,22 @@ var CoretimePolkadot = {
|
|
|
837
902
|
otherAssets: [
|
|
838
903
|
]
|
|
839
904
|
};
|
|
905
|
+
var RobonomicsPolkadot = {
|
|
906
|
+
defaultPallet: "XcmPallet",
|
|
907
|
+
supportedPallets: [
|
|
908
|
+
{
|
|
909
|
+
name: "Balances",
|
|
910
|
+
index: 31
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
name: "XcmPallet",
|
|
914
|
+
index: 71
|
|
915
|
+
}
|
|
916
|
+
],
|
|
917
|
+
nativeAssets: "Balances",
|
|
918
|
+
otherAssets: [
|
|
919
|
+
]
|
|
920
|
+
};
|
|
840
921
|
var PeoplePolkadot = {
|
|
841
922
|
defaultPallet: "PolkadotXcm",
|
|
842
923
|
supportedPallets: [
|
|
@@ -844,6 +925,10 @@ var PeoplePolkadot = {
|
|
|
844
925
|
name: "Balances",
|
|
845
926
|
index: 10
|
|
846
927
|
},
|
|
928
|
+
{
|
|
929
|
+
name: "Assets",
|
|
930
|
+
index: 12
|
|
931
|
+
},
|
|
847
932
|
{
|
|
848
933
|
name: "PolkadotXcm",
|
|
849
934
|
index: 31
|
|
@@ -851,6 +936,7 @@ var PeoplePolkadot = {
|
|
|
851
936
|
],
|
|
852
937
|
nativeAssets: "Balances",
|
|
853
938
|
otherAssets: [
|
|
939
|
+
"Assets"
|
|
854
940
|
]
|
|
855
941
|
};
|
|
856
942
|
var PeopleKusama = {
|
|
@@ -1426,11 +1512,16 @@ var Xode = {
|
|
|
1426
1512
|
{
|
|
1427
1513
|
name: "Assets",
|
|
1428
1514
|
index: 50
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
name: "ForeignAssets",
|
|
1518
|
+
index: 101
|
|
1429
1519
|
}
|
|
1430
1520
|
],
|
|
1431
1521
|
nativeAssets: "Balances",
|
|
1432
1522
|
otherAssets: [
|
|
1433
|
-
"Assets"
|
|
1523
|
+
"Assets",
|
|
1524
|
+
"ForeignAssets"
|
|
1434
1525
|
]
|
|
1435
1526
|
};
|
|
1436
1527
|
var pallets = {
|
|
@@ -1447,7 +1538,6 @@ var pallets = {
|
|
|
1447
1538
|
Moonbeam: Moonbeam,
|
|
1448
1539
|
AssetHubKusama: AssetHubKusama,
|
|
1449
1540
|
Encointer: Encointer,
|
|
1450
|
-
Altair: Altair,
|
|
1451
1541
|
Basilisk: Basilisk,
|
|
1452
1542
|
BifrostKusama: BifrostKusama,
|
|
1453
1543
|
CrustShadow: CrustShadow,
|
|
@@ -1460,7 +1550,6 @@ var pallets = {
|
|
|
1460
1550
|
Unique: Unique,
|
|
1461
1551
|
Crust: Crust,
|
|
1462
1552
|
Manta: Manta,
|
|
1463
|
-
Nodle: Nodle,
|
|
1464
1553
|
NeuroWeb: NeuroWeb,
|
|
1465
1554
|
Pendulum: Pendulum,
|
|
1466
1555
|
Zeitgeist: Zeitgeist,
|
|
@@ -1470,6 +1559,7 @@ var pallets = {
|
|
|
1470
1559
|
Mythos: Mythos,
|
|
1471
1560
|
Peaq: Peaq,
|
|
1472
1561
|
CoretimePolkadot: CoretimePolkadot,
|
|
1562
|
+
RobonomicsPolkadot: RobonomicsPolkadot,
|
|
1473
1563
|
PeoplePolkadot: PeoplePolkadot,
|
|
1474
1564
|
PeopleKusama: PeopleKusama,
|
|
1475
1565
|
Polkadot: Polkadot,
|
|
@@ -1506,7 +1596,6 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
1506
1596
|
Acala: Acala,
|
|
1507
1597
|
Ajuna: Ajuna,
|
|
1508
1598
|
AjunaPaseo: AjunaPaseo,
|
|
1509
|
-
Altair: Altair,
|
|
1510
1599
|
AssetHubKusama: AssetHubKusama,
|
|
1511
1600
|
AssetHubPaseo: AssetHubPaseo,
|
|
1512
1601
|
AssetHubPolkadot: AssetHubPolkadot,
|
|
@@ -1551,7 +1640,6 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
1551
1640
|
Mythos: Mythos,
|
|
1552
1641
|
NeuroWeb: NeuroWeb,
|
|
1553
1642
|
NeuroWebPaseo: NeuroWebPaseo,
|
|
1554
|
-
Nodle: Nodle,
|
|
1555
1643
|
Paseo: Paseo,
|
|
1556
1644
|
Peaq: Peaq,
|
|
1557
1645
|
Pendulum: Pendulum,
|
|
@@ -1562,6 +1650,7 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
1562
1650
|
PeopleWestend: PeopleWestend,
|
|
1563
1651
|
Polkadot: Polkadot,
|
|
1564
1652
|
Quartz: Quartz,
|
|
1653
|
+
RobonomicsPolkadot: RobonomicsPolkadot,
|
|
1565
1654
|
Shiden: Shiden,
|
|
1566
1655
|
Unique: Unique,
|
|
1567
1656
|
Westend: Westend,
|
|
@@ -1608,5 +1697,25 @@ var getNativeAssetsPallet = function getNativeAssetsPallet(chain) {
|
|
|
1608
1697
|
var getOtherAssetsPallets = function getOtherAssetsPallets(chain) {
|
|
1609
1698
|
return palletsMap[chain].otherAssets;
|
|
1610
1699
|
};
|
|
1700
|
+
var hasPallet = function hasPallet(chain, pallet) {
|
|
1701
|
+
return palletsMap[chain].supportedPallets.some(function (p) {
|
|
1702
|
+
return p.name === pallet;
|
|
1703
|
+
});
|
|
1704
|
+
};
|
|
1705
|
+
/**
|
|
1706
|
+
* Retrieves the XCM pallet for a specified chain.
|
|
1707
|
+
*
|
|
1708
|
+
* @param chain - The chain for which to get the XCM pallet.
|
|
1709
|
+
* @returns The XCM pallet found on the chain (XcmPallet or PolkadotXcm).
|
|
1710
|
+
* @throws {@link XcmPalletNotFoundError} If no XCM pallet is found on the chain.
|
|
1711
|
+
*/
|
|
1712
|
+
var getXcmPallet = function getXcmPallet(chain) {
|
|
1713
|
+
var candidates = ['XcmPallet', 'PolkadotXcm'];
|
|
1714
|
+
for (var _i = 0, _candidates = candidates; _i < _candidates.length; _i++) {
|
|
1715
|
+
var pallet = _candidates[_i];
|
|
1716
|
+
if (hasPallet(chain, pallet)) return pallet;
|
|
1717
|
+
}
|
|
1718
|
+
throw new XcmPalletNotFoundError(chain);
|
|
1719
|
+
};
|
|
1611
1720
|
|
|
1612
|
-
export { ASSETS_PALLETS, CROSSCHAIN_PALLETS, OTHER_PALLETS, PALLETS, getDefaultPallet, getNativeAssetsPallet, getOtherAssetsPallets, getPalletIndex, getSupportedPallets, getSupportedPalletsDetails };
|
|
1721
|
+
export { ASSETS_PALLETS, CROSSCHAIN_PALLETS, OTHER_PALLETS, PALLETS, XcmPalletNotFoundError, getDefaultPallet, getNativeAssetsPallet, getOtherAssetsPallets, getPalletIndex, getSupportedPallets, getSupportedPalletsDetails, getXcmPallet, hasPallet };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/pallets",
|
|
3
|
-
"version": "12.9.
|
|
3
|
+
"version": "12.9.6",
|
|
4
4
|
"description": "Pallets for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,22 +23,22 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@paraspell/sdk-common": "12.9.
|
|
26
|
+
"@paraspell/sdk-common": "12.9.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-syntax-import-attributes": "^7.28.6",
|
|
30
|
-
"@babel/preset-env": "^7.29.
|
|
30
|
+
"@babel/preset-env": "^7.29.2",
|
|
31
31
|
"@codecov/rollup-plugin": "^1.9.1",
|
|
32
|
-
"@polkadot/api": "^16.5.
|
|
33
|
-
"@polkadot/types": "^16.5.
|
|
34
|
-
"@rollup/plugin-babel": "^
|
|
32
|
+
"@polkadot/api": "^16.5.6",
|
|
33
|
+
"@polkadot/types": "^16.5.6",
|
|
34
|
+
"@rollup/plugin-babel": "^7.0.0",
|
|
35
35
|
"@rollup/plugin-json": "^6.1.0",
|
|
36
36
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
37
|
-
"@vitest/coverage-v8": "^4.
|
|
38
|
-
"axios": "^1.
|
|
37
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
38
|
+
"axios": "^1.14.0",
|
|
39
39
|
"dotenv": "^17.3.1",
|
|
40
|
-
"rollup": "^4.
|
|
41
|
-
"rollup-plugin-dts": "^6.
|
|
40
|
+
"rollup": "^4.60.1",
|
|
41
|
+
"rollup-plugin-dts": "^6.4.1",
|
|
42
42
|
"ts-node": "^10.9.2"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|