@paraspell/sdk-core 12.0.5 → 12.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.d.ts +2 -2
- package/dist/index.mjs +44 -21
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1811,7 +1811,6 @@ declare class HeimaPaseo<TApi, TRes> extends Heima<TApi, TRes> {
|
|
|
1811
1811
|
}
|
|
1812
1812
|
|
|
1813
1813
|
declare class Hydration<TApi, TRes> extends Parachain<TApi, TRes> implements IXTokensTransfer, IPolkadotXCMTransfer {
|
|
1814
|
-
private static NATIVE_ASSET_ID;
|
|
1815
1814
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1816
1815
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1817
1816
|
transferMoonbeamWhAsset<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
@@ -2107,6 +2106,7 @@ declare const chains: <TApi, TRes>() => {
|
|
|
2107
2106
|
|
|
2108
2107
|
declare const ETH_CHAIN_ID: bigint;
|
|
2109
2108
|
declare const ETHEREUM_JUNCTION: TJunction;
|
|
2109
|
+
declare const RELAY_LOCATION: TLocation;
|
|
2110
2110
|
declare const TX_CLIENT_TIMEOUT_MS: number;
|
|
2111
2111
|
declare const DRY_RUN_CLIENT_TIMEOUT_MS: number;
|
|
2112
2112
|
|
|
@@ -2323,5 +2323,5 @@ declare const formatUnits: typeof formatUnits$1;
|
|
|
2323
2323
|
|
|
2324
2324
|
declare const validateAddress: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: TAddress, chain: TChain, isDestination?: boolean) => void;
|
|
2325
2325
|
|
|
2326
|
-
export { AmountTooLowError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, UnsupportedOperationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, constructTypeAndThenCall, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
|
2326
|
+
export { AmountTooLowError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, UnsupportedOperationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, constructTypeAndThenCall, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
|
2327
2327
|
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, TChainEndpoint, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedEthTransfer, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TSwapConfig, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { blake2b } from '@noble/hashes/blake2.js';
|
|
2
|
-
import { isChainEvm, getAssetsObject, InvalidCurrencyError, extractAssetLocation, findAssetInfoOrThrow, getOtherAssets, isTAsset, findNativeAssetInfoOrThrow, findAssetInfo, getExistentialDepositOrThrow, isSymbolMatch, getNativeAssetSymbol, getEdFromAssetOrThrow, hasDryRunSupport, findAssetOnDestOrThrow, findAssetInfoOnDest, isAssetEqual, isOverrideLocationSpecifier, getRelayChainSymbol, isSymbolSpecifier, findNativeAssetInfo, isAssetXcEqual, normalizeLocation, normalizeSymbol, Native, hasXcmPaymentApiSupport, findAssetInfoByLoc } from '@paraspell/assets';
|
|
2
|
+
import { isChainEvm, getAssetsObject, InvalidCurrencyError, extractAssetLocation, findAssetInfoOrThrow, getOtherAssets, isTAsset, findNativeAssetInfoOrThrow, findAssetInfo, getExistentialDepositOrThrow, isSymbolMatch, getNativeAssetSymbol, getEdFromAssetOrThrow, hasDryRunSupport, findAssetOnDestOrThrow, findAssetInfoOnDest, isAssetEqual, isStableCoinAsset, isOverrideLocationSpecifier, getRelayChainSymbol, isSymbolSpecifier, findNativeAssetInfo, isAssetXcEqual, normalizeLocation, normalizeSymbol, Native, hasXcmPaymentApiSupport, findAssetInfoByLoc } from '@paraspell/assets';
|
|
3
3
|
export * from '@paraspell/assets';
|
|
4
4
|
import { base58 } from '@scure/base';
|
|
5
5
|
import { isAddress, parseUnits as parseUnits$1, formatUnits as formatUnits$1, getContract, createPublicClient, http, pad, toHex, getAddress, concat, keccak256 } from 'viem';
|
|
@@ -4601,8 +4601,9 @@ var validateBridgeAsset = function validateBridgeAsset(origin, destination, asse
|
|
|
4601
4601
|
var nativeAsset = findNativeAssetInfoOrThrow(origin);
|
|
4602
4602
|
var isNativeAsset = isAssetEqual(asset, nativeAsset);
|
|
4603
4603
|
var ecosystem = getRelayChainOf(destination).toLowerCase();
|
|
4604
|
-
var
|
|
4605
|
-
|
|
4604
|
+
var isBridgedSystemAsset = ((_asset$location = asset.location) === null || _asset$location === void 0 ? void 0 : _asset$location.parents) === Parents.TWO && deepEqual(getJunctionValue(asset.location, 'GlobalConsensus'), _defineProperty({}, ecosystem, null));
|
|
4605
|
+
var isBridgedStablecoin = isStableCoinAsset(asset);
|
|
4606
|
+
if (!(isNativeAsset || isBridgedSystemAsset || isBridgedStablecoin)) {
|
|
4606
4607
|
throw new InvalidCurrencyError("Substrate bridge does not support currency ".concat(JSON.stringify(currency, replaceBigInt), "."));
|
|
4607
4608
|
}
|
|
4608
4609
|
};
|
|
@@ -5205,21 +5206,32 @@ var getChainLocation = function getChainLocation(chain, destChain) {
|
|
|
5205
5206
|
* @returns The localized location
|
|
5206
5207
|
*/
|
|
5207
5208
|
var localizeLocation = function localizeLocation(chain, location, origin) {
|
|
5209
|
+
var _Object$keys$;
|
|
5208
5210
|
var targetRelay = isExternalChain(chain) ? undefined : getRelayChainOf(chain).toLowerCase();
|
|
5209
5211
|
var originRelay = origin && !isExternalChain(origin) ? getRelayChainOf(origin).toLowerCase() : undefined;
|
|
5210
|
-
var
|
|
5211
|
-
|
|
5212
|
+
var locationConsensus = getJunctionValue(location, 'GlobalConsensus');
|
|
5213
|
+
var locationRelay = locationConsensus ? (_Object$keys$ = Object.keys(locationConsensus)[0]) === null || _Object$keys$ === void 0 ? void 0 : _Object$keys$.toLowerCase() : undefined;
|
|
5214
|
+
var ecosystemDiffers = targetRelay && originRelay && originRelay !== targetRelay;
|
|
5215
|
+
var junctions = location.interior === 'Here' ? [] : Object.values(location.interior).flat().filter(function (junction) {
|
|
5216
|
+
return _typeof(junction) === 'object' && junction !== null;
|
|
5217
|
+
});
|
|
5218
|
+
var junctionCount = junctions.length;
|
|
5219
|
+
var isLocationOnTargetRelay = targetRelay !== undefined && locationRelay === targetRelay;
|
|
5220
|
+
if (!origin && locationRelay && targetRelay && locationRelay !== targetRelay) {
|
|
5221
|
+
return location;
|
|
5222
|
+
}
|
|
5223
|
+
if (origin && ecosystemDiffers && location.parents === Parents.TWO && originRelay !== undefined && targetRelay !== undefined && deepEqual(getJunctionValue(location, 'GlobalConsensus'), _defineProperty({}, targetRelay, null)) && junctionCount === 1) {
|
|
5212
5224
|
return RELAY_LOCATION;
|
|
5213
5225
|
}
|
|
5214
5226
|
var newInterior = location.interior;
|
|
5215
5227
|
var parachainRemoved = false;
|
|
5216
5228
|
if (location.interior !== 'Here') {
|
|
5217
5229
|
var paraId = getParaId(chain);
|
|
5218
|
-
var junctions = Object.values(location.interior).flat().filter(function (junction) {
|
|
5219
|
-
return _typeof(junction) === 'object' && junction !== null;
|
|
5220
|
-
});
|
|
5221
5230
|
var filteredJunctions = junctions.filter(function (junction) {
|
|
5222
|
-
if ('
|
|
5231
|
+
if ('GlobalConsensus' in junction && isLocationOnTargetRelay) {
|
|
5232
|
+
return false;
|
|
5233
|
+
}
|
|
5234
|
+
if ('Parachain' in junction && (!ecosystemDiffers || isLocationOnTargetRelay)) {
|
|
5223
5235
|
var paraJunctionId = getJunctionValue(location, 'Parachain');
|
|
5224
5236
|
if (paraJunctionId === paraId) {
|
|
5225
5237
|
parachainRemoved = true;
|
|
@@ -5248,6 +5260,18 @@ var localizeLocation = function localizeLocation(chain, location, origin) {
|
|
|
5248
5260
|
}
|
|
5249
5261
|
};
|
|
5250
5262
|
}
|
|
5263
|
+
if (origin && ecosystemDiffers && newInterior !== 'Here' && !hasGlobalConsensus && originRelay !== undefined) {
|
|
5264
|
+
var _junctions = Object.values(newInterior).flat().filter(function (junction) {
|
|
5265
|
+
return _typeof(junction) === 'object' && junction !== null;
|
|
5266
|
+
});
|
|
5267
|
+
var updatedJunctions = [{
|
|
5268
|
+
GlobalConsensus: _defineProperty({}, originRelay, null)
|
|
5269
|
+
}].concat(_toConsumableArray(_junctions));
|
|
5270
|
+
return {
|
|
5271
|
+
parents: Parents.TWO,
|
|
5272
|
+
interior: _defineProperty({}, "X".concat(updatedJunctions.length), updatedJunctions)
|
|
5273
|
+
};
|
|
5274
|
+
}
|
|
5251
5275
|
var shouldSetParentsToZero = parachainRemoved || newInterior === 'Here' && isRelayChain(chain);
|
|
5252
5276
|
return {
|
|
5253
5277
|
parents: shouldSetParentsToZero ? Parents.ZERO : location.parents,
|
|
@@ -8052,6 +8076,7 @@ var buildTypeAndThenCall = function buildTypeAndThenCall(_ref, isDotAsset, custo
|
|
|
8052
8076
|
var origin = _ref.origin,
|
|
8053
8077
|
reserve = _ref.reserve,
|
|
8054
8078
|
dest = _ref.dest,
|
|
8079
|
+
isSubBridge = _ref.isSubBridge,
|
|
8055
8080
|
assetInfo = _ref.assetInfo,
|
|
8056
8081
|
_ref$options = _ref.options,
|
|
8057
8082
|
version = _ref$options.version,
|
|
@@ -8061,7 +8086,7 @@ var buildTypeAndThenCall = function buildTypeAndThenCall(_ref, isDotAsset, custo
|
|
|
8061
8086
|
var finalDest = origin.chain === reserve.chain ? dest.chain : reserve.chain;
|
|
8062
8087
|
var destLocation = createDestination(version, origin.chain, finalDest, getParaId(finalDest));
|
|
8063
8088
|
var reserveType = origin.chain === reserve.chain ? 'LocalReserve' : 'DestinationReserve';
|
|
8064
|
-
var feeMultiAsset = createAsset(version, assetInfo.amount, isRelayChain(origin.chain) ? localizeLocation(origin.chain, feeAssetLocation) : feeAssetLocation);
|
|
8089
|
+
var feeMultiAsset = createAsset(version, assetInfo.amount, isRelayChain(origin.chain) || isSubBridge ? localizeLocation(origin.chain, feeAssetLocation) : feeAssetLocation);
|
|
8065
8090
|
var module = pallet !== null && pallet !== void 0 ? pallet : isRelayChain(origin.chain) ? 'XcmPallet' : 'PolkadotXcm';
|
|
8066
8091
|
var methodName = method !== null && method !== void 0 ? method : 'transfer_assets_using_type_and_then';
|
|
8067
8092
|
return {
|
|
@@ -8080,8 +8105,10 @@ var buildTypeAndThenCall = function buildTypeAndThenCall(_ref, isDotAsset, custo
|
|
|
8080
8105
|
};
|
|
8081
8106
|
|
|
8082
8107
|
var getSubBridgeReserve = function getSubBridgeReserve(chain, destination, location) {
|
|
8083
|
-
|
|
8084
|
-
|
|
8108
|
+
var destRelay = getRelayChainOf(destination).toLowerCase();
|
|
8109
|
+
var isDestReserve = deepEqual(getJunctionValue(location, 'GlobalConsensus'), _defineProperty({}, destRelay, null));
|
|
8110
|
+
if (isDestReserve) return destination;
|
|
8111
|
+
return chain;
|
|
8085
8112
|
};
|
|
8086
8113
|
var resolveReserveChain = function resolveReserveChain(chain, destination, assetLocation, isSubBridge, overrideReserve) {
|
|
8087
8114
|
if (isSubBridge) {
|
|
@@ -8126,7 +8153,7 @@ var createTypeAndThenCallContext = /*#__PURE__*/function () {
|
|
|
8126
8153
|
systemAsset = findNativeAssetInfoOrThrow(getRelayChainOf(chain));
|
|
8127
8154
|
isRelayAsset = RELAY_ASSET_LOCATIONS.some(function (loc) {
|
|
8128
8155
|
return deepEqual(assetInfo.location, loc);
|
|
8129
|
-
});
|
|
8156
|
+
}) || isSubBridge;
|
|
8130
8157
|
destApi = api.clone();
|
|
8131
8158
|
_context.n = 1;
|
|
8132
8159
|
return destApi.init(destinationChain);
|
|
@@ -8277,10 +8304,10 @@ var createRefundInstruction = function createRefundInstruction(api, senderAddres
|
|
|
8277
8304
|
};
|
|
8278
8305
|
};
|
|
8279
8306
|
|
|
8280
|
-
var buildAssets = function buildAssets(chain, asset, feeAmount,
|
|
8307
|
+
var buildAssets = function buildAssets(chain, asset, feeAmount, isRelayAsset, version) {
|
|
8281
8308
|
var assets = [];
|
|
8282
8309
|
var shouldLocalizeAndSort = isRelayChain(chain) || chain.startsWith('AssetHub');
|
|
8283
|
-
if (!
|
|
8310
|
+
if (!isRelayAsset) {
|
|
8284
8311
|
assets.push(createAsset(version, feeAmount, RELAY_LOCATION));
|
|
8285
8312
|
}
|
|
8286
8313
|
assets.push(createAsset(version, asset.amount, shouldLocalizeAndSort ? localizeLocation(chain, asset.location) : asset.location));
|
|
@@ -10878,7 +10905,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
10878
10905
|
key: "getBalanceForeign",
|
|
10879
10906
|
value: function getBalanceForeign(api, address, asset) {
|
|
10880
10907
|
var ASSETS_PALLET_ID = 50;
|
|
10881
|
-
var hasRequiredJunctions = asset.location && hasJunction(asset.location, 'PalletInstance', ASSETS_PALLET_ID) && hasJunction(asset.location, 'GeneralIndex');
|
|
10908
|
+
var hasRequiredJunctions = asset.location && hasJunction(asset.location, 'PalletInstance', ASSETS_PALLET_ID) && hasJunction(asset.location, 'GeneralIndex') && !hasJunction(asset.location, 'GlobalConsensus');
|
|
10882
10909
|
if (!asset.location || hasRequiredJunctions) {
|
|
10883
10910
|
return getPalletInstance('Assets').getBalance(api, address, asset);
|
|
10884
10911
|
}
|
|
@@ -11805,9 +11832,6 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
|
|
|
11805
11832
|
value: function transferXTokens$1(input) {
|
|
11806
11833
|
var asset = input.asset,
|
|
11807
11834
|
destination = input.destination;
|
|
11808
|
-
if (asset.symbol === this.getNativeAssetSymbol()) {
|
|
11809
|
-
return transferXTokens(input, Hydration.NATIVE_ASSET_ID);
|
|
11810
|
-
}
|
|
11811
11835
|
var isMoonbeamWhAsset = asset.location && hasJunction(asset.location, 'Parachain', getParaId('Moonbeam')) && hasJunction(asset.location, 'PalletInstance', 110);
|
|
11812
11836
|
if (isMoonbeamWhAsset && destination === 'Moonbeam') {
|
|
11813
11837
|
return this.transferMoonbeamWhAsset(input);
|
|
@@ -11885,7 +11909,6 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
|
|
|
11885
11909
|
}
|
|
11886
11910
|
}]);
|
|
11887
11911
|
}(Parachain);
|
|
11888
|
-
Hydration.NATIVE_ASSET_ID = 0;
|
|
11889
11912
|
|
|
11890
11913
|
var HydrationPaseo = /*#__PURE__*/function (_Hydration) {
|
|
11891
11914
|
function HydrationPaseo() {
|
|
@@ -14163,4 +14186,4 @@ var getMoonbeamErc20Balance = /*#__PURE__*/function () {
|
|
|
14163
14186
|
};
|
|
14164
14187
|
}();
|
|
14165
14188
|
|
|
14166
|
-
export { AmountTooLowError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, UnsupportedOperationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, constructTypeAndThenCall, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getFailureInfo$1 as getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, throwUnsupportedCurrency, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
|
14189
|
+
export { AmountTooLowError, AssetClaimBuilder, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiUnavailableError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, UnsupportedOperationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, constructTypeAndThenCall, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createId, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatAssetIdToERC20, formatUnits, getAssetBalanceInternal, getAssetReserveChain, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getEthErc20Balance, getFailureInfo$1 as getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getMoonbeamErc20Balance, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, throwUnsupportedCurrency, 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": "12.0
|
|
3
|
+
"version": "12.1.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": "^2.0.1",
|
|
27
27
|
"@scure/base": "^2.0.0",
|
|
28
28
|
"viem": "^2.40.3",
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/
|
|
31
|
-
"@paraspell/
|
|
29
|
+
"@paraspell/assets": "12.1.0",
|
|
30
|
+
"@paraspell/pallets": "12.1.0",
|
|
31
|
+
"@paraspell/sdk-common": "12.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|