@paraspell/assets 14.1.1 → 14.2.1
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 +5 -1
- package/dist/index.mjs +205 -107
- package/package.json +2 -2
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;
|
|
@@ -238,6 +240,8 @@ declare const findNativeAssetInfo: (chain: TChain) => TAssetInfo | null;
|
|
|
238
240
|
declare const findNativeAssetInfoOrThrowImpl: <TCustomChain extends string = never>(chain: TChain | TCustomChain, ctx?: TCustomCtx) => TAssetInfo;
|
|
239
241
|
declare const findNativeAssetInfoOrThrow: (chain: TChain) => TAssetInfo;
|
|
240
242
|
|
|
243
|
+
declare const STABLECOIN_IDS: number[];
|
|
244
|
+
|
|
241
245
|
/**
|
|
242
246
|
* Error thrown when a custom asset's location collides with an existing
|
|
243
247
|
* registry asset and `forceOverride` was not set.
|
|
@@ -292,5 +296,5 @@ declare const extractAssetLocation: <T = bigint>(asset: TAsset<T>) => TLocation;
|
|
|
292
296
|
|
|
293
297
|
declare const getAssetLocation: (chain: TChain, currency: TCurrencyInput) => TLocation | null;
|
|
294
298
|
|
|
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 };
|
|
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 };
|
|
296
300
|
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
|
|
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);
|
|
@@ -1739,21 +1739,14 @@ var BifrostPolkadot = {
|
|
|
1739
1739
|
location: {
|
|
1740
1740
|
parents: 1,
|
|
1741
1741
|
interior: {
|
|
1742
|
-
|
|
1742
|
+
X1: [
|
|
1743
1743
|
{
|
|
1744
1744
|
Parachain: 2030
|
|
1745
|
-
},
|
|
1746
|
-
{
|
|
1747
|
-
GeneralKey: {
|
|
1748
|
-
length: 2,
|
|
1749
|
-
data: "0x0001000000000000000000000000000000000000000000000000000000000000"
|
|
1750
|
-
}
|
|
1751
1745
|
}
|
|
1752
1746
|
]
|
|
1753
1747
|
}
|
|
1754
1748
|
},
|
|
1755
|
-
isNative: true
|
|
1756
|
-
isFeeAsset: true
|
|
1749
|
+
isNative: true
|
|
1757
1750
|
},
|
|
1758
1751
|
{
|
|
1759
1752
|
assetId: "6",
|
|
@@ -5702,28 +5695,6 @@ var AssetHubPolkadot = {
|
|
|
5702
5695
|
existentialDeposit: "1000000000000",
|
|
5703
5696
|
alias: "dot2"
|
|
5704
5697
|
},
|
|
5705
|
-
{
|
|
5706
|
-
assetId: "22222078",
|
|
5707
|
-
symbol: "JAMTON",
|
|
5708
|
-
decimals: 12,
|
|
5709
|
-
location: {
|
|
5710
|
-
parents: 1,
|
|
5711
|
-
interior: {
|
|
5712
|
-
X3: [
|
|
5713
|
-
{
|
|
5714
|
-
Parachain: 1000
|
|
5715
|
-
},
|
|
5716
|
-
{
|
|
5717
|
-
PalletInstance: 50
|
|
5718
|
-
},
|
|
5719
|
-
{
|
|
5720
|
-
GeneralIndex: 22222078
|
|
5721
|
-
}
|
|
5722
|
-
]
|
|
5723
|
-
}
|
|
5724
|
-
},
|
|
5725
|
-
existentialDeposit: "1000000000000"
|
|
5726
|
-
},
|
|
5727
5698
|
{
|
|
5728
5699
|
assetId: "50000069",
|
|
5729
5700
|
symbol: "LOTY",
|
|
@@ -7648,21 +7619,14 @@ var BifrostKusama = {
|
|
|
7648
7619
|
location: {
|
|
7649
7620
|
parents: 1,
|
|
7650
7621
|
interior: {
|
|
7651
|
-
|
|
7622
|
+
X1: [
|
|
7652
7623
|
{
|
|
7653
7624
|
Parachain: 2001
|
|
7654
|
-
},
|
|
7655
|
-
{
|
|
7656
|
-
GeneralKey: {
|
|
7657
|
-
length: 2,
|
|
7658
|
-
data: "0x0001000000000000000000000000000000000000000000000000000000000000"
|
|
7659
|
-
}
|
|
7660
7625
|
}
|
|
7661
7626
|
]
|
|
7662
7627
|
}
|
|
7663
7628
|
},
|
|
7664
|
-
isNative: true
|
|
7665
|
-
isFeeAsset: true
|
|
7629
|
+
isNative: true
|
|
7666
7630
|
},
|
|
7667
7631
|
{
|
|
7668
7632
|
symbol: "KSM",
|
|
@@ -8783,55 +8747,6 @@ var Jamton = {
|
|
|
8783
8747
|
},
|
|
8784
8748
|
isNative: true
|
|
8785
8749
|
},
|
|
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
8750
|
{
|
|
8836
8751
|
assetId: "0",
|
|
8837
8752
|
symbol: "DOT",
|
|
@@ -8892,7 +8807,8 @@ var Jamton = {
|
|
|
8892
8807
|
}
|
|
8893
8808
|
]
|
|
8894
8809
|
}
|
|
8895
|
-
}
|
|
8810
|
+
},
|
|
8811
|
+
isFeeAsset: true
|
|
8896
8812
|
},
|
|
8897
8813
|
{
|
|
8898
8814
|
assetId: "1",
|
|
@@ -9614,6 +9530,29 @@ var AssetHubKusama = {
|
|
|
9614
9530
|
},
|
|
9615
9531
|
existentialDeposit: "1000000"
|
|
9616
9532
|
},
|
|
9533
|
+
{
|
|
9534
|
+
assetId: "50000013",
|
|
9535
|
+
symbol: "KSM",
|
|
9536
|
+
decimals: 12,
|
|
9537
|
+
location: {
|
|
9538
|
+
parents: 1,
|
|
9539
|
+
interior: {
|
|
9540
|
+
X3: [
|
|
9541
|
+
{
|
|
9542
|
+
Parachain: 1000
|
|
9543
|
+
},
|
|
9544
|
+
{
|
|
9545
|
+
PalletInstance: 50
|
|
9546
|
+
},
|
|
9547
|
+
{
|
|
9548
|
+
GeneralIndex: 50000013
|
|
9549
|
+
}
|
|
9550
|
+
]
|
|
9551
|
+
}
|
|
9552
|
+
},
|
|
9553
|
+
existentialDeposit: "1",
|
|
9554
|
+
alias: "KSM4"
|
|
9555
|
+
},
|
|
9617
9556
|
{
|
|
9618
9557
|
assetId: "18",
|
|
9619
9558
|
symbol: "HEI",
|
|
@@ -16175,6 +16114,145 @@ var NeuroWebPaseo = {
|
|
|
16175
16114
|
}
|
|
16176
16115
|
]
|
|
16177
16116
|
};
|
|
16117
|
+
var Curio = {
|
|
16118
|
+
relaychainSymbol: "KSM",
|
|
16119
|
+
nativeAssetSymbol: "CGT",
|
|
16120
|
+
isEVM: false,
|
|
16121
|
+
ss58Prefix: 777,
|
|
16122
|
+
supportsDryRunApi: true,
|
|
16123
|
+
supportsXcmPaymentApi: true,
|
|
16124
|
+
assets: [
|
|
16125
|
+
{
|
|
16126
|
+
symbol: "CGT",
|
|
16127
|
+
decimals: 18,
|
|
16128
|
+
existentialDeposit: "10000000000000000",
|
|
16129
|
+
location: {
|
|
16130
|
+
parents: 2,
|
|
16131
|
+
interior: {
|
|
16132
|
+
X2: [
|
|
16133
|
+
{
|
|
16134
|
+
GlobalConsensus: {
|
|
16135
|
+
Ethereum: {
|
|
16136
|
+
chainId: 1
|
|
16137
|
+
}
|
|
16138
|
+
}
|
|
16139
|
+
},
|
|
16140
|
+
{
|
|
16141
|
+
AccountKey20: {
|
|
16142
|
+
network: null,
|
|
16143
|
+
key: "0x0e186357c323c806c1efdad36d217f7a54b63d18"
|
|
16144
|
+
}
|
|
16145
|
+
}
|
|
16146
|
+
]
|
|
16147
|
+
}
|
|
16148
|
+
},
|
|
16149
|
+
isNative: true,
|
|
16150
|
+
isFeeAsset: true
|
|
16151
|
+
},
|
|
16152
|
+
{
|
|
16153
|
+
symbol: "KSM",
|
|
16154
|
+
decimals: 12,
|
|
16155
|
+
existentialDeposit: "333333333",
|
|
16156
|
+
location: {
|
|
16157
|
+
parents: 1,
|
|
16158
|
+
interior: {
|
|
16159
|
+
Here: null
|
|
16160
|
+
}
|
|
16161
|
+
},
|
|
16162
|
+
isNative: true,
|
|
16163
|
+
isFeeAsset: true
|
|
16164
|
+
},
|
|
16165
|
+
{
|
|
16166
|
+
assetId: "0",
|
|
16167
|
+
symbol: "BSX",
|
|
16168
|
+
decimals: 12,
|
|
16169
|
+
existentialDeposit: "1000000000000",
|
|
16170
|
+
location: {
|
|
16171
|
+
parents: 1,
|
|
16172
|
+
interior: {
|
|
16173
|
+
X2: [
|
|
16174
|
+
{
|
|
16175
|
+
Parachain: 2090
|
|
16176
|
+
},
|
|
16177
|
+
{
|
|
16178
|
+
GeneralIndex: 0
|
|
16179
|
+
}
|
|
16180
|
+
]
|
|
16181
|
+
}
|
|
16182
|
+
},
|
|
16183
|
+
isFeeAsset: true
|
|
16184
|
+
},
|
|
16185
|
+
{
|
|
16186
|
+
assetId: "2",
|
|
16187
|
+
symbol: "VAL",
|
|
16188
|
+
decimals: 18,
|
|
16189
|
+
existentialDeposit: "1000000000000000",
|
|
16190
|
+
location: {
|
|
16191
|
+
parents: 1,
|
|
16192
|
+
interior: {
|
|
16193
|
+
X2: [
|
|
16194
|
+
{
|
|
16195
|
+
Parachain: 2011
|
|
16196
|
+
},
|
|
16197
|
+
{
|
|
16198
|
+
GeneralKey: {
|
|
16199
|
+
length: 32,
|
|
16200
|
+
data: "0x0200040000000000000000000000000000000000000000000000000000000000"
|
|
16201
|
+
}
|
|
16202
|
+
}
|
|
16203
|
+
]
|
|
16204
|
+
}
|
|
16205
|
+
},
|
|
16206
|
+
isFeeAsset: true
|
|
16207
|
+
},
|
|
16208
|
+
{
|
|
16209
|
+
assetId: "3",
|
|
16210
|
+
symbol: "PSWAP",
|
|
16211
|
+
decimals: 18,
|
|
16212
|
+
existentialDeposit: "1000000000000000000",
|
|
16213
|
+
location: {
|
|
16214
|
+
parents: 1,
|
|
16215
|
+
interior: {
|
|
16216
|
+
X2: [
|
|
16217
|
+
{
|
|
16218
|
+
Parachain: 2011
|
|
16219
|
+
},
|
|
16220
|
+
{
|
|
16221
|
+
GeneralKey: {
|
|
16222
|
+
length: 32,
|
|
16223
|
+
data: "0x0200050000000000000000000000000000000000000000000000000000000000"
|
|
16224
|
+
}
|
|
16225
|
+
}
|
|
16226
|
+
]
|
|
16227
|
+
}
|
|
16228
|
+
},
|
|
16229
|
+
isFeeAsset: true
|
|
16230
|
+
},
|
|
16231
|
+
{
|
|
16232
|
+
assetId: "1",
|
|
16233
|
+
symbol: "XOR",
|
|
16234
|
+
decimals: 18,
|
|
16235
|
+
existentialDeposit: "1000000000000000",
|
|
16236
|
+
location: {
|
|
16237
|
+
parents: 1,
|
|
16238
|
+
interior: {
|
|
16239
|
+
X2: [
|
|
16240
|
+
{
|
|
16241
|
+
Parachain: 2011
|
|
16242
|
+
},
|
|
16243
|
+
{
|
|
16244
|
+
GeneralKey: {
|
|
16245
|
+
length: 32,
|
|
16246
|
+
data: "0x0200000000000000000000000000000000000000000000000000000000000000"
|
|
16247
|
+
}
|
|
16248
|
+
}
|
|
16249
|
+
]
|
|
16250
|
+
}
|
|
16251
|
+
},
|
|
16252
|
+
isFeeAsset: true
|
|
16253
|
+
}
|
|
16254
|
+
]
|
|
16255
|
+
};
|
|
16178
16256
|
var assetsMapJson = {
|
|
16179
16257
|
Polkadot: Polkadot,
|
|
16180
16258
|
Kusama: Kusama,
|
|
@@ -16227,7 +16305,8 @@ var assetsMapJson = {
|
|
|
16227
16305
|
HeimaPaseo: HeimaPaseo,
|
|
16228
16306
|
EnergyWebXPaseo: EnergyWebXPaseo,
|
|
16229
16307
|
HydrationPaseo: HydrationPaseo,
|
|
16230
|
-
NeuroWebPaseo: NeuroWebPaseo
|
|
16308
|
+
NeuroWebPaseo: NeuroWebPaseo,
|
|
16309
|
+
Curio: Curio
|
|
16231
16310
|
};
|
|
16232
16311
|
|
|
16233
16312
|
/**
|
|
@@ -16929,26 +17008,41 @@ var getNativeAssetSymbol = function getNativeAssetSymbol(chain) {
|
|
|
16929
17008
|
return getNativeAssetSymbolImpl(chain);
|
|
16930
17009
|
};
|
|
16931
17010
|
var hasDryRunSupportImpl = function hasDryRunSupportImpl(chain, ctx) {
|
|
16932
|
-
|
|
16933
|
-
var DISABLED_CHAINS = ['Jamton'];
|
|
16934
|
-
return getAssetsObjectImpl(chain, ctx).supportsDryRunApi && !DISABLED_CHAINS.some(function (disabled) {
|
|
16935
|
-
return disabled === chain;
|
|
16936
|
-
});
|
|
17011
|
+
return getAssetsObjectImpl(chain, ctx).supportsDryRunApi;
|
|
16937
17012
|
};
|
|
16938
17013
|
var hasDryRunSupport = function hasDryRunSupport(chain) {
|
|
16939
17014
|
return hasDryRunSupportImpl(chain);
|
|
16940
17015
|
};
|
|
16941
17016
|
var hasXcmPaymentApiSupportImpl = function hasXcmPaymentApiSupportImpl(chain, ctx) {
|
|
16942
|
-
|
|
16943
|
-
var DISABLED_CHAINS = ['Basilisk', 'Jamton'];
|
|
16944
|
-
return getAssetsObjectImpl(chain, ctx).supportsXcmPaymentApi && !DISABLED_CHAINS.some(function (disabled) {
|
|
16945
|
-
return disabled === chain;
|
|
16946
|
-
});
|
|
17017
|
+
return getAssetsObjectImpl(chain, ctx).supportsXcmPaymentApi;
|
|
16947
17018
|
};
|
|
16948
17019
|
var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
|
|
16949
17020
|
return hasXcmPaymentApiSupportImpl(chain);
|
|
16950
17021
|
};
|
|
16951
17022
|
|
|
17023
|
+
var ADDITIONAL_SUBSTRATE_BRIDGE_ASSET_LOCATIONS = [{
|
|
17024
|
+
parents: 2,
|
|
17025
|
+
interior: {
|
|
17026
|
+
X2: [{
|
|
17027
|
+
GlobalConsensus: {
|
|
17028
|
+
Ethereum: {
|
|
17029
|
+
chainId: 1
|
|
17030
|
+
}
|
|
17031
|
+
}
|
|
17032
|
+
}, {
|
|
17033
|
+
AccountKey20: {
|
|
17034
|
+
network: null,
|
|
17035
|
+
key: '0x0e186357c323c806c1efdad36d217f7a54b63d18'
|
|
17036
|
+
}
|
|
17037
|
+
}]
|
|
17038
|
+
}
|
|
17039
|
+
}];
|
|
17040
|
+
var isAdditionalSubstrateBridgeAsset = function isAdditionalSubstrateBridgeAsset(asset) {
|
|
17041
|
+
return ADDITIONAL_SUBSTRATE_BRIDGE_ASSET_LOCATIONS.some(function (location) {
|
|
17042
|
+
return deepEqual(asset.location, location);
|
|
17043
|
+
});
|
|
17044
|
+
};
|
|
17045
|
+
|
|
16952
17046
|
var isAssetEqual = function isAssetEqual(asset1, asset2) {
|
|
16953
17047
|
var loc1 = asset1.location;
|
|
16954
17048
|
var loc2 = asset2.location;
|
|
@@ -16956,6 +17050,11 @@ var isAssetEqual = function isAssetEqual(asset1, asset2) {
|
|
|
16956
17050
|
};
|
|
16957
17051
|
|
|
16958
17052
|
var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination, ctx) {
|
|
17053
|
+
var isSubBridge = isSubstrateBridge(origin, destination);
|
|
17054
|
+
var isSb = isSnowbridge(origin, destination);
|
|
17055
|
+
if (isSb && !ETHEREUM_BRIDGE_ORIGINS.some(function (chain) {
|
|
17056
|
+
return chain === origin;
|
|
17057
|
+
})) return [];
|
|
16959
17058
|
var originAssets = getAssetsImpl(origin, ctx);
|
|
16960
17059
|
var destinationAssets = getAssetsImpl(destination, ctx);
|
|
16961
17060
|
var supportedAssets = originAssets.filter(function (asset) {
|
|
@@ -16963,8 +17062,6 @@ var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination
|
|
|
16963
17062
|
return isAssetEqual(a, asset);
|
|
16964
17063
|
});
|
|
16965
17064
|
});
|
|
16966
|
-
var isSubBridge = isSubstrateBridge(origin, destination);
|
|
16967
|
-
var isSb = isSnowbridge(origin, destination);
|
|
16968
17065
|
if (isSubBridge || isSb) {
|
|
16969
17066
|
var systemAssets = originAssets.filter(function (asset) {
|
|
16970
17067
|
return isSystemAsset(asset);
|
|
@@ -16978,7 +17075,8 @@ var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination
|
|
|
16978
17075
|
return nativeSymbols.includes(symbol);
|
|
16979
17076
|
});
|
|
16980
17077
|
var stablecoinAssets = findStablecoinAssets(origin);
|
|
16981
|
-
|
|
17078
|
+
var additionalBridgeAssets = supportedAssets.filter(isAdditionalSubstrateBridgeAsset);
|
|
17079
|
+
return [].concat(_toConsumableArray(filteredSystemAssets), _toConsumableArray(stablecoinAssets), _toConsumableArray(additionalBridgeAssets));
|
|
16982
17080
|
} else {
|
|
16983
17081
|
// MYTH has two valid locations (native on Mythos, ERC-20 on Ethereum),
|
|
16984
17082
|
// so it isn't matched by isAssetEqual. Include it explicitly.
|
|
@@ -17043,7 +17141,7 @@ var getSupportedDestinations = function getSupportedDestinations(origin, currenc
|
|
|
17043
17141
|
}
|
|
17044
17142
|
if (isUnsupportedAssetHubNative(origin, destination, originAsset, nativeAssets)) return false;
|
|
17045
17143
|
if (isSubstrateBridge(origin, destination)) {
|
|
17046
|
-
return isSystemAsset(originAsset) || isStableCoinAsset(originAsset);
|
|
17144
|
+
return isSystemAsset(originAsset) || isStableCoinAsset(originAsset) || isAdditionalSubstrateBridgeAsset(originAsset);
|
|
17047
17145
|
}
|
|
17048
17146
|
try {
|
|
17049
17147
|
return !!findAssetInfoOnDest(origin, destination, currency, originAsset);
|
|
@@ -17074,4 +17172,4 @@ var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
|
17074
17172
|
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
17075
17173
|
};
|
|
17076
17174
|
|
|
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 };
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/assets",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.1",
|
|
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.
|
|
25
|
+
"@paraspell/sdk-common": "14.2.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/plugin-syntax-import-attributes": "^7.29.7",
|