@paraspell/sdk-common 14.3.0 → 14.3.4
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 +3 -1
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -208,6 +208,8 @@ declare const isTrustedChain: <TCustomChain extends string = never>(chain: TChai
|
|
|
208
208
|
declare const isPrimitive: (obj: unknown) => boolean;
|
|
209
209
|
declare const deepEqual: (obj1: unknown, obj2: unknown) => boolean;
|
|
210
210
|
|
|
211
|
+
declare const flattenJunctions: (junctions: TJunctions) => TJunction[];
|
|
212
|
+
|
|
211
213
|
declare const getJunctionValue: <T = unknown>(location: TLocation, junctionType: TJunctionType) => T | undefined;
|
|
212
214
|
declare const hasJunction: (location: TLocation, junctionType: TJunctionType, junctionValue?: unknown) => boolean;
|
|
213
215
|
|
|
@@ -216,5 +218,5 @@ declare const replaceBigInt: (_key: string, value: unknown) => unknown;
|
|
|
216
218
|
declare const lowercaseFirstLetter: (value: string) => string;
|
|
217
219
|
declare const snakeToCamel: (str: string) => string;
|
|
218
220
|
|
|
219
|
-
export { CHAINS, DEFAULT_SS58_PREFIX, ETHEREUM_BRIDGE_ORIGINS, EXTERNAL_CHAINS, PARACHAINS, ParaSpellError, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, deepEqual, getJunctionValue, hasJunction, isBridge, isChain, isCustomChain, isEthereumBridgeOrigin, isExternalChain, isPrimitive, isRelayChain, isSnowbridge, isSubstrateBridge, isSubstrateChain, isSystemChain, isTLocation, isTrustedChain, lowercaseFirstLetter, replaceBigInt, snakeToCamel };
|
|
221
|
+
export { CHAINS, DEFAULT_SS58_PREFIX, ETHEREUM_BRIDGE_ORIGINS, EXTERNAL_CHAINS, PARACHAINS, ParaSpellError, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, deepEqual, flattenJunctions, getJunctionValue, hasJunction, isBridge, isChain, isCustomChain, isEthereumBridgeOrigin, isExternalChain, isPrimitive, isRelayChain, isSnowbridge, isSubstrateBridge, isSubstrateChain, isSystemChain, isTLocation, isTrustedChain, lowercaseFirstLetter, replaceBigInt, snakeToCamel };
|
|
220
222
|
export type { TChain, TExternalChain, TJunction, TJunctionAccountId32, TJunctionAccountIndex64, TJunctionAccountKey20, TJunctionGeneralIndex, TJunctionGeneralKey, TJunctionGlobalConsensus, TJunctionOnlyChild, TJunctionPalletInstance, TJunctionParachain, TJunctionPlurality, TJunctionType, TJunctions, TLocation, TParachain, TRelaychain, TStringOrNumberOrBigInt, TSubstrateChain };
|
package/dist/index.mjs
CHANGED
|
@@ -369,8 +369,12 @@ var isBridge = function isBridge(origin, destination) {
|
|
|
369
369
|
var isPrimitive = function isPrimitive(obj) {
|
|
370
370
|
return obj !== Object(obj);
|
|
371
371
|
};
|
|
372
|
+
var isNumeric = function isNumeric(value) {
|
|
373
|
+
return typeof value === 'number' || typeof value === 'bigint';
|
|
374
|
+
};
|
|
372
375
|
var _deepEqual = function deepEqual(obj1, obj2) {
|
|
373
376
|
if (obj1 === obj2) return true;
|
|
377
|
+
if (isNumeric(obj1) && isNumeric(obj2)) return obj1 == obj2;
|
|
374
378
|
if (isPrimitive(obj1) && isPrimitive(obj2)) return obj1 === obj2;
|
|
375
379
|
if (_typeof(obj1) !== 'object' || obj1 === null || _typeof(obj2) !== 'object' || obj2 === null) {
|
|
376
380
|
return false;
|
|
@@ -468,11 +472,7 @@ var hasJunction = function hasJunction(location, junctionType, junctionValue) {
|
|
|
468
472
|
return true;
|
|
469
473
|
}
|
|
470
474
|
var jv = matchingJunction[junctionType];
|
|
471
|
-
|
|
472
|
-
return JSON.stringify(jv) === JSON.stringify(junctionValue);
|
|
473
|
-
} catch (_unused) {
|
|
474
|
-
return jv === junctionValue;
|
|
475
|
-
}
|
|
475
|
+
return _deepEqual(jv, junctionValue);
|
|
476
476
|
};
|
|
477
477
|
|
|
478
478
|
var replaceBigInt = function replaceBigInt(_key, value) {
|
|
@@ -488,4 +488,4 @@ var snakeToCamel = function snakeToCamel(str) {
|
|
|
488
488
|
});
|
|
489
489
|
};
|
|
490
490
|
|
|
491
|
-
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, isEthereumBridgeOrigin, isExternalChain, isPrimitive, isRelayChain, isSnowbridge, isSubstrateBridge, isSubstrateChain, isSystemChain, isTLocation, isTrustedChain, lowercaseFirstLetter, replaceBigInt, snakeToCamel };
|
|
491
|
+
export { CHAINS, DEFAULT_SS58_PREFIX, ETHEREUM_BRIDGE_ORIGINS, EXTERNAL_CHAINS, PARACHAINS, ParaSpellError, Parents, RELAYCHAINS, SUBSTRATE_CHAINS, Version, _deepEqual as deepEqual, flattenJunctions, getJunctionValue, hasJunction, isBridge, isChain, isCustomChain, isEthereumBridgeOrigin, isExternalChain, isPrimitive, isRelayChain, isSnowbridge, isSubstrateBridge, isSubstrateChain, isSystemChain, isTLocation, isTrustedChain, lowercaseFirstLetter, replaceBigInt, snakeToCamel };
|