@paraspell/assets 14.1.1 → 14.2.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
@@ -185,6 +185,8 @@ declare const getSupportedAssets: (origin: TChain, destination: TChain) => TAsse
185
185
 
186
186
  declare const getSupportedDestinations: (origin: TChain, currency: TCurrencyCore) => TChain[];
187
187
 
188
+ declare const isAdditionalSubstrateBridgeAsset: (asset: TAssetInfo) => boolean;
189
+
188
190
  declare const isAssetEqual: (asset1: TAssetInfo, asset2: TAssetInfo) => boolean;
189
191
 
190
192
  declare const isStableCoinAsset: (asset: TAssetInfo, assetId?: number) => boolean;
@@ -292,5 +294,5 @@ declare const extractAssetLocation: <T = bigint>(asset: TAsset<T>) => TLocation;
292
294
 
293
295
  declare const getAssetLocation: (chain: TChain, currency: TCurrencyInput) => TLocation | null;
294
296
 
295
- export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, 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, isAssetEqual, isBridgedSystemAsset, isChainEvm, isChainEvmImpl, isCustomAsset, isStableCoinAsset, isSymbolMatch, isSymbolSpecifier, isSystemAsset, isTAsset, normalizeCustomAssets, normalizeLocation, normalizeSymbol };
297
+ export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, 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 };
296
298
  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, SUBSTRATE_CHAINS, CHAINS, ETHEREUM_BRIDGE_ORIGINS } from '@paraspell/sdk-common';
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';
2
2
 
3
3
  function _arrayLikeToArray(r, a) {
4
4
  (null == a || a > r.length) && (a = r.length);
@@ -8783,55 +8783,6 @@ var Jamton = {
8783
8783
  },
8784
8784
  isNative: true
8785
8785
  },
8786
- {
8787
- assetId: "2",
8788
- symbol: "jamTON",
8789
- decimals: 9,
8790
- existentialDeposit: "1000000",
8791
- location: {
8792
- parents: 1,
8793
- interior: {
8794
- X3: [
8795
- {
8796
- Parachain: 1000
8797
- },
8798
- {
8799
- PalletInstance: 50
8800
- },
8801
- {
8802
- GeneralIndex: 22222078
8803
- }
8804
- ]
8805
- }
8806
- },
8807
- isNative: true
8808
- },
8809
- {
8810
- assetId: "1",
8811
- symbol: "stDOT",
8812
- decimals: 10,
8813
- existentialDeposit: "10000000",
8814
- location: {
8815
- parents: 1,
8816
- interior: {
8817
- X3: [
8818
- {
8819
- Parachain: 2004
8820
- },
8821
- {
8822
- PalletInstance: 110
8823
- },
8824
- {
8825
- AccountKey20: {
8826
- network: null,
8827
- key: "0xbc7e02c4178a7df7d3e564323a5c359dc96c4db4"
8828
- }
8829
- }
8830
- ]
8831
- }
8832
- },
8833
- isNative: true
8834
- },
8835
8786
  {
8836
8787
  assetId: "0",
8837
8788
  symbol: "DOT",
@@ -16175,6 +16126,145 @@ var NeuroWebPaseo = {
16175
16126
  }
16176
16127
  ]
16177
16128
  };
16129
+ var Curio = {
16130
+ relaychainSymbol: "KSM",
16131
+ nativeAssetSymbol: "CGT",
16132
+ isEVM: false,
16133
+ ss58Prefix: 777,
16134
+ supportsDryRunApi: true,
16135
+ supportsXcmPaymentApi: true,
16136
+ assets: [
16137
+ {
16138
+ symbol: "CGT",
16139
+ decimals: 18,
16140
+ existentialDeposit: "10000000000000000",
16141
+ location: {
16142
+ parents: 2,
16143
+ interior: {
16144
+ X2: [
16145
+ {
16146
+ GlobalConsensus: {
16147
+ Ethereum: {
16148
+ chainId: 1
16149
+ }
16150
+ }
16151
+ },
16152
+ {
16153
+ AccountKey20: {
16154
+ network: null,
16155
+ key: "0x0e186357c323c806c1efdad36d217f7a54b63d18"
16156
+ }
16157
+ }
16158
+ ]
16159
+ }
16160
+ },
16161
+ isNative: true,
16162
+ isFeeAsset: true
16163
+ },
16164
+ {
16165
+ symbol: "KSM",
16166
+ decimals: 12,
16167
+ existentialDeposit: "333333333",
16168
+ location: {
16169
+ parents: 1,
16170
+ interior: {
16171
+ Here: null
16172
+ }
16173
+ },
16174
+ isNative: true,
16175
+ isFeeAsset: true
16176
+ },
16177
+ {
16178
+ assetId: "0",
16179
+ symbol: "BSX",
16180
+ decimals: 12,
16181
+ existentialDeposit: "1000000000000",
16182
+ location: {
16183
+ parents: 1,
16184
+ interior: {
16185
+ X2: [
16186
+ {
16187
+ Parachain: 2090
16188
+ },
16189
+ {
16190
+ GeneralIndex: 0
16191
+ }
16192
+ ]
16193
+ }
16194
+ },
16195
+ isFeeAsset: true
16196
+ },
16197
+ {
16198
+ assetId: "2",
16199
+ symbol: "VAL",
16200
+ decimals: 18,
16201
+ existentialDeposit: "1000000000000000",
16202
+ location: {
16203
+ parents: 1,
16204
+ interior: {
16205
+ X2: [
16206
+ {
16207
+ Parachain: 2011
16208
+ },
16209
+ {
16210
+ GeneralKey: {
16211
+ length: 32,
16212
+ data: "0x0200040000000000000000000000000000000000000000000000000000000000"
16213
+ }
16214
+ }
16215
+ ]
16216
+ }
16217
+ },
16218
+ isFeeAsset: true
16219
+ },
16220
+ {
16221
+ assetId: "3",
16222
+ symbol: "PSWAP",
16223
+ decimals: 18,
16224
+ existentialDeposit: "1000000000000000000",
16225
+ location: {
16226
+ parents: 1,
16227
+ interior: {
16228
+ X2: [
16229
+ {
16230
+ Parachain: 2011
16231
+ },
16232
+ {
16233
+ GeneralKey: {
16234
+ length: 32,
16235
+ data: "0x0200050000000000000000000000000000000000000000000000000000000000"
16236
+ }
16237
+ }
16238
+ ]
16239
+ }
16240
+ },
16241
+ isFeeAsset: true
16242
+ },
16243
+ {
16244
+ assetId: "1",
16245
+ symbol: "XOR",
16246
+ decimals: 18,
16247
+ existentialDeposit: "1000000000000000",
16248
+ location: {
16249
+ parents: 1,
16250
+ interior: {
16251
+ X2: [
16252
+ {
16253
+ Parachain: 2011
16254
+ },
16255
+ {
16256
+ GeneralKey: {
16257
+ length: 32,
16258
+ data: "0x0200000000000000000000000000000000000000000000000000000000000000"
16259
+ }
16260
+ }
16261
+ ]
16262
+ }
16263
+ },
16264
+ isFeeAsset: true
16265
+ }
16266
+ ]
16267
+ };
16178
16268
  var assetsMapJson = {
16179
16269
  Polkadot: Polkadot,
16180
16270
  Kusama: Kusama,
@@ -16227,7 +16317,8 @@ var assetsMapJson = {
16227
16317
  HeimaPaseo: HeimaPaseo,
16228
16318
  EnergyWebXPaseo: EnergyWebXPaseo,
16229
16319
  HydrationPaseo: HydrationPaseo,
16230
- NeuroWebPaseo: NeuroWebPaseo
16320
+ NeuroWebPaseo: NeuroWebPaseo,
16321
+ Curio: Curio
16231
16322
  };
16232
16323
 
16233
16324
  /**
@@ -16929,26 +17020,41 @@ var getNativeAssetSymbol = function getNativeAssetSymbol(chain) {
16929
17020
  return getNativeAssetSymbolImpl(chain);
16930
17021
  };
16931
17022
  var hasDryRunSupportImpl = function hasDryRunSupportImpl(chain, ctx) {
16932
- // These chains have DryRun but it's not working
16933
- var DISABLED_CHAINS = ['Jamton'];
16934
- return getAssetsObjectImpl(chain, ctx).supportsDryRunApi && !DISABLED_CHAINS.some(function (disabled) {
16935
- return disabled === chain;
16936
- });
17023
+ return getAssetsObjectImpl(chain, ctx).supportsDryRunApi;
16937
17024
  };
16938
17025
  var hasDryRunSupport = function hasDryRunSupport(chain) {
16939
17026
  return hasDryRunSupportImpl(chain);
16940
17027
  };
16941
17028
  var hasXcmPaymentApiSupportImpl = function hasXcmPaymentApiSupportImpl(chain, ctx) {
16942
- // These chains have XcmPaymentApi but it's not working
16943
- var DISABLED_CHAINS = ['Basilisk', 'Jamton'];
16944
- return getAssetsObjectImpl(chain, ctx).supportsXcmPaymentApi && !DISABLED_CHAINS.some(function (disabled) {
16945
- return disabled === chain;
16946
- });
17029
+ return getAssetsObjectImpl(chain, ctx).supportsXcmPaymentApi;
16947
17030
  };
16948
17031
  var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
16949
17032
  return hasXcmPaymentApiSupportImpl(chain);
16950
17033
  };
16951
17034
 
17035
+ var ADDITIONAL_SUBSTRATE_BRIDGE_ASSET_LOCATIONS = [{
17036
+ parents: 2,
17037
+ interior: {
17038
+ X2: [{
17039
+ GlobalConsensus: {
17040
+ Ethereum: {
17041
+ chainId: 1
17042
+ }
17043
+ }
17044
+ }, {
17045
+ AccountKey20: {
17046
+ network: null,
17047
+ key: '0x0e186357c323c806c1efdad36d217f7a54b63d18'
17048
+ }
17049
+ }]
17050
+ }
17051
+ }];
17052
+ var isAdditionalSubstrateBridgeAsset = function isAdditionalSubstrateBridgeAsset(asset) {
17053
+ return ADDITIONAL_SUBSTRATE_BRIDGE_ASSET_LOCATIONS.some(function (location) {
17054
+ return deepEqual(asset.location, location);
17055
+ });
17056
+ };
17057
+
16952
17058
  var isAssetEqual = function isAssetEqual(asset1, asset2) {
16953
17059
  var loc1 = asset1.location;
16954
17060
  var loc2 = asset2.location;
@@ -16956,6 +17062,11 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
16956
17062
  };
16957
17063
 
16958
17064
  var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination, ctx) {
17065
+ var isSubBridge = isSubstrateBridge(origin, destination);
17066
+ var isSb = isSnowbridge(origin, destination);
17067
+ if (isSb && !ETHEREUM_BRIDGE_ORIGINS.some(function (chain) {
17068
+ return chain === origin;
17069
+ })) return [];
16959
17070
  var originAssets = getAssetsImpl(origin, ctx);
16960
17071
  var destinationAssets = getAssetsImpl(destination, ctx);
16961
17072
  var supportedAssets = originAssets.filter(function (asset) {
@@ -16963,8 +17074,6 @@ var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination
16963
17074
  return isAssetEqual(a, asset);
16964
17075
  });
16965
17076
  });
16966
- var isSubBridge = isSubstrateBridge(origin, destination);
16967
- var isSb = isSnowbridge(origin, destination);
16968
17077
  if (isSubBridge || isSb) {
16969
17078
  var systemAssets = originAssets.filter(function (asset) {
16970
17079
  return isSystemAsset(asset);
@@ -16978,7 +17087,8 @@ var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination
16978
17087
  return nativeSymbols.includes(symbol);
16979
17088
  });
16980
17089
  var stablecoinAssets = findStablecoinAssets(origin);
16981
- return [].concat(_toConsumableArray(filteredSystemAssets), _toConsumableArray(stablecoinAssets));
17090
+ var additionalBridgeAssets = supportedAssets.filter(isAdditionalSubstrateBridgeAsset);
17091
+ return [].concat(_toConsumableArray(filteredSystemAssets), _toConsumableArray(stablecoinAssets), _toConsumableArray(additionalBridgeAssets));
16982
17092
  } else {
16983
17093
  // MYTH has two valid locations (native on Mythos, ERC-20 on Ethereum),
16984
17094
  // so it isn't matched by isAssetEqual. Include it explicitly.
@@ -17043,7 +17153,7 @@ var getSupportedDestinations = function getSupportedDestinations(origin, currenc
17043
17153
  }
17044
17154
  if (isUnsupportedAssetHubNative(origin, destination, originAsset, nativeAssets)) return false;
17045
17155
  if (isSubstrateBridge(origin, destination)) {
17046
- return isSystemAsset(originAsset) || isStableCoinAsset(originAsset);
17156
+ return isSystemAsset(originAsset) || isStableCoinAsset(originAsset) || isAdditionalSubstrateBridgeAsset(originAsset);
17047
17157
  }
17048
17158
  try {
17049
17159
  return !!findAssetInfoOnDest(origin, destination, currency, originAsset);
@@ -17074,4 +17184,4 @@ var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
17074
17184
  return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
17075
17185
  };
17076
17186
 
17077
- export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, 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, isAssetEqual, isBridgedSystemAsset, isChainEvm, isChainEvmImpl, isCustomAsset, isStableCoinAsset, isSymbolMatch, isSymbolSpecifier, isSystemAsset, isTAsset, normalizeCustomAssets, normalizeLocation, normalizeSymbol };
17187
+ export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/assets",
3
- "version": "14.1.1",
3
+ "version": "14.2.0",
4
4
  "description": "Assets for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@paraspell/sdk-common": "14.1.1"
25
+ "@paraspell/sdk-common": "14.2.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@babel/plugin-syntax-import-attributes": "^7.29.7",