@paraspell/sdk-core 10.10.5 → 10.10.7
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 +46 -30
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +46 -32
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -695,7 +695,7 @@ var DOT_MULTILOCATION = {
|
|
|
695
695
|
parents: sdkCommon.Parents.ONE,
|
|
696
696
|
interior: 'Here'
|
|
697
697
|
};
|
|
698
|
-
var CHAINS_DOT_RESERVE_AH = new Set(['Polimec', 'Moonbeam', 'BifrostPolkadot', 'PeoplePolkadot', 'Ajuna']);
|
|
698
|
+
var CHAINS_DOT_RESERVE_AH = new Set(['Polimec', 'Moonbeam', 'AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BifrostPolkadot', 'BifrostKusama', 'PeoplePolkadot', 'PeopleKusama', 'Ajuna']);
|
|
699
699
|
var ASSET_HUB_EXECUTION_FEE = 2200000000n; // 0.22 DOT
|
|
700
700
|
var TX_CLIENT_TIMEOUT_MS = 20 * 60 * 1000; // 20 minutes
|
|
701
701
|
var DRY_RUN_CLIENT_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
|
|
@@ -2826,14 +2826,17 @@ var createBeneficiaryLocation = function createBeneficiaryLocation(_ref2) {
|
|
|
2826
2826
|
};
|
|
2827
2827
|
};
|
|
2828
2828
|
|
|
2829
|
-
var getChainLocation = function getChainLocation(chain) {
|
|
2830
|
-
var
|
|
2829
|
+
var getChainLocation = function getChainLocation(chain, destChain) {
|
|
2830
|
+
var fromRelay = sdkCommon.isRelayChain(chain);
|
|
2831
|
+
var toRelay = sdkCommon.isRelayChain(destChain);
|
|
2832
|
+
var parents = fromRelay ? sdkCommon.Parents.ZERO : sdkCommon.Parents.ONE;
|
|
2833
|
+
var interior = toRelay ? 'Here' : {
|
|
2831
2834
|
X1: [{
|
|
2832
|
-
Parachain: getParaId(
|
|
2835
|
+
Parachain: getParaId(destChain)
|
|
2833
2836
|
}]
|
|
2834
2837
|
};
|
|
2835
2838
|
return {
|
|
2836
|
-
parents:
|
|
2839
|
+
parents: parents,
|
|
2837
2840
|
interior: interior
|
|
2838
2841
|
};
|
|
2839
2842
|
};
|
|
@@ -3106,15 +3109,15 @@ var getTNode = function getTNode(paraId, ecosystem) {
|
|
|
3106
3109
|
})) !== null && _NODE_NAMES_DOT_KSM$f !== void 0 ? _NODE_NAMES_DOT_KSM$f : null;
|
|
3107
3110
|
};
|
|
3108
3111
|
|
|
3109
|
-
var getAssetReserveChain = function getAssetReserveChain(
|
|
3112
|
+
var getAssetReserveChain = function getAssetReserveChain(chain, destChain, assetLocation) {
|
|
3110
3113
|
var hasGlobalConsensusJunction = sdkCommon.hasJunction(assetLocation, 'GlobalConsensus');
|
|
3111
3114
|
var paraId = sdkCommon.getJunctionValue(assetLocation, 'Parachain');
|
|
3112
3115
|
if (paraId) {
|
|
3113
|
-
var
|
|
3114
|
-
if (!
|
|
3116
|
+
var resolvedChain = getTNode(paraId, getRelayChainOf(chain).toLowerCase());
|
|
3117
|
+
if (!resolvedChain) {
|
|
3115
3118
|
throw new InvalidParameterError("Chain with paraId ".concat(paraId, " not found"));
|
|
3116
3119
|
}
|
|
3117
|
-
return
|
|
3120
|
+
return resolvedChain;
|
|
3118
3121
|
}
|
|
3119
3122
|
if (hasGlobalConsensusJunction) {
|
|
3120
3123
|
return 'AssetHubPolkadot';
|
|
@@ -3125,9 +3128,9 @@ var getAssetReserveChain = function getAssetReserveChain(origin, assetLocation)
|
|
|
3125
3128
|
Here: null
|
|
3126
3129
|
}
|
|
3127
3130
|
})) {
|
|
3128
|
-
return CHAINS_DOT_RESERVE_AH.has(
|
|
3131
|
+
return CHAINS_DOT_RESERVE_AH.has(destChain) ? 'AssetHubPolkadot' : 'Polkadot';
|
|
3129
3132
|
}
|
|
3130
|
-
return
|
|
3133
|
+
return chain;
|
|
3131
3134
|
};
|
|
3132
3135
|
|
|
3133
3136
|
var prepareExecuteContext = function prepareExecuteContext(_ref) {
|
|
@@ -3140,7 +3143,7 @@ var prepareExecuteContext = function prepareExecuteContext(_ref) {
|
|
|
3140
3143
|
assertHasLocation(asset);
|
|
3141
3144
|
if (feeAsset) assertHasLocation(feeAsset);
|
|
3142
3145
|
var amount = BigInt(asset.amount);
|
|
3143
|
-
var reserveChain = getAssetReserveChain(chain, asset.multiLocation);
|
|
3146
|
+
var reserveChain = getAssetReserveChain(chain, destChain, asset.multiLocation);
|
|
3144
3147
|
var multiAsset = createMultiAsset(version, amount, asset.multiLocation);
|
|
3145
3148
|
var multiAssetLocalized = createMultiAsset(version, amount, localizeLocation(chain, asset.multiLocation));
|
|
3146
3149
|
var multiAssetLocalizedToDest = createMultiAsset(version, amount, localizeLocation(destChain, asset.multiLocation));
|
|
@@ -3238,7 +3241,7 @@ var createBaseExecuteXcm = function createBaseExecuteXcm(options) {
|
|
|
3238
3241
|
mainInstructions = [{
|
|
3239
3242
|
InitiateTeleport: {
|
|
3240
3243
|
assets: createAssetsFilter(multiAssetLocalized),
|
|
3241
|
-
dest: getChainLocation(reserveChain),
|
|
3244
|
+
dest: getChainLocation(chain, reserveChain),
|
|
3242
3245
|
xcm: [{
|
|
3243
3246
|
BuyExecution: {
|
|
3244
3247
|
fees: updateAsset(multiAssetLocalizedToReserve, feeMultiAsset ? amount : amount - originFee),
|
|
@@ -3253,7 +3256,7 @@ var createBaseExecuteXcm = function createBaseExecuteXcm(options) {
|
|
|
3253
3256
|
mainInstructions = [{
|
|
3254
3257
|
InitiateReserveWithdraw: {
|
|
3255
3258
|
assets: createAssetsFilter(multiAssetLocalized),
|
|
3256
|
-
reserve: getChainLocation(reserveChain),
|
|
3259
|
+
reserve: getChainLocation(chain, reserveChain),
|
|
3257
3260
|
xcm: [{
|
|
3258
3261
|
BuyExecution: {
|
|
3259
3262
|
fees:
|
|
@@ -4899,7 +4902,7 @@ function _traverseXcmHops() {
|
|
|
4899
4902
|
_context2.n = 4;
|
|
4900
4903
|
return hopApi.init(nextChain, DRY_RUN_CLIENT_TIMEOUT_MS);
|
|
4901
4904
|
case 4:
|
|
4902
|
-
isDestination = nextChain === destination
|
|
4905
|
+
isDestination = nextChain === destination;
|
|
4903
4906
|
isAssetHub = nextChain === assetHubNode;
|
|
4904
4907
|
isBridgeHub = nextChain === bridgeHubNode;
|
|
4905
4908
|
_context2.n = 5;
|
|
@@ -7001,18 +7004,18 @@ var createExchangeInstructions = /*#__PURE__*/function () {
|
|
|
7001
7004
|
}();
|
|
7002
7005
|
var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
7003
7006
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
7004
|
-
var api, chain, exchangeChain, destChain, assetFrom, assetTo, _options$fees2, originReserveFee, exchangeFee, destReserveFee, recipientAddress, version, paraIdTo, multiAssetFrom, multiAssetTo, _prepareCommonExecute, prefix, depositInstruction, exchangeInstructions, exchangeToDestXcm, finalXcm, fullXcm;
|
|
7007
|
+
var api, chain, exchangeChain, destChain, assetFrom, assetTo, _options$fees2, originReserveFee, exchangeFee, destReserveFee, recipientAddress, version, paraIdTo, multiAssetFrom, amountOut, multiAssetTo, multiAssetToLocalizedToDest, _prepareCommonExecute, prefix, depositInstruction, exchangeInstructions, exchangeToDestXcm, finalXcm, fullXcm;
|
|
7005
7008
|
return _regenerator().w(function (_context2) {
|
|
7006
7009
|
while (1) switch (_context2.n) {
|
|
7007
7010
|
case 0:
|
|
7008
7011
|
api = options.api, chain = options.chain, exchangeChain = options.exchangeChain, destChain = options.destChain, assetFrom = options.assetFrom, assetTo = options.assetTo, _options$fees2 = options.fees, originReserveFee = _options$fees2.originReserveFee, exchangeFee = _options$fees2.exchangeFee, destReserveFee = _options$fees2.destReserveFee, recipientAddress = options.recipientAddress, version = options.version, paraIdTo = options.paraIdTo;
|
|
7009
7012
|
assertHasLocation(assetFrom);
|
|
7010
7013
|
assertHasLocation(assetTo);
|
|
7011
|
-
multiAssetFrom = createMultiAsset(version, BigInt(assetFrom.amount), localizeLocation(exchangeChain, assetFrom.multiLocation));
|
|
7012
|
-
multiAssetTo = createMultiAsset(version,
|
|
7013
|
-
// Exchange fee 0n means we are creating a dummy tx
|
|
7014
|
+
multiAssetFrom = createMultiAsset(version, BigInt(assetFrom.amount), localizeLocation(exchangeChain, assetFrom.multiLocation)); // Exchange fee 0n means we are creating a dummy tx
|
|
7014
7015
|
// Set want to 1000n to prevent NoDeal
|
|
7015
|
-
exchangeFee === 0n ? 1000n : BigInt(assetTo.amount)
|
|
7016
|
+
amountOut = chain && exchangeFee === 0n ? 1000n : BigInt(assetTo.amount);
|
|
7017
|
+
multiAssetTo = createMultiAsset(version, amountOut, localizeLocation(exchangeChain, assetTo.multiLocation));
|
|
7018
|
+
multiAssetToLocalizedToDest = createMultiAsset(version, amountOut, localizeLocation(destChain !== null && destChain !== void 0 ? destChain : exchangeChain, assetTo.multiLocation));
|
|
7016
7019
|
_prepareCommonExecute = prepareCommonExecuteXcm({
|
|
7017
7020
|
api: api,
|
|
7018
7021
|
chain: chain !== null && chain !== void 0 ? chain : exchangeChain,
|
|
@@ -7025,7 +7028,7 @@ var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
|
7025
7028
|
reserveFee: originReserveFee
|
|
7026
7029
|
},
|
|
7027
7030
|
version: version
|
|
7028
|
-
},
|
|
7031
|
+
}, multiAssetToLocalizedToDest), prefix = _prepareCommonExecute.prefix, depositInstruction = _prepareCommonExecute.depositInstruction;
|
|
7029
7032
|
_context2.n = 1;
|
|
7030
7033
|
return createExchangeInstructions(options, multiAssetFrom, multiAssetTo);
|
|
7031
7034
|
case 1:
|
|
@@ -7042,7 +7045,7 @@ var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
|
7042
7045
|
reserveFee: destReserveFee
|
|
7043
7046
|
},
|
|
7044
7047
|
suffixXcm: [depositInstruction]
|
|
7045
|
-
}) : [];
|
|
7048
|
+
}) : [depositInstruction];
|
|
7046
7049
|
finalXcm = chain ? createBaseExecuteXcm({
|
|
7047
7050
|
chain: chain,
|
|
7048
7051
|
destChain: exchangeChain,
|
|
@@ -7067,7 +7070,7 @@ var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
|
7067
7070
|
}();
|
|
7068
7071
|
|
|
7069
7072
|
var MIN_FEE = 1000n;
|
|
7070
|
-
var FEE_PADDING_PERCENTAGE =
|
|
7073
|
+
var FEE_PADDING_PERCENTAGE = 20;
|
|
7071
7074
|
var validateAmount = function validateAmount(amount, requiredFee) {
|
|
7072
7075
|
if (amount <= requiredFee) {
|
|
7073
7076
|
throw new InvalidParameterError("Asset amount is too low, please increase the amount or use a different fee asset.");
|
|
@@ -7183,8 +7186,8 @@ var extractFeesFromDryRun = function extractFeesFromDryRun(chain, dryRunResult,
|
|
|
7183
7186
|
return fees;
|
|
7184
7187
|
};
|
|
7185
7188
|
var createXcmAndCall = /*#__PURE__*/function () {
|
|
7186
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
7187
|
-
var xcm, api, chain, exchangeChain, weight, call;
|
|
7189
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options, dryRunWeight) {
|
|
7190
|
+
var xcm, api, chain, exchangeChain, hasApiSupport, weight, call, _t;
|
|
7188
7191
|
return _regenerator().w(function (_context2) {
|
|
7189
7192
|
while (1) switch (_context2.n) {
|
|
7190
7193
|
case 0:
|
|
@@ -7193,10 +7196,21 @@ var createXcmAndCall = /*#__PURE__*/function () {
|
|
|
7193
7196
|
case 1:
|
|
7194
7197
|
xcm = _context2.v;
|
|
7195
7198
|
api = options.api, chain = options.chain, exchangeChain = options.exchangeChain;
|
|
7199
|
+
hasApiSupport = assets.hasXcmPaymentApiSupport(chain !== null && chain !== void 0 ? chain : exchangeChain);
|
|
7200
|
+
if (!hasApiSupport) {
|
|
7201
|
+
_context2.n = 3;
|
|
7202
|
+
break;
|
|
7203
|
+
}
|
|
7196
7204
|
_context2.n = 2;
|
|
7197
7205
|
return api.getXcmWeight(xcm);
|
|
7198
7206
|
case 2:
|
|
7199
|
-
|
|
7207
|
+
_t = _context2.v;
|
|
7208
|
+
_context2.n = 4;
|
|
7209
|
+
break;
|
|
7210
|
+
case 3:
|
|
7211
|
+
_t = dryRunWeight !== null && dryRunWeight !== void 0 ? dryRunWeight : MAX_WEIGHT;
|
|
7212
|
+
case 4:
|
|
7213
|
+
weight = _t;
|
|
7200
7214
|
call = createExecuteCall(chain !== null && chain !== void 0 ? chain : exchangeChain, xcm, weight);
|
|
7201
7215
|
return _context2.a(2, {
|
|
7202
7216
|
xcm: xcm,
|
|
@@ -7206,7 +7220,7 @@ var createXcmAndCall = /*#__PURE__*/function () {
|
|
|
7206
7220
|
}
|
|
7207
7221
|
}, _callee2);
|
|
7208
7222
|
}));
|
|
7209
|
-
return function createXcmAndCall(_x2) {
|
|
7223
|
+
return function createXcmAndCall(_x2, _x3) {
|
|
7210
7224
|
return _ref2.apply(this, arguments);
|
|
7211
7225
|
};
|
|
7212
7226
|
}();
|
|
@@ -7315,7 +7329,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7315
7329
|
return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
|
|
7316
7330
|
assetTo: updatedAssetTo,
|
|
7317
7331
|
fees: extractedFees
|
|
7318
|
-
}));
|
|
7332
|
+
}), firstDryRunResult.origin.success ? firstDryRunResult.origin.weight : undefined);
|
|
7319
7333
|
case 9:
|
|
7320
7334
|
_yield$createXcmAndCa2 = _context3.v;
|
|
7321
7335
|
secondCall = _yield$createXcmAndCa2.call;
|
|
@@ -7353,7 +7367,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7353
7367
|
return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
|
|
7354
7368
|
assetTo: finalAssetTo,
|
|
7355
7369
|
fees: finalFees
|
|
7356
|
-
}));
|
|
7370
|
+
}), secondDryRunResult.origin.success ? secondDryRunResult.origin.weight : undefined);
|
|
7357
7371
|
case 12:
|
|
7358
7372
|
_yield$createXcmAndCa3 = _context3.v;
|
|
7359
7373
|
finalCall = _yield$createXcmAndCa3.call;
|
|
@@ -7363,7 +7377,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7363
7377
|
}
|
|
7364
7378
|
}, _callee3);
|
|
7365
7379
|
}));
|
|
7366
|
-
return function handleSwapExecuteTransfer(
|
|
7380
|
+
return function handleSwapExecuteTransfer(_x4) {
|
|
7367
7381
|
return _ref3.apply(this, arguments);
|
|
7368
7382
|
};
|
|
7369
7383
|
}();
|
|
@@ -12058,6 +12072,8 @@ exports.handleToAhTeleport = handleToAhTeleport;
|
|
|
12058
12072
|
exports.localizeLocation = localizeLocation;
|
|
12059
12073
|
exports.maybeOverrideMultiAsset = maybeOverrideMultiAsset;
|
|
12060
12074
|
exports.maybeOverrideMultiAssets = maybeOverrideMultiAssets;
|
|
12075
|
+
exports.padFee = padFee;
|
|
12076
|
+
exports.padFeeBy = padFeeBy;
|
|
12061
12077
|
exports.resolveModuleError = resolveModuleError;
|
|
12062
12078
|
exports.resolveParaId = resolveParaId;
|
|
12063
12079
|
exports.reverseTransformMultiLocation = reverseTransformMultiLocation;
|
package/dist/index.d.ts
CHANGED
|
@@ -1982,6 +1982,9 @@ declare const getXcmFee: <TApi, TRes, TDisableFallback extends boolean>({ api, t
|
|
|
1982
1982
|
|
|
1983
1983
|
declare const getXcmFeeEstimate: <TApi, TRes>(options: TGetXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateResult>;
|
|
1984
1984
|
|
|
1985
|
+
declare const padFee: (raw: bigint, origin: TNodeDotKsmWithRelayChains, dest: TNodeWithRelayChains, side: "origin" | "destination") => bigint;
|
|
1986
|
+
declare const padFeeBy: (amount: bigint, percent: number) => bigint;
|
|
1987
|
+
|
|
1985
1988
|
declare const getBridgeStatus: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>) => Promise<TBridgeStatus>;
|
|
1986
1989
|
|
|
1987
1990
|
declare const send: <TApi, TRes>(options: TSendOptions<TApi, TRes>) => Promise<TRes>;
|
|
@@ -2025,7 +2028,7 @@ declare const createBeneficiaryLocation: <TApi, TRes>({ api, address: recipientA
|
|
|
2025
2028
|
|
|
2026
2029
|
declare const createX1Payload: (version: Version, junction: TJunction) => TJunctions;
|
|
2027
2030
|
|
|
2028
|
-
declare const getChainLocation: (chain: TNodeWithRelayChains) => TMultiLocation;
|
|
2031
|
+
declare const getChainLocation: (chain: TNodeWithRelayChains, destChain: TNodeWithRelayChains) => TMultiLocation;
|
|
2029
2032
|
|
|
2030
2033
|
/**
|
|
2031
2034
|
* This function localizes a multiLocation by removing the `Parachain` junction
|
|
@@ -2077,5 +2080,5 @@ declare const handleToAhTeleport: <TApi, TRes>(origin: TNodePolkadotKusama, inpu
|
|
|
2077
2080
|
|
|
2078
2081
|
declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, isDestination?: boolean) => void;
|
|
2079
2082
|
|
|
2080
|
-
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, TransferToAhNotSupported, UnableToComputeError, XTokensError, addEthereumBridgeFees, addXcmVersionHeader, assertAddressIsString, assertHasLocation, assertToIsString, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createMultiAsset, createVersionedMultiAssets, createX1Payload, deriveAccountId, dryRun, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChainLocation, getChainVersion, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getRelayChainOf, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, localizeLocation, maybeOverrideMultiAsset, maybeOverrideMultiAssets, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, sortMultiAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination };
|
|
2083
|
+
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, TransferToAhNotSupported, UnableToComputeError, XTokensError, addEthereumBridgeFees, addXcmVersionHeader, assertAddressIsString, assertHasLocation, assertToIsString, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createMultiAsset, createVersionedMultiAssets, createX1Payload, deriveAccountId, dryRun, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChainLocation, getChainVersion, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getRelayChainOf, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, localizeLocation, maybeOverrideMultiAsset, maybeOverrideMultiAssets, padFee, padFeeBy, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, sortMultiAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination };
|
|
2081
2084
|
export type { HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimOptions, TAssetClaimOptionsBase, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunNodeFailure, TDryRunNodeResult, TDryRunNodeResultInternal, TDryRunNodeSuccess, TDryRunOptions, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEdJsonMap, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmNodeFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestNodeBaseOptions, TGetFeeForDestNodeOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodeConfig, TNodeConfigMap, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress, XcmFeeHopResult };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { blake2b } from '@noble/hashes/blake2';
|
|
2
|
-
import { isNodeEvm, getAssetsObject, InvalidCurrencyError, getNativeAssetSymbol, getOtherAssets, extractMultiAssetLoc, isAssetEqual, isForeignAsset, findAssetForNodeOrThrow, getExistentialDeposit, findAsset, isTMultiAsset, getExistentialDepositOrThrow, isSymbolMatch, hasDryRunSupport, isOverrideMultiLocationSpecifier, findAssetByMultiLocation, findAssetOnDestOrThrow, hasSupportForAsset, getRelayChainSymbol, isSymbolSpecifier, normalizeMultiLocation, normalizeSymbol, getAssetId, getNativeAssets } from '@paraspell/assets';
|
|
2
|
+
import { isNodeEvm, getAssetsObject, InvalidCurrencyError, getNativeAssetSymbol, getOtherAssets, extractMultiAssetLoc, isAssetEqual, isForeignAsset, findAssetForNodeOrThrow, getExistentialDeposit, findAsset, isTMultiAsset, getExistentialDepositOrThrow, isSymbolMatch, hasDryRunSupport, isOverrideMultiLocationSpecifier, findAssetByMultiLocation, findAssetOnDestOrThrow, hasSupportForAsset, getRelayChainSymbol, isSymbolSpecifier, normalizeMultiLocation, normalizeSymbol, hasXcmPaymentApiSupport, getAssetId, getNativeAssets } from '@paraspell/assets';
|
|
3
3
|
export * from '@paraspell/assets';
|
|
4
4
|
import { base58 } from '@scure/base';
|
|
5
5
|
import { isAddress, createPublicClient, http, getContract } from 'viem';
|
|
@@ -696,7 +696,7 @@ var DOT_MULTILOCATION = {
|
|
|
696
696
|
parents: Parents.ONE,
|
|
697
697
|
interior: 'Here'
|
|
698
698
|
};
|
|
699
|
-
var CHAINS_DOT_RESERVE_AH = new Set(['Polimec', 'Moonbeam', 'BifrostPolkadot', 'PeoplePolkadot', 'Ajuna']);
|
|
699
|
+
var CHAINS_DOT_RESERVE_AH = new Set(['Polimec', 'Moonbeam', 'AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BifrostPolkadot', 'BifrostKusama', 'PeoplePolkadot', 'PeopleKusama', 'Ajuna']);
|
|
700
700
|
var ASSET_HUB_EXECUTION_FEE = 2200000000n; // 0.22 DOT
|
|
701
701
|
var TX_CLIENT_TIMEOUT_MS = 20 * 60 * 1000; // 20 minutes
|
|
702
702
|
var DRY_RUN_CLIENT_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
|
|
@@ -2827,14 +2827,17 @@ var createBeneficiaryLocation = function createBeneficiaryLocation(_ref2) {
|
|
|
2827
2827
|
};
|
|
2828
2828
|
};
|
|
2829
2829
|
|
|
2830
|
-
var getChainLocation = function getChainLocation(chain) {
|
|
2831
|
-
var
|
|
2830
|
+
var getChainLocation = function getChainLocation(chain, destChain) {
|
|
2831
|
+
var fromRelay = isRelayChain(chain);
|
|
2832
|
+
var toRelay = isRelayChain(destChain);
|
|
2833
|
+
var parents = fromRelay ? Parents.ZERO : Parents.ONE;
|
|
2834
|
+
var interior = toRelay ? 'Here' : {
|
|
2832
2835
|
X1: [{
|
|
2833
|
-
Parachain: getParaId(
|
|
2836
|
+
Parachain: getParaId(destChain)
|
|
2834
2837
|
}]
|
|
2835
2838
|
};
|
|
2836
2839
|
return {
|
|
2837
|
-
parents:
|
|
2840
|
+
parents: parents,
|
|
2838
2841
|
interior: interior
|
|
2839
2842
|
};
|
|
2840
2843
|
};
|
|
@@ -3107,15 +3110,15 @@ var getTNode = function getTNode(paraId, ecosystem) {
|
|
|
3107
3110
|
})) !== null && _NODE_NAMES_DOT_KSM$f !== void 0 ? _NODE_NAMES_DOT_KSM$f : null;
|
|
3108
3111
|
};
|
|
3109
3112
|
|
|
3110
|
-
var getAssetReserveChain = function getAssetReserveChain(
|
|
3113
|
+
var getAssetReserveChain = function getAssetReserveChain(chain, destChain, assetLocation) {
|
|
3111
3114
|
var hasGlobalConsensusJunction = hasJunction(assetLocation, 'GlobalConsensus');
|
|
3112
3115
|
var paraId = getJunctionValue(assetLocation, 'Parachain');
|
|
3113
3116
|
if (paraId) {
|
|
3114
|
-
var
|
|
3115
|
-
if (!
|
|
3117
|
+
var resolvedChain = getTNode(paraId, getRelayChainOf(chain).toLowerCase());
|
|
3118
|
+
if (!resolvedChain) {
|
|
3116
3119
|
throw new InvalidParameterError("Chain with paraId ".concat(paraId, " not found"));
|
|
3117
3120
|
}
|
|
3118
|
-
return
|
|
3121
|
+
return resolvedChain;
|
|
3119
3122
|
}
|
|
3120
3123
|
if (hasGlobalConsensusJunction) {
|
|
3121
3124
|
return 'AssetHubPolkadot';
|
|
@@ -3126,9 +3129,9 @@ var getAssetReserveChain = function getAssetReserveChain(origin, assetLocation)
|
|
|
3126
3129
|
Here: null
|
|
3127
3130
|
}
|
|
3128
3131
|
})) {
|
|
3129
|
-
return CHAINS_DOT_RESERVE_AH.has(
|
|
3132
|
+
return CHAINS_DOT_RESERVE_AH.has(destChain) ? 'AssetHubPolkadot' : 'Polkadot';
|
|
3130
3133
|
}
|
|
3131
|
-
return
|
|
3134
|
+
return chain;
|
|
3132
3135
|
};
|
|
3133
3136
|
|
|
3134
3137
|
var prepareExecuteContext = function prepareExecuteContext(_ref) {
|
|
@@ -3141,7 +3144,7 @@ var prepareExecuteContext = function prepareExecuteContext(_ref) {
|
|
|
3141
3144
|
assertHasLocation(asset);
|
|
3142
3145
|
if (feeAsset) assertHasLocation(feeAsset);
|
|
3143
3146
|
var amount = BigInt(asset.amount);
|
|
3144
|
-
var reserveChain = getAssetReserveChain(chain, asset.multiLocation);
|
|
3147
|
+
var reserveChain = getAssetReserveChain(chain, destChain, asset.multiLocation);
|
|
3145
3148
|
var multiAsset = createMultiAsset(version, amount, asset.multiLocation);
|
|
3146
3149
|
var multiAssetLocalized = createMultiAsset(version, amount, localizeLocation(chain, asset.multiLocation));
|
|
3147
3150
|
var multiAssetLocalizedToDest = createMultiAsset(version, amount, localizeLocation(destChain, asset.multiLocation));
|
|
@@ -3239,7 +3242,7 @@ var createBaseExecuteXcm = function createBaseExecuteXcm(options) {
|
|
|
3239
3242
|
mainInstructions = [{
|
|
3240
3243
|
InitiateTeleport: {
|
|
3241
3244
|
assets: createAssetsFilter(multiAssetLocalized),
|
|
3242
|
-
dest: getChainLocation(reserveChain),
|
|
3245
|
+
dest: getChainLocation(chain, reserveChain),
|
|
3243
3246
|
xcm: [{
|
|
3244
3247
|
BuyExecution: {
|
|
3245
3248
|
fees: updateAsset(multiAssetLocalizedToReserve, feeMultiAsset ? amount : amount - originFee),
|
|
@@ -3254,7 +3257,7 @@ var createBaseExecuteXcm = function createBaseExecuteXcm(options) {
|
|
|
3254
3257
|
mainInstructions = [{
|
|
3255
3258
|
InitiateReserveWithdraw: {
|
|
3256
3259
|
assets: createAssetsFilter(multiAssetLocalized),
|
|
3257
|
-
reserve: getChainLocation(reserveChain),
|
|
3260
|
+
reserve: getChainLocation(chain, reserveChain),
|
|
3258
3261
|
xcm: [{
|
|
3259
3262
|
BuyExecution: {
|
|
3260
3263
|
fees:
|
|
@@ -4900,7 +4903,7 @@ function _traverseXcmHops() {
|
|
|
4900
4903
|
_context2.n = 4;
|
|
4901
4904
|
return hopApi.init(nextChain, DRY_RUN_CLIENT_TIMEOUT_MS);
|
|
4902
4905
|
case 4:
|
|
4903
|
-
isDestination = nextChain === destination
|
|
4906
|
+
isDestination = nextChain === destination;
|
|
4904
4907
|
isAssetHub = nextChain === assetHubNode;
|
|
4905
4908
|
isBridgeHub = nextChain === bridgeHubNode;
|
|
4906
4909
|
_context2.n = 5;
|
|
@@ -7002,18 +7005,18 @@ var createExchangeInstructions = /*#__PURE__*/function () {
|
|
|
7002
7005
|
}();
|
|
7003
7006
|
var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
7004
7007
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
7005
|
-
var api, chain, exchangeChain, destChain, assetFrom, assetTo, _options$fees2, originReserveFee, exchangeFee, destReserveFee, recipientAddress, version, paraIdTo, multiAssetFrom, multiAssetTo, _prepareCommonExecute, prefix, depositInstruction, exchangeInstructions, exchangeToDestXcm, finalXcm, fullXcm;
|
|
7008
|
+
var api, chain, exchangeChain, destChain, assetFrom, assetTo, _options$fees2, originReserveFee, exchangeFee, destReserveFee, recipientAddress, version, paraIdTo, multiAssetFrom, amountOut, multiAssetTo, multiAssetToLocalizedToDest, _prepareCommonExecute, prefix, depositInstruction, exchangeInstructions, exchangeToDestXcm, finalXcm, fullXcm;
|
|
7006
7009
|
return _regenerator().w(function (_context2) {
|
|
7007
7010
|
while (1) switch (_context2.n) {
|
|
7008
7011
|
case 0:
|
|
7009
7012
|
api = options.api, chain = options.chain, exchangeChain = options.exchangeChain, destChain = options.destChain, assetFrom = options.assetFrom, assetTo = options.assetTo, _options$fees2 = options.fees, originReserveFee = _options$fees2.originReserveFee, exchangeFee = _options$fees2.exchangeFee, destReserveFee = _options$fees2.destReserveFee, recipientAddress = options.recipientAddress, version = options.version, paraIdTo = options.paraIdTo;
|
|
7010
7013
|
assertHasLocation(assetFrom);
|
|
7011
7014
|
assertHasLocation(assetTo);
|
|
7012
|
-
multiAssetFrom = createMultiAsset(version, BigInt(assetFrom.amount), localizeLocation(exchangeChain, assetFrom.multiLocation));
|
|
7013
|
-
multiAssetTo = createMultiAsset(version,
|
|
7014
|
-
// Exchange fee 0n means we are creating a dummy tx
|
|
7015
|
+
multiAssetFrom = createMultiAsset(version, BigInt(assetFrom.amount), localizeLocation(exchangeChain, assetFrom.multiLocation)); // Exchange fee 0n means we are creating a dummy tx
|
|
7015
7016
|
// Set want to 1000n to prevent NoDeal
|
|
7016
|
-
exchangeFee === 0n ? 1000n : BigInt(assetTo.amount)
|
|
7017
|
+
amountOut = chain && exchangeFee === 0n ? 1000n : BigInt(assetTo.amount);
|
|
7018
|
+
multiAssetTo = createMultiAsset(version, amountOut, localizeLocation(exchangeChain, assetTo.multiLocation));
|
|
7019
|
+
multiAssetToLocalizedToDest = createMultiAsset(version, amountOut, localizeLocation(destChain !== null && destChain !== void 0 ? destChain : exchangeChain, assetTo.multiLocation));
|
|
7017
7020
|
_prepareCommonExecute = prepareCommonExecuteXcm({
|
|
7018
7021
|
api: api,
|
|
7019
7022
|
chain: chain !== null && chain !== void 0 ? chain : exchangeChain,
|
|
@@ -7026,7 +7029,7 @@ var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
|
7026
7029
|
reserveFee: originReserveFee
|
|
7027
7030
|
},
|
|
7028
7031
|
version: version
|
|
7029
|
-
},
|
|
7032
|
+
}, multiAssetToLocalizedToDest), prefix = _prepareCommonExecute.prefix, depositInstruction = _prepareCommonExecute.depositInstruction;
|
|
7030
7033
|
_context2.n = 1;
|
|
7031
7034
|
return createExchangeInstructions(options, multiAssetFrom, multiAssetTo);
|
|
7032
7035
|
case 1:
|
|
@@ -7043,7 +7046,7 @@ var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
|
7043
7046
|
reserveFee: destReserveFee
|
|
7044
7047
|
},
|
|
7045
7048
|
suffixXcm: [depositInstruction]
|
|
7046
|
-
}) : [];
|
|
7049
|
+
}) : [depositInstruction];
|
|
7047
7050
|
finalXcm = chain ? createBaseExecuteXcm({
|
|
7048
7051
|
chain: chain,
|
|
7049
7052
|
destChain: exchangeChain,
|
|
@@ -7068,7 +7071,7 @@ var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
|
7068
7071
|
}();
|
|
7069
7072
|
|
|
7070
7073
|
var MIN_FEE = 1000n;
|
|
7071
|
-
var FEE_PADDING_PERCENTAGE =
|
|
7074
|
+
var FEE_PADDING_PERCENTAGE = 20;
|
|
7072
7075
|
var validateAmount = function validateAmount(amount, requiredFee) {
|
|
7073
7076
|
if (amount <= requiredFee) {
|
|
7074
7077
|
throw new InvalidParameterError("Asset amount is too low, please increase the amount or use a different fee asset.");
|
|
@@ -7184,8 +7187,8 @@ var extractFeesFromDryRun = function extractFeesFromDryRun(chain, dryRunResult,
|
|
|
7184
7187
|
return fees;
|
|
7185
7188
|
};
|
|
7186
7189
|
var createXcmAndCall = /*#__PURE__*/function () {
|
|
7187
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
7188
|
-
var xcm, api, chain, exchangeChain, weight, call;
|
|
7190
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options, dryRunWeight) {
|
|
7191
|
+
var xcm, api, chain, exchangeChain, hasApiSupport, weight, call, _t;
|
|
7189
7192
|
return _regenerator().w(function (_context2) {
|
|
7190
7193
|
while (1) switch (_context2.n) {
|
|
7191
7194
|
case 0:
|
|
@@ -7194,10 +7197,21 @@ var createXcmAndCall = /*#__PURE__*/function () {
|
|
|
7194
7197
|
case 1:
|
|
7195
7198
|
xcm = _context2.v;
|
|
7196
7199
|
api = options.api, chain = options.chain, exchangeChain = options.exchangeChain;
|
|
7200
|
+
hasApiSupport = hasXcmPaymentApiSupport(chain !== null && chain !== void 0 ? chain : exchangeChain);
|
|
7201
|
+
if (!hasApiSupport) {
|
|
7202
|
+
_context2.n = 3;
|
|
7203
|
+
break;
|
|
7204
|
+
}
|
|
7197
7205
|
_context2.n = 2;
|
|
7198
7206
|
return api.getXcmWeight(xcm);
|
|
7199
7207
|
case 2:
|
|
7200
|
-
|
|
7208
|
+
_t = _context2.v;
|
|
7209
|
+
_context2.n = 4;
|
|
7210
|
+
break;
|
|
7211
|
+
case 3:
|
|
7212
|
+
_t = dryRunWeight !== null && dryRunWeight !== void 0 ? dryRunWeight : MAX_WEIGHT;
|
|
7213
|
+
case 4:
|
|
7214
|
+
weight = _t;
|
|
7201
7215
|
call = createExecuteCall(chain !== null && chain !== void 0 ? chain : exchangeChain, xcm, weight);
|
|
7202
7216
|
return _context2.a(2, {
|
|
7203
7217
|
xcm: xcm,
|
|
@@ -7207,7 +7221,7 @@ var createXcmAndCall = /*#__PURE__*/function () {
|
|
|
7207
7221
|
}
|
|
7208
7222
|
}, _callee2);
|
|
7209
7223
|
}));
|
|
7210
|
-
return function createXcmAndCall(_x2) {
|
|
7224
|
+
return function createXcmAndCall(_x2, _x3) {
|
|
7211
7225
|
return _ref2.apply(this, arguments);
|
|
7212
7226
|
};
|
|
7213
7227
|
}();
|
|
@@ -7316,7 +7330,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7316
7330
|
return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
|
|
7317
7331
|
assetTo: updatedAssetTo,
|
|
7318
7332
|
fees: extractedFees
|
|
7319
|
-
}));
|
|
7333
|
+
}), firstDryRunResult.origin.success ? firstDryRunResult.origin.weight : undefined);
|
|
7320
7334
|
case 9:
|
|
7321
7335
|
_yield$createXcmAndCa2 = _context3.v;
|
|
7322
7336
|
secondCall = _yield$createXcmAndCa2.call;
|
|
@@ -7354,7 +7368,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7354
7368
|
return createXcmAndCall(_objectSpread2(_objectSpread2({}, internalOptions), {}, {
|
|
7355
7369
|
assetTo: finalAssetTo,
|
|
7356
7370
|
fees: finalFees
|
|
7357
|
-
}));
|
|
7371
|
+
}), secondDryRunResult.origin.success ? secondDryRunResult.origin.weight : undefined);
|
|
7358
7372
|
case 12:
|
|
7359
7373
|
_yield$createXcmAndCa3 = _context3.v;
|
|
7360
7374
|
finalCall = _yield$createXcmAndCa3.call;
|
|
@@ -7364,7 +7378,7 @@ var handleSwapExecuteTransfer = /*#__PURE__*/function () {
|
|
|
7364
7378
|
}
|
|
7365
7379
|
}, _callee3);
|
|
7366
7380
|
}));
|
|
7367
|
-
return function handleSwapExecuteTransfer(
|
|
7381
|
+
return function handleSwapExecuteTransfer(_x4) {
|
|
7368
7382
|
return _ref3.apply(this, arguments);
|
|
7369
7383
|
};
|
|
7370
7384
|
}();
|
|
@@ -11985,4 +11999,4 @@ var Builder = function Builder(api) {
|
|
|
11985
11999
|
return new GeneralBuilder(api, new BatchTransactionManager());
|
|
11986
12000
|
};
|
|
11987
12001
|
|
|
11988
|
-
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, TransferToAhNotSupported, UnableToComputeError, XTokensError, addEthereumBridgeFees, addXcmVersionHeader, assertAddressIsString, assertHasLocation, assertToIsString, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createMultiAsset, createVersionedMultiAssets, createX1Payload, deriveAccountId, dryRun, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChainLocation, getChainVersion, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getRelayChainOf, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, localizeLocation, maybeOverrideMultiAsset, maybeOverrideMultiAssets, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, sortMultiAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination };
|
|
12002
|
+
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, TransferToAhNotSupported, UnableToComputeError, XTokensError, addEthereumBridgeFees, addXcmVersionHeader, assertAddressIsString, assertHasLocation, assertToIsString, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createMultiAsset, createVersionedMultiAssets, createX1Payload, deriveAccountId, dryRun, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChainLocation, getChainVersion, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getRelayChainOf, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, localizeLocation, maybeOverrideMultiAsset, maybeOverrideMultiAssets, padFee, padFeeBy, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, sortMultiAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "10.10.
|
|
3
|
+
"version": "10.10.7",
|
|
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": "^1.2.6",
|
|
28
28
|
"viem": "^2.31.6",
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/
|
|
31
|
-
"@paraspell/
|
|
29
|
+
"@paraspell/pallets": "10.10.7",
|
|
30
|
+
"@paraspell/assets": "10.10.7",
|
|
31
|
+
"@paraspell/sdk-common": "10.10.7"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|