@paraspell/sdk-core 11.13.0 → 11.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +119 -38
- package/dist/index.d.ts +62 -10
- package/dist/index.mjs +120 -39
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1141,6 +1141,7 @@ exports.XTokensError = void 0;
|
|
|
1141
1141
|
XTokensError["MinXcmFeeNotDefined"] = "MinXcmFeeNotDefined";
|
|
1142
1142
|
XTokensError["RateLimited"] = "RateLimited";
|
|
1143
1143
|
})(exports.XTokensError || (exports.XTokensError = {}));
|
|
1144
|
+
// Mirrors https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/errors.rs
|
|
1144
1145
|
exports.PolkadotXcmError = void 0;
|
|
1145
1146
|
(function (PolkadotXcmError) {
|
|
1146
1147
|
PolkadotXcmError["Unreachable"] = "Unreachable";
|
|
@@ -1173,6 +1174,50 @@ exports.PolkadotXcmError = void 0;
|
|
|
1173
1174
|
PolkadotXcmError["AliasNotFound"] = "AliasNotFound";
|
|
1174
1175
|
PolkadotXcmError["LocalExecutionIncompleteWithError"] = "LocalExecutionIncompleteWithError";
|
|
1175
1176
|
})(exports.PolkadotXcmError || (exports.PolkadotXcmError = {}));
|
|
1177
|
+
exports.PolkadotXcmExecutionError = void 0;
|
|
1178
|
+
(function (PolkadotXcmExecutionError) {
|
|
1179
|
+
PolkadotXcmExecutionError["Overflow"] = "Overflow";
|
|
1180
|
+
PolkadotXcmExecutionError["Unimplemented"] = "Unimplemented";
|
|
1181
|
+
PolkadotXcmExecutionError["UntrustedReserveLocation"] = "UntrustedReserveLocation";
|
|
1182
|
+
PolkadotXcmExecutionError["UntrustedTeleportLocation"] = "UntrustedTeleportLocation";
|
|
1183
|
+
PolkadotXcmExecutionError["LocationFull"] = "LocationFull";
|
|
1184
|
+
PolkadotXcmExecutionError["LocationNotInvertible"] = "LocationNotInvertible";
|
|
1185
|
+
PolkadotXcmExecutionError["BadOrigin"] = "BadOrigin";
|
|
1186
|
+
PolkadotXcmExecutionError["InvalidLocation"] = "InvalidLocation";
|
|
1187
|
+
PolkadotXcmExecutionError["AssetNotFound"] = "AssetNotFound";
|
|
1188
|
+
PolkadotXcmExecutionError["FailedToTransactAsset"] = "FailedToTransactAsset";
|
|
1189
|
+
PolkadotXcmExecutionError["NotWithdrawable"] = "NotWithdrawable";
|
|
1190
|
+
PolkadotXcmExecutionError["LocationCannotHold"] = "LocationCannotHold";
|
|
1191
|
+
PolkadotXcmExecutionError["ExceedsMaxMessageSize"] = "ExceedsMaxMessageSize";
|
|
1192
|
+
PolkadotXcmExecutionError["DestinationUnsupported"] = "DestinationUnsupported";
|
|
1193
|
+
PolkadotXcmExecutionError["Transport"] = "Transport";
|
|
1194
|
+
PolkadotXcmExecutionError["Unroutable"] = "Unroutable";
|
|
1195
|
+
PolkadotXcmExecutionError["UnknownClaim"] = "UnknownClaim";
|
|
1196
|
+
PolkadotXcmExecutionError["FailedToDecode"] = "FailedToDecode";
|
|
1197
|
+
PolkadotXcmExecutionError["MaxWeightInvalid"] = "MaxWeightInvalid";
|
|
1198
|
+
PolkadotXcmExecutionError["NotHoldingFees"] = "NotHoldingFees";
|
|
1199
|
+
PolkadotXcmExecutionError["TooExpensive"] = "TooExpensive";
|
|
1200
|
+
PolkadotXcmExecutionError["Trap"] = "Trap";
|
|
1201
|
+
PolkadotXcmExecutionError["ExpectationFalse"] = "ExpectationFalse";
|
|
1202
|
+
PolkadotXcmExecutionError["PalletNotFound"] = "PalletNotFound";
|
|
1203
|
+
PolkadotXcmExecutionError["NameMismatch"] = "NameMismatch";
|
|
1204
|
+
PolkadotXcmExecutionError["VersionIncompatible"] = "VersionIncompatible";
|
|
1205
|
+
PolkadotXcmExecutionError["HoldingWouldOverflow"] = "HoldingWouldOverflow";
|
|
1206
|
+
PolkadotXcmExecutionError["ExportError"] = "ExportError";
|
|
1207
|
+
PolkadotXcmExecutionError["ReanchorFailed"] = "ReanchorFailed";
|
|
1208
|
+
PolkadotXcmExecutionError["NoDeal"] = "NoDeal";
|
|
1209
|
+
PolkadotXcmExecutionError["FeesNotMet"] = "FeesNotMet";
|
|
1210
|
+
PolkadotXcmExecutionError["LockError"] = "LockError";
|
|
1211
|
+
PolkadotXcmExecutionError["NoPermission"] = "NoPermission";
|
|
1212
|
+
PolkadotXcmExecutionError["Unanchored"] = "Unanchored";
|
|
1213
|
+
PolkadotXcmExecutionError["NotDepositable"] = "NotDepositable";
|
|
1214
|
+
PolkadotXcmExecutionError["TooManyAssets"] = "TooManyAssets";
|
|
1215
|
+
PolkadotXcmExecutionError["UnhandledXcmVersion"] = "UnhandledXcmVersion";
|
|
1216
|
+
PolkadotXcmExecutionError["WeightLimitReached"] = "WeightLimitReached";
|
|
1217
|
+
PolkadotXcmExecutionError["Barrier"] = "Barrier";
|
|
1218
|
+
PolkadotXcmExecutionError["WeightNotComputable"] = "WeightNotComputable";
|
|
1219
|
+
PolkadotXcmExecutionError["ExceedsStackLimit"] = "ExceedsStackLimit";
|
|
1220
|
+
})(exports.PolkadotXcmExecutionError || (exports.PolkadotXcmExecutionError = {}));
|
|
1176
1221
|
|
|
1177
1222
|
var resolveModuleError = function resolveModuleError(chain, error) {
|
|
1178
1223
|
var palletDetails = pallets.getSupportedPalletsDetails(chain).find(function (p) {
|
|
@@ -1182,6 +1227,7 @@ var resolveModuleError = function resolveModuleError(chain, error) {
|
|
|
1182
1227
|
throw new InvalidParameterError("Pallet with index ".concat(error.index, " not found"));
|
|
1183
1228
|
}
|
|
1184
1229
|
// Use only the first byte of the error to get the error index
|
|
1230
|
+
// Including 0x prefix
|
|
1185
1231
|
var errorIndex = Number(error.error.slice(0, 4));
|
|
1186
1232
|
var name = palletDetails.name;
|
|
1187
1233
|
if (name !== 'XTokens' && name !== 'PolkadotXcm' && name !== 'XcmPallet') {
|
|
@@ -1191,7 +1237,20 @@ var resolveModuleError = function resolveModuleError(chain, error) {
|
|
|
1191
1237
|
if (!failureReason) {
|
|
1192
1238
|
throw new InvalidParameterError("Error index ".concat(errorIndex, " not found in ").concat(name, " pallet"));
|
|
1193
1239
|
}
|
|
1194
|
-
|
|
1240
|
+
if (failureReason === exports.PolkadotXcmError.LocalExecutionIncompleteWithError) {
|
|
1241
|
+
var subErrorIndex = Number("0x".concat(error.error.slice(6, 8)));
|
|
1242
|
+
var failureSubReason = Object.values(exports.PolkadotXcmExecutionError)[subErrorIndex];
|
|
1243
|
+
if (!failureSubReason) {
|
|
1244
|
+
throw new InvalidParameterError("Sub-error index ".concat(subErrorIndex, " not found in PolkadotXcm pallet"));
|
|
1245
|
+
}
|
|
1246
|
+
return {
|
|
1247
|
+
failureReason: failureReason,
|
|
1248
|
+
failureSubReason: failureSubReason
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
return {
|
|
1252
|
+
failureReason: failureReason
|
|
1253
|
+
};
|
|
1195
1254
|
};
|
|
1196
1255
|
|
|
1197
1256
|
var isAssetHub = function isAssetHub(chain) {
|
|
@@ -1228,7 +1287,8 @@ var padFee = function padFee(raw, origin, dest, side) {
|
|
|
1228
1287
|
return mul(raw, 130n, 100n);
|
|
1229
1288
|
};
|
|
1230
1289
|
var padValueBy = function padValueBy(amount, percent) {
|
|
1231
|
-
|
|
1290
|
+
var scaled = BigInt(Math.round(percent * 100)); // 2 decimal precision
|
|
1291
|
+
return amount * (BigInt(10000) + scaled) / BigInt(10000);
|
|
1232
1292
|
};
|
|
1233
1293
|
|
|
1234
1294
|
var resolveScenario = function resolveScenario(origin, destination) {
|
|
@@ -4408,7 +4468,8 @@ var getDestXcmFee = /*#__PURE__*/function () {
|
|
|
4408
4468
|
break;
|
|
4409
4469
|
}
|
|
4410
4470
|
return _context3.a(2, {
|
|
4411
|
-
dryRunError: dryRunResult.failureReason
|
|
4471
|
+
dryRunError: dryRunResult.failureReason,
|
|
4472
|
+
dryRunSubError: dryRunResult.failureSubReason
|
|
4412
4473
|
});
|
|
4413
4474
|
case 5:
|
|
4414
4475
|
_context3.n = 6;
|
|
@@ -4419,6 +4480,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
|
|
|
4419
4480
|
fee: _fee2,
|
|
4420
4481
|
feeType: 'paymentInfo',
|
|
4421
4482
|
dryRunError: dryRunResult.failureReason,
|
|
4483
|
+
dryRunSubError: dryRunResult.failureSubReason,
|
|
4422
4484
|
sufficient: false,
|
|
4423
4485
|
asset: asset,
|
|
4424
4486
|
currency: asset.symbol
|
|
@@ -4673,7 +4735,8 @@ var getFailureInfo$1 = function getFailureInfo(result) {
|
|
|
4673
4735
|
if (chainResult && chainResult.success === false && chainResult.failureReason) {
|
|
4674
4736
|
return {
|
|
4675
4737
|
failureChain: chain,
|
|
4676
|
-
failureReason: chainResult.failureReason
|
|
4738
|
+
failureReason: chainResult.failureReason,
|
|
4739
|
+
failureSubReason: chainResult.failureSubReason
|
|
4677
4740
|
};
|
|
4678
4741
|
}
|
|
4679
4742
|
}
|
|
@@ -4684,7 +4747,8 @@ var getFailureInfo$1 = function getFailureInfo(result) {
|
|
|
4684
4747
|
}
|
|
4685
4748
|
return {
|
|
4686
4749
|
failureChain: result.failureChain,
|
|
4687
|
-
failureReason: result.failureReason
|
|
4750
|
+
failureReason: result.failureReason,
|
|
4751
|
+
failureSubReason: result.failureSubReason
|
|
4688
4752
|
};
|
|
4689
4753
|
};
|
|
4690
4754
|
|
|
@@ -5445,6 +5509,7 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
5445
5509
|
}
|
|
5446
5510
|
return _context2.a(2, {
|
|
5447
5511
|
failureReason: originDryRun.failureReason,
|
|
5512
|
+
failureSubReason: originDryRun.failureSubReason,
|
|
5448
5513
|
failureChain: 'origin',
|
|
5449
5514
|
origin: originDryRun,
|
|
5450
5515
|
hops: []
|
|
@@ -7700,25 +7765,6 @@ var Basilisk = /*#__PURE__*/function (_Parachain) {
|
|
|
7700
7765
|
}]);
|
|
7701
7766
|
}(Parachain);
|
|
7702
7767
|
|
|
7703
|
-
var BifrostKusama = /*#__PURE__*/function (_Parachain) {
|
|
7704
|
-
function BifrostKusama() {
|
|
7705
|
-
_classCallCheck(this, BifrostKusama);
|
|
7706
|
-
return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'Kusama', sdkCommon.Version.V5]);
|
|
7707
|
-
}
|
|
7708
|
-
_inherits(BifrostKusama, _Parachain);
|
|
7709
|
-
return _createClass(BifrostKusama, [{
|
|
7710
|
-
key: "transferXTokens",
|
|
7711
|
-
value: function transferXTokens(input) {
|
|
7712
|
-
return getChain('BifrostPolkadot').transferXTokens(input);
|
|
7713
|
-
}
|
|
7714
|
-
}, {
|
|
7715
|
-
key: "transferLocalNonNativeAsset",
|
|
7716
|
-
value: function transferLocalNonNativeAsset(options) {
|
|
7717
|
-
return getChain('BifrostPolkadot').transferLocalNonNativeAsset(options);
|
|
7718
|
-
}
|
|
7719
|
-
}]);
|
|
7720
|
-
}(Parachain);
|
|
7721
|
-
|
|
7722
7768
|
var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
7723
7769
|
function BifrostPolkadot() {
|
|
7724
7770
|
var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'BifrostPolkadot';
|
|
@@ -7740,7 +7786,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
7740
7786
|
}
|
|
7741
7787
|
var isVToken = asset.symbol && asset.symbol.startsWith('v');
|
|
7742
7788
|
var isVSToken = asset.symbol && asset.symbol.startsWith('vs');
|
|
7743
|
-
if (!assets.isForeignAsset(asset)) {
|
|
7789
|
+
if (!assets.isForeignAsset(asset) || assets.isForeignAsset(asset) && !asset.assetId) {
|
|
7744
7790
|
return isVToken ? {
|
|
7745
7791
|
VToken: asset.symbol.substring(1)
|
|
7746
7792
|
} : {
|
|
@@ -7820,6 +7866,15 @@ var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
7820
7866
|
}]);
|
|
7821
7867
|
}(Parachain);
|
|
7822
7868
|
|
|
7869
|
+
var BifrostKusama = /*#__PURE__*/function (_BifrostPolkadot) {
|
|
7870
|
+
function BifrostKusama() {
|
|
7871
|
+
_classCallCheck(this, BifrostKusama);
|
|
7872
|
+
return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'Kusama', sdkCommon.Version.V5]);
|
|
7873
|
+
}
|
|
7874
|
+
_inherits(BifrostKusama, _BifrostPolkadot);
|
|
7875
|
+
return _createClass(BifrostKusama);
|
|
7876
|
+
}(BifrostPolkadot);
|
|
7877
|
+
|
|
7823
7878
|
var BifrostPaseo = /*#__PURE__*/function (_BifrostPolkadot) {
|
|
7824
7879
|
function BifrostPaseo() {
|
|
7825
7880
|
_classCallCheck(this, BifrostPaseo);
|
|
@@ -8609,6 +8664,16 @@ var IntegriteePolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
8609
8664
|
value: function transferRelayToPara() {
|
|
8610
8665
|
throw new ChainNotSupportedError();
|
|
8611
8666
|
}
|
|
8667
|
+
}, {
|
|
8668
|
+
key: "isSendingTempDisabled",
|
|
8669
|
+
value: function isSendingTempDisabled(_options) {
|
|
8670
|
+
return true;
|
|
8671
|
+
}
|
|
8672
|
+
}, {
|
|
8673
|
+
key: "isReceivingTempDisabled",
|
|
8674
|
+
value: function isReceivingTempDisabled(_scenario) {
|
|
8675
|
+
return true;
|
|
8676
|
+
}
|
|
8612
8677
|
}, {
|
|
8613
8678
|
key: "transferLocalNonNativeAsset",
|
|
8614
8679
|
value: function transferLocalNonNativeAsset(options) {
|
|
@@ -10290,14 +10355,13 @@ var SystemPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
10290
10355
|
}(BaseAssetsPallet);
|
|
10291
10356
|
|
|
10292
10357
|
var resolveId = function resolveId(asset, chain) {
|
|
10293
|
-
|
|
10294
|
-
if (isBifrost) {
|
|
10358
|
+
if (chain === 'BifrostPolkadot' || chain === 'BifrostKusama' || chain === 'BifrostPaseo') {
|
|
10295
10359
|
var _asset$assetId;
|
|
10296
10360
|
var isEthAsset = assets.isForeignAsset(asset) && ((_asset$assetId = asset.assetId) === null || _asset$assetId === void 0 ? void 0 : _asset$assetId.startsWith('0x'));
|
|
10297
10361
|
var resolvedAsset = isEthAsset && asset.location ? assets.findAssetInfoOrThrow(chain, {
|
|
10298
10362
|
location: asset.location
|
|
10299
10363
|
}, null) : asset;
|
|
10300
|
-
return getChain(
|
|
10364
|
+
return getChain(chain).getCurrencySelection(resolvedAsset);
|
|
10301
10365
|
} else {
|
|
10302
10366
|
assertHasId(asset);
|
|
10303
10367
|
return asset.assetId;
|
|
@@ -10827,6 +10891,7 @@ var getOriginXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10827
10891
|
}
|
|
10828
10892
|
return _context.a(2, {
|
|
10829
10893
|
dryRunError: dryRunResult.failureReason,
|
|
10894
|
+
dryRunSubError: dryRunResult.failureSubReason,
|
|
10830
10895
|
currency: dryRunResult.currency,
|
|
10831
10896
|
asset: dryRunResult.asset
|
|
10832
10897
|
});
|
|
@@ -10842,6 +10907,7 @@ var getOriginXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10842
10907
|
asset: dryRunResult.asset,
|
|
10843
10908
|
feeType: 'paymentInfo',
|
|
10844
10909
|
dryRunError: dryRunResult.failureReason,
|
|
10910
|
+
dryRunSubError: dryRunResult.failureSubReason,
|
|
10845
10911
|
sufficient: false
|
|
10846
10912
|
});
|
|
10847
10913
|
case 8:
|
|
@@ -10955,19 +11021,23 @@ var getFailureInfo = function getFailureInfo(chains, hops) {
|
|
|
10955
11021
|
// Check standard chains first for backwards compatibility
|
|
10956
11022
|
if ((_chains$origin = chains.origin) !== null && _chains$origin !== void 0 && _chains$origin.dryRunError) return {
|
|
10957
11023
|
failureChain: 'origin',
|
|
10958
|
-
failureReason: chains.origin.dryRunError
|
|
11024
|
+
failureReason: chains.origin.dryRunError,
|
|
11025
|
+
failureSubReason: chains.origin.dryRunSubError
|
|
10959
11026
|
};
|
|
10960
11027
|
if ((_chains$assetHub = chains.assetHub) !== null && _chains$assetHub !== void 0 && _chains$assetHub.dryRunError) return {
|
|
10961
11028
|
failureChain: 'assetHub',
|
|
10962
|
-
failureReason: chains.assetHub.dryRunError
|
|
11029
|
+
failureReason: chains.assetHub.dryRunError,
|
|
11030
|
+
failureSubReason: chains.assetHub.dryRunSubError
|
|
10963
11031
|
};
|
|
10964
11032
|
if ((_chains$bridgeHub = chains.bridgeHub) !== null && _chains$bridgeHub !== void 0 && _chains$bridgeHub.dryRunError) return {
|
|
10965
11033
|
failureChain: 'bridgeHub',
|
|
10966
|
-
failureReason: chains.bridgeHub.dryRunError
|
|
11034
|
+
failureReason: chains.bridgeHub.dryRunError,
|
|
11035
|
+
failureSubReason: chains.bridgeHub.dryRunSubError
|
|
10967
11036
|
};
|
|
10968
11037
|
if ((_chains$destination = chains.destination) !== null && _chains$destination !== void 0 && _chains$destination.dryRunError) return {
|
|
10969
11038
|
failureChain: 'destination',
|
|
10970
|
-
failureReason: chains.destination.dryRunError
|
|
11039
|
+
failureReason: chains.destination.dryRunError,
|
|
11040
|
+
failureSubReason: chains.destination.dryRunSubError
|
|
10971
11041
|
};
|
|
10972
11042
|
// Check hops for failures
|
|
10973
11043
|
var _iterator = _createForOfIteratorHelper(hops),
|
|
@@ -10978,7 +11048,8 @@ var getFailureInfo = function getFailureInfo(chains, hops) {
|
|
|
10978
11048
|
if (hop.result.dryRunError) {
|
|
10979
11049
|
return {
|
|
10980
11050
|
failureChain: hop.chain,
|
|
10981
|
-
failureReason: hop.result.dryRunError
|
|
11051
|
+
failureReason: hop.result.dryRunError,
|
|
11052
|
+
failureSubReason: hop.result.dryRunSubError
|
|
10982
11053
|
};
|
|
10983
11054
|
}
|
|
10984
11055
|
}
|
|
@@ -10991,7 +11062,7 @@ var getFailureInfo = function getFailureInfo(chains, hops) {
|
|
|
10991
11062
|
};
|
|
10992
11063
|
var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
10993
11064
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
|
10994
|
-
var api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, swapConfig, useRootOrigin, asset, amount, _yield$getOriginXcmFe, originFeeRaw, originCurrency, originAsset, originFeeType, originDryRunError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, isMythosToEthereum, originFee, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, processHop, traversalResult, destFee, destCurrency, destAsset, destFeeType, destDryRunError, destSufficient, destResult, _destApi, destFallback, assetHubChain, processedBridgeHub, bridgeHubChain, bridgeHubHopIndex, convertToFeeDetail, result, _getFailureInfo2, failureChain, failureReason, _t, _t2, _t3, _t4;
|
|
11065
|
+
var api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, swapConfig, useRootOrigin, asset, amount, _yield$getOriginXcmFe, originFeeRaw, originCurrency, originAsset, originFeeType, originDryRunError, originDryRunSubError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, isMythosToEthereum, originFee, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, processHop, traversalResult, destFee, destCurrency, destAsset, destFeeType, destDryRunError, destDryRunSubError, destSufficient, destResult, _destApi, destFallback, assetHubChain, processedBridgeHub, bridgeHubChain, bridgeHubHopIndex, convertToFeeDetail, result, _getFailureInfo2, failureChain, failureReason, _t, _t2, _t3, _t4;
|
|
10995
11066
|
return _regenerator().w(function (_context2) {
|
|
10996
11067
|
while (1) switch (_context2.p = _context2.n) {
|
|
10997
11068
|
case 0:
|
|
@@ -11017,6 +11088,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11017
11088
|
originAsset = _yield$getOriginXcmFe.asset;
|
|
11018
11089
|
originFeeType = _yield$getOriginXcmFe.feeType;
|
|
11019
11090
|
originDryRunError = _yield$getOriginXcmFe.dryRunError;
|
|
11091
|
+
originDryRunSubError = _yield$getOriginXcmFe.dryRunSubError;
|
|
11020
11092
|
initialForwardedXcm = _yield$getOriginXcmFe.forwardedXcms;
|
|
11021
11093
|
initialDestParaId = _yield$getOriginXcmFe.destParaId;
|
|
11022
11094
|
originWeight = _yield$getOriginXcmFe.weight;
|
|
@@ -11070,7 +11142,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11070
11142
|
case 7:
|
|
11071
11143
|
destFeeRes = _context2.v;
|
|
11072
11144
|
_result = {
|
|
11073
|
-
origin: _objectSpread2(_objectSpread2(_objectSpread2({}, originFee && {
|
|
11145
|
+
origin: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, originFee && {
|
|
11074
11146
|
fee: originFee
|
|
11075
11147
|
}), originFeeType && {
|
|
11076
11148
|
feeType: originFeeType
|
|
@@ -11080,6 +11152,8 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11080
11152
|
asset: originAsset
|
|
11081
11153
|
}, originDryRunError && {
|
|
11082
11154
|
dryRunError: originDryRunError
|
|
11155
|
+
}), originDryRunSubError && {
|
|
11156
|
+
dryRunSubError: originDryRunSubError
|
|
11083
11157
|
}),
|
|
11084
11158
|
destination: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, destFeeRes.fee ? {
|
|
11085
11159
|
fee: destFeeRes.fee
|
|
@@ -11193,6 +11267,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11193
11267
|
destFee = destResult.fee;
|
|
11194
11268
|
destFeeType = destResult.feeType;
|
|
11195
11269
|
destDryRunError = destResult.dryRunError;
|
|
11270
|
+
destDryRunSubError = destResult.dryRunSubError;
|
|
11196
11271
|
destSufficient = destResult.sufficient;
|
|
11197
11272
|
destCurrency = destResult.currency;
|
|
11198
11273
|
destAsset = destResult.asset;
|
|
@@ -11271,7 +11346,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11271
11346
|
}
|
|
11272
11347
|
}
|
|
11273
11348
|
convertToFeeDetail = function convertToFeeDetail(result) {
|
|
11274
|
-
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, result.fee !== undefined && {
|
|
11349
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, result.fee !== undefined && {
|
|
11275
11350
|
fee: result.fee
|
|
11276
11351
|
}), result.feeType && {
|
|
11277
11352
|
feeType: result.feeType
|
|
@@ -11282,10 +11357,12 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11282
11357
|
asset: result.asset
|
|
11283
11358
|
}, result.dryRunError && {
|
|
11284
11359
|
dryRunError: result.dryRunError
|
|
11360
|
+
}), result.dryRunSubError && {
|
|
11361
|
+
dryRunSubError: result.dryRunSubError
|
|
11285
11362
|
});
|
|
11286
11363
|
};
|
|
11287
11364
|
result = _objectSpread2(_objectSpread2(_objectSpread2({
|
|
11288
|
-
origin: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, originWeight && {
|
|
11365
|
+
origin: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, originWeight && {
|
|
11289
11366
|
weight: originWeight
|
|
11290
11367
|
}), originFee && {
|
|
11291
11368
|
fee: originFee
|
|
@@ -11298,13 +11375,15 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11298
11375
|
asset: originAsset
|
|
11299
11376
|
}, originDryRunError && {
|
|
11300
11377
|
dryRunError: originDryRunError
|
|
11378
|
+
}), originDryRunSubError && {
|
|
11379
|
+
dryRunSubError: originDryRunSubError
|
|
11301
11380
|
})
|
|
11302
11381
|
}, traversalResult.assetHub && {
|
|
11303
11382
|
assetHub: convertToFeeDetail(traversalResult.assetHub)
|
|
11304
11383
|
}), processedBridgeHub && {
|
|
11305
11384
|
bridgeHub: convertToFeeDetail(processedBridgeHub)
|
|
11306
11385
|
}), {}, {
|
|
11307
|
-
destination: _objectSpread2(_objectSpread2(_objectSpread2({}, destFee !== undefined && {
|
|
11386
|
+
destination: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, destFee !== undefined && {
|
|
11308
11387
|
fee: destFee
|
|
11309
11388
|
}), destFeeType && {
|
|
11310
11389
|
feeType: destFeeType
|
|
@@ -11314,6 +11393,8 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11314
11393
|
asset: destAsset
|
|
11315
11394
|
}, destDryRunError && {
|
|
11316
11395
|
dryRunError: destDryRunError
|
|
11396
|
+
}), destDryRunSubError && {
|
|
11397
|
+
dryRunSubError: destDryRunSubError
|
|
11317
11398
|
}),
|
|
11318
11399
|
hops: traversalResult.hops.map(function (hop) {
|
|
11319
11400
|
return {
|
package/dist/index.d.ts
CHANGED
|
@@ -626,6 +626,7 @@ type TDryRunChainSuccess = TDryRunResBase & {
|
|
|
626
626
|
type TDryRunChainFailure = TDryRunResBase & {
|
|
627
627
|
success: false;
|
|
628
628
|
failureReason: string;
|
|
629
|
+
failureSubReason?: string;
|
|
629
630
|
};
|
|
630
631
|
type TDryRunChainResult = TDryRunChainSuccess | TDryRunChainFailure;
|
|
631
632
|
type THopInfo = {
|
|
@@ -635,6 +636,7 @@ type THopInfo = {
|
|
|
635
636
|
type TDryRunChain = 'origin' | 'destination' | 'assetHub' | 'bridgeHub' | TChain;
|
|
636
637
|
type TDryRunResult = {
|
|
637
638
|
failureReason?: string;
|
|
639
|
+
failureSubReason?: string;
|
|
638
640
|
failureChain?: TDryRunChain;
|
|
639
641
|
origin: TDryRunChainResult;
|
|
640
642
|
destination?: TDryRunChainResult;
|
|
@@ -746,10 +748,57 @@ declare enum PolkadotXcmError {
|
|
|
746
748
|
AliasNotFound = "AliasNotFound",
|
|
747
749
|
LocalExecutionIncompleteWithError = "LocalExecutionIncompleteWithError"
|
|
748
750
|
}
|
|
751
|
+
declare enum PolkadotXcmExecutionError {
|
|
752
|
+
Overflow = "Overflow",
|
|
753
|
+
Unimplemented = "Unimplemented",
|
|
754
|
+
UntrustedReserveLocation = "UntrustedReserveLocation",
|
|
755
|
+
UntrustedTeleportLocation = "UntrustedTeleportLocation",
|
|
756
|
+
LocationFull = "LocationFull",
|
|
757
|
+
LocationNotInvertible = "LocationNotInvertible",
|
|
758
|
+
BadOrigin = "BadOrigin",
|
|
759
|
+
InvalidLocation = "InvalidLocation",
|
|
760
|
+
AssetNotFound = "AssetNotFound",
|
|
761
|
+
FailedToTransactAsset = "FailedToTransactAsset",
|
|
762
|
+
NotWithdrawable = "NotWithdrawable",
|
|
763
|
+
LocationCannotHold = "LocationCannotHold",
|
|
764
|
+
ExceedsMaxMessageSize = "ExceedsMaxMessageSize",
|
|
765
|
+
DestinationUnsupported = "DestinationUnsupported",
|
|
766
|
+
Transport = "Transport",
|
|
767
|
+
Unroutable = "Unroutable",
|
|
768
|
+
UnknownClaim = "UnknownClaim",
|
|
769
|
+
FailedToDecode = "FailedToDecode",
|
|
770
|
+
MaxWeightInvalid = "MaxWeightInvalid",
|
|
771
|
+
NotHoldingFees = "NotHoldingFees",
|
|
772
|
+
TooExpensive = "TooExpensive",
|
|
773
|
+
Trap = "Trap",
|
|
774
|
+
ExpectationFalse = "ExpectationFalse",
|
|
775
|
+
PalletNotFound = "PalletNotFound",
|
|
776
|
+
NameMismatch = "NameMismatch",
|
|
777
|
+
VersionIncompatible = "VersionIncompatible",
|
|
778
|
+
HoldingWouldOverflow = "HoldingWouldOverflow",
|
|
779
|
+
ExportError = "ExportError",
|
|
780
|
+
ReanchorFailed = "ReanchorFailed",
|
|
781
|
+
NoDeal = "NoDeal",
|
|
782
|
+
FeesNotMet = "FeesNotMet",
|
|
783
|
+
LockError = "LockError",
|
|
784
|
+
NoPermission = "NoPermission",
|
|
785
|
+
Unanchored = "Unanchored",
|
|
786
|
+
NotDepositable = "NotDepositable",
|
|
787
|
+
TooManyAssets = "TooManyAssets",
|
|
788
|
+
UnhandledXcmVersion = "UnhandledXcmVersion",
|
|
789
|
+
WeightLimitReached = "WeightLimitReached",
|
|
790
|
+
Barrier = "Barrier",
|
|
791
|
+
WeightNotComputable = "WeightNotComputable",
|
|
792
|
+
ExceedsStackLimit = "ExceedsStackLimit"
|
|
793
|
+
}
|
|
749
794
|
type TModuleError = {
|
|
750
795
|
index: string;
|
|
751
796
|
error: string;
|
|
752
797
|
};
|
|
798
|
+
type TDryRunError = {
|
|
799
|
+
failureReason: string;
|
|
800
|
+
failureSubReason?: string;
|
|
801
|
+
};
|
|
753
802
|
|
|
754
803
|
type TXcmFeeSwapConfig = TSwapConfig & {
|
|
755
804
|
amountOut: bigint;
|
|
@@ -835,12 +884,14 @@ type TXcmFeeDetailSuccess = TXcmFeeBase$1 & {
|
|
|
835
884
|
fee: bigint;
|
|
836
885
|
feeType: TFeeType;
|
|
837
886
|
dryRunError?: string;
|
|
887
|
+
dryRunSubError?: string;
|
|
838
888
|
};
|
|
839
889
|
type TXcmFeeDetailWithFallback = TXcmFeeDetailSuccess;
|
|
840
890
|
type TXcmFeeDetailError = TXcmFeeBase$1 & {
|
|
841
891
|
fee?: bigint;
|
|
842
892
|
feeType?: TFeeType;
|
|
843
893
|
dryRunError: string;
|
|
894
|
+
dryRunSubError?: string;
|
|
844
895
|
};
|
|
845
896
|
type TXcmFeeDetail = TXcmFeeDetailSuccess | TXcmFeeDetailError;
|
|
846
897
|
type TXcmFeeHopResult = {
|
|
@@ -848,6 +899,7 @@ type TXcmFeeHopResult = {
|
|
|
848
899
|
feeType?: TFeeType;
|
|
849
900
|
sufficient?: boolean;
|
|
850
901
|
dryRunError?: string;
|
|
902
|
+
dryRunSubError?: string;
|
|
851
903
|
forwardedXcms?: any;
|
|
852
904
|
destParaId?: number;
|
|
853
905
|
/** @deprecated Use `asset` property instead. */
|
|
@@ -1617,12 +1669,6 @@ declare class Basilisk<TApi, TRes> extends Parachain<TApi, TRes> implements IXTo
|
|
|
1617
1669
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1618
1670
|
}
|
|
1619
1671
|
|
|
1620
|
-
declare class BifrostKusama<TApi, TRes> extends Parachain<TApi, TRes> implements IXTokensTransfer {
|
|
1621
|
-
constructor();
|
|
1622
|
-
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1623
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
1672
|
declare class BifrostPolkadot<TApi, TRes> extends Parachain<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
1627
1673
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1628
1674
|
getCurrencySelection(asset: TAssetInfo): {
|
|
@@ -1674,6 +1720,10 @@ declare class BifrostPolkadot<TApi, TRes> extends Parachain<TApi, TRes> implemen
|
|
|
1674
1720
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1675
1721
|
}
|
|
1676
1722
|
|
|
1723
|
+
declare class BifrostKusama<TApi, TRes> extends BifrostPolkadot<TApi, TRes> {
|
|
1724
|
+
constructor();
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1677
1727
|
declare class BifrostPaseo<TApi, TRes> extends BifrostPolkadot<TApi, TRes> {
|
|
1678
1728
|
constructor();
|
|
1679
1729
|
}
|
|
@@ -1815,6 +1865,8 @@ declare class IntegriteePolkadot<TApi, TRes> extends Parachain<TApi, TRes> imple
|
|
|
1815
1865
|
constructor(chain?: TParachain, info?: string, type?: TRelaychain, version?: Version);
|
|
1816
1866
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1817
1867
|
transferRelayToPara(): Promise<TSerializedApiCall>;
|
|
1868
|
+
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1869
|
+
isReceivingTempDisabled(_scenario: TScenario): boolean;
|
|
1818
1870
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1819
1871
|
}
|
|
1820
1872
|
|
|
@@ -2140,7 +2192,7 @@ declare const dryRunInternal: <TApi, TRes>(options: TDryRunOptions<TApi, TRes>)
|
|
|
2140
2192
|
|
|
2141
2193
|
declare const dryRunOrigin: <TApi, TRes>(options: TDryRunCallOptions<TApi, TRes>) => Promise<TDryRunChainResult>;
|
|
2142
2194
|
|
|
2143
|
-
declare const getFailureInfo: (result: TDryRunResult) => Pick<TDryRunResult, "failureReason" | "failureChain">;
|
|
2195
|
+
declare const getFailureInfo: (result: TDryRunResult) => Pick<TDryRunResult, "failureReason" | "failureSubReason" | "failureChain">;
|
|
2144
2196
|
|
|
2145
2197
|
declare const traverseXcmHops: <TApi, TRes, THopResult>(config: HopTraversalConfig<TApi, TRes, THopResult>) => Promise<HopTraversalResult<THopResult>>;
|
|
2146
2198
|
declare const addEthereumBridgeFees: <TApi, TRes, TResult extends {
|
|
@@ -2240,7 +2292,7 @@ declare const computeFeeFromDryRun: (dryRun: any, chain: TSubstrateChain, execut
|
|
|
2240
2292
|
|
|
2241
2293
|
declare const computeFeeFromDryRunPjs: (dryRun: any, chain: TSubstrateChain, executionFee: bigint) => bigint;
|
|
2242
2294
|
|
|
2243
|
-
declare const resolveModuleError: (chain: TSubstrateChain, error: TModuleError) =>
|
|
2295
|
+
declare const resolveModuleError: (chain: TSubstrateChain, error: TModuleError) => TDryRunError;
|
|
2244
2296
|
|
|
2245
2297
|
declare const padFee: (raw: bigint, origin: TSubstrateChain, dest: TChain, side: "origin" | "destination") => bigint;
|
|
2246
2298
|
declare const padValueBy: (amount: bigint, percent: number) => bigint;
|
|
@@ -2314,5 +2366,5 @@ declare const formatUnits: typeof formatUnits$1;
|
|
|
2314
2366
|
|
|
2315
2367
|
declare const validateAddress: (address: TAddress, chain: TChain, isDestination?: boolean) => void;
|
|
2316
2368
|
|
|
2317
|
-
export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
|
2318
|
-
export type { BuildHopInfoOptions, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, TBifrostToken, TBridgeStatus, TBuildDestInfoOptions, TBuildInternalRes, TBuilderConfig, TBuilderOptions, TBypassOptions, TChainConfig, TChainConfigMap, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignByAssetOptions, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapConfig, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|
|
2369
|
+
export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, PolkadotXcmExecutionError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
|
2370
|
+
export type { BuildHopInfoOptions, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, TBifrostToken, TBridgeStatus, TBuildDestInfoOptions, TBuildInternalRes, TBuilderConfig, TBuilderOptions, TBypassOptions, TChainConfig, TChainConfigMap, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignByAssetOptions, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapConfig, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|
package/dist/index.mjs
CHANGED
|
@@ -1142,6 +1142,7 @@ var XTokensError;
|
|
|
1142
1142
|
XTokensError["MinXcmFeeNotDefined"] = "MinXcmFeeNotDefined";
|
|
1143
1143
|
XTokensError["RateLimited"] = "RateLimited";
|
|
1144
1144
|
})(XTokensError || (XTokensError = {}));
|
|
1145
|
+
// Mirrors https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/errors.rs
|
|
1145
1146
|
var PolkadotXcmError;
|
|
1146
1147
|
(function (PolkadotXcmError) {
|
|
1147
1148
|
PolkadotXcmError["Unreachable"] = "Unreachable";
|
|
@@ -1174,6 +1175,50 @@ var PolkadotXcmError;
|
|
|
1174
1175
|
PolkadotXcmError["AliasNotFound"] = "AliasNotFound";
|
|
1175
1176
|
PolkadotXcmError["LocalExecutionIncompleteWithError"] = "LocalExecutionIncompleteWithError";
|
|
1176
1177
|
})(PolkadotXcmError || (PolkadotXcmError = {}));
|
|
1178
|
+
var PolkadotXcmExecutionError;
|
|
1179
|
+
(function (PolkadotXcmExecutionError) {
|
|
1180
|
+
PolkadotXcmExecutionError["Overflow"] = "Overflow";
|
|
1181
|
+
PolkadotXcmExecutionError["Unimplemented"] = "Unimplemented";
|
|
1182
|
+
PolkadotXcmExecutionError["UntrustedReserveLocation"] = "UntrustedReserveLocation";
|
|
1183
|
+
PolkadotXcmExecutionError["UntrustedTeleportLocation"] = "UntrustedTeleportLocation";
|
|
1184
|
+
PolkadotXcmExecutionError["LocationFull"] = "LocationFull";
|
|
1185
|
+
PolkadotXcmExecutionError["LocationNotInvertible"] = "LocationNotInvertible";
|
|
1186
|
+
PolkadotXcmExecutionError["BadOrigin"] = "BadOrigin";
|
|
1187
|
+
PolkadotXcmExecutionError["InvalidLocation"] = "InvalidLocation";
|
|
1188
|
+
PolkadotXcmExecutionError["AssetNotFound"] = "AssetNotFound";
|
|
1189
|
+
PolkadotXcmExecutionError["FailedToTransactAsset"] = "FailedToTransactAsset";
|
|
1190
|
+
PolkadotXcmExecutionError["NotWithdrawable"] = "NotWithdrawable";
|
|
1191
|
+
PolkadotXcmExecutionError["LocationCannotHold"] = "LocationCannotHold";
|
|
1192
|
+
PolkadotXcmExecutionError["ExceedsMaxMessageSize"] = "ExceedsMaxMessageSize";
|
|
1193
|
+
PolkadotXcmExecutionError["DestinationUnsupported"] = "DestinationUnsupported";
|
|
1194
|
+
PolkadotXcmExecutionError["Transport"] = "Transport";
|
|
1195
|
+
PolkadotXcmExecutionError["Unroutable"] = "Unroutable";
|
|
1196
|
+
PolkadotXcmExecutionError["UnknownClaim"] = "UnknownClaim";
|
|
1197
|
+
PolkadotXcmExecutionError["FailedToDecode"] = "FailedToDecode";
|
|
1198
|
+
PolkadotXcmExecutionError["MaxWeightInvalid"] = "MaxWeightInvalid";
|
|
1199
|
+
PolkadotXcmExecutionError["NotHoldingFees"] = "NotHoldingFees";
|
|
1200
|
+
PolkadotXcmExecutionError["TooExpensive"] = "TooExpensive";
|
|
1201
|
+
PolkadotXcmExecutionError["Trap"] = "Trap";
|
|
1202
|
+
PolkadotXcmExecutionError["ExpectationFalse"] = "ExpectationFalse";
|
|
1203
|
+
PolkadotXcmExecutionError["PalletNotFound"] = "PalletNotFound";
|
|
1204
|
+
PolkadotXcmExecutionError["NameMismatch"] = "NameMismatch";
|
|
1205
|
+
PolkadotXcmExecutionError["VersionIncompatible"] = "VersionIncompatible";
|
|
1206
|
+
PolkadotXcmExecutionError["HoldingWouldOverflow"] = "HoldingWouldOverflow";
|
|
1207
|
+
PolkadotXcmExecutionError["ExportError"] = "ExportError";
|
|
1208
|
+
PolkadotXcmExecutionError["ReanchorFailed"] = "ReanchorFailed";
|
|
1209
|
+
PolkadotXcmExecutionError["NoDeal"] = "NoDeal";
|
|
1210
|
+
PolkadotXcmExecutionError["FeesNotMet"] = "FeesNotMet";
|
|
1211
|
+
PolkadotXcmExecutionError["LockError"] = "LockError";
|
|
1212
|
+
PolkadotXcmExecutionError["NoPermission"] = "NoPermission";
|
|
1213
|
+
PolkadotXcmExecutionError["Unanchored"] = "Unanchored";
|
|
1214
|
+
PolkadotXcmExecutionError["NotDepositable"] = "NotDepositable";
|
|
1215
|
+
PolkadotXcmExecutionError["TooManyAssets"] = "TooManyAssets";
|
|
1216
|
+
PolkadotXcmExecutionError["UnhandledXcmVersion"] = "UnhandledXcmVersion";
|
|
1217
|
+
PolkadotXcmExecutionError["WeightLimitReached"] = "WeightLimitReached";
|
|
1218
|
+
PolkadotXcmExecutionError["Barrier"] = "Barrier";
|
|
1219
|
+
PolkadotXcmExecutionError["WeightNotComputable"] = "WeightNotComputable";
|
|
1220
|
+
PolkadotXcmExecutionError["ExceedsStackLimit"] = "ExceedsStackLimit";
|
|
1221
|
+
})(PolkadotXcmExecutionError || (PolkadotXcmExecutionError = {}));
|
|
1177
1222
|
|
|
1178
1223
|
var resolveModuleError = function resolveModuleError(chain, error) {
|
|
1179
1224
|
var palletDetails = getSupportedPalletsDetails(chain).find(function (p) {
|
|
@@ -1183,6 +1228,7 @@ var resolveModuleError = function resolveModuleError(chain, error) {
|
|
|
1183
1228
|
throw new InvalidParameterError("Pallet with index ".concat(error.index, " not found"));
|
|
1184
1229
|
}
|
|
1185
1230
|
// Use only the first byte of the error to get the error index
|
|
1231
|
+
// Including 0x prefix
|
|
1186
1232
|
var errorIndex = Number(error.error.slice(0, 4));
|
|
1187
1233
|
var name = palletDetails.name;
|
|
1188
1234
|
if (name !== 'XTokens' && name !== 'PolkadotXcm' && name !== 'XcmPallet') {
|
|
@@ -1192,7 +1238,20 @@ var resolveModuleError = function resolveModuleError(chain, error) {
|
|
|
1192
1238
|
if (!failureReason) {
|
|
1193
1239
|
throw new InvalidParameterError("Error index ".concat(errorIndex, " not found in ").concat(name, " pallet"));
|
|
1194
1240
|
}
|
|
1195
|
-
|
|
1241
|
+
if (failureReason === PolkadotXcmError.LocalExecutionIncompleteWithError) {
|
|
1242
|
+
var subErrorIndex = Number("0x".concat(error.error.slice(6, 8)));
|
|
1243
|
+
var failureSubReason = Object.values(PolkadotXcmExecutionError)[subErrorIndex];
|
|
1244
|
+
if (!failureSubReason) {
|
|
1245
|
+
throw new InvalidParameterError("Sub-error index ".concat(subErrorIndex, " not found in PolkadotXcm pallet"));
|
|
1246
|
+
}
|
|
1247
|
+
return {
|
|
1248
|
+
failureReason: failureReason,
|
|
1249
|
+
failureSubReason: failureSubReason
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
return {
|
|
1253
|
+
failureReason: failureReason
|
|
1254
|
+
};
|
|
1196
1255
|
};
|
|
1197
1256
|
|
|
1198
1257
|
var isAssetHub = function isAssetHub(chain) {
|
|
@@ -1229,7 +1288,8 @@ var padFee = function padFee(raw, origin, dest, side) {
|
|
|
1229
1288
|
return mul(raw, 130n, 100n);
|
|
1230
1289
|
};
|
|
1231
1290
|
var padValueBy = function padValueBy(amount, percent) {
|
|
1232
|
-
|
|
1291
|
+
var scaled = BigInt(Math.round(percent * 100)); // 2 decimal precision
|
|
1292
|
+
return amount * (BigInt(10000) + scaled) / BigInt(10000);
|
|
1233
1293
|
};
|
|
1234
1294
|
|
|
1235
1295
|
var resolveScenario = function resolveScenario(origin, destination) {
|
|
@@ -4409,7 +4469,8 @@ var getDestXcmFee = /*#__PURE__*/function () {
|
|
|
4409
4469
|
break;
|
|
4410
4470
|
}
|
|
4411
4471
|
return _context3.a(2, {
|
|
4412
|
-
dryRunError: dryRunResult.failureReason
|
|
4472
|
+
dryRunError: dryRunResult.failureReason,
|
|
4473
|
+
dryRunSubError: dryRunResult.failureSubReason
|
|
4413
4474
|
});
|
|
4414
4475
|
case 5:
|
|
4415
4476
|
_context3.n = 6;
|
|
@@ -4420,6 +4481,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
|
|
|
4420
4481
|
fee: _fee2,
|
|
4421
4482
|
feeType: 'paymentInfo',
|
|
4422
4483
|
dryRunError: dryRunResult.failureReason,
|
|
4484
|
+
dryRunSubError: dryRunResult.failureSubReason,
|
|
4423
4485
|
sufficient: false,
|
|
4424
4486
|
asset: asset,
|
|
4425
4487
|
currency: asset.symbol
|
|
@@ -4674,7 +4736,8 @@ var getFailureInfo$1 = function getFailureInfo(result) {
|
|
|
4674
4736
|
if (chainResult && chainResult.success === false && chainResult.failureReason) {
|
|
4675
4737
|
return {
|
|
4676
4738
|
failureChain: chain,
|
|
4677
|
-
failureReason: chainResult.failureReason
|
|
4739
|
+
failureReason: chainResult.failureReason,
|
|
4740
|
+
failureSubReason: chainResult.failureSubReason
|
|
4678
4741
|
};
|
|
4679
4742
|
}
|
|
4680
4743
|
}
|
|
@@ -4685,7 +4748,8 @@ var getFailureInfo$1 = function getFailureInfo(result) {
|
|
|
4685
4748
|
}
|
|
4686
4749
|
return {
|
|
4687
4750
|
failureChain: result.failureChain,
|
|
4688
|
-
failureReason: result.failureReason
|
|
4751
|
+
failureReason: result.failureReason,
|
|
4752
|
+
failureSubReason: result.failureSubReason
|
|
4689
4753
|
};
|
|
4690
4754
|
};
|
|
4691
4755
|
|
|
@@ -5446,6 +5510,7 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
5446
5510
|
}
|
|
5447
5511
|
return _context2.a(2, {
|
|
5448
5512
|
failureReason: originDryRun.failureReason,
|
|
5513
|
+
failureSubReason: originDryRun.failureSubReason,
|
|
5449
5514
|
failureChain: 'origin',
|
|
5450
5515
|
origin: originDryRun,
|
|
5451
5516
|
hops: []
|
|
@@ -7701,25 +7766,6 @@ var Basilisk = /*#__PURE__*/function (_Parachain) {
|
|
|
7701
7766
|
}]);
|
|
7702
7767
|
}(Parachain);
|
|
7703
7768
|
|
|
7704
|
-
var BifrostKusama = /*#__PURE__*/function (_Parachain) {
|
|
7705
|
-
function BifrostKusama() {
|
|
7706
|
-
_classCallCheck(this, BifrostKusama);
|
|
7707
|
-
return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'Kusama', Version.V5]);
|
|
7708
|
-
}
|
|
7709
|
-
_inherits(BifrostKusama, _Parachain);
|
|
7710
|
-
return _createClass(BifrostKusama, [{
|
|
7711
|
-
key: "transferXTokens",
|
|
7712
|
-
value: function transferXTokens(input) {
|
|
7713
|
-
return getChain('BifrostPolkadot').transferXTokens(input);
|
|
7714
|
-
}
|
|
7715
|
-
}, {
|
|
7716
|
-
key: "transferLocalNonNativeAsset",
|
|
7717
|
-
value: function transferLocalNonNativeAsset(options) {
|
|
7718
|
-
return getChain('BifrostPolkadot').transferLocalNonNativeAsset(options);
|
|
7719
|
-
}
|
|
7720
|
-
}]);
|
|
7721
|
-
}(Parachain);
|
|
7722
|
-
|
|
7723
7769
|
var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
7724
7770
|
function BifrostPolkadot() {
|
|
7725
7771
|
var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'BifrostPolkadot';
|
|
@@ -7741,7 +7787,7 @@ var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
7741
7787
|
}
|
|
7742
7788
|
var isVToken = asset.symbol && asset.symbol.startsWith('v');
|
|
7743
7789
|
var isVSToken = asset.symbol && asset.symbol.startsWith('vs');
|
|
7744
|
-
if (!isForeignAsset(asset)) {
|
|
7790
|
+
if (!isForeignAsset(asset) || isForeignAsset(asset) && !asset.assetId) {
|
|
7745
7791
|
return isVToken ? {
|
|
7746
7792
|
VToken: asset.symbol.substring(1)
|
|
7747
7793
|
} : {
|
|
@@ -7821,6 +7867,15 @@ var BifrostPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
7821
7867
|
}]);
|
|
7822
7868
|
}(Parachain);
|
|
7823
7869
|
|
|
7870
|
+
var BifrostKusama = /*#__PURE__*/function (_BifrostPolkadot) {
|
|
7871
|
+
function BifrostKusama() {
|
|
7872
|
+
_classCallCheck(this, BifrostKusama);
|
|
7873
|
+
return _callSuper(this, BifrostKusama, ['BifrostKusama', 'bifrost', 'Kusama', Version.V5]);
|
|
7874
|
+
}
|
|
7875
|
+
_inherits(BifrostKusama, _BifrostPolkadot);
|
|
7876
|
+
return _createClass(BifrostKusama);
|
|
7877
|
+
}(BifrostPolkadot);
|
|
7878
|
+
|
|
7824
7879
|
var BifrostPaseo = /*#__PURE__*/function (_BifrostPolkadot) {
|
|
7825
7880
|
function BifrostPaseo() {
|
|
7826
7881
|
_classCallCheck(this, BifrostPaseo);
|
|
@@ -8610,6 +8665,16 @@ var IntegriteePolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
8610
8665
|
value: function transferRelayToPara() {
|
|
8611
8666
|
throw new ChainNotSupportedError();
|
|
8612
8667
|
}
|
|
8668
|
+
}, {
|
|
8669
|
+
key: "isSendingTempDisabled",
|
|
8670
|
+
value: function isSendingTempDisabled(_options) {
|
|
8671
|
+
return true;
|
|
8672
|
+
}
|
|
8673
|
+
}, {
|
|
8674
|
+
key: "isReceivingTempDisabled",
|
|
8675
|
+
value: function isReceivingTempDisabled(_scenario) {
|
|
8676
|
+
return true;
|
|
8677
|
+
}
|
|
8613
8678
|
}, {
|
|
8614
8679
|
key: "transferLocalNonNativeAsset",
|
|
8615
8680
|
value: function transferLocalNonNativeAsset(options) {
|
|
@@ -10291,14 +10356,13 @@ var SystemPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
10291
10356
|
}(BaseAssetsPallet);
|
|
10292
10357
|
|
|
10293
10358
|
var resolveId = function resolveId(asset, chain) {
|
|
10294
|
-
|
|
10295
|
-
if (isBifrost) {
|
|
10359
|
+
if (chain === 'BifrostPolkadot' || chain === 'BifrostKusama' || chain === 'BifrostPaseo') {
|
|
10296
10360
|
var _asset$assetId;
|
|
10297
10361
|
var isEthAsset = isForeignAsset(asset) && ((_asset$assetId = asset.assetId) === null || _asset$assetId === void 0 ? void 0 : _asset$assetId.startsWith('0x'));
|
|
10298
10362
|
var resolvedAsset = isEthAsset && asset.location ? findAssetInfoOrThrow(chain, {
|
|
10299
10363
|
location: asset.location
|
|
10300
10364
|
}, null) : asset;
|
|
10301
|
-
return getChain(
|
|
10365
|
+
return getChain(chain).getCurrencySelection(resolvedAsset);
|
|
10302
10366
|
} else {
|
|
10303
10367
|
assertHasId(asset);
|
|
10304
10368
|
return asset.assetId;
|
|
@@ -10828,6 +10892,7 @@ var getOriginXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10828
10892
|
}
|
|
10829
10893
|
return _context.a(2, {
|
|
10830
10894
|
dryRunError: dryRunResult.failureReason,
|
|
10895
|
+
dryRunSubError: dryRunResult.failureSubReason,
|
|
10831
10896
|
currency: dryRunResult.currency,
|
|
10832
10897
|
asset: dryRunResult.asset
|
|
10833
10898
|
});
|
|
@@ -10843,6 +10908,7 @@ var getOriginXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10843
10908
|
asset: dryRunResult.asset,
|
|
10844
10909
|
feeType: 'paymentInfo',
|
|
10845
10910
|
dryRunError: dryRunResult.failureReason,
|
|
10911
|
+
dryRunSubError: dryRunResult.failureSubReason,
|
|
10846
10912
|
sufficient: false
|
|
10847
10913
|
});
|
|
10848
10914
|
case 8:
|
|
@@ -10956,19 +11022,23 @@ var getFailureInfo = function getFailureInfo(chains, hops) {
|
|
|
10956
11022
|
// Check standard chains first for backwards compatibility
|
|
10957
11023
|
if ((_chains$origin = chains.origin) !== null && _chains$origin !== void 0 && _chains$origin.dryRunError) return {
|
|
10958
11024
|
failureChain: 'origin',
|
|
10959
|
-
failureReason: chains.origin.dryRunError
|
|
11025
|
+
failureReason: chains.origin.dryRunError,
|
|
11026
|
+
failureSubReason: chains.origin.dryRunSubError
|
|
10960
11027
|
};
|
|
10961
11028
|
if ((_chains$assetHub = chains.assetHub) !== null && _chains$assetHub !== void 0 && _chains$assetHub.dryRunError) return {
|
|
10962
11029
|
failureChain: 'assetHub',
|
|
10963
|
-
failureReason: chains.assetHub.dryRunError
|
|
11030
|
+
failureReason: chains.assetHub.dryRunError,
|
|
11031
|
+
failureSubReason: chains.assetHub.dryRunSubError
|
|
10964
11032
|
};
|
|
10965
11033
|
if ((_chains$bridgeHub = chains.bridgeHub) !== null && _chains$bridgeHub !== void 0 && _chains$bridgeHub.dryRunError) return {
|
|
10966
11034
|
failureChain: 'bridgeHub',
|
|
10967
|
-
failureReason: chains.bridgeHub.dryRunError
|
|
11035
|
+
failureReason: chains.bridgeHub.dryRunError,
|
|
11036
|
+
failureSubReason: chains.bridgeHub.dryRunSubError
|
|
10968
11037
|
};
|
|
10969
11038
|
if ((_chains$destination = chains.destination) !== null && _chains$destination !== void 0 && _chains$destination.dryRunError) return {
|
|
10970
11039
|
failureChain: 'destination',
|
|
10971
|
-
failureReason: chains.destination.dryRunError
|
|
11040
|
+
failureReason: chains.destination.dryRunError,
|
|
11041
|
+
failureSubReason: chains.destination.dryRunSubError
|
|
10972
11042
|
};
|
|
10973
11043
|
// Check hops for failures
|
|
10974
11044
|
var _iterator = _createForOfIteratorHelper(hops),
|
|
@@ -10979,7 +11049,8 @@ var getFailureInfo = function getFailureInfo(chains, hops) {
|
|
|
10979
11049
|
if (hop.result.dryRunError) {
|
|
10980
11050
|
return {
|
|
10981
11051
|
failureChain: hop.chain,
|
|
10982
|
-
failureReason: hop.result.dryRunError
|
|
11052
|
+
failureReason: hop.result.dryRunError,
|
|
11053
|
+
failureSubReason: hop.result.dryRunSubError
|
|
10983
11054
|
};
|
|
10984
11055
|
}
|
|
10985
11056
|
}
|
|
@@ -10992,7 +11063,7 @@ var getFailureInfo = function getFailureInfo(chains, hops) {
|
|
|
10992
11063
|
};
|
|
10993
11064
|
var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
10994
11065
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
|
10995
|
-
var api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, swapConfig, useRootOrigin, asset, amount, _yield$getOriginXcmFe, originFeeRaw, originCurrency, originAsset, originFeeType, originDryRunError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, isMythosToEthereum, originFee, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, processHop, traversalResult, destFee, destCurrency, destAsset, destFeeType, destDryRunError, destSufficient, destResult, _destApi, destFallback, assetHubChain, processedBridgeHub, bridgeHubChain, bridgeHubHopIndex, convertToFeeDetail, result, _getFailureInfo2, failureChain, failureReason, _t, _t2, _t3, _t4;
|
|
11066
|
+
var api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, swapConfig, useRootOrigin, asset, amount, _yield$getOriginXcmFe, originFeeRaw, originCurrency, originAsset, originFeeType, originDryRunError, originDryRunSubError, initialForwardedXcm, initialDestParaId, originWeight, sufficientOriginFee, isMythosToEthereum, originFee, destApi, destFeeRes, _result, _getFailureInfo, _failureChain, _failureReason, processHop, traversalResult, destFee, destCurrency, destAsset, destFeeType, destDryRunError, destDryRunSubError, destSufficient, destResult, _destApi, destFallback, assetHubChain, processedBridgeHub, bridgeHubChain, bridgeHubHopIndex, convertToFeeDetail, result, _getFailureInfo2, failureChain, failureReason, _t, _t2, _t3, _t4;
|
|
10996
11067
|
return _regenerator().w(function (_context2) {
|
|
10997
11068
|
while (1) switch (_context2.p = _context2.n) {
|
|
10998
11069
|
case 0:
|
|
@@ -11018,6 +11089,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11018
11089
|
originAsset = _yield$getOriginXcmFe.asset;
|
|
11019
11090
|
originFeeType = _yield$getOriginXcmFe.feeType;
|
|
11020
11091
|
originDryRunError = _yield$getOriginXcmFe.dryRunError;
|
|
11092
|
+
originDryRunSubError = _yield$getOriginXcmFe.dryRunSubError;
|
|
11021
11093
|
initialForwardedXcm = _yield$getOriginXcmFe.forwardedXcms;
|
|
11022
11094
|
initialDestParaId = _yield$getOriginXcmFe.destParaId;
|
|
11023
11095
|
originWeight = _yield$getOriginXcmFe.weight;
|
|
@@ -11071,7 +11143,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11071
11143
|
case 7:
|
|
11072
11144
|
destFeeRes = _context2.v;
|
|
11073
11145
|
_result = {
|
|
11074
|
-
origin: _objectSpread2(_objectSpread2(_objectSpread2({}, originFee && {
|
|
11146
|
+
origin: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, originFee && {
|
|
11075
11147
|
fee: originFee
|
|
11076
11148
|
}), originFeeType && {
|
|
11077
11149
|
feeType: originFeeType
|
|
@@ -11081,6 +11153,8 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11081
11153
|
asset: originAsset
|
|
11082
11154
|
}, originDryRunError && {
|
|
11083
11155
|
dryRunError: originDryRunError
|
|
11156
|
+
}), originDryRunSubError && {
|
|
11157
|
+
dryRunSubError: originDryRunSubError
|
|
11084
11158
|
}),
|
|
11085
11159
|
destination: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, destFeeRes.fee ? {
|
|
11086
11160
|
fee: destFeeRes.fee
|
|
@@ -11194,6 +11268,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11194
11268
|
destFee = destResult.fee;
|
|
11195
11269
|
destFeeType = destResult.feeType;
|
|
11196
11270
|
destDryRunError = destResult.dryRunError;
|
|
11271
|
+
destDryRunSubError = destResult.dryRunSubError;
|
|
11197
11272
|
destSufficient = destResult.sufficient;
|
|
11198
11273
|
destCurrency = destResult.currency;
|
|
11199
11274
|
destAsset = destResult.asset;
|
|
@@ -11272,7 +11347,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11272
11347
|
}
|
|
11273
11348
|
}
|
|
11274
11349
|
convertToFeeDetail = function convertToFeeDetail(result) {
|
|
11275
|
-
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, result.fee !== undefined && {
|
|
11350
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, result.fee !== undefined && {
|
|
11276
11351
|
fee: result.fee
|
|
11277
11352
|
}), result.feeType && {
|
|
11278
11353
|
feeType: result.feeType
|
|
@@ -11283,10 +11358,12 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11283
11358
|
asset: result.asset
|
|
11284
11359
|
}, result.dryRunError && {
|
|
11285
11360
|
dryRunError: result.dryRunError
|
|
11361
|
+
}), result.dryRunSubError && {
|
|
11362
|
+
dryRunSubError: result.dryRunSubError
|
|
11286
11363
|
});
|
|
11287
11364
|
};
|
|
11288
11365
|
result = _objectSpread2(_objectSpread2(_objectSpread2({
|
|
11289
|
-
origin: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, originWeight && {
|
|
11366
|
+
origin: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, originWeight && {
|
|
11290
11367
|
weight: originWeight
|
|
11291
11368
|
}), originFee && {
|
|
11292
11369
|
fee: originFee
|
|
@@ -11299,13 +11376,15 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11299
11376
|
asset: originAsset
|
|
11300
11377
|
}, originDryRunError && {
|
|
11301
11378
|
dryRunError: originDryRunError
|
|
11379
|
+
}), originDryRunSubError && {
|
|
11380
|
+
dryRunSubError: originDryRunSubError
|
|
11302
11381
|
})
|
|
11303
11382
|
}, traversalResult.assetHub && {
|
|
11304
11383
|
assetHub: convertToFeeDetail(traversalResult.assetHub)
|
|
11305
11384
|
}), processedBridgeHub && {
|
|
11306
11385
|
bridgeHub: convertToFeeDetail(processedBridgeHub)
|
|
11307
11386
|
}), {}, {
|
|
11308
|
-
destination: _objectSpread2(_objectSpread2(_objectSpread2({}, destFee !== undefined && {
|
|
11387
|
+
destination: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, destFee !== undefined && {
|
|
11309
11388
|
fee: destFee
|
|
11310
11389
|
}), destFeeType && {
|
|
11311
11390
|
feeType: destFeeType
|
|
@@ -11315,6 +11394,8 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
11315
11394
|
asset: destAsset
|
|
11316
11395
|
}, destDryRunError && {
|
|
11317
11396
|
dryRunError: destDryRunError
|
|
11397
|
+
}), destDryRunSubError && {
|
|
11398
|
+
dryRunSubError: destDryRunSubError
|
|
11318
11399
|
}),
|
|
11319
11400
|
hops: traversalResult.hops.map(function (hop) {
|
|
11320
11401
|
return {
|
|
@@ -13941,4 +14022,4 @@ var Builder = function Builder(api) {
|
|
|
13941
14022
|
return new GeneralBuilder(api, new BatchTransactionManager());
|
|
13942
14023
|
};
|
|
13943
14024
|
|
|
13944
|
-
export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo$1 as getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
|
14025
|
+
export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, PolkadotXcmExecutionError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo$1 as getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.14.0",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@noble/hashes": "^1.8.0",
|
|
27
27
|
"@scure/base": "^2.0.0",
|
|
28
28
|
"viem": "^2.38.5",
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/
|
|
31
|
-
"@paraspell/pallets": "11.
|
|
29
|
+
"@paraspell/sdk-common": "11.14.0",
|
|
30
|
+
"@paraspell/assets": "11.14.0",
|
|
31
|
+
"@paraspell/pallets": "11.14.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|