@paraspell/sdk-common 10.7.2 → 10.8.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 +21 -10
- package/dist/index.d.ts +13 -6
- package/dist/index.mjs +21 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -120,6 +120,26 @@ exports.Version = void 0;
|
|
|
120
120
|
Version["V5"] = "V5";
|
|
121
121
|
})(exports.Version || (exports.Version = {}));
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Determines whether a given node is a relay chain (Polkadot or Kusama).
|
|
125
|
+
*
|
|
126
|
+
* @param node - The node to check.
|
|
127
|
+
* @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
|
|
128
|
+
*/
|
|
129
|
+
var isRelayChain = function isRelayChain(node) {
|
|
130
|
+
return node === 'Polkadot' || node === 'Kusama';
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Checks if a given node is a system chain.
|
|
134
|
+
*
|
|
135
|
+
* @param node - The node to check.
|
|
136
|
+
* @returns True if the node is a system chain; otherwise, false.
|
|
137
|
+
*/
|
|
138
|
+
var isSystemChain = function isSystemChain(node) {
|
|
139
|
+
var systemChains = ['AssetHubPolkadot', 'AssetHubKusama', 'BridgeHubPolkadot', 'BridgeHubKusama', 'PeoplePolkadot', 'PeopleKusama', 'Mythos'];
|
|
140
|
+
return systemChains.includes(node);
|
|
141
|
+
};
|
|
142
|
+
|
|
123
143
|
var isPrimitive = function isPrimitive(obj) {
|
|
124
144
|
return obj !== Object(obj);
|
|
125
145
|
};
|
|
@@ -177,16 +197,6 @@ var isDotKsmBridge = function isDotKsmBridge(origin, destination) {
|
|
|
177
197
|
return origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot';
|
|
178
198
|
};
|
|
179
199
|
|
|
180
|
-
/**
|
|
181
|
-
* Determines whether a given node is a relay chain (Polkadot or Kusama).
|
|
182
|
-
*
|
|
183
|
-
* @param node - The node to check.
|
|
184
|
-
* @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
|
|
185
|
-
*/
|
|
186
|
-
var isRelayChain = function isRelayChain(node) {
|
|
187
|
-
return node === 'Polkadot' || node === 'Kusama';
|
|
188
|
-
};
|
|
189
|
-
|
|
190
200
|
var flattenJunctions = function flattenJunctions(junctions) {
|
|
191
201
|
if (junctions.Here !== undefined) {
|
|
192
202
|
return [];
|
|
@@ -257,5 +267,6 @@ exports.hasJunction = hasJunction;
|
|
|
257
267
|
exports.isDotKsmBridge = isDotKsmBridge;
|
|
258
268
|
exports.isPrimitive = isPrimitive;
|
|
259
269
|
exports.isRelayChain = isRelayChain;
|
|
270
|
+
exports.isSystemChain = isSystemChain;
|
|
260
271
|
exports.isTMultiLocation = isTMultiLocation;
|
|
261
272
|
exports.replaceBigInt = replaceBigInt;
|
package/dist/index.d.ts
CHANGED
|
@@ -108,11 +108,6 @@ declare enum Version {
|
|
|
108
108
|
|
|
109
109
|
declare const isTMultiLocation: (value: unknown) => value is TMultiLocation;
|
|
110
110
|
|
|
111
|
-
declare const isPrimitive: (obj: unknown) => boolean;
|
|
112
|
-
declare const deepEqual: (obj1: unknown, obj2: unknown) => boolean;
|
|
113
|
-
|
|
114
|
-
declare const isDotKsmBridge: (origin: TNodeDotKsmWithRelayChains, destination: TNodeWithRelayChains) => boolean;
|
|
115
|
-
|
|
116
111
|
/**
|
|
117
112
|
* Determines whether a given node is a relay chain (Polkadot or Kusama).
|
|
118
113
|
*
|
|
@@ -120,11 +115,23 @@ declare const isDotKsmBridge: (origin: TNodeDotKsmWithRelayChains, destination:
|
|
|
120
115
|
* @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
|
|
121
116
|
*/
|
|
122
117
|
declare const isRelayChain: (node: TNodeWithRelayChains) => node is "Polkadot" | "Kusama";
|
|
118
|
+
/**
|
|
119
|
+
* Checks if a given node is a system chain.
|
|
120
|
+
*
|
|
121
|
+
* @param node - The node to check.
|
|
122
|
+
* @returns True if the node is a system chain; otherwise, false.
|
|
123
|
+
*/
|
|
124
|
+
declare const isSystemChain: (node: TNodeWithRelayChains) => boolean;
|
|
125
|
+
|
|
126
|
+
declare const isPrimitive: (obj: unknown) => boolean;
|
|
127
|
+
declare const deepEqual: (obj1: unknown, obj2: unknown) => boolean;
|
|
128
|
+
|
|
129
|
+
declare const isDotKsmBridge: (origin: TNodeDotKsmWithRelayChains, destination: TNodeWithRelayChains) => boolean;
|
|
123
130
|
|
|
124
131
|
declare const getJunctionValue: <T = unknown>(multiLocation: TMultiLocation, junctionType: TJunctionType) => T | undefined;
|
|
125
132
|
declare const hasJunction: (multiLocation: TMultiLocation, junctionType: TJunctionType, junctionValue?: unknown) => boolean;
|
|
126
133
|
|
|
127
134
|
declare const replaceBigInt: (_key: string, value: unknown) => unknown;
|
|
128
135
|
|
|
129
|
-
export { NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Parents, Version, deepEqual, getJunctionValue, hasJunction, isDotKsmBridge, isPrimitive, isRelayChain, isTMultiLocation, replaceBigInt };
|
|
136
|
+
export { NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Parents, Version, deepEqual, getJunctionValue, hasJunction, isDotKsmBridge, isPrimitive, isRelayChain, isSystemChain, isTMultiLocation, replaceBigInt };
|
|
130
137
|
export type { TEcosystemType, TJunction, TJunctionGeneralIndex, TJunctionParachain, TJunctionType, TJunctions, TMultiLocation, TNode, TNodeDotKsmWithRelayChains, TNodePolkadotKusama, TNodeWithRelayChains, TRelayChainSymbol };
|
package/dist/index.mjs
CHANGED
|
@@ -118,6 +118,26 @@ var Version;
|
|
|
118
118
|
Version["V5"] = "V5";
|
|
119
119
|
})(Version || (Version = {}));
|
|
120
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Determines whether a given node is a relay chain (Polkadot or Kusama).
|
|
123
|
+
*
|
|
124
|
+
* @param node - The node to check.
|
|
125
|
+
* @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
|
|
126
|
+
*/
|
|
127
|
+
var isRelayChain = function isRelayChain(node) {
|
|
128
|
+
return node === 'Polkadot' || node === 'Kusama';
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Checks if a given node is a system chain.
|
|
132
|
+
*
|
|
133
|
+
* @param node - The node to check.
|
|
134
|
+
* @returns True if the node is a system chain; otherwise, false.
|
|
135
|
+
*/
|
|
136
|
+
var isSystemChain = function isSystemChain(node) {
|
|
137
|
+
var systemChains = ['AssetHubPolkadot', 'AssetHubKusama', 'BridgeHubPolkadot', 'BridgeHubKusama', 'PeoplePolkadot', 'PeopleKusama', 'Mythos'];
|
|
138
|
+
return systemChains.includes(node);
|
|
139
|
+
};
|
|
140
|
+
|
|
121
141
|
var isPrimitive = function isPrimitive(obj) {
|
|
122
142
|
return obj !== Object(obj);
|
|
123
143
|
};
|
|
@@ -175,16 +195,6 @@ var isDotKsmBridge = function isDotKsmBridge(origin, destination) {
|
|
|
175
195
|
return origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot';
|
|
176
196
|
};
|
|
177
197
|
|
|
178
|
-
/**
|
|
179
|
-
* Determines whether a given node is a relay chain (Polkadot or Kusama).
|
|
180
|
-
*
|
|
181
|
-
* @param node - The node to check.
|
|
182
|
-
* @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
|
|
183
|
-
*/
|
|
184
|
-
var isRelayChain = function isRelayChain(node) {
|
|
185
|
-
return node === 'Polkadot' || node === 'Kusama';
|
|
186
|
-
};
|
|
187
|
-
|
|
188
198
|
var flattenJunctions = function flattenJunctions(junctions) {
|
|
189
199
|
if (junctions.Here !== undefined) {
|
|
190
200
|
return [];
|
|
@@ -245,4 +255,4 @@ var replaceBigInt = function replaceBigInt(_key, value) {
|
|
|
245
255
|
return typeof value === 'bigint' ? value.toString() : value;
|
|
246
256
|
};
|
|
247
257
|
|
|
248
|
-
export { NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Parents, Version, _deepEqual as deepEqual, getJunctionValue, hasJunction, isDotKsmBridge, isPrimitive, isRelayChain, isTMultiLocation, replaceBigInt };
|
|
258
|
+
export { NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Parents, Version, _deepEqual as deepEqual, getJunctionValue, hasJunction, isDotKsmBridge, isPrimitive, isRelayChain, isSystemChain, isTMultiLocation, replaceBigInt };
|