@paraspell/assets 12.0.4 → 12.0.6
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 +1 -1
- package/dist/index.mjs +97 -12
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -215,7 +215,7 @@ declare const normalizeSymbol: (symbol?: string) => string;
|
|
|
215
215
|
|
|
216
216
|
declare const findAssetInfo: (chain: TChain, currency: TCurrencyInput, destination: TChain | null) => TAssetInfo | null;
|
|
217
217
|
|
|
218
|
-
declare const findAssetInfoById: (assets: TAssetInfo[], assetId: TCurrency) => TAssetInfo
|
|
218
|
+
declare const findAssetInfoById: (assets: TAssetInfo[], assetId: TCurrency) => TAssetInfo;
|
|
219
219
|
|
|
220
220
|
declare const findAssetInfoByLoc: (foreignAssets: TAssetInfo[], location: string | TLocation) => TAssetInfo | undefined;
|
|
221
221
|
|
package/dist/index.mjs
CHANGED
|
@@ -2895,7 +2895,6 @@ var EnergyWebX = {
|
|
|
2895
2895
|
{
|
|
2896
2896
|
symbol: "USDC",
|
|
2897
2897
|
decimals: 6,
|
|
2898
|
-
assetId: "1337",
|
|
2899
2898
|
existentialDeposit: "10000",
|
|
2900
2899
|
location: {
|
|
2901
2900
|
parents: 1,
|
|
@@ -2913,6 +2912,27 @@ var EnergyWebX = {
|
|
|
2913
2912
|
]
|
|
2914
2913
|
}
|
|
2915
2914
|
}
|
|
2915
|
+
},
|
|
2916
|
+
{
|
|
2917
|
+
symbol: "stEWT",
|
|
2918
|
+
decimals: 18,
|
|
2919
|
+
existentialDeposit: "1",
|
|
2920
|
+
location: {
|
|
2921
|
+
parents: 1,
|
|
2922
|
+
interior: {
|
|
2923
|
+
X3: [
|
|
2924
|
+
{
|
|
2925
|
+
Parachain: 3345
|
|
2926
|
+
},
|
|
2927
|
+
{
|
|
2928
|
+
PalletInstance: 60
|
|
2929
|
+
},
|
|
2930
|
+
{
|
|
2931
|
+
GeneralIndex: 1
|
|
2932
|
+
}
|
|
2933
|
+
]
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2916
2936
|
}
|
|
2917
2937
|
]
|
|
2918
2938
|
};
|
|
@@ -2929,6 +2949,7 @@ var Hydration = {
|
|
|
2929
2949
|
isNative: true,
|
|
2930
2950
|
decimals: 12,
|
|
2931
2951
|
existentialDeposit: "1000000000000",
|
|
2952
|
+
assetId: "0",
|
|
2932
2953
|
location: {
|
|
2933
2954
|
parents: 1,
|
|
2934
2955
|
interior: {
|
|
@@ -2996,7 +3017,7 @@ var Hydration = {
|
|
|
2996
3017
|
assetId: "222",
|
|
2997
3018
|
symbol: "HOLLAR",
|
|
2998
3019
|
decimals: 18,
|
|
2999
|
-
existentialDeposit: "
|
|
3020
|
+
existentialDeposit: "20000000000000000",
|
|
3000
3021
|
location: {
|
|
3001
3022
|
parents: 1,
|
|
3002
3023
|
interior: {
|
|
@@ -18065,6 +18086,48 @@ var EnergyWebXPaseo = {
|
|
|
18065
18086
|
]
|
|
18066
18087
|
}
|
|
18067
18088
|
}
|
|
18089
|
+
},
|
|
18090
|
+
{
|
|
18091
|
+
symbol: "USDC",
|
|
18092
|
+
decimals: 6,
|
|
18093
|
+
existentialDeposit: "10000",
|
|
18094
|
+
location: {
|
|
18095
|
+
parents: 1,
|
|
18096
|
+
interior: {
|
|
18097
|
+
X3: [
|
|
18098
|
+
{
|
|
18099
|
+
Parachain: 1000
|
|
18100
|
+
},
|
|
18101
|
+
{
|
|
18102
|
+
PalletInstance: 50
|
|
18103
|
+
},
|
|
18104
|
+
{
|
|
18105
|
+
GeneralIndex: 1337
|
|
18106
|
+
}
|
|
18107
|
+
]
|
|
18108
|
+
}
|
|
18109
|
+
}
|
|
18110
|
+
},
|
|
18111
|
+
{
|
|
18112
|
+
symbol: "stEWT",
|
|
18113
|
+
decimals: 18,
|
|
18114
|
+
existentialDeposit: "1",
|
|
18115
|
+
location: {
|
|
18116
|
+
parents: 1,
|
|
18117
|
+
interior: {
|
|
18118
|
+
X3: [
|
|
18119
|
+
{
|
|
18120
|
+
Parachain: 3345
|
|
18121
|
+
},
|
|
18122
|
+
{
|
|
18123
|
+
PalletInstance: 60
|
|
18124
|
+
},
|
|
18125
|
+
{
|
|
18126
|
+
GeneralIndex: 1
|
|
18127
|
+
}
|
|
18128
|
+
]
|
|
18129
|
+
}
|
|
18130
|
+
}
|
|
18068
18131
|
}
|
|
18069
18132
|
]
|
|
18070
18133
|
};
|
|
@@ -20374,6 +20437,14 @@ var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
|
|
|
20374
20437
|
return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
|
|
20375
20438
|
};
|
|
20376
20439
|
|
|
20440
|
+
function _arrayLikeToArray(r, a) {
|
|
20441
|
+
(null == a || a > r.length) && (a = r.length);
|
|
20442
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
20443
|
+
return n;
|
|
20444
|
+
}
|
|
20445
|
+
function _arrayWithoutHoles(r) {
|
|
20446
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
20447
|
+
}
|
|
20377
20448
|
function _assertThisInitialized(e) {
|
|
20378
20449
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
20379
20450
|
return e;
|
|
@@ -20428,6 +20499,12 @@ function _isNativeReflectConstruct() {
|
|
|
20428
20499
|
return !!t;
|
|
20429
20500
|
})();
|
|
20430
20501
|
}
|
|
20502
|
+
function _iterableToArray(r) {
|
|
20503
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
20504
|
+
}
|
|
20505
|
+
function _nonIterableSpread() {
|
|
20506
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
20507
|
+
}
|
|
20431
20508
|
function _objectWithoutProperties(e, t) {
|
|
20432
20509
|
if (null == e) return {};
|
|
20433
20510
|
var o,
|
|
@@ -20458,6 +20535,9 @@ function _setPrototypeOf(t, e) {
|
|
|
20458
20535
|
return t.__proto__ = e, t;
|
|
20459
20536
|
}, _setPrototypeOf(t, e);
|
|
20460
20537
|
}
|
|
20538
|
+
function _toConsumableArray(r) {
|
|
20539
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
20540
|
+
}
|
|
20461
20541
|
function _typeof(o) {
|
|
20462
20542
|
"@babel/helpers - typeof";
|
|
20463
20543
|
|
|
@@ -20467,6 +20547,13 @@ function _typeof(o) {
|
|
|
20467
20547
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
20468
20548
|
}, _typeof(o);
|
|
20469
20549
|
}
|
|
20550
|
+
function _unsupportedIterableToArray(r, a) {
|
|
20551
|
+
if (r) {
|
|
20552
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
20553
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
20554
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
20555
|
+
}
|
|
20556
|
+
}
|
|
20470
20557
|
function _wrapNativeSuper(t) {
|
|
20471
20558
|
var r = "function" == typeof Map ? new Map() : void 0;
|
|
20472
20559
|
return _wrapNativeSuper = function (t) {
|
|
@@ -20563,17 +20650,14 @@ var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
|
|
|
20563
20650
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
20564
20651
|
|
|
20565
20652
|
var findAssetInfoById = function findAssetInfoById(assets, assetId) {
|
|
20566
|
-
var
|
|
20567
|
-
|
|
20568
|
-
return
|
|
20653
|
+
var id = assetId.toString();
|
|
20654
|
+
var matches = assets.filter(function (a) {
|
|
20655
|
+
return a.assetId === id;
|
|
20569
20656
|
});
|
|
20570
|
-
if (
|
|
20571
|
-
throw new DuplicateAssetIdError(
|
|
20657
|
+
if (matches.length > 1) {
|
|
20658
|
+
throw new DuplicateAssetIdError(id);
|
|
20572
20659
|
}
|
|
20573
|
-
return
|
|
20574
|
-
var currentAssetId = _ref2.assetId;
|
|
20575
|
-
return currentAssetId === assetId.toString();
|
|
20576
|
-
});
|
|
20660
|
+
return matches[0];
|
|
20577
20661
|
};
|
|
20578
20662
|
|
|
20579
20663
|
var sanitizeLocation = function sanitizeLocation(location) {
|
|
@@ -20840,6 +20924,7 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
|
|
|
20840
20924
|
}
|
|
20841
20925
|
var otherAssets = getOtherAssets(chain);
|
|
20842
20926
|
var nativeAssets = getNativeAssets(chain);
|
|
20927
|
+
var assets = [].concat(_toConsumableArray(nativeAssets), _toConsumableArray(otherAssets));
|
|
20843
20928
|
var asset;
|
|
20844
20929
|
if ('symbol' in currency) {
|
|
20845
20930
|
asset = findAssetInfoBySymbol(destination, otherAssets, nativeAssets, currency.symbol);
|
|
@@ -20847,7 +20932,7 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
|
|
|
20847
20932
|
var _findAssetInfoByLoc;
|
|
20848
20933
|
asset = (_findAssetInfoByLoc = findAssetInfoByLoc(otherAssets, currency.location)) !== null && _findAssetInfoByLoc !== void 0 ? _findAssetInfoByLoc : findAssetInfoByLoc(nativeAssets, currency.location);
|
|
20849
20934
|
} else if ('id' in currency) {
|
|
20850
|
-
asset = findAssetInfoById(
|
|
20935
|
+
asset = findAssetInfoById(assets, currency.id);
|
|
20851
20936
|
}
|
|
20852
20937
|
return asset !== null && asset !== void 0 ? asset : null;
|
|
20853
20938
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/assets",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.6",
|
|
4
4
|
"description": "Assets for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@paraspell/sdk-common": "12.0.
|
|
26
|
+
"@paraspell/sdk-common": "12.0.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|