@paraspell/assets 13.4.1 → 13.6.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.mjs CHANGED
@@ -1,4 +1,344 @@
1
- import { Version, deepEqual, isExternalChain, getJunctionValue, hasJunction, Parents, RELAYCHAINS, replaceBigInt, isSubstrateBridge, isSnowbridge, CHAINS } from '@paraspell/sdk-common';
1
+ import { Version, deepEqual, isChain, isExternalChain, getJunctionValue, hasJunction, Parents, RELAYCHAINS, replaceBigInt, isCustomChain, isSubstrateBridge, isSnowbridge, CHAINS } from '@paraspell/sdk-common';
2
+
3
+ function _arrayLikeToArray(r, a) {
4
+ (null == a || a > r.length) && (a = r.length);
5
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
6
+ return n;
7
+ }
8
+ function _arrayWithHoles(r) {
9
+ if (Array.isArray(r)) return r;
10
+ }
11
+ function _arrayWithoutHoles(r) {
12
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
13
+ }
14
+ function _assertThisInitialized(e) {
15
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16
+ return e;
17
+ }
18
+ function _callSuper(t, o, e) {
19
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
20
+ }
21
+ function _classCallCheck(a, n) {
22
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
23
+ }
24
+ function _construct(t, e, r) {
25
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
26
+ var o = [null];
27
+ o.push.apply(o, e);
28
+ var p = new (t.bind.apply(t, o))();
29
+ return r && _setPrototypeOf(p, r.prototype), p;
30
+ }
31
+ function _createClass(e, r, t) {
32
+ return Object.defineProperty(e, "prototype", {
33
+ writable: false
34
+ }), e;
35
+ }
36
+ function _createForOfIteratorHelper(r, e) {
37
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
38
+ if (!t) {
39
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
40
+ t && (r = t);
41
+ var n = 0,
42
+ F = function () {};
43
+ return {
44
+ s: F,
45
+ n: function () {
46
+ return n >= r.length ? {
47
+ done: true
48
+ } : {
49
+ done: false,
50
+ value: r[n++]
51
+ };
52
+ },
53
+ e: function (r) {
54
+ throw r;
55
+ },
56
+ f: F
57
+ };
58
+ }
59
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
60
+ }
61
+ var o,
62
+ a = true,
63
+ u = false;
64
+ return {
65
+ s: function () {
66
+ t = t.call(r);
67
+ },
68
+ n: function () {
69
+ var r = t.next();
70
+ return a = r.done, r;
71
+ },
72
+ e: function (r) {
73
+ u = true, o = r;
74
+ },
75
+ f: function () {
76
+ try {
77
+ a || null == t.return || t.return();
78
+ } finally {
79
+ if (u) throw o;
80
+ }
81
+ }
82
+ };
83
+ }
84
+ function _defineProperty(e, r, t) {
85
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
86
+ value: t,
87
+ enumerable: true,
88
+ configurable: true,
89
+ writable: true
90
+ }) : e[r] = t, e;
91
+ }
92
+ function _getPrototypeOf(t) {
93
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
94
+ return t.__proto__ || Object.getPrototypeOf(t);
95
+ }, _getPrototypeOf(t);
96
+ }
97
+ function _inherits(t, e) {
98
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
99
+ t.prototype = Object.create(e && e.prototype, {
100
+ constructor: {
101
+ value: t,
102
+ writable: true,
103
+ configurable: true
104
+ }
105
+ }), Object.defineProperty(t, "prototype", {
106
+ writable: false
107
+ }), e && _setPrototypeOf(t, e);
108
+ }
109
+ function _isNativeFunction(t) {
110
+ try {
111
+ return -1 !== Function.toString.call(t).indexOf("[native code]");
112
+ } catch (n) {
113
+ return "function" == typeof t;
114
+ }
115
+ }
116
+ function _isNativeReflectConstruct() {
117
+ try {
118
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
119
+ } catch (t) {}
120
+ return (_isNativeReflectConstruct = function () {
121
+ return !!t;
122
+ })();
123
+ }
124
+ function _iterableToArray(r) {
125
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
126
+ }
127
+ function _iterableToArrayLimit(r, l) {
128
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
129
+ if (null != t) {
130
+ var e,
131
+ n,
132
+ i,
133
+ u,
134
+ a = [],
135
+ f = true,
136
+ o = false;
137
+ try {
138
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
139
+ } catch (r) {
140
+ o = true, n = r;
141
+ } finally {
142
+ try {
143
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
144
+ } finally {
145
+ if (o) throw n;
146
+ }
147
+ }
148
+ return a;
149
+ }
150
+ }
151
+ function _nonIterableRest() {
152
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
153
+ }
154
+ function _nonIterableSpread() {
155
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
156
+ }
157
+ function ownKeys(e, r) {
158
+ var t = Object.keys(e);
159
+ if (Object.getOwnPropertySymbols) {
160
+ var o = Object.getOwnPropertySymbols(e);
161
+ r && (o = o.filter(function (r) {
162
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
163
+ })), t.push.apply(t, o);
164
+ }
165
+ return t;
166
+ }
167
+ function _objectSpread2(e) {
168
+ for (var r = 1; r < arguments.length; r++) {
169
+ var t = null != arguments[r] ? arguments[r] : {};
170
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
171
+ _defineProperty(e, r, t[r]);
172
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
173
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
174
+ });
175
+ }
176
+ return e;
177
+ }
178
+ function _objectWithoutProperties(e, t) {
179
+ if (null == e) return {};
180
+ var o,
181
+ r,
182
+ i = _objectWithoutPropertiesLoose(e, t);
183
+ if (Object.getOwnPropertySymbols) {
184
+ var n = Object.getOwnPropertySymbols(e);
185
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
186
+ }
187
+ return i;
188
+ }
189
+ function _objectWithoutPropertiesLoose(r, e) {
190
+ if (null == r) return {};
191
+ var t = {};
192
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
193
+ if (-1 !== e.indexOf(n)) continue;
194
+ t[n] = r[n];
195
+ }
196
+ return t;
197
+ }
198
+ function _possibleConstructorReturn(t, e) {
199
+ if (e && ("object" == typeof e || "function" == typeof e)) return e;
200
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
201
+ return _assertThisInitialized(t);
202
+ }
203
+ function _setPrototypeOf(t, e) {
204
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
205
+ return t.__proto__ = e, t;
206
+ }, _setPrototypeOf(t, e);
207
+ }
208
+ function _slicedToArray(r, e) {
209
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
210
+ }
211
+ function _toConsumableArray(r) {
212
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
213
+ }
214
+ function _toPrimitive(t, r) {
215
+ if ("object" != typeof t || !t) return t;
216
+ var e = t[Symbol.toPrimitive];
217
+ if (void 0 !== e) {
218
+ var i = e.call(t, r);
219
+ if ("object" != typeof i) return i;
220
+ throw new TypeError("@@toPrimitive must return a primitive value.");
221
+ }
222
+ return ("string" === r ? String : Number)(t);
223
+ }
224
+ function _toPropertyKey(t) {
225
+ var i = _toPrimitive(t, "string");
226
+ return "symbol" == typeof i ? i : i + "";
227
+ }
228
+ function _typeof(o) {
229
+ "@babel/helpers - typeof";
230
+
231
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
232
+ return typeof o;
233
+ } : function (o) {
234
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
235
+ }, _typeof(o);
236
+ }
237
+ function _unsupportedIterableToArray(r, a) {
238
+ if (r) {
239
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
240
+ var t = {}.toString.call(r).slice(8, -1);
241
+ 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;
242
+ }
243
+ }
244
+ function _wrapNativeSuper(t) {
245
+ var r = "function" == typeof Map ? new Map() : void 0;
246
+ return _wrapNativeSuper = function (t) {
247
+ if (null === t || !_isNativeFunction(t)) return t;
248
+ if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
249
+ if (void 0 !== r) {
250
+ if (r.has(t)) return r.get(t);
251
+ r.set(t, Wrapper);
252
+ }
253
+ function Wrapper() {
254
+ return _construct(t, arguments, _getPrototypeOf(this).constructor);
255
+ }
256
+ return Wrapper.prototype = Object.create(t.prototype, {
257
+ constructor: {
258
+ value: Wrapper,
259
+ enumerable: false,
260
+ writable: true,
261
+ configurable: true
262
+ }
263
+ }), _setPrototypeOf(Wrapper, t);
264
+ }, _wrapNativeSuper(t);
265
+ }
266
+
267
+ /**
268
+ * Error thrown when a custom asset's location collides with an existing
269
+ * registry asset and `forceOverride` was not set.
270
+ */
271
+ var CustomAssetConflictError = /*#__PURE__*/function (_Error) {
272
+ function CustomAssetConflictError(msg) {
273
+ var _this;
274
+ _classCallCheck(this, CustomAssetConflictError);
275
+ _this = _callSuper(this, CustomAssetConflictError, [msg]);
276
+ _this.name = 'CustomAssetConflict';
277
+ return _this;
278
+ }
279
+ _inherits(CustomAssetConflictError, _Error);
280
+ return _createClass(CustomAssetConflictError);
281
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
282
+
283
+ /**
284
+ * Error thrown when multiple assets with the same symbol are found.
285
+ */
286
+ var DuplicateAssetError = /*#__PURE__*/function (_Error) {
287
+ /**
288
+ * Constructs a new DuplicateAssetError.
289
+ *
290
+ * @param symbol - The symbol of the asset causing the duplication error.
291
+ */
292
+ function DuplicateAssetError(msg) {
293
+ var _this;
294
+ _classCallCheck(this, DuplicateAssetError);
295
+ _this = _callSuper(this, DuplicateAssetError, [msg]);
296
+ _this.name = 'DuplicateAsset';
297
+ return _this;
298
+ }
299
+ _inherits(DuplicateAssetError, _Error);
300
+ return _createClass(DuplicateAssetError);
301
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
302
+
303
+ /**
304
+ * Error thrown when multiple assets with the same symbol are found.
305
+ */
306
+ var DuplicateAssetIdError = /*#__PURE__*/function (_Error) {
307
+ /**
308
+ * Constructs a new DuplicateAssetError.
309
+ *
310
+ * @param symbol - The symbol of the asset causing the duplication error.
311
+ */
312
+ function DuplicateAssetIdError(id) {
313
+ var _this;
314
+ _classCallCheck(this, DuplicateAssetIdError);
315
+ _this = _callSuper(this, DuplicateAssetIdError, ["Multiple assets found with the same ID: ".concat(id, ". Please specify asset directly by symbol using .currency({symbol: <ASSET_SYMBOL>})")]);
316
+ _this.name = 'DuplicateAssetId';
317
+ return _this;
318
+ }
319
+ _inherits(DuplicateAssetIdError, _Error);
320
+ return _createClass(DuplicateAssetIdError);
321
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
322
+
323
+ /**
324
+ * Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
325
+ */
326
+ var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
327
+ /**
328
+ * Constructs a new InvalidCurrencyError.
329
+ *
330
+ * @param message - The error message.
331
+ */
332
+ function InvalidCurrencyError(message) {
333
+ var _this;
334
+ _classCallCheck(this, InvalidCurrencyError);
335
+ _this = _callSuper(this, InvalidCurrencyError, [message]);
336
+ _this.name = 'InvalidCurrencyError';
337
+ return _this;
338
+ }
339
+ _inherits(InvalidCurrencyError, _Error);
340
+ return _createClass(InvalidCurrencyError);
341
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
2
342
 
3
343
  var Polkadot = {
4
344
  relaychainSymbol: "DOT",
@@ -4052,23 +4392,6 @@ var Hydration = {
4052
4392
  },
4053
4393
  isFeeAsset: true
4054
4394
  },
4055
- {
4056
- assetId: "3370",
4057
- symbol: "LAOS",
4058
- decimals: 18,
4059
- existentialDeposit: "1",
4060
- location: {
4061
- parents: 1,
4062
- interior: {
4063
- X1: [
4064
- {
4065
- Parachain: 3370
4066
- }
4067
- ]
4068
- }
4069
- },
4070
- isFeeAsset: true
4071
- },
4072
4395
  {
4073
4396
  assetId: "1003",
4074
4397
  symbol: "aUSDC",
@@ -6802,6 +7125,29 @@ var AssetHubPolkadot = {
6802
7125
  existentialDeposit: "1000000000000",
6803
7126
  isFeeAsset: true
6804
7127
  },
7128
+ {
7129
+ assetId: "50000515",
7130
+ symbol: "WUD",
7131
+ decimals: 18,
7132
+ location: {
7133
+ parents: 1,
7134
+ interior: {
7135
+ X3: [
7136
+ {
7137
+ Parachain: 1000
7138
+ },
7139
+ {
7140
+ PalletInstance: 50
7141
+ },
7142
+ {
7143
+ GeneralIndex: 50000515
7144
+ }
7145
+ ]
7146
+ }
7147
+ },
7148
+ existentialDeposit: "1000000000000",
7149
+ alias: "WUD4"
7150
+ },
6805
7151
  {
6806
7152
  assetId: "108",
6807
7153
  symbol: "GAME",
@@ -7146,6 +7492,29 @@ var AssetHubPolkadot = {
7146
7492
  existentialDeposit: "1",
7147
7493
  alias: "VDOT1"
7148
7494
  },
7495
+ {
7496
+ assetId: "50000520",
7497
+ symbol: "DOT",
7498
+ decimals: 18,
7499
+ location: {
7500
+ parents: 1,
7501
+ interior: {
7502
+ X3: [
7503
+ {
7504
+ Parachain: 1000
7505
+ },
7506
+ {
7507
+ PalletInstance: 50
7508
+ },
7509
+ {
7510
+ GeneralIndex: 50000520
7511
+ }
7512
+ ]
7513
+ }
7514
+ },
7515
+ existentialDeposit: "1000000000000",
7516
+ alias: "DOT2"
7517
+ },
7149
7518
  {
7150
7519
  assetId: "40",
7151
7520
  symbol: "PEPE",
@@ -7169,6 +7538,29 @@ var AssetHubPolkadot = {
7169
7538
  existentialDeposit: "1",
7170
7539
  alias: "PEPE2"
7171
7540
  },
7541
+ {
7542
+ assetId: "50000509",
7543
+ symbol: "WUD",
7544
+ decimals: 18,
7545
+ location: {
7546
+ parents: 1,
7547
+ interior: {
7548
+ X3: [
7549
+ {
7550
+ Parachain: 1000
7551
+ },
7552
+ {
7553
+ PalletInstance: 50
7554
+ },
7555
+ {
7556
+ GeneralIndex: 50000509
7557
+ }
7558
+ ]
7559
+ }
7560
+ },
7561
+ existentialDeposit: "1000000000000",
7562
+ alias: "WUD3"
7563
+ },
7172
7564
  {
7173
7565
  assetId: "50000470",
7174
7566
  symbol: "USDt",
@@ -7351,6 +7743,29 @@ var AssetHubPolkadot = {
7351
7743
  },
7352
7744
  existentialDeposit: "1000000"
7353
7745
  },
7746
+ {
7747
+ assetId: "50000516",
7748
+ symbol: "WUD",
7749
+ decimals: 18,
7750
+ location: {
7751
+ parents: 1,
7752
+ interior: {
7753
+ X3: [
7754
+ {
7755
+ Parachain: 1000
7756
+ },
7757
+ {
7758
+ PalletInstance: 50
7759
+ },
7760
+ {
7761
+ GeneralIndex: 50000516
7762
+ }
7763
+ ]
7764
+ }
7765
+ },
7766
+ existentialDeposit: "1000000000000",
7767
+ alias: "WUD5"
7768
+ },
7354
7769
  {
7355
7770
  assetId: "31337",
7356
7771
  symbol: "WUD",
@@ -7416,7 +7831,8 @@ var AssetHubPolkadot = {
7416
7831
  ]
7417
7832
  }
7418
7833
  },
7419
- existentialDeposit: "10000000000000000"
7834
+ existentialDeposit: "10000000000000000",
7835
+ alias: "DOT1"
7420
7836
  },
7421
7837
  {
7422
7838
  assetId: "1337",
@@ -7511,6 +7927,29 @@ var AssetHubPolkadot = {
7511
7927
  existentialDeposit: "1",
7512
7928
  alias: "ETH2"
7513
7929
  },
7930
+ {
7931
+ assetId: "50000523",
7932
+ symbol: "DED",
7933
+ decimals: 18,
7934
+ location: {
7935
+ parents: 1,
7936
+ interior: {
7937
+ X3: [
7938
+ {
7939
+ Parachain: 1000
7940
+ },
7941
+ {
7942
+ PalletInstance: 50
7943
+ },
7944
+ {
7945
+ GeneralIndex: 50000523
7946
+ }
7947
+ ]
7948
+ }
7949
+ },
7950
+ existentialDeposit: "1000000000000",
7951
+ alias: "DED3"
7952
+ },
7514
7953
  {
7515
7954
  assetId: "22222012",
7516
7955
  symbol: "DAMN",
@@ -9327,32 +9766,6 @@ var CrustShadow = {
9327
9766
  }
9328
9767
  ]
9329
9768
  };
9330
- var Laos = {
9331
- relaychainSymbol: "DOT",
9332
- nativeAssetSymbol: "LAOS",
9333
- isEVM: true,
9334
- ss58Prefix: 42,
9335
- supportsDryRunApi: true,
9336
- supportsXcmPaymentApi: true,
9337
- assets: [
9338
- {
9339
- symbol: "LAOS",
9340
- isNative: true,
9341
- decimals: 18,
9342
- existentialDeposit: "0",
9343
- location: {
9344
- parents: 1,
9345
- interior: {
9346
- X1: [
9347
- {
9348
- Parachain: 3370
9349
- }
9350
- ]
9351
- }
9352
- }
9353
- }
9354
- ]
9355
- };
9356
9769
  var Encointer = {
9357
9770
  relaychainSymbol: "KSM",
9358
9771
  nativeAssetSymbol: "KSM",
@@ -13801,6 +14214,58 @@ var Ethereum = {
13801
14214
  }
13802
14215
  }
13803
14216
  },
14217
+ {
14218
+ symbol: "NEXO",
14219
+ assetId: "0xb62132e35a6c13ee1ee0f84dc5d40bad8d815206",
14220
+ decimals: 18,
14221
+ existentialDeposit: "1",
14222
+ location: {
14223
+ parents: 2,
14224
+ interior: {
14225
+ X2: [
14226
+ {
14227
+ GlobalConsensus: {
14228
+ Ethereum: {
14229
+ chainId: 1
14230
+ }
14231
+ }
14232
+ },
14233
+ {
14234
+ AccountKey20: {
14235
+ network: null,
14236
+ key: "0xb62132e35a6c13ee1ee0f84dc5d40bad8d815206"
14237
+ }
14238
+ }
14239
+ ]
14240
+ }
14241
+ }
14242
+ },
14243
+ {
14244
+ symbol: "sUSDat",
14245
+ assetId: "0xd166337499e176bbc38a1fbd113ab144e5bd2df7",
14246
+ decimals: 18,
14247
+ existentialDeposit: "1",
14248
+ location: {
14249
+ parents: 2,
14250
+ interior: {
14251
+ X2: [
14252
+ {
14253
+ GlobalConsensus: {
14254
+ Ethereum: {
14255
+ chainId: 1
14256
+ }
14257
+ }
14258
+ },
14259
+ {
14260
+ AccountKey20: {
14261
+ network: null,
14262
+ key: "0xd166337499e176bbc38a1fbd113ab144e5bd2df7"
14263
+ }
14264
+ }
14265
+ ]
14266
+ }
14267
+ }
14268
+ },
13804
14269
  {
13805
14270
  symbol: "SKY",
13806
14271
  assetId: "0x56072c95faa701256059aa122697b133aded9279",
@@ -16533,8 +16998,8 @@ var EnergyWebXPaseo = {
16533
16998
  nativeAssetSymbol: "EWT",
16534
16999
  isEVM: false,
16535
17000
  ss58Prefix: 42,
16536
- supportsDryRunApi: false,
16537
- supportsXcmPaymentApi: false,
17001
+ supportsDryRunApi: true,
17002
+ supportsXcmPaymentApi: true,
16538
17003
  assets: [
16539
17004
  {
16540
17005
  symbol: "EWT",
@@ -16571,7 +17036,8 @@ var EnergyWebXPaseo = {
16571
17036
  }
16572
17037
  ]
16573
17038
  }
16574
- }
17039
+ },
17040
+ isFeeAsset: true
16575
17041
  },
16576
17042
  {
16577
17043
  symbol: "stEWT",
@@ -18494,32 +18960,6 @@ var HydrationPaseo = {
18494
18960
  }
18495
18961
  ]
18496
18962
  };
18497
- var LaosPaseo = {
18498
- relaychainSymbol: "PAS",
18499
- nativeAssetSymbol: "SIGMA",
18500
- isEVM: true,
18501
- ss58Prefix: 42,
18502
- supportsDryRunApi: true,
18503
- supportsXcmPaymentApi: true,
18504
- assets: [
18505
- {
18506
- symbol: "SIGMA",
18507
- isNative: true,
18508
- decimals: 18,
18509
- existentialDeposit: "0",
18510
- location: {
18511
- parents: 1,
18512
- interior: {
18513
- X1: [
18514
- {
18515
- Parachain: 4006
18516
- }
18517
- ]
18518
- }
18519
- }
18520
- }
18521
- ]
18522
- };
18523
18963
  var NeuroWebPaseo = {
18524
18964
  relaychainSymbol: "PAS",
18525
18965
  nativeAssetSymbol: "NEURO",
@@ -18729,7 +19169,6 @@ var assetsMapJson = {
18729
19169
  BifrostKusama: BifrostKusama,
18730
19170
  Crab: Crab,
18731
19171
  CrustShadow: CrustShadow,
18732
- Laos: Laos,
18733
19172
  Encointer: Encointer,
18734
19173
  Karura: Karura,
18735
19174
  Kintsugi: Kintsugi,
@@ -18768,190 +19207,135 @@ var assetsMapJson = {
18768
19207
  HeimaPaseo: HeimaPaseo,
18769
19208
  EnergyWebXPaseo: EnergyWebXPaseo,
18770
19209
  HydrationPaseo: HydrationPaseo,
18771
- LaosPaseo: LaosPaseo,
18772
19210
  NeuroWebPaseo: NeuroWebPaseo,
18773
19211
  ZeitgeistPaseo: ZeitgeistPaseo
18774
19212
  };
18775
19213
 
18776
19214
  /**
18777
- * Normalizes an asset symbol by stripping the 'xc' prefix (if present) and converting it to lowercase.
19215
+ * Converts a location to a specific XCM version
18778
19216
  *
18779
- * @param symbol - The symbol to normalize.
18780
- * @returns The normalized symbol.
19217
+ * In XCM v3, `interior.X1` is a single `Object`. In XCM V4, `interior.X1` is an `Array<Object>`.
19218
+ *
19219
+ * @param location - The location to normalize.
19220
+ * @param version - The target XCM version: `'V3'`, `'V4'` or `'V5'`. Defaults to `'V5'`.
19221
+ * @returns A new transformed `TLocation`
18781
19222
  */
18782
- var normalizeSymbol = function normalizeSymbol(symbol) {
18783
- if (!symbol) return '';
18784
- var s = symbol.toLowerCase();
18785
- if (s.startsWith('xc')) s = s.substring(2);
18786
- if (s.endsWith('.e')) s = s.slice(0, -2);
18787
- return s;
18788
- };
18789
-
18790
- var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
18791
- return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
18792
- };
18793
-
18794
- function _arrayLikeToArray(r, a) {
18795
- (null == a || a > r.length) && (a = r.length);
18796
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
18797
- return n;
18798
- }
18799
- function _arrayWithoutHoles(r) {
18800
- if (Array.isArray(r)) return _arrayLikeToArray(r);
18801
- }
18802
- function _assertThisInitialized(e) {
18803
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
18804
- return e;
18805
- }
18806
- function _callSuper(t, o, e) {
18807
- return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
18808
- }
18809
- function _classCallCheck(a, n) {
18810
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
18811
- }
18812
- function _construct(t, e, r) {
18813
- if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
18814
- var o = [null];
18815
- o.push.apply(o, e);
18816
- var p = new (t.bind.apply(t, o))();
18817
- return r && _setPrototypeOf(p, r.prototype), p;
18818
- }
18819
- function _createClass(e, r, t) {
18820
- return Object.defineProperty(e, "prototype", {
18821
- writable: false
18822
- }), e;
18823
- }
18824
- function _defineProperty(e, r, t) {
18825
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
18826
- value: t,
18827
- enumerable: true,
18828
- configurable: true,
18829
- writable: true
18830
- }) : e[r] = t, e;
18831
- }
18832
- function _getPrototypeOf(t) {
18833
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
18834
- return t.__proto__ || Object.getPrototypeOf(t);
18835
- }, _getPrototypeOf(t);
18836
- }
18837
- function _inherits(t, e) {
18838
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
18839
- t.prototype = Object.create(e && e.prototype, {
18840
- constructor: {
18841
- value: t,
18842
- writable: true,
18843
- configurable: true
18844
- }
18845
- }), Object.defineProperty(t, "prototype", {
18846
- writable: false
18847
- }), e && _setPrototypeOf(t, e);
18848
- }
18849
- function _isNativeFunction(t) {
18850
- try {
18851
- return -1 !== Function.toString.call(t).indexOf("[native code]");
18852
- } catch (n) {
18853
- return "function" == typeof t;
18854
- }
18855
- }
18856
- function _isNativeReflectConstruct() {
18857
- try {
18858
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
18859
- } catch (t) {}
18860
- return (_isNativeReflectConstruct = function () {
18861
- return !!t;
18862
- })();
18863
- }
18864
- function _iterableToArray(r) {
18865
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
18866
- }
18867
- function _nonIterableSpread() {
18868
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18869
- }
18870
- function _objectWithoutProperties(e, t) {
18871
- if (null == e) return {};
18872
- var o,
18873
- r,
18874
- i = _objectWithoutPropertiesLoose(e, t);
18875
- if (Object.getOwnPropertySymbols) {
18876
- var n = Object.getOwnPropertySymbols(e);
18877
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
18878
- }
18879
- return i;
18880
- }
18881
- function _objectWithoutPropertiesLoose(r, e) {
18882
- if (null == r) return {};
18883
- var t = {};
18884
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
18885
- if (-1 !== e.indexOf(n)) continue;
18886
- t[n] = r[n];
18887
- }
18888
- return t;
18889
- }
18890
- function _possibleConstructorReturn(t, e) {
18891
- if (e && ("object" == typeof e || "function" == typeof e)) return e;
18892
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
18893
- return _assertThisInitialized(t);
18894
- }
18895
- function _setPrototypeOf(t, e) {
18896
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
18897
- return t.__proto__ = e, t;
18898
- }, _setPrototypeOf(t, e);
18899
- }
18900
- function _toConsumableArray(r) {
18901
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
18902
- }
18903
- function _toPrimitive(t, r) {
18904
- if ("object" != typeof t || !t) return t;
18905
- var e = t[Symbol.toPrimitive];
18906
- if (void 0 !== e) {
18907
- var i = e.call(t, r);
18908
- if ("object" != typeof i) return i;
18909
- throw new TypeError("@@toPrimitive must return a primitive value.");
18910
- }
18911
- return ("string" === r ? String : Number)(t);
18912
- }
18913
- function _toPropertyKey(t) {
18914
- var i = _toPrimitive(t, "string");
18915
- return "symbol" == typeof i ? i : i + "";
18916
- }
18917
- function _typeof(o) {
18918
- "@babel/helpers - typeof";
18919
-
18920
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
18921
- return typeof o;
18922
- } : function (o) {
18923
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
18924
- }, _typeof(o);
18925
- }
18926
- function _unsupportedIterableToArray(r, a) {
18927
- if (r) {
18928
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
18929
- var t = {}.toString.call(r).slice(8, -1);
18930
- 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;
19223
+ var normalizeLocation = function normalizeLocation(location) {
19224
+ var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Version.V5;
19225
+ if (location.interior === 'Here' || location.interior.X1 === undefined) {
19226
+ return location;
18931
19227
  }
18932
- }
18933
- function _wrapNativeSuper(t) {
18934
- var r = "function" == typeof Map ? new Map() : void 0;
18935
- return _wrapNativeSuper = function (t) {
18936
- if (null === t || !_isNativeFunction(t)) return t;
18937
- if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
18938
- if (void 0 !== r) {
18939
- if (r.has(t)) return r.get(t);
18940
- r.set(t, Wrapper);
19228
+ var currentX1 = location.interior.X1;
19229
+ if (version === Version.V4 || version === Version.V5) {
19230
+ if (Array.isArray(currentX1)) {
19231
+ // Already in V4/V5 format
19232
+ return location;
18941
19233
  }
18942
- function Wrapper() {
18943
- return _construct(t, arguments, _getPrototypeOf(this).constructor);
19234
+ return {
19235
+ parents: location.parents,
19236
+ interior: {
19237
+ X1: [currentX1]
19238
+ }
19239
+ };
19240
+ } else {
19241
+ if (!Array.isArray(currentX1)) {
19242
+ // Already in V3 format
19243
+ return location;
18944
19244
  }
18945
- return Wrapper.prototype = Object.create(t.prototype, {
18946
- constructor: {
18947
- value: Wrapper,
18948
- enumerable: false,
18949
- writable: true,
18950
- configurable: true
19245
+ return {
19246
+ parents: location.parents,
19247
+ interior: {
19248
+ X1: currentX1[0]
18951
19249
  }
18952
- }), _setPrototypeOf(Wrapper, t);
18953
- }, _wrapNativeSuper(t);
18954
- }
19250
+ };
19251
+ }
19252
+ };
19253
+ var canonicalizeLocation = function canonicalizeLocation(location) {
19254
+ var normalized = normalizeLocation(location);
19255
+ return normalized.interior === 'Here' ? {
19256
+ parents: normalized.parents,
19257
+ interior: {
19258
+ Here: null
19259
+ }
19260
+ } : normalized;
19261
+ };
19262
+
19263
+ var baseAssetsMap = assetsMapJson;
19264
+ var normalizeCustomAssets = function normalizeCustomAssets(map) {
19265
+ if (!map) return {};
19266
+ var result = {};
19267
+ for (var _i = 0, _Object$entries = Object.entries(map); _i < _Object$entries.length; _i++) {
19268
+ var _baseAssetsMap$chain$, _baseAssetsMap$chain;
19269
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
19270
+ chain = _Object$entries$_i[0],
19271
+ entries = _Object$entries$_i[1];
19272
+ if (!isChain(chain) || !entries || entries.length === 0) continue;
19273
+ var base = (_baseAssetsMap$chain$ = (_baseAssetsMap$chain = baseAssetsMap[chain]) === null || _baseAssetsMap$chain === void 0 ? void 0 : _baseAssetsMap$chain.assets) !== null && _baseAssetsMap$chain$ !== void 0 ? _baseAssetsMap$chain$ : [];
19274
+ var normalized = entries.map(function (entry) {
19275
+ return _objectSpread2(_objectSpread2({}, entry), {}, {
19276
+ location: canonicalizeLocation(entry.location)
19277
+ });
19278
+ });
19279
+ var _iterator = _createForOfIteratorHelper(normalized),
19280
+ _step;
19281
+ try {
19282
+ var _loop = function _loop() {
19283
+ var entry = _step.value;
19284
+ if (entry.forceOverride) return 1; // continue
19285
+ var clash = base.find(function (a) {
19286
+ return deepEqual(canonicalizeLocation(a.location), entry.location);
19287
+ });
19288
+ if (clash) {
19289
+ throw new CustomAssetConflictError("Custom asset '".concat(entry.symbol, "' on chain '").concat(chain, "' collides on location with registry asset '").concat(clash.symbol, "'. Set 'forceOverride: true' to replace it."));
19290
+ }
19291
+ };
19292
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
19293
+ if (_loop()) continue;
19294
+ }
19295
+ } catch (err) {
19296
+ _iterator.e(err);
19297
+ } finally {
19298
+ _iterator.f();
19299
+ }
19300
+ result[chain] = normalized;
19301
+ }
19302
+ return result;
19303
+ };
19304
+ var mergeCustomAssets = function mergeCustomAssets(base, overlay) {
19305
+ if (!overlay || overlay.length === 0) return _toConsumableArray(base);
19306
+ var kept = base.filter(function (b) {
19307
+ return !overlay.some(function (o) {
19308
+ return deepEqual(o.location, b.location);
19309
+ });
19310
+ });
19311
+ return [].concat(_toConsumableArray(kept), _toConsumableArray(overlay));
19312
+ };
19313
+ var isCustomAsset = function isCustomAsset(chain, asset, ctx) {
19314
+ var _ctx$customAssets;
19315
+ var overlay = ctx === null || ctx === void 0 || (_ctx$customAssets = ctx.customAssets) === null || _ctx$customAssets === void 0 ? void 0 : _ctx$customAssets[chain];
19316
+ if (!overlay || overlay.length === 0) return false;
19317
+ return overlay.some(function (a) {
19318
+ return deepEqual(a.location, asset.location);
19319
+ });
19320
+ };
19321
+
19322
+ /**
19323
+ * Normalizes an asset symbol by stripping the 'xc' prefix (if present) and converting it to lowercase.
19324
+ *
19325
+ * @param symbol - The symbol to normalize.
19326
+ * @returns The normalized symbol.
19327
+ */
19328
+ var normalizeSymbol = function normalizeSymbol(symbol) {
19329
+ if (!symbol) return '';
19330
+ var s = symbol.toLowerCase();
19331
+ if (s.startsWith('xc')) s = s.substring(2);
19332
+ if (s.endsWith('.e')) s = s.slice(0, -2);
19333
+ return s;
19334
+ };
19335
+
19336
+ var isSymbolMatch = function isSymbolMatch(symbolA, symbolB) {
19337
+ return normalizeSymbol(symbolA) === normalizeSymbol(symbolB);
19338
+ };
18955
19339
 
18956
19340
  var isOverrideLocationSpecifier = function isOverrideLocationSpecifier(locationSpecifier) {
18957
19341
  return _typeof(locationSpecifier) === 'object' && 'type' in locationSpecifier && 'value' in locationSpecifier;
@@ -18965,66 +19349,6 @@ var isTAsset = function isTAsset(value) {
18965
19349
  return _typeof(value) === 'object' && value !== null && 'id' in value && 'fun' in value;
18966
19350
  };
18967
19351
 
18968
- /**
18969
- * Error thrown when multiple assets with the same symbol are found.
18970
- */
18971
- var DuplicateAssetError = /*#__PURE__*/function (_Error) {
18972
- /**
18973
- * Constructs a new DuplicateAssetError.
18974
- *
18975
- * @param symbol - The symbol of the asset causing the duplication error.
18976
- */
18977
- function DuplicateAssetError(msg) {
18978
- var _this;
18979
- _classCallCheck(this, DuplicateAssetError);
18980
- _this = _callSuper(this, DuplicateAssetError, [msg]);
18981
- _this.name = 'DuplicateAsset';
18982
- return _this;
18983
- }
18984
- _inherits(DuplicateAssetError, _Error);
18985
- return _createClass(DuplicateAssetError);
18986
- }(/*#__PURE__*/_wrapNativeSuper(Error));
18987
-
18988
- /**
18989
- * Error thrown when multiple assets with the same symbol are found.
18990
- */
18991
- var DuplicateAssetIdError = /*#__PURE__*/function (_Error) {
18992
- /**
18993
- * Constructs a new DuplicateAssetError.
18994
- *
18995
- * @param symbol - The symbol of the asset causing the duplication error.
18996
- */
18997
- function DuplicateAssetIdError(id) {
18998
- var _this;
18999
- _classCallCheck(this, DuplicateAssetIdError);
19000
- _this = _callSuper(this, DuplicateAssetIdError, ["Multiple assets found with the same ID: ".concat(id, ". Please specify asset directly by symbol using .currency({symbol: <ASSET_SYMBOL>})")]);
19001
- _this.name = 'DuplicateAssetId';
19002
- return _this;
19003
- }
19004
- _inherits(DuplicateAssetIdError, _Error);
19005
- return _createClass(DuplicateAssetIdError);
19006
- }(/*#__PURE__*/_wrapNativeSuper(Error));
19007
-
19008
- /**
19009
- * Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
19010
- */
19011
- var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
19012
- /**
19013
- * Constructs a new InvalidCurrencyError.
19014
- *
19015
- * @param message - The error message.
19016
- */
19017
- function InvalidCurrencyError(message) {
19018
- var _this;
19019
- _classCallCheck(this, InvalidCurrencyError);
19020
- _this = _callSuper(this, InvalidCurrencyError, [message]);
19021
- _this.name = 'InvalidCurrencyError';
19022
- return _this;
19023
- }
19024
- _inherits(InvalidCurrencyError, _Error);
19025
- return _createClass(InvalidCurrencyError);
19026
- }(/*#__PURE__*/_wrapNativeSuper(Error));
19027
-
19028
19352
  var findAssetInfoById = function findAssetInfoById(assets, assetId) {
19029
19353
  var id = assetId.toString();
19030
19354
  var matches = assets.filter(function (a) {
@@ -19065,58 +19389,16 @@ var getAssetLocation = function getAssetLocation(chain, currency) {
19065
19389
  return (_asset$location = asset === null || asset === void 0 ? void 0 : asset.location) !== null && _asset$location !== void 0 ? _asset$location : null;
19066
19390
  };
19067
19391
 
19068
- /**
19069
- * Converts a location to a specific XCM version
19070
- *
19071
- * In XCM v3, `interior.X1` is a single `Object`. In XCM V4, `interior.X1` is an `Array<Object>`.
19072
- *
19073
- * @param location - The location to normalize.
19074
- * @param version - The target XCM version: `'V3'`, `'V4'` or `'V5'`. Defaults to `'V5'`.
19075
- * @returns A new transformed `TLocation`
19076
- */
19077
- var normalizeLocation = function normalizeLocation(location) {
19078
- var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Version.V5;
19079
- if (location.interior === 'Here' || location.interior.X1 === undefined) {
19080
- return location;
19081
- }
19082
- var currentX1 = location.interior.X1;
19083
- if (version === Version.V4 || version === Version.V5) {
19084
- if (Array.isArray(currentX1)) {
19085
- // Already in V4/V5 format
19086
- return location;
19087
- }
19088
- return {
19089
- parents: location.parents,
19090
- interior: {
19091
- X1: [currentX1]
19092
- }
19093
- };
19094
- } else {
19095
- if (!Array.isArray(currentX1)) {
19096
- // Already in V3 format
19097
- return location;
19098
- }
19099
- return {
19100
- parents: location.parents,
19101
- interior: {
19102
- X1: currentX1[0]
19103
- }
19104
- };
19105
- }
19106
- };
19107
-
19108
19392
  var findAssetInfoByLoc = function findAssetInfoByLoc(foreignAssets, location) {
19109
19393
  if (typeof location === 'string') {
19110
19394
  return foreignAssets.find(function (asset) {
19111
19395
  return compareLocations(location, asset);
19112
19396
  });
19113
- } else {
19114
- var normalizedLocation = normalizeLocation(location);
19115
- return foreignAssets.find(function (asset) {
19116
- var normalizedAssetML = asset.location && normalizeLocation(asset.location);
19117
- return deepEqual(normalizedLocation, normalizedAssetML);
19118
- });
19119
19397
  }
19398
+ var normalizedLocation = canonicalizeLocation(location);
19399
+ return foreignAssets.find(function (asset) {
19400
+ return asset.location && deepEqual(normalizedLocation, canonicalizeLocation(asset.location));
19401
+ });
19120
19402
  };
19121
19403
 
19122
19404
  var findBestMatches = function findBestMatches(assets, value) {
@@ -19291,12 +19573,12 @@ var findAssetInfoBySymbol = function findAssetInfoBySymbol(otherAssets, nativeAs
19291
19573
  return assetsMatches[0];
19292
19574
  };
19293
19575
 
19294
- var findAssetInfo = function findAssetInfo(chain, currency, destination) {
19576
+ var findAssetInfoImpl = function findAssetInfoImpl(chain, currency, destination, ctx) {
19295
19577
  if ('location' in currency && isOverrideLocationSpecifier(currency.location) || Array.isArray(currency)) {
19296
19578
  return null;
19297
19579
  }
19298
- var otherAssets = getOtherAssets(chain);
19299
- var nativeAssets = getNativeAssets(chain);
19580
+ var otherAssets = getOtherAssetsImpl(chain, ctx);
19581
+ var nativeAssets = getNativeAssetsImpl(chain, ctx);
19300
19582
  var assets = [].concat(_toConsumableArray(nativeAssets), _toConsumableArray(otherAssets));
19301
19583
  var asset;
19302
19584
  if ('symbol' in currency) {
@@ -19308,6 +19590,9 @@ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
19308
19590
  }
19309
19591
  return asset !== null && asset !== void 0 ? asset : null;
19310
19592
  };
19593
+ var findAssetInfo = function findAssetInfo(chain, currency, destination) {
19594
+ return findAssetInfoImpl(chain, currency, destination);
19595
+ };
19311
19596
 
19312
19597
  var Native = function Native(symbol) {
19313
19598
  return {
@@ -19327,6 +19612,9 @@ var ForeignAbstract = function ForeignAbstract(symbol) {
19327
19612
  value: symbol
19328
19613
  };
19329
19614
  };
19615
+ /**
19616
+ * @deprecated Use the `customAssets` Builder option to register the asset instead. Will be removed in v14.
19617
+ */
19330
19618
  var Override = function Override(location) {
19331
19619
  return {
19332
19620
  type: 'Override',
@@ -19362,13 +19650,16 @@ var isBridgedSystemAsset = function isBridgedSystemAsset(asset, relayChains) {
19362
19650
  });
19363
19651
  };
19364
19652
 
19365
- var findAssetInfoOrThrow = function findAssetInfoOrThrow(chain, currency, destination) {
19366
- var asset = findAssetInfo(chain, currency, destination);
19653
+ var findAssetInfoOrThrowImpl = function findAssetInfoOrThrowImpl(chain, currency, destination, ctx) {
19654
+ var asset = findAssetInfoImpl(chain, currency, destination, ctx);
19367
19655
  if (!asset) {
19368
19656
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency, replaceBigInt), " not found on ").concat(chain));
19369
19657
  }
19370
19658
  return asset;
19371
19659
  };
19660
+ var findAssetInfoOrThrow = function findAssetInfoOrThrow(chain, currency, destination) {
19661
+ return findAssetInfoOrThrowImpl(chain, currency, destination);
19662
+ };
19372
19663
 
19373
19664
  var findStablecoinAssets = function findStablecoinAssets(chain) {
19374
19665
  var assets = getOtherAssets(chain);
@@ -19383,10 +19674,10 @@ var findStablecoinAssets = function findStablecoinAssets(chain) {
19383
19674
  });
19384
19675
  };
19385
19676
 
19386
- var findAssetInfoOnSubBridgeDest = function findAssetInfoOnSubBridgeDest(destination, resolvedOriginAsset) {
19387
- var nativeMatch = findAssetInfo(destination, {
19677
+ var findAssetInfoOnSubBridgeDest = function findAssetInfoOnSubBridgeDest(destination, resolvedOriginAsset, ctx) {
19678
+ var nativeMatch = findAssetInfoImpl(destination, {
19388
19679
  symbol: Native(resolvedOriginAsset.symbol)
19389
- }, null);
19680
+ }, null, ctx);
19390
19681
  if (nativeMatch) return nativeMatch;
19391
19682
  var isStablecoin = isStableCoinAsset(resolvedOriginAsset);
19392
19683
  if (isStablecoin) {
@@ -19396,48 +19687,75 @@ var findAssetInfoOnSubBridgeDest = function findAssetInfoOnSubBridgeDest(destina
19396
19687
  });
19397
19688
  if (match) return match;
19398
19689
  }
19399
- var foreignMatch = findAssetInfo(destination, {
19690
+ var foreignMatch = findAssetInfoImpl(destination, {
19400
19691
  symbol: Foreign(resolvedOriginAsset.symbol)
19401
- }, null);
19692
+ }, null, ctx);
19402
19693
  if (foreignMatch) return foreignMatch;
19403
19694
  return null;
19404
19695
  };
19405
- var findAssetInfoOnDest = function findAssetInfoOnDest(origin, destination, currency, originAsset) {
19406
- var isSubBridge = isSubstrateBridge(origin, destination);
19407
- var isSb = isSnowbridge(origin, destination);
19408
- var resolvedOriginAsset = originAsset !== null && originAsset !== void 0 ? originAsset : findAssetInfoOrThrow(origin, currency, destination);
19409
- if (isSubBridge) {
19410
- return findAssetInfoOnSubBridgeDest(destination, resolvedOriginAsset);
19696
+ var resolveAssetOnDest = function resolveAssetOnDest(origin, destination, resolvedOriginAsset, ctx) {
19697
+ if (isSubstrateBridge(origin, destination)) {
19698
+ return findAssetInfoOnSubBridgeDest(destination, resolvedOriginAsset, ctx);
19411
19699
  }
19700
+ var isSb = isSnowbridge(origin, destination);
19412
19701
  if (isSb && isSystemAsset(resolvedOriginAsset)) {
19413
- var match = findAssetInfo(destination, {
19702
+ var match = findAssetInfoImpl(destination, {
19414
19703
  symbol: resolvedOriginAsset.symbol
19415
- });
19704
+ }, null, ctx);
19416
19705
  if (match) return match;
19417
19706
  }
19418
- return findAssetInfo(destination, {
19707
+ // MYTH has two valid locations (native on Mythos, ERC-20 on Ethereum),
19708
+ // so resolve by symbol for the Mythos -> Ethereum Snowbridge transfer.
19709
+ if (isSb && origin === 'Mythos' && resolvedOriginAsset.symbol === 'MYTH') {
19710
+ var _match = findAssetInfoImpl(destination, {
19711
+ symbol: 'MYTH'
19712
+ }, null, ctx);
19713
+ if (_match) return _match;
19714
+ }
19715
+ return findAssetInfoImpl(destination, {
19419
19716
  location: resolvedOriginAsset.location
19420
- });
19717
+ }, null, ctx);
19421
19718
  };
19422
- var findAssetOnDestOrThrow = function findAssetOnDestOrThrow(origin, destination, currency) {
19423
- var asset = findAssetInfoOnDest(origin, destination, currency);
19719
+ var findAssetInfoOnDestImpl = function findAssetInfoOnDestImpl(origin, destination, currency, originAsset, ctx) {
19720
+ var resolvedOriginAsset = originAsset !== null && originAsset !== void 0 ? originAsset : findAssetInfoOrThrowImpl(origin, currency, destination, ctx);
19721
+ var result = resolveAssetOnDest(origin, destination, resolvedOriginAsset, ctx);
19722
+ if (result) return result;
19723
+ if (!isCustomChain(origin) && isCustomAsset(origin, resolvedOriginAsset, ctx)) {
19724
+ return resolvedOriginAsset;
19725
+ }
19726
+ return null;
19727
+ };
19728
+ var findAssetInfoOnDest = function findAssetInfoOnDest(origin, destination, currency, originAsset) {
19729
+ return findAssetInfoOnDestImpl(origin, destination, currency, originAsset);
19730
+ };
19731
+ var findAssetOnDestOrThrowImpl = function findAssetOnDestOrThrowImpl(origin, destination, currency, ctx) {
19732
+ var asset = findAssetInfoOnDestImpl(origin, destination, currency, null, ctx);
19424
19733
  if (!asset) {
19425
19734
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency, replaceBigInt), " not found on ").concat(destination));
19426
19735
  }
19427
19736
  return asset;
19428
19737
  };
19738
+ var findAssetOnDestOrThrow = function findAssetOnDestOrThrow(origin, destination, currency) {
19739
+ return findAssetOnDestOrThrowImpl(origin, destination, currency);
19740
+ };
19429
19741
 
19430
- var createSelection = function createSelection(chain) {
19431
- var nativeSymbol = getNativeAssetSymbol(chain);
19742
+ var createSelection = function createSelection(chain, ctx) {
19743
+ var nativeSymbol = getNativeAssetSymbolImpl(chain, ctx);
19432
19744
  return {
19433
19745
  symbol: isExternalChain(chain) ? nativeSymbol : Native(nativeSymbol)
19434
19746
  };
19435
19747
  };
19748
+ var findNativeAssetInfoImpl = function findNativeAssetInfoImpl(chain, ctx) {
19749
+ return findAssetInfoImpl(chain, createSelection(chain, ctx), null, ctx);
19750
+ };
19436
19751
  var findNativeAssetInfo = function findNativeAssetInfo(chain) {
19437
- return findAssetInfo(chain, createSelection(chain));
19752
+ return findNativeAssetInfoImpl(chain);
19753
+ };
19754
+ var findNativeAssetInfoOrThrowImpl = function findNativeAssetInfoOrThrowImpl(chain, ctx) {
19755
+ return findAssetInfoOrThrowImpl(chain, createSelection(chain, ctx), null, ctx);
19438
19756
  };
19439
19757
  var findNativeAssetInfoOrThrow = function findNativeAssetInfoOrThrow(chain) {
19440
- return findAssetInfoOrThrow(chain, createSelection(chain));
19758
+ return findNativeAssetInfoOrThrowImpl(chain);
19441
19759
  };
19442
19760
 
19443
19761
  var extractEdFromAsset = function extractEdFromAsset(asset) {
@@ -19505,8 +19823,24 @@ var getFeeAssets = function getFeeAssets(chain) {
19505
19823
  return feeAssets;
19506
19824
  };
19507
19825
 
19508
- // Contains different useful asset query operations from compatible Parachains asset map
19509
19826
  var assetsMap = assetsMapJson;
19827
+ var getAssetsObjectImpl = function getAssetsObjectImpl(chain, ctx) {
19828
+ var _ctx$customAssets;
19829
+ if (isCustomChain(chain)) {
19830
+ var _ctx$customChainAsset;
19831
+ var entry = ctx === null || ctx === void 0 || (_ctx$customChainAsset = ctx.customChainAssets) === null || _ctx$customChainAsset === void 0 ? void 0 : _ctx$customChainAsset[chain];
19832
+ if (!entry) {
19833
+ throw new InvalidCurrencyError("Custom chain '".concat(chain, "' is not registered."));
19834
+ }
19835
+ return entry;
19836
+ }
19837
+ var base = assetsMap[chain];
19838
+ var overlay = ctx === null || ctx === void 0 || (_ctx$customAssets = ctx.customAssets) === null || _ctx$customAssets === void 0 ? void 0 : _ctx$customAssets[chain];
19839
+ if (!overlay || overlay.length === 0) return base;
19840
+ return _objectSpread2(_objectSpread2({}, base), {}, {
19841
+ assets: mergeCustomAssets(base.assets, overlay)
19842
+ });
19843
+ };
19510
19844
  /**
19511
19845
  * Retrieves the assets object for a given chain containing the native and foreign assets.
19512
19846
  *
@@ -19514,10 +19848,13 @@ var assetsMap = assetsMapJson;
19514
19848
  * @returns The assets object associated with the given chain.
19515
19849
  */
19516
19850
  var getAssetsObject = function getAssetsObject(chain) {
19517
- return assetsMap[chain];
19851
+ return getAssetsObjectImpl(chain);
19852
+ };
19853
+ var isChainEvmImpl = function isChainEvmImpl(chain, ctx) {
19854
+ return getAssetsObjectImpl(chain, ctx).isEVM;
19518
19855
  };
19519
19856
  var isChainEvm = function isChainEvm(chain) {
19520
- return assetsMap[chain].isEVM;
19857
+ return isChainEvmImpl(chain);
19521
19858
  };
19522
19859
  /**
19523
19860
  * Retrieves the asset ID for a given symbol on a specified chain.
@@ -19534,6 +19871,9 @@ var getAssetId = function getAssetId(chain, symbol) {
19534
19871
  });
19535
19872
  return asset != null && asset.assetId ? asset.assetId : null;
19536
19873
  };
19874
+ var getRelayChainSymbolImpl = function getRelayChainSymbolImpl(chain, ctx) {
19875
+ return getAssetsObjectImpl(chain, ctx).relaychainSymbol;
19876
+ };
19537
19877
  /**
19538
19878
  * Retrieves the relay chain asset symbol for a specified chain.
19539
19879
  *
@@ -19541,7 +19881,12 @@ var getAssetId = function getAssetId(chain, symbol) {
19541
19881
  * @returns The relay chain asset symbol.
19542
19882
  */
19543
19883
  var getRelayChainSymbol = function getRelayChainSymbol(chain) {
19544
- return getAssetsObject(chain).relaychainSymbol;
19884
+ return getRelayChainSymbolImpl(chain);
19885
+ };
19886
+ var getNativeAssetsImpl = function getNativeAssetsImpl(chain, ctx) {
19887
+ return getAssetsObjectImpl(chain, ctx).assets.filter(function (asset) {
19888
+ return asset.isNative;
19889
+ });
19545
19890
  };
19546
19891
  /**
19547
19892
  * Retrieves the list of native assets for a specified chain.
@@ -19550,8 +19895,11 @@ var getRelayChainSymbol = function getRelayChainSymbol(chain) {
19550
19895
  * @returns An array of native asset details.
19551
19896
  */
19552
19897
  var getNativeAssets = function getNativeAssets(chain) {
19553
- return getAssetsObject(chain).assets.filter(function (asset) {
19554
- return asset.isNative;
19898
+ return getNativeAssetsImpl(chain);
19899
+ };
19900
+ var getOtherAssetsImpl = function getOtherAssetsImpl(chain, ctx) {
19901
+ return getAssetsObjectImpl(chain, ctx).assets.filter(function (asset) {
19902
+ return !asset.isNative;
19555
19903
  });
19556
19904
  };
19557
19905
  /**
@@ -19561,9 +19909,10 @@ var getNativeAssets = function getNativeAssets(chain) {
19561
19909
  * @returns An array of other asset details.
19562
19910
  */
19563
19911
  var getOtherAssets = function getOtherAssets(chain) {
19564
- return getAssetsObject(chain).assets.filter(function (asset) {
19565
- return !asset.isNative;
19566
- });
19912
+ return getOtherAssetsImpl(chain);
19913
+ };
19914
+ var getAssetsImpl = function getAssetsImpl(chain, ctx) {
19915
+ return getAssetsObjectImpl(chain, ctx).assets;
19567
19916
  };
19568
19917
  /**
19569
19918
  * Retrieves the complete list of assets for a specified chain, including relay chain asset, native, and other assets.
@@ -19572,9 +19921,7 @@ var getOtherAssets = function getOtherAssets(chain) {
19572
19921
  * @returns An array of objects of all assets associated with the chain.
19573
19922
  */
19574
19923
  var getAssets = function getAssets(chain) {
19575
- var _getAssetsObject = getAssetsObject(chain),
19576
- assets = _getAssetsObject.assets;
19577
- return assets;
19924
+ return getAssetsImpl(chain);
19578
19925
  };
19579
19926
  /**
19580
19927
  * Retrieves the symbols of all assets (relay chain, native, and other assets) for a specified chain.
@@ -19583,13 +19930,16 @@ var getAssets = function getAssets(chain) {
19583
19930
  * @returns An array of asset symbols.
19584
19931
  */
19585
19932
  var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
19586
- var _getAssetsObject2 = getAssetsObject(chain),
19587
- assets = _getAssetsObject2.assets;
19933
+ var _getAssetsObject = getAssetsObject(chain),
19934
+ assets = _getAssetsObject.assets;
19588
19935
  return assets.map(function (_ref) {
19589
19936
  var symbol = _ref.symbol;
19590
19937
  return symbol;
19591
19938
  });
19592
19939
  };
19940
+ var getNativeAssetSymbolImpl = function getNativeAssetSymbolImpl(chain, ctx) {
19941
+ return getAssetsObjectImpl(chain, ctx).nativeAssetSymbol;
19942
+ };
19593
19943
  /**
19594
19944
  * Retrieves the symbol of the native asset for a specified chain.
19595
19945
  *
@@ -19597,7 +19947,7 @@ var getAllAssetsSymbols = function getAllAssetsSymbols(chain) {
19597
19947
  * @returns The symbol of the native asset.
19598
19948
  */
19599
19949
  var getNativeAssetSymbol = function getNativeAssetSymbol(chain) {
19600
- return getAssetsObject(chain).nativeAssetSymbol;
19950
+ return getNativeAssetSymbolImpl(chain);
19601
19951
  };
19602
19952
  /**
19603
19953
  * Determines whether a specified chain supports an asset with the given symbol.
@@ -19639,24 +19989,34 @@ var hasSupportForAsset = function hasSupportForAsset(chain, symbol) {
19639
19989
  * @returns The number of decimals if the asset is found; otherwise, null.
19640
19990
  */
19641
19991
  var getAssetDecimals = function getAssetDecimals(chain, symbol) {
19642
- var _getAssetsObject3 = getAssetsObject(chain),
19643
- assets = _getAssetsObject3.assets;
19992
+ var _getAssetsObject2 = getAssetsObject(chain),
19993
+ assets = _getAssetsObject2.assets;
19644
19994
  var isMainNativeAsset = isSymbolMatch(symbol, getNativeAssetSymbol(chain));
19645
- if (isMainNativeAsset) return findNativeAssetInfoOrThrow(chain).decimals;
19995
+ if (isMainNativeAsset) return findNativeAssetInfoOrThrowImpl(chain).decimals;
19646
19996
  var asset = assets.find(function (o) {
19647
19997
  return o.symbol === symbol;
19648
19998
  });
19649
19999
  return (asset === null || asset === void 0 ? void 0 : asset.decimals) !== undefined ? asset.decimals : null;
19650
20000
  };
19651
- var hasDryRunSupport = function hasDryRunSupport(chain) {
20001
+ var hasDryRunSupportImpl = function hasDryRunSupportImpl(chain, ctx) {
19652
20002
  // These chains have DryRun but it's not working
19653
20003
  var DISABLED_CHAINS = ['Basilisk', 'Jamton'];
19654
- return getAssetsObject(chain).supportsDryRunApi && !DISABLED_CHAINS.includes(chain);
20004
+ return getAssetsObjectImpl(chain, ctx).supportsDryRunApi && !DISABLED_CHAINS.some(function (disabled) {
20005
+ return disabled === chain;
20006
+ });
19655
20007
  };
19656
- var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
20008
+ var hasDryRunSupport = function hasDryRunSupport(chain) {
20009
+ return hasDryRunSupportImpl(chain);
20010
+ };
20011
+ var hasXcmPaymentApiSupportImpl = function hasXcmPaymentApiSupportImpl(chain, ctx) {
19657
20012
  // These chains have XcmPaymentApi but it's not working
19658
20013
  var DISABLED_CHAINS = ['Basilisk', 'Jamton'];
19659
- return getAssetsObject(chain).supportsXcmPaymentApi && !DISABLED_CHAINS.includes(chain);
20014
+ return getAssetsObjectImpl(chain, ctx).supportsXcmPaymentApi && !DISABLED_CHAINS.some(function (disabled) {
20015
+ return disabled === chain;
20016
+ });
20017
+ };
20018
+ var hasXcmPaymentApiSupport = function hasXcmPaymentApiSupport(chain) {
20019
+ return hasXcmPaymentApiSupportImpl(chain);
19660
20020
  };
19661
20021
 
19662
20022
  var isAssetEqual = function isAssetEqual(asset1, asset2) {
@@ -19669,16 +20029,9 @@ var isAssetXcEqual = function isAssetXcEqual(asset1, asset2) {
19669
20029
  return isAssetEqual(asset1, asset2);
19670
20030
  };
19671
20031
 
19672
- /**
19673
- * Retrieves the list of assets that are supported for transfers between two specified chains.
19674
- *
19675
- * @param origin - The origin chain.
19676
- * @param destination - The destination chain.
19677
- * @returns An array of assets supported between the origin and destination chains.
19678
- */
19679
- var getSupportedAssets = function getSupportedAssets(origin, destination) {
19680
- var originAssets = getAssets(origin);
19681
- var destinationAssets = getAssets(destination);
20032
+ var getSupportedAssetsImpl = function getSupportedAssetsImpl(origin, destination, ctx) {
20033
+ var originAssets = getAssetsImpl(origin, ctx);
20034
+ var destinationAssets = getAssetsImpl(destination, ctx);
19682
20035
  var supportedAssets = originAssets.filter(function (asset) {
19683
20036
  return destinationAssets.some(function (a) {
19684
20037
  return isAssetXcEqual(a, asset);
@@ -19691,7 +20044,9 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
19691
20044
  return isSystemAsset(asset);
19692
20045
  });
19693
20046
  if (isSubBridge) {
19694
- var nativeSymbols = [origin, destination].map(getNativeAssetSymbol);
20047
+ var nativeSymbols = [origin, destination].map(function (chain) {
20048
+ return getNativeAssetSymbolImpl(chain, ctx);
20049
+ });
19695
20050
  var filteredSystemAssets = systemAssets.filter(function (_ref) {
19696
20051
  var symbol = _ref.symbol;
19697
20052
  return nativeSymbols.includes(symbol);
@@ -19699,11 +20054,26 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
19699
20054
  var stablecoinAssets = findStablecoinAssets(origin);
19700
20055
  return [].concat(_toConsumableArray(filteredSystemAssets), _toConsumableArray(stablecoinAssets));
19701
20056
  } else {
19702
- return [].concat(_toConsumableArray(systemAssets), _toConsumableArray(supportedAssets));
20057
+ // MYTH has two valid locations (native on Mythos, ERC-20 on Ethereum),
20058
+ // so it isn't matched by isAssetXcEqual. Include it explicitly.
20059
+ var mythosNative = origin === 'Mythos' && destination === 'Ethereum' ? originAssets.filter(function (asset) {
20060
+ return asset.symbol === 'MYTH';
20061
+ }) : [];
20062
+ return [].concat(_toConsumableArray(systemAssets), _toConsumableArray(mythosNative), _toConsumableArray(supportedAssets));
19703
20063
  }
19704
20064
  }
19705
20065
  return supportedAssets;
19706
20066
  };
20067
+ /**
20068
+ * Retrieves the list of assets that are supported for transfers between two specified chains.
20069
+ *
20070
+ * @param origin - The origin chain.
20071
+ * @param destination - The destination chain.
20072
+ * @returns An array of assets supported between the origin and destination chains.
20073
+ */
20074
+ var getSupportedAssets = function getSupportedAssets(origin, destination) {
20075
+ return getSupportedAssetsImpl(origin, destination);
20076
+ };
19707
20077
 
19708
20078
  var getSupportedDestinations = function getSupportedDestinations(origin, currency) {
19709
20079
  findAssetInfoOrThrow(origin, currency);
@@ -19730,4 +20100,4 @@ var getSupportedDestinations = function getSupportedDestinations(origin, currenc
19730
20100
  });
19731
20101
  };
19732
20102
 
19733
- export { DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, compareLocations, extractAssetLocation, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoOnDest, findAssetInfoOrThrow, findAssetOnDestOrThrow, findBestMatches, findNativeAssetInfo, findNativeAssetInfoOrThrow, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetLocation, getAssets, getAssetsObject, getEdFromAssetOrThrow, getExistentialDeposit, getExistentialDepositOrThrow, getFeeAssets, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getSupportedDestinations, hasDryRunSupport, hasSupportForAsset, hasXcmPaymentApiSupport, isAssetEqual, isAssetXcEqual, isBridgedSystemAsset, isChainEvm, isOverrideLocationSpecifier, isStableCoinAsset, isSymbolMatch, isSymbolSpecifier, isSystemAsset, isTAsset, normalizeLocation, normalizeSymbol };
20103
+ export { CustomAssetConflictError, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, InvalidCurrencyError, Native, Override, assertEdDefined, canonicalizeLocation, compareLocations, extractAssetLocation, findAssetInfo, findAssetInfoById, findAssetInfoByLoc, findAssetInfoBySymbol, findAssetInfoImpl, findAssetInfoOnDest, findAssetInfoOnDestImpl, findAssetInfoOrThrow, findAssetInfoOrThrowImpl, findAssetOnDestOrThrow, findAssetOnDestOrThrowImpl, findBestMatches, findNativeAssetInfo, findNativeAssetInfoImpl, findNativeAssetInfoOrThrow, findNativeAssetInfoOrThrowImpl, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetLocation, getAssets, getAssetsImpl, getAssetsObject, getAssetsObjectImpl, getEdFromAssetOrThrow, getExistentialDeposit, getExistentialDepositOrThrow, getFeeAssets, getNativeAssetSymbol, getNativeAssetSymbolImpl, getNativeAssets, getNativeAssetsImpl, getOtherAssets, getOtherAssetsImpl, getRelayChainSymbol, getRelayChainSymbolImpl, getSupportedAssets, getSupportedAssetsImpl, getSupportedDestinations, hasDryRunSupport, hasDryRunSupportImpl, hasSupportForAsset, hasXcmPaymentApiSupport, hasXcmPaymentApiSupportImpl, isAssetEqual, isAssetXcEqual, isBridgedSystemAsset, isChainEvm, isChainEvmImpl, isCustomAsset, isOverrideLocationSpecifier, isStableCoinAsset, isSymbolMatch, isSymbolSpecifier, isSystemAsset, isTAsset, normalizeCustomAssets, normalizeLocation, normalizeSymbol };