@paraspell/sdk-core 13.0.0-rc.1 → 13.0.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +100 -87
  2. package/dist/index.mjs +2102 -2059
  3. package/package.json +6 -6
package/dist/index.mjs CHANGED
@@ -446,6 +446,21 @@ var AmountTooLowError = /*#__PURE__*/function (_Error) {
446
446
  return _createClass(AmountTooLowError);
447
447
  }(/*#__PURE__*/_wrapNativeSuper(Error));
448
448
 
449
+ /**
450
+ * Error thrown when an API operation is attempted before the API has been initialized.
451
+ */
452
+ var ApiNotInitializedError = /*#__PURE__*/function (_Error) {
453
+ function ApiNotInitializedError() {
454
+ var _this;
455
+ _classCallCheck(this, ApiNotInitializedError);
456
+ _this = _callSuper(this, ApiNotInitializedError, ['API is not initialized. Please call init() before using this method.']);
457
+ _this.name = 'ApiNotInitializedError';
458
+ return _this;
459
+ }
460
+ _inherits(ApiNotInitializedError, _Error);
461
+ return _createClass(ApiNotInitializedError);
462
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
463
+
449
464
  /**
450
465
  * Error thrown when a batch operation is invalid or cannot be executed.
451
466
  */
@@ -931,2303 +946,2318 @@ var createClientPoolHelpers = function createClientPoolHelpers(clientPool, creat
931
946
  };
932
947
  };
933
948
 
934
- var AssetHubPolkadot$1 = {
935
- name: "Asset Hub",
936
- info: "PolkadotAssetHub",
937
- paraId: 1000,
938
- providers: [
939
- {
940
- name: "Dwellir",
941
- endpoint: "wss://asset-hub-polkadot-rpc.n.dwellir.com"
942
- },
943
- {
944
- name: "Dwellir Tunisia",
945
- endpoint: "wss://statemint-rpc-tn.dwellir.com"
946
- },
947
- {
948
- name: "IBP1",
949
- endpoint: "wss://asset-hub-polkadot.ibp.network"
950
- },
951
- {
952
- name: "IBP2",
953
- endpoint: "wss://asset-hub-polkadot.dotters.network"
954
- },
955
- {
956
- name: "LuckyFriday",
957
- endpoint: "wss://rpc-asset-hub-polkadot.luckyfriday.io"
958
- },
959
- {
960
- name: "OnFinality",
961
- endpoint: "wss://statemint.api.onfinality.io/public-ws"
962
- },
963
- {
964
- name: "Parity",
965
- endpoint: "wss://polkadot-asset-hub-rpc.polkadot.io"
966
- },
967
- {
968
- name: "RadiumBlock",
969
- endpoint: "wss://statemint.public.curie.radiumblock.co/ws"
970
- }
971
- ]
949
+ // PayFees instruction is removed temporarily in favor of BuyExecution everywhere,
950
+ // but we keep this function for now in case we need to add it back in the future
951
+ var createPayFees = function createPayFees(_version, asset, weight) {
952
+ return [{
953
+ BuyExecution: {
954
+ fees: asset,
955
+ weight_limit: weight ? {
956
+ Limited: {
957
+ ref_time: weight.refTime,
958
+ proof_size: weight.proofSize
959
+ }
960
+ } : 'Unlimited'
961
+ }
962
+ }];
972
963
  };
973
- var Acala$1 = {
974
- name: "Acala",
975
- info: "acala",
976
- paraId: 2000,
977
- providers: [
978
- {
979
- name: "Acala Foundation 0",
980
- endpoint: "wss://acala-rpc-0.aca-api.network"
981
- },
982
- {
983
- name: "Acala Foundation 1",
984
- endpoint: "wss://acala-rpc-1.aca-api.network"
985
- },
986
- {
987
- name: "Acala Foundation 3",
988
- endpoint: "wss://acala-rpc-3.aca-api.network/ws"
989
- },
990
- {
991
- name: "Dwellir",
992
- endpoint: "wss://acala-rpc.n.dwellir.com"
993
- },
994
- {
995
- name: "IBP1",
996
- endpoint: "wss://acala.ibp.network"
997
- },
998
- {
999
- name: "IBP2",
1000
- endpoint: "wss://acala.dotters.network"
1001
- }
1002
- ]
964
+
965
+ var resolveTx = /*#__PURE__*/function () {
966
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(destApi, _ref) {
967
+ var call;
968
+ return _regenerator().w(function (_context) {
969
+ while (1) switch (_context.n) {
970
+ case 0:
971
+ call = _ref.call;
972
+ if (!(typeof call !== 'string')) {
973
+ _context.n = 1;
974
+ break;
975
+ }
976
+ return _context.a(2, call);
977
+ case 1:
978
+ return _context.a(2, destApi.txFromHex(call));
979
+ }
980
+ }, _callee);
981
+ }));
982
+ return function resolveTx(_x, _x2) {
983
+ return _ref2.apply(this, arguments);
984
+ };
985
+ }();
986
+ var resolveMaxWeight = /*#__PURE__*/function () {
987
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(api, version, destChain, address, options) {
988
+ var maxWeight, destApi, tx, _yield$destApi$getPay, weight;
989
+ return _regenerator().w(function (_context2) {
990
+ while (1) switch (_context2.n) {
991
+ case 0:
992
+ maxWeight = options.maxWeight;
993
+ if (!maxWeight) {
994
+ _context2.n = 1;
995
+ break;
996
+ }
997
+ return _context2.a(2, maxWeight);
998
+ case 1:
999
+ if (!(version < Version.V5)) {
1000
+ _context2.n = 5;
1001
+ break;
1002
+ }
1003
+ destApi = api.clone();
1004
+ _context2.n = 2;
1005
+ return destApi.init(destChain);
1006
+ case 2:
1007
+ _context2.n = 3;
1008
+ return resolveTx(destApi, options);
1009
+ case 3:
1010
+ tx = _context2.v;
1011
+ _context2.n = 4;
1012
+ return destApi.getPaymentInfo(tx, address);
1013
+ case 4:
1014
+ _yield$destApi$getPay = _context2.v;
1015
+ weight = _yield$destApi$getPay.weight;
1016
+ return _context2.a(2, weight);
1017
+ case 5:
1018
+ return _context2.a(2, undefined);
1019
+ }
1020
+ }, _callee2);
1021
+ }));
1022
+ return function resolveMaxWeight(_x3, _x4, _x5, _x6, _x7) {
1023
+ return _ref3.apply(this, arguments);
1024
+ };
1025
+ }();
1026
+ var convertWeight = function convertWeight(weight) {
1027
+ if (weight) return {
1028
+ ref_time: weight.refTime,
1029
+ proof_size: weight.proofSize
1030
+ };
1031
+ return undefined;
1003
1032
  };
1004
- var Ajuna$1 = {
1005
- name: "Ajuna Network",
1006
- info: "ajuna",
1007
- paraId: 2051,
1008
- providers: [
1009
- {
1010
- name: "AjunaNetwork",
1011
- endpoint: "wss://rpc-para.ajuna.network"
1012
- },
1013
- {
1014
- name: "IBP1",
1015
- endpoint: "wss://ajuna.ibp.network"
1016
- },
1017
- {
1018
- name: "IBP2",
1019
- endpoint: "wss://ajuna.dotters.network"
1020
- }
1021
- ]
1033
+ var createTransactInstructions = /*#__PURE__*/function () {
1034
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(api, options, version, destChain, address) {
1035
+ var call, originKind, weightKey, weight;
1036
+ return _regenerator().w(function (_context3) {
1037
+ while (1) switch (_context3.n) {
1038
+ case 0:
1039
+ call = options.call, originKind = options.originKind;
1040
+ weightKey = version < Version.V5 ? 'require_weight_at_most' : 'fallback_max_weight';
1041
+ _context3.n = 1;
1042
+ return resolveMaxWeight(api, version, destChain, address, options);
1043
+ case 1:
1044
+ weight = _context3.v;
1045
+ return _context3.a(2, [{
1046
+ Transact: _defineProperty(_defineProperty({
1047
+ origin_kind: originKind !== null && originKind !== void 0 ? originKind : 'SovereignAccount'
1048
+ }, weightKey, convertWeight(weight)), "call", call)
1049
+ }, {
1050
+ ExpectTransactStatus: {
1051
+ Success: undefined
1052
+ }
1053
+ }]);
1054
+ }
1055
+ }, _callee3);
1056
+ }));
1057
+ return function createTransactInstructions(_x8, _x9, _x0, _x1, _x10) {
1058
+ return _ref4.apply(this, arguments);
1059
+ };
1060
+ }();
1061
+
1062
+ var compareAddresses = function compareAddresses(api, addr1, addr2) {
1063
+ var hex1 = api.accountToHex(addr1);
1064
+ var hex2 = api.accountToHex(addr2);
1065
+ return hex1 === hex2;
1022
1066
  };
1023
- var Astar$1 = {
1024
- name: "Astar",
1025
- info: "astar",
1026
- paraId: 2006,
1027
- providers: [
1028
- {
1029
- name: "Astar",
1030
- endpoint: "wss://rpc.astar.network"
1031
- },
1032
- {
1033
- name: "Dwellir",
1034
- endpoint: "wss://astar-rpc.n.dwellir.com"
1035
- },
1036
- {
1037
- name: "OnFinality",
1038
- endpoint: "wss://astar.api.onfinality.io/public-ws"
1039
- },
1040
- {
1041
- name: "RadiumBlock",
1042
- endpoint: "wss://astar.public.curie.radiumblock.co/ws"
1043
- }
1044
- ]
1067
+
1068
+ var validateAddress = function validateAddress(api, address, chain) {
1069
+ var isDestination = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
1070
+ if (isTLocation(address)) return;
1071
+ var isEvm = isChainEvm(chain);
1072
+ var isEthereumAddress = isAddress(address);
1073
+ var isPublicKeyFormat = typeof address === 'string' && address.startsWith('0x') && !isEthereumAddress;
1074
+ if (isEvm) {
1075
+ if (!isEthereumAddress) {
1076
+ throw new InvalidAddressError("".concat(isDestination ? 'Destination chain' : 'Chain', " is an EVM chain, but the address provided is not a valid Ethereum address."));
1077
+ }
1078
+ } else {
1079
+ if (isEthereumAddress) {
1080
+ throw new InvalidAddressError("EVM address provided but ".concat(isDestination ? 'destination ' : '', "chain is not an EVM chain."));
1081
+ }
1082
+ if (isPublicKeyFormat) {
1083
+ return;
1084
+ }
1085
+ if (typeof address === 'string') {
1086
+ var isValid = api.validateSubstrateAddress(address);
1087
+ if (!isValid) {
1088
+ throw new InvalidAddressError("Invalid address: ".concat(address));
1089
+ }
1090
+ }
1091
+ }
1045
1092
  };
1046
- var BifrostPolkadot$1 = {
1047
- name: "Bifrost",
1048
- info: "bifrost",
1049
- paraId: 2030,
1050
- providers: [
1051
- {
1052
- name: "IBP1",
1053
- endpoint: "wss://bifrost-polkadot.ibp.network"
1054
- },
1055
- {
1056
- name: "IBP2",
1057
- endpoint: "wss://bifrost-polkadot.dotters.network"
1058
- },
1059
- {
1060
- name: "Liebi",
1061
- endpoint: "wss://hk.p.bifrost-rpc.liebi.com/ws"
1062
- },
1063
- {
1064
- name: "LiebiEU",
1065
- endpoint: "wss://eu.bifrost-polkadot-rpc.liebi.com/ws"
1066
- }
1067
- ]
1068
- };
1069
- var BridgeHubPolkadot$1 = {
1070
- name: "Bridge Hub",
1071
- info: "polkadotBridgeHub",
1072
- paraId: 1002,
1073
- providers: [
1074
- {
1075
- name: "Dwellir",
1076
- endpoint: "wss://bridge-hub-polkadot-rpc.n.dwellir.com"
1077
- },
1078
- {
1079
- name: "Dwellir Tunisia",
1080
- endpoint: "wss://polkadot-bridge-hub-rpc-tn.dwellir.com"
1081
- },
1082
- {
1083
- name: "IBP1",
1084
- endpoint: "wss://bridge-hub-polkadot.ibp.network"
1085
- },
1086
- {
1087
- name: "IBP2",
1088
- endpoint: "wss://bridge-hub-polkadot.dotters.network"
1089
- },
1090
- {
1091
- name: "LuckyFriday",
1092
- endpoint: "wss://rpc-bridge-hub-polkadot.luckyfriday.io"
1093
- },
1094
- {
1095
- name: "OnFinality",
1096
- endpoint: "wss://bridgehub-polkadot.api.onfinality.io/public-ws"
1097
- },
1098
- {
1099
- name: "Parity",
1100
- endpoint: "wss://polkadot-bridge-hub-rpc.polkadot.io"
1101
- },
1102
- {
1103
- name: "RadiumBlock",
1104
- endpoint: "wss://bridgehub-polkadot.public.curie.radiumblock.co/ws"
1105
- },
1106
- {
1107
- name: "Spectrum",
1108
- endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/mgX--uWlEtmNKw/polkadotbridgehub/mainnet/"
1109
- }
1110
- ]
1093
+
1094
+ var validateDestinationAddress = function validateDestinationAddress(address, destination, api) {
1095
+ if (typeof address === 'string' && !isTLocation(destination)) {
1096
+ validateAddress(api, address, destination, true);
1097
+ }
1111
1098
  };
1112
- var Centrifuge$1 = {
1113
- name: "Centrifuge",
1114
- info: "centrifuge",
1115
- paraId: 2031,
1116
- providers: [
1117
- {
1118
- name: "LuckyFriday",
1119
- endpoint: "wss://rpc-centrifuge.luckyfriday.io"
1120
- },
1121
- {
1122
- name: "OnFinality",
1123
- endpoint: "wss://centrifuge-parachain.api.onfinality.io/public-ws"
1124
- }
1125
- ]
1099
+
1100
+ var assertToIsString = function assertToIsString(to, overrideMsg) {
1101
+ if (isTLocation(to)) {
1102
+ throw new InvalidAddressError(overrideMsg !== null && overrideMsg !== void 0 ? overrideMsg : 'Location destination is not supported for XCM fee calculation.');
1103
+ }
1126
1104
  };
1127
- var Darwinia$1 = {
1128
- name: "Darwinia",
1129
- info: "darwinia",
1130
- paraId: 2046,
1131
- providers: [
1132
- {
1133
- name: "Darwinia",
1134
- endpoint: "wss://rpc.darwinia.network"
1135
- },
1136
- {
1137
- name: "Subquery",
1138
- endpoint: "wss://darwinia.rpc.subquery.network/public/ws"
1139
- }
1140
- ]
1105
+ var assertAddressIsString = function assertAddressIsString(address) {
1106
+ if (isTLocation(address)) {
1107
+ throw new InvalidAddressError('Location address is not supported for this transfer type.');
1108
+ }
1141
1109
  };
1142
- var EnergyWebX$1 = {
1143
- name: "Energy Web X",
1144
- info: "ewx",
1145
- paraId: 3345,
1146
- providers: [
1147
- {
1148
- name: "Energy Web",
1149
- endpoint: "wss://wnp-rpc.mainnet.energywebx.com/"
1150
- }
1151
- ]
1110
+ var assertSender = function assertSender(address) {
1111
+ if (!address) {
1112
+ throw new MissingParameterError('sender');
1113
+ }
1152
1114
  };
1153
- var Hydration$1 = {
1154
- name: "Hydration",
1155
- info: "hydradx",
1156
- paraId: 2034,
1157
- providers: [
1158
- {
1159
- name: "Helikon",
1160
- endpoint: "wss://rpc.helikon.io/hydradx"
1161
- },
1162
- {
1163
- name: "IBP1",
1164
- endpoint: "wss://hydration.ibp.network"
1165
- },
1166
- {
1167
- name: "IBP2",
1168
- endpoint: "wss://hydration.dotters.network"
1169
- }
1170
- ]
1115
+ var assertHasId = function assertHasId(asset) {
1116
+ if (asset.assetId === undefined) {
1117
+ throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, replaceBigInt), " has no assetId"));
1118
+ }
1171
1119
  };
1172
- var Interlay$1 = {
1173
- name: "Interlay",
1174
- info: "interlay",
1175
- paraId: 2032,
1176
- providers: [
1177
- {
1178
- name: "Kintsugi Labs",
1179
- endpoint: "wss://api.interlay.io/parachain"
1180
- },
1181
- {
1182
- name: "LuckyFriday",
1183
- endpoint: "wss://rpc-interlay.luckyfriday.io/"
1184
- }
1185
- ]
1120
+ var assertSenderSource = function assertSenderSource(sender) {
1121
+ if (sender === undefined) {
1122
+ throw new InvalidAddressError('Sender address needs to be a derivation path or signer to sign and submit transaction using this method.');
1123
+ }
1186
1124
  };
1187
- var Heima$1 = {
1188
- name: "Heima",
1189
- info: "heima",
1190
- paraId: 2013,
1191
- providers: [
1192
- {
1193
- name: "Dwellir",
1194
- endpoint: "wss://heima-rpc.n.dwellir.com"
1195
- },
1196
- {
1197
- name: "Heima",
1198
- endpoint: "wss://rpc.heima-parachain.heima.network"
1199
- }
1200
- ]
1125
+ var isSenderSigner = function isSenderSigner(sender) {
1126
+ return typeof sender !== 'string';
1201
1127
  };
1202
- var Jamton$1 = {
1203
- name: "JAMTON",
1204
- info: "jamton",
1205
- paraId: 3397,
1206
- providers: [
1207
- {
1208
- name: "Jamton",
1209
- endpoint: "wss://rpc.jamton.network"
1210
- }
1211
- ]
1128
+ var assertSwapSupport = function assertSwapSupport(options) {
1129
+ if (options) {
1130
+ throw new UnsupportedOperationError('Swap options are not supported by this operation. Please open an issue if you would like to see this supported.');
1131
+ }
1212
1132
  };
1213
- var Moonbeam$1 = {
1214
- name: "Moonbeam",
1215
- info: "moonbeam",
1216
- paraId: 2004,
1217
- providers: [
1218
- {
1219
- name: "Allnodes",
1220
- endpoint: "wss://moonbeam-rpc.publicnode.com"
1221
- },
1222
- {
1223
- name: "IBP1",
1224
- endpoint: "wss://moonbeam.ibp.network"
1225
- },
1226
- {
1227
- name: "IBP2",
1228
- endpoint: "wss://moonbeam.dotters.network"
1229
- },
1230
- {
1231
- name: "Moonbeam Foundation",
1232
- endpoint: "wss://wss.api.moonbeam.network"
1233
- },
1234
- {
1235
- name: "OnFinality",
1236
- endpoint: "wss://moonbeam.api.onfinality.io/public-ws"
1237
- },
1238
- {
1239
- name: "RadiumBlock",
1240
- endpoint: "wss://moonbeam.public.curie.radiumblock.co/ws"
1241
- },
1242
- {
1243
- name: "UnitedBloc",
1244
- endpoint: "wss://moonbeam.unitedbloc.com"
1245
- }
1246
- ]
1133
+
1134
+ var getAssetReserveChain = function getAssetReserveChain(chain, assetLocation) {
1135
+ var hasGlobalConsensusJunction = hasJunction(assetLocation, 'GlobalConsensus');
1136
+ var paraId = getJunctionValue(assetLocation, 'Parachain');
1137
+ if (paraId) {
1138
+ var resolvedChain = getTChain(paraId, getRelayChainOf(chain));
1139
+ if (!resolvedChain) {
1140
+ throw new RoutingResolutionError("Chain with paraId ".concat(paraId, " not found"));
1141
+ }
1142
+ return resolvedChain;
1143
+ }
1144
+ if (isRelayChain(chain)) return chain;
1145
+ var relaychain = getRelayChainOf(chain);
1146
+ var ahChain = "AssetHub".concat(relaychain);
1147
+ if (hasGlobalConsensusJunction) {
1148
+ return ahChain;
1149
+ }
1150
+ if (deepEqual(assetLocation, {
1151
+ parents: Parents.ONE,
1152
+ interior: {
1153
+ Here: null
1154
+ }
1155
+ })) {
1156
+ return ahChain;
1157
+ }
1158
+ return chain;
1247
1159
  };
1248
- var CoretimePolkadot$1 = {
1249
- name: "Coretime",
1250
- info: "polkadotCoretime",
1251
- paraId: 1005,
1252
- providers: [
1253
- {
1254
- name: "Dwellir",
1255
- endpoint: "wss://coretime-polkadot-rpc.n.dwellir.com"
1256
- },
1257
- {
1258
- name: "IBP1",
1259
- endpoint: "wss://coretime-polkadot.ibp.network"
1260
- },
1261
- {
1262
- name: "IBP2",
1263
- endpoint: "wss://coretime-polkadot.dotters.network"
1264
- },
1265
- {
1266
- name: "LuckyFriday",
1267
- endpoint: "wss://rpc-coretime-polkadot.luckyfriday.io"
1268
- },
1269
- {
1270
- name: "OnFinality",
1271
- endpoint: "wss://coretime-polkadot.api.onfinality.io/public-ws"
1272
- },
1273
- {
1274
- name: "Parity",
1275
- endpoint: "wss://polkadot-coretime-rpc.polkadot.io"
1276
- },
1277
- {
1278
- name: "RadiumBlock",
1279
- endpoint: "wss://coretime-polkadot.public.curie.radiumblock.co/ws"
1280
- }
1281
- ]
1160
+
1161
+ /**
1162
+ * Retrieves the chain instance for a given chain.
1163
+ *
1164
+ * @param chain - The chain identifier.
1165
+ * @returns The chain instance
1166
+ */
1167
+ var getChain = function getChain(chain) {
1168
+ var map = chains();
1169
+ return map[chain];
1282
1170
  };
1283
- var Collectives$1 = {
1284
- name: "Collectives",
1285
- info: "polkadotCollectives",
1286
- paraId: 1001,
1287
- providers: [
1288
- {
1289
- name: "Dwellir",
1290
- endpoint: "wss://collectives-polkadot-rpc.n.dwellir.com"
1291
- },
1292
- {
1293
- name: "Dwellir Tunisia",
1294
- endpoint: "wss://polkadot-collectives-rpc-tn.dwellir.com"
1295
- },
1296
- {
1297
- name: "IBP1",
1298
- endpoint: "wss://collectives-polkadot.ibp.network"
1299
- },
1300
- {
1301
- name: "IBP2",
1302
- endpoint: "wss://collectives-polkadot.dotters.network"
1303
- },
1304
- {
1305
- name: "LuckyFriday",
1306
- endpoint: "wss://rpc-collectives-polkadot.luckyfriday.io"
1307
- },
1308
- {
1309
- name: "OnFinality",
1310
- endpoint: "wss://collectives.api.onfinality.io/public-ws"
1311
- },
1312
- {
1313
- name: "Parity",
1314
- endpoint: "wss://polkadot-collectives-rpc.polkadot.io"
1315
- },
1316
- {
1317
- name: "RadiumBlock",
1318
- endpoint: "wss://collectives.public.curie.radiumblock.co/ws"
1319
- }
1320
- ]
1171
+
1172
+ var getChainVersion = function getChainVersion(chain) {
1173
+ if (isRelayChain(chain) || isExternalChain(chain)) {
1174
+ return Version.V5;
1175
+ }
1176
+ return getChain(chain).version;
1321
1177
  };
1322
- var Crust$1 = {
1323
- name: "Crust",
1324
- info: "crustParachain",
1325
- paraId: 2008,
1326
- providers: [
1327
- {
1328
- name: "Crust",
1329
- endpoint: "wss://crust-parachain.crustapps.net"
1330
- },
1331
- {
1332
- name: "Crust APP",
1333
- endpoint: "wss://crust-parachain.crustnetwork.app"
1334
- },
1335
- {
1336
- name: "Crust CC",
1337
- endpoint: "wss://crust-parachain.crustnetwork.cc"
1338
- },
1339
- {
1340
- name: "Crust XYZ",
1341
- endpoint: "wss://crust-parachain.crustnetwork.xyz"
1342
- }
1343
- ]
1178
+
1179
+ /**
1180
+ * Gets the relay chain (Polkadot, Kusama, Westend, or Paseo) of a given chain.
1181
+ *
1182
+ * @param chain - The chain to evaluate.
1183
+ * @returns The corresponding relay chain.
1184
+ */
1185
+ var getRelayChainOf = function getRelayChainOf(chain) {
1186
+ if (isRelayChain(chain)) return chain;
1187
+ return getChain(chain).ecosystem;
1344
1188
  };
1345
- var Manta$1 = {
1346
- name: "Manta",
1347
- info: "manta",
1348
- paraId: 2104,
1349
- providers: [
1350
- {
1351
- name: "Manta Network",
1352
- endpoint: "wss://ws.manta.systems"
1353
- }
1354
- ]
1189
+
1190
+ var addXcmVersionHeader = function addXcmVersionHeader(obj, version) {
1191
+ return _defineProperty({}, version, obj);
1355
1192
  };
1356
- var NeuroWeb$1 = {
1357
- name: "NeuroWeb",
1358
- info: "neuroweb",
1359
- paraId: 2043,
1360
- providers: [
1361
- {
1362
- name: "TraceLabs",
1363
- endpoint: "wss://parachain-rpc.origin-trail.network"
1364
- }
1365
- ]
1193
+ var selectXcmVersion = function selectXcmVersion(forcedVersion, originVersion, destMaxVersion) {
1194
+ if (forcedVersion) return forcedVersion;
1195
+ var destVersion = destMaxVersion !== null && destMaxVersion !== void 0 ? destMaxVersion : originVersion;
1196
+ return destVersion < originVersion ? destVersion : originVersion;
1366
1197
  };
1367
- var Pendulum$1 = {
1368
- name: "Pendulum",
1369
- info: "pendulum",
1370
- paraId: 2094,
1371
- providers: [
1372
- {
1373
- name: "PendulumChain",
1374
- endpoint: "wss://rpc-pendulum.prd.pendulumchain.tech"
1375
- }
1376
- ]
1198
+ var pickCompatibleXcmVersion = function pickCompatibleXcmVersion(origin, destination, override) {
1199
+ var originVersion = getChainVersion(origin);
1200
+ var destVersion = !isTLocation(destination) ? getChainVersion(destination) : undefined;
1201
+ return selectXcmVersion(override, originVersion, destVersion);
1377
1202
  };
1378
- var Mythos$1 = {
1379
- name: "Mythos",
1380
- info: "mythos",
1381
- paraId: 3369,
1382
- providers: [
1383
- {
1384
- name: "parity",
1385
- endpoint: "wss://polkadot-mythos-rpc.polkadot.io"
1386
- }
1387
- ]
1203
+ var pickRouterCompatibleXcmVersion = function pickRouterCompatibleXcmVersion(origin, exchangeChain, destination) {
1204
+ var exchangeVersion = getChainVersion(exchangeChain);
1205
+ var originVersion = origin ? getChainVersion(origin) : undefined;
1206
+ var destVersion = destination ? getChainVersion(destination) : undefined;
1207
+ // Find minimum compatible version across all defined chains
1208
+ var minWithOrigin = selectXcmVersion(undefined, exchangeVersion, originVersion);
1209
+ return selectXcmVersion(undefined, minWithOrigin, destVersion);
1388
1210
  };
1389
- var Peaq$1 = {
1390
- name: "peaq",
1391
- info: "peaq",
1392
- paraId: 3338,
1393
- providers: [
1394
- {
1395
- name: "OnFinality",
1396
- endpoint: "wss://peaq.api.onfinality.io/public-ws"
1397
- }
1398
- ]
1211
+
1212
+ var createId = function createId(version, location) {
1213
+ if (version === Version.V3) {
1214
+ return {
1215
+ Concrete: location
1216
+ };
1217
+ }
1218
+ return location;
1399
1219
  };
1400
- var PeoplePolkadot$1 = {
1401
- name: "People",
1402
- info: "polkadotPeople",
1403
- paraId: 1004,
1404
- providers: [
1405
- {
1406
- name: "Dwellir",
1407
- endpoint: "wss://people-polkadot-rpc.n.dwellir.com"
1408
- },
1409
- {
1410
- name: "IBP1",
1411
- endpoint: "wss://people-polkadot.ibp.network"
1412
- },
1413
- {
1414
- name: "IBP2",
1415
- endpoint: "wss://people-polkadot.dotters.network"
1416
- },
1417
- {
1418
- name: "LuckyFriday",
1419
- endpoint: "wss://rpc-people-polkadot.luckyfriday.io"
1420
- },
1421
- {
1422
- name: "OnFinality",
1423
- endpoint: "wss://people-polkadot.api.onfinality.io/public-ws"
1424
- },
1425
- {
1426
- name: "Parity",
1427
- endpoint: "wss://polkadot-people-rpc.polkadot.io"
1428
- },
1429
- {
1430
- name: "RadiumBlock",
1431
- endpoint: "wss://people-polkadot.public.curie.radiumblock.co/ws"
1432
- }
1433
- ]
1220
+ var createAsset = function createAsset(version, amount, location) {
1221
+ if (version === Version.V3) {
1222
+ return {
1223
+ id: {
1224
+ Concrete: location
1225
+ },
1226
+ fun: {
1227
+ Fungible: amount
1228
+ }
1229
+ };
1230
+ }
1231
+ return {
1232
+ id: location,
1233
+ fun: {
1234
+ Fungible: amount
1235
+ }
1236
+ };
1434
1237
  };
1435
- var Unique$1 = {
1436
- name: "Unique Network",
1437
- info: "unique",
1438
- paraId: 2037,
1439
- providers: [
1440
- {
1441
- name: "Geo Load Balancer",
1442
- endpoint: "wss://ws.unique.network"
1443
- },
1444
- {
1445
- name: "IBP1",
1446
- endpoint: "wss://unique.ibp.network"
1447
- },
1448
- {
1449
- name: "IBP2",
1450
- endpoint: "wss://unique.dotters.network"
1451
- }
1452
- ]
1238
+ var createVersionedAssets = function createVersionedAssets(version, amount, location) {
1239
+ var asset = createAsset(version, amount, location);
1240
+ return addXcmVersionHeader([asset], version);
1453
1241
  };
1454
- var Xode$1 = {
1455
- name: "Xode",
1456
- info: "xode",
1457
- paraId: 3417,
1458
- providers: [
1459
- {
1460
- name: "RakSonCebu",
1461
- endpoint: "wss://rakson-ceb-rpc.xode.net"
1462
- },
1463
- {
1464
- name: "RakSonKorea",
1465
- endpoint: "wss://rakson-rpc.xode.net"
1466
- },
1467
- {
1468
- name: "XodeCommunity",
1469
- endpoint: "wss://polkadot-rpcnode.xode.net"
1470
- }
1471
- ]
1242
+
1243
+ // Inspired by Moonbeam XCM-SDK
1244
+ // https://github.com/moonbeam-foundation/xcm-sdk/blob/ab835c15bf41612604b1c858d956a9f07705ed65/packages/utils/src/format/asset.ts#L1
1245
+ var formatAssetIdToERC20 = function formatAssetIdToERC20(id) {
1246
+ if (id.startsWith('0x')) {
1247
+ return id;
1248
+ }
1249
+ if (!(/^\d{38,39}$/.test(id) || /^\d{4}$/.test(id))) {
1250
+ throw new NumberFormatError("Asset id: ".concat(id, " must be a string and have either 4 digits or 38-39 digits"));
1251
+ }
1252
+ return "0xffffffff".concat(BigInt(id).toString(16).padStart(32, '0'));
1472
1253
  };
1473
- var AssetHubKusama$1 = {
1474
- name: "Asset Hub",
1475
- info: "KusamaAssetHub",
1476
- paraId: 1000,
1477
- providers: [
1478
- {
1479
- name: "Dwellir",
1480
- endpoint: "wss://asset-hub-kusama-rpc.n.dwellir.com"
1481
- },
1482
- {
1483
- name: "Dwellir Tunisia",
1484
- endpoint: "wss://statemine-rpc-tn.dwellir.com"
1485
- },
1486
- {
1487
- name: "IBP1",
1488
- endpoint: "wss://asset-hub-kusama.ibp.network"
1489
- },
1490
- {
1491
- name: "IBP2",
1492
- endpoint: "wss://asset-hub-kusama.dotters.network"
1493
- },
1494
- {
1495
- name: "LuckyFriday",
1496
- endpoint: "wss://rpc-asset-hub-kusama.luckyfriday.io"
1497
- },
1498
- {
1499
- name: "OnFinality",
1500
- endpoint: "wss://assethub-kusama.api.onfinality.io/public-ws"
1501
- },
1502
- {
1503
- name: "Parity",
1504
- endpoint: "wss://kusama-asset-hub-rpc.polkadot.io"
1505
- },
1506
- {
1507
- name: "RadiumBlock",
1508
- endpoint: "wss://statemine.public.curie.radiumblock.co/ws"
1509
- }
1510
- ]
1254
+
1255
+ var maybeOverrideAssets = function maybeOverrideAssets(version, amount, assets, overriddenCurrency) {
1256
+ if (!overriddenCurrency) {
1257
+ return assets;
1258
+ }
1259
+ return isTLocation(overriddenCurrency) ? createAsset(version, amount, overriddenCurrency) : overriddenCurrency;
1511
1260
  };
1512
- var BridgeHubKusama$1 = {
1513
- name: "Bridge Hub",
1514
- info: "kusamaBridgeHub",
1515
- paraId: 1002,
1516
- providers: [
1517
- {
1518
- name: "Dwellir",
1519
- endpoint: "wss://bridge-hub-kusama-rpc.n.dwellir.com"
1520
- },
1521
- {
1522
- name: "Dwellir Tunisia",
1523
- endpoint: "wss://kusama-bridge-hub-rpc-tn.dwellir.com"
1524
- },
1525
- {
1526
- name: "IBP1",
1527
- endpoint: "wss://bridge-hub-kusama.ibp.network"
1528
- },
1529
- {
1530
- name: "IBP2",
1531
- endpoint: "wss://bridge-hub-kusama.dotters.network"
1532
- },
1533
- {
1534
- name: "LuckyFriday",
1535
- endpoint: "wss://rpc-bridge-hub-kusama.luckyfriday.io"
1536
- },
1537
- {
1538
- name: "OnFinality",
1539
- endpoint: "wss://bridgehub-kusama.api.onfinality.io/public-ws"
1540
- },
1541
- {
1542
- name: "Parity",
1543
- endpoint: "wss://kusama-bridge-hub-rpc.polkadot.io"
1544
- },
1545
- {
1546
- name: "RadiumBlock",
1547
- endpoint: "wss://bridgehub-kusama.public.curie.radiumblock.co/ws"
1548
- },
1549
- {
1550
- name: "Spectrum",
1551
- endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/balkpUVauqyv8g/kusamabridgehub/mainnet/"
1552
- }
1553
- ]
1261
+ var maybeOverrideAsset = function maybeOverrideAsset(version, amount, asset, overriddenCurrency) {
1262
+ if (!overriddenCurrency) {
1263
+ return asset;
1264
+ }
1265
+ if (Array.isArray(overriddenCurrency)) {
1266
+ if (overriddenCurrency.length !== 1) {
1267
+ throw new OverrideConflictError('Expected a single asset in overriddenCurrency array.');
1268
+ }
1269
+ return overriddenCurrency[0];
1270
+ }
1271
+ return createAsset(version, amount, overriddenCurrency);
1554
1272
  };
1555
- var Karura$1 = {
1556
- name: "Karura",
1557
- info: "karura",
1558
- paraId: 2000,
1559
- providers: [
1560
- {
1561
- name: "Acala Foundation 0",
1562
- endpoint: "wss://karura-rpc-0.aca-api.network"
1563
- },
1564
- {
1565
- name: "Acala Foundation 1",
1566
- endpoint: "wss://karura-rpc-1.aca-api.network"
1567
- },
1568
- {
1569
- name: "Acala Foundation 2",
1570
- endpoint: "wss://karura-rpc-2.aca-api.network/ws"
1571
- },
1572
- {
1573
- name: "Acala Foundation 3",
1574
- endpoint: "wss://karura-rpc-3.aca-api.network/ws"
1575
- },
1576
- {
1577
- name: "Dwellir",
1578
- endpoint: "wss://karura-rpc.n.dwellir.com"
1579
- }
1580
- ]
1273
+
1274
+ var isHere = function isHere(loc) {
1275
+ var _loc$interior;
1276
+ return loc.interior === 'Here' || ((_loc$interior = loc.interior) === null || _loc$interior === void 0 ? void 0 : _loc$interior.Here) !== undefined;
1581
1277
  };
1582
- var Kintsugi$1 = {
1583
- name: "Kintsugi BTC",
1584
- info: "kintsugi",
1585
- paraId: 2092,
1586
- providers: [
1587
- {
1588
- name: "Kintsugi Labs",
1589
- endpoint: "wss://api-kusama.interlay.io/parachain"
1590
- },
1591
- {
1592
- name: "OnFinality",
1593
- endpoint: "wss://kintsugi.api.onfinality.io/public-ws"
1594
- }
1595
- ]
1278
+ var sortAssets = function sortAssets(assets) {
1279
+ return assets.sort(function (a, b) {
1280
+ var aLoc = extractAssetLocation(a);
1281
+ var bLoc = extractAssetLocation(b);
1282
+ // 1. Sort by parents first
1283
+ if (aLoc.parents !== bLoc.parents) {
1284
+ return Number(aLoc.parents) - Number(bLoc.parents);
1285
+ }
1286
+ // 2. If parents are equal, use priority function
1287
+ var aIsHere = isHere(aLoc);
1288
+ var bIsHere = isHere(bLoc);
1289
+ var aHasGlobal = hasJunction(aLoc, 'GlobalConsensus');
1290
+ var bHasGlobal = hasJunction(bLoc, 'GlobalConsensus');
1291
+ var aGeneralIndex = getJunctionValue(aLoc, 'GeneralIndex');
1292
+ var bGeneralIndex = getJunctionValue(bLoc, 'GeneralIndex');
1293
+ var getPriority = function getPriority(isHere, hasGlobal) {
1294
+ if (isHere) return 0;
1295
+ if (hasGlobal) return 2;
1296
+ return 1;
1297
+ };
1298
+ var aPriority = getPriority(aIsHere, aHasGlobal);
1299
+ var bPriority = getPriority(bIsHere, bHasGlobal);
1300
+ if (aPriority !== bPriority) return aPriority - bPriority;
1301
+ if (aGeneralIndex === undefined && bGeneralIndex === undefined) return 0;
1302
+ if (aGeneralIndex === undefined) return 1;
1303
+ if (bGeneralIndex === undefined) return -1;
1304
+ return aGeneralIndex - bGeneralIndex;
1305
+ });
1596
1306
  };
1597
- var Moonriver$1 = {
1598
- name: "Moonriver",
1599
- info: "moonriver",
1600
- paraId: 2023,
1601
- providers: [
1602
- {
1603
- name: "Allnodes",
1604
- endpoint: "wss://moonriver-rpc.publicnode.com"
1605
- },
1606
- {
1607
- name: "Moonbeam Foundation",
1608
- endpoint: "wss://wss.api.moonriver.moonbeam.network"
1609
- },
1610
- {
1611
- name: "OnFinality",
1612
- endpoint: "wss://moonriver.api.onfinality.io/public-ws"
1613
- },
1614
- {
1615
- name: "RadiumBlock",
1616
- endpoint: "wss://moonriver.public.curie.radiumblock.co/ws"
1617
- },
1618
- {
1619
- name: "UnitedBloc",
1620
- endpoint: "wss://moonriver.unitedbloc.com"
1621
- }
1622
- ]
1307
+
1308
+ var buildClaimAssetsParams = function buildClaimAssetsParams(options) {
1309
+ var assets = options.assets,
1310
+ version = options.version;
1311
+ var beneficiary = createBeneficiaryLocation(options);
1312
+ return {
1313
+ assets: addXcmVersionHeader(assets, version),
1314
+ beneficiary: addXcmVersionHeader(beneficiary, version)
1315
+ };
1623
1316
  };
1624
- var CoretimeKusama$1 = {
1625
- name: "Coretime",
1626
- info: "kusamaCoretime",
1627
- paraId: 1005,
1628
- providers: [
1629
- {
1630
- name: "Dwellir",
1631
- endpoint: "wss://coretime-kusama-rpc.n.dwellir.com"
1632
- },
1633
- {
1634
- name: "IBP1",
1635
- endpoint: "wss://coretime-kusama.ibp.network"
1636
- },
1637
- {
1638
- name: "IBP2",
1639
- endpoint: "wss://coretime-kusama.dotters.network"
1640
- },
1641
- {
1642
- name: "LuckyFriday",
1643
- endpoint: "wss://rpc-coretime-kusama.luckyfriday.io"
1644
- },
1645
- {
1646
- name: "OnFinality",
1647
- endpoint: "wss://coretime-kusama.api.onfinality.io/public-ws"
1648
- },
1649
- {
1650
- name: "Parity",
1651
- endpoint: "wss://kusama-coretime-rpc.polkadot.io"
1652
- }
1653
- ]
1317
+
1318
+ var resolveAssets = function resolveAssets(_ref, version) {
1319
+ var api = _ref.api,
1320
+ chain = _ref.chain,
1321
+ currency = _ref.currency;
1322
+ var normalizeAsset = function normalizeAsset(amount, currency) {
1323
+ var asset = findAssetInfoOrThrow(chain, currency);
1324
+ var abstracted = abstractDecimals(amount, asset.decimals, api);
1325
+ return createAsset(version, abstracted, localizeLocation(chain, asset.location));
1326
+ };
1327
+ if (Array.isArray(currency)) {
1328
+ if (currency.every(function (asset) {
1329
+ return isTAsset(asset);
1330
+ })) {
1331
+ return currency.map(function (asset) {
1332
+ return _objectSpread2(_objectSpread2({}, asset), {}, {
1333
+ fun: {
1334
+ Fungible: BigInt(asset.fun.Fungible)
1335
+ }
1336
+ });
1337
+ });
1338
+ } else {
1339
+ return currency.map(function (currency) {
1340
+ return normalizeAsset(currency.amount, currency);
1341
+ });
1342
+ }
1343
+ }
1344
+ return [normalizeAsset(currency.amount, currency)];
1654
1345
  };
1655
- var Encointer$1 = {
1656
- name: "Encointer Network",
1657
- info: "encointer",
1658
- paraId: 1001,
1659
- providers: [
1660
- {
1661
- name: "Dwellir",
1662
- endpoint: "wss://encointer-kusama-rpc.n.dwellir.com"
1663
- },
1664
- {
1665
- name: "Encointer Association",
1666
- endpoint: "wss://kusama.api.encointer.org"
1667
- },
1668
- {
1669
- name: "IBP1",
1670
- endpoint: "wss://encointer-kusama.ibp.network"
1671
- },
1672
- {
1673
- name: "IBP2",
1674
- endpoint: "wss://encointer-kusama.dotters.network"
1675
- },
1676
- {
1677
- name: "LuckyFriday",
1678
- endpoint: "wss://rpc-encointer-kusama.luckyfriday.io"
1679
- }
1680
- ]
1346
+
1347
+ /**
1348
+ * @deprecated Asset claim functionality is deprecated and will be removed in v14.
1349
+ */
1350
+ var claimAssets = /*#__PURE__*/function () {
1351
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
1352
+ var api, chain, address, pallets, supportedPallet, version, assets, params, call;
1353
+ return _regenerator().w(function (_context) {
1354
+ while (1) switch (_context.n) {
1355
+ case 0:
1356
+ api = options.api, chain = options.chain, address = options.address;
1357
+ validateAddress(api, address, chain, true);
1358
+ _context.n = 1;
1359
+ return api.init(chain, TX_CLIENT_TIMEOUT_MS);
1360
+ case 1:
1361
+ pallets = getSupportedPallets(chain);
1362
+ supportedPallet = pallets.find(function (p) {
1363
+ return p === 'PolkadotXcm' || p === 'XcmPallet';
1364
+ });
1365
+ if (supportedPallet) {
1366
+ _context.n = 2;
1367
+ break;
1368
+ }
1369
+ throw new UnsupportedOperationError('Unsupported pallet for asset claim');
1370
+ case 2:
1371
+ version = getChainVersion(chain);
1372
+ assets = resolveAssets(options, version);
1373
+ params = buildClaimAssetsParams(_objectSpread2(_objectSpread2({}, options), {}, {
1374
+ version: version,
1375
+ assets: assets
1376
+ }));
1377
+ call = {
1378
+ module: supportedPallet,
1379
+ method: 'claim_assets',
1380
+ params: params
1381
+ };
1382
+ return _context.a(2, api.deserializeExtrinsics(call));
1383
+ }
1384
+ }, _callee);
1385
+ }));
1386
+ return function claimAssets(_x) {
1387
+ return _ref.apply(this, arguments);
1388
+ };
1389
+ }();
1390
+
1391
+ var resolveAsset = function resolveAsset(currency, origin, destination, assetCheckEnabled) {
1392
+ return assetCheckEnabled ? findAssetInfo(origin, currency, !isTLocation(destination) ? destination : null) : null;
1681
1393
  };
1682
- var Basilisk$1 = {
1683
- name: "Basilisk",
1684
- info: "basilisk",
1685
- paraId: 2090,
1686
- providers: [
1687
- {
1688
- name: "Basilisk",
1689
- endpoint: "wss://rpc.basilisk.cloud"
1690
- },
1691
- {
1692
- name: "Dwellir",
1693
- endpoint: "wss://basilisk-rpc.n.dwellir.com"
1694
- }
1695
- ]
1394
+
1395
+ var resolveFeeAsset = function resolveFeeAsset(feeAsset, origin, destination, currency) {
1396
+ if (!origin.startsWith('Hydration') && origin !== 'AssetHubPolkadot') {
1397
+ throw new ScenarioNotSupportedError("Fee asset is not supported on ".concat(origin));
1398
+ }
1399
+ var asset = findAssetInfo(origin, feeAsset, !isTLocation(destination) ? destination : null);
1400
+ var usesRawOverriddenMultiAssets = Array.isArray(currency) && currency.every(isTAsset);
1401
+ if (!asset && !usesRawOverriddenMultiAssets) {
1402
+ throwUnsupportedCurrency(feeAsset, origin);
1403
+ }
1404
+ return asset !== null && asset !== void 0 ? asset : undefined;
1696
1405
  };
1697
- var BifrostKusama$1 = {
1698
- name: "Bifrost",
1699
- info: "bifrost",
1700
- paraId: 2001,
1701
- providers: [
1702
- {
1703
- name: "Liebi",
1704
- endpoint: "wss://bifrost-rpc.liebi.com/ws"
1705
- },
1706
- {
1707
- name: "LiebiUS",
1708
- endpoint: "wss://us.bifrost-rpc.liebi.com/ws"
1709
- }
1710
- ]
1406
+
1407
+ var resolveHopAsset = function resolveHopAsset(_ref) {
1408
+ var _findAssetInfoOnDest;
1409
+ var api = _ref.api,
1410
+ tx = _ref.tx,
1411
+ originChain = _ref.originChain,
1412
+ currentChain = _ref.currentChain,
1413
+ destination = _ref.destination,
1414
+ swapConfig = _ref.swapConfig,
1415
+ asset = _ref.asset,
1416
+ hasPassedExchange = _ref.hasPassedExchange,
1417
+ currency = _ref.currency;
1418
+ var isRelayAssetIncluded = api.getTypeThenAssetCount(tx) === 2;
1419
+ var useRelayAssetAsFee = typeof destination === 'string' && isExternalChain(destination) || isRelayAssetIncluded;
1420
+ if (useRelayAssetAsFee) {
1421
+ return findNativeAssetInfoOrThrow(getRelayChainOf(currentChain));
1422
+ }
1423
+ if (hasPassedExchange && swapConfig && currentChain !== swapConfig.exchangeChain) {
1424
+ return findAssetOnDestOrThrow(swapConfig.exchangeChain, currentChain, swapConfig.currencyTo);
1425
+ }
1426
+ return (_findAssetInfoOnDest = findAssetInfoOnDest(originChain, currentChain, currency)) !== null && _findAssetInfoOnDest !== void 0 ? _findAssetInfoOnDest : asset;
1711
1427
  };
1712
- var CrustShadow$1 = {
1713
- name: "Crust Shadow",
1714
- info: "shadow",
1715
- paraId: 2012,
1716
- providers: [
1717
- {
1718
- name: "Crust",
1719
- endpoint: "wss://rpc-shadow.crust.network/"
1720
- },
1721
- {
1722
- name: "Crust APP",
1723
- endpoint: "wss://rpc-shadow.crustnetwork.app"
1724
- },
1725
- {
1726
- name: "Crust CC",
1727
- endpoint: "wss://rpc-shadow.crustnetwork.cc"
1728
- },
1729
- {
1730
- name: "Crust XYZ",
1731
- endpoint: "wss://rpc-shadow.crustnetwork.xyz"
1732
- }
1733
- ]
1428
+
1429
+ var getEthereumJunction = function getEthereumJunction(chain) {
1430
+ var useBigInt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1431
+ var relayChain = getRelayChainOf(chain);
1432
+ var isTestnet = relayChain === 'Westend' || relayChain === 'Paseo';
1433
+ var chainId = isTestnet ? ETH_TESTNET_PARA_ID : ETH_MAINNET_PARA_ID;
1434
+ return {
1435
+ GlobalConsensus: {
1436
+ Ethereum: {
1437
+ chainId: useBigInt ? BigInt(chainId) : chainId
1438
+ }
1439
+ }
1440
+ };
1734
1441
  };
1735
- var Crab$1 = {
1736
- name: "Crab",
1737
- info: "crab",
1738
- paraId: 2105,
1739
- providers: [
1740
- {
1741
- name: "Darwinia",
1742
- endpoint: "wss://crab-rpc.darwinia.network/"
1743
- }
1744
- ]
1442
+
1443
+ var validateBridgeAsset = function validateBridgeAsset(origin, destination, asset, currency, isBridge) {
1444
+ if (!asset || isTLocation(destination) || isExternalChain(destination) || !isBridge) {
1445
+ return;
1446
+ }
1447
+ var nativeAsset = findNativeAssetInfoOrThrow(origin);
1448
+ var isNativeAsset = isAssetEqual(asset, nativeAsset);
1449
+ var isBridgedStablecoin = isStableCoinAsset(asset);
1450
+ if (!(isNativeAsset || isBridgedSystemAsset(asset, [getRelayChainOf(destination)]) || isBridgedStablecoin)) {
1451
+ throw new InvalidCurrencyError("Substrate bridge does not support currency ".concat(JSON.stringify(currency, replaceBigInt), "."));
1452
+ }
1745
1453
  };
1746
- var Laos$1 = {
1747
- name: "Laos",
1748
- info: "laos",
1749
- paraId: 3370,
1750
- providers: [
1751
- {
1752
- name: "laosfoundation.io",
1753
- endpoint: "wss://rpc.laos.laosfoundation.io"
1754
- }
1755
- ]
1454
+ var validateEcosystems = function validateEcosystems(origin, destination) {
1455
+ if (isTLocation(destination)) return;
1456
+ var relayChain = getRelayChainOf(origin);
1457
+ var destinationToRelayChains = {
1458
+ Ethereum: ['Polkadot'],
1459
+ EthereumTestnet: ['Westend', 'Paseo']
1460
+ };
1461
+ var allowedRelayChains = destinationToRelayChains[destination];
1462
+ if (!allowedRelayChains) return;
1463
+ if (!allowedRelayChains.includes(relayChain)) {
1464
+ throw new InvalidCurrencyError("Destination ".concat(destination, " is only supported from following ecosystems: ").concat(allowedRelayChains.join(', '), "."));
1465
+ }
1756
1466
  };
1757
- var Quartz$1 = {
1758
- name: "QUARTZ by UNIQUE",
1759
- info: "quartz",
1760
- paraId: 2095,
1761
- providers: [
1762
- {
1763
- name: "Geo Load Balancer",
1764
- endpoint: "wss://ws-quartz.unique.network"
1765
- }
1766
- ]
1467
+ var validateEthereumAsset = function validateEthereumAsset(origin, destination, asset) {
1468
+ if (!asset || !isTLocation(destination) && !isSnowbridge(origin, destination) || origin === 'Mythos') {
1469
+ return;
1470
+ }
1471
+ validateEcosystems(origin, destination);
1472
+ var ADDITIONAL_ALLOWED_LOCATIONS = [RELAY_LOCATION, {
1473
+ parents: 2,
1474
+ interior: {
1475
+ X1: [{
1476
+ GlobalConsensus: {
1477
+ Kusama: null
1478
+ }
1479
+ }]
1480
+ }
1481
+ }];
1482
+ var isEthCompatibleAsset = asset.location.parents === Parents.TWO && deepEqual(getJunctionValue(asset.location, 'GlobalConsensus'), getEthereumJunction(origin, false).GlobalConsensus) || ADDITIONAL_ALLOWED_LOCATIONS.some(function (loc) {
1483
+ return deepEqual(asset.location, loc);
1484
+ });
1485
+ if (!isEthCompatibleAsset) {
1486
+ throw new InvalidCurrencyError("Currency ".concat(JSON.stringify(asset, replaceBigInt), " is not transferable to Ethereum."));
1487
+ }
1767
1488
  };
1768
- var RobonomicsPolkadot$1 = {
1769
- name: "Robonomics",
1770
- info: "robonomics",
1771
- paraId: 3388,
1772
- providers: [
1773
- {
1774
- name: "Airalab",
1775
- endpoint: "wss://polkadot.rpc.robonomics.network/"
1776
- }
1777
- ]
1489
+ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled, isBridge, asset) {
1490
+ var origin = _ref.from,
1491
+ destination = _ref.to,
1492
+ currency = _ref.currency;
1493
+ var isLocationDestination = _typeof(destination) === 'object';
1494
+ if (asset === null && assetCheckEnabled) {
1495
+ throwUnsupportedCurrency(currency, origin);
1496
+ }
1497
+ if (!isLocationDestination && assetCheckEnabled && !findAssetInfoOnDest(origin, destination, currency, asset)) {
1498
+ throw new InvalidCurrencyError("Destination chain ".concat(destination, " does not support currency ").concat(JSON.stringify(currency, replaceBigInt), "."));
1499
+ }
1500
+ validateBridgeAsset(origin, destination, asset, currency, isBridge);
1501
+ validateEthereumAsset(origin, destination, asset);
1778
1502
  };
1779
- var PeopleKusama$1 = {
1780
- name: "People",
1781
- info: "kusamaPeople",
1782
- paraId: 1004,
1783
- providers: [
1784
- {
1785
- name: "Dwellir",
1786
- endpoint: "wss://people-kusama-rpc.n.dwellir.com"
1787
- },
1788
- {
1789
- name: "Helixstreet",
1790
- endpoint: "wss://rpc-people-kusama.helixstreet.io"
1791
- },
1792
- {
1793
- name: "IBP1",
1794
- endpoint: "wss://people-kusama.ibp.network"
1795
- },
1796
- {
1797
- name: "IBP2",
1798
- endpoint: "wss://people-kusama.dotters.network"
1799
- },
1800
- {
1801
- name: "LuckyFriday",
1802
- endpoint: "wss://rpc-people-kusama.luckyfriday.io"
1803
- },
1804
- {
1805
- name: "OnFinality",
1806
- endpoint: "wss://people-kusama.api.onfinality.io/public-ws"
1807
- },
1808
- {
1809
- name: "Parity",
1810
- endpoint: "wss://kusama-people-rpc.polkadot.io"
1811
- },
1812
- {
1813
- name: "RadiumBlock",
1814
- endpoint: "wss://people-kusama.public.curie.radiumblock.co/ws"
1815
- }
1816
- ]
1503
+
1504
+ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge, assetCheckEnabled, resolvedFeeAsset) {
1505
+ var api = options.api,
1506
+ currency = options.currency,
1507
+ feeAsset = options.feeAsset,
1508
+ origin = options.from,
1509
+ destination = options.to;
1510
+ if ('location' in currency && isOverrideLocationSpecifier(currency.location)) {
1511
+ return currency.location.value;
1512
+ }
1513
+ if (Array.isArray(currency)) {
1514
+ if (!feeAsset) {
1515
+ throw new InvalidCurrencyError('Overridden multi assets cannot be used without specifying fee asset');
1516
+ }
1517
+ if ('location' in feeAsset && isOverrideLocationSpecifier(feeAsset.location)) {
1518
+ throw new InvalidCurrencyError('Fee asset cannot be an overridden location specifier');
1519
+ }
1520
+ if (currency.every(function (asset) {
1521
+ return isTAsset(asset);
1522
+ })) {
1523
+ if (!feeAsset) {
1524
+ throw new InvalidCurrencyError('Fee asset not provided');
1525
+ }
1526
+ if (!('location' in feeAsset)) {
1527
+ throw new InvalidCurrencyError('Fee asset must be specified by location when using raw overridden multi assets');
1528
+ }
1529
+ return currency.map(function (asset) {
1530
+ var ml = extractAssetLocation(asset);
1531
+ return _objectSpread2(_objectSpread2({}, asset), {}, {
1532
+ fun: {
1533
+ Fungible: BigInt(asset.fun.Fungible)
1534
+ },
1535
+ isFeeAsset: deepEqual(ml, feeAsset.location)
1536
+ });
1537
+ });
1538
+ }
1539
+ // MultiAsset is an array of TCurrencyCore, search for assets
1540
+ var assets = currency.map(function (currency) {
1541
+ if (currency.amount === AMOUNT_ALL) {
1542
+ throw new InvalidCurrencyError('Multi assets cannot use amount all. Please specify amount.');
1543
+ }
1544
+ var asset = findAssetInfo(origin, currency, !isTLocation(destination) ? destination : null);
1545
+ if (!asset) {
1546
+ throw new InvalidCurrencyError("Origin chain ".concat(origin, " does not support currency ").concat(JSON.stringify(currency)));
1547
+ }
1548
+ if (!resolvedFeeAsset) {
1549
+ throw new InvalidCurrencyError('Fee asset not found');
1550
+ }
1551
+ validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
1552
+ var version = getChainVersion(origin);
1553
+ var abstractedAmount = abstractDecimals(currency.amount, asset.decimals, api);
1554
+ return _objectSpread2({
1555
+ isFeeAsset: isAssetEqual(resolvedFeeAsset, asset)
1556
+ }, createAsset(version, abstractedAmount, asset.location));
1557
+ });
1558
+ if (assets.filter(function (asset) {
1559
+ return asset.isFeeAsset;
1560
+ }).length > 1) {
1561
+ throw new InvalidCurrencyError("Fee asset matches multiple assets in multiassets");
1562
+ }
1563
+ if (assets.filter(function (asset) {
1564
+ return asset.isFeeAsset;
1565
+ }).length === 0) {
1566
+ throw new InvalidCurrencyError("Fee asset not found in multiassets");
1567
+ }
1568
+ return assets;
1569
+ }
1570
+ return undefined;
1817
1571
  };
1818
- var Shiden$1 = {
1819
- name: "Shiden",
1820
- info: "shiden",
1821
- paraId: 2007,
1822
- providers: [
1823
- {
1824
- name: "Astar",
1825
- endpoint: "wss://rpc.shiden.astar.network"
1826
- },
1827
- {
1828
- name: "Dwellir",
1829
- endpoint: "wss://shiden-rpc.n.dwellir.com"
1830
- },
1831
- {
1832
- name: "OnFinality",
1833
- endpoint: "wss://shiden.api.onfinality.io/public-ws"
1834
- },
1835
- {
1836
- name: "RadiumBlock",
1837
- endpoint: "wss://shiden.public.curie.radiumblock.co/ws"
1838
- }
1839
- ]
1572
+
1573
+ var shouldPerformAssetCheck = function shouldPerformAssetCheck(origin, currency) {
1574
+ if (isRelayChain(origin)) return true;
1575
+ var isMultipleAssets = Array.isArray(currency);
1576
+ var hasOverriddenLocation = 'location' in currency && isOverrideLocationSpecifier(currency.location);
1577
+ return !(isMultipleAssets || hasOverriddenLocation);
1840
1578
  };
1841
- var Zeitgeist$1 = {
1842
- name: "Zeitgeist",
1843
- info: "zeitgeist",
1844
- paraId: 2092,
1845
- providers: [
1846
- {
1847
- name: "OnFinality",
1848
- endpoint: "wss://zeitgeist.api.onfinality.io/public-ws"
1849
- }
1850
- ]
1579
+
1580
+ var validateCurrency = function validateCurrency(currency, feeAsset) {
1581
+ if (Array.isArray(currency)) {
1582
+ if (currency.length === 0) {
1583
+ throw new InvalidCurrencyError('Overridden assets cannot be empty');
1584
+ }
1585
+ if (currency.length === 1) {
1586
+ throw new InvalidCurrencyError('Please provide more than one asset');
1587
+ }
1588
+ if (currency.length > 1 && !currency.every(function (asset) {
1589
+ return isTAsset(asset);
1590
+ }) && !feeAsset) {
1591
+ throw new InvalidCurrencyError('Overridden assets cannot be used without specifying fee asset');
1592
+ }
1593
+ }
1851
1594
  };
1852
- var AssetHubWestend$1 = {
1853
- name: "Asset Hub",
1854
- info: "WestendAssetHub",
1855
- paraId: 1000,
1856
- providers: [
1857
- {
1858
- name: "Dwellir",
1859
- endpoint: "wss://asset-hub-westend-rpc.n.dwellir.com"
1860
- },
1861
- {
1862
- name: "Dwellir Tunisia",
1863
- endpoint: "wss://westmint-rpc-tn.dwellir.com"
1864
- },
1865
- {
1866
- name: "Parity",
1867
- endpoint: "wss://westend-asset-hub-rpc.polkadot.io"
1868
- }
1869
- ]
1595
+ var validateDestination = function validateDestination(origin, destination) {
1596
+ if (isRelayChain(origin) && !isTLocation(destination) && isRelayChain(destination) && origin !== destination) {
1597
+ throw new ScenarioNotSupportedError('Direct relay chain to relay chain transfers are not supported. Please use Polkadot <-> Kusama bridge through AssetHub.');
1598
+ }
1599
+ var allowedChainsToEthereum = ['AssetHubPolkadot', 'AssetHubPaseo', 'AssetHubWestend', 'Hydration', 'BifrostPolkadot', 'Moonbeam', 'Mythos'];
1600
+ if (typeof destination === 'string' && isExternalChain(destination) && !allowedChainsToEthereum.includes(origin)) {
1601
+ throw new ScenarioNotSupportedError("Transfers to Ethereum are only supported from: ".concat(allowedChainsToEthereum.join(', ')));
1602
+ }
1603
+ var isLocationDestination = _typeof(destination) === 'object';
1604
+ var isBridgeTransfer = !isTLocation(destination) && isBridge(origin, destination);
1605
+ var isRelayDestination = !isTLocation(destination) && isRelayChain(destination);
1606
+ if (!isRelayDestination && !isLocationDestination) {
1607
+ var originRelayChainSymbol = getRelayChainSymbol(origin);
1608
+ var destinationRelayChainSymbol = getRelayChainSymbol(destination);
1609
+ if (!isBridgeTransfer && originRelayChainSymbol !== destinationRelayChainSymbol) {
1610
+ throw new ScenarioNotSupportedError('Origin and destination must share the same relay chain unless using a bridge.');
1611
+ }
1612
+ }
1613
+ if (isRelayChain(origin) && typeof destination === 'string' && !isExternalChain(destination)) {
1614
+ var chain = getChain(destination);
1615
+ if (!chain.isRelayToParaEnabled()) {
1616
+ throw new ScenarioNotSupportedError({
1617
+ chain: destination,
1618
+ scenario: 'RelayToPara'
1619
+ });
1620
+ }
1621
+ }
1870
1622
  };
1871
- var BridgeHubWestend$1 = {
1872
- name: "Bridge Hub",
1873
- info: "westendBridgeHub",
1874
- paraId: 1002,
1623
+ var validateAssetSpecifiers = function validateAssetSpecifiers(assetCheckEnabled, currency) {
1624
+ if (!assetCheckEnabled && 'symbol' in currency && isSymbolSpecifier(currency.symbol)) {
1625
+ throw new InvalidCurrencyError('Symbol specifier is not supported when asset check is disabled. Please use normal symbol instead.');
1626
+ }
1627
+ if (!assetCheckEnabled && 'id' in currency) {
1628
+ throw new InvalidCurrencyError('Asset ID is not supported when asset check is disabled. Please use normal symbol instead');
1629
+ }
1630
+ };
1631
+ var validateTransact = function validateTransact(_ref) {
1632
+ var api = _ref.api,
1633
+ from = _ref.from,
1634
+ to = _ref.to,
1635
+ sender = _ref.sender,
1636
+ address = _ref.recipient,
1637
+ transactOptions = _ref.transactOptions;
1638
+ var call = transactOptions === null || transactOptions === void 0 ? void 0 : transactOptions.call;
1639
+ if (!call) return;
1640
+ if (from === to) {
1641
+ throw new UnsupportedOperationError('Cannot use transact options with local transfers.');
1642
+ }
1643
+ if (typeof call === 'string' && !isHex(call)) {
1644
+ throw new ValidationError('Transact call hex must be a valid hex string.');
1645
+ }
1646
+ if (isChainEvm(from) || typeof to === 'string' && isChainEvm(to)) {
1647
+ throw new UnsupportedOperationError('Transact option is only supported for Substrate to Substrate scenarios.');
1648
+ }
1649
+ if (typeof address === 'string' && sender && !compareAddresses(api, address, sender)) {
1650
+ return new ValidationError('Sender address must match the destination address for transact to work.');
1651
+ }
1652
+ };
1653
+
1654
+ var resolveTransferParams = function resolveTransferParams(options) {
1655
+ var api = options.api,
1656
+ origin = options.from,
1657
+ currency = options.currency,
1658
+ feeAsset = options.feeAsset,
1659
+ address = options.recipient,
1660
+ destination = options.to,
1661
+ version = options.version,
1662
+ sender = options.sender;
1663
+ validateCurrency(currency, feeAsset);
1664
+ validateDestination(origin, destination);
1665
+ validateTransact(options);
1666
+ validateDestinationAddress(address, destination, api);
1667
+ if (sender) validateAddress(api, sender, origin, false);
1668
+ var isBridge = !isTLocation(destination) && isSubstrateBridge(origin, destination);
1669
+ var assetCheckEnabled = shouldPerformAssetCheck(origin, currency);
1670
+ validateAssetSpecifiers(assetCheckEnabled, currency);
1671
+ var asset = resolveAsset(currency, origin, destination, assetCheckEnabled);
1672
+ var resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
1673
+ validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
1674
+ var amount = Array.isArray(currency) ? 0n : abstractDecimals(currency.amount, asset === null || asset === void 0 ? void 0 : asset.decimals, api);
1675
+ // Ensure amount is at least 2 to avoid Rust panic (only for non-array currencies)
1676
+ var finalAmount = !Array.isArray(currency) && amount < MIN_AMOUNT ? MIN_AMOUNT : amount;
1677
+ var resolvedVersion = pickCompatibleXcmVersion(origin, destination, version);
1678
+ var overriddenAsset = resolveOverriddenAsset(options, isBridge, assetCheckEnabled, resolvedFeeAsset);
1679
+ // In case asset check is disabled, we create asset object from currency symbol
1680
+ var resolvedAsset = asset !== null && asset !== void 0 ? asset : {
1681
+ symbol: 'symbol' in currency ? currency.symbol : undefined
1682
+ };
1683
+ var finalAsset = Array.isArray(currency) ? // TODO: Refactor this
1684
+ // We use a dummy values when overriding with multi-assets
1685
+ // since these values won't be used but need to pass checks
1686
+ _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
1687
+ amount: 0n,
1688
+ assetId: '1',
1689
+ location: {
1690
+ parents: Parents.ZERO,
1691
+ interior: {
1692
+ Here: null
1693
+ }
1694
+ }
1695
+ }) : _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
1696
+ amount: finalAmount
1697
+ });
1698
+ var normalizedAsset = finalAsset.location ? _objectSpread2(_objectSpread2({}, finalAsset), {}, {
1699
+ location: normalizeLocation(finalAsset.location, resolvedVersion)
1700
+ }) : finalAsset;
1701
+ return {
1702
+ resolvedFeeAsset: resolvedFeeAsset,
1703
+ resolvedVersion: resolvedVersion,
1704
+ overriddenAsset: overriddenAsset,
1705
+ normalizedAsset: normalizedAsset
1706
+ };
1707
+ };
1708
+ var createTransfer = /*#__PURE__*/function () {
1709
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
1710
+ var api, origin, currency, feeAsset, recipient, destination, paraIdTo, sender, ahAddress, pallet, method, transactOptions, isAmountAll, keepAlive, _resolveTransferParam, resolvedFeeAsset, resolvedVersion, overriddenAsset, normalizedAsset;
1711
+ return _regenerator().w(function (_context) {
1712
+ while (1) switch (_context.n) {
1713
+ case 0:
1714
+ api = options.api, origin = options.from, currency = options.currency, feeAsset = options.feeAsset, recipient = options.recipient, destination = options.to, paraIdTo = options.paraIdTo, sender = options.sender, ahAddress = options.ahAddress, pallet = options.pallet, method = options.method, transactOptions = options.transactOptions, isAmountAll = options.isAmountAll, keepAlive = options.keepAlive;
1715
+ _resolveTransferParam = resolveTransferParams(options), resolvedFeeAsset = _resolveTransferParam.resolvedFeeAsset, resolvedVersion = _resolveTransferParam.resolvedVersion, overriddenAsset = _resolveTransferParam.overriddenAsset, normalizedAsset = _resolveTransferParam.normalizedAsset;
1716
+ _context.n = 1;
1717
+ return api.init(origin, TX_CLIENT_TIMEOUT_MS);
1718
+ case 1:
1719
+ return _context.a(2, getChain(origin).transfer({
1720
+ api: api,
1721
+ assetInfo: normalizedAsset,
1722
+ currency: currency,
1723
+ feeAsset: resolvedFeeAsset,
1724
+ feeCurrency: feeAsset,
1725
+ recipient: recipient,
1726
+ to: destination,
1727
+ paraIdTo: paraIdTo,
1728
+ overriddenAsset: overriddenAsset,
1729
+ version: resolvedVersion,
1730
+ sender: sender,
1731
+ ahAddress: ahAddress,
1732
+ pallet: pallet,
1733
+ method: method,
1734
+ transactOptions: transactOptions,
1735
+ isAmountAll: isAmountAll,
1736
+ keepAlive: keepAlive
1737
+ }));
1738
+ }
1739
+ }, _callee);
1740
+ }));
1741
+ return function createTransfer(_x) {
1742
+ return _ref.apply(this, arguments);
1743
+ };
1744
+ }();
1745
+
1746
+ var isAssetHub = function isAssetHub(chain) {
1747
+ return chain === 'AssetHubPolkadot' || chain === 'AssetHubKusama';
1748
+ };
1749
+ var isBridgeHub = function isBridgeHub(chain) {
1750
+ return chain === 'BridgeHubPolkadot' || chain === 'BridgeHubKusama';
1751
+ };
1752
+ var isPeople = function isPeople(chain) {
1753
+ return chain === 'PeoplePolkadot' || chain === 'PeopleKusama';
1754
+ };
1755
+ var isSystemPara = function isSystemPara(chain) {
1756
+ return isAssetHub(chain) || isBridgeHub(chain) || isPeople(chain);
1757
+ };
1758
+ var mul = function mul(v, num) {
1759
+ var den = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1n;
1760
+ return v * num / den;
1761
+ };
1762
+ var padFee = function padFee(raw, origin, dest, side) {
1763
+ var relayOrigin = isRelayChain(origin);
1764
+ var relayDest = isRelayChain(dest);
1765
+ var sysParaOrigin = isSystemPara(origin);
1766
+ var sysParaDest = isSystemPara(dest);
1767
+ var relayToPara = relayOrigin && !relayDest;
1768
+ var sysParaToPara = sysParaOrigin && !sysParaDest;
1769
+ var paraToPara = !relayOrigin && !sysParaOrigin;
1770
+ if (sysParaToPara) return raw * 40n;
1771
+ if (relayToPara) return side === 'origin' ? mul(raw, 320n, 100n) : mul(raw, 3000n, 100n);
1772
+ if (paraToPara && side == 'origin' && origin === 'Mythos' && dest !== 'Ethereum') {
1773
+ return 150000000000000000n;
1774
+ }
1775
+ if (paraToPara) return mul(raw, 130n, 100n);
1776
+ // apply default 30% padding
1777
+ return mul(raw, 130n, 100n);
1778
+ };
1779
+ var padValueBy = function padValueBy(amount, percent) {
1780
+ var scaled = BigInt(Math.round(percent * 100)); // 2 decimal precision
1781
+ return amount * (BigInt(10000) + scaled) / BigInt(10000);
1782
+ };
1783
+
1784
+ var getMythosOriginFee = /*#__PURE__*/function () {
1785
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api) {
1786
+ var ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, ahExecutionFee, nativeAsset, feeConverted;
1787
+ return _regenerator().w(function (_context) {
1788
+ while (1) switch (_context.n) {
1789
+ case 0:
1790
+ ahApi = api.clone();
1791
+ _context.n = 1;
1792
+ return ahApi.init('AssetHubPolkadot');
1793
+ case 1:
1794
+ _context.n = 2;
1795
+ return getParaEthTransferFees(ahApi, false);
1796
+ case 2:
1797
+ _yield$getParaEthTran = _context.v;
1798
+ _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
1799
+ bridgeFee = _yield$getParaEthTran2[0];
1800
+ ahExecutionFee = _yield$getParaEthTran2[1];
1801
+ nativeAsset = findNativeAssetInfoOrThrow('Mythos');
1802
+ _context.n = 3;
1803
+ return ahApi.quoteAhPrice(DOT_LOCATION, nativeAsset.location, bridgeFee + ahExecutionFee);
1804
+ case 3:
1805
+ feeConverted = _context.v;
1806
+ _context.n = 4;
1807
+ return ahApi.disconnect();
1808
+ case 4:
1809
+ if (feeConverted) {
1810
+ _context.n = 5;
1811
+ break;
1812
+ }
1813
+ throw new UnableToComputeError("Pool DOT -> ".concat(nativeAsset.symbol, " not found."));
1814
+ case 5:
1815
+ return _context.a(2, padValueBy(feeConverted, 10));
1816
+ }
1817
+ }, _callee);
1818
+ }));
1819
+ return function getMythosOriginFee(_x) {
1820
+ return _ref.apply(this, arguments);
1821
+ };
1822
+ }();
1823
+
1824
+ var AssetHubPolkadot$1 = {
1825
+ name: "Asset Hub",
1826
+ info: "PolkadotAssetHub",
1827
+ paraId: 1000,
1875
1828
  providers: [
1876
1829
  {
1877
1830
  name: "Dwellir",
1878
- endpoint: "wss://bridge-hub-westend-rpc.n.dwellir.com"
1831
+ endpoint: "wss://asset-hub-polkadot-rpc.n.dwellir.com"
1879
1832
  },
1880
1833
  {
1881
1834
  name: "Dwellir Tunisia",
1882
- endpoint: "wss://westend-bridge-hub-rpc-tn.dwellir.com"
1835
+ endpoint: "wss://statemint-rpc-tn.dwellir.com"
1883
1836
  },
1884
1837
  {
1885
- name: "Parity",
1886
- endpoint: "wss://westend-bridge-hub-rpc.polkadot.io"
1887
- }
1888
- ]
1889
- };
1890
- var CollectivesWestend$1 = {
1891
- name: "Collectives",
1892
- info: "westendCollectives",
1893
- paraId: 1001,
1894
- providers: [
1838
+ name: "IBP1",
1839
+ endpoint: "wss://asset-hub-polkadot.ibp.network"
1840
+ },
1895
1841
  {
1896
- name: "Dwellir",
1897
- endpoint: "wss://collectives-westend-rpc.n.dwellir.com"
1842
+ name: "IBP2",
1843
+ endpoint: "wss://asset-hub-polkadot.dotters.network"
1898
1844
  },
1899
1845
  {
1900
- name: "Dwellir Tunisia",
1901
- endpoint: "wss://westend-collectives-rpc-tn.dwellir.com"
1846
+ name: "LuckyFriday",
1847
+ endpoint: "wss://rpc-asset-hub-polkadot.luckyfriday.io"
1848
+ },
1849
+ {
1850
+ name: "OnFinality",
1851
+ endpoint: "wss://statemint.api.onfinality.io/public-ws"
1902
1852
  },
1903
1853
  {
1904
1854
  name: "Parity",
1905
- endpoint: "wss://westend-collectives-rpc.polkadot.io"
1855
+ endpoint: "wss://polkadot-asset-hub-rpc.polkadot.io"
1856
+ },
1857
+ {
1858
+ name: "RadiumBlock",
1859
+ endpoint: "wss://statemint.public.curie.radiumblock.co/ws"
1906
1860
  }
1907
1861
  ]
1908
1862
  };
1909
- var CoretimeWestend$1 = {
1910
- name: "Coretime",
1911
- info: "westendCoretime",
1912
- paraId: 1005,
1863
+ var Acala$1 = {
1864
+ name: "Acala",
1865
+ info: "acala",
1866
+ paraId: 2000,
1913
1867
  providers: [
1914
1868
  {
1915
- name: "Dwellir",
1916
- endpoint: "wss://coretime-westend-rpc.n.dwellir.com"
1869
+ name: "Acala Foundation 0",
1870
+ endpoint: "wss://acala-rpc-0.aca-api.network"
1917
1871
  },
1918
1872
  {
1919
- name: "Parity",
1920
- endpoint: "wss://westend-coretime-rpc.polkadot.io"
1921
- }
1922
- ]
1923
- };
1924
- var Penpal$1 = {
1925
- name: "Penpal",
1926
- info: "westendPenpal",
1927
- paraId: 2042,
1928
- providers: [
1873
+ name: "Acala Foundation 1",
1874
+ endpoint: "wss://acala-rpc-1.aca-api.network"
1875
+ },
1929
1876
  {
1930
- name: "Parity",
1931
- endpoint: "wss://westend-penpal-rpc.polkadot.io"
1932
- }
1933
- ]
1934
- };
1935
- var PeopleWestend$1 = {
1936
- name: "People",
1937
- info: "westendPeople",
1938
- paraId: 1004,
1939
- providers: [
1877
+ name: "Acala Foundation 3",
1878
+ endpoint: "wss://acala-rpc-3.aca-api.network/ws"
1879
+ },
1940
1880
  {
1941
1881
  name: "Dwellir",
1942
- endpoint: "wss://people-westend-rpc.n.dwellir.com"
1882
+ endpoint: "wss://acala-rpc.n.dwellir.com"
1943
1883
  },
1944
1884
  {
1945
- name: "Parity",
1946
- endpoint: "wss://westend-people-rpc.polkadot.io"
1885
+ name: "IBP1",
1886
+ endpoint: "wss://acala.ibp.network"
1887
+ },
1888
+ {
1889
+ name: "IBP2",
1890
+ endpoint: "wss://acala.dotters.network"
1947
1891
  }
1948
1892
  ]
1949
1893
  };
1950
- var AjunaPaseo$1 = {
1951
- name: "Ajuna Network (Paseo)",
1952
- info: "Ajuna(paseo)",
1894
+ var Ajuna$1 = {
1895
+ name: "Ajuna Network",
1896
+ info: "ajuna",
1953
1897
  paraId: 2051,
1954
1898
  providers: [
1955
1899
  {
1956
- name: "BajunNetwork",
1957
- endpoint: "wss://rpc-paseo.ajuna.network"
1900
+ name: "AjunaNetwork",
1901
+ endpoint: "wss://rpc-para.ajuna.network"
1902
+ },
1903
+ {
1904
+ name: "IBP1",
1905
+ endpoint: "wss://ajuna.ibp.network"
1906
+ },
1907
+ {
1908
+ name: "IBP2",
1909
+ endpoint: "wss://ajuna.dotters.network"
1958
1910
  }
1959
1911
  ]
1960
1912
  };
1961
- var AssetHubPaseo$1 = {
1962
- name: "Asset Hub",
1963
- info: "PaseoAssetHub",
1964
- paraId: 1000,
1913
+ var Astar$1 = {
1914
+ name: "Astar",
1915
+ info: "astar",
1916
+ paraId: 2006,
1965
1917
  providers: [
1966
1918
  {
1967
- name: "Dwellir",
1968
- endpoint: "wss://asset-hub-paseo-rpc.n.dwellir.com"
1919
+ name: "Astar",
1920
+ endpoint: "wss://rpc.astar.network"
1969
1921
  },
1970
1922
  {
1971
- name: "IBP1",
1972
- endpoint: "wss://asset-hub-paseo.ibp.network"
1923
+ name: "Dwellir",
1924
+ endpoint: "wss://astar-rpc.n.dwellir.com"
1973
1925
  },
1974
1926
  {
1975
- name: "IBP2",
1976
- endpoint: "wss://asset-hub-paseo.dotters.network"
1927
+ name: "OnFinality",
1928
+ endpoint: "wss://astar.api.onfinality.io/public-ws"
1977
1929
  },
1978
1930
  {
1979
- name: "TurboFlakes",
1980
- endpoint: "wss://sys.turboflakes.io/asset-hub-paseo"
1931
+ name: "RadiumBlock",
1932
+ endpoint: "wss://astar.public.curie.radiumblock.co/ws"
1981
1933
  }
1982
1934
  ]
1983
1935
  };
1984
- var BifrostPaseo$1 = {
1936
+ var BifrostPolkadot$1 = {
1985
1937
  name: "Bifrost",
1986
- info: "Bifrost(Paseo)",
1938
+ info: "bifrost",
1987
1939
  paraId: 2030,
1988
1940
  providers: [
1941
+ {
1942
+ name: "IBP1",
1943
+ endpoint: "wss://bifrost-polkadot.ibp.network"
1944
+ },
1945
+ {
1946
+ name: "IBP2",
1947
+ endpoint: "wss://bifrost-polkadot.dotters.network"
1948
+ },
1989
1949
  {
1990
1950
  name: "Liebi",
1991
- endpoint: "wss://bifrost-rpc.paseo.liebi.com/ws"
1951
+ endpoint: "wss://hk.p.bifrost-rpc.liebi.com/ws"
1992
1952
  },
1993
1953
  {
1994
- name: "Liebi2",
1995
- endpoint: "wss://bifrost-rpc.paseo2.liebi.com/ws"
1954
+ name: "LiebiEU",
1955
+ endpoint: "wss://eu.bifrost-polkadot-rpc.liebi.com/ws"
1996
1956
  }
1997
1957
  ]
1998
1958
  };
1999
- var BridgeHubPaseo$1 = {
1959
+ var BridgeHubPolkadot$1 = {
2000
1960
  name: "Bridge Hub",
2001
- info: "PaseoBridgeHub",
1961
+ info: "polkadotBridgeHub",
2002
1962
  paraId: 1002,
2003
1963
  providers: [
1964
+ {
1965
+ name: "Dwellir",
1966
+ endpoint: "wss://bridge-hub-polkadot-rpc.n.dwellir.com"
1967
+ },
1968
+ {
1969
+ name: "Dwellir Tunisia",
1970
+ endpoint: "wss://polkadot-bridge-hub-rpc-tn.dwellir.com"
1971
+ },
2004
1972
  {
2005
1973
  name: "IBP1",
2006
- endpoint: "wss://bridge-hub-paseo.ibp.network"
1974
+ endpoint: "wss://bridge-hub-polkadot.ibp.network"
2007
1975
  },
2008
1976
  {
2009
1977
  name: "IBP2",
2010
- endpoint: "wss://bridge-hub-paseo.dotters.network"
1978
+ endpoint: "wss://bridge-hub-polkadot.dotters.network"
1979
+ },
1980
+ {
1981
+ name: "LuckyFriday",
1982
+ endpoint: "wss://rpc-bridge-hub-polkadot.luckyfriday.io"
1983
+ },
1984
+ {
1985
+ name: "OnFinality",
1986
+ endpoint: "wss://bridgehub-polkadot.api.onfinality.io/public-ws"
1987
+ },
1988
+ {
1989
+ name: "Parity",
1990
+ endpoint: "wss://polkadot-bridge-hub-rpc.polkadot.io"
1991
+ },
1992
+ {
1993
+ name: "RadiumBlock",
1994
+ endpoint: "wss://bridgehub-polkadot.public.curie.radiumblock.co/ws"
1995
+ },
1996
+ {
1997
+ name: "Spectrum",
1998
+ endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/mgX--uWlEtmNKw/polkadotbridgehub/mainnet/"
2011
1999
  }
2012
2000
  ]
2013
2001
  };
2014
- var CoretimePaseo$1 = {
2015
- name: "Coretime",
2016
- info: "PaseoCoretime",
2017
- paraId: 1005,
2002
+ var Centrifuge$1 = {
2003
+ name: "Centrifuge",
2004
+ info: "centrifuge",
2005
+ paraId: 2031,
2018
2006
  providers: [
2019
2007
  {
2020
- name: "IBP1",
2021
- endpoint: "wss://coretime-paseo.ibp.network"
2008
+ name: "LuckyFriday",
2009
+ endpoint: "wss://rpc-centrifuge.luckyfriday.io"
2022
2010
  },
2023
2011
  {
2024
- name: "IBP2",
2025
- endpoint: "wss://coretime-paseo.dotters.network"
2012
+ name: "OnFinality",
2013
+ endpoint: "wss://centrifuge-parachain.api.onfinality.io/public-ws"
2026
2014
  }
2027
2015
  ]
2028
2016
  };
2029
- var EnergyWebXPaseo$1 = {
2030
- name: "PEX",
2031
- info: "paseoEwx",
2017
+ var Darwinia$1 = {
2018
+ name: "Darwinia",
2019
+ info: "darwinia",
2020
+ paraId: 2046,
2021
+ providers: [
2022
+ {
2023
+ name: "Darwinia",
2024
+ endpoint: "wss://rpc.darwinia.network"
2025
+ },
2026
+ {
2027
+ name: "Subquery",
2028
+ endpoint: "wss://darwinia.rpc.subquery.network/public/ws"
2029
+ }
2030
+ ]
2031
+ };
2032
+ var EnergyWebX$1 = {
2033
+ name: "Energy Web X",
2034
+ info: "ewx",
2032
2035
  paraId: 3345,
2033
2036
  providers: [
2034
2037
  {
2035
2038
  name: "Energy Web",
2036
- endpoint: "wss://public-rpc.testnet.energywebx.com/"
2039
+ endpoint: "wss://wnp-rpc.mainnet.energywebx.com/"
2037
2040
  }
2038
2041
  ]
2039
2042
  };
2040
- var HeimaPaseo$1 = {
2041
- name: "Heima paseo",
2042
- info: "heima-paseo",
2043
- paraId: 2106,
2043
+ var Hydration$1 = {
2044
+ name: "Hydration",
2045
+ info: "hydradx",
2046
+ paraId: 2034,
2044
2047
  providers: [
2045
2048
  {
2046
- name: "Heima",
2047
- endpoint: "wss://rpc.paseo-parachain.heima.network"
2049
+ name: "Helikon",
2050
+ endpoint: "wss://rpc.helikon.io/hydradx"
2051
+ },
2052
+ {
2053
+ name: "IBP1",
2054
+ endpoint: "wss://hydration.ibp.network"
2055
+ },
2056
+ {
2057
+ name: "IBP2",
2058
+ endpoint: "wss://hydration.dotters.network"
2048
2059
  }
2049
2060
  ]
2050
2061
  };
2051
- var HydrationPaseo$1 = {
2052
- name: "Hydration (Paseo)",
2053
- info: "rococoHydraDX",
2054
- paraId: 2034,
2062
+ var Interlay$1 = {
2063
+ name: "Interlay",
2064
+ info: "interlay",
2065
+ paraId: 2032,
2055
2066
  providers: [
2056
2067
  {
2057
- name: "Galactic Council",
2058
- endpoint: "wss://paseo-rpc.play.hydration.cloud"
2068
+ name: "Kintsugi Labs",
2069
+ endpoint: "wss://api.interlay.io/parachain"
2070
+ },
2071
+ {
2072
+ name: "LuckyFriday",
2073
+ endpoint: "wss://rpc-interlay.luckyfriday.io/"
2059
2074
  }
2060
2075
  ]
2061
2076
  };
2062
- var LaosPaseo$1 = {
2063
- name: "Laos Sigma",
2064
- info: "laos-sigma",
2065
- paraId: 4006,
2077
+ var Heima$1 = {
2078
+ name: "Heima",
2079
+ info: "heima",
2080
+ paraId: 2013,
2066
2081
  providers: [
2067
2082
  {
2068
- name: "freeverse.io",
2069
- endpoint: "wss://rpc.laossigma.laosfoundation.io"
2083
+ name: "Dwellir",
2084
+ endpoint: "wss://heima-rpc.n.dwellir.com"
2085
+ },
2086
+ {
2087
+ name: "Heima",
2088
+ endpoint: "wss://rpc.heima-parachain.heima.network"
2070
2089
  }
2071
2090
  ]
2072
2091
  };
2073
- var NeuroWebPaseo$1 = {
2074
- name: "NeuroWeb Testnet",
2075
- info: "NeuroWeb",
2076
- paraId: 2043,
2092
+ var Jamton$1 = {
2093
+ name: "JAMTON",
2094
+ info: "jamton",
2095
+ paraId: 3397,
2077
2096
  providers: [
2078
2097
  {
2079
- name: "TraceLabs",
2080
- endpoint: "wss://parachain-testnet-rpc.origin-trail.network/"
2098
+ name: "Jamton",
2099
+ endpoint: "wss://rpc.jamton.network"
2081
2100
  }
2082
2101
  ]
2083
2102
  };
2084
- var PeoplePaseo$1 = {
2085
- name: "People",
2086
- info: "PaseoPeopleChain",
2087
- paraId: 1004,
2103
+ var Moonbeam$1 = {
2104
+ name: "Moonbeam",
2105
+ info: "moonbeam",
2106
+ paraId: 2004,
2088
2107
  providers: [
2089
2108
  {
2090
- name: "Amforc",
2091
- endpoint: "wss://people-paseo.rpc.amforc.com"
2109
+ name: "Allnodes",
2110
+ endpoint: "wss://moonbeam-rpc.publicnode.com"
2092
2111
  },
2093
2112
  {
2094
2113
  name: "IBP1",
2095
- endpoint: "wss://people-paseo.ibp.network"
2114
+ endpoint: "wss://moonbeam.ibp.network"
2096
2115
  },
2097
2116
  {
2098
2117
  name: "IBP2",
2099
- endpoint: "wss://people-paseo.dotters.network"
2100
- }
2101
- ]
2102
- };
2103
- var ZeitgeistPaseo$1 = {
2104
- name: "Zeitgeist Battery Station",
2105
- info: "ZeitgeistBatteryStation",
2106
- paraId: 2101,
2107
- providers: [
2118
+ endpoint: "wss://moonbeam.dotters.network"
2119
+ },
2108
2120
  {
2109
- name: "Zeitgeist",
2110
- endpoint: "wss://bsr.zeitgeist.pm"
2121
+ name: "Moonbeam Foundation",
2122
+ endpoint: "wss://wss.api.moonbeam.network"
2123
+ },
2124
+ {
2125
+ name: "OnFinality",
2126
+ endpoint: "wss://moonbeam.api.onfinality.io/public-ws"
2127
+ },
2128
+ {
2129
+ name: "RadiumBlock",
2130
+ endpoint: "wss://moonbeam.public.curie.radiumblock.co/ws"
2131
+ },
2132
+ {
2133
+ name: "UnitedBloc",
2134
+ endpoint: "wss://moonbeam.unitedbloc.com"
2111
2135
  }
2112
2136
  ]
2113
2137
  };
2114
- var Polkadot$1 = {
2115
- name: "Polkadot Relay",
2116
- info: "polkadot",
2117
- paraId: 0,
2138
+ var CoretimePolkadot$1 = {
2139
+ name: "Coretime",
2140
+ info: "polkadotCoretime",
2141
+ paraId: 1005,
2118
2142
  providers: [
2119
2143
  {
2120
- name: "Allnodes",
2121
- endpoint: "wss://polkadot-rpc.publicnode.com"
2144
+ name: "Dwellir",
2145
+ endpoint: "wss://coretime-polkadot-rpc.n.dwellir.com"
2122
2146
  },
2123
2147
  {
2124
- name: "Dwellir",
2125
- endpoint: "wss://polkadot-rpc.n.dwellir.com"
2148
+ name: "IBP1",
2149
+ endpoint: "wss://coretime-polkadot.ibp.network"
2126
2150
  },
2127
2151
  {
2128
- name: "Dwellir Tunisia",
2129
- endpoint: "wss://polkadot-rpc-tn.dwellir.com"
2152
+ name: "IBP2",
2153
+ endpoint: "wss://coretime-polkadot.dotters.network"
2130
2154
  },
2131
2155
  {
2132
- name: "Helixstreet",
2133
- endpoint: "wss://rpc-polkadot.helixstreet.io"
2156
+ name: "LuckyFriday",
2157
+ endpoint: "wss://rpc-coretime-polkadot.luckyfriday.io"
2158
+ },
2159
+ {
2160
+ name: "OnFinality",
2161
+ endpoint: "wss://coretime-polkadot.api.onfinality.io/public-ws"
2162
+ },
2163
+ {
2164
+ name: "Parity",
2165
+ endpoint: "wss://polkadot-coretime-rpc.polkadot.io"
2166
+ },
2167
+ {
2168
+ name: "RadiumBlock",
2169
+ endpoint: "wss://coretime-polkadot.public.curie.radiumblock.co/ws"
2170
+ }
2171
+ ]
2172
+ };
2173
+ var Collectives$1 = {
2174
+ name: "Collectives",
2175
+ info: "polkadotCollectives",
2176
+ paraId: 1001,
2177
+ providers: [
2178
+ {
2179
+ name: "Dwellir",
2180
+ endpoint: "wss://collectives-polkadot-rpc.n.dwellir.com"
2181
+ },
2182
+ {
2183
+ name: "Dwellir Tunisia",
2184
+ endpoint: "wss://polkadot-collectives-rpc-tn.dwellir.com"
2134
2185
  },
2135
2186
  {
2136
2187
  name: "IBP1",
2137
- endpoint: "wss://polkadot.ibp.network"
2188
+ endpoint: "wss://collectives-polkadot.ibp.network"
2138
2189
  },
2139
2190
  {
2140
2191
  name: "IBP2",
2141
- endpoint: "wss://polkadot.dotters.network"
2192
+ endpoint: "wss://collectives-polkadot.dotters.network"
2142
2193
  },
2143
2194
  {
2144
2195
  name: "LuckyFriday",
2145
- endpoint: "wss://rpc-polkadot.luckyfriday.io"
2196
+ endpoint: "wss://rpc-collectives-polkadot.luckyfriday.io"
2146
2197
  },
2147
2198
  {
2148
2199
  name: "OnFinality",
2149
- endpoint: "wss://polkadot.api.onfinality.io/public-ws"
2200
+ endpoint: "wss://collectives.api.onfinality.io/public-ws"
2201
+ },
2202
+ {
2203
+ name: "Parity",
2204
+ endpoint: "wss://polkadot-collectives-rpc.polkadot.io"
2150
2205
  },
2151
2206
  {
2152
2207
  name: "RadiumBlock",
2153
- endpoint: "wss://polkadot.public.curie.radiumblock.co/ws"
2208
+ endpoint: "wss://collectives.public.curie.radiumblock.co/ws"
2209
+ }
2210
+ ]
2211
+ };
2212
+ var Crust$1 = {
2213
+ name: "Crust",
2214
+ info: "crustParachain",
2215
+ paraId: 2008,
2216
+ providers: [
2217
+ {
2218
+ name: "Crust",
2219
+ endpoint: "wss://crust-parachain.crustapps.net"
2154
2220
  },
2155
2221
  {
2156
- name: "Spectrum",
2157
- endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/LjwBJpV3dIKyWQ/polkadot/mainnet/"
2222
+ name: "Crust APP",
2223
+ endpoint: "wss://crust-parachain.crustnetwork.app"
2158
2224
  },
2159
2225
  {
2160
- name: "Stakeworld",
2161
- endpoint: "wss://rpc-polkadot.stakeworld.io"
2226
+ name: "Crust CC",
2227
+ endpoint: "wss://crust-parachain.crustnetwork.cc"
2162
2228
  },
2163
2229
  {
2164
- name: "SubQuery",
2165
- endpoint: "wss://polkadot.rpc.subquery.network/public/ws"
2230
+ name: "Crust XYZ",
2231
+ endpoint: "wss://crust-parachain.crustnetwork.xyz"
2166
2232
  }
2167
2233
  ]
2168
2234
  };
2169
- var Kusama$1 = {
2170
- name: "Kusama Relay",
2171
- info: "kusama",
2172
- paraId: 0,
2235
+ var Manta$1 = {
2236
+ name: "Manta",
2237
+ info: "manta",
2238
+ paraId: 2104,
2173
2239
  providers: [
2174
2240
  {
2175
- name: "Allnodes",
2176
- endpoint: "wss://kusama-rpc.publicnode.com"
2177
- },
2241
+ name: "Manta Network",
2242
+ endpoint: "wss://ws.manta.systems"
2243
+ }
2244
+ ]
2245
+ };
2246
+ var NeuroWeb$1 = {
2247
+ name: "NeuroWeb",
2248
+ info: "neuroweb",
2249
+ paraId: 2043,
2250
+ providers: [
2178
2251
  {
2179
- name: "Dwellir",
2180
- endpoint: "wss://kusama-rpc.n.dwellir.com"
2181
- },
2252
+ name: "TraceLabs",
2253
+ endpoint: "wss://parachain-rpc.origin-trail.network"
2254
+ }
2255
+ ]
2256
+ };
2257
+ var Pendulum$1 = {
2258
+ name: "Pendulum",
2259
+ info: "pendulum",
2260
+ paraId: 2094,
2261
+ providers: [
2182
2262
  {
2183
- name: "Dwellir Tunisia",
2184
- endpoint: "wss://kusama-rpc-tn.dwellir.com"
2185
- },
2263
+ name: "PendulumChain",
2264
+ endpoint: "wss://rpc-pendulum.prd.pendulumchain.tech"
2265
+ }
2266
+ ]
2267
+ };
2268
+ var Mythos$1 = {
2269
+ name: "Mythos",
2270
+ info: "mythos",
2271
+ paraId: 3369,
2272
+ providers: [
2186
2273
  {
2187
- name: "Helixstreet",
2188
- endpoint: "wss://rpc-kusama.helixstreet.io"
2274
+ name: "parity",
2275
+ endpoint: "wss://polkadot-mythos-rpc.polkadot.io"
2276
+ }
2277
+ ]
2278
+ };
2279
+ var Peaq$1 = {
2280
+ name: "peaq",
2281
+ info: "peaq",
2282
+ paraId: 3338,
2283
+ providers: [
2284
+ {
2285
+ name: "OnFinality",
2286
+ endpoint: "wss://peaq.api.onfinality.io/public-ws"
2287
+ }
2288
+ ]
2289
+ };
2290
+ var PeoplePolkadot$1 = {
2291
+ name: "People",
2292
+ info: "polkadotPeople",
2293
+ paraId: 1004,
2294
+ providers: [
2295
+ {
2296
+ name: "Dwellir",
2297
+ endpoint: "wss://people-polkadot-rpc.n.dwellir.com"
2189
2298
  },
2190
2299
  {
2191
2300
  name: "IBP1",
2192
- endpoint: "wss://kusama.ibp.network"
2301
+ endpoint: "wss://people-polkadot.ibp.network"
2193
2302
  },
2194
2303
  {
2195
2304
  name: "IBP2",
2196
- endpoint: "wss://kusama.dotters.network"
2305
+ endpoint: "wss://people-polkadot.dotters.network"
2197
2306
  },
2198
2307
  {
2199
2308
  name: "LuckyFriday",
2200
- endpoint: "wss://rpc-kusama.luckyfriday.io"
2309
+ endpoint: "wss://rpc-people-polkadot.luckyfriday.io"
2201
2310
  },
2202
2311
  {
2203
2312
  name: "OnFinality",
2204
- endpoint: "wss://kusama.api.onfinality.io/public-ws"
2205
- },
2206
- {
2207
- name: "RadiumBlock",
2208
- endpoint: "wss://kusama.public.curie.radiumblock.co/ws"
2313
+ endpoint: "wss://people-polkadot.api.onfinality.io/public-ws"
2209
2314
  },
2210
2315
  {
2211
- name: "Spectrum",
2212
- endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/QXq7QZ6Q60NDzA/kusama/mainnet/"
2316
+ name: "Parity",
2317
+ endpoint: "wss://polkadot-people-rpc.polkadot.io"
2213
2318
  },
2214
2319
  {
2215
- name: "Stakeworld",
2216
- endpoint: "wss://rpc-kusama.stakeworld.io"
2320
+ name: "RadiumBlock",
2321
+ endpoint: "wss://people-polkadot.public.curie.radiumblock.co/ws"
2217
2322
  }
2218
2323
  ]
2219
2324
  };
2220
- var Westend$1 = {
2221
- name: "Westend Relay",
2222
- info: "westend",
2223
- paraId: 0,
2325
+ var Unique$1 = {
2326
+ name: "Unique Network",
2327
+ info: "unique",
2328
+ paraId: 2037,
2224
2329
  providers: [
2225
2330
  {
2226
- name: "Dwellir",
2227
- endpoint: "wss://westend-rpc.n.dwellir.com"
2331
+ name: "Geo Load Balancer",
2332
+ endpoint: "wss://ws.unique.network"
2228
2333
  },
2229
2334
  {
2230
- name: "Dwellir Tunisia",
2231
- endpoint: "wss://westend-rpc-tn.dwellir.com"
2335
+ name: "IBP1",
2336
+ endpoint: "wss://unique.ibp.network"
2232
2337
  },
2233
2338
  {
2234
- name: "OnFinality",
2235
- endpoint: "wss://westend.api.onfinality.io/public-ws"
2339
+ name: "IBP2",
2340
+ endpoint: "wss://unique.dotters.network"
2341
+ }
2342
+ ]
2343
+ };
2344
+ var Xode$1 = {
2345
+ name: "Xode",
2346
+ info: "xode",
2347
+ paraId: 3417,
2348
+ providers: [
2349
+ {
2350
+ name: "RakSonCebu",
2351
+ endpoint: "wss://rakson-ceb-rpc.xode.net"
2236
2352
  },
2237
2353
  {
2238
- name: "Parity",
2239
- endpoint: "wss://westend-rpc.polkadot.io"
2354
+ name: "RakSonKorea",
2355
+ endpoint: "wss://rakson-rpc.xode.net"
2240
2356
  },
2241
2357
  {
2242
- name: "RadiumBlock",
2243
- endpoint: "wss://westend.public.curie.radiumblock.co/ws"
2358
+ name: "XodeCommunity",
2359
+ endpoint: "wss://polkadot-rpcnode.xode.net"
2244
2360
  }
2245
2361
  ]
2246
2362
  };
2247
- var Paseo$1 = {
2248
- name: "Paseo Relay",
2249
- info: "paseo",
2250
- paraId: 0,
2363
+ var AssetHubKusama$1 = {
2364
+ name: "Asset Hub",
2365
+ info: "KusamaAssetHub",
2366
+ paraId: 1000,
2251
2367
  providers: [
2252
2368
  {
2253
- name: "Amforc",
2254
- endpoint: "wss://paseo.rpc.amforc.com"
2369
+ name: "Dwellir",
2370
+ endpoint: "wss://asset-hub-kusama-rpc.n.dwellir.com"
2255
2371
  },
2256
2372
  {
2257
- name: "Dwellir",
2258
- endpoint: "wss://paseo-rpc.n.dwellir.com"
2373
+ name: "Dwellir Tunisia",
2374
+ endpoint: "wss://statemine-rpc-tn.dwellir.com"
2259
2375
  },
2260
2376
  {
2261
2377
  name: "IBP1",
2262
- endpoint: "wss://paseo.ibp.network"
2378
+ endpoint: "wss://asset-hub-kusama.ibp.network"
2263
2379
  },
2264
2380
  {
2265
2381
  name: "IBP2",
2266
- endpoint: "wss://paseo.dotters.network"
2382
+ endpoint: "wss://asset-hub-kusama.dotters.network"
2383
+ },
2384
+ {
2385
+ name: "LuckyFriday",
2386
+ endpoint: "wss://rpc-asset-hub-kusama.luckyfriday.io"
2387
+ },
2388
+ {
2389
+ name: "OnFinality",
2390
+ endpoint: "wss://assethub-kusama.api.onfinality.io/public-ws"
2391
+ },
2392
+ {
2393
+ name: "Parity",
2394
+ endpoint: "wss://kusama-asset-hub-rpc.polkadot.io"
2395
+ },
2396
+ {
2397
+ name: "RadiumBlock",
2398
+ endpoint: "wss://statemine.public.curie.radiumblock.co/ws"
2267
2399
  }
2268
2400
  ]
2269
2401
  };
2270
- var configs = {
2271
- AssetHubPolkadot: AssetHubPolkadot$1,
2272
- Acala: Acala$1,
2273
- Ajuna: Ajuna$1,
2274
- Astar: Astar$1,
2275
- BifrostPolkadot: BifrostPolkadot$1,
2276
- BridgeHubPolkadot: BridgeHubPolkadot$1,
2277
- Centrifuge: Centrifuge$1,
2278
- Darwinia: Darwinia$1,
2279
- EnergyWebX: EnergyWebX$1,
2280
- Hydration: Hydration$1,
2281
- Interlay: Interlay$1,
2282
- Heima: Heima$1,
2283
- Jamton: Jamton$1,
2284
- Moonbeam: Moonbeam$1,
2285
- CoretimePolkadot: CoretimePolkadot$1,
2286
- Collectives: Collectives$1,
2287
- Crust: Crust$1,
2288
- Manta: Manta$1,
2289
- NeuroWeb: NeuroWeb$1,
2290
- Pendulum: Pendulum$1,
2291
- Mythos: Mythos$1,
2292
- Peaq: Peaq$1,
2293
- PeoplePolkadot: PeoplePolkadot$1,
2294
- Unique: Unique$1,
2295
- Xode: Xode$1,
2296
- AssetHubKusama: AssetHubKusama$1,
2297
- BridgeHubKusama: BridgeHubKusama$1,
2298
- Karura: Karura$1,
2299
- Kintsugi: Kintsugi$1,
2300
- Moonriver: Moonriver$1,
2301
- CoretimeKusama: CoretimeKusama$1,
2302
- Encointer: Encointer$1,
2303
- Basilisk: Basilisk$1,
2304
- BifrostKusama: BifrostKusama$1,
2305
- CrustShadow: CrustShadow$1,
2306
- Crab: Crab$1,
2307
- Laos: Laos$1,
2308
- Quartz: Quartz$1,
2309
- RobonomicsPolkadot: RobonomicsPolkadot$1,
2310
- PeopleKusama: PeopleKusama$1,
2311
- Shiden: Shiden$1,
2312
- Zeitgeist: Zeitgeist$1,
2313
- AssetHubWestend: AssetHubWestend$1,
2314
- BridgeHubWestend: BridgeHubWestend$1,
2315
- CollectivesWestend: CollectivesWestend$1,
2316
- CoretimeWestend: CoretimeWestend$1,
2317
- Penpal: Penpal$1,
2318
- PeopleWestend: PeopleWestend$1,
2319
- AjunaPaseo: AjunaPaseo$1,
2320
- AssetHubPaseo: AssetHubPaseo$1,
2321
- BifrostPaseo: BifrostPaseo$1,
2322
- BridgeHubPaseo: BridgeHubPaseo$1,
2323
- CoretimePaseo: CoretimePaseo$1,
2324
- EnergyWebXPaseo: EnergyWebXPaseo$1,
2325
- HeimaPaseo: HeimaPaseo$1,
2326
- HydrationPaseo: HydrationPaseo$1,
2327
- LaosPaseo: LaosPaseo$1,
2328
- NeuroWebPaseo: NeuroWebPaseo$1,
2329
- PeoplePaseo: PeoplePaseo$1,
2330
- ZeitgeistPaseo: ZeitgeistPaseo$1,
2331
- Polkadot: Polkadot$1,
2332
- Kusama: Kusama$1,
2333
- Westend: Westend$1,
2334
- Paseo: Paseo$1
2402
+ var BridgeHubKusama$1 = {
2403
+ name: "Bridge Hub",
2404
+ info: "kusamaBridgeHub",
2405
+ paraId: 1002,
2406
+ providers: [
2407
+ {
2408
+ name: "Dwellir",
2409
+ endpoint: "wss://bridge-hub-kusama-rpc.n.dwellir.com"
2410
+ },
2411
+ {
2412
+ name: "Dwellir Tunisia",
2413
+ endpoint: "wss://kusama-bridge-hub-rpc-tn.dwellir.com"
2414
+ },
2415
+ {
2416
+ name: "IBP1",
2417
+ endpoint: "wss://bridge-hub-kusama.ibp.network"
2418
+ },
2419
+ {
2420
+ name: "IBP2",
2421
+ endpoint: "wss://bridge-hub-kusama.dotters.network"
2422
+ },
2423
+ {
2424
+ name: "LuckyFriday",
2425
+ endpoint: "wss://rpc-bridge-hub-kusama.luckyfriday.io"
2426
+ },
2427
+ {
2428
+ name: "OnFinality",
2429
+ endpoint: "wss://bridgehub-kusama.api.onfinality.io/public-ws"
2430
+ },
2431
+ {
2432
+ name: "Parity",
2433
+ endpoint: "wss://kusama-bridge-hub-rpc.polkadot.io"
2434
+ },
2435
+ {
2436
+ name: "RadiumBlock",
2437
+ endpoint: "wss://bridgehub-kusama.public.curie.radiumblock.co/ws"
2438
+ },
2439
+ {
2440
+ name: "Spectrum",
2441
+ endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/balkpUVauqyv8g/kusamabridgehub/mainnet/"
2442
+ }
2443
+ ]
2335
2444
  };
2336
-
2337
- var configsMap = configs;
2338
- var getChainConfig = function getChainConfig(chain) {
2339
- return configsMap[chain];
2445
+ var Karura$1 = {
2446
+ name: "Karura",
2447
+ info: "karura",
2448
+ paraId: 2000,
2449
+ providers: [
2450
+ {
2451
+ name: "Acala Foundation 0",
2452
+ endpoint: "wss://karura-rpc-0.aca-api.network"
2453
+ },
2454
+ {
2455
+ name: "Acala Foundation 1",
2456
+ endpoint: "wss://karura-rpc-1.aca-api.network"
2457
+ },
2458
+ {
2459
+ name: "Acala Foundation 2",
2460
+ endpoint: "wss://karura-rpc-2.aca-api.network/ws"
2461
+ },
2462
+ {
2463
+ name: "Acala Foundation 3",
2464
+ endpoint: "wss://karura-rpc-3.aca-api.network/ws"
2465
+ },
2466
+ {
2467
+ name: "Dwellir",
2468
+ endpoint: "wss://karura-rpc.n.dwellir.com"
2469
+ }
2470
+ ]
2340
2471
  };
2341
-
2342
- var getChainProviders = function getChainProviders(chain) {
2343
- var _getChainConfig = getChainConfig(chain),
2344
- providers = _getChainConfig.providers;
2345
- if (providers.length === 0) {
2346
- throw new ProviderUnavailableError("No providers found for chain ".concat(chain));
2347
- }
2348
- // Prefer Dwellir provider
2349
- providers.sort(function (a, b) {
2350
- return (a.name === 'Dwellir' ? 0 : 1) - (b.name === 'Dwellir' ? 0 : 1);
2351
- });
2352
- return providers.map(function (p) {
2353
- return p.endpoint;
2354
- });
2472
+ var Kintsugi$1 = {
2473
+ name: "Kintsugi BTC",
2474
+ info: "kintsugi",
2475
+ paraId: 2092,
2476
+ providers: [
2477
+ {
2478
+ name: "Kintsugi Labs",
2479
+ endpoint: "wss://api-kusama.interlay.io/parachain"
2480
+ },
2481
+ {
2482
+ name: "OnFinality",
2483
+ endpoint: "wss://kintsugi.api.onfinality.io/public-ws"
2484
+ }
2485
+ ]
2355
2486
  };
2356
-
2357
- // PayFees instruction is removed temporarily in favor of BuyExecution everywhere,
2358
- // but we keep this function for now in case we need to add it back in the future
2359
- var createPayFees = function createPayFees(_version, asset, weight) {
2360
- return [{
2361
- BuyExecution: {
2362
- fees: asset,
2363
- weight_limit: weight ? {
2364
- Limited: {
2365
- ref_time: weight.refTime,
2366
- proof_size: weight.proofSize
2367
- }
2368
- } : 'Unlimited'
2369
- }
2370
- }];
2487
+ var Moonriver$1 = {
2488
+ name: "Moonriver",
2489
+ info: "moonriver",
2490
+ paraId: 2023,
2491
+ providers: [
2492
+ {
2493
+ name: "Allnodes",
2494
+ endpoint: "wss://moonriver-rpc.publicnode.com"
2495
+ },
2496
+ {
2497
+ name: "Moonbeam Foundation",
2498
+ endpoint: "wss://wss.api.moonriver.moonbeam.network"
2499
+ },
2500
+ {
2501
+ name: "OnFinality",
2502
+ endpoint: "wss://moonriver.api.onfinality.io/public-ws"
2503
+ },
2504
+ {
2505
+ name: "RadiumBlock",
2506
+ endpoint: "wss://moonriver.public.curie.radiumblock.co/ws"
2507
+ },
2508
+ {
2509
+ name: "UnitedBloc",
2510
+ endpoint: "wss://moonriver.unitedbloc.com"
2511
+ }
2512
+ ]
2371
2513
  };
2372
-
2373
- var resolveTx = /*#__PURE__*/function () {
2374
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(destApi, _ref) {
2375
- var call;
2376
- return _regenerator().w(function (_context) {
2377
- while (1) switch (_context.n) {
2378
- case 0:
2379
- call = _ref.call;
2380
- if (!(typeof call !== 'string')) {
2381
- _context.n = 1;
2382
- break;
2383
- }
2384
- return _context.a(2, call);
2385
- case 1:
2386
- return _context.a(2, destApi.txFromHex(call));
2387
- }
2388
- }, _callee);
2389
- }));
2390
- return function resolveTx(_x, _x2) {
2391
- return _ref2.apply(this, arguments);
2392
- };
2393
- }();
2394
- var resolveMaxWeight = /*#__PURE__*/function () {
2395
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(api, version, destChain, address, options) {
2396
- var maxWeight, destApi, tx, _yield$destApi$getPay, weight;
2397
- return _regenerator().w(function (_context2) {
2398
- while (1) switch (_context2.n) {
2399
- case 0:
2400
- maxWeight = options.maxWeight;
2401
- if (!maxWeight) {
2402
- _context2.n = 1;
2403
- break;
2404
- }
2405
- return _context2.a(2, maxWeight);
2406
- case 1:
2407
- if (!(version < Version.V5)) {
2408
- _context2.n = 5;
2409
- break;
2410
- }
2411
- destApi = api.clone();
2412
- _context2.n = 2;
2413
- return destApi.init(destChain);
2414
- case 2:
2415
- _context2.n = 3;
2416
- return resolveTx(destApi, options);
2417
- case 3:
2418
- tx = _context2.v;
2419
- _context2.n = 4;
2420
- return destApi.getPaymentInfo(tx, address);
2421
- case 4:
2422
- _yield$destApi$getPay = _context2.v;
2423
- weight = _yield$destApi$getPay.weight;
2424
- return _context2.a(2, weight);
2425
- case 5:
2426
- return _context2.a(2, undefined);
2427
- }
2428
- }, _callee2);
2429
- }));
2430
- return function resolveMaxWeight(_x3, _x4, _x5, _x6, _x7) {
2431
- return _ref3.apply(this, arguments);
2432
- };
2433
- }();
2434
- var convertWeight = function convertWeight(weight) {
2435
- if (weight) return {
2436
- ref_time: weight.refTime,
2437
- proof_size: weight.proofSize
2438
- };
2439
- return undefined;
2514
+ var CoretimeKusama$1 = {
2515
+ name: "Coretime",
2516
+ info: "kusamaCoretime",
2517
+ paraId: 1005,
2518
+ providers: [
2519
+ {
2520
+ name: "Dwellir",
2521
+ endpoint: "wss://coretime-kusama-rpc.n.dwellir.com"
2522
+ },
2523
+ {
2524
+ name: "IBP1",
2525
+ endpoint: "wss://coretime-kusama.ibp.network"
2526
+ },
2527
+ {
2528
+ name: "IBP2",
2529
+ endpoint: "wss://coretime-kusama.dotters.network"
2530
+ },
2531
+ {
2532
+ name: "LuckyFriday",
2533
+ endpoint: "wss://rpc-coretime-kusama.luckyfriday.io"
2534
+ },
2535
+ {
2536
+ name: "OnFinality",
2537
+ endpoint: "wss://coretime-kusama.api.onfinality.io/public-ws"
2538
+ },
2539
+ {
2540
+ name: "Parity",
2541
+ endpoint: "wss://kusama-coretime-rpc.polkadot.io"
2542
+ }
2543
+ ]
2440
2544
  };
2441
- var createTransactInstructions = /*#__PURE__*/function () {
2442
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(api, options, version, destChain, address) {
2443
- var call, originKind, weightKey, weight;
2444
- return _regenerator().w(function (_context3) {
2445
- while (1) switch (_context3.n) {
2446
- case 0:
2447
- call = options.call, originKind = options.originKind;
2448
- weightKey = version < Version.V5 ? 'require_weight_at_most' : 'fallback_max_weight';
2449
- _context3.n = 1;
2450
- return resolveMaxWeight(api, version, destChain, address, options);
2451
- case 1:
2452
- weight = _context3.v;
2453
- return _context3.a(2, [{
2454
- Transact: _defineProperty(_defineProperty({
2455
- origin_kind: originKind !== null && originKind !== void 0 ? originKind : 'SovereignAccount'
2456
- }, weightKey, convertWeight(weight)), "call", call)
2457
- }, {
2458
- ExpectTransactStatus: {
2459
- Success: undefined
2460
- }
2461
- }]);
2462
- }
2463
- }, _callee3);
2464
- }));
2465
- return function createTransactInstructions(_x8, _x9, _x0, _x1, _x10) {
2466
- return _ref4.apply(this, arguments);
2467
- };
2468
- }();
2469
-
2470
- var compareAddresses = function compareAddresses(api, addr1, addr2) {
2471
- var hex1 = api.accountToHex(addr1);
2472
- var hex2 = api.accountToHex(addr2);
2473
- return hex1 === hex2;
2545
+ var Encointer$1 = {
2546
+ name: "Encointer Network",
2547
+ info: "encointer",
2548
+ paraId: 1001,
2549
+ providers: [
2550
+ {
2551
+ name: "Dwellir",
2552
+ endpoint: "wss://encointer-kusama-rpc.n.dwellir.com"
2553
+ },
2554
+ {
2555
+ name: "Encointer Association",
2556
+ endpoint: "wss://kusama.api.encointer.org"
2557
+ },
2558
+ {
2559
+ name: "IBP1",
2560
+ endpoint: "wss://encointer-kusama.ibp.network"
2561
+ },
2562
+ {
2563
+ name: "IBP2",
2564
+ endpoint: "wss://encointer-kusama.dotters.network"
2565
+ },
2566
+ {
2567
+ name: "LuckyFriday",
2568
+ endpoint: "wss://rpc-encointer-kusama.luckyfriday.io"
2569
+ }
2570
+ ]
2474
2571
  };
2475
-
2476
- var validateAddress = function validateAddress(api, address, chain) {
2477
- var isDestination = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
2478
- if (isTLocation(address)) return;
2479
- var isEvm = isChainEvm(chain);
2480
- var isEthereumAddress = isAddress(address);
2481
- var isPublicKeyFormat = typeof address === 'string' && address.startsWith('0x') && !isEthereumAddress;
2482
- if (isEvm) {
2483
- if (!isEthereumAddress) {
2484
- throw new InvalidAddressError("".concat(isDestination ? 'Destination chain' : 'Chain', " is an EVM chain, but the address provided is not a valid Ethereum address."));
2485
- }
2486
- } else {
2487
- if (isEthereumAddress) {
2488
- throw new InvalidAddressError("EVM address provided but ".concat(isDestination ? 'destination ' : '', "chain is not an EVM chain."));
2489
- }
2490
- if (isPublicKeyFormat) {
2491
- return;
2492
- }
2493
- if (typeof address === 'string') {
2494
- var isValid = api.validateSubstrateAddress(address);
2495
- if (!isValid) {
2496
- throw new InvalidAddressError("Invalid address: ".concat(address));
2497
- }
2498
- }
2499
- }
2572
+ var Basilisk$1 = {
2573
+ name: "Basilisk",
2574
+ info: "basilisk",
2575
+ paraId: 2090,
2576
+ providers: [
2577
+ {
2578
+ name: "Basilisk",
2579
+ endpoint: "wss://rpc.basilisk.cloud"
2580
+ },
2581
+ {
2582
+ name: "Dwellir",
2583
+ endpoint: "wss://basilisk-rpc.n.dwellir.com"
2584
+ }
2585
+ ]
2500
2586
  };
2501
-
2502
- var validateDestinationAddress = function validateDestinationAddress(address, destination, api) {
2503
- if (typeof address === 'string' && !isTLocation(destination)) {
2504
- validateAddress(api, address, destination, true);
2505
- }
2587
+ var BifrostKusama$1 = {
2588
+ name: "Bifrost",
2589
+ info: "bifrost",
2590
+ paraId: 2001,
2591
+ providers: [
2592
+ {
2593
+ name: "Liebi",
2594
+ endpoint: "wss://bifrost-rpc.liebi.com/ws"
2595
+ },
2596
+ {
2597
+ name: "LiebiUS",
2598
+ endpoint: "wss://us.bifrost-rpc.liebi.com/ws"
2599
+ }
2600
+ ]
2506
2601
  };
2507
-
2508
- var assertToIsString = function assertToIsString(to, overrideMsg) {
2509
- if (isTLocation(to)) {
2510
- throw new InvalidAddressError(overrideMsg !== null && overrideMsg !== void 0 ? overrideMsg : 'Location destination is not supported for XCM fee calculation.');
2511
- }
2602
+ var CrustShadow$1 = {
2603
+ name: "Crust Shadow",
2604
+ info: "shadow",
2605
+ paraId: 2012,
2606
+ providers: [
2607
+ {
2608
+ name: "Crust",
2609
+ endpoint: "wss://rpc-shadow.crust.network/"
2610
+ },
2611
+ {
2612
+ name: "Crust APP",
2613
+ endpoint: "wss://rpc-shadow.crustnetwork.app"
2614
+ },
2615
+ {
2616
+ name: "Crust CC",
2617
+ endpoint: "wss://rpc-shadow.crustnetwork.cc"
2618
+ },
2619
+ {
2620
+ name: "Crust XYZ",
2621
+ endpoint: "wss://rpc-shadow.crustnetwork.xyz"
2622
+ }
2623
+ ]
2512
2624
  };
2513
- var assertAddressIsString = function assertAddressIsString(address) {
2514
- if (isTLocation(address)) {
2515
- throw new InvalidAddressError('Location address is not supported for this transfer type.');
2516
- }
2625
+ var Crab$1 = {
2626
+ name: "Crab",
2627
+ info: "crab",
2628
+ paraId: 2105,
2629
+ providers: [
2630
+ {
2631
+ name: "Darwinia",
2632
+ endpoint: "wss://crab-rpc.darwinia.network/"
2633
+ }
2634
+ ]
2517
2635
  };
2518
- var assertSender = function assertSender(address) {
2519
- if (!address) {
2520
- throw new MissingParameterError('sender');
2521
- }
2636
+ var Laos$1 = {
2637
+ name: "Laos",
2638
+ info: "laos",
2639
+ paraId: 3370,
2640
+ providers: [
2641
+ {
2642
+ name: "laosfoundation.io",
2643
+ endpoint: "wss://rpc.laos.laosfoundation.io"
2644
+ }
2645
+ ]
2522
2646
  };
2523
- var assertHasId = function assertHasId(asset) {
2524
- if (asset.assetId === undefined) {
2525
- throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset, replaceBigInt), " has no assetId"));
2526
- }
2647
+ var Quartz$1 = {
2648
+ name: "QUARTZ by UNIQUE",
2649
+ info: "quartz",
2650
+ paraId: 2095,
2651
+ providers: [
2652
+ {
2653
+ name: "Geo Load Balancer",
2654
+ endpoint: "wss://ws-quartz.unique.network"
2655
+ }
2656
+ ]
2527
2657
  };
2528
- var assertSenderSource = function assertSenderSource(sender) {
2529
- if (sender === undefined) {
2530
- throw new InvalidAddressError('Sender address needs to be a derivation path or signer to sign and submit transaction using this method.');
2531
- }
2532
- };
2533
- var isSenderSigner = function isSenderSigner(sender) {
2534
- return typeof sender !== 'string';
2658
+ var RobonomicsPolkadot$1 = {
2659
+ name: "Robonomics",
2660
+ info: "robonomics",
2661
+ paraId: 3388,
2662
+ providers: [
2663
+ {
2664
+ name: "Airalab",
2665
+ endpoint: "wss://polkadot.rpc.robonomics.network/"
2666
+ }
2667
+ ]
2535
2668
  };
2536
- var assertSwapSupport = function assertSwapSupport(options) {
2537
- if (options) {
2538
- throw new UnsupportedOperationError('Swap options are not supported by this operation. Please open an issue if you would like to see this supported.');
2539
- }
2669
+ var PeopleKusama$1 = {
2670
+ name: "People",
2671
+ info: "kusamaPeople",
2672
+ paraId: 1004,
2673
+ providers: [
2674
+ {
2675
+ name: "Dwellir",
2676
+ endpoint: "wss://people-kusama-rpc.n.dwellir.com"
2677
+ },
2678
+ {
2679
+ name: "Helixstreet",
2680
+ endpoint: "wss://rpc-people-kusama.helixstreet.io"
2681
+ },
2682
+ {
2683
+ name: "IBP1",
2684
+ endpoint: "wss://people-kusama.ibp.network"
2685
+ },
2686
+ {
2687
+ name: "IBP2",
2688
+ endpoint: "wss://people-kusama.dotters.network"
2689
+ },
2690
+ {
2691
+ name: "LuckyFriday",
2692
+ endpoint: "wss://rpc-people-kusama.luckyfriday.io"
2693
+ },
2694
+ {
2695
+ name: "OnFinality",
2696
+ endpoint: "wss://people-kusama.api.onfinality.io/public-ws"
2697
+ },
2698
+ {
2699
+ name: "Parity",
2700
+ endpoint: "wss://kusama-people-rpc.polkadot.io"
2701
+ },
2702
+ {
2703
+ name: "RadiumBlock",
2704
+ endpoint: "wss://people-kusama.public.curie.radiumblock.co/ws"
2705
+ }
2706
+ ]
2540
2707
  };
2541
-
2542
- var getAssetReserveChain = function getAssetReserveChain(chain, assetLocation) {
2543
- var hasGlobalConsensusJunction = hasJunction(assetLocation, 'GlobalConsensus');
2544
- var paraId = getJunctionValue(assetLocation, 'Parachain');
2545
- if (paraId) {
2546
- var resolvedChain = getTChain(paraId, getRelayChainOf(chain));
2547
- if (!resolvedChain) {
2548
- throw new RoutingResolutionError("Chain with paraId ".concat(paraId, " not found"));
2549
- }
2550
- return resolvedChain;
2551
- }
2552
- if (isRelayChain(chain)) return chain;
2553
- var relaychain = getRelayChainOf(chain);
2554
- var ahChain = "AssetHub".concat(relaychain);
2555
- if (hasGlobalConsensusJunction) {
2556
- return ahChain;
2557
- }
2558
- if (deepEqual(assetLocation, {
2559
- parents: Parents.ONE,
2560
- interior: {
2561
- Here: null
2562
- }
2563
- })) {
2564
- return ahChain;
2565
- }
2566
- return chain;
2708
+ var Shiden$1 = {
2709
+ name: "Shiden",
2710
+ info: "shiden",
2711
+ paraId: 2007,
2712
+ providers: [
2713
+ {
2714
+ name: "Astar",
2715
+ endpoint: "wss://rpc.shiden.astar.network"
2716
+ },
2717
+ {
2718
+ name: "Dwellir",
2719
+ endpoint: "wss://shiden-rpc.n.dwellir.com"
2720
+ },
2721
+ {
2722
+ name: "OnFinality",
2723
+ endpoint: "wss://shiden.api.onfinality.io/public-ws"
2724
+ },
2725
+ {
2726
+ name: "RadiumBlock",
2727
+ endpoint: "wss://shiden.public.curie.radiumblock.co/ws"
2728
+ }
2729
+ ]
2567
2730
  };
2568
-
2569
- /**
2570
- * Retrieves the chain instance for a given chain.
2571
- *
2572
- * @param chain - The chain identifier.
2573
- * @returns The chain instance
2574
- */
2575
- var getChain = function getChain(chain) {
2576
- var map = chains();
2577
- return map[chain];
2731
+ var Zeitgeist$1 = {
2732
+ name: "Zeitgeist",
2733
+ info: "zeitgeist",
2734
+ paraId: 2092,
2735
+ providers: [
2736
+ {
2737
+ name: "OnFinality",
2738
+ endpoint: "wss://zeitgeist.api.onfinality.io/public-ws"
2739
+ }
2740
+ ]
2578
2741
  };
2579
-
2580
- var getChainVersion = function getChainVersion(chain) {
2581
- if (isRelayChain(chain) || isExternalChain(chain)) {
2582
- return Version.V5;
2583
- }
2584
- return getChain(chain).version;
2742
+ var AssetHubWestend$1 = {
2743
+ name: "Asset Hub",
2744
+ info: "WestendAssetHub",
2745
+ paraId: 1000,
2746
+ providers: [
2747
+ {
2748
+ name: "Dwellir",
2749
+ endpoint: "wss://asset-hub-westend-rpc.n.dwellir.com"
2750
+ },
2751
+ {
2752
+ name: "Dwellir Tunisia",
2753
+ endpoint: "wss://westmint-rpc-tn.dwellir.com"
2754
+ },
2755
+ {
2756
+ name: "Parity",
2757
+ endpoint: "wss://westend-asset-hub-rpc.polkadot.io"
2758
+ }
2759
+ ]
2585
2760
  };
2586
-
2587
- /**
2588
- * Gets the relay chain (Polkadot, Kusama, Westend, or Paseo) of a given chain.
2589
- *
2590
- * @param chain - The chain to evaluate.
2591
- * @returns The corresponding relay chain.
2592
- */
2593
- var getRelayChainOf = function getRelayChainOf(chain) {
2594
- if (isRelayChain(chain)) return chain;
2595
- return getChain(chain).ecosystem;
2761
+ var BridgeHubWestend$1 = {
2762
+ name: "Bridge Hub",
2763
+ info: "westendBridgeHub",
2764
+ paraId: 1002,
2765
+ providers: [
2766
+ {
2767
+ name: "Dwellir",
2768
+ endpoint: "wss://bridge-hub-westend-rpc.n.dwellir.com"
2769
+ },
2770
+ {
2771
+ name: "Dwellir Tunisia",
2772
+ endpoint: "wss://westend-bridge-hub-rpc-tn.dwellir.com"
2773
+ },
2774
+ {
2775
+ name: "Parity",
2776
+ endpoint: "wss://westend-bridge-hub-rpc.polkadot.io"
2777
+ }
2778
+ ]
2596
2779
  };
2597
-
2598
- var addXcmVersionHeader = function addXcmVersionHeader(obj, version) {
2599
- return _defineProperty({}, version, obj);
2780
+ var CollectivesWestend$1 = {
2781
+ name: "Collectives",
2782
+ info: "westendCollectives",
2783
+ paraId: 1001,
2784
+ providers: [
2785
+ {
2786
+ name: "Dwellir",
2787
+ endpoint: "wss://collectives-westend-rpc.n.dwellir.com"
2788
+ },
2789
+ {
2790
+ name: "Dwellir Tunisia",
2791
+ endpoint: "wss://westend-collectives-rpc-tn.dwellir.com"
2792
+ },
2793
+ {
2794
+ name: "Parity",
2795
+ endpoint: "wss://westend-collectives-rpc.polkadot.io"
2796
+ }
2797
+ ]
2600
2798
  };
2601
- var selectXcmVersion = function selectXcmVersion(forcedVersion, originVersion, destMaxVersion) {
2602
- if (forcedVersion) return forcedVersion;
2603
- var destVersion = destMaxVersion !== null && destMaxVersion !== void 0 ? destMaxVersion : originVersion;
2604
- return destVersion < originVersion ? destVersion : originVersion;
2799
+ var CoretimeWestend$1 = {
2800
+ name: "Coretime",
2801
+ info: "westendCoretime",
2802
+ paraId: 1005,
2803
+ providers: [
2804
+ {
2805
+ name: "Dwellir",
2806
+ endpoint: "wss://coretime-westend-rpc.n.dwellir.com"
2807
+ },
2808
+ {
2809
+ name: "Parity",
2810
+ endpoint: "wss://westend-coretime-rpc.polkadot.io"
2811
+ }
2812
+ ]
2605
2813
  };
2606
- var pickCompatibleXcmVersion = function pickCompatibleXcmVersion(origin, destination, override) {
2607
- var originVersion = getChainVersion(origin);
2608
- var destVersion = !isTLocation(destination) ? getChainVersion(destination) : undefined;
2609
- return selectXcmVersion(override, originVersion, destVersion);
2814
+ var Penpal$1 = {
2815
+ name: "Penpal",
2816
+ info: "westendPenpal",
2817
+ paraId: 2042,
2818
+ providers: [
2819
+ {
2820
+ name: "Parity",
2821
+ endpoint: "wss://westend-penpal-rpc.polkadot.io"
2822
+ }
2823
+ ]
2610
2824
  };
2611
- var pickRouterCompatibleXcmVersion = function pickRouterCompatibleXcmVersion(origin, exchangeChain, destination) {
2612
- var exchangeVersion = getChainVersion(exchangeChain);
2613
- var originVersion = origin ? getChainVersion(origin) : undefined;
2614
- var destVersion = destination ? getChainVersion(destination) : undefined;
2615
- // Find minimum compatible version across all defined chains
2616
- var minWithOrigin = selectXcmVersion(undefined, exchangeVersion, originVersion);
2617
- return selectXcmVersion(undefined, minWithOrigin, destVersion);
2825
+ var PeopleWestend$1 = {
2826
+ name: "People",
2827
+ info: "westendPeople",
2828
+ paraId: 1004,
2829
+ providers: [
2830
+ {
2831
+ name: "Dwellir",
2832
+ endpoint: "wss://people-westend-rpc.n.dwellir.com"
2833
+ },
2834
+ {
2835
+ name: "Parity",
2836
+ endpoint: "wss://westend-people-rpc.polkadot.io"
2837
+ }
2838
+ ]
2618
2839
  };
2619
-
2620
- var createId = function createId(version, location) {
2621
- if (version === Version.V3) {
2622
- return {
2623
- Concrete: location
2624
- };
2625
- }
2626
- return location;
2840
+ var AjunaPaseo$1 = {
2841
+ name: "Ajuna Network (Paseo)",
2842
+ info: "Ajuna(paseo)",
2843
+ paraId: 2051,
2844
+ providers: [
2845
+ {
2846
+ name: "BajunNetwork",
2847
+ endpoint: "wss://rpc-paseo.ajuna.network"
2848
+ }
2849
+ ]
2627
2850
  };
2628
- var createAsset = function createAsset(version, amount, location) {
2629
- if (version === Version.V3) {
2630
- return {
2631
- id: {
2632
- Concrete: location
2633
- },
2634
- fun: {
2635
- Fungible: amount
2636
- }
2637
- };
2638
- }
2639
- return {
2640
- id: location,
2641
- fun: {
2642
- Fungible: amount
2643
- }
2644
- };
2851
+ var AssetHubPaseo$1 = {
2852
+ name: "Asset Hub",
2853
+ info: "PaseoAssetHub",
2854
+ paraId: 1000,
2855
+ providers: [
2856
+ {
2857
+ name: "Dwellir",
2858
+ endpoint: "wss://asset-hub-paseo-rpc.n.dwellir.com"
2859
+ },
2860
+ {
2861
+ name: "IBP1",
2862
+ endpoint: "wss://asset-hub-paseo.ibp.network"
2863
+ },
2864
+ {
2865
+ name: "IBP2",
2866
+ endpoint: "wss://asset-hub-paseo.dotters.network"
2867
+ },
2868
+ {
2869
+ name: "TurboFlakes",
2870
+ endpoint: "wss://sys.turboflakes.io/asset-hub-paseo"
2871
+ }
2872
+ ]
2645
2873
  };
2646
- var createVersionedAssets = function createVersionedAssets(version, amount, location) {
2647
- var asset = createAsset(version, amount, location);
2648
- return addXcmVersionHeader([asset], version);
2874
+ var BifrostPaseo$1 = {
2875
+ name: "Bifrost",
2876
+ info: "Bifrost(Paseo)",
2877
+ paraId: 2030,
2878
+ providers: [
2879
+ {
2880
+ name: "Liebi",
2881
+ endpoint: "wss://bifrost-rpc.paseo.liebi.com/ws"
2882
+ },
2883
+ {
2884
+ name: "Liebi2",
2885
+ endpoint: "wss://bifrost-rpc.paseo2.liebi.com/ws"
2886
+ }
2887
+ ]
2649
2888
  };
2650
-
2651
- // Inspired by Moonbeam XCM-SDK
2652
- // https://github.com/moonbeam-foundation/xcm-sdk/blob/ab835c15bf41612604b1c858d956a9f07705ed65/packages/utils/src/format/asset.ts#L1
2653
- var formatAssetIdToERC20 = function formatAssetIdToERC20(id) {
2654
- if (id.startsWith('0x')) {
2655
- return id;
2656
- }
2657
- if (!(/^\d{38,39}$/.test(id) || /^\d{4}$/.test(id))) {
2658
- throw new NumberFormatError("Asset id: ".concat(id, " must be a string and have either 4 digits or 38-39 digits"));
2659
- }
2660
- return "0xffffffff".concat(BigInt(id).toString(16).padStart(32, '0'));
2889
+ var BridgeHubPaseo$1 = {
2890
+ name: "Bridge Hub",
2891
+ info: "PaseoBridgeHub",
2892
+ paraId: 1002,
2893
+ providers: [
2894
+ {
2895
+ name: "IBP1",
2896
+ endpoint: "wss://bridge-hub-paseo.ibp.network"
2897
+ },
2898
+ {
2899
+ name: "IBP2",
2900
+ endpoint: "wss://bridge-hub-paseo.dotters.network"
2901
+ }
2902
+ ]
2661
2903
  };
2662
-
2663
- var maybeOverrideAssets = function maybeOverrideAssets(version, amount, assets, overriddenCurrency) {
2664
- if (!overriddenCurrency) {
2665
- return assets;
2666
- }
2667
- return isTLocation(overriddenCurrency) ? createAsset(version, amount, overriddenCurrency) : overriddenCurrency;
2904
+ var CoretimePaseo$1 = {
2905
+ name: "Coretime",
2906
+ info: "PaseoCoretime",
2907
+ paraId: 1005,
2908
+ providers: [
2909
+ {
2910
+ name: "IBP1",
2911
+ endpoint: "wss://coretime-paseo.ibp.network"
2912
+ },
2913
+ {
2914
+ name: "IBP2",
2915
+ endpoint: "wss://coretime-paseo.dotters.network"
2916
+ }
2917
+ ]
2668
2918
  };
2669
- var maybeOverrideAsset = function maybeOverrideAsset(version, amount, asset, overriddenCurrency) {
2670
- if (!overriddenCurrency) {
2671
- return asset;
2672
- }
2673
- if (Array.isArray(overriddenCurrency)) {
2674
- if (overriddenCurrency.length !== 1) {
2675
- throw new OverrideConflictError('Expected a single asset in overriddenCurrency array.');
2676
- }
2677
- return overriddenCurrency[0];
2678
- }
2679
- return createAsset(version, amount, overriddenCurrency);
2919
+ var EnergyWebXPaseo$1 = {
2920
+ name: "PEX",
2921
+ info: "paseoEwx",
2922
+ paraId: 3345,
2923
+ providers: [
2924
+ {
2925
+ name: "Energy Web",
2926
+ endpoint: "wss://public-rpc.testnet.energywebx.com/"
2927
+ }
2928
+ ]
2680
2929
  };
2681
-
2682
- var isHere = function isHere(loc) {
2683
- var _loc$interior;
2684
- return loc.interior === 'Here' || ((_loc$interior = loc.interior) === null || _loc$interior === void 0 ? void 0 : _loc$interior.Here) !== undefined;
2930
+ var HeimaPaseo$1 = {
2931
+ name: "Heima paseo",
2932
+ info: "heima-paseo",
2933
+ paraId: 2106,
2934
+ providers: [
2935
+ {
2936
+ name: "Heima",
2937
+ endpoint: "wss://rpc.paseo-parachain.heima.network"
2938
+ }
2939
+ ]
2685
2940
  };
2686
- var sortAssets = function sortAssets(assets) {
2687
- return assets.sort(function (a, b) {
2688
- var aLoc = extractAssetLocation(a);
2689
- var bLoc = extractAssetLocation(b);
2690
- // 1. Sort by parents first
2691
- if (aLoc.parents !== bLoc.parents) {
2692
- return Number(aLoc.parents) - Number(bLoc.parents);
2693
- }
2694
- // 2. If parents are equal, use priority function
2695
- var aIsHere = isHere(aLoc);
2696
- var bIsHere = isHere(bLoc);
2697
- var aHasGlobal = hasJunction(aLoc, 'GlobalConsensus');
2698
- var bHasGlobal = hasJunction(bLoc, 'GlobalConsensus');
2699
- var aGeneralIndex = getJunctionValue(aLoc, 'GeneralIndex');
2700
- var bGeneralIndex = getJunctionValue(bLoc, 'GeneralIndex');
2701
- var getPriority = function getPriority(isHere, hasGlobal) {
2702
- if (isHere) return 0;
2703
- if (hasGlobal) return 2;
2704
- return 1;
2705
- };
2706
- var aPriority = getPriority(aIsHere, aHasGlobal);
2707
- var bPriority = getPriority(bIsHere, bHasGlobal);
2708
- if (aPriority !== bPriority) return aPriority - bPriority;
2709
- if (aGeneralIndex === undefined && bGeneralIndex === undefined) return 0;
2710
- if (aGeneralIndex === undefined) return 1;
2711
- if (bGeneralIndex === undefined) return -1;
2712
- return aGeneralIndex - bGeneralIndex;
2713
- });
2941
+ var HydrationPaseo$1 = {
2942
+ name: "Hydration (Paseo)",
2943
+ info: "rococoHydraDX",
2944
+ paraId: 2034,
2945
+ providers: [
2946
+ {
2947
+ name: "Galactic Council",
2948
+ endpoint: "wss://paseo-rpc.play.hydration.cloud"
2949
+ }
2950
+ ]
2714
2951
  };
2715
-
2716
- var buildClaimAssetsParams = function buildClaimAssetsParams(options) {
2717
- var assets = options.assets,
2718
- version = options.version;
2719
- var beneficiary = createBeneficiaryLocation(options);
2720
- return {
2721
- assets: addXcmVersionHeader(assets, version),
2722
- beneficiary: addXcmVersionHeader(beneficiary, version)
2723
- };
2952
+ var LaosPaseo$1 = {
2953
+ name: "Laos Sigma",
2954
+ info: "laos-sigma",
2955
+ paraId: 4006,
2956
+ providers: [
2957
+ {
2958
+ name: "freeverse.io",
2959
+ endpoint: "wss://rpc.laossigma.laosfoundation.io"
2960
+ }
2961
+ ]
2724
2962
  };
2725
-
2726
- var resolveAssets = function resolveAssets(_ref, version) {
2727
- var api = _ref.api,
2728
- chain = _ref.chain,
2729
- currency = _ref.currency;
2730
- var normalizeAsset = function normalizeAsset(amount, currency) {
2731
- var asset = findAssetInfoOrThrow(chain, currency);
2732
- var abstracted = abstractDecimals(amount, asset.decimals, api);
2733
- return createAsset(version, abstracted, localizeLocation(chain, asset.location));
2734
- };
2735
- if (Array.isArray(currency)) {
2736
- if (currency.every(function (asset) {
2737
- return isTAsset(asset);
2738
- })) {
2739
- return currency.map(function (asset) {
2740
- return _objectSpread2(_objectSpread2({}, asset), {}, {
2741
- fun: {
2742
- Fungible: BigInt(asset.fun.Fungible)
2743
- }
2744
- });
2745
- });
2746
- } else {
2747
- return currency.map(function (currency) {
2748
- return normalizeAsset(currency.amount, currency);
2749
- });
2750
- }
2751
- }
2752
- return [normalizeAsset(currency.amount, currency)];
2963
+ var NeuroWebPaseo$1 = {
2964
+ name: "NeuroWeb Testnet",
2965
+ info: "NeuroWeb",
2966
+ paraId: 2043,
2967
+ providers: [
2968
+ {
2969
+ name: "TraceLabs",
2970
+ endpoint: "wss://parachain-testnet-rpc.origin-trail.network/"
2971
+ }
2972
+ ]
2753
2973
  };
2754
-
2755
- /**
2756
- * @deprecated Asset claim functionality is deprecated and will be removed in v14.
2757
- */
2758
- var claimAssets = /*#__PURE__*/function () {
2759
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
2760
- var api, chain, address, pallets, supportedPallet, version, assets, params, call;
2761
- return _regenerator().w(function (_context) {
2762
- while (1) switch (_context.n) {
2763
- case 0:
2764
- api = options.api, chain = options.chain, address = options.address;
2765
- validateAddress(api, address, chain, true);
2766
- _context.n = 1;
2767
- return api.init(chain, TX_CLIENT_TIMEOUT_MS);
2768
- case 1:
2769
- pallets = getSupportedPallets(chain);
2770
- supportedPallet = pallets.find(function (p) {
2771
- return p === 'PolkadotXcm' || p === 'XcmPallet';
2772
- });
2773
- if (supportedPallet) {
2774
- _context.n = 2;
2775
- break;
2776
- }
2777
- throw new UnsupportedOperationError('Unsupported pallet for asset claim');
2778
- case 2:
2779
- version = getChainVersion(chain);
2780
- assets = resolveAssets(options, version);
2781
- params = buildClaimAssetsParams(_objectSpread2(_objectSpread2({}, options), {}, {
2782
- version: version,
2783
- assets: assets
2784
- }));
2785
- call = {
2786
- module: supportedPallet,
2787
- method: 'claim_assets',
2788
- params: params
2789
- };
2790
- return _context.a(2, api.deserializeExtrinsics(call));
2791
- }
2792
- }, _callee);
2793
- }));
2794
- return function claimAssets(_x) {
2795
- return _ref.apply(this, arguments);
2796
- };
2797
- }();
2798
-
2799
- var resolveAsset = function resolveAsset(currency, origin, destination, assetCheckEnabled) {
2800
- return assetCheckEnabled ? findAssetInfo(origin, currency, !isTLocation(destination) ? destination : null) : null;
2801
- };
2802
-
2803
- var resolveFeeAsset = function resolveFeeAsset(feeAsset, origin, destination, currency) {
2804
- if (!origin.startsWith('Hydration') && origin !== 'AssetHubPolkadot') {
2805
- throw new ScenarioNotSupportedError("Fee asset is not supported on ".concat(origin));
2806
- }
2807
- var asset = findAssetInfo(origin, feeAsset, !isTLocation(destination) ? destination : null);
2808
- var usesRawOverriddenMultiAssets = Array.isArray(currency) && currency.every(isTAsset);
2809
- if (!asset && !usesRawOverriddenMultiAssets) {
2810
- throwUnsupportedCurrency(feeAsset, origin);
2811
- }
2812
- return asset !== null && asset !== void 0 ? asset : undefined;
2813
- };
2814
-
2815
- var resolveHopAsset = function resolveHopAsset(_ref) {
2816
- var _findAssetInfoOnDest;
2817
- var api = _ref.api,
2818
- tx = _ref.tx,
2819
- originChain = _ref.originChain,
2820
- currentChain = _ref.currentChain,
2821
- destination = _ref.destination,
2822
- swapConfig = _ref.swapConfig,
2823
- asset = _ref.asset,
2824
- hasPassedExchange = _ref.hasPassedExchange,
2825
- currency = _ref.currency;
2826
- var isRelayAssetIncluded = api.getTypeThenAssetCount(tx) === 2;
2827
- var useRelayAssetAsFee = typeof destination === 'string' && isExternalChain(destination) || isRelayAssetIncluded;
2828
- if (useRelayAssetAsFee) {
2829
- return findNativeAssetInfoOrThrow(getRelayChainOf(currentChain));
2830
- }
2831
- if (hasPassedExchange && swapConfig && currentChain !== swapConfig.exchangeChain) {
2832
- return findAssetOnDestOrThrow(swapConfig.exchangeChain, currentChain, swapConfig.currencyTo);
2833
- }
2834
- return (_findAssetInfoOnDest = findAssetInfoOnDest(originChain, currentChain, currency)) !== null && _findAssetInfoOnDest !== void 0 ? _findAssetInfoOnDest : asset;
2835
- };
2836
-
2837
- var getEthereumJunction = function getEthereumJunction(chain) {
2838
- var useBigInt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2839
- var relayChain = getRelayChainOf(chain);
2840
- var isTestnet = relayChain === 'Westend' || relayChain === 'Paseo';
2841
- var chainId = isTestnet ? ETH_TESTNET_PARA_ID : ETH_MAINNET_PARA_ID;
2842
- return {
2843
- GlobalConsensus: {
2844
- Ethereum: {
2845
- chainId: useBigInt ? BigInt(chainId) : chainId
2846
- }
2847
- }
2848
- };
2849
- };
2850
-
2851
- var validateBridgeAsset = function validateBridgeAsset(origin, destination, asset, currency, isBridge) {
2852
- if (!asset || isTLocation(destination) || isExternalChain(destination) || !isBridge) {
2853
- return;
2854
- }
2855
- var nativeAsset = findNativeAssetInfoOrThrow(origin);
2856
- var isNativeAsset = isAssetEqual(asset, nativeAsset);
2857
- var isBridgedStablecoin = isStableCoinAsset(asset);
2858
- if (!(isNativeAsset || isBridgedSystemAsset(asset, [getRelayChainOf(destination)]) || isBridgedStablecoin)) {
2859
- throw new InvalidCurrencyError("Substrate bridge does not support currency ".concat(JSON.stringify(currency, replaceBigInt), "."));
2860
- }
2861
- };
2862
- var validateEcosystems = function validateEcosystems(origin, destination) {
2863
- if (isTLocation(destination)) return;
2864
- var relayChain = getRelayChainOf(origin);
2865
- var destinationToRelayChains = {
2866
- Ethereum: ['Polkadot'],
2867
- EthereumTestnet: ['Westend', 'Paseo']
2868
- };
2869
- var allowedRelayChains = destinationToRelayChains[destination];
2870
- if (!allowedRelayChains) return;
2871
- if (!allowedRelayChains.includes(relayChain)) {
2872
- throw new InvalidCurrencyError("Destination ".concat(destination, " is only supported from following ecosystems: ").concat(allowedRelayChains.join(', '), "."));
2873
- }
2874
- };
2875
- var validateEthereumAsset = function validateEthereumAsset(origin, destination, asset) {
2876
- if (!asset || !isTLocation(destination) && !isSnowbridge(origin, destination) || origin === 'Mythos') {
2877
- return;
2878
- }
2879
- validateEcosystems(origin, destination);
2880
- var ADDITIONAL_ALLOWED_LOCATIONS = [RELAY_LOCATION, {
2881
- parents: 2,
2882
- interior: {
2883
- X1: [{
2884
- GlobalConsensus: {
2885
- Kusama: null
2886
- }
2887
- }]
2888
- }
2889
- }];
2890
- var isEthCompatibleAsset = asset.location.parents === Parents.TWO && deepEqual(getJunctionValue(asset.location, 'GlobalConsensus'), getEthereumJunction(origin, false).GlobalConsensus) || ADDITIONAL_ALLOWED_LOCATIONS.some(function (loc) {
2891
- return deepEqual(asset.location, loc);
2892
- });
2893
- if (!isEthCompatibleAsset) {
2894
- throw new InvalidCurrencyError("Currency ".concat(JSON.stringify(asset, replaceBigInt), " is not transferable to Ethereum."));
2895
- }
2896
- };
2897
- var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled, isBridge, asset) {
2898
- var origin = _ref.from,
2899
- destination = _ref.to,
2900
- currency = _ref.currency;
2901
- var isLocationDestination = _typeof(destination) === 'object';
2902
- if (asset === null && assetCheckEnabled) {
2903
- throwUnsupportedCurrency(currency, origin);
2904
- }
2905
- if (!isLocationDestination && assetCheckEnabled && !findAssetInfoOnDest(origin, destination, currency, asset)) {
2906
- throw new InvalidCurrencyError("Destination chain ".concat(destination, " does not support currency ").concat(JSON.stringify(currency, replaceBigInt), "."));
2907
- }
2908
- validateBridgeAsset(origin, destination, asset, currency, isBridge);
2909
- validateEthereumAsset(origin, destination, asset);
2910
- };
2911
-
2912
- var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge, assetCheckEnabled, resolvedFeeAsset) {
2913
- var api = options.api,
2914
- currency = options.currency,
2915
- feeAsset = options.feeAsset,
2916
- origin = options.from,
2917
- destination = options.to;
2918
- if ('location' in currency && isOverrideLocationSpecifier(currency.location)) {
2919
- return currency.location.value;
2920
- }
2921
- if (Array.isArray(currency)) {
2922
- if (!feeAsset) {
2923
- throw new InvalidCurrencyError('Overridden multi assets cannot be used without specifying fee asset');
2924
- }
2925
- if ('location' in feeAsset && isOverrideLocationSpecifier(feeAsset.location)) {
2926
- throw new InvalidCurrencyError('Fee asset cannot be an overridden location specifier');
2927
- }
2928
- if (currency.every(function (asset) {
2929
- return isTAsset(asset);
2930
- })) {
2931
- if (!feeAsset) {
2932
- throw new InvalidCurrencyError('Fee asset not provided');
2933
- }
2934
- if (!('location' in feeAsset)) {
2935
- throw new InvalidCurrencyError('Fee asset must be specified by location when using raw overridden multi assets');
2936
- }
2937
- return currency.map(function (asset) {
2938
- var ml = extractAssetLocation(asset);
2939
- return _objectSpread2(_objectSpread2({}, asset), {}, {
2940
- fun: {
2941
- Fungible: BigInt(asset.fun.Fungible)
2942
- },
2943
- isFeeAsset: deepEqual(ml, feeAsset.location)
2944
- });
2945
- });
2946
- }
2947
- // MultiAsset is an array of TCurrencyCore, search for assets
2948
- var assets = currency.map(function (currency) {
2949
- if (currency.amount === AMOUNT_ALL) {
2950
- throw new InvalidCurrencyError('Multi assets cannot use amount all. Please specify amount.');
2951
- }
2952
- var asset = findAssetInfo(origin, currency, !isTLocation(destination) ? destination : null);
2953
- if (!asset) {
2954
- throw new InvalidCurrencyError("Origin chain ".concat(origin, " does not support currency ").concat(JSON.stringify(currency)));
2955
- }
2956
- if (!resolvedFeeAsset) {
2957
- throw new InvalidCurrencyError('Fee asset not found');
2958
- }
2959
- validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
2960
- var version = getChainVersion(origin);
2961
- var abstractedAmount = abstractDecimals(currency.amount, asset.decimals, api);
2962
- return _objectSpread2({
2963
- isFeeAsset: isAssetEqual(resolvedFeeAsset, asset)
2964
- }, createAsset(version, abstractedAmount, asset.location));
2965
- });
2966
- if (assets.filter(function (asset) {
2967
- return asset.isFeeAsset;
2968
- }).length > 1) {
2969
- throw new InvalidCurrencyError("Fee asset matches multiple assets in multiassets");
2970
- }
2971
- if (assets.filter(function (asset) {
2972
- return asset.isFeeAsset;
2973
- }).length === 0) {
2974
- throw new InvalidCurrencyError("Fee asset not found in multiassets");
2975
- }
2976
- return assets;
2977
- }
2978
- return undefined;
2979
- };
2980
-
2981
- var shouldPerformAssetCheck = function shouldPerformAssetCheck(origin, currency) {
2982
- if (isRelayChain(origin)) return true;
2983
- var isMultipleAssets = Array.isArray(currency);
2984
- var hasOverriddenLocation = 'location' in currency && isOverrideLocationSpecifier(currency.location);
2985
- return !(isMultipleAssets || hasOverriddenLocation);
2986
- };
2987
-
2988
- var validateCurrency = function validateCurrency(currency, feeAsset) {
2989
- if (Array.isArray(currency)) {
2990
- if (currency.length === 0) {
2991
- throw new InvalidCurrencyError('Overridden assets cannot be empty');
2992
- }
2993
- if (currency.length === 1) {
2994
- throw new InvalidCurrencyError('Please provide more than one asset');
2995
- }
2996
- if (currency.length > 1 && !currency.every(function (asset) {
2997
- return isTAsset(asset);
2998
- }) && !feeAsset) {
2999
- throw new InvalidCurrencyError('Overridden assets cannot be used without specifying fee asset');
3000
- }
3001
- }
3002
- };
3003
- var validateDestination = function validateDestination(origin, destination) {
3004
- if (isRelayChain(origin) && !isTLocation(destination) && isRelayChain(destination) && origin !== destination) {
3005
- throw new ScenarioNotSupportedError('Direct relay chain to relay chain transfers are not supported. Please use Polkadot <-> Kusama bridge through AssetHub.');
3006
- }
3007
- var allowedChainsToEthereum = ['AssetHubPolkadot', 'AssetHubPaseo', 'AssetHubWestend', 'Hydration', 'BifrostPolkadot', 'Moonbeam', 'Mythos'];
3008
- if (typeof destination === 'string' && isExternalChain(destination) && !allowedChainsToEthereum.includes(origin)) {
3009
- throw new ScenarioNotSupportedError("Transfers to Ethereum are only supported from: ".concat(allowedChainsToEthereum.join(', ')));
3010
- }
3011
- var isLocationDestination = _typeof(destination) === 'object';
3012
- var isBridgeTransfer = !isTLocation(destination) && isBridge(origin, destination);
3013
- var isRelayDestination = !isTLocation(destination) && isRelayChain(destination);
3014
- if (!isRelayDestination && !isLocationDestination) {
3015
- var originRelayChainSymbol = getRelayChainSymbol(origin);
3016
- var destinationRelayChainSymbol = getRelayChainSymbol(destination);
3017
- if (!isBridgeTransfer && originRelayChainSymbol !== destinationRelayChainSymbol) {
3018
- throw new ScenarioNotSupportedError('Origin and destination must share the same relay chain unless using a bridge.');
3019
- }
3020
- }
3021
- if (isRelayChain(origin) && typeof destination === 'string' && !isExternalChain(destination)) {
3022
- var chain = getChain(destination);
3023
- if (!chain.isRelayToParaEnabled()) {
3024
- throw new ScenarioNotSupportedError({
3025
- chain: destination,
3026
- scenario: 'RelayToPara'
3027
- });
3028
- }
3029
- }
3030
- };
3031
- var validateAssetSpecifiers = function validateAssetSpecifiers(assetCheckEnabled, currency) {
3032
- if (!assetCheckEnabled && 'symbol' in currency && isSymbolSpecifier(currency.symbol)) {
3033
- throw new InvalidCurrencyError('Symbol specifier is not supported when asset check is disabled. Please use normal symbol instead.');
3034
- }
3035
- if (!assetCheckEnabled && 'id' in currency) {
3036
- throw new InvalidCurrencyError('Asset ID is not supported when asset check is disabled. Please use normal symbol instead');
3037
- }
2974
+ var PeoplePaseo$1 = {
2975
+ name: "People",
2976
+ info: "PaseoPeopleChain",
2977
+ paraId: 1004,
2978
+ providers: [
2979
+ {
2980
+ name: "Amforc",
2981
+ endpoint: "wss://people-paseo.rpc.amforc.com"
2982
+ },
2983
+ {
2984
+ name: "IBP1",
2985
+ endpoint: "wss://people-paseo.ibp.network"
2986
+ },
2987
+ {
2988
+ name: "IBP2",
2989
+ endpoint: "wss://people-paseo.dotters.network"
2990
+ }
2991
+ ]
3038
2992
  };
3039
- var validateTransact = function validateTransact(_ref) {
3040
- var api = _ref.api,
3041
- from = _ref.from,
3042
- to = _ref.to,
3043
- sender = _ref.sender,
3044
- address = _ref.recipient,
3045
- transactOptions = _ref.transactOptions;
3046
- var call = transactOptions === null || transactOptions === void 0 ? void 0 : transactOptions.call;
3047
- if (!call) return;
3048
- if (from === to) {
3049
- throw new UnsupportedOperationError('Cannot use transact options with local transfers.');
3050
- }
3051
- if (typeof call === 'string' && !isHex(call)) {
3052
- throw new ValidationError('Transact call hex must be a valid hex string.');
3053
- }
3054
- if (isChainEvm(from) || typeof to === 'string' && isChainEvm(to)) {
3055
- throw new UnsupportedOperationError('Transact option is only supported for Substrate to Substrate scenarios.');
3056
- }
3057
- if (typeof address === 'string' && sender && !compareAddresses(api, address, sender)) {
3058
- return new ValidationError('Sender address must match the destination address for transact to work.');
3059
- }
2993
+ var ZeitgeistPaseo$1 = {
2994
+ name: "Zeitgeist Battery Station",
2995
+ info: "ZeitgeistBatteryStation",
2996
+ paraId: 2101,
2997
+ providers: [
2998
+ {
2999
+ name: "Zeitgeist",
3000
+ endpoint: "wss://bsr.zeitgeist.pm"
3001
+ }
3002
+ ]
3060
3003
  };
3061
-
3062
- var resolveTransferParams = function resolveTransferParams(options) {
3063
- var api = options.api,
3064
- origin = options.from,
3065
- currency = options.currency,
3066
- feeAsset = options.feeAsset,
3067
- address = options.recipient,
3068
- destination = options.to,
3069
- version = options.version,
3070
- sender = options.sender;
3071
- validateCurrency(currency, feeAsset);
3072
- validateDestination(origin, destination);
3073
- validateTransact(options);
3074
- validateDestinationAddress(address, destination, api);
3075
- if (sender) validateAddress(api, sender, origin, false);
3076
- var isBridge = !isTLocation(destination) && isSubstrateBridge(origin, destination);
3077
- var assetCheckEnabled = shouldPerformAssetCheck(origin, currency);
3078
- validateAssetSpecifiers(assetCheckEnabled, currency);
3079
- var asset = resolveAsset(currency, origin, destination, assetCheckEnabled);
3080
- var resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
3081
- validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
3082
- var amount = Array.isArray(currency) ? 0n : abstractDecimals(currency.amount, asset === null || asset === void 0 ? void 0 : asset.decimals, api);
3083
- // Ensure amount is at least 2 to avoid Rust panic (only for non-array currencies)
3084
- var finalAmount = !Array.isArray(currency) && amount < MIN_AMOUNT ? MIN_AMOUNT : amount;
3085
- var resolvedVersion = pickCompatibleXcmVersion(origin, destination, version);
3086
- var overriddenAsset = resolveOverriddenAsset(options, isBridge, assetCheckEnabled, resolvedFeeAsset);
3087
- // In case asset check is disabled, we create asset object from currency symbol
3088
- var resolvedAsset = asset !== null && asset !== void 0 ? asset : {
3089
- symbol: 'symbol' in currency ? currency.symbol : undefined
3090
- };
3091
- var finalAsset = Array.isArray(currency) ? // TODO: Refactor this
3092
- // We use a dummy values when overriding with multi-assets
3093
- // since these values won't be used but need to pass checks
3094
- _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
3095
- amount: 0n,
3096
- assetId: '1',
3097
- location: {
3098
- parents: Parents.ZERO,
3099
- interior: {
3100
- Here: null
3101
- }
3102
- }
3103
- }) : _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
3104
- amount: finalAmount
3105
- });
3106
- var normalizedAsset = finalAsset.location ? _objectSpread2(_objectSpread2({}, finalAsset), {}, {
3107
- location: normalizeLocation(finalAsset.location, resolvedVersion)
3108
- }) : finalAsset;
3109
- return {
3110
- resolvedFeeAsset: resolvedFeeAsset,
3111
- resolvedVersion: resolvedVersion,
3112
- overriddenAsset: overriddenAsset,
3113
- normalizedAsset: normalizedAsset
3114
- };
3004
+ var Polkadot$1 = {
3005
+ name: "Polkadot Relay",
3006
+ info: "polkadot",
3007
+ paraId: 0,
3008
+ providers: [
3009
+ {
3010
+ name: "Allnodes",
3011
+ endpoint: "wss://polkadot-rpc.publicnode.com"
3012
+ },
3013
+ {
3014
+ name: "Dwellir",
3015
+ endpoint: "wss://polkadot-rpc.n.dwellir.com"
3016
+ },
3017
+ {
3018
+ name: "Dwellir Tunisia",
3019
+ endpoint: "wss://polkadot-rpc-tn.dwellir.com"
3020
+ },
3021
+ {
3022
+ name: "Helixstreet",
3023
+ endpoint: "wss://rpc-polkadot.helixstreet.io"
3024
+ },
3025
+ {
3026
+ name: "IBP1",
3027
+ endpoint: "wss://polkadot.ibp.network"
3028
+ },
3029
+ {
3030
+ name: "IBP2",
3031
+ endpoint: "wss://polkadot.dotters.network"
3032
+ },
3033
+ {
3034
+ name: "LuckyFriday",
3035
+ endpoint: "wss://rpc-polkadot.luckyfriday.io"
3036
+ },
3037
+ {
3038
+ name: "OnFinality",
3039
+ endpoint: "wss://polkadot.api.onfinality.io/public-ws"
3040
+ },
3041
+ {
3042
+ name: "RadiumBlock",
3043
+ endpoint: "wss://polkadot.public.curie.radiumblock.co/ws"
3044
+ },
3045
+ {
3046
+ name: "Spectrum",
3047
+ endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/LjwBJpV3dIKyWQ/polkadot/mainnet/"
3048
+ },
3049
+ {
3050
+ name: "Stakeworld",
3051
+ endpoint: "wss://rpc-polkadot.stakeworld.io"
3052
+ },
3053
+ {
3054
+ name: "SubQuery",
3055
+ endpoint: "wss://polkadot.rpc.subquery.network/public/ws"
3056
+ }
3057
+ ]
3115
3058
  };
3116
- var createTransfer = /*#__PURE__*/function () {
3117
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
3118
- var api, origin, currency, feeAsset, recipient, destination, paraIdTo, sender, ahAddress, pallet, method, transactOptions, isAmountAll, keepAlive, _resolveTransferParam, resolvedFeeAsset, resolvedVersion, overriddenAsset, normalizedAsset;
3119
- return _regenerator().w(function (_context) {
3120
- while (1) switch (_context.n) {
3121
- case 0:
3122
- api = options.api, origin = options.from, currency = options.currency, feeAsset = options.feeAsset, recipient = options.recipient, destination = options.to, paraIdTo = options.paraIdTo, sender = options.sender, ahAddress = options.ahAddress, pallet = options.pallet, method = options.method, transactOptions = options.transactOptions, isAmountAll = options.isAmountAll, keepAlive = options.keepAlive;
3123
- _resolveTransferParam = resolveTransferParams(options), resolvedFeeAsset = _resolveTransferParam.resolvedFeeAsset, resolvedVersion = _resolveTransferParam.resolvedVersion, overriddenAsset = _resolveTransferParam.overriddenAsset, normalizedAsset = _resolveTransferParam.normalizedAsset;
3124
- _context.n = 1;
3125
- return api.init(origin, TX_CLIENT_TIMEOUT_MS);
3126
- case 1:
3127
- return _context.a(2, getChain(origin).transfer({
3128
- api: api,
3129
- assetInfo: normalizedAsset,
3130
- currency: currency,
3131
- feeAsset: resolvedFeeAsset,
3132
- feeCurrency: feeAsset,
3133
- recipient: recipient,
3134
- to: destination,
3135
- paraIdTo: paraIdTo,
3136
- overriddenAsset: overriddenAsset,
3137
- version: resolvedVersion,
3138
- sender: sender,
3139
- ahAddress: ahAddress,
3140
- pallet: pallet,
3141
- method: method,
3142
- transactOptions: transactOptions,
3143
- isAmountAll: isAmountAll,
3144
- keepAlive: keepAlive
3145
- }));
3146
- }
3147
- }, _callee);
3148
- }));
3149
- return function createTransfer(_x) {
3150
- return _ref.apply(this, arguments);
3151
- };
3152
- }();
3153
-
3154
- var isAssetHub = function isAssetHub(chain) {
3155
- return chain === 'AssetHubPolkadot' || chain === 'AssetHubKusama';
3059
+ var Kusama$1 = {
3060
+ name: "Kusama Relay",
3061
+ info: "kusama",
3062
+ paraId: 0,
3063
+ providers: [
3064
+ {
3065
+ name: "Allnodes",
3066
+ endpoint: "wss://kusama-rpc.publicnode.com"
3067
+ },
3068
+ {
3069
+ name: "Dwellir",
3070
+ endpoint: "wss://kusama-rpc.n.dwellir.com"
3071
+ },
3072
+ {
3073
+ name: "Dwellir Tunisia",
3074
+ endpoint: "wss://kusama-rpc-tn.dwellir.com"
3075
+ },
3076
+ {
3077
+ name: "Helixstreet",
3078
+ endpoint: "wss://rpc-kusama.helixstreet.io"
3079
+ },
3080
+ {
3081
+ name: "IBP1",
3082
+ endpoint: "wss://kusama.ibp.network"
3083
+ },
3084
+ {
3085
+ name: "IBP2",
3086
+ endpoint: "wss://kusama.dotters.network"
3087
+ },
3088
+ {
3089
+ name: "LuckyFriday",
3090
+ endpoint: "wss://rpc-kusama.luckyfriday.io"
3091
+ },
3092
+ {
3093
+ name: "OnFinality",
3094
+ endpoint: "wss://kusama.api.onfinality.io/public-ws"
3095
+ },
3096
+ {
3097
+ name: "RadiumBlock",
3098
+ endpoint: "wss://kusama.public.curie.radiumblock.co/ws"
3099
+ },
3100
+ {
3101
+ name: "Spectrum",
3102
+ endpoint: "wss://spectrum-03.simplystaking.xyz/cG9sa2Fkb3QtMDMtOTFkMmYwZGYtcG9sa2Fkb3Q/QXq7QZ6Q60NDzA/kusama/mainnet/"
3103
+ },
3104
+ {
3105
+ name: "Stakeworld",
3106
+ endpoint: "wss://rpc-kusama.stakeworld.io"
3107
+ }
3108
+ ]
3156
3109
  };
3157
- var isBridgeHub = function isBridgeHub(chain) {
3158
- return chain === 'BridgeHubPolkadot' || chain === 'BridgeHubKusama';
3110
+ var Westend$1 = {
3111
+ name: "Westend Relay",
3112
+ info: "westend",
3113
+ paraId: 0,
3114
+ providers: [
3115
+ {
3116
+ name: "Dwellir",
3117
+ endpoint: "wss://westend-rpc.n.dwellir.com"
3118
+ },
3119
+ {
3120
+ name: "Dwellir Tunisia",
3121
+ endpoint: "wss://westend-rpc-tn.dwellir.com"
3122
+ },
3123
+ {
3124
+ name: "OnFinality",
3125
+ endpoint: "wss://westend.api.onfinality.io/public-ws"
3126
+ },
3127
+ {
3128
+ name: "Parity",
3129
+ endpoint: "wss://westend-rpc.polkadot.io"
3130
+ },
3131
+ {
3132
+ name: "RadiumBlock",
3133
+ endpoint: "wss://westend.public.curie.radiumblock.co/ws"
3134
+ }
3135
+ ]
3159
3136
  };
3160
- var isPeople = function isPeople(chain) {
3161
- return chain === 'PeoplePolkadot' || chain === 'PeopleKusama';
3137
+ var Paseo$1 = {
3138
+ name: "Paseo Relay",
3139
+ info: "paseo",
3140
+ paraId: 0,
3141
+ providers: [
3142
+ {
3143
+ name: "Amforc",
3144
+ endpoint: "wss://paseo.rpc.amforc.com"
3145
+ },
3146
+ {
3147
+ name: "Dwellir",
3148
+ endpoint: "wss://paseo-rpc.n.dwellir.com"
3149
+ },
3150
+ {
3151
+ name: "IBP1",
3152
+ endpoint: "wss://paseo.ibp.network"
3153
+ },
3154
+ {
3155
+ name: "IBP2",
3156
+ endpoint: "wss://paseo.dotters.network"
3157
+ }
3158
+ ]
3162
3159
  };
3163
- var isSystemPara = function isSystemPara(chain) {
3164
- return isAssetHub(chain) || isBridgeHub(chain) || isPeople(chain);
3160
+ var configs = {
3161
+ AssetHubPolkadot: AssetHubPolkadot$1,
3162
+ Acala: Acala$1,
3163
+ Ajuna: Ajuna$1,
3164
+ Astar: Astar$1,
3165
+ BifrostPolkadot: BifrostPolkadot$1,
3166
+ BridgeHubPolkadot: BridgeHubPolkadot$1,
3167
+ Centrifuge: Centrifuge$1,
3168
+ Darwinia: Darwinia$1,
3169
+ EnergyWebX: EnergyWebX$1,
3170
+ Hydration: Hydration$1,
3171
+ Interlay: Interlay$1,
3172
+ Heima: Heima$1,
3173
+ Jamton: Jamton$1,
3174
+ Moonbeam: Moonbeam$1,
3175
+ CoretimePolkadot: CoretimePolkadot$1,
3176
+ Collectives: Collectives$1,
3177
+ Crust: Crust$1,
3178
+ Manta: Manta$1,
3179
+ NeuroWeb: NeuroWeb$1,
3180
+ Pendulum: Pendulum$1,
3181
+ Mythos: Mythos$1,
3182
+ Peaq: Peaq$1,
3183
+ PeoplePolkadot: PeoplePolkadot$1,
3184
+ Unique: Unique$1,
3185
+ Xode: Xode$1,
3186
+ AssetHubKusama: AssetHubKusama$1,
3187
+ BridgeHubKusama: BridgeHubKusama$1,
3188
+ Karura: Karura$1,
3189
+ Kintsugi: Kintsugi$1,
3190
+ Moonriver: Moonriver$1,
3191
+ CoretimeKusama: CoretimeKusama$1,
3192
+ Encointer: Encointer$1,
3193
+ Basilisk: Basilisk$1,
3194
+ BifrostKusama: BifrostKusama$1,
3195
+ CrustShadow: CrustShadow$1,
3196
+ Crab: Crab$1,
3197
+ Laos: Laos$1,
3198
+ Quartz: Quartz$1,
3199
+ RobonomicsPolkadot: RobonomicsPolkadot$1,
3200
+ PeopleKusama: PeopleKusama$1,
3201
+ Shiden: Shiden$1,
3202
+ Zeitgeist: Zeitgeist$1,
3203
+ AssetHubWestend: AssetHubWestend$1,
3204
+ BridgeHubWestend: BridgeHubWestend$1,
3205
+ CollectivesWestend: CollectivesWestend$1,
3206
+ CoretimeWestend: CoretimeWestend$1,
3207
+ Penpal: Penpal$1,
3208
+ PeopleWestend: PeopleWestend$1,
3209
+ AjunaPaseo: AjunaPaseo$1,
3210
+ AssetHubPaseo: AssetHubPaseo$1,
3211
+ BifrostPaseo: BifrostPaseo$1,
3212
+ BridgeHubPaseo: BridgeHubPaseo$1,
3213
+ CoretimePaseo: CoretimePaseo$1,
3214
+ EnergyWebXPaseo: EnergyWebXPaseo$1,
3215
+ HeimaPaseo: HeimaPaseo$1,
3216
+ HydrationPaseo: HydrationPaseo$1,
3217
+ LaosPaseo: LaosPaseo$1,
3218
+ NeuroWebPaseo: NeuroWebPaseo$1,
3219
+ PeoplePaseo: PeoplePaseo$1,
3220
+ ZeitgeistPaseo: ZeitgeistPaseo$1,
3221
+ Polkadot: Polkadot$1,
3222
+ Kusama: Kusama$1,
3223
+ Westend: Westend$1,
3224
+ Paseo: Paseo$1
3165
3225
  };
3166
- var mul = function mul(v, num) {
3167
- var den = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1n;
3168
- return v * num / den;
3226
+
3227
+ var configsMap = configs;
3228
+ var getChainConfig = function getChainConfig(chain) {
3229
+ return configsMap[chain];
3169
3230
  };
3170
- var padFee = function padFee(raw, origin, dest, side) {
3171
- var relayOrigin = isRelayChain(origin);
3172
- var relayDest = isRelayChain(dest);
3173
- var sysParaOrigin = isSystemPara(origin);
3174
- var sysParaDest = isSystemPara(dest);
3175
- var relayToPara = relayOrigin && !relayDest;
3176
- var sysParaToPara = sysParaOrigin && !sysParaDest;
3177
- var paraToPara = !relayOrigin && !sysParaOrigin;
3178
- if (sysParaToPara) return raw * 40n;
3179
- if (relayToPara) return side === 'origin' ? mul(raw, 320n, 100n) : mul(raw, 3000n, 100n);
3180
- if (paraToPara && side == 'origin' && origin === 'Mythos' && dest !== 'Ethereum') {
3181
- return 150000000000000000n;
3231
+
3232
+ var getChainProviders = function getChainProviders(chain) {
3233
+ var _getChainConfig = getChainConfig(chain),
3234
+ providers = _getChainConfig.providers;
3235
+ if (providers.length === 0) {
3236
+ throw new ProviderUnavailableError("No providers found for chain ".concat(chain));
3182
3237
  }
3183
- if (paraToPara) return mul(raw, 130n, 100n);
3184
- // apply default 30% padding
3185
- return mul(raw, 130n, 100n);
3186
- };
3187
- var padValueBy = function padValueBy(amount, percent) {
3188
- var scaled = BigInt(Math.round(percent * 100)); // 2 decimal precision
3189
- return amount * (BigInt(10000) + scaled) / BigInt(10000);
3238
+ // Prefer Dwellir provider
3239
+ providers.sort(function (a, b) {
3240
+ return (a.name === 'Dwellir' ? 0 : 1) - (b.name === 'Dwellir' ? 0 : 1);
3241
+ });
3242
+ return providers.map(function (p) {
3243
+ return p.endpoint;
3244
+ });
3190
3245
  };
3191
3246
 
3192
- var getMythosOriginFee = /*#__PURE__*/function () {
3193
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api) {
3194
- var ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, ahExecutionFee, nativeAsset, feeConverted;
3195
- return _regenerator().w(function (_context) {
3196
- while (1) switch (_context.n) {
3197
- case 0:
3198
- ahApi = api.clone();
3199
- _context.n = 1;
3200
- return ahApi.init('AssetHubPolkadot');
3201
- case 1:
3202
- _context.n = 2;
3203
- return getParaEthTransferFees(ahApi, false);
3204
- case 2:
3205
- _yield$getParaEthTran = _context.v;
3206
- _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
3207
- bridgeFee = _yield$getParaEthTran2[0];
3208
- ahExecutionFee = _yield$getParaEthTran2[1];
3209
- nativeAsset = findNativeAssetInfoOrThrow('Mythos');
3210
- _context.n = 3;
3211
- return ahApi.quoteAhPrice(DOT_LOCATION, nativeAsset.location, bridgeFee + ahExecutionFee);
3212
- case 3:
3213
- feeConverted = _context.v;
3214
- _context.n = 4;
3215
- return ahApi.disconnect();
3216
- case 4:
3217
- if (feeConverted) {
3218
- _context.n = 5;
3219
- break;
3220
- }
3221
- throw new UnableToComputeError("Pool DOT -> ".concat(nativeAsset.symbol, " not found."));
3222
- case 5:
3223
- return _context.a(2, padValueBy(feeConverted, 10));
3224
- }
3225
- }, _callee);
3226
- }));
3227
- return function getMythosOriginFee(_x) {
3228
- return _ref.apply(this, arguments);
3229
- };
3230
- }();
3247
+ /**
3248
+ * Retrieves the parachain ID for a specified chain.
3249
+ *
3250
+ * @param chain - The chain for which to get the paraId.
3251
+ * @returns The parachain ID of the chain.
3252
+ */
3253
+ var getParaId = function getParaId(chain) {
3254
+ if (chain === 'Ethereum') {
3255
+ return ETH_MAINNET_PARA_ID;
3256
+ } else if (chain === 'EthereumTestnet') {
3257
+ return ETH_TESTNET_PARA_ID;
3258
+ }
3259
+ return getChainConfig(chain).paraId;
3260
+ };
3231
3261
 
3232
3262
  /**
3233
3263
  * Builder class for constructing asset claim transactions.
@@ -3343,7 +3373,7 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
3343
3373
  }, {
3344
3374
  key: "getApi",
3345
3375
  value: function getApi() {
3346
- return this.api.getApi();
3376
+ return this.api.api;
3347
3377
  }
3348
3378
  /**
3349
3379
  * Disconnects the API.
@@ -4085,7 +4115,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
4085
4115
  while (1) switch (_context7.n) {
4086
4116
  case 0:
4087
4117
  sender = options.sender;
4088
- config = this.api.getConfig();
4118
+ config = this.api.config;
4089
4119
  if (!(isConfig(config) && config.xcmFormatCheck && !isCalledInternally)) {
4090
4120
  _context7.n = 2;
4091
4121
  break;
@@ -4657,7 +4687,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
4657
4687
  }, {
4658
4688
  key: "getApi",
4659
4689
  value: function getApi() {
4660
- return this.api.getApi();
4690
+ return this.api.api;
4661
4691
  }
4662
4692
  /**
4663
4693
  * Disconnects the API.
@@ -6692,7 +6722,7 @@ var traverseXcmHops = /*#__PURE__*/function () {
6692
6722
  hasPassedExchange = origin === (swapConfig === null || swapConfig === void 0 ? void 0 : swapConfig.exchangeChain);
6693
6723
  hops = [];
6694
6724
  case 1:
6695
- if (!(Array.isArray(forwardedXcms) && forwardedXcms.length > 0 && forwardedXcms[1].length > 0 && ('disconnect' in api.getApi() ? Object.values(forwardedXcms[1][0]).length : forwardedXcms[1][0].value.length) > 0 && nextParaId !== undefined)) {
6725
+ if (!(Array.isArray(forwardedXcms) && forwardedXcms.length > 0 && forwardedXcms[1].length > 0 && ('disconnect' in api.api ? Object.values(forwardedXcms[1][0]).length : forwardedXcms[1][0].value.length) > 0 && nextParaId !== undefined)) {
6696
6726
  _context.n = 10;
6697
6727
  break;
6698
6728
  }
@@ -7723,7 +7753,7 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
7723
7753
  _context2.n = 6;
7724
7754
  return destApi.init(destination, DRY_RUN_CLIENT_TIMEOUT_MS);
7725
7755
  case 6:
7726
- destApi.setDisconnectAllowed(false);
7756
+ destApi.disconnectAllowed = false;
7727
7757
  _context2.n = 7;
7728
7758
  return getDestXcmFee({
7729
7759
  api: destApi,
@@ -7783,7 +7813,7 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
7783
7813
  }));
7784
7814
  case 8:
7785
7815
  _context2.p = 8;
7786
- destApi.setDisconnectAllowed(true);
7816
+ destApi.disconnectAllowed = true;
7787
7817
  _context2.n = 9;
7788
7818
  return destApi.disconnect();
7789
7819
  case 9:
@@ -8218,7 +8248,7 @@ var buildHopInfo = /*#__PURE__*/function () {
8218
8248
  _context.n = 1;
8219
8249
  return hopApi.init(chain);
8220
8250
  case 1:
8221
- hopApi.setDisconnectAllowed(false);
8251
+ hopApi.disconnectAllowed = false;
8222
8252
  _context.p = 2;
8223
8253
  xcmFeeDetails = {
8224
8254
  fee: fee,
@@ -8246,7 +8276,7 @@ var buildHopInfo = /*#__PURE__*/function () {
8246
8276
  });
8247
8277
  case 4:
8248
8278
  _context.p = 4;
8249
- hopApi.setDisconnectAllowed(true);
8279
+ hopApi.disconnectAllowed = true;
8250
8280
  _context.n = 5;
8251
8281
  return hopApi.disconnect();
8252
8282
  case 5:
@@ -8278,7 +8308,7 @@ var getTransferInfo = /*#__PURE__*/function () {
8278
8308
  _context2.n = 2;
8279
8309
  return api.init(origin);
8280
8310
  case 2:
8281
- api.setDisconnectAllowed(false);
8311
+ api.disconnectAllowed = false;
8282
8312
  _context2.p = 3;
8283
8313
  originAsset = findAssetInfoOrThrow(origin, currency, destination);
8284
8314
  amount = abstractDecimals(currency.amount, originAsset.decimals, api);
@@ -8414,7 +8444,7 @@ var getTransferInfo = /*#__PURE__*/function () {
8414
8444
  });
8415
8445
  case 10:
8416
8446
  _context2.p = 10;
8417
- api.setDisconnectAllowed(true);
8447
+ api.disconnectAllowed = true;
8418
8448
  _context2.n = 11;
8419
8449
  return api.disconnect();
8420
8450
  case 11:
@@ -8626,7 +8656,7 @@ var getMinTransferableAmount = /*#__PURE__*/function () {
8626
8656
  while (1) switch (_context3.p = _context3.n) {
8627
8657
  case 0:
8628
8658
  api = options.api;
8629
- api.setDisconnectAllowed(false);
8659
+ api.disconnectAllowed = false;
8630
8660
  _context3.p = 1;
8631
8661
  _context3.n = 2;
8632
8662
  return getMinTransferableAmountInternal(options);
@@ -8634,7 +8664,7 @@ var getMinTransferableAmount = /*#__PURE__*/function () {
8634
8664
  return _context3.a(2, _context3.v);
8635
8665
  case 3:
8636
8666
  _context3.p = 3;
8637
- api.setDisconnectAllowed(true);
8667
+ api.disconnectAllowed = true;
8638
8668
  _context3.n = 4;
8639
8669
  return api.disconnect();
8640
8670
  case 4:
@@ -8719,7 +8749,7 @@ var getTransferableAmount = /*#__PURE__*/function () {
8719
8749
  while (1) switch (_context2.p = _context2.n) {
8720
8750
  case 0:
8721
8751
  api = options.api;
8722
- api.setDisconnectAllowed(false);
8752
+ api.disconnectAllowed = false;
8723
8753
  _context2.p = 1;
8724
8754
  _context2.n = 2;
8725
8755
  return getTransferableAmountInternal(options);
@@ -8727,7 +8757,7 @@ var getTransferableAmount = /*#__PURE__*/function () {
8727
8757
  return _context2.a(2, _context2.v);
8728
8758
  case 3:
8729
8759
  _context2.p = 3;
8730
- api.setDisconnectAllowed(true);
8760
+ api.disconnectAllowed = true;
8731
8761
  _context2.n = 4;
8732
8762
  return api.disconnect();
8733
8763
  case 4:
@@ -9543,7 +9573,7 @@ var computeOverridenAmount = function computeOverridenAmount(options, increaseAm
9543
9573
  currency = options.currency,
9544
9574
  api = options.api;
9545
9575
  var amount = options.currency.amount;
9546
- var config = api.getConfig();
9576
+ var config = api.config;
9547
9577
  if (!(isConfig(config) && config.abstractDecimals === false) && typeof amount !== 'bigint') {
9548
9578
  var base = relative ? Number(amount) : 0;
9549
9579
  return Number(increaseAmount) + base;
@@ -9606,7 +9636,7 @@ var createTxOverrideAmount = /*#__PURE__*/function () {
9606
9636
  }();
9607
9637
  var createTransferOrSwapAll = /*#__PURE__*/function () {
9608
9638
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options) {
9609
- var api, from, swapOptions, _t, _t2, _t3, _t4;
9639
+ var api, from, swapOptions, tx;
9610
9640
  return _regenerator().w(function (_context3) {
9611
9641
  while (1) switch (_context3.n) {
9612
9642
  case 0:
@@ -9621,19 +9651,16 @@ var createTransferOrSwapAll = /*#__PURE__*/function () {
9621
9651
  return builder.build();
9622
9652
  }));
9623
9653
  case 1:
9624
- _t = api.getApi();
9625
- _t2 = from;
9626
9654
  _context3.n = 2;
9627
9655
  return createTransfer(options);
9628
9656
  case 2:
9629
- _t3 = _context3.v;
9630
- _t4 = {
9657
+ tx = _context3.v;
9658
+ return _context3.a(2, [{
9631
9659
  type: 'TRANSFER',
9632
- api: _t,
9633
- chain: _t2,
9634
- tx: _t3
9635
- };
9636
- return _context3.a(2, [_t4]);
9660
+ api: api.api,
9661
+ chain: from,
9662
+ tx: tx
9663
+ }]);
9637
9664
  }
9638
9665
  }, _callee3);
9639
9666
  }));
@@ -9674,7 +9701,7 @@ var createChainClient = /*#__PURE__*/function () {
9674
9701
  _context.n = 1;
9675
9702
  return api.init(chain);
9676
9703
  case 1:
9677
- return _context.a(2, api.getApi());
9704
+ return _context.a(2, api.api);
9678
9705
  }
9679
9706
  }, _callee);
9680
9707
  }));
@@ -9741,7 +9768,7 @@ var resolveParaId = function resolveParaId(paraId, destination) {
9741
9768
  };
9742
9769
 
9743
9770
  var abstractDecimals = function abstractDecimals(amount, decimals, api) {
9744
- var config = api.getConfig();
9771
+ var config = api.config;
9745
9772
  var abstractDecimals = !(isConfig(config) && config.abstractDecimals === false);
9746
9773
  return applyDecimalAbstraction(amount, decimals, abstractDecimals);
9747
9774
  };
@@ -13961,7 +13988,7 @@ var ERR_LOCATION_DEST_NOT_SUPPORTED = 'XCM Location destinations are not support
13961
13988
  /**
13962
13989
  * Supported exchange chains
13963
13990
  */
13964
- var EXCHANGE_CHAINS = ['AssetHubPolkadotDex', 'AssetHubKusamaDex', 'AssetHubPaseoDex', 'AssetHubWestendDex', 'HydrationDex', 'KaruraDex', 'AcalaDex', 'BifrostKusamaDex', 'BifrostPolkadotDex'];
13991
+ var EXCHANGE_CHAINS = ['AssetHubPolkadot', 'AssetHubKusama', 'AssetHubPaseo', 'AssetHubWestend', 'Hydration', 'Karura', 'Acala', 'BifrostKusama', 'BifrostPolkadot'];
13965
13992
  var DEFAULT_SWAP_SLIPPAGE = 1;
13966
13993
 
13967
13994
  var EVM_DEV_PRIVATE_KEYS = {
@@ -13973,20 +14000,36 @@ var EVM_DEV_PRIVATE_KEYS = {
13973
14000
  faith: '0xb9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df'
13974
14001
  };
13975
14002
 
13976
- /**
13977
- * Retrieves the parachain ID for a specified chain.
13978
- *
13979
- * @param chain - The chain for which to get the paraId.
13980
- * @returns The parachain ID of the chain.
13981
- */
13982
- var getParaId = function getParaId(chain) {
13983
- if (chain === 'Ethereum') {
13984
- return ETH_MAINNET_PARA_ID;
13985
- } else if (chain === 'EthereumTestnet') {
13986
- return ETH_TESTNET_PARA_ID;
14003
+ var PolkadotApi = /*#__PURE__*/function () {
14004
+ function PolkadotApi(config) {
14005
+ _classCallCheck(this, PolkadotApi);
14006
+ this._ttlMs = DEFAULT_TTL_MS;
14007
+ this._disconnectAllowed = true;
14008
+ this._config = config;
13987
14009
  }
13988
- return getChainConfig(chain).paraId;
13989
- };
14010
+ return _createClass(PolkadotApi, [{
14011
+ key: "api",
14012
+ get: function get() {
14013
+ if (!this._api) {
14014
+ throw new ApiNotInitializedError();
14015
+ }
14016
+ return this._api;
14017
+ }
14018
+ }, {
14019
+ key: "disconnectAllowed",
14020
+ get: function get() {
14021
+ return this._disconnectAllowed;
14022
+ },
14023
+ set: function set(allowed) {
14024
+ this._disconnectAllowed = allowed;
14025
+ }
14026
+ }, {
14027
+ key: "config",
14028
+ get: function get() {
14029
+ return this._config;
14030
+ }
14031
+ }]);
14032
+ }();
13990
14033
 
13991
14034
  var resolveChainApi = function resolveChainApi(config, chain, createApiInstance) {
13992
14035
  var _config$apiOverrides;
@@ -14171,4 +14214,4 @@ var createClientCache = function createClientCache(maxSize, pingClient, onEvicti
14171
14214
  };
14172
14215
  };
14173
14216
 
14174
- export { API_TYPES, AmountTooLowError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertSender, assertSenderSource, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createDestination, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createRouterBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithRouter, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmPrivateKeyHex, getFailureInfo$1 as getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerSwapExtension, resolveChainApi, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };
14217
+ export { API_TYPES, AmountTooLowError, ApiNotInitializedError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertSender, assertSenderSource, assertSwapSupport, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, compareAddresses, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createClientCache, createClientPoolHelpers, createDestination, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createRouterBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithRouter, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getEvmPrivateKeyHex, getFailureInfo$1 as getFailureInfo, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getSwapExtensionOrThrow, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isSenderSigner, keyFromWs, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickRouterCompatibleXcmVersion, registerSwapExtension, resolveChainApi, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateTransact, verifyEdOnDestination, wrapTxBypass };