@paraspell/sdk 6.2.0 → 6.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.cjs +194 -34
- package/dist/index.d.ts +28 -2
- package/dist/index.mjs +194 -35
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -507,11 +507,11 @@ function _toPrimitive(t, r) {
|
|
|
507
507
|
if ("object" != typeof t || !t) return t;
|
|
508
508
|
var e = t[Symbol.toPrimitive];
|
|
509
509
|
if (void 0 !== e) {
|
|
510
|
-
var i = e.call(t, r
|
|
510
|
+
var i = e.call(t, r);
|
|
511
511
|
if ("object" != typeof i) return i;
|
|
512
512
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
513
513
|
}
|
|
514
|
-
return (
|
|
514
|
+
return (String )(t);
|
|
515
515
|
}
|
|
516
516
|
function _toPropertyKey(t) {
|
|
517
517
|
var i = _toPrimitive(t, "string");
|
|
@@ -1133,51 +1133,120 @@ var BifrostPolkadot$3 = {
|
|
|
1133
1133
|
nativeAssetSymbol: "BNC",
|
|
1134
1134
|
nativeAssets: [
|
|
1135
1135
|
{
|
|
1136
|
-
symbol: "
|
|
1137
|
-
decimals:
|
|
1136
|
+
symbol: "vBNC",
|
|
1137
|
+
decimals: 12
|
|
1138
1138
|
},
|
|
1139
1139
|
{
|
|
1140
1140
|
symbol: "BNC",
|
|
1141
1141
|
decimals: 12
|
|
1142
|
+
}
|
|
1143
|
+
],
|
|
1144
|
+
otherAssets: [
|
|
1145
|
+
{
|
|
1146
|
+
assetId: "6",
|
|
1147
|
+
symbol: "IBTC",
|
|
1148
|
+
decimals: 8
|
|
1142
1149
|
},
|
|
1143
1150
|
{
|
|
1144
|
-
|
|
1145
|
-
|
|
1151
|
+
assetId: "8",
|
|
1152
|
+
symbol: "MANTA",
|
|
1153
|
+
decimals: 18
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
assetId: "7",
|
|
1157
|
+
symbol: "INTR",
|
|
1158
|
+
decimals: 10
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
assetId: "13",
|
|
1162
|
+
symbol: "WETH",
|
|
1163
|
+
decimals: 18
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
assetId: "2",
|
|
1167
|
+
symbol: "USDT",
|
|
1168
|
+
decimals: 6
|
|
1146
1169
|
},
|
|
1147
1170
|
{
|
|
1171
|
+
assetId: "5",
|
|
1172
|
+
symbol: "USDC",
|
|
1173
|
+
decimals: 6
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
assetId: "0",
|
|
1148
1177
|
symbol: "DOT",
|
|
1149
1178
|
decimals: 10
|
|
1150
1179
|
},
|
|
1151
1180
|
{
|
|
1152
|
-
|
|
1153
|
-
|
|
1181
|
+
assetId: "1",
|
|
1182
|
+
symbol: "GLMR",
|
|
1183
|
+
decimals: 18
|
|
1154
1184
|
},
|
|
1155
1185
|
{
|
|
1156
|
-
|
|
1186
|
+
assetId: "1",
|
|
1187
|
+
symbol: "vGLMR",
|
|
1188
|
+
decimals: 18
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
assetId: "14",
|
|
1192
|
+
symbol: "WAVE",
|
|
1193
|
+
decimals: 18
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
assetId: "11",
|
|
1197
|
+
symbol: "DED",
|
|
1157
1198
|
decimals: 10
|
|
1158
1199
|
},
|
|
1159
1200
|
{
|
|
1160
|
-
|
|
1161
|
-
|
|
1201
|
+
assetId: "4",
|
|
1202
|
+
symbol: "vFIL",
|
|
1203
|
+
decimals: 18
|
|
1162
1204
|
},
|
|
1163
1205
|
{
|
|
1164
|
-
|
|
1206
|
+
assetId: "9",
|
|
1207
|
+
symbol: "BNCS",
|
|
1165
1208
|
decimals: 12
|
|
1166
1209
|
},
|
|
1167
1210
|
{
|
|
1168
|
-
|
|
1211
|
+
assetId: "10",
|
|
1212
|
+
symbol: "PINK",
|
|
1213
|
+
decimals: 10
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
assetId: "4",
|
|
1217
|
+
symbol: "FIL",
|
|
1218
|
+
decimals: 18
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
assetId: "8",
|
|
1222
|
+
symbol: "vMANTA",
|
|
1223
|
+
decimals: 18
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
assetId: "12",
|
|
1227
|
+
symbol: "PEN",
|
|
1169
1228
|
decimals: 12
|
|
1170
1229
|
},
|
|
1171
1230
|
{
|
|
1172
|
-
|
|
1231
|
+
assetId: "3",
|
|
1232
|
+
symbol: "vASTR",
|
|
1233
|
+
decimals: 18
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
assetId: "0",
|
|
1237
|
+
symbol: "vDOT",
|
|
1173
1238
|
decimals: 10
|
|
1174
1239
|
},
|
|
1175
1240
|
{
|
|
1176
|
-
|
|
1241
|
+
assetId: "3",
|
|
1242
|
+
symbol: "ASTR",
|
|
1177
1243
|
decimals: 18
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
assetId: "0",
|
|
1247
|
+
symbol: "vsDOT",
|
|
1248
|
+
decimals: 10
|
|
1178
1249
|
}
|
|
1179
|
-
],
|
|
1180
|
-
otherAssets: [
|
|
1181
1250
|
]
|
|
1182
1251
|
};
|
|
1183
1252
|
var Bitgreen$3 = {
|
|
@@ -4505,24 +4574,28 @@ var BifrostKusama$3 = {
|
|
|
4505
4574
|
nativeAssetSymbol: "BNC",
|
|
4506
4575
|
nativeAssets: [
|
|
4507
4576
|
{
|
|
4508
|
-
symbol: "
|
|
4577
|
+
symbol: "KSM",
|
|
4509
4578
|
decimals: 12
|
|
4510
4579
|
},
|
|
4511
4580
|
{
|
|
4512
|
-
symbol: "
|
|
4581
|
+
symbol: "RMRK",
|
|
4582
|
+
decimals: 10
|
|
4583
|
+
},
|
|
4584
|
+
{
|
|
4585
|
+
symbol: "vBNC",
|
|
4513
4586
|
decimals: 12
|
|
4514
4587
|
},
|
|
4515
4588
|
{
|
|
4516
|
-
symbol: "
|
|
4517
|
-
decimals:
|
|
4589
|
+
symbol: "vMOVR",
|
|
4590
|
+
decimals: 18
|
|
4518
4591
|
},
|
|
4519
4592
|
{
|
|
4520
|
-
symbol: "
|
|
4593
|
+
symbol: "vKSM",
|
|
4521
4594
|
decimals: 12
|
|
4522
4595
|
},
|
|
4523
4596
|
{
|
|
4524
|
-
symbol: "
|
|
4525
|
-
decimals:
|
|
4597
|
+
symbol: "MOVR",
|
|
4598
|
+
decimals: 18
|
|
4526
4599
|
},
|
|
4527
4600
|
{
|
|
4528
4601
|
symbol: "ZLK",
|
|
@@ -4533,15 +4606,40 @@ var BifrostKusama$3 = {
|
|
|
4533
4606
|
decimals: 12
|
|
4534
4607
|
},
|
|
4535
4608
|
{
|
|
4536
|
-
symbol: "
|
|
4537
|
-
decimals:
|
|
4609
|
+
symbol: "KAR",
|
|
4610
|
+
decimals: 12
|
|
4538
4611
|
},
|
|
4539
4612
|
{
|
|
4540
|
-
symbol: "
|
|
4541
|
-
decimals:
|
|
4613
|
+
symbol: "BNC",
|
|
4614
|
+
decimals: 12
|
|
4542
4615
|
}
|
|
4543
4616
|
],
|
|
4544
4617
|
otherAssets: [
|
|
4618
|
+
{
|
|
4619
|
+
assetId: "2",
|
|
4620
|
+
symbol: "KBTC",
|
|
4621
|
+
decimals: 8
|
|
4622
|
+
},
|
|
4623
|
+
{
|
|
4624
|
+
assetId: "0",
|
|
4625
|
+
symbol: "USDT",
|
|
4626
|
+
decimals: 6
|
|
4627
|
+
},
|
|
4628
|
+
{
|
|
4629
|
+
assetId: "1",
|
|
4630
|
+
symbol: "KINT",
|
|
4631
|
+
decimals: 12
|
|
4632
|
+
},
|
|
4633
|
+
{
|
|
4634
|
+
assetId: "4",
|
|
4635
|
+
symbol: "MGX",
|
|
4636
|
+
decimals: 18
|
|
4637
|
+
},
|
|
4638
|
+
{
|
|
4639
|
+
assetId: "3",
|
|
4640
|
+
symbol: "SDN",
|
|
4641
|
+
decimals: 18
|
|
4642
|
+
}
|
|
4545
4643
|
]
|
|
4546
4644
|
};
|
|
4547
4645
|
var Calamari$3 = {
|
|
@@ -8255,6 +8353,26 @@ var DuplicateAssetError = /*#__PURE__*/function (_Error) {
|
|
|
8255
8353
|
return _createClass(DuplicateAssetError);
|
|
8256
8354
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
8257
8355
|
|
|
8356
|
+
/**
|
|
8357
|
+
* Error thrown when multiple assets with the same symbol are found.
|
|
8358
|
+
*/
|
|
8359
|
+
var DuplicateAssetIdError = /*#__PURE__*/function (_Error) {
|
|
8360
|
+
/**
|
|
8361
|
+
* Constructs a new DuplicateAssetError.
|
|
8362
|
+
*
|
|
8363
|
+
* @param symbol - The symbol of the asset causing the duplication error.
|
|
8364
|
+
*/
|
|
8365
|
+
function DuplicateAssetIdError(id) {
|
|
8366
|
+
var _this;
|
|
8367
|
+
_classCallCheck(this, DuplicateAssetIdError);
|
|
8368
|
+
_this = _callSuper(this, DuplicateAssetIdError, ["Multiple assets found with the same ID: ".concat(id, ". Please specify asset directly by symbol using .currency({symbol: <ASSET_SYMBOL>})")]);
|
|
8369
|
+
_this.name = 'DuplicateAssetId';
|
|
8370
|
+
return _this;
|
|
8371
|
+
}
|
|
8372
|
+
_inherits(DuplicateAssetIdError, _Error);
|
|
8373
|
+
return _createClass(DuplicateAssetIdError);
|
|
8374
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
8375
|
+
|
|
8258
8376
|
var supportsXTokens = function supportsXTokens(obj) {
|
|
8259
8377
|
return _typeof(obj) === 'object' && obj !== null && 'transferXTokens' in obj;
|
|
8260
8378
|
};
|
|
@@ -8598,9 +8716,44 @@ var BifrostPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8598
8716
|
}
|
|
8599
8717
|
_inherits(BifrostPolkadot, _ParachainNode);
|
|
8600
8718
|
return _createClass(BifrostPolkadot, [{
|
|
8719
|
+
key: "getCurrencySelection",
|
|
8720
|
+
value: function getCurrencySelection(currency, currencyId) {
|
|
8721
|
+
var nativeAssetSymbol = this.getNativeAssetSymbol();
|
|
8722
|
+
if (currency === nativeAssetSymbol) {
|
|
8723
|
+
return {
|
|
8724
|
+
Native: nativeAssetSymbol
|
|
8725
|
+
};
|
|
8726
|
+
}
|
|
8727
|
+
var isVToken = currency.startsWith('v');
|
|
8728
|
+
var isVSToken = currency.startsWith('vs');
|
|
8729
|
+
if (!currencyId) {
|
|
8730
|
+
return isVToken ? {
|
|
8731
|
+
VToken: currency.substring(1)
|
|
8732
|
+
} : {
|
|
8733
|
+
Token: currency
|
|
8734
|
+
};
|
|
8735
|
+
}
|
|
8736
|
+
var id = Number(currencyId);
|
|
8737
|
+
if (isVSToken) {
|
|
8738
|
+
return {
|
|
8739
|
+
VSToken2: id
|
|
8740
|
+
};
|
|
8741
|
+
}
|
|
8742
|
+
return isVToken ? {
|
|
8743
|
+
VToken2: id
|
|
8744
|
+
} : {
|
|
8745
|
+
Token2: id
|
|
8746
|
+
};
|
|
8747
|
+
}
|
|
8748
|
+
}, {
|
|
8601
8749
|
key: "transferXTokens",
|
|
8602
8750
|
value: function transferXTokens(input) {
|
|
8603
|
-
var
|
|
8751
|
+
var currency = input.currency,
|
|
8752
|
+
currencyID = input.currencyID;
|
|
8753
|
+
if (!currency) {
|
|
8754
|
+
throw new Error('Currency symbol is undefined');
|
|
8755
|
+
}
|
|
8756
|
+
var currencySelection = this.getCurrencySelection(currency, currencyID);
|
|
8604
8757
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
8605
8758
|
}
|
|
8606
8759
|
}]);
|
|
@@ -8845,8 +8998,7 @@ var BifrostKusama$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8845
8998
|
return _createClass(BifrostKusama, [{
|
|
8846
8999
|
key: "transferXTokens",
|
|
8847
9000
|
value: function transferXTokens(input) {
|
|
8848
|
-
|
|
8849
|
-
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9001
|
+
return getNode('BifrostPolkadot').transferXTokens(input);
|
|
8850
9002
|
}
|
|
8851
9003
|
}]);
|
|
8852
9004
|
}(ParachainNode);
|
|
@@ -10741,13 +10893,20 @@ var findAssetBySymbol = function findAssetBySymbol(node, destination, otherAsset
|
|
|
10741
10893
|
}
|
|
10742
10894
|
return otherAssetsMatches[0] || nativeAssetsMatches[0] || null;
|
|
10743
10895
|
};
|
|
10744
|
-
|
|
10745
10896
|
var findAssetById = function findAssetById(assets, assetId) {
|
|
10746
|
-
|
|
10747
|
-
var currentAssetId =
|
|
10897
|
+
var otherAssetsMatches = assets.filter(function (_ref4) {
|
|
10898
|
+
var currentAssetId = _ref4.assetId;
|
|
10748
10899
|
return currentAssetId === assetId.toString();
|
|
10749
10900
|
});
|
|
10901
|
+
if (otherAssetsMatches.length > 1) {
|
|
10902
|
+
throw new DuplicateAssetIdError(assetId.toString());
|
|
10903
|
+
}
|
|
10904
|
+
return assets.find(function (_ref5) {
|
|
10905
|
+
var currentAssetId = _ref5.assetId;
|
|
10906
|
+
return currentAssetId === assetId;
|
|
10907
|
+
});
|
|
10750
10908
|
};
|
|
10909
|
+
|
|
10751
10910
|
var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency) {
|
|
10752
10911
|
var isRelayDestination = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
10753
10912
|
var destination = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -13649,6 +13808,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
13649
13808
|
|
|
13650
13809
|
exports.Builder = Builder;
|
|
13651
13810
|
exports.DuplicateAssetError = DuplicateAssetError;
|
|
13811
|
+
exports.DuplicateAssetIdError = DuplicateAssetIdError;
|
|
13652
13812
|
exports.EvmBuilder = EvmBuilder;
|
|
13653
13813
|
exports.GeneralBuilder = GeneralBuilder;
|
|
13654
13814
|
exports.IncompatibleNodesError = IncompatibleNodesError;
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ declare class Crust extends ParachainNode implements IXTokensTransfer {
|
|
|
44
44
|
|
|
45
45
|
declare class BifrostPolkadot extends ParachainNode implements IXTokensTransfer {
|
|
46
46
|
constructor();
|
|
47
|
+
private getCurrencySelection;
|
|
47
48
|
transferXTokens(input: XTokensTransferInput): TTransferReturn;
|
|
48
49
|
}
|
|
49
50
|
|
|
@@ -307,7 +308,20 @@ type TOtherReserveAsset = {
|
|
|
307
308
|
};
|
|
308
309
|
type TSelfReserveAsset = 'SelfReserve';
|
|
309
310
|
type TReserveAsset = TOtherReserveAsset | TSelfReserveAsset;
|
|
310
|
-
type
|
|
311
|
+
type TBifrostToken = {
|
|
312
|
+
Native: string;
|
|
313
|
+
} | {
|
|
314
|
+
VToken: string;
|
|
315
|
+
} | {
|
|
316
|
+
Token: string;
|
|
317
|
+
} | {
|
|
318
|
+
VSToken2: number;
|
|
319
|
+
} | {
|
|
320
|
+
VToken2: number;
|
|
321
|
+
} | {
|
|
322
|
+
Token2: number;
|
|
323
|
+
};
|
|
324
|
+
type TXTokensCurrencySelection = TCurrencySelectionHeader | TCurrencySelectionHeaderArr | TForeignAsset | TForeignAssetId | TForeignOrTokenAsset | TXcmAsset | TMantaAsset | TOtherReserveAsset | TBifrostToken | string | undefined;
|
|
311
325
|
|
|
312
326
|
interface IPolkadotApi<TApi extends TApiType, TRes extends TResType> {
|
|
313
327
|
init(api: TApi): void;
|
|
@@ -1488,4 +1502,16 @@ declare class DuplicateAssetError extends Error {
|
|
|
1488
1502
|
constructor(symbol: string);
|
|
1489
1503
|
}
|
|
1490
1504
|
|
|
1491
|
-
|
|
1505
|
+
/**
|
|
1506
|
+
* Error thrown when multiple assets with the same symbol are found.
|
|
1507
|
+
*/
|
|
1508
|
+
declare class DuplicateAssetIdError extends Error {
|
|
1509
|
+
/**
|
|
1510
|
+
* Constructs a new DuplicateAssetError.
|
|
1511
|
+
*
|
|
1512
|
+
* @param symbol - The symbol of the asset causing the duplication error.
|
|
1513
|
+
*/
|
|
1514
|
+
constructor(id: string);
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
export { BatchMode, Builder, type CheckKeepAliveOptions, DuplicateAssetError, DuplicateAssetIdError, EvmBuilder, type Extrinsic, GeneralBuilder, type HexString$1 as HexString, type IPolkadotXCMTransfer, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidCurrencyError, type JunctionParachain, type JunctionType, type Junctions, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, type PolkadotXCMTransferInput, type PolkadotXcmModule, type PolkadotXcmSection, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiType, type TAsset, type TAssetDetails, type TAssetJsonMap, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyInput, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TDestWeight, type TDestination, type TEdJsonMap, type TEvmBuilderOptions, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TJunction, type TMantaAsset, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiLocation, type TMultiLocationHeader, type TNativeAssetDetails, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TPallet, type TPalletJsonMap, type TPalletMap, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaCommonOptions, type TRelayToParaInternalOptions, type TRelayToParaOptions, type TResType, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSendOptionsCommon, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TTransferInfo, type TTransferReturn, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXcmAsset, type TZeitgeistAsset, type UseKeepAliveFinalBuilder, Version, type XTokensModule, type XTokensSection, type XTokensTransferInput, type XTransferModule, type XTransferSection, type XTransferTransferInput, index as assets, buildEthTransferOptions, createApiInstanceForNode, determineRelayChain, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isRelayChain, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index$1 as xcmPallet };
|
package/dist/index.mjs
CHANGED
|
@@ -505,11 +505,11 @@ function _toPrimitive(t, r) {
|
|
|
505
505
|
if ("object" != typeof t || !t) return t;
|
|
506
506
|
var e = t[Symbol.toPrimitive];
|
|
507
507
|
if (void 0 !== e) {
|
|
508
|
-
var i = e.call(t, r
|
|
508
|
+
var i = e.call(t, r);
|
|
509
509
|
if ("object" != typeof i) return i;
|
|
510
510
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
511
511
|
}
|
|
512
|
-
return (
|
|
512
|
+
return (String )(t);
|
|
513
513
|
}
|
|
514
514
|
function _toPropertyKey(t) {
|
|
515
515
|
var i = _toPrimitive(t, "string");
|
|
@@ -1131,51 +1131,120 @@ var BifrostPolkadot$3 = {
|
|
|
1131
1131
|
nativeAssetSymbol: "BNC",
|
|
1132
1132
|
nativeAssets: [
|
|
1133
1133
|
{
|
|
1134
|
-
symbol: "
|
|
1135
|
-
decimals:
|
|
1134
|
+
symbol: "vBNC",
|
|
1135
|
+
decimals: 12
|
|
1136
1136
|
},
|
|
1137
1137
|
{
|
|
1138
1138
|
symbol: "BNC",
|
|
1139
1139
|
decimals: 12
|
|
1140
|
+
}
|
|
1141
|
+
],
|
|
1142
|
+
otherAssets: [
|
|
1143
|
+
{
|
|
1144
|
+
assetId: "6",
|
|
1145
|
+
symbol: "IBTC",
|
|
1146
|
+
decimals: 8
|
|
1140
1147
|
},
|
|
1141
1148
|
{
|
|
1142
|
-
|
|
1143
|
-
|
|
1149
|
+
assetId: "8",
|
|
1150
|
+
symbol: "MANTA",
|
|
1151
|
+
decimals: 18
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
assetId: "7",
|
|
1155
|
+
symbol: "INTR",
|
|
1156
|
+
decimals: 10
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
assetId: "13",
|
|
1160
|
+
symbol: "WETH",
|
|
1161
|
+
decimals: 18
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
assetId: "2",
|
|
1165
|
+
symbol: "USDT",
|
|
1166
|
+
decimals: 6
|
|
1144
1167
|
},
|
|
1145
1168
|
{
|
|
1169
|
+
assetId: "5",
|
|
1170
|
+
symbol: "USDC",
|
|
1171
|
+
decimals: 6
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
assetId: "0",
|
|
1146
1175
|
symbol: "DOT",
|
|
1147
1176
|
decimals: 10
|
|
1148
1177
|
},
|
|
1149
1178
|
{
|
|
1150
|
-
|
|
1151
|
-
|
|
1179
|
+
assetId: "1",
|
|
1180
|
+
symbol: "GLMR",
|
|
1181
|
+
decimals: 18
|
|
1152
1182
|
},
|
|
1153
1183
|
{
|
|
1154
|
-
|
|
1184
|
+
assetId: "1",
|
|
1185
|
+
symbol: "vGLMR",
|
|
1186
|
+
decimals: 18
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
assetId: "14",
|
|
1190
|
+
symbol: "WAVE",
|
|
1191
|
+
decimals: 18
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
assetId: "11",
|
|
1195
|
+
symbol: "DED",
|
|
1155
1196
|
decimals: 10
|
|
1156
1197
|
},
|
|
1157
1198
|
{
|
|
1158
|
-
|
|
1159
|
-
|
|
1199
|
+
assetId: "4",
|
|
1200
|
+
symbol: "vFIL",
|
|
1201
|
+
decimals: 18
|
|
1160
1202
|
},
|
|
1161
1203
|
{
|
|
1162
|
-
|
|
1204
|
+
assetId: "9",
|
|
1205
|
+
symbol: "BNCS",
|
|
1163
1206
|
decimals: 12
|
|
1164
1207
|
},
|
|
1165
1208
|
{
|
|
1166
|
-
|
|
1209
|
+
assetId: "10",
|
|
1210
|
+
symbol: "PINK",
|
|
1211
|
+
decimals: 10
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
assetId: "4",
|
|
1215
|
+
symbol: "FIL",
|
|
1216
|
+
decimals: 18
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
assetId: "8",
|
|
1220
|
+
symbol: "vMANTA",
|
|
1221
|
+
decimals: 18
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
assetId: "12",
|
|
1225
|
+
symbol: "PEN",
|
|
1167
1226
|
decimals: 12
|
|
1168
1227
|
},
|
|
1169
1228
|
{
|
|
1170
|
-
|
|
1229
|
+
assetId: "3",
|
|
1230
|
+
symbol: "vASTR",
|
|
1231
|
+
decimals: 18
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
assetId: "0",
|
|
1235
|
+
symbol: "vDOT",
|
|
1171
1236
|
decimals: 10
|
|
1172
1237
|
},
|
|
1173
1238
|
{
|
|
1174
|
-
|
|
1239
|
+
assetId: "3",
|
|
1240
|
+
symbol: "ASTR",
|
|
1175
1241
|
decimals: 18
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
assetId: "0",
|
|
1245
|
+
symbol: "vsDOT",
|
|
1246
|
+
decimals: 10
|
|
1176
1247
|
}
|
|
1177
|
-
],
|
|
1178
|
-
otherAssets: [
|
|
1179
1248
|
]
|
|
1180
1249
|
};
|
|
1181
1250
|
var Bitgreen$3 = {
|
|
@@ -4503,24 +4572,28 @@ var BifrostKusama$3 = {
|
|
|
4503
4572
|
nativeAssetSymbol: "BNC",
|
|
4504
4573
|
nativeAssets: [
|
|
4505
4574
|
{
|
|
4506
|
-
symbol: "
|
|
4575
|
+
symbol: "KSM",
|
|
4507
4576
|
decimals: 12
|
|
4508
4577
|
},
|
|
4509
4578
|
{
|
|
4510
|
-
symbol: "
|
|
4579
|
+
symbol: "RMRK",
|
|
4580
|
+
decimals: 10
|
|
4581
|
+
},
|
|
4582
|
+
{
|
|
4583
|
+
symbol: "vBNC",
|
|
4511
4584
|
decimals: 12
|
|
4512
4585
|
},
|
|
4513
4586
|
{
|
|
4514
|
-
symbol: "
|
|
4515
|
-
decimals:
|
|
4587
|
+
symbol: "vMOVR",
|
|
4588
|
+
decimals: 18
|
|
4516
4589
|
},
|
|
4517
4590
|
{
|
|
4518
|
-
symbol: "
|
|
4591
|
+
symbol: "vKSM",
|
|
4519
4592
|
decimals: 12
|
|
4520
4593
|
},
|
|
4521
4594
|
{
|
|
4522
|
-
symbol: "
|
|
4523
|
-
decimals:
|
|
4595
|
+
symbol: "MOVR",
|
|
4596
|
+
decimals: 18
|
|
4524
4597
|
},
|
|
4525
4598
|
{
|
|
4526
4599
|
symbol: "ZLK",
|
|
@@ -4531,15 +4604,40 @@ var BifrostKusama$3 = {
|
|
|
4531
4604
|
decimals: 12
|
|
4532
4605
|
},
|
|
4533
4606
|
{
|
|
4534
|
-
symbol: "
|
|
4535
|
-
decimals:
|
|
4607
|
+
symbol: "KAR",
|
|
4608
|
+
decimals: 12
|
|
4536
4609
|
},
|
|
4537
4610
|
{
|
|
4538
|
-
symbol: "
|
|
4539
|
-
decimals:
|
|
4611
|
+
symbol: "BNC",
|
|
4612
|
+
decimals: 12
|
|
4540
4613
|
}
|
|
4541
4614
|
],
|
|
4542
4615
|
otherAssets: [
|
|
4616
|
+
{
|
|
4617
|
+
assetId: "2",
|
|
4618
|
+
symbol: "KBTC",
|
|
4619
|
+
decimals: 8
|
|
4620
|
+
},
|
|
4621
|
+
{
|
|
4622
|
+
assetId: "0",
|
|
4623
|
+
symbol: "USDT",
|
|
4624
|
+
decimals: 6
|
|
4625
|
+
},
|
|
4626
|
+
{
|
|
4627
|
+
assetId: "1",
|
|
4628
|
+
symbol: "KINT",
|
|
4629
|
+
decimals: 12
|
|
4630
|
+
},
|
|
4631
|
+
{
|
|
4632
|
+
assetId: "4",
|
|
4633
|
+
symbol: "MGX",
|
|
4634
|
+
decimals: 18
|
|
4635
|
+
},
|
|
4636
|
+
{
|
|
4637
|
+
assetId: "3",
|
|
4638
|
+
symbol: "SDN",
|
|
4639
|
+
decimals: 18
|
|
4640
|
+
}
|
|
4543
4641
|
]
|
|
4544
4642
|
};
|
|
4545
4643
|
var Calamari$3 = {
|
|
@@ -8253,6 +8351,26 @@ var DuplicateAssetError = /*#__PURE__*/function (_Error) {
|
|
|
8253
8351
|
return _createClass(DuplicateAssetError);
|
|
8254
8352
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
8255
8353
|
|
|
8354
|
+
/**
|
|
8355
|
+
* Error thrown when multiple assets with the same symbol are found.
|
|
8356
|
+
*/
|
|
8357
|
+
var DuplicateAssetIdError = /*#__PURE__*/function (_Error) {
|
|
8358
|
+
/**
|
|
8359
|
+
* Constructs a new DuplicateAssetError.
|
|
8360
|
+
*
|
|
8361
|
+
* @param symbol - The symbol of the asset causing the duplication error.
|
|
8362
|
+
*/
|
|
8363
|
+
function DuplicateAssetIdError(id) {
|
|
8364
|
+
var _this;
|
|
8365
|
+
_classCallCheck(this, DuplicateAssetIdError);
|
|
8366
|
+
_this = _callSuper(this, DuplicateAssetIdError, ["Multiple assets found with the same ID: ".concat(id, ". Please specify asset directly by symbol using .currency({symbol: <ASSET_SYMBOL>})")]);
|
|
8367
|
+
_this.name = 'DuplicateAssetId';
|
|
8368
|
+
return _this;
|
|
8369
|
+
}
|
|
8370
|
+
_inherits(DuplicateAssetIdError, _Error);
|
|
8371
|
+
return _createClass(DuplicateAssetIdError);
|
|
8372
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
8373
|
+
|
|
8256
8374
|
var supportsXTokens = function supportsXTokens(obj) {
|
|
8257
8375
|
return _typeof(obj) === 'object' && obj !== null && 'transferXTokens' in obj;
|
|
8258
8376
|
};
|
|
@@ -8596,9 +8714,44 @@ var BifrostPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8596
8714
|
}
|
|
8597
8715
|
_inherits(BifrostPolkadot, _ParachainNode);
|
|
8598
8716
|
return _createClass(BifrostPolkadot, [{
|
|
8717
|
+
key: "getCurrencySelection",
|
|
8718
|
+
value: function getCurrencySelection(currency, currencyId) {
|
|
8719
|
+
var nativeAssetSymbol = this.getNativeAssetSymbol();
|
|
8720
|
+
if (currency === nativeAssetSymbol) {
|
|
8721
|
+
return {
|
|
8722
|
+
Native: nativeAssetSymbol
|
|
8723
|
+
};
|
|
8724
|
+
}
|
|
8725
|
+
var isVToken = currency.startsWith('v');
|
|
8726
|
+
var isVSToken = currency.startsWith('vs');
|
|
8727
|
+
if (!currencyId) {
|
|
8728
|
+
return isVToken ? {
|
|
8729
|
+
VToken: currency.substring(1)
|
|
8730
|
+
} : {
|
|
8731
|
+
Token: currency
|
|
8732
|
+
};
|
|
8733
|
+
}
|
|
8734
|
+
var id = Number(currencyId);
|
|
8735
|
+
if (isVSToken) {
|
|
8736
|
+
return {
|
|
8737
|
+
VSToken2: id
|
|
8738
|
+
};
|
|
8739
|
+
}
|
|
8740
|
+
return isVToken ? {
|
|
8741
|
+
VToken2: id
|
|
8742
|
+
} : {
|
|
8743
|
+
Token2: id
|
|
8744
|
+
};
|
|
8745
|
+
}
|
|
8746
|
+
}, {
|
|
8599
8747
|
key: "transferXTokens",
|
|
8600
8748
|
value: function transferXTokens(input) {
|
|
8601
|
-
var
|
|
8749
|
+
var currency = input.currency,
|
|
8750
|
+
currencyID = input.currencyID;
|
|
8751
|
+
if (!currency) {
|
|
8752
|
+
throw new Error('Currency symbol is undefined');
|
|
8753
|
+
}
|
|
8754
|
+
var currencySelection = this.getCurrencySelection(currency, currencyID);
|
|
8602
8755
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
8603
8756
|
}
|
|
8604
8757
|
}]);
|
|
@@ -8843,8 +8996,7 @@ var BifrostKusama$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
8843
8996
|
return _createClass(BifrostKusama, [{
|
|
8844
8997
|
key: "transferXTokens",
|
|
8845
8998
|
value: function transferXTokens(input) {
|
|
8846
|
-
|
|
8847
|
-
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
8999
|
+
return getNode('BifrostPolkadot').transferXTokens(input);
|
|
8848
9000
|
}
|
|
8849
9001
|
}]);
|
|
8850
9002
|
}(ParachainNode);
|
|
@@ -10739,13 +10891,20 @@ var findAssetBySymbol = function findAssetBySymbol(node, destination, otherAsset
|
|
|
10739
10891
|
}
|
|
10740
10892
|
return otherAssetsMatches[0] || nativeAssetsMatches[0] || null;
|
|
10741
10893
|
};
|
|
10742
|
-
|
|
10743
10894
|
var findAssetById = function findAssetById(assets, assetId) {
|
|
10744
|
-
|
|
10745
|
-
var currentAssetId =
|
|
10895
|
+
var otherAssetsMatches = assets.filter(function (_ref4) {
|
|
10896
|
+
var currentAssetId = _ref4.assetId;
|
|
10746
10897
|
return currentAssetId === assetId.toString();
|
|
10747
10898
|
});
|
|
10899
|
+
if (otherAssetsMatches.length > 1) {
|
|
10900
|
+
throw new DuplicateAssetIdError(assetId.toString());
|
|
10901
|
+
}
|
|
10902
|
+
return assets.find(function (_ref5) {
|
|
10903
|
+
var currentAssetId = _ref5.assetId;
|
|
10904
|
+
return currentAssetId === assetId;
|
|
10905
|
+
});
|
|
10748
10906
|
};
|
|
10907
|
+
|
|
10749
10908
|
var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency) {
|
|
10750
10909
|
var isRelayDestination = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
10751
10910
|
var destination = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -13645,4 +13804,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
13645
13804
|
transferRelayToParaSerializedApiCall: transferRelayToParaSerializedApiCall
|
|
13646
13805
|
});
|
|
13647
13806
|
|
|
13648
|
-
export { BatchMode, Builder, DuplicateAssetError, EvmBuilder, GeneralBuilder, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, index$1 as assets, buildEthTransferOptions, createApiInstanceForNode, determineRelayChain, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit$1 as getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isRelayChain, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index as xcmPallet };
|
|
13807
|
+
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, EvmBuilder, GeneralBuilder, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, index$1 as assets, buildEthTransferOptions, createApiInstanceForNode, determineRelayChain, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit$1 as getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isRelayChain, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index as xcmPallet };
|