@paraspell/sdk-common 11.2.4 → 11.3.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.cjs +15 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +15 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Supported Polkadot / Kusama / Westend / Paseo parachains.
|
|
5
5
|
*/
|
|
6
|
-
var PARACHAINS = [
|
|
6
|
+
var PARACHAINS = [
|
|
7
|
+
// Polkadot chains
|
|
8
|
+
'AssetHubPolkadot', 'Acala', 'Ajuna', 'Astar', 'BifrostPolkadot', 'BridgeHubPolkadot', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'EnergyWebX', 'Hydration', 'Interlay', 'Heima', 'Jamton', 'Moonbeam', 'CoretimePolkadot', 'Collectives', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Phala', 'Subsocial', 'KiltSpiritnet', 'Curio', 'Mythos', 'Peaq', 'Polimec', 'RobonomicsPolkadot', 'PeoplePolkadot', 'Unique',
|
|
9
|
+
// Kusama chains
|
|
10
|
+
'AssetHubKusama', 'BridgeHubKusama', 'IntegriteeKusama', 'Karura', 'Kintsugi', 'Moonriver', 'CoretimeKusama', 'Encointer', 'Altair', 'Amplitude', 'Basilisk', 'BifrostKusama', 'CrustShadow', 'Crab', 'Laos', 'Quartz', 'RobonomicsKusama', 'PeopleKusama', 'Shiden', 'Zeitgeist',
|
|
7
11
|
// Westend testnet chains
|
|
8
|
-
'AssetHubWestend', 'BridgeHubWestend', 'CollectivesWestend', 'CoretimeWestend', '
|
|
12
|
+
'AssetHubWestend', 'BridgeHubWestend', 'CollectivesWestend', 'CoretimeWestend', 'Penpal', 'PeopleWestend',
|
|
9
13
|
// Paseo testnet chains
|
|
10
|
-
'
|
|
14
|
+
'AjunaPaseo', 'AssetHubPaseo', 'BifrostPaseo', 'BridgeHubPaseo', 'CoretimePaseo', 'EnergyWebXPaseo', 'HeimaPaseo', 'HydrationPaseo', 'IntegriteePaseo', 'KiltPaseo', 'LaosPaseo', 'NeuroWebPaseo', 'NodlePaseo', 'PAssetHub', 'PeoplePaseo', 'ZeitgeistPaseo'];
|
|
11
15
|
/**
|
|
12
16
|
* Relaychains.
|
|
13
17
|
*/
|
|
@@ -144,9 +148,15 @@ var isRelayChain = function isRelayChain(chain) {
|
|
|
144
148
|
* @returns True if the chain is a system chain; otherwise, false.
|
|
145
149
|
*/
|
|
146
150
|
var isSystemChain = function isSystemChain(chain) {
|
|
147
|
-
var systemChains = ['AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BridgeHubPolkadot', 'BridgeHubKusama', 'BridgeHubWestend', 'BridgeHubPaseo', 'PeoplePolkadot', 'PeopleKusama', 'PeopleWestend', 'PeoplePaseo', 'CoretimePolkadot', 'CoretimeKusama', 'CoretimeWestend', 'CoretimePaseo', 'Collectives', 'CollectivesWestend'
|
|
151
|
+
var systemChains = ['AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BridgeHubPolkadot', 'BridgeHubKusama', 'BridgeHubWestend', 'BridgeHubPaseo', 'PeoplePolkadot', 'PeopleKusama', 'PeopleWestend', 'PeoplePaseo', 'CoretimePolkadot', 'CoretimeKusama', 'CoretimeWestend', 'CoretimePaseo', 'Collectives', 'CollectivesWestend'];
|
|
148
152
|
return systemChains.includes(chain) || isRelayChain(chain);
|
|
149
153
|
};
|
|
154
|
+
var isTrustedChain = function isTrustedChain(chain) {
|
|
155
|
+
var isTrustedByAh = function isTrustedByAh(chain) {
|
|
156
|
+
return ['Mythos'].includes(chain);
|
|
157
|
+
};
|
|
158
|
+
return isTrustedByAh(chain) || isSystemChain(chain);
|
|
159
|
+
};
|
|
150
160
|
|
|
151
161
|
var isPrimitive = function isPrimitive(obj) {
|
|
152
162
|
return obj !== Object(obj);
|
|
@@ -278,4 +288,5 @@ exports.isPrimitive = isPrimitive;
|
|
|
278
288
|
exports.isRelayChain = isRelayChain;
|
|
279
289
|
exports.isSystemChain = isSystemChain;
|
|
280
290
|
exports.isTLocation = isTLocation;
|
|
291
|
+
exports.isTrustedChain = isTrustedChain;
|
|
281
292
|
exports.replaceBigInt = replaceBigInt;
|
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", "
|
|
4
|
+
declare const PARACHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "ComposableFinance", "Darwinia", "EnergyWebX", "Hydration", "Interlay", "Heima", "Jamton", "Moonbeam", "CoretimePolkadot", "Collectives", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "RobonomicsPolkadot", "PeoplePolkadot", "Unique", "AssetHubKusama", "BridgeHubKusama", "IntegriteeKusama", "Karura", "Kintsugi", "Moonriver", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Basilisk", "BifrostKusama", "CrustShadow", "Crab", "Laos", "Quartz", "RobonomicsKusama", "PeopleKusama", "Shiden", "Zeitgeist", "AssetHubWestend", "BridgeHubWestend", "CollectivesWestend", "CoretimeWestend", "Penpal", "PeopleWestend", "AjunaPaseo", "AssetHubPaseo", "BifrostPaseo", "BridgeHubPaseo", "CoretimePaseo", "EnergyWebXPaseo", "HeimaPaseo", "HydrationPaseo", "IntegriteePaseo", "KiltPaseo", "LaosPaseo", "NeuroWebPaseo", "NodlePaseo", "PAssetHub", "PeoplePaseo", "ZeitgeistPaseo"];
|
|
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", "
|
|
12
|
+
declare const SUBSTRATE_CHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "ComposableFinance", "Darwinia", "EnergyWebX", "Hydration", "Interlay", "Heima", "Jamton", "Moonbeam", "CoretimePolkadot", "Collectives", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "RobonomicsPolkadot", "PeoplePolkadot", "Unique", "AssetHubKusama", "BridgeHubKusama", "IntegriteeKusama", "Karura", "Kintsugi", "Moonriver", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Basilisk", "BifrostKusama", "CrustShadow", "Crab", "Laos", "Quartz", "RobonomicsKusama", "PeopleKusama", "Shiden", "Zeitgeist", "AssetHubWestend", "BridgeHubWestend", "CollectivesWestend", "CoretimeWestend", "Penpal", "PeopleWestend", "AjunaPaseo", "AssetHubPaseo", "BifrostPaseo", "BridgeHubPaseo", "CoretimePaseo", "EnergyWebXPaseo", "HeimaPaseo", "HydrationPaseo", "IntegriteePaseo", "KiltPaseo", "LaosPaseo", "NeuroWebPaseo", "NodlePaseo", "PAssetHub", "PeoplePaseo", "ZeitgeistPaseo", "Polkadot", "Kusama", "Westend", "Paseo"];
|
|
13
13
|
/**
|
|
14
14
|
* External chains (non-Substrate/Polkadot ecosystem chains).
|
|
15
15
|
*/
|
|
@@ -17,7 +17,7 @@ declare const EXTERNAL_CHAINS: readonly ["Ethereum"];
|
|
|
17
17
|
/**
|
|
18
18
|
* All supported chains.
|
|
19
19
|
*/
|
|
20
|
-
declare const CHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "
|
|
20
|
+
declare const CHAINS: readonly ["AssetHubPolkadot", "Acala", "Ajuna", "Astar", "BifrostPolkadot", "BridgeHubPolkadot", "Centrifuge", "ComposableFinance", "Darwinia", "EnergyWebX", "Hydration", "Interlay", "Heima", "Jamton", "Moonbeam", "CoretimePolkadot", "Collectives", "Crust", "Manta", "Nodle", "NeuroWeb", "Pendulum", "Phala", "Subsocial", "KiltSpiritnet", "Curio", "Mythos", "Peaq", "Polimec", "RobonomicsPolkadot", "PeoplePolkadot", "Unique", "AssetHubKusama", "BridgeHubKusama", "IntegriteeKusama", "Karura", "Kintsugi", "Moonriver", "CoretimeKusama", "Encointer", "Altair", "Amplitude", "Basilisk", "BifrostKusama", "CrustShadow", "Crab", "Laos", "Quartz", "RobonomicsKusama", "PeopleKusama", "Shiden", "Zeitgeist", "AssetHubWestend", "BridgeHubWestend", "CollectivesWestend", "CoretimeWestend", "Penpal", "PeopleWestend", "AjunaPaseo", "AssetHubPaseo", "BifrostPaseo", "BridgeHubPaseo", "CoretimePaseo", "EnergyWebXPaseo", "HeimaPaseo", "HydrationPaseo", "IntegriteePaseo", "KiltPaseo", "LaosPaseo", "NeuroWebPaseo", "NodlePaseo", "PAssetHub", "PeoplePaseo", "ZeitgeistPaseo", "Polkadot", "Kusama", "Westend", "Paseo", "Ethereum"];
|
|
21
21
|
|
|
22
22
|
type TParachain = (typeof PARACHAINS)[number];
|
|
23
23
|
type TRelaychain = (typeof RELAYCHAINS)[number];
|
|
@@ -132,6 +132,7 @@ declare const isRelayChain: (chain: TChain) => chain is TRelaychain;
|
|
|
132
132
|
* @returns True if the chain is a system chain; otherwise, false.
|
|
133
133
|
*/
|
|
134
134
|
declare const isSystemChain: (chain: TChain) => boolean;
|
|
135
|
+
declare const isTrustedChain: (chain: TChain) => boolean;
|
|
135
136
|
|
|
136
137
|
declare const isPrimitive: (obj: unknown) => boolean;
|
|
137
138
|
declare const deepEqual: (obj1: unknown, obj2: unknown) => boolean;
|
|
@@ -143,5 +144,5 @@ declare const hasJunction: (location: TLocation, junctionType: TJunctionType, ju
|
|
|
143
144
|
|
|
144
145
|
declare const replaceBigInt: (_key: string, value: unknown) => unknown;
|
|
145
146
|
|
|
146
|
-
export { CHAINS, EXTERNAL_CHAINS, PARACHAINS, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, deepEqual, getJunctionValue, hasJunction, isDotKsmBridge, isPrimitive, isRelayChain, isSystemChain, isTLocation, replaceBigInt };
|
|
147
|
+
export { CHAINS, EXTERNAL_CHAINS, PARACHAINS, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, deepEqual, getJunctionValue, hasJunction, isDotKsmBridge, isPrimitive, isRelayChain, isSystemChain, isTLocation, isTrustedChain, replaceBigInt };
|
|
147
148
|
export type { TChain, TExternalChain, TJunction, TJunctionGeneralIndex, TJunctionParachain, TJunctionType, TJunctions, TLocation, TNode, TNodeDotKsmWithRelayChains, TNodePolkadotKusama, TNodeWithRelayChains, TParachain, TRelaychain, TSubstrateChain };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Supported Polkadot / Kusama / Westend / Paseo parachains.
|
|
3
3
|
*/
|
|
4
|
-
var PARACHAINS = [
|
|
4
|
+
var PARACHAINS = [
|
|
5
|
+
// Polkadot chains
|
|
6
|
+
'AssetHubPolkadot', 'Acala', 'Ajuna', 'Astar', 'BifrostPolkadot', 'BridgeHubPolkadot', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'EnergyWebX', 'Hydration', 'Interlay', 'Heima', 'Jamton', 'Moonbeam', 'CoretimePolkadot', 'Collectives', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Phala', 'Subsocial', 'KiltSpiritnet', 'Curio', 'Mythos', 'Peaq', 'Polimec', 'RobonomicsPolkadot', 'PeoplePolkadot', 'Unique',
|
|
7
|
+
// Kusama chains
|
|
8
|
+
'AssetHubKusama', 'BridgeHubKusama', 'IntegriteeKusama', 'Karura', 'Kintsugi', 'Moonriver', 'CoretimeKusama', 'Encointer', 'Altair', 'Amplitude', 'Basilisk', 'BifrostKusama', 'CrustShadow', 'Crab', 'Laos', 'Quartz', 'RobonomicsKusama', 'PeopleKusama', 'Shiden', 'Zeitgeist',
|
|
5
9
|
// Westend testnet chains
|
|
6
|
-
'AssetHubWestend', 'BridgeHubWestend', 'CollectivesWestend', 'CoretimeWestend', '
|
|
10
|
+
'AssetHubWestend', 'BridgeHubWestend', 'CollectivesWestend', 'CoretimeWestend', 'Penpal', 'PeopleWestend',
|
|
7
11
|
// Paseo testnet chains
|
|
8
|
-
'
|
|
12
|
+
'AjunaPaseo', 'AssetHubPaseo', 'BifrostPaseo', 'BridgeHubPaseo', 'CoretimePaseo', 'EnergyWebXPaseo', 'HeimaPaseo', 'HydrationPaseo', 'IntegriteePaseo', 'KiltPaseo', 'LaosPaseo', 'NeuroWebPaseo', 'NodlePaseo', 'PAssetHub', 'PeoplePaseo', 'ZeitgeistPaseo'];
|
|
9
13
|
/**
|
|
10
14
|
* Relaychains.
|
|
11
15
|
*/
|
|
@@ -142,9 +146,15 @@ var isRelayChain = function isRelayChain(chain) {
|
|
|
142
146
|
* @returns True if the chain is a system chain; otherwise, false.
|
|
143
147
|
*/
|
|
144
148
|
var isSystemChain = function isSystemChain(chain) {
|
|
145
|
-
var systemChains = ['AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BridgeHubPolkadot', 'BridgeHubKusama', 'BridgeHubWestend', 'BridgeHubPaseo', 'PeoplePolkadot', 'PeopleKusama', 'PeopleWestend', 'PeoplePaseo', 'CoretimePolkadot', 'CoretimeKusama', 'CoretimeWestend', 'CoretimePaseo', 'Collectives', 'CollectivesWestend'
|
|
149
|
+
var systemChains = ['AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BridgeHubPolkadot', 'BridgeHubKusama', 'BridgeHubWestend', 'BridgeHubPaseo', 'PeoplePolkadot', 'PeopleKusama', 'PeopleWestend', 'PeoplePaseo', 'CoretimePolkadot', 'CoretimeKusama', 'CoretimeWestend', 'CoretimePaseo', 'Collectives', 'CollectivesWestend'];
|
|
146
150
|
return systemChains.includes(chain) || isRelayChain(chain);
|
|
147
151
|
};
|
|
152
|
+
var isTrustedChain = function isTrustedChain(chain) {
|
|
153
|
+
var isTrustedByAh = function isTrustedByAh(chain) {
|
|
154
|
+
return ['Mythos'].includes(chain);
|
|
155
|
+
};
|
|
156
|
+
return isTrustedByAh(chain) || isSystemChain(chain);
|
|
157
|
+
};
|
|
148
158
|
|
|
149
159
|
var isPrimitive = function isPrimitive(obj) {
|
|
150
160
|
return obj !== Object(obj);
|
|
@@ -263,4 +273,4 @@ var replaceBigInt = function replaceBigInt(_key, value) {
|
|
|
263
273
|
return typeof value === 'bigint' ? value.toString() : value;
|
|
264
274
|
};
|
|
265
275
|
|
|
266
|
-
export { CHAINS, EXTERNAL_CHAINS, PARACHAINS, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, _deepEqual as deepEqual, getJunctionValue, hasJunction, isDotKsmBridge, isPrimitive, isRelayChain, isSystemChain, isTLocation, replaceBigInt };
|
|
276
|
+
export { CHAINS, EXTERNAL_CHAINS, PARACHAINS, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, _deepEqual as deepEqual, getJunctionValue, hasJunction, isDotKsmBridge, isPrimitive, isRelayChain, isSystemChain, isTLocation, isTrustedChain, replaceBigInt };
|