@paraspell/assets 10.10.10 → 10.11.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
@@ -19,6 +19,9 @@ type TForeignAsset = TBaseAsset & AtLeastOne<{
19
19
  assetId?: string;
20
20
  multiLocation?: TMultiLocation;
21
21
  }>;
22
+ type TForeignAssetWithId = TForeignAsset & {
23
+ assetId: string;
24
+ };
22
25
  type TAsset = TNativeAsset | TForeignAsset;
23
26
  type TAssetWithLocation = TAsset & {
24
27
  multiLocation: TMultiLocation;
@@ -35,19 +38,19 @@ type TNodeAssets = {
35
38
  };
36
39
  type TAssetJsonMap = Record<TNodeWithRelayChains, TNodeAssets>;
37
40
 
38
- type TMultiAsset = TMultiAssetV3 | TMultiAssetV4;
39
- interface TMultiAssetV3 {
41
+ type TMultiAsset<T = bigint> = TMultiAssetV3<T> | TMultiAssetV4<T>;
42
+ interface TMultiAssetV3<T = bigint> {
40
43
  id: {
41
44
  Concrete: TMultiLocation;
42
45
  };
43
46
  fun: {
44
- Fungible: TAmount;
47
+ Fungible: T;
45
48
  };
46
49
  }
47
- interface TMultiAssetV4 {
50
+ interface TMultiAssetV4<T = bigint> {
48
51
  id: TMultiLocation;
49
52
  fun: {
50
- Fungible: TAmount;
53
+ Fungible: T;
51
54
  };
52
55
  }
53
56
 
@@ -75,23 +78,24 @@ type TMultiAssetWithFee = TMultiAsset & {
75
78
  };
76
79
  type TMultiLocationValue = string | TMultiLocation;
77
80
  type TMultiLocationValueWithOverride = TMultiLocationValue | TOverrideMultiLocationSpecifier;
78
- type TCurrencyInputWithAmount = WithAmount<TCurrencySymbol | {
81
+ type TCurrencyInputWithAmount = WithComplexAmount<TCurrencySymbol | {
79
82
  id: TCurrency;
80
83
  } | {
81
84
  multilocation: TMultiLocationValueWithOverride;
82
85
  }> | {
83
- multiasset: TMultiAsset[] | WithAmount<TCurrencyCore>[];
86
+ multiasset: TMultiAsset<TAmount>[] | WithComplexAmount<TCurrencyCore>[];
84
87
  };
85
88
  type TCurrencyInput = TCurrencySymbol | {
86
89
  id: TCurrency;
87
90
  } | {
88
91
  multilocation: TMultiLocationValueWithOverride;
89
92
  } | {
90
- multiasset: TMultiAsset[] | WithAmount<TCurrencyCore>[];
93
+ multiasset: TMultiAsset<TAmount>[] | WithComplexAmount<TCurrencyCore>[];
91
94
  };
92
- type WithAmount<TBase> = TBase & {
93
- amount: TAmount;
95
+ type WithAmount<TBase, T = bigint> = TBase & {
96
+ amount: T;
94
97
  };
98
+ type WithComplexAmount<TBase> = WithAmount<TBase, TAmount>;
95
99
 
96
100
  /**
97
101
  * Retrieves the existential deposit value for a given node.
@@ -228,7 +232,7 @@ declare const findAssetById: (assets: TForeignAsset[], assetId: TCurrency) => TF
228
232
 
229
233
  declare const findAssetByMultiLocation: (foreignAssets: TForeignAsset[], multiLocation: string | TMultiLocation) => TForeignAsset | undefined;
230
234
 
231
- declare const findAssetBySymbol: (node: TNodeWithRelayChains, destination: TNodeWithRelayChains | null, otherAssets: TForeignAsset[], nativeAssets: TNativeAsset[], symbol: TCurrencySymbolValue) => TAsset | undefined;
235
+ declare const findAssetBySymbol: (destination: TNodeWithRelayChains | null, otherAssets: TForeignAsset[], nativeAssets: TNativeAsset[], symbol: TCurrencySymbolValue) => TAsset | undefined;
232
236
 
233
237
  declare const findAssetForNodeOrThrow: (node: TNodeWithRelayChains, currency: TCurrencyInput, destination: TNodeWithRelayChains | null) => TAsset;
234
238
 
@@ -282,13 +286,13 @@ declare const isOverrideMultiLocationSpecifier: (multiLocationSpecifier: TMultiL
282
286
 
283
287
  declare const isSymbolSpecifier: (currencySymbolValue: TCurrencySymbolValue) => currencySymbolValue is TSymbolSpecifier;
284
288
 
285
- declare const isTMultiAsset: (value: unknown) => value is TMultiAsset;
289
+ declare const isTMultiAsset: <T = bigint>(value: unknown) => value is TMultiAsset<T>;
286
290
 
287
291
  declare const compareMultiLocations: (input: string, asset: TForeignAsset) => boolean;
288
292
 
289
- declare const extractMultiAssetLoc: (multiAsset: TMultiAsset) => TMultiLocation;
293
+ declare const extractMultiAssetLoc: <T = bigint>(multiAsset: TMultiAsset<T>) => TMultiLocation;
290
294
 
291
295
  declare const getAssetMultiLocation: (node: TNodeWithRelayChains, currency: TCurrencyInput) => TMultiLocation | null;
292
296
 
293
297
  export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, compareMultiLocations, extractMultiAssetLoc, filterEthCompatibleAssets, findAsset, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findAssetForNodeOrThrow, findAssetOnDest, findAssetOnDestOrThrow, findBestMatches, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getExistentialDeposit, getExistentialDepositOrThrow, getFeeAssets, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getSupportedDestinations, hasDryRunSupport, hasSupportForAsset, hasXcmPaymentApiSupport, isAssetEqual, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isSymbolMatch, isSymbolSpecifier, isTMultiAsset, normalizeMultiLocation, normalizeSymbol };
294
- export type { TAmount, TAsset, TAssetJsonMap, TAssetWithLocation, TCurrency, TCurrencyCore, TCurrencyInput, TCurrencyInputWithAmount, TCurrencySymbol, TCurrencySymbolValue, TForeignAsset, TMultiAsset, TMultiAssetV3, TMultiAssetV4, TMultiAssetWithFee, TMultiLocationValue, TMultiLocationValueWithOverride, TNativeAsset, TNodeAssets, TOverrideMultiLocationSpecifier, TSymbolSpecifier, WithAmount };
298
+ export type { TAmount, TAsset, TAssetJsonMap, TAssetWithLocation, TCurrency, TCurrencyCore, TCurrencyInput, TCurrencyInputWithAmount, TCurrencySymbol, TCurrencySymbolValue, TForeignAsset, TForeignAssetWithId, TMultiAsset, TMultiAssetV3, TMultiAssetV4, TMultiAssetWithFee, TMultiLocationValue, TMultiLocationValueWithOverride, TNativeAsset, TNodeAssets, TOverrideMultiLocationSpecifier, TSymbolSpecifier, WithAmount, WithComplexAmount };