@paraspell/assets 14.2.1 → 14.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.d.ts CHANGED
@@ -189,6 +189,9 @@ declare const isAdditionalSubstrateBridgeAsset: (asset: TAssetInfo) => boolean;
189
189
 
190
190
  declare const isAssetEqual: (asset1: TAssetInfo, asset2: TAssetInfo) => boolean;
191
191
 
192
+ declare const isDestinationReachableImpl: <TCustomChain extends string = never>(origin: TChain | TCustomChain, destination: TChain | TCustomChain, ctx?: TCustomCtx) => boolean;
193
+ declare const isDestinationReachable: (origin: TChain, destination: TChain) => boolean;
194
+
192
195
  declare const isStableCoinAsset: (asset: TAssetInfo, assetId?: number) => boolean;
193
196
 
194
197
  declare const isSymbolMatch: (symbolA: string, symbolB: string) => boolean;
@@ -296,5 +299,5 @@ declare const extractAssetLocation: <T = bigint>(asset: TAsset<T>) => TLocation;
296
299
 
297
300
  declare const getAssetLocation: (chain: TChain, currency: TCurrencyInput) => TLocation | null;
298
301
 
299
- export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, STABLECOIN_IDS, assertEdDefined, canonicalizeLocation, compareLocations, extractAssetLocation, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoImpl, findAssetInfoOnDest, findAssetInfoOnDestImpl, findAssetInfoOrThrow, findAssetInfoOrThrowImpl, findAssetOnDestOrThrow, findAssetOnDestOrThrowImpl, findBestMatches, findNativeAssetInfo, findNativeAssetInfoImpl, findNativeAssetInfoOrThrow, findNativeAssetInfoOrThrowImpl, getAllAssetsSymbols, getAssetLocation, getAssets, getAssetsImpl, getAssetsObject, getAssetsObjectImpl, getEdFromAssetOrThrow, getExistentialDeposit, getExistentialDepositImpl, getExistentialDepositOrThrow, getExistentialDepositOrThrowImpl, getFeeAssets, getNativeAssetSymbol, getNativeAssetSymbolImpl, getNativeAssets, getNativeAssetsImpl, getOtherAssets, getOtherAssetsImpl, getRelayChainSymbol, getRelayChainSymbolImpl, getSupportedAssets, getSupportedAssetsImpl, getSupportedDestinations, hasDryRunSupport, hasDryRunSupportImpl, hasXcmPaymentApiSupport, hasXcmPaymentApiSupportImpl, isAdditionalSubstrateBridgeAsset, isAssetEqual, isBridgedSystemAsset, isChainEvm, isChainEvmImpl, isCustomAsset, isStableCoinAsset, isSymbolMatch, isSymbolSpecifier, isSystemAsset, isTAsset, normalizeCustomAssets, normalizeLocation, normalizeSymbol };
302
+ export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, STABLECOIN_IDS, assertEdDefined, canonicalizeLocation, compareLocations, extractAssetLocation, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoImpl, findAssetInfoOnDest, findAssetInfoOnDestImpl, findAssetInfoOrThrow, findAssetInfoOrThrowImpl, findAssetOnDestOrThrow, findAssetOnDestOrThrowImpl, findBestMatches, findNativeAssetInfo, findNativeAssetInfoImpl, findNativeAssetInfoOrThrow, findNativeAssetInfoOrThrowImpl, getAllAssetsSymbols, getAssetLocation, getAssets, getAssetsImpl, getAssetsObject, getAssetsObjectImpl, getEdFromAssetOrThrow, getExistentialDeposit, getExistentialDepositImpl, getExistentialDepositOrThrow, getExistentialDepositOrThrowImpl, getFeeAssets, getNativeAssetSymbol, getNativeAssetSymbolImpl, getNativeAssets, getNativeAssetsImpl, getOtherAssets, getOtherAssetsImpl, getRelayChainSymbol, getRelayChainSymbolImpl, getSupportedAssets, getSupportedAssetsImpl, getSupportedDestinations, hasDryRunSupport, hasDryRunSupportImpl, hasXcmPaymentApiSupport, hasXcmPaymentApiSupportImpl, isAdditionalSubstrateBridgeAsset, isAssetEqual, isBridgedSystemAsset, isChainEvm, isChainEvmImpl, isCustomAsset, isDestinationReachable, isDestinationReachableImpl, isStableCoinAsset, isSymbolMatch, isSymbolSpecifier, isSystemAsset, isTAsset, normalizeCustomAssets, normalizeLocation, normalizeSymbol };
300
303
  export type { TAmount, TAsset, TAssetInfo, TAssetInfoWithId, TAssetJsonMap, TAssetV3, TAssetV4, TAssetWithFee, TChainAssetsInfo, TCurrency, TCurrencyCore, TCurrencyInput, TCurrencyInputWithAmount, TCurrencySymbol, TCurrencySymbolValue, TCustomAssetInfo, TCustomAssetsMap, TCustomAssetsMapNormalized, TCustomCtx, TLocationValue, TSingleCurrencyInput, TSingleCurrencyInputWithAmount, TSymbolSpecifier, WithAmount, WithComplexAmount, WithOptionalAmount };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { ParaSpellError, Version, deepEqual, isChain, isExternalChain, getJunctionValue, hasJunction, Parents, RELAYCHAINS, replaceBigInt, isCustomChain, isSubstrateBridge, isSnowbridge, ETHEREUM_BRIDGE_ORIGINS, SUBSTRATE_CHAINS, CHAINS } from '@paraspell/sdk-common';
1
+ import { ParaSpellError, Version, deepEqual, isChain, isExternalChain, getJunctionValue, hasJunction, Parents, RELAYCHAINS, replaceBigInt, isCustomChain, isSubstrateBridge, isSnowbridge, isEthereumBridgeOrigin, SUBSTRATE_CHAINS, CHAINS } from '@paraspell/sdk-common';
2
2
 
3
3
  function _arrayLikeToArray(r, a) {
4
4
  (null == a || a > r.length) && (a = r.length);
@@ -1739,14 +1739,21 @@ var BifrostPolkadot = {
1739
1739
  location: {
1740
1740
  parents: 1,
1741
1741
  interior: {
1742
- X1: [
1742
+ X2: [
1743
1743
  {
1744
1744
  Parachain: 2030
1745
+ },
1746
+ {
1747
+ GeneralKey: {
1748
+ length: 2,
1749
+ data: "0x0001000000000000000000000000000000000000000000000000000000000000"
1750
+ }
1745
1751
  }
1746
1752
  ]
1747
1753
  }
1748
1754
  },
1749
- isNative: true
1755
+ isNative: true,
1756
+ isFeeAsset: true
1750
1757
  },
1751
1758
  {
1752
1759
  assetId: "6",
@@ -7619,14 +7626,21 @@ var BifrostKusama = {
7619
7626
  location: {
7620
7627
  parents: 1,
7621
7628
  interior: {
7622
- X1: [
7629
+ X2: [
7623
7630
  {
7624
7631
  Parachain: 2001
7632
+ },
7633
+ {
7634
+ GeneralKey: {
7635
+ length: 2,
7636
+ data: "0x0001000000000000000000000000000000000000000000000000000000000000"
7637
+ }
7625
7638
  }
7626
7639
  ]
7627
7640
  }
7628
7641
  },
7629
- isNative: true
7642
+ isNative: true,
7643
+ isFeeAsset: true
7630
7644
  },
7631
7645
  {
7632
7646
  symbol: "KSM",
@@ -7918,35 +7932,6 @@ var BifrostKusama = {
7918
7932
  }
7919
7933
  ]
7920
7934
  };
7921
- var Crab = {
7922
- relaychainSymbol: "KSM",
7923
- nativeAssetSymbol: "CRAB",
7924
- isEVM: true,
7925
- ss58Prefix: 42,
7926
- supportsDryRunApi: true,
7927
- supportsXcmPaymentApi: true,
7928
- assets: [
7929
- {
7930
- symbol: "CRAB",
7931
- isNative: true,
7932
- decimals: 18,
7933
- existentialDeposit: "0",
7934
- location: {
7935
- parents: 1,
7936
- interior: {
7937
- X2: [
7938
- {
7939
- Parachain: 2105
7940
- },
7941
- {
7942
- PalletInstance: 5
7943
- }
7944
- ]
7945
- }
7946
- }
7947
- }
7948
- ]
7949
- };
7950
7935
  var CrustShadow = {
7951
7936
  relaychainSymbol: "KSM",
7952
7937
  nativeAssetSymbol: "CSM",
@@ -16024,96 +16009,6 @@ var HydrationPaseo = {
16024
16009
  }
16025
16010
  ]
16026
16011
  };
16027
- var NeuroWebPaseo = {
16028
- relaychainSymbol: "PAS",
16029
- nativeAssetSymbol: "NEURO",
16030
- isEVM: false,
16031
- ss58Prefix: 101,
16032
- supportsDryRunApi: true,
16033
- supportsXcmPaymentApi: true,
16034
- assets: [
16035
- {
16036
- symbol: "NEURO",
16037
- isNative: true,
16038
- decimals: 12,
16039
- existentialDeposit: "100000000000",
16040
- location: {
16041
- parents: 1,
16042
- interior: {
16043
- X1: [
16044
- {
16045
- Parachain: 2043
16046
- }
16047
- ]
16048
- }
16049
- }
16050
- },
16051
- {
16052
- symbol: "TRAC",
16053
- decimals: 18,
16054
- location: {
16055
- parents: 2,
16056
- interior: {
16057
- X2: [
16058
- {
16059
- GlobalConsensus: {
16060
- Ethereum: {
16061
- chainId: 11155111
16062
- }
16063
- }
16064
- },
16065
- {
16066
- AccountKey20: {
16067
- network: null,
16068
- key: "0xef32abea56beff54f61da319a7311098d6fbcea9"
16069
- }
16070
- }
16071
- ]
16072
- }
16073
- },
16074
- existentialDeposit: "1000000000000000",
16075
- alias: "TRAC1"
16076
- },
16077
- {
16078
- symbol: "TRAC",
16079
- decimals: 18,
16080
- location: {
16081
- parents: 2,
16082
- interior: {
16083
- X2: [
16084
- {
16085
- GlobalConsensus: {
16086
- Ethereum: {
16087
- chainId: 1
16088
- }
16089
- }
16090
- },
16091
- {
16092
- AccountKey20: {
16093
- network: null,
16094
- key: "0xaa7a9ca87d3694b5755f213b5d04094b8d0f0a6f"
16095
- }
16096
- }
16097
- ]
16098
- }
16099
- },
16100
- existentialDeposit: "1",
16101
- alias: "TRAC2"
16102
- },
16103
- {
16104
- symbol: "PAS",
16105
- decimals: 10,
16106
- location: {
16107
- parents: 1,
16108
- interior: {
16109
- Here: null
16110
- }
16111
- },
16112
- existentialDeposit: "10000000",
16113
- isFeeAsset: true
16114
- }
16115
- ]
16116
- };
16117
16012
  var Curio = {
16118
16013
  relaychainSymbol: "KSM",
16119
16014
  nativeAssetSymbol: "CGT",
@@ -16273,7 +16168,6 @@ var assetsMapJson = {
16273
16168
  AssetHubPolkadot: AssetHubPolkadot,
16274
16169
  Basilisk: Basilisk,
16275
16170
  BifrostKusama: BifrostKusama,
16276
- Crab: Crab,
16277
16171
  CrustShadow: CrustShadow,
16278
16172
  Encointer: Encointer,
16279
16173
  Karura: Karura,
@@ -16305,7 +16199,6 @@ var assetsMapJson = {
16305
16199
  HeimaPaseo: HeimaPaseo,
16306
16200
  EnergyWebXPaseo: EnergyWebXPaseo,
16307
16201
  HydrationPaseo: HydrationPaseo,
16308
- NeuroWebPaseo: NeuroWebPaseo,
16309
16202
  Curio: Curio
16310
16203
  };
16311
16204
 
@@ -17049,12 +16942,24 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
17049
16942
  return deepEqual(loc1, loc2);
17050
16943
  };
17051
16944
 
16945
+ var isDestinationReachableImpl = function isDestinationReachableImpl(origin, destination, ctx) {
16946
+ if (isExternalChain(origin)) {
16947
+ return !isExternalChain(destination) && isEthereumBridgeOrigin(destination, origin);
16948
+ }
16949
+ if (isExternalChain(destination)) {
16950
+ return isEthereumBridgeOrigin(origin, destination);
16951
+ }
16952
+ if (isSubstrateBridge(origin, destination)) return true;
16953
+ return getRelayChainSymbolImpl(origin, ctx) === getRelayChainSymbolImpl(destination, ctx);
16954
+ };
16955
+ var isDestinationReachable = function isDestinationReachable(origin, destination) {
16956
+ return isDestinationReachableImpl(origin, destination);
16957
+ };
16958
+
17052
16959
  var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination, ctx) {
17053
16960
  var isSubBridge = isSubstrateBridge(origin, destination);
17054
16961
  var isSb = isSnowbridge(origin, destination);
17055
- if (isSb && !ETHEREUM_BRIDGE_ORIGINS.some(function (chain) {
17056
- return chain === origin;
17057
- })) return [];
16962
+ if (!isDestinationReachableImpl(origin, destination, ctx)) return [];
17058
16963
  var originAssets = getAssetsImpl(origin, ctx);
17059
16964
  var destinationAssets = getAssetsImpl(destination, ctx);
17060
16965
  var supportedAssets = originAssets.filter(function (asset) {
@@ -17099,15 +17004,6 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
17099
17004
  return getSupportedAssetsImpl(origin, destination);
17100
17005
  };
17101
17006
 
17102
- var isDestinationReachable = function isDestinationReachable(origin, destination) {
17103
- if (isExternalChain(origin) || isExternalChain(destination)) {
17104
- var substrateSide = isExternalChain(origin) ? destination : origin;
17105
- if (isExternalChain(substrateSide)) return false;
17106
- return ETHEREUM_BRIDGE_ORIGINS.includes(substrateSide);
17107
- }
17108
- if (isSubstrateBridge(origin, destination)) return true;
17109
- return getRelayChainSymbol(origin) === getRelayChainSymbol(destination);
17110
- };
17111
17007
  var isUnsupportedAssetHubNative = function isUnsupportedAssetHubNative(origin, destination, originAsset, nativeAssets) {
17112
17008
  if (isExternalChain(origin) || isExternalChain(destination)) return false;
17113
17009
  var originIsAssetHub = origin.startsWith('AssetHub');
@@ -17172,4 +17068,4 @@ var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
17172
17068
  return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
17173
17069
  };
17174
17070
 
17175
- export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, STABLECOIN_IDS, assertEdDefined, canonicalizeLocation, compareLocations, extractAssetLocation, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoImpl, findAssetInfoOnDest, findAssetInfoOnDestImpl, findAssetInfoOrThrow, findAssetInfoOrThrowImpl, findAssetOnDestOrThrow, findAssetOnDestOrThrowImpl, findBestMatches, findNativeAssetInfo, findNativeAssetInfoImpl, findNativeAssetInfoOrThrow, findNativeAssetInfoOrThrowImpl, getAllAssetsSymbols, getAssetLocation, getAssets, getAssetsImpl, getAssetsObject, getAssetsObjectImpl, getEdFromAssetOrThrow, getExistentialDeposit, getExistentialDepositImpl, getExistentialDepositOrThrow, getExistentialDepositOrThrowImpl, getFeeAssets, getNativeAssetSymbol, getNativeAssetSymbolImpl, getNativeAssets, getNativeAssetsImpl, getOtherAssets, getOtherAssetsImpl, getRelayChainSymbol, getRelayChainSymbolImpl, getSupportedAssets, getSupportedAssetsImpl, getSupportedDestinations, hasDryRunSupport, hasDryRunSupportImpl, hasXcmPaymentApiSupport, hasXcmPaymentApiSupportImpl, isAdditionalSubstrateBridgeAsset, isAssetEqual, isBridgedSystemAsset, isChainEvm, isChainEvmImpl, isCustomAsset, isStableCoinAsset, isSymbolMatch, isSymbolSpecifier, isSystemAsset, isTAsset, normalizeCustomAssets, normalizeLocation, normalizeSymbol };
17071
+ export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, STABLECOIN_IDS, assertEdDefined, canonicalizeLocation, compareLocations, extractAssetLocation, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoImpl, findAssetInfoOnDest, findAssetInfoOnDestImpl, findAssetInfoOrThrow, findAssetInfoOrThrowImpl, findAssetOnDestOrThrow, findAssetOnDestOrThrowImpl, findBestMatches, findNativeAssetInfo, findNativeAssetInfoImpl, findNativeAssetInfoOrThrow, findNativeAssetInfoOrThrowImpl, getAllAssetsSymbols, getAssetLocation, getAssets, getAssetsImpl, getAssetsObject, getAssetsObjectImpl, getEdFromAssetOrThrow, getExistentialDeposit, getExistentialDepositImpl, getExistentialDepositOrThrow, getExistentialDepositOrThrowImpl, getFeeAssets, getNativeAssetSymbol, getNativeAssetSymbolImpl, getNativeAssets, getNativeAssetsImpl, getOtherAssets, getOtherAssetsImpl, getRelayChainSymbol, getRelayChainSymbolImpl, getSupportedAssets, getSupportedAssetsImpl, getSupportedDestinations, hasDryRunSupport, hasDryRunSupportImpl, hasXcmPaymentApiSupport, hasXcmPaymentApiSupportImpl, isAdditionalSubstrateBridgeAsset, isAssetEqual, isBridgedSystemAsset, isChainEvm, isChainEvmImpl, isCustomAsset, isDestinationReachable, isDestinationReachableImpl, isStableCoinAsset, isSymbolMatch, isSymbolSpecifier, isSystemAsset, isTAsset, normalizeCustomAssets, normalizeLocation, normalizeSymbol };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/assets",
3
- "version": "14.2.1",
3
+ "version": "14.3.0",
4
4
  "description": "Assets for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,24 +22,24 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@paraspell/sdk-common": "14.2.1"
25
+ "@paraspell/sdk-common": "14.3.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@babel/plugin-syntax-import-attributes": "^7.29.7",
29
29
  "@babel/preset-env": "^7.29.7",
30
30
  "@codecov/rollup-plugin": "^2.0.1",
31
- "@polkadot-api/metadata-builders": "^0.14.3",
32
- "@polkadot-api/substrate-bindings": "^0.20.3",
31
+ "@polkadot-api/metadata-builders": "^0.15.0",
32
+ "@polkadot-api/substrate-bindings": "^0.21.0",
33
33
  "@rollup/plugin-babel": "^7.1.0",
34
34
  "@rollup/plugin-json": "^6.1.0",
35
35
  "@rollup/plugin-typescript": "^12.3.0",
36
- "@snowbridge/registry": "^1.1.12",
37
- "@vitest/coverage-v8": "^4.1.10",
36
+ "@snowbridge/registry": "^1.1.13",
37
+ "@vitest/coverage-v8": "^4.1.11",
38
38
  "dotenv": "^17.4.2",
39
- "polkadot-api": "^2.2.1",
40
- "rollup": "^4.62.3",
41
- "rollup-plugin-dts": "^6.4.1",
42
- "tsx": "^4.23.1"
39
+ "polkadot-api": "^3.0.0",
40
+ "rollup": "^4.62.5",
41
+ "rollup-plugin-dts": "^6.5.1",
42
+ "tsx": "^4.23.12"
43
43
  },
44
44
  "scripts": {
45
45
  "compile": "tsc --noEmit",