@paraspell/sdk-common 14.1.0-rc.1 → 14.1.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/dist/index.d.ts +8 -4
- package/dist/index.mjs +104 -6
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Supported Polkadot / Kusama / Westend / Paseo parachains.
|
|
3
3
|
*/
|
|
4
|
-
declare const PARACHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "Darwinia", "EnergyWebX", "Hydration", "
|
|
4
|
+
declare const PARACHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "Darwinia", "EnergyWebX", "Hydration", "Heima", "Jamton", "CoretimePolkadot", "Collectives", "Crust", "NeuroWeb", "Pendulum", "Mythos", "Peaq", "PeoplePolkadot", "Unique", "Xode", "AssetHubKusama", "BridgeHubKusama", "Karura", "CoretimeKusama", "Encointer", "Basilisk", "BifrostKusama", "CrustShadow", "Crab", "RobonomicsPolkadot", "PeopleKusama", "Shiden", "AssetHubWestend", "BridgeHubWestend", "CollectivesWestend", "CoretimeWestend", "Penpal", "PeopleWestend", "AssetHubPaseo", "EnergyWebXPaseo", "HeimaPaseo", "HydrationPaseo", "NeuroWebPaseo", "PeoplePaseo"];
|
|
5
5
|
/**
|
|
6
6
|
* Relaychains.
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ declare const RELAYCHAINS: readonly ["Polkadot", "Kusama", "Westend", "Paseo"];
|
|
|
9
9
|
/**
|
|
10
10
|
* All Substrate chains (parachains + relaychains).
|
|
11
11
|
*/
|
|
12
|
-
declare const SUBSTRATE_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "Darwinia", "EnergyWebX", "Hydration", "
|
|
12
|
+
declare const SUBSTRATE_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "Darwinia", "EnergyWebX", "Hydration", "Heima", "Jamton", "CoretimePolkadot", "Collectives", "Crust", "NeuroWeb", "Pendulum", "Mythos", "Peaq", "PeoplePolkadot", "Unique", "Xode", "AssetHubKusama", "BridgeHubKusama", "Karura", "CoretimeKusama", "Encointer", "Basilisk", "BifrostKusama", "CrustShadow", "Crab", "RobonomicsPolkadot", "PeopleKusama", "Shiden", "AssetHubWestend", "BridgeHubWestend", "CollectivesWestend", "CoretimeWestend", "Penpal", "PeopleWestend", "AssetHubPaseo", "EnergyWebXPaseo", "HeimaPaseo", "HydrationPaseo", "NeuroWebPaseo", "PeoplePaseo", "Polkadot", "Kusama", "Westend", "Paseo"];
|
|
13
13
|
/**
|
|
14
14
|
* External chains (non-Substrate/Polkadot ecosystem chains).
|
|
15
15
|
*/
|
|
@@ -21,7 +21,11 @@ declare const DEFAULT_SS58_PREFIX = 42;
|
|
|
21
21
|
/**
|
|
22
22
|
* All supported chains.
|
|
23
23
|
*/
|
|
24
|
-
declare const CHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "Darwinia", "EnergyWebX", "Hydration", "
|
|
24
|
+
declare const CHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "Darwinia", "EnergyWebX", "Hydration", "Heima", "Jamton", "CoretimePolkadot", "Collectives", "Crust", "NeuroWeb", "Pendulum", "Mythos", "Peaq", "PeoplePolkadot", "Unique", "Xode", "AssetHubKusama", "BridgeHubKusama", "Karura", "CoretimeKusama", "Encointer", "Basilisk", "BifrostKusama", "CrustShadow", "Crab", "RobonomicsPolkadot", "PeopleKusama", "Shiden", "AssetHubWestend", "BridgeHubWestend", "CollectivesWestend", "CoretimeWestend", "Penpal", "PeopleWestend", "AssetHubPaseo", "EnergyWebXPaseo", "HeimaPaseo", "HydrationPaseo", "NeuroWebPaseo", "PeoplePaseo", "Polkadot", "Kusama", "Westend", "Paseo", "Ethereum", "EthereumTestnet"];
|
|
25
|
+
|
|
26
|
+
declare class ParaSpellError extends Error {
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
25
29
|
|
|
26
30
|
type TParachain = (typeof PARACHAINS)[number];
|
|
27
31
|
type TRelaychain = (typeof RELAYCHAINS)[number];
|
|
@@ -173,5 +177,5 @@ declare const replaceBigInt: (_key: string, value: unknown) => unknown;
|
|
|
173
177
|
declare const lowercaseFirstLetter: (value: string) => string;
|
|
174
178
|
declare const snakeToCamel: (str: string) => string;
|
|
175
179
|
|
|
176
|
-
export { CHAINS, DEFAULT_SS58_PREFIX, ETHEREUM_BRIDGE_ORIGINS, EXTERNAL_CHAINS, PARACHAINS, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, deepEqual, getJunctionValue, hasJunction, isBridge, isChain, isCustomChain, isExternalChain, isPrimitive, isRelayChain, isSnowbridge, isSubstrateBridge, isSubstrateChain, isSystemChain, isTLocation, isTrustedChain, lowercaseFirstLetter, replaceBigInt, snakeToCamel };
|
|
180
|
+
export { CHAINS, DEFAULT_SS58_PREFIX, ETHEREUM_BRIDGE_ORIGINS, EXTERNAL_CHAINS, PARACHAINS, ParaSpellError, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, deepEqual, getJunctionValue, hasJunction, isBridge, isChain, isCustomChain, isExternalChain, isPrimitive, isRelayChain, isSnowbridge, isSubstrateBridge, isSubstrateChain, isSystemChain, isTLocation, isTrustedChain, lowercaseFirstLetter, replaceBigInt, snakeToCamel };
|
|
177
181
|
export type { TChain, TExternalChain, TJunction, TJunctionAccountId32, TJunctionAccountIndex64, TJunctionAccountKey20, TJunctionGeneralIndex, TJunctionGeneralKey, TJunctionGlobalConsensus, TJunctionOnlyChild, TJunctionPalletInstance, TJunctionParachain, TJunctionPlurality, TJunctionType, TJunctions, TLocation, TParachain, TRelaychain, TSubstrateChain };
|
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
var PARACHAINS = [
|
|
5
5
|
// Polkadot chains
|
|
6
|
-
'AssetHubPolkadot', 'Acala', 'Ajuna', 'Astar', 'BifrostPolkadot', 'BridgeHubPolkadot', 'Centrifuge', 'Darwinia', 'EnergyWebX', 'Hydration', '
|
|
6
|
+
'AssetHubPolkadot', 'Acala', 'Ajuna', 'Astar', 'BifrostPolkadot', 'BridgeHubPolkadot', 'Centrifuge', 'Darwinia', 'EnergyWebX', 'Hydration', 'Heima', 'Jamton', 'CoretimePolkadot', 'Collectives', 'Crust', 'NeuroWeb', 'Pendulum', 'Mythos', 'Peaq', 'PeoplePolkadot', 'Unique', 'Xode',
|
|
7
7
|
// Kusama chains
|
|
8
|
-
'AssetHubKusama', 'BridgeHubKusama', 'Karura', '
|
|
8
|
+
'AssetHubKusama', 'BridgeHubKusama', 'Karura', 'CoretimeKusama', 'Encointer', 'Basilisk', 'BifrostKusama', 'CrustShadow', 'Crab', 'RobonomicsPolkadot', 'PeopleKusama', 'Shiden',
|
|
9
9
|
// Westend testnet chains
|
|
10
10
|
'AssetHubWestend', 'BridgeHubWestend', 'CollectivesWestend', 'CoretimeWestend', 'Penpal', 'PeopleWestend',
|
|
11
11
|
// Paseo testnet chains
|
|
12
|
-
'
|
|
12
|
+
'AssetHubPaseo', 'EnergyWebXPaseo', 'HeimaPaseo', 'HydrationPaseo', 'NeuroWebPaseo', 'PeoplePaseo'];
|
|
13
13
|
/**
|
|
14
14
|
* Relaychains.
|
|
15
15
|
*/
|
|
@@ -42,6 +42,28 @@ function _arrayWithHoles(r) {
|
|
|
42
42
|
function _arrayWithoutHoles(r) {
|
|
43
43
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
44
44
|
}
|
|
45
|
+
function _assertThisInitialized(e) {
|
|
46
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
47
|
+
return e;
|
|
48
|
+
}
|
|
49
|
+
function _callSuper(t, o, e) {
|
|
50
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
51
|
+
}
|
|
52
|
+
function _classCallCheck(a, n) {
|
|
53
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
54
|
+
}
|
|
55
|
+
function _construct(t, e, r) {
|
|
56
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
57
|
+
var o = [null];
|
|
58
|
+
o.push.apply(o, e);
|
|
59
|
+
var p = new (t.bind.apply(t, o))();
|
|
60
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
61
|
+
}
|
|
62
|
+
function _createClass(e, r, t) {
|
|
63
|
+
return Object.defineProperty(e, "prototype", {
|
|
64
|
+
writable: false
|
|
65
|
+
}), e;
|
|
66
|
+
}
|
|
45
67
|
function _createForOfIteratorHelper(r, e) {
|
|
46
68
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
47
69
|
if (!t) {
|
|
@@ -90,6 +112,38 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
90
112
|
}
|
|
91
113
|
};
|
|
92
114
|
}
|
|
115
|
+
function _getPrototypeOf(t) {
|
|
116
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
117
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
118
|
+
}, _getPrototypeOf(t);
|
|
119
|
+
}
|
|
120
|
+
function _inherits(t, e) {
|
|
121
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
122
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
123
|
+
constructor: {
|
|
124
|
+
value: t,
|
|
125
|
+
writable: true,
|
|
126
|
+
configurable: true
|
|
127
|
+
}
|
|
128
|
+
}), Object.defineProperty(t, "prototype", {
|
|
129
|
+
writable: false
|
|
130
|
+
}), e && _setPrototypeOf(t, e);
|
|
131
|
+
}
|
|
132
|
+
function _isNativeFunction(t) {
|
|
133
|
+
try {
|
|
134
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
135
|
+
} catch (n) {
|
|
136
|
+
return "function" == typeof t;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function _isNativeReflectConstruct() {
|
|
140
|
+
try {
|
|
141
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
142
|
+
} catch (t) {}
|
|
143
|
+
return (_isNativeReflectConstruct = function () {
|
|
144
|
+
return !!t;
|
|
145
|
+
})();
|
|
146
|
+
}
|
|
93
147
|
function _iterableToArray(r) {
|
|
94
148
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
95
149
|
}
|
|
@@ -123,6 +177,16 @@ function _nonIterableRest() {
|
|
|
123
177
|
function _nonIterableSpread() {
|
|
124
178
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
125
179
|
}
|
|
180
|
+
function _possibleConstructorReturn(t, e) {
|
|
181
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
182
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
183
|
+
return _assertThisInitialized(t);
|
|
184
|
+
}
|
|
185
|
+
function _setPrototypeOf(t, e) {
|
|
186
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
187
|
+
return t.__proto__ = e, t;
|
|
188
|
+
}, _setPrototypeOf(t, e);
|
|
189
|
+
}
|
|
126
190
|
function _slicedToArray(r, e) {
|
|
127
191
|
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
128
192
|
}
|
|
@@ -145,6 +209,40 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
145
209
|
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
146
210
|
}
|
|
147
211
|
}
|
|
212
|
+
function _wrapNativeSuper(t) {
|
|
213
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
214
|
+
return _wrapNativeSuper = function (t) {
|
|
215
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
216
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
217
|
+
if (void 0 !== r) {
|
|
218
|
+
if (r.has(t)) return r.get(t);
|
|
219
|
+
r.set(t, Wrapper);
|
|
220
|
+
}
|
|
221
|
+
function Wrapper() {
|
|
222
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
223
|
+
}
|
|
224
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
225
|
+
constructor: {
|
|
226
|
+
value: Wrapper,
|
|
227
|
+
enumerable: false,
|
|
228
|
+
writable: true,
|
|
229
|
+
configurable: true
|
|
230
|
+
}
|
|
231
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
232
|
+
}, _wrapNativeSuper(t);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
var ParaSpellError = /*#__PURE__*/function (_Error) {
|
|
236
|
+
function ParaSpellError(message) {
|
|
237
|
+
var _this;
|
|
238
|
+
_classCallCheck(this, ParaSpellError);
|
|
239
|
+
_this = _callSuper(this, ParaSpellError, [message]);
|
|
240
|
+
_this.name = (this instanceof ParaSpellError ? this.constructor : void 0).name;
|
|
241
|
+
return _this;
|
|
242
|
+
}
|
|
243
|
+
_inherits(ParaSpellError, _Error);
|
|
244
|
+
return _createClass(ParaSpellError);
|
|
245
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
148
246
|
|
|
149
247
|
var isTLocation = function isTLocation(value) {
|
|
150
248
|
return _typeof(value) === 'object' && value !== null && 'parents' in value && 'interior' in value;
|
|
@@ -228,7 +326,7 @@ var isCustomChain = function isCustomChain(chain) {
|
|
|
228
326
|
* @returns True if the chain is a system chain; otherwise, false.
|
|
229
327
|
*/
|
|
230
328
|
var isSystemChain = function isSystemChain(chain) {
|
|
231
|
-
var systemChains = ['AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BridgeHubPolkadot', 'BridgeHubKusama', 'BridgeHubWestend', '
|
|
329
|
+
var systemChains = ['AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BridgeHubPolkadot', 'BridgeHubKusama', 'BridgeHubWestend', 'PeoplePolkadot', 'PeopleKusama', 'PeopleWestend', 'PeoplePaseo', 'CoretimePolkadot', 'CoretimeKusama', 'CoretimeWestend', 'Collectives', 'Encointer', 'CollectivesWestend'];
|
|
232
330
|
return systemChains.some(function (c) {
|
|
233
331
|
return c === chain;
|
|
234
332
|
}) || isRelayChain(chain);
|
|
@@ -241,7 +339,7 @@ var isTrustedChain = function isTrustedChain(chain) {
|
|
|
241
339
|
};
|
|
242
340
|
|
|
243
341
|
var COMPATIBLE_BRIDGES = [['AssetHubPolkadot', 'AssetHubKusama']];
|
|
244
|
-
var ETHEREUM_BRIDGE_ORIGINS = ['AssetHubPolkadot', 'AssetHubPaseo', 'AssetHubWestend', 'Hydration', 'BifrostPolkadot', '
|
|
342
|
+
var ETHEREUM_BRIDGE_ORIGINS = ['AssetHubPolkadot', 'AssetHubPaseo', 'AssetHubWestend', 'Hydration', 'BifrostPolkadot', 'Mythos'];
|
|
245
343
|
var isSubstrateBridge = function isSubstrateBridge(origin, destination) {
|
|
246
344
|
if (isExternalChain(origin) || isExternalChain(destination)) return false;
|
|
247
345
|
if (!origin.startsWith('AssetHub') || !destination.startsWith('AssetHub')) return false;
|
|
@@ -381,4 +479,4 @@ var snakeToCamel = function snakeToCamel(str) {
|
|
|
381
479
|
});
|
|
382
480
|
};
|
|
383
481
|
|
|
384
|
-
export { CHAINS, DEFAULT_SS58_PREFIX, ETHEREUM_BRIDGE_ORIGINS, EXTERNAL_CHAINS, PARACHAINS, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, _deepEqual as deepEqual, getJunctionValue, hasJunction, isBridge, isChain, isCustomChain, isExternalChain, isPrimitive, isRelayChain, isSnowbridge, isSubstrateBridge, isSubstrateChain, isSystemChain, isTLocation, isTrustedChain, lowercaseFirstLetter, replaceBigInt, snakeToCamel };
|
|
482
|
+
export { CHAINS, DEFAULT_SS58_PREFIX, ETHEREUM_BRIDGE_ORIGINS, EXTERNAL_CHAINS, PARACHAINS, ParaSpellError, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, _deepEqual as deepEqual, getJunctionValue, hasJunction, isBridge, isChain, isCustomChain, isExternalChain, isPrimitive, isRelayChain, isSnowbridge, isSubstrateBridge, isSubstrateChain, isSystemChain, isTLocation, isTrustedChain, lowercaseFirstLetter, replaceBigInt, snakeToCamel };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-common",
|
|
3
|
-
"version": "14.1.0
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "SDK common code for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
"@babel/plugin-syntax-import-attributes": "^7.29.7",
|
|
27
27
|
"@babel/preset-env": "^7.29.7",
|
|
28
28
|
"@codecov/rollup-plugin": "^2.0.1",
|
|
29
|
-
"@polkadot-api/substrate-bindings": "0.
|
|
29
|
+
"@polkadot-api/substrate-bindings": "^0.20.3",
|
|
30
30
|
"@rollup/plugin-babel": "^7.1.0",
|
|
31
31
|
"@rollup/plugin-json": "^6.1.0",
|
|
32
32
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
33
33
|
"@types/cli-progress": "^3.11.6",
|
|
34
|
-
"@vitest/coverage-v8": "^4.1.
|
|
34
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
35
35
|
"cli-progress": "^3.12.0",
|
|
36
36
|
"dotenv": "^17.4.2",
|
|
37
37
|
"picocolors": "^1.1.1",
|
|
38
|
-
"polkadot-api": "
|
|
39
|
-
"rollup": "^4.62.
|
|
38
|
+
"polkadot-api": "^2.2.1",
|
|
39
|
+
"rollup": "^4.62.3",
|
|
40
40
|
"rollup-plugin-dts": "^6.4.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|