@paraspell/sdk-core 8.16.0 → 9.1.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 +51 -44
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +51 -45
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1070,14 +1070,14 @@ var Centrifuge$1 = {
|
|
|
1070
1070
|
info: "centrifuge",
|
|
1071
1071
|
paraId: 2031,
|
|
1072
1072
|
providers: [
|
|
1073
|
-
{
|
|
1074
|
-
name: "Centrifuge",
|
|
1075
|
-
endpoint: "wss://fullnode.centrifuge.io"
|
|
1076
|
-
},
|
|
1077
1073
|
{
|
|
1078
1074
|
name: "LuckyFriday",
|
|
1079
1075
|
endpoint: "wss://rpc-centrifuge.luckyfriday.io"
|
|
1080
1076
|
},
|
|
1077
|
+
{
|
|
1078
|
+
name: "Centrifuge",
|
|
1079
|
+
endpoint: "wss://fullnode.centrifuge.io"
|
|
1080
|
+
},
|
|
1081
1081
|
{
|
|
1082
1082
|
name: "OnFinality",
|
|
1083
1083
|
endpoint: "wss://centrifuge-parachain.api.onfinality.io/public-ws"
|
|
@@ -2477,6 +2477,28 @@ var createBeneficiaryMultiLocation = function createBeneficiaryMultiLocation(_re
|
|
|
2477
2477
|
}
|
|
2478
2478
|
};
|
|
2479
2479
|
|
|
2480
|
+
var reverseTransformMultiLocation = function reverseTransformMultiLocation(multiLocation) {
|
|
2481
|
+
var parachainJunction = {
|
|
2482
|
+
Parachain: 1000
|
|
2483
|
+
};
|
|
2484
|
+
var alreadyHasP1000 = multiLocation.interior !== 'Here' && Object.values(multiLocation.interior).flat().some(function (j) {
|
|
2485
|
+
return _typeof(j) === 'object' && j !== null && 'Parachain' in j && j.Parachain === 1000;
|
|
2486
|
+
});
|
|
2487
|
+
if (alreadyHasP1000) {
|
|
2488
|
+
return _objectSpread2(_objectSpread2({}, multiLocation), {}, {
|
|
2489
|
+
parents: sdkCommon.Parents.ONE
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
var existingJunctions = multiLocation.interior === 'Here' ? [] // no other junctions
|
|
2493
|
+
: Object.values(multiLocation.interior).flat();
|
|
2494
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2495
|
+
var allJunctions = [parachainJunction].concat(_toConsumableArray(existingJunctions));
|
|
2496
|
+
return _objectSpread2(_objectSpread2({}, multiLocation), {}, {
|
|
2497
|
+
parents: sdkCommon.Parents.ONE,
|
|
2498
|
+
interior: _defineProperty({}, "X".concat(allJunctions.length), allJunctions)
|
|
2499
|
+
});
|
|
2500
|
+
};
|
|
2501
|
+
|
|
2480
2502
|
/**
|
|
2481
2503
|
* This function transforms a multiLocation by removing the `Parachain` junction
|
|
2482
2504
|
* if it exists and setting the `parents` to `0`.
|
|
@@ -3081,42 +3103,26 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
3081
3103
|
});
|
|
3082
3104
|
case 9:
|
|
3083
3105
|
initialForwardedXcms = originDryRun.forwardedXcms, initialDestParaId = originDryRun.destParaId;
|
|
3084
|
-
/* SPECIAL‑CASE: AssetHubKusama -> Kusama relay‑chain should bypass
|
|
3085
|
-
* forwarded XCM inspection - because of Rust panic */
|
|
3086
|
-
if (!(origin === 'AssetHubKusama' && destination === 'Kusama')) {
|
|
3087
|
-
_context.next = 12;
|
|
3088
|
-
break;
|
|
3089
|
-
}
|
|
3090
|
-
return _context.abrupt("return", {
|
|
3091
|
-
origin: originDryRun.success ? _objectSpread2(_objectSpread2({}, originDryRun), {}, {
|
|
3092
|
-
currency: assets.getNativeAssetSymbol(origin)
|
|
3093
|
-
}) : originDryRun,
|
|
3094
|
-
destination: {
|
|
3095
|
-
success: false,
|
|
3096
|
-
failureReason: 'Unknown error occurred. Please open an issue on GitHub.'
|
|
3097
|
-
}
|
|
3098
|
-
});
|
|
3099
|
-
case 12:
|
|
3100
3106
|
currentOrigin = origin;
|
|
3101
3107
|
forwardedXcms = initialForwardedXcms;
|
|
3102
3108
|
nextParaId = initialDestParaId;
|
|
3103
3109
|
intermediateFees = {};
|
|
3104
|
-
case
|
|
3110
|
+
case 14:
|
|
3105
3111
|
if (!(Array.isArray(forwardedXcms) && forwardedXcms.length && forwardedXcms[1].length && ('disconnect' in api.getApi() ? Object.values(forwardedXcms[1][0]).length : forwardedXcms[1][0].value.length) > 0 && nextParaId !== undefined)) {
|
|
3106
|
-
_context.next =
|
|
3112
|
+
_context.next = 41;
|
|
3107
3113
|
break;
|
|
3108
3114
|
}
|
|
3109
3115
|
nextChain = getTNode(nextParaId, determineRelayChain(origin) === 'Polkadot' ? 'polkadot' : 'kusama');
|
|
3110
3116
|
if (nextChain) {
|
|
3111
|
-
_context.next =
|
|
3117
|
+
_context.next = 18;
|
|
3112
3118
|
break;
|
|
3113
3119
|
}
|
|
3114
3120
|
throw new Error("Unable to find TNode for paraId ".concat(nextParaId));
|
|
3115
|
-
case
|
|
3121
|
+
case 18:
|
|
3116
3122
|
hopApi = api.clone();
|
|
3117
|
-
_context.prev =
|
|
3123
|
+
_context.prev = 19;
|
|
3118
3124
|
if (assets.hasDryRunSupport(nextChain)) {
|
|
3119
|
-
_context.next =
|
|
3125
|
+
_context.next = 23;
|
|
3120
3126
|
break;
|
|
3121
3127
|
}
|
|
3122
3128
|
if (nextChain === destination) {
|
|
@@ -3125,19 +3131,19 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
3125
3131
|
failureReason: "DryRunApi is not available on node ".concat(nextChain)
|
|
3126
3132
|
};
|
|
3127
3133
|
}
|
|
3128
|
-
return _context.abrupt("break",
|
|
3134
|
+
return _context.abrupt("break", 41);
|
|
3135
|
+
case 23:
|
|
3136
|
+
_context.next = 25;
|
|
3137
|
+
return hopApi.init(nextChain, DRY_RUN_CLIENT_TIMEOUT_MS);
|
|
3129
3138
|
case 25:
|
|
3130
3139
|
_context.next = 27;
|
|
3131
|
-
return hopApi.init(nextChain, DRY_RUN_CLIENT_TIMEOUT_MS);
|
|
3132
|
-
case 27:
|
|
3133
|
-
_context.next = 29;
|
|
3134
3140
|
return hopApi.getDryRunXcm({
|
|
3135
3141
|
originLocation: addXcmVersionHeader(createOriginLocation(currentOrigin, nextChain), exports.Version.V4),
|
|
3136
3142
|
xcm: forwardedXcms[1][0],
|
|
3137
3143
|
node: nextChain,
|
|
3138
3144
|
origin: currentOrigin
|
|
3139
3145
|
});
|
|
3140
|
-
case
|
|
3146
|
+
case 27:
|
|
3141
3147
|
hopDryRun = _context.sent;
|
|
3142
3148
|
if (nextChain === destination || sdkCommon.isRelayChain(nextChain) && !sdkCommon.isRelayChain(destination)) {
|
|
3143
3149
|
destinationDryRun = hopDryRun;
|
|
@@ -3147,25 +3153,25 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
3147
3153
|
intermediateFees.bridgeHub = hopDryRun;
|
|
3148
3154
|
}
|
|
3149
3155
|
if (hopDryRun.success) {
|
|
3150
|
-
_context.next =
|
|
3156
|
+
_context.next = 31;
|
|
3151
3157
|
break;
|
|
3152
3158
|
}
|
|
3153
|
-
return _context.abrupt("break",
|
|
3154
|
-
case
|
|
3159
|
+
return _context.abrupt("break", 41);
|
|
3160
|
+
case 31:
|
|
3155
3161
|
newXcms = hopDryRun.forwardedXcms, destParaId = hopDryRun.destParaId;
|
|
3156
3162
|
forwardedXcms = newXcms;
|
|
3157
3163
|
nextParaId = destParaId;
|
|
3158
3164
|
currentOrigin = nextChain;
|
|
3159
|
-
case
|
|
3160
|
-
_context.prev =
|
|
3161
|
-
_context.next =
|
|
3165
|
+
case 35:
|
|
3166
|
+
_context.prev = 35;
|
|
3167
|
+
_context.next = 38;
|
|
3162
3168
|
return hopApi.disconnect();
|
|
3163
|
-
case
|
|
3164
|
-
return _context.finish(
|
|
3165
|
-
case
|
|
3166
|
-
_context.next =
|
|
3169
|
+
case 38:
|
|
3170
|
+
return _context.finish(35);
|
|
3171
|
+
case 39:
|
|
3172
|
+
_context.next = 14;
|
|
3167
3173
|
break;
|
|
3168
|
-
case
|
|
3174
|
+
case 41:
|
|
3169
3175
|
return _context.abrupt("return", {
|
|
3170
3176
|
origin: originDryRun.success ? _objectSpread2(_objectSpread2({}, originDryRun), {}, {
|
|
3171
3177
|
currency: assets.getNativeAssetSymbol(origin)
|
|
@@ -3180,11 +3186,11 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
3180
3186
|
currency: asset.symbol
|
|
3181
3187
|
}) : destinationDryRun
|
|
3182
3188
|
});
|
|
3183
|
-
case
|
|
3189
|
+
case 42:
|
|
3184
3190
|
case "end":
|
|
3185
3191
|
return _context.stop();
|
|
3186
3192
|
}
|
|
3187
|
-
}, _callee, null, [[
|
|
3193
|
+
}, _callee, null, [[19,, 35, 39]]);
|
|
3188
3194
|
}));
|
|
3189
3195
|
return function dryRunInternal(_x) {
|
|
3190
3196
|
return _ref.apply(this, arguments);
|
|
@@ -9723,6 +9729,7 @@ exports.isEthersContract = isEthersContract;
|
|
|
9723
9729
|
exports.isEthersSigner = isEthersSigner;
|
|
9724
9730
|
exports.resolveModuleError = resolveModuleError;
|
|
9725
9731
|
exports.resolveParaId = resolveParaId;
|
|
9732
|
+
exports.reverseTransformMultiLocation = reverseTransformMultiLocation;
|
|
9726
9733
|
exports.send = send;
|
|
9727
9734
|
exports.transferMoonbeamEvm = transferMoonbeamEvm;
|
|
9728
9735
|
exports.transferMoonbeamToEth = transferMoonbeamToEth;
|
package/dist/index.d.ts
CHANGED
|
@@ -1733,6 +1733,8 @@ declare const getNode: <TApi, TRes, T extends keyof ReturnType<typeof nodes>>(no
|
|
|
1733
1733
|
|
|
1734
1734
|
declare const createBeneficiaryMultiLocation: <TApi, TRes>({ api, scenario, pallet, recipientAddress, version, paraId }: TCreateBeneficiaryOptions<TApi, TRes>) => TMultiLocation;
|
|
1735
1735
|
|
|
1736
|
+
declare const reverseTransformMultiLocation: (multiLocation: TMultiLocation) => TMultiLocation;
|
|
1737
|
+
|
|
1736
1738
|
/**
|
|
1737
1739
|
* This function transforms a multiLocation by removing the `Parachain` junction
|
|
1738
1740
|
* if it exists and setting the `parents` to `0`.
|
|
@@ -1754,5 +1756,5 @@ declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, i
|
|
|
1754
1756
|
*/
|
|
1755
1757
|
declare const determineRelayChain: (node: TNodeWithRelayChains) => TRelaychain;
|
|
1756
1758
|
|
|
1757
|
-
export { AssetClaimBuilder, BatchMode, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidParameterError, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, Version, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, generateAddressMultiLocationV4, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getMaxForeignTransferableAmount, getMaxForeignTransferableAmountInternal, getMaxNativeTransferableAmount, getMaxNativeTransferableAmountInternal, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, isEthersContract, isEthersSigner, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
|
|
1759
|
+
export { AssetClaimBuilder, BatchMode, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidParameterError, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, Version, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, generateAddressMultiLocationV4, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getMaxForeignTransferableAmount, getMaxForeignTransferableAmountInternal, getMaxNativeTransferableAmount, getMaxNativeTransferableAmountInternal, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, isEthersContract, isEthersSigner, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
|
|
1758
1760
|
export type { IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimOptions, TAssetClaimOptionsBase, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TCreateBeneficiaryOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunNodeFailure, TDryRunNodeResult, TDryRunNodeResultInternal, TDryRunNodeSuccess, TDryRunOptions, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEdJsonMap, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmNodeFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestNodeBaseOptions, TGetFeeForDestNodeOptions, TGetFeeForOriginNodeBaseOptions, TGetFeeForOriginNodeOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodeConfig, TNodeConfigMap, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmSection, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TRelaychain, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TTransferInfo, TTransferLocalOptions, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TVersionClaimAssets, TWeight, TXTokensCurrencySelection, TXTokensSection, TXTokensTransferOptions, TXTransferSection, TXTransferTransferOptions, TXcmAsset, TXcmFeeDetail, TXcmForeignAsset, TXcmPalletSection, TXcmVersioned, TZeitgeistAsset, WithApi };
|
package/dist/index.mjs
CHANGED
|
@@ -1071,14 +1071,14 @@ var Centrifuge$1 = {
|
|
|
1071
1071
|
info: "centrifuge",
|
|
1072
1072
|
paraId: 2031,
|
|
1073
1073
|
providers: [
|
|
1074
|
-
{
|
|
1075
|
-
name: "Centrifuge",
|
|
1076
|
-
endpoint: "wss://fullnode.centrifuge.io"
|
|
1077
|
-
},
|
|
1078
1074
|
{
|
|
1079
1075
|
name: "LuckyFriday",
|
|
1080
1076
|
endpoint: "wss://rpc-centrifuge.luckyfriday.io"
|
|
1081
1077
|
},
|
|
1078
|
+
{
|
|
1079
|
+
name: "Centrifuge",
|
|
1080
|
+
endpoint: "wss://fullnode.centrifuge.io"
|
|
1081
|
+
},
|
|
1082
1082
|
{
|
|
1083
1083
|
name: "OnFinality",
|
|
1084
1084
|
endpoint: "wss://centrifuge-parachain.api.onfinality.io/public-ws"
|
|
@@ -2478,6 +2478,28 @@ var createBeneficiaryMultiLocation = function createBeneficiaryMultiLocation(_re
|
|
|
2478
2478
|
}
|
|
2479
2479
|
};
|
|
2480
2480
|
|
|
2481
|
+
var reverseTransformMultiLocation = function reverseTransformMultiLocation(multiLocation) {
|
|
2482
|
+
var parachainJunction = {
|
|
2483
|
+
Parachain: 1000
|
|
2484
|
+
};
|
|
2485
|
+
var alreadyHasP1000 = multiLocation.interior !== 'Here' && Object.values(multiLocation.interior).flat().some(function (j) {
|
|
2486
|
+
return _typeof(j) === 'object' && j !== null && 'Parachain' in j && j.Parachain === 1000;
|
|
2487
|
+
});
|
|
2488
|
+
if (alreadyHasP1000) {
|
|
2489
|
+
return _objectSpread2(_objectSpread2({}, multiLocation), {}, {
|
|
2490
|
+
parents: Parents.ONE
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
var existingJunctions = multiLocation.interior === 'Here' ? [] // no other junctions
|
|
2494
|
+
: Object.values(multiLocation.interior).flat();
|
|
2495
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2496
|
+
var allJunctions = [parachainJunction].concat(_toConsumableArray(existingJunctions));
|
|
2497
|
+
return _objectSpread2(_objectSpread2({}, multiLocation), {}, {
|
|
2498
|
+
parents: Parents.ONE,
|
|
2499
|
+
interior: _defineProperty({}, "X".concat(allJunctions.length), allJunctions)
|
|
2500
|
+
});
|
|
2501
|
+
};
|
|
2502
|
+
|
|
2481
2503
|
/**
|
|
2482
2504
|
* This function transforms a multiLocation by removing the `Parachain` junction
|
|
2483
2505
|
* if it exists and setting the `parents` to `0`.
|
|
@@ -3082,42 +3104,26 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
3082
3104
|
});
|
|
3083
3105
|
case 9:
|
|
3084
3106
|
initialForwardedXcms = originDryRun.forwardedXcms, initialDestParaId = originDryRun.destParaId;
|
|
3085
|
-
/* SPECIAL‑CASE: AssetHubKusama -> Kusama relay‑chain should bypass
|
|
3086
|
-
* forwarded XCM inspection - because of Rust panic */
|
|
3087
|
-
if (!(origin === 'AssetHubKusama' && destination === 'Kusama')) {
|
|
3088
|
-
_context.next = 12;
|
|
3089
|
-
break;
|
|
3090
|
-
}
|
|
3091
|
-
return _context.abrupt("return", {
|
|
3092
|
-
origin: originDryRun.success ? _objectSpread2(_objectSpread2({}, originDryRun), {}, {
|
|
3093
|
-
currency: getNativeAssetSymbol(origin)
|
|
3094
|
-
}) : originDryRun,
|
|
3095
|
-
destination: {
|
|
3096
|
-
success: false,
|
|
3097
|
-
failureReason: 'Unknown error occurred. Please open an issue on GitHub.'
|
|
3098
|
-
}
|
|
3099
|
-
});
|
|
3100
|
-
case 12:
|
|
3101
3107
|
currentOrigin = origin;
|
|
3102
3108
|
forwardedXcms = initialForwardedXcms;
|
|
3103
3109
|
nextParaId = initialDestParaId;
|
|
3104
3110
|
intermediateFees = {};
|
|
3105
|
-
case
|
|
3111
|
+
case 14:
|
|
3106
3112
|
if (!(Array.isArray(forwardedXcms) && forwardedXcms.length && forwardedXcms[1].length && ('disconnect' in api.getApi() ? Object.values(forwardedXcms[1][0]).length : forwardedXcms[1][0].value.length) > 0 && nextParaId !== undefined)) {
|
|
3107
|
-
_context.next =
|
|
3113
|
+
_context.next = 41;
|
|
3108
3114
|
break;
|
|
3109
3115
|
}
|
|
3110
3116
|
nextChain = getTNode(nextParaId, determineRelayChain(origin) === 'Polkadot' ? 'polkadot' : 'kusama');
|
|
3111
3117
|
if (nextChain) {
|
|
3112
|
-
_context.next =
|
|
3118
|
+
_context.next = 18;
|
|
3113
3119
|
break;
|
|
3114
3120
|
}
|
|
3115
3121
|
throw new Error("Unable to find TNode for paraId ".concat(nextParaId));
|
|
3116
|
-
case
|
|
3122
|
+
case 18:
|
|
3117
3123
|
hopApi = api.clone();
|
|
3118
|
-
_context.prev =
|
|
3124
|
+
_context.prev = 19;
|
|
3119
3125
|
if (hasDryRunSupport(nextChain)) {
|
|
3120
|
-
_context.next =
|
|
3126
|
+
_context.next = 23;
|
|
3121
3127
|
break;
|
|
3122
3128
|
}
|
|
3123
3129
|
if (nextChain === destination) {
|
|
@@ -3126,19 +3132,19 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
3126
3132
|
failureReason: "DryRunApi is not available on node ".concat(nextChain)
|
|
3127
3133
|
};
|
|
3128
3134
|
}
|
|
3129
|
-
return _context.abrupt("break",
|
|
3135
|
+
return _context.abrupt("break", 41);
|
|
3136
|
+
case 23:
|
|
3137
|
+
_context.next = 25;
|
|
3138
|
+
return hopApi.init(nextChain, DRY_RUN_CLIENT_TIMEOUT_MS);
|
|
3130
3139
|
case 25:
|
|
3131
3140
|
_context.next = 27;
|
|
3132
|
-
return hopApi.init(nextChain, DRY_RUN_CLIENT_TIMEOUT_MS);
|
|
3133
|
-
case 27:
|
|
3134
|
-
_context.next = 29;
|
|
3135
3141
|
return hopApi.getDryRunXcm({
|
|
3136
3142
|
originLocation: addXcmVersionHeader(createOriginLocation(currentOrigin, nextChain), Version.V4),
|
|
3137
3143
|
xcm: forwardedXcms[1][0],
|
|
3138
3144
|
node: nextChain,
|
|
3139
3145
|
origin: currentOrigin
|
|
3140
3146
|
});
|
|
3141
|
-
case
|
|
3147
|
+
case 27:
|
|
3142
3148
|
hopDryRun = _context.sent;
|
|
3143
3149
|
if (nextChain === destination || isRelayChain(nextChain) && !isRelayChain(destination)) {
|
|
3144
3150
|
destinationDryRun = hopDryRun;
|
|
@@ -3148,25 +3154,25 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
3148
3154
|
intermediateFees.bridgeHub = hopDryRun;
|
|
3149
3155
|
}
|
|
3150
3156
|
if (hopDryRun.success) {
|
|
3151
|
-
_context.next =
|
|
3157
|
+
_context.next = 31;
|
|
3152
3158
|
break;
|
|
3153
3159
|
}
|
|
3154
|
-
return _context.abrupt("break",
|
|
3155
|
-
case
|
|
3160
|
+
return _context.abrupt("break", 41);
|
|
3161
|
+
case 31:
|
|
3156
3162
|
newXcms = hopDryRun.forwardedXcms, destParaId = hopDryRun.destParaId;
|
|
3157
3163
|
forwardedXcms = newXcms;
|
|
3158
3164
|
nextParaId = destParaId;
|
|
3159
3165
|
currentOrigin = nextChain;
|
|
3160
|
-
case
|
|
3161
|
-
_context.prev =
|
|
3162
|
-
_context.next =
|
|
3166
|
+
case 35:
|
|
3167
|
+
_context.prev = 35;
|
|
3168
|
+
_context.next = 38;
|
|
3163
3169
|
return hopApi.disconnect();
|
|
3164
|
-
case
|
|
3165
|
-
return _context.finish(
|
|
3166
|
-
case
|
|
3167
|
-
_context.next =
|
|
3170
|
+
case 38:
|
|
3171
|
+
return _context.finish(35);
|
|
3172
|
+
case 39:
|
|
3173
|
+
_context.next = 14;
|
|
3168
3174
|
break;
|
|
3169
|
-
case
|
|
3175
|
+
case 41:
|
|
3170
3176
|
return _context.abrupt("return", {
|
|
3171
3177
|
origin: originDryRun.success ? _objectSpread2(_objectSpread2({}, originDryRun), {}, {
|
|
3172
3178
|
currency: getNativeAssetSymbol(origin)
|
|
@@ -3181,11 +3187,11 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
3181
3187
|
currency: asset.symbol
|
|
3182
3188
|
}) : destinationDryRun
|
|
3183
3189
|
});
|
|
3184
|
-
case
|
|
3190
|
+
case 42:
|
|
3185
3191
|
case "end":
|
|
3186
3192
|
return _context.stop();
|
|
3187
3193
|
}
|
|
3188
|
-
}, _callee, null, [[
|
|
3194
|
+
}, _callee, null, [[19,, 35, 39]]);
|
|
3189
3195
|
}));
|
|
3190
3196
|
return function dryRunInternal(_x) {
|
|
3191
3197
|
return _ref.apply(this, arguments);
|
|
@@ -9664,4 +9670,4 @@ var verifyEdOnDestination = /*#__PURE__*/function () {
|
|
|
9664
9670
|
};
|
|
9665
9671
|
}();
|
|
9666
9672
|
|
|
9667
|
-
export { AssetClaimBuilder, BatchMode, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidParameterError, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, Version, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, generateAddressMultiLocationV4, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getMaxForeignTransferableAmount, getMaxForeignTransferableAmountInternal, getMaxNativeTransferableAmount, getMaxNativeTransferableAmountInternal, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, isEthersContract, isEthersSigner, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
|
|
9673
|
+
export { AssetClaimBuilder, BatchMode, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidParameterError, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, Version, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, generateAddressMultiLocationV4, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getMaxForeignTransferableAmount, getMaxForeignTransferableAmountInternal, getMaxNativeTransferableAmount, getMaxNativeTransferableAmountInternal, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, isEthersContract, isEthersSigner, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@scure/base": "^1.2.5",
|
|
28
28
|
"ethers": "^6.13.7",
|
|
29
29
|
"viem": "^2.28.1",
|
|
30
|
-
"@paraspell/assets": "
|
|
31
|
-
"@paraspell/pallets": "
|
|
32
|
-
"@paraspell/sdk-common": "
|
|
30
|
+
"@paraspell/assets": "9.1.0",
|
|
31
|
+
"@paraspell/pallets": "9.1.0",
|
|
32
|
+
"@paraspell/sdk-common": "9.1.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|