@paraspell/assets 14.2.2 → 14.3.3

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);
@@ -7932,35 +7932,6 @@ var BifrostKusama = {
7932
7932
  }
7933
7933
  ]
7934
7934
  };
7935
- var Crab = {
7936
- relaychainSymbol: "KSM",
7937
- nativeAssetSymbol: "CRAB",
7938
- isEVM: true,
7939
- ss58Prefix: 42,
7940
- supportsDryRunApi: true,
7941
- supportsXcmPaymentApi: true,
7942
- assets: [
7943
- {
7944
- symbol: "CRAB",
7945
- isNative: true,
7946
- decimals: 18,
7947
- existentialDeposit: "0",
7948
- location: {
7949
- parents: 1,
7950
- interior: {
7951
- X2: [
7952
- {
7953
- Parachain: 2105
7954
- },
7955
- {
7956
- PalletInstance: 5
7957
- }
7958
- ]
7959
- }
7960
- }
7961
- }
7962
- ]
7963
- };
7964
7935
  var CrustShadow = {
7965
7936
  relaychainSymbol: "KSM",
7966
7937
  nativeAssetSymbol: "CSM",
@@ -8824,6 +8795,25 @@ var Jamton = {
8824
8795
  },
8825
8796
  isFeeAsset: true
8826
8797
  },
8798
+ {
8799
+ assetId: "4",
8800
+ symbol: "KSM",
8801
+ decimals: 12,
8802
+ existentialDeposit: "10000000000",
8803
+ location: {
8804
+ parents: 2,
8805
+ interior: {
8806
+ X1: [
8807
+ {
8808
+ GlobalConsensus: {
8809
+ kusama: null
8810
+ }
8811
+ }
8812
+ ]
8813
+ }
8814
+ },
8815
+ isFeeAsset: true
8816
+ },
8827
8817
  {
8828
8818
  assetId: "1",
8829
8819
  symbol: "WUD",
@@ -9751,6 +9741,29 @@ var AssetHubKusama = {
9751
9741
  isFeeAsset: true,
9752
9742
  alias: "USDt2"
9753
9743
  },
9744
+ {
9745
+ assetId: "50000014",
9746
+ symbol: "KSM",
9747
+ decimals: 12,
9748
+ location: {
9749
+ parents: 1,
9750
+ interior: {
9751
+ X3: [
9752
+ {
9753
+ Parachain: 1000
9754
+ },
9755
+ {
9756
+ PalletInstance: 50
9757
+ },
9758
+ {
9759
+ GeneralIndex: 50000014
9760
+ }
9761
+ ]
9762
+ }
9763
+ },
9764
+ existentialDeposit: "1",
9765
+ alias: "KSM5"
9766
+ },
9754
9767
  {
9755
9768
  symbol: "sUSDe",
9756
9769
  decimals: 18,
@@ -16038,96 +16051,6 @@ var HydrationPaseo = {
16038
16051
  }
16039
16052
  ]
16040
16053
  };
16041
- var NeuroWebPaseo = {
16042
- relaychainSymbol: "PAS",
16043
- nativeAssetSymbol: "NEURO",
16044
- isEVM: false,
16045
- ss58Prefix: 101,
16046
- supportsDryRunApi: true,
16047
- supportsXcmPaymentApi: true,
16048
- assets: [
16049
- {
16050
- symbol: "NEURO",
16051
- isNative: true,
16052
- decimals: 12,
16053
- existentialDeposit: "100000000000",
16054
- location: {
16055
- parents: 1,
16056
- interior: {
16057
- X1: [
16058
- {
16059
- Parachain: 2043
16060
- }
16061
- ]
16062
- }
16063
- }
16064
- },
16065
- {
16066
- symbol: "TRAC",
16067
- decimals: 18,
16068
- location: {
16069
- parents: 2,
16070
- interior: {
16071
- X2: [
16072
- {
16073
- GlobalConsensus: {
16074
- Ethereum: {
16075
- chainId: 11155111
16076
- }
16077
- }
16078
- },
16079
- {
16080
- AccountKey20: {
16081
- network: null,
16082
- key: "0xef32abea56beff54f61da319a7311098d6fbcea9"
16083
- }
16084
- }
16085
- ]
16086
- }
16087
- },
16088
- existentialDeposit: "1000000000000000",
16089
- alias: "TRAC1"
16090
- },
16091
- {
16092
- symbol: "TRAC",
16093
- decimals: 18,
16094
- location: {
16095
- parents: 2,
16096
- interior: {
16097
- X2: [
16098
- {
16099
- GlobalConsensus: {
16100
- Ethereum: {
16101
- chainId: 1
16102
- }
16103
- }
16104
- },
16105
- {
16106
- AccountKey20: {
16107
- network: null,
16108
- key: "0xaa7a9ca87d3694b5755f213b5d04094b8d0f0a6f"
16109
- }
16110
- }
16111
- ]
16112
- }
16113
- },
16114
- existentialDeposit: "1",
16115
- alias: "TRAC2"
16116
- },
16117
- {
16118
- symbol: "PAS",
16119
- decimals: 10,
16120
- location: {
16121
- parents: 1,
16122
- interior: {
16123
- Here: null
16124
- }
16125
- },
16126
- existentialDeposit: "10000000",
16127
- isFeeAsset: true
16128
- }
16129
- ]
16130
- };
16131
16054
  var Curio = {
16132
16055
  relaychainSymbol: "KSM",
16133
16056
  nativeAssetSymbol: "CGT",
@@ -16242,6 +16165,53 @@ var Curio = {
16242
16165
  },
16243
16166
  isFeeAsset: true
16244
16167
  },
16168
+ {
16169
+ assetId: "5",
16170
+ symbol: "DOT",
16171
+ decimals: 10,
16172
+ existentialDeposit: "100000000",
16173
+ location: {
16174
+ parents: 2,
16175
+ interior: {
16176
+ X1: [
16177
+ {
16178
+ GlobalConsensus: {
16179
+ polkadot: null
16180
+ }
16181
+ }
16182
+ ]
16183
+ }
16184
+ },
16185
+ isFeeAsset: true
16186
+ },
16187
+ {
16188
+ assetId: "4",
16189
+ symbol: "USDT",
16190
+ decimals: 6,
16191
+ existentialDeposit: "10000",
16192
+ location: {
16193
+ parents: 2,
16194
+ interior: {
16195
+ X4: [
16196
+ {
16197
+ GlobalConsensus: {
16198
+ polkadot: null
16199
+ }
16200
+ },
16201
+ {
16202
+ Parachain: 1000
16203
+ },
16204
+ {
16205
+ PalletInstance: 50
16206
+ },
16207
+ {
16208
+ GeneralIndex: 1984
16209
+ }
16210
+ ]
16211
+ }
16212
+ },
16213
+ isFeeAsset: true
16214
+ },
16245
16215
  {
16246
16216
  assetId: "1",
16247
16217
  symbol: "XOR",
@@ -16287,7 +16257,6 @@ var assetsMapJson = {
16287
16257
  AssetHubPolkadot: AssetHubPolkadot,
16288
16258
  Basilisk: Basilisk,
16289
16259
  BifrostKusama: BifrostKusama,
16290
- Crab: Crab,
16291
16260
  CrustShadow: CrustShadow,
16292
16261
  Encointer: Encointer,
16293
16262
  Karura: Karura,
@@ -16319,7 +16288,6 @@ var assetsMapJson = {
16319
16288
  HeimaPaseo: HeimaPaseo,
16320
16289
  EnergyWebXPaseo: EnergyWebXPaseo,
16321
16290
  HydrationPaseo: HydrationPaseo,
16322
- NeuroWebPaseo: NeuroWebPaseo,
16323
16291
  Curio: Curio
16324
16292
  };
16325
16293
 
@@ -17063,12 +17031,24 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
17063
17031
  return deepEqual(loc1, loc2);
17064
17032
  };
17065
17033
 
17034
+ var isDestinationReachableImpl = function isDestinationReachableImpl(origin, destination, ctx) {
17035
+ if (isExternalChain(origin)) {
17036
+ return !isExternalChain(destination) && isEthereumBridgeOrigin(destination, origin);
17037
+ }
17038
+ if (isExternalChain(destination)) {
17039
+ return isEthereumBridgeOrigin(origin, destination);
17040
+ }
17041
+ if (isSubstrateBridge(origin, destination)) return true;
17042
+ return getRelayChainSymbolImpl(origin, ctx) === getRelayChainSymbolImpl(destination, ctx);
17043
+ };
17044
+ var isDestinationReachable = function isDestinationReachable(origin, destination) {
17045
+ return isDestinationReachableImpl(origin, destination);
17046
+ };
17047
+
17066
17048
  var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination, ctx) {
17067
17049
  var isSubBridge = isSubstrateBridge(origin, destination);
17068
17050
  var isSb = isSnowbridge(origin, destination);
17069
- if (isSb && !ETHEREUM_BRIDGE_ORIGINS.some(function (chain) {
17070
- return chain === origin;
17071
- })) return [];
17051
+ if (!isDestinationReachableImpl(origin, destination, ctx)) return [];
17072
17052
  var originAssets = getAssetsImpl(origin, ctx);
17073
17053
  var destinationAssets = getAssetsImpl(destination, ctx);
17074
17054
  var supportedAssets = originAssets.filter(function (asset) {
@@ -17113,15 +17093,6 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
17113
17093
  return getSupportedAssetsImpl(origin, destination);
17114
17094
  };
17115
17095
 
17116
- var isDestinationReachable = function isDestinationReachable(origin, destination) {
17117
- if (isExternalChain(origin) || isExternalChain(destination)) {
17118
- var substrateSide = isExternalChain(origin) ? destination : origin;
17119
- if (isExternalChain(substrateSide)) return false;
17120
- return ETHEREUM_BRIDGE_ORIGINS.includes(substrateSide);
17121
- }
17122
- if (isSubstrateBridge(origin, destination)) return true;
17123
- return getRelayChainSymbol(origin) === getRelayChainSymbol(destination);
17124
- };
17125
17096
  var isUnsupportedAssetHubNative = function isUnsupportedAssetHubNative(origin, destination, originAsset, nativeAssets) {
17126
17097
  if (isExternalChain(origin) || isExternalChain(destination)) return false;
17127
17098
  var originIsAssetHub = origin.startsWith('AssetHub');
@@ -17186,4 +17157,4 @@ var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
17186
17157
  return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
17187
17158
  };
17188
17159
 
17189
- 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 };
17160
+ 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.2",
3
+ "version": "14.3.3",
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.2"
25
+ "@paraspell/sdk-common": "14.3.3"
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",