@paraspell/sdk-core 14.3.6 → 14.4.2
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 +7 -20
- package/dist/index.mjs +97 -193
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner, TCustomChain extends str
|
|
|
83
83
|
getRelayChainSymbol(chain: TChain | TCustomChain): string;
|
|
84
84
|
hasDryRunSupport(chain: TChain | TCustomChain): boolean;
|
|
85
85
|
hasXcmPaymentApiSupport(chain: TChain | TCustomChain): boolean;
|
|
86
|
-
|
|
86
|
+
getExistentialDeposit(chain: TChain | TCustomChain, currency?: TCurrencyCore): bigint;
|
|
87
87
|
hasPallet(chain: TSubstrateChain | TCustomChain, pallet: TPallet): boolean;
|
|
88
88
|
getXcmPallet(chain: TSubstrateChain | TCustomChain): TPallet;
|
|
89
89
|
getRelayChainOf(chain: TSubstrateChain | TCustomChain): TRelaychain;
|
|
@@ -123,6 +123,7 @@ declare abstract class PolkadotApi<TApi, TRes, TSigner, TCustomChain extends str
|
|
|
123
123
|
abstract getXcmPaymentApiFee(chain: TSubstrateChain, localXcm: any, forwardedXcm: any, asset: TAssetInfo, version: Version, transformXcm: boolean): Promise<bigint>;
|
|
124
124
|
abstract getFromRpc(module: string, method: string, key: string): Promise<string>;
|
|
125
125
|
abstract blake2AsHex(data: Uint8Array): string;
|
|
126
|
+
abstract xxhashAsHex(data: Uint8Array): string;
|
|
126
127
|
abstract clone(): PolkadotApi<TApi, TRes, TSigner, TCustomChain>;
|
|
127
128
|
abstract createApiForChain(chain: TSubstrateChain): Promise<PolkadotApi<TApi, TRes, TSigner, TCustomChain>>;
|
|
128
129
|
abstract getDryRunCall(options: TDryRunCallBaseOptions<TRes, TCustomChain>): Promise<TDryRunChainResult>;
|
|
@@ -338,20 +339,6 @@ declare class CoretimeWestend<TApi, TRes, TSigner, TCustomChain extends string =
|
|
|
338
339
|
constructor();
|
|
339
340
|
}
|
|
340
341
|
|
|
341
|
-
declare class Crust<TApi, TRes, TSigner, TCustomChain extends string = never> extends SubstrateChain<TApi, TRes, TSigner, TCustomChain> implements IXTokensTransfer<TApi, TRes, TSigner, TCustomChain> {
|
|
342
|
-
constructor();
|
|
343
|
-
private getCurrencySelection;
|
|
344
|
-
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner, TCustomChain>): TRes;
|
|
345
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner, TCustomChain>): TRes;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
declare class CrustShadow<TApi, TRes, TSigner, TCustomChain extends string = never> extends SubstrateChain<TApi, TRes, TSigner, TCustomChain> implements IXTokensTransfer<TApi, TRes, TSigner, TCustomChain> {
|
|
349
|
-
constructor();
|
|
350
|
-
private getCurrencySelection;
|
|
351
|
-
transferXTokens(input: TXTokensTransferOptions<TApi, TRes, TSigner, TCustomChain>): TRes;
|
|
352
|
-
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner, TCustomChain>): TRes;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
342
|
declare class Curio<TApi, TRes, TSigner, TCustomChain extends string = never> extends SubstrateChain<TApi, TRes, TSigner, TCustomChain> implements IPolkadotXCMTransfer<TApi, TRes, TSigner, TCustomChain> {
|
|
356
343
|
constructor();
|
|
357
344
|
getCustomCurrencyId(_api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, asset: TAssetInfo): TForeignOrTokenAsset;
|
|
@@ -515,6 +502,7 @@ declare class Unique<TApi, TRes, TSigner, TCustomChain extends string = never> e
|
|
|
515
502
|
transferPolkadotXCM(input: TPolkadotXCMTransferOptions<TApi, TRes, TSigner, TCustomChain>): Promise<TRes>;
|
|
516
503
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes, TSigner, TCustomChain>): TRes;
|
|
517
504
|
getBalanceForeign(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
505
|
+
mint(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint): Promise<TSetBalanceRes>;
|
|
518
506
|
}
|
|
519
507
|
|
|
520
508
|
declare class Westend<TApi, TRes, TSigner, TCustomChain extends string = never> extends Polkadot<TApi, TRes, TSigner, TCustomChain> {
|
|
@@ -534,7 +522,6 @@ declare const chains: <TApi, TRes, TSigner>() => {
|
|
|
534
522
|
Ajuna: Ajuna<TApi, TRes, TSigner, never>;
|
|
535
523
|
Astar: Astar<TApi, TRes, TSigner, never>;
|
|
536
524
|
Unique: Unique<TApi, TRes, TSigner, never>;
|
|
537
|
-
Crust: Crust<TApi, TRes, TSigner, never>;
|
|
538
525
|
BifrostPolkadot: BifrostPolkadot<TApi, TRes, TSigner, never>;
|
|
539
526
|
BridgeHubPolkadot: BridgeHubPolkadot<TApi, TRes, TSigner, never>;
|
|
540
527
|
Centrifuge: Centrifuge<TApi, TRes, TSigner, never>;
|
|
@@ -560,7 +547,6 @@ declare const chains: <TApi, TRes, TSigner>() => {
|
|
|
560
547
|
Basilisk: Basilisk<TApi, TRes, TSigner, never>;
|
|
561
548
|
BifrostKusama: BifrostKusama<TApi, TRes, TSigner, never>;
|
|
562
549
|
Curio: Curio<TApi, TRes, TSigner, never>;
|
|
563
|
-
CrustShadow: CrustShadow<TApi, TRes, TSigner, never>;
|
|
564
550
|
Karura: Karura<TApi, TRes, TSigner, never>;
|
|
565
551
|
PeopleKusama: PeopleKusama<TApi, TRes, TSigner, never>;
|
|
566
552
|
Shiden: Shiden<TApi, TRes, TSigner, never>;
|
|
@@ -2306,7 +2292,7 @@ declare const resolveTransferParams: <TApi, TRes, TSigner, TCustomChain extends
|
|
|
2306
2292
|
isNative?: boolean;
|
|
2307
2293
|
assetId?: string;
|
|
2308
2294
|
location: _paraspell_sdk_common.TLocation;
|
|
2309
|
-
existentialDeposit
|
|
2295
|
+
existentialDeposit: string;
|
|
2310
2296
|
isFeeAsset?: boolean;
|
|
2311
2297
|
erc20?: _paraspell_assets.TErc20Info;
|
|
2312
2298
|
alias?: string;
|
|
@@ -2448,6 +2434,7 @@ declare const createVersionedAssets: (version: Version, amount: bigint, location
|
|
|
2448
2434
|
|
|
2449
2435
|
declare const formatAssetIdToERC20: (id: string) => string;
|
|
2450
2436
|
|
|
2437
|
+
declare const blake2128Concat: (hex: string) => string;
|
|
2451
2438
|
declare const buildErc20StorageMint: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, address: string, asset: TAssetInfo, erc20: TErc20Info, balance: bigint) => TSetBalanceRes;
|
|
2452
2439
|
|
|
2453
2440
|
declare const maybeOverrideAssets: (version: Version, amount: bigint, assets: TAsset[], overriddenCurrency?: TLocation | TAsset[]) => TAsset | TAsset[];
|
|
@@ -2546,7 +2533,7 @@ declare const reverseTransformLocation: (location: TLocation) => TLocation;
|
|
|
2546
2533
|
|
|
2547
2534
|
declare const normalizeAmount: (amount: bigint) => bigint;
|
|
2548
2535
|
|
|
2549
|
-
declare const resolveDestChain: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, originChain: TSubstrateChain | TCustomChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "Darwinia" | "EnergyWebX" | "Hydration" | "Heima" | "Jamton" | "CoretimePolkadot" | "Collectives" | "
|
|
2536
|
+
declare const resolveDestChain: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, originChain: TSubstrateChain | TCustomChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "Darwinia" | "EnergyWebX" | "Hydration" | "Heima" | "Jamton" | "CoretimePolkadot" | "Collectives" | "NeuroWeb" | "Pendulum" | "Mythos" | "Peaq" | "PeoplePolkadot" | "Unique" | "Xode" | "AssetHubKusama" | "BridgeHubKusama" | "Karura" | "CoretimeKusama" | "Encointer" | "Basilisk" | "BifrostKusama" | "Curio" | "RobonomicsPolkadot" | "PeopleKusama" | "Shiden" | "AssetHubWestend" | "BridgeHubWestend" | "CollectivesWestend" | "CoretimeWestend" | "Penpal" | "PeopleWestend" | "AssetHubPaseo" | "EnergyWebXPaseo" | "HeimaPaseo" | "HydrationPaseo" | "PeoplePaseo" | undefined;
|
|
2550
2537
|
|
|
2551
2538
|
declare const resolveParaId: <TApi, TRes, TSigner, TCustomChain extends string = never>(paraId: number | undefined, destination: TDestination, api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>) => number | undefined;
|
|
2552
2539
|
|
|
@@ -2613,5 +2600,5 @@ declare const selectXcmVersion: (forcedVersion: Version | undefined, originVersi
|
|
|
2613
2600
|
declare const pickCompatibleXcmVersion: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, origin: TSubstrateChain | TCustomChain, destination: TDestination, override?: Version) => Version;
|
|
2614
2601
|
declare const pickRouterCompatibleXcmVersion: <TApi, TRes, TSigner, TCustomChain extends string = never>(api: PolkadotApi<TApi, TRes, TSigner, TCustomChain>, origin: TSubstrateChain | undefined, exchangeChain: TSubstrateChain, destination: TChain | undefined) => Version;
|
|
2615
2602
|
|
|
2616
|
-
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, CustomChainConflictError, CustomChainInvalidError, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, aggregateHopFees, applyDecimalAbstraction, assertAddressIsString, assertCurrencyCore, assertEvmAddress, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2b256, blake2b512, buildCustomChainAssetsInfo, buildCustomChainConfig, buildDestInfo, buildDryRunError, buildErc20StorageMint, buildHopInfo, buildOriginInfo, calcPreviewMintAmount, compareAddresses, compareLocationOrder, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAllCountedFilter, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createBridgedXcmPrefix, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getAssetReserveChainImpl, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainConfigImpl, getChainLocation, getChainProviders, getChainProvidersImpl, getChainVersion, getDryRunError, getErrorInstruction, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getParaIdImpl, getRelayChainOf, getRelayChainOfImpl, getRelayChainSymbolOf, getSwapExtensionOrThrow, getTChain, getTSubstrateChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isExchange, isNativeAssetTeleport, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, localizeLocationImpl, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeCustomChains, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickOtherMintPallet, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateFeeAssetSupport, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2603
|
+
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, CustomChainConflictError, CustomChainInvalidError, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, aggregateHopFees, applyDecimalAbstraction, assertAddressIsString, assertCurrencyCore, assertEvmAddress, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2128Concat, blake2b256, blake2b512, buildCustomChainAssetsInfo, buildCustomChainConfig, buildDestInfo, buildDryRunError, buildErc20StorageMint, buildHopInfo, buildOriginInfo, calcPreviewMintAmount, compareAddresses, compareLocationOrder, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAllCountedFilter, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createBridgedXcmPrefix, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getAssetReserveChainImpl, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainConfigImpl, getChainLocation, getChainProviders, getChainProvidersImpl, getChainVersion, getDryRunError, getErrorInstruction, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getParaIdImpl, getRelayChainOf, getRelayChainOfImpl, getRelayChainSymbolOf, getSwapExtensionOrThrow, getTChain, getTSubstrateChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isExchange, isNativeAssetTeleport, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, localizeLocationImpl, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeCustomChains, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickOtherMintPallet, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateFeeAssetSupport, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
2617
2604
|
export type { BuildHopInfoOptions, ClientCache, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotXCMTransfer, IXTokensTransfer, OneKey, TAddress, TApiOrUrl, TApiType, TBatchOptions, TBatchedTransferOptions, TBifrostToken, TBridgeStatus, TBridgedXcmParams, TBuildAllInternalRes, TBuildDestInfoOptions, TBuildEvmTransferOptions, TBuildInternalRes, TBuildInternalResBase, TBuildOriginInfoOptions, TBuilderConfig, TBuilderInternalOptions, TBuilderOptions, TBypassOptions, TCacheItem, TChainConfig, TChainConfigMap, TChainWithApi, TClientEntry, TClientKey, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateEthBridgeInstructionsOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TCustomChainEntry, TCustomChainEntryHydrated, TCustomChainFrom, TCustomChainInput, TCustomChainPalletsInput, TCustomChainsCtx, TCustomChainsMap, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChainFailure, TDryRunChainKind, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunFailure, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmExtension, TEvmSnowbridgeExtension, TEvmTransferOptions, TEvmTransferOptionsBase, TExchangeChain, TExchangeInput, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TFullCustomCtx, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceCommonOptions, TGetBalanceOptions, TGetBalanceOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, TMintConfig, TModuleError, TNativeTokenAsset, TOriginFeeDetails, TOriginXcmFeeInfo, TOtherReserveAsset, TPaymentInfo, TPerAssetResult, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TReceivedCurrencyInfo, TReserveAsset, TResolveHopParams, TResolvedCurrency, TRuntimeApi, TScenario, TSelectedCurrencyInfo, TSelfReserveAsset, TSender, TSerializedExtrinsics, TSerializedRuntimeApiQuery, TSerializedStateQuery, TSetBalanceRes, TStatusChangeCallback, TSubstrateTransferBaseOptions, TSubstrateTransferBaseOptionsWithSender, TSubstrateTransferOptions, TSwapBuilder, TSwapBuilderFactory, TSwapConfig, TSwapEvent, TSwapEventType, TSwapExtension, TSwapFeeEstimates, TSwapOptions, TSystemProperties, TTransactOptions, TTransactOrigin, TTransactionContext, TTransactionType, TTransferBaseOptions, TTransferBaseOptionsWithSender, TTransferBaseOptionsWithSwap, TTransferFeeEstimates, TTransferInfo, TTransferInternalOptions, TTransferLocalOptions, TTransferOptions, TTransferOptionsWithSwap, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TTypeAndThenOverrides, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeDetailWithForwardedXcm, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmVersioned, WithApi, WithRequiredSender, WithRequiredSwapOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { blake2b } from '@noble/hashes/blake2.js';
|
|
2
|
-
import { isChainEvm, getAssetsObject, InvalidCurrencyError, isAssetEqual, isSymbolMatch, isStableCoinAsset, isAdditionalSubstrateBridgeAsset, isBridgedSystemAsset, STABLECOIN_IDS, isSymbolSpecifier, normalizeLocation, getNativeAssetSymbol,
|
|
2
|
+
import { isChainEvm, getAssetsObject, InvalidCurrencyError, isAssetEqual, isSymbolMatch, isStableCoinAsset, isAdditionalSubstrateBridgeAsset, isBridgedSystemAsset, STABLECOIN_IDS, isSymbolSpecifier, normalizeLocation, getNativeAssetSymbol, extractAssetLocation, hasDryRunSupport, normalizeSymbol, Native, getOtherAssets, canonicalizeLocation, getAssetsObjectImpl, getAssetsImpl, getNativeAssetsImpl, getOtherAssetsImpl, findAssetInfoImpl, findAssetInfoOrThrowImpl, findAssetInfoOnDestImpl, findAssetOnDestOrThrowImpl, findNativeAssetInfoImpl, findNativeAssetInfoOrThrowImpl, isChainEvmImpl, getNativeAssetSymbolImpl, getRelayChainSymbolImpl, hasDryRunSupportImpl, hasXcmPaymentApiSupportImpl, getExistentialDepositImpl, normalizeCustomAssets } from '@paraspell/assets';
|
|
3
3
|
export * from '@paraspell/assets';
|
|
4
4
|
import { base58 } from '@scure/base';
|
|
5
|
-
import { isAddress, isHex, createPublicClient, http, formatUnits as formatUnits$1, parseUnits as parseUnits$1 } from 'viem';
|
|
5
|
+
import { isAddress, isHex, createPublicClient, http, formatUnits as formatUnits$1, parseUnits as parseUnits$1, numberToBytes } from 'viem';
|
|
6
6
|
import { ParaSpellError, isTLocation, replaceBigInt, isExternalChain, CHAINS, Version, isRelayChain, isSubstrateBridge, Parents, deepEqual, isTrustedChain, isCustomChain, isSnowbridge, getJunctionValue, hasJunction, ETHEREUM_BRIDGE_ORIGINS, isBridge, isSubstrateChain, flattenJunctions, RELAYCHAINS, DEFAULT_SS58_PREFIX } from '@paraspell/sdk-common';
|
|
7
7
|
export * from '@paraspell/sdk-common';
|
|
8
8
|
import { getOtherAssetsPallets, getNativeAssetsPallet, BRIDGE_PALLETS, getPalletIndex, getXcmPallet, getSupportedPalletsDetails, ASSETS_PALLETS, NATIVE_ASSETS_PALLET_PRIORITY, OTHER_ASSETS_PALLET_PRIORITY, hasPalletImpl, getXcmPalletImpl } from '@paraspell/pallets';
|
|
9
9
|
export * from '@paraspell/pallets';
|
|
10
10
|
import { mainnet, sepolia } from 'viem/chains';
|
|
11
|
+
import { hexToBytes, bytesToHex } from '@noble/hashes/utils.js';
|
|
11
12
|
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
12
|
-
import { bytesToHex, hexToBytes } from '@noble/hashes/utils.js';
|
|
13
13
|
|
|
14
14
|
function _arrayLikeToArray(r, a) {
|
|
15
15
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -1204,29 +1204,6 @@ var Collectives$1 = {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
]
|
|
1206
1206
|
};
|
|
1207
|
-
var Crust$1 = {
|
|
1208
|
-
name: "Crust",
|
|
1209
|
-
info: "crustParachain",
|
|
1210
|
-
paraId: 2008,
|
|
1211
|
-
providers: [
|
|
1212
|
-
{
|
|
1213
|
-
name: "Crust",
|
|
1214
|
-
endpoint: "wss://crust-parachain.crustapps.net"
|
|
1215
|
-
},
|
|
1216
|
-
{
|
|
1217
|
-
name: "Crust APP",
|
|
1218
|
-
endpoint: "wss://crust-parachain.crustnetwork.app"
|
|
1219
|
-
},
|
|
1220
|
-
{
|
|
1221
|
-
name: "Crust CC",
|
|
1222
|
-
endpoint: "wss://crust-parachain.crustnetwork.cc"
|
|
1223
|
-
},
|
|
1224
|
-
{
|
|
1225
|
-
name: "Crust XYZ",
|
|
1226
|
-
endpoint: "wss://crust-parachain.crustnetwork.xyz"
|
|
1227
|
-
}
|
|
1228
|
-
]
|
|
1229
|
-
};
|
|
1230
1207
|
var NeuroWeb$1 = {
|
|
1231
1208
|
name: "NeuroWeb",
|
|
1232
1209
|
info: "neuroweb",
|
|
@@ -1492,29 +1469,6 @@ var Curio$1 = {
|
|
|
1492
1469
|
}
|
|
1493
1470
|
]
|
|
1494
1471
|
};
|
|
1495
|
-
var CrustShadow$1 = {
|
|
1496
|
-
name: "Crust Shadow",
|
|
1497
|
-
info: "shadow",
|
|
1498
|
-
paraId: 2012,
|
|
1499
|
-
providers: [
|
|
1500
|
-
{
|
|
1501
|
-
name: "Crust",
|
|
1502
|
-
endpoint: "wss://rpc-shadow.crust.network/"
|
|
1503
|
-
},
|
|
1504
|
-
{
|
|
1505
|
-
name: "Crust APP",
|
|
1506
|
-
endpoint: "wss://rpc-shadow.crustnetwork.app"
|
|
1507
|
-
},
|
|
1508
|
-
{
|
|
1509
|
-
name: "Crust CC",
|
|
1510
|
-
endpoint: "wss://rpc-shadow.crustnetwork.cc"
|
|
1511
|
-
},
|
|
1512
|
-
{
|
|
1513
|
-
name: "Crust XYZ",
|
|
1514
|
-
endpoint: "wss://rpc-shadow.crustnetwork.xyz"
|
|
1515
|
-
}
|
|
1516
|
-
]
|
|
1517
|
-
};
|
|
1518
1472
|
var RobonomicsPolkadot$1 = {
|
|
1519
1473
|
name: "Robonomics",
|
|
1520
1474
|
info: "robonomics",
|
|
@@ -1860,7 +1814,6 @@ var configs = {
|
|
|
1860
1814
|
Jamton: Jamton$1,
|
|
1861
1815
|
CoretimePolkadot: CoretimePolkadot$1,
|
|
1862
1816
|
Collectives: Collectives$1,
|
|
1863
|
-
Crust: Crust$1,
|
|
1864
1817
|
NeuroWeb: NeuroWeb$1,
|
|
1865
1818
|
Pendulum: Pendulum$1,
|
|
1866
1819
|
Mythos: Mythos$1,
|
|
@@ -1876,7 +1829,6 @@ var configs = {
|
|
|
1876
1829
|
Basilisk: Basilisk$1,
|
|
1877
1830
|
BifrostKusama: BifrostKusama$1,
|
|
1878
1831
|
Curio: Curio$1,
|
|
1879
|
-
CrustShadow: CrustShadow$1,
|
|
1880
1832
|
RobonomicsPolkadot: RobonomicsPolkadot$1,
|
|
1881
1833
|
PeopleKusama: PeopleKusama$1,
|
|
1882
1834
|
Shiden: Shiden$1,
|
|
@@ -2523,7 +2475,6 @@ var SystemPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
2523
2475
|
key: "getBalance",
|
|
2524
2476
|
value: function () {
|
|
2525
2477
|
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, address, asset) {
|
|
2526
|
-
var _asset$existentialDep;
|
|
2527
2478
|
var account, free, reserved, frozen, ed, frozenUntouchable, untouchable, spendable;
|
|
2528
2479
|
return _regenerator().w(function (_context) {
|
|
2529
2480
|
while (1) switch (_context.n) {
|
|
@@ -2545,7 +2496,7 @@ var SystemPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
2545
2496
|
free = BigInt(account.data.free);
|
|
2546
2497
|
reserved = BigInt(account.data.reserved);
|
|
2547
2498
|
frozen = BigInt(account.data.frozen);
|
|
2548
|
-
ed = BigInt(
|
|
2499
|
+
ed = BigInt(asset.existentialDeposit);
|
|
2549
2500
|
frozenUntouchable = frozen - reserved;
|
|
2550
2501
|
untouchable = frozenUntouchable > ed ? frozenUntouchable : ed;
|
|
2551
2502
|
spendable = free - untouchable;
|
|
@@ -5363,7 +5314,7 @@ var isSufficientOrigin = /*#__PURE__*/function () {
|
|
|
5363
5314
|
}
|
|
5364
5315
|
return _context.a(2, undefined);
|
|
5365
5316
|
case 1:
|
|
5366
|
-
edNative = api.
|
|
5317
|
+
edNative = api.getExistentialDeposit(origin);
|
|
5367
5318
|
_context.n = 2;
|
|
5368
5319
|
return getBalanceInternal({
|
|
5369
5320
|
api: api,
|
|
@@ -5394,7 +5345,7 @@ var isSufficientOrigin = /*#__PURE__*/function () {
|
|
|
5394
5345
|
});
|
|
5395
5346
|
case 4:
|
|
5396
5347
|
balanceAsset = _context.v;
|
|
5397
|
-
edAsset =
|
|
5348
|
+
edAsset = BigInt(asset.existentialDeposit);
|
|
5398
5349
|
isSufficientAsset = balanceAsset - edAsset > 0n;
|
|
5399
5350
|
return _context.a(2, isSufficientNative && isSufficientAsset);
|
|
5400
5351
|
case 5:
|
|
@@ -5421,7 +5372,7 @@ var isSufficientDestination = /*#__PURE__*/function () {
|
|
|
5421
5372
|
}
|
|
5422
5373
|
return _context2.a(2, undefined);
|
|
5423
5374
|
case 1:
|
|
5424
|
-
existentialDeposit = api.
|
|
5375
|
+
existentialDeposit = api.getExistentialDeposit(destination);
|
|
5425
5376
|
_context2.n = 2;
|
|
5426
5377
|
return getBalanceInternal({
|
|
5427
5378
|
api: api,
|
|
@@ -6295,7 +6246,7 @@ var wrapTxBypass = /*#__PURE__*/function () {
|
|
|
6295
6246
|
if ((options === null || options === void 0 ? void 0 : options.sentAssetMintMode) === 'bypass') {
|
|
6296
6247
|
mintAmount = parseUnits(bypassMintAmount, sentAsset.decimals) + sentAsset.amount;
|
|
6297
6248
|
} else {
|
|
6298
|
-
keepAliveBuffer = dryRunOptions.keepAlive ?
|
|
6249
|
+
keepAliveBuffer = dryRunOptions.keepAlive ? BigInt(sentAsset.existentialDeposit) : 0n;
|
|
6299
6250
|
desiredBalance = sentAsset.amount + keepAliveBuffer;
|
|
6300
6251
|
missing = (_calcPreviewMintAmoun = calcPreviewMintAmount(balance, desiredBalance)) !== null && _calcPreviewMintAmoun !== void 0 ? _calcPreviewMintAmoun : 0n;
|
|
6301
6252
|
total = missing + bonus;
|
|
@@ -7198,7 +7149,7 @@ var buildDestInfo = /*#__PURE__*/function () {
|
|
|
7198
7149
|
return destApi.init(destination);
|
|
7199
7150
|
case 1:
|
|
7200
7151
|
destAsset = api.findAssetOnDestOrThrow(origin, destination, currency);
|
|
7201
|
-
edDest =
|
|
7152
|
+
edDest = BigInt(destAsset.existentialDeposit);
|
|
7202
7153
|
_context.n = 2;
|
|
7203
7154
|
return getAssetBalanceInternal({
|
|
7204
7155
|
api: destApi,
|
|
@@ -7362,7 +7313,7 @@ var buildOriginInfo = /*#__PURE__*/function () {
|
|
|
7362
7313
|
balance = _context.v;
|
|
7363
7314
|
balanceAfter = balance - assetAmount;
|
|
7364
7315
|
return _context.a(2, {
|
|
7365
|
-
sufficient: balanceAfter >=
|
|
7316
|
+
sufficient: balanceAfter >= BigInt(asset.existentialDeposit),
|
|
7366
7317
|
balance: balance,
|
|
7367
7318
|
balanceAfter: balanceAfter,
|
|
7368
7319
|
asset: asset
|
|
@@ -7588,8 +7539,9 @@ var sumHopFees = function sumHopFees(result, _ref) {
|
|
|
7588
7539
|
var assetInfo = _ref.assetInfo,
|
|
7589
7540
|
feeAssetInfo = _ref.feeAssetInfo,
|
|
7590
7541
|
isRelayAsset = _ref.isRelayAsset,
|
|
7591
|
-
systemAsset = _ref.systemAsset
|
|
7592
|
-
|
|
7542
|
+
systemAsset = _ref.systemAsset,
|
|
7543
|
+
overriddenAsset = _ref.options.overriddenAsset;
|
|
7544
|
+
var feeAsset = isRelayAsset || overriddenAsset ? assetInfo : feeAssetInfo !== null && feeAssetInfo !== void 0 ? feeAssetInfo : systemAsset;
|
|
7593
7545
|
return result.hops.reduce(function (acc, hop) {
|
|
7594
7546
|
// only add if asset is equal
|
|
7595
7547
|
return isAssetEqual(hop.result.asset, feeAsset) ? acc + hop.result.fee : acc;
|
|
@@ -7597,20 +7549,26 @@ var sumHopFees = function sumHopFees(result, _ref) {
|
|
|
7597
7549
|
};
|
|
7598
7550
|
var computeAllFees = /*#__PURE__*/function () {
|
|
7599
7551
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(context, buildTx) {
|
|
7600
|
-
var origin, dest, _context$options, sender, recipient, currency, feeCurrency, version, result, hopFees, destFee;
|
|
7552
|
+
var origin, dest, feeAssetInfo, _context$options, sender, recipient, currency, feeCurrency, version, overriddenAsset, result, hopFees, destFee;
|
|
7601
7553
|
return _regenerator().w(function (_context) {
|
|
7602
7554
|
while (1) switch (_context.n) {
|
|
7603
7555
|
case 0:
|
|
7604
|
-
origin = context.origin, dest = context.dest, _context$options = context.options, sender = _context$options.sender, recipient = _context$options.recipient, currency = _context$options.currency, feeCurrency = _context$options.feeCurrency, version = _context$options.version;
|
|
7556
|
+
origin = context.origin, dest = context.dest, feeAssetInfo = context.feeAssetInfo, _context$options = context.options, sender = _context$options.sender, recipient = _context$options.recipient, currency = _context$options.currency, feeCurrency = _context$options.feeCurrency, version = _context$options.version, overriddenAsset = _context$options.overriddenAsset;
|
|
7605
7557
|
assertSender(sender);
|
|
7606
7558
|
assertAddressIsString(recipient);
|
|
7607
7559
|
if (origin.api.hasDryRunSupport(context.origin.chain)) {
|
|
7560
|
+
_context.n = 2;
|
|
7561
|
+
break;
|
|
7562
|
+
}
|
|
7563
|
+
if (!(feeAssetInfo || overriddenAsset)) {
|
|
7608
7564
|
_context.n = 1;
|
|
7609
7565
|
break;
|
|
7610
7566
|
}
|
|
7611
|
-
|
|
7567
|
+
throw new ScenarioNotSupportedError("Fee asset cannot be used on ".concat(origin.chain, " because it does not support dry run."));
|
|
7612
7568
|
case 1:
|
|
7613
|
-
_context.
|
|
7569
|
+
return _context.a(2, null);
|
|
7570
|
+
case 2:
|
|
7571
|
+
_context.n = 3;
|
|
7614
7572
|
return getXcmFeeInternal({
|
|
7615
7573
|
api: origin.api,
|
|
7616
7574
|
buildTx: buildTx,
|
|
@@ -7624,7 +7582,7 @@ var computeAllFees = /*#__PURE__*/function () {
|
|
|
7624
7582
|
disableFallback: false,
|
|
7625
7583
|
skipReverseFeeCalculation: true
|
|
7626
7584
|
});
|
|
7627
|
-
case
|
|
7585
|
+
case 3:
|
|
7628
7586
|
result = _context.v;
|
|
7629
7587
|
hopFees = sumHopFees(result, context);
|
|
7630
7588
|
destFee = result.destination.fee;
|
|
@@ -7697,7 +7655,7 @@ var getMinTransferableAmountInternal = /*#__PURE__*/function () {
|
|
|
7697
7655
|
});
|
|
7698
7656
|
case 1:
|
|
7699
7657
|
destBalance = _context.v;
|
|
7700
|
-
destEd =
|
|
7658
|
+
destEd = BigInt(destAsset.existentialDeposit);
|
|
7701
7659
|
paysOriginInSendingAsset = !resolvedFeeAsset && isAssetEqual(nativeAssetInfo, asset) || resolvedFeeAsset && isAssetEqual(resolvedFeeAsset, asset);
|
|
7702
7660
|
originFee = result.origin && paysOriginInSendingAsset && isAssetEqual(result.origin.asset, asset) ? result.origin.fee : 0n;
|
|
7703
7661
|
hopFeeTotal = result.hops.reduce(function (acc, hop) {
|
|
@@ -7885,7 +7843,7 @@ var computeTransferableAmount = /*#__PURE__*/function () {
|
|
|
7885
7843
|
});
|
|
7886
7844
|
case 1:
|
|
7887
7845
|
balance = _context2.v;
|
|
7888
|
-
transferable = balance -
|
|
7846
|
+
transferable = balance - BigInt(asset.existentialDeposit) - fee;
|
|
7889
7847
|
return _context2.a(2, transferable > 0n ? transferable : 0n);
|
|
7890
7848
|
}
|
|
7891
7849
|
}, _callee2);
|
|
@@ -8539,8 +8497,12 @@ var createCustomXcm = /*#__PURE__*/function () {
|
|
|
8539
8497
|
feeAssetLocation,
|
|
8540
8498
|
feeLocLocalized,
|
|
8541
8499
|
assetLocLocalized,
|
|
8500
|
+
transferredAsset,
|
|
8501
|
+
depositLocLocalized,
|
|
8542
8502
|
asset,
|
|
8543
8503
|
allOfSelector,
|
|
8504
|
+
isFeeLeftoverAboveEd,
|
|
8505
|
+
depositsFeeAsset,
|
|
8544
8506
|
depositInstruction,
|
|
8545
8507
|
localizeFilterAsset,
|
|
8546
8508
|
assetsFilter,
|
|
@@ -8600,17 +8562,28 @@ var createCustomXcm = /*#__PURE__*/function () {
|
|
|
8600
8562
|
feeAssetLocation = getFeeAssetLocation(context);
|
|
8601
8563
|
feeLocLocalized = origin.api.localizeLocation(dest.chain, feeAssetLocation, origin.chain);
|
|
8602
8564
|
assetLocLocalized = origin.api.localizeLocation(dest.chain, assetInfo.location, origin.chain);
|
|
8603
|
-
|
|
8565
|
+
transferredAsset = overriddenAsset === null || overriddenAsset === void 0 ? void 0 : overriddenAsset.find(function (asset) {
|
|
8566
|
+
return !asset.isFeeAsset;
|
|
8567
|
+
});
|
|
8568
|
+
depositLocLocalized = transferredAsset ? origin.api.localizeLocation(dest.chain, extractAssetLocation(transferredAsset), origin.chain) : assetLocLocalized;
|
|
8569
|
+
asset = createAsset(version, assetInfo.amount, depositLocLocalized);
|
|
8604
8570
|
allOfSelector = {
|
|
8605
8571
|
AllOf: {
|
|
8606
8572
|
id: asset.id,
|
|
8607
8573
|
fun: 'Fungible'
|
|
8608
8574
|
}
|
|
8609
8575
|
};
|
|
8576
|
+
isFeeLeftoverAboveEd = function isFeeLeftoverAboveEd() {
|
|
8577
|
+
var destFeeAsset = origin.api.findAssetInfoOnDest(origin.chain, dest.chain, {
|
|
8578
|
+
location: assetInfo.location
|
|
8579
|
+
}, assetInfo);
|
|
8580
|
+
return destFeeAsset !== null && assetInfo.amount - hopFees - destFee >= BigInt(destFeeAsset.existentialDeposit);
|
|
8581
|
+
};
|
|
8582
|
+
depositsFeeAsset = overriddenAsset !== undefined && (isForFeeCalc || isExternalChain(dest.chain) || isFeeLeftoverAboveEd());
|
|
8610
8583
|
depositInstruction = {
|
|
8611
8584
|
DepositAsset: {
|
|
8612
8585
|
assets: {
|
|
8613
|
-
Wild: assetCount > 1 && !
|
|
8586
|
+
Wild: assetCount > 1 && !depositsFeeAsset ? allOfSelector : {
|
|
8614
8587
|
AllCounted: assetCount
|
|
8615
8588
|
}
|
|
8616
8589
|
},
|
|
@@ -9095,7 +9068,7 @@ var verifyEdOnDestinationInternal = /*#__PURE__*/function () {
|
|
|
9095
9068
|
while (1) switch (_context.n) {
|
|
9096
9069
|
case 0:
|
|
9097
9070
|
destAsset = _ref4.destAsset, amount = _ref4.amount, paysDestFee = _ref4.paysDestFee;
|
|
9098
|
-
ed =
|
|
9071
|
+
ed = BigInt(destAsset.existentialDeposit);
|
|
9099
9072
|
_context.n = 1;
|
|
9100
9073
|
return getAssetBalanceInternal({
|
|
9101
9074
|
address: recipient,
|
|
@@ -9644,6 +9617,7 @@ var createExecuteExchangeXcm = function createExecuteExchangeXcm(input, origin,
|
|
|
9644
9617
|
};
|
|
9645
9618
|
|
|
9646
9619
|
var prepareCommonExecuteXcm = function prepareCommonExecuteXcm(options, assetToDeposit) {
|
|
9620
|
+
var depositFeeAsset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
9647
9621
|
var api = options.api,
|
|
9648
9622
|
useJitWithdraw = options.useJitWithdraw,
|
|
9649
9623
|
recipient = options.recipient,
|
|
@@ -9673,7 +9647,7 @@ var prepareCommonExecuteXcm = function prepareCommonExecuteXcm(options, assetToD
|
|
|
9673
9647
|
});
|
|
9674
9648
|
var depositInstruction = {
|
|
9675
9649
|
DepositAsset: {
|
|
9676
|
-
assets: createAssetsFilter(assetToDeposit !== null && assetToDeposit !== void 0 ? assetToDeposit : assetLocalizedToDest, version),
|
|
9650
|
+
assets: depositFeeAsset ? createAllCountedFilter(2) : createAssetsFilter(assetToDeposit !== null && assetToDeposit !== void 0 ? assetToDeposit : assetLocalizedToDest, version),
|
|
9677
9651
|
beneficiary: beneficiary
|
|
9678
9652
|
}
|
|
9679
9653
|
};
|
|
@@ -10051,7 +10025,7 @@ var createExchangeInstructions = /*#__PURE__*/function () {
|
|
|
10051
10025
|
var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
10052
10026
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
10053
10027
|
var _ref3, _ref4;
|
|
10054
|
-
var api, chain, exchangeChain, destChain, assetInfoFrom, assetInfoTo, feeAssetInfo, _options$fees2, originFee, originReserveFee, exchangeFee, destReserveFee, destFee, sender, recipient, version, paraIdTo, isEthereumDest, resolvedDestChain, assetFrom, amountOut, assetTo, assetToLocalizedToDest, ethFeeAssetInfo, ethBridgeFee, nativeFeeAssetInfo, ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, executionFee, resolvedFeeAssetInfo, hasSeparateFeeAsset, createLegFees, feeAssetBudget, _prepareCommonExecute, prefix, depositInstruction, exchangeInstructions, exchangeToDestXcm, ethAsset, messageId, snowbridgeInstructions, finalXcm, fullXcm;
|
|
10028
|
+
var api, chain, exchangeChain, destChain, assetInfoFrom, assetInfoTo, feeAssetInfo, _options$fees2, originFee, originReserveFee, exchangeFee, destReserveFee, destFee, sender, recipient, version, paraIdTo, isEthereumDest, resolvedDestChain, assetFrom, amountOut, assetTo, assetToLocalizedToDest, ethFeeAssetInfo, ethBridgeFee, nativeFeeAssetInfo, ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, executionFee, resolvedFeeAssetInfo, hasSeparateFeeAsset, createLegFees, feeAssetBudget, isFeeLeftoverAboveEd, _prepareCommonExecute, prefix, depositInstruction, exchangeInstructions, exchangeToDestXcm, ethAsset, messageId, snowbridgeInstructions, finalXcm, fullXcm;
|
|
10055
10029
|
return _regenerator().w(function (_context2) {
|
|
10056
10030
|
while (1) switch (_context2.n) {
|
|
10057
10031
|
case 0:
|
|
@@ -10095,6 +10069,13 @@ var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
|
10095
10069
|
};
|
|
10096
10070
|
};
|
|
10097
10071
|
feeAssetBudget = ethFeeAssetInfo ? ethBridgeFee : originFee + originReserveFee + exchangeFee + destReserveFee + destFee;
|
|
10072
|
+
isFeeLeftoverAboveEd = function isFeeLeftoverAboveEd() {
|
|
10073
|
+
if (isEthereumDest || !resolvedFeeAssetInfo || !getFeeAssetInfo(assetInfoTo, resolvedFeeAssetInfo)) return false;
|
|
10074
|
+
var finalFeeAsset = api.findAssetInfo(destChain !== null && destChain !== void 0 ? destChain : exchangeChain, {
|
|
10075
|
+
location: resolvedFeeAssetInfo.location
|
|
10076
|
+
});
|
|
10077
|
+
return finalFeeAsset !== null && feeAssetBudget - (originReserveFee + exchangeFee + destReserveFee + destFee) >= BigInt(finalFeeAsset.existentialDeposit);
|
|
10078
|
+
};
|
|
10098
10079
|
_prepareCommonExecute = prepareCommonExecuteXcm({
|
|
10099
10080
|
api: api,
|
|
10100
10081
|
chain: chain !== null && chain !== void 0 ? chain : exchangeChain,
|
|
@@ -10109,7 +10090,7 @@ var createSwapExecuteXcm = /*#__PURE__*/function () {
|
|
|
10109
10090
|
destFee: 0n
|
|
10110
10091
|
},
|
|
10111
10092
|
version: version
|
|
10112
|
-
}, assetToLocalizedToDest), prefix = _prepareCommonExecute.prefix, depositInstruction = _prepareCommonExecute.depositInstruction;
|
|
10093
|
+
}, assetToLocalizedToDest, isFeeLeftoverAboveEd()), prefix = _prepareCommonExecute.prefix, depositInstruction = _prepareCommonExecute.depositInstruction;
|
|
10113
10094
|
_context2.n = 4;
|
|
10114
10095
|
return createExchangeInstructions(options, assetFrom, assetTo, resolvedFeeAssetInfo);
|
|
10115
10096
|
case 4:
|
|
@@ -10505,7 +10486,7 @@ var getLocalTransferAmount = function getLocalTransferAmount(_ref) {
|
|
|
10505
10486
|
isAmountAll = _ref.isAmountAll,
|
|
10506
10487
|
keepAlive = _ref.keepAlive;
|
|
10507
10488
|
var fee = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0n;
|
|
10508
|
-
var ed =
|
|
10489
|
+
var ed = BigInt(assetInfo.existentialDeposit);
|
|
10509
10490
|
var amount = assetInfo.amount;
|
|
10510
10491
|
var freeBalance = balance > fee ? balance - fee : 0n;
|
|
10511
10492
|
if (isAmountAll) {
|
|
@@ -11121,7 +11102,7 @@ var Hydration = /*#__PURE__*/function (_SubstrateChain) {
|
|
|
11121
11102
|
assertHasId(asset);
|
|
11122
11103
|
var currencyId = Number(asset.assetId);
|
|
11123
11104
|
if (asset.erc20) {
|
|
11124
|
-
var amount = isAmountAll ? balance - (keepAlive ?
|
|
11105
|
+
var amount = isAmountAll ? balance - (keepAlive ? BigInt(asset.existentialDeposit) : 0n) : asset.amount;
|
|
11125
11106
|
return api.deserializeExtrinsics({
|
|
11126
11107
|
module: 'Currencies',
|
|
11127
11108
|
method: 'transfer',
|
|
@@ -11575,98 +11556,6 @@ var CoretimeWestend = /*#__PURE__*/function (_CoretimePolkadot) {
|
|
|
11575
11556
|
return _createClass(CoretimeWestend);
|
|
11576
11557
|
}(CoretimePolkadot);
|
|
11577
11558
|
|
|
11578
|
-
var Crust = /*#__PURE__*/function (_SubstrateChain) {
|
|
11579
|
-
function Crust() {
|
|
11580
|
-
_classCallCheck(this, Crust);
|
|
11581
|
-
return _callSuper(this, Crust, ['Crust', 'crustParachain', 'Polkadot', Version.V3]);
|
|
11582
|
-
}
|
|
11583
|
-
_inherits(Crust, _SubstrateChain);
|
|
11584
|
-
return _createClass(Crust, [{
|
|
11585
|
-
key: "getCurrencySelection",
|
|
11586
|
-
value: function getCurrencySelection(asset) {
|
|
11587
|
-
if (asset.isNative) return 'SelfReserve';
|
|
11588
|
-
assertHasId(asset);
|
|
11589
|
-
return {
|
|
11590
|
-
OtherReserve: BigInt(asset.assetId)
|
|
11591
|
-
};
|
|
11592
|
-
}
|
|
11593
|
-
}, {
|
|
11594
|
-
key: "transferXTokens",
|
|
11595
|
-
value: function transferXTokens$1(input) {
|
|
11596
|
-
var asset = input.asset;
|
|
11597
|
-
var currencySelection = this.getCurrencySelection(asset);
|
|
11598
|
-
return transferXTokens(input, currencySelection);
|
|
11599
|
-
}
|
|
11600
|
-
}, {
|
|
11601
|
-
key: "transferLocalNonNativeAsset",
|
|
11602
|
-
value: function transferLocalNonNativeAsset(options) {
|
|
11603
|
-
var api = options.api,
|
|
11604
|
-
asset = options.assetInfo,
|
|
11605
|
-
recipient = options.recipient,
|
|
11606
|
-
isAmountAll = options.isAmountAll,
|
|
11607
|
-
keepAlive = options.keepAlive;
|
|
11608
|
-
assertHasId(asset);
|
|
11609
|
-
var assetId = BigInt(asset.assetId);
|
|
11610
|
-
var dest = {
|
|
11611
|
-
Id: recipient
|
|
11612
|
-
};
|
|
11613
|
-
if (isAmountAll) {
|
|
11614
|
-
return api.deserializeExtrinsics({
|
|
11615
|
-
module: 'Assets',
|
|
11616
|
-
method: 'transfer_all',
|
|
11617
|
-
params: {
|
|
11618
|
-
id: assetId,
|
|
11619
|
-
dest: dest,
|
|
11620
|
-
keep_alive: keepAlive
|
|
11621
|
-
}
|
|
11622
|
-
});
|
|
11623
|
-
}
|
|
11624
|
-
return api.deserializeExtrinsics({
|
|
11625
|
-
module: 'Assets',
|
|
11626
|
-
method: keepAlive ? 'transfer_keep_alive' : 'transfer',
|
|
11627
|
-
params: {
|
|
11628
|
-
id: assetId,
|
|
11629
|
-
target: dest,
|
|
11630
|
-
amount: asset.amount
|
|
11631
|
-
}
|
|
11632
|
-
});
|
|
11633
|
-
}
|
|
11634
|
-
}]);
|
|
11635
|
-
}(SubstrateChain);
|
|
11636
|
-
|
|
11637
|
-
var CrustShadow = /*#__PURE__*/function (_SubstrateChain) {
|
|
11638
|
-
function CrustShadow() {
|
|
11639
|
-
_classCallCheck(this, CrustShadow);
|
|
11640
|
-
return _callSuper(this, CrustShadow, ['CrustShadow', 'shadow', 'Kusama', Version.V3]);
|
|
11641
|
-
}
|
|
11642
|
-
_inherits(CrustShadow, _SubstrateChain);
|
|
11643
|
-
return _createClass(CrustShadow, [{
|
|
11644
|
-
key: "getCurrencySelection",
|
|
11645
|
-
value: function getCurrencySelection(api, asset) {
|
|
11646
|
-
if (asset.symbol === this.getNativeAssetSymbol(api)) {
|
|
11647
|
-
return 'SelfReserve';
|
|
11648
|
-
}
|
|
11649
|
-
assertHasId(asset);
|
|
11650
|
-
return {
|
|
11651
|
-
OtherReserve: BigInt(asset.assetId)
|
|
11652
|
-
};
|
|
11653
|
-
}
|
|
11654
|
-
}, {
|
|
11655
|
-
key: "transferXTokens",
|
|
11656
|
-
value: function transferXTokens$1(input) {
|
|
11657
|
-
var asset = input.asset,
|
|
11658
|
-
api = input.api;
|
|
11659
|
-
var currencySelection = this.getCurrencySelection(api, asset);
|
|
11660
|
-
return transferXTokens(input, currencySelection);
|
|
11661
|
-
}
|
|
11662
|
-
}, {
|
|
11663
|
-
key: "transferLocalNonNativeAsset",
|
|
11664
|
-
value: function transferLocalNonNativeAsset(options) {
|
|
11665
|
-
return getSubstrateChainImpl('Crust').transferLocalNonNativeAsset(options);
|
|
11666
|
-
}
|
|
11667
|
-
}]);
|
|
11668
|
-
}(SubstrateChain);
|
|
11669
|
-
|
|
11670
11559
|
var Curio = /*#__PURE__*/function (_SubstrateChain) {
|
|
11671
11560
|
function Curio() {
|
|
11672
11561
|
_classCallCheck(this, Curio);
|
|
@@ -12475,6 +12364,14 @@ var Shiden = /*#__PURE__*/function (_Astar) {
|
|
|
12475
12364
|
}(Astar);
|
|
12476
12365
|
|
|
12477
12366
|
var FUNGIBLE_ITEM_ID = 0;
|
|
12367
|
+
var FUNGIBLE_BALANCE_PREFIX = 'b6f8df5e96e2c932e9bd00274d53a26f4ea8ea0c01faa42b6eb344a85c47b387';
|
|
12368
|
+
var FUNGIBLE_TOTAL_SUPPLY_PREFIX = 'b6f8df5e96e2c932e9bd00274d53a26f5994cfda14cd67e1586647d40008abaa';
|
|
12369
|
+
var SUBSTRATE_CROSS_ACCOUNT_PREFIX = '00';
|
|
12370
|
+
var toLeHex = function toLeHex(value, size) {
|
|
12371
|
+
return bytesToHex(numberToBytes(value, {
|
|
12372
|
+
size: size
|
|
12373
|
+
}).reverse());
|
|
12374
|
+
};
|
|
12478
12375
|
var Unique = /*#__PURE__*/function (_SubstrateChain) {
|
|
12479
12376
|
function Unique() {
|
|
12480
12377
|
_classCallCheck(this, Unique);
|
|
@@ -12536,6 +12433,25 @@ var Unique = /*#__PURE__*/function (_SubstrateChain) {
|
|
|
12536
12433
|
}
|
|
12537
12434
|
return getBalanceForeign;
|
|
12538
12435
|
}()
|
|
12436
|
+
}, {
|
|
12437
|
+
key: "mint",
|
|
12438
|
+
value: function mint(api, address, assetInfo, balance) {
|
|
12439
|
+
if (assetInfo.isNative) return _superPropGet(Unique, "mint", this, 3)([api, address, assetInfo, balance]);
|
|
12440
|
+
assertHasId(assetInfo);
|
|
12441
|
+
var collectionId = toLeHex(Number(assetInfo.assetId), 4);
|
|
12442
|
+
var collectionKey = api.xxhashAsHex(hexToBytes(collectionId)).slice(2) + collectionId;
|
|
12443
|
+
var accountKey = blake2128Concat(SUBSTRATE_CROSS_ACCOUNT_PREFIX + bytesToHex(api.accountToUint8a(address)));
|
|
12444
|
+
var value = '0x' + toLeHex(balance + assetInfo.amount, 16);
|
|
12445
|
+
return Promise.resolve({
|
|
12446
|
+
balanceTx: {
|
|
12447
|
+
module: 'System',
|
|
12448
|
+
method: 'set_storage',
|
|
12449
|
+
params: {
|
|
12450
|
+
items: [['0x' + FUNGIBLE_BALANCE_PREFIX + collectionKey + accountKey, value], ['0x' + FUNGIBLE_TOTAL_SUPPLY_PREFIX + collectionKey, value]]
|
|
12451
|
+
}
|
|
12452
|
+
}
|
|
12453
|
+
});
|
|
12454
|
+
}
|
|
12539
12455
|
}]);
|
|
12540
12456
|
}(SubstrateChain);
|
|
12541
12457
|
|
|
@@ -12581,7 +12497,6 @@ var chains = function chains() {
|
|
|
12581
12497
|
Ajuna: new Ajuna(),
|
|
12582
12498
|
Astar: new Astar(),
|
|
12583
12499
|
Unique: new Unique(),
|
|
12584
|
-
Crust: new Crust(),
|
|
12585
12500
|
BifrostPolkadot: new BifrostPolkadot(),
|
|
12586
12501
|
BridgeHubPolkadot: new BridgeHubPolkadot(),
|
|
12587
12502
|
Centrifuge: new Centrifuge(),
|
|
@@ -12608,7 +12523,6 @@ var chains = function chains() {
|
|
|
12608
12523
|
Basilisk: new Basilisk(),
|
|
12609
12524
|
BifrostKusama: new BifrostKusama(),
|
|
12610
12525
|
Curio: new Curio(),
|
|
12611
|
-
CrustShadow: new CrustShadow(),
|
|
12612
12526
|
Karura: new Karura(),
|
|
12613
12527
|
PeopleKusama: new PeopleKusama(),
|
|
12614
12528
|
Shiden: new Shiden(),
|
|
@@ -13049,8 +12963,7 @@ var convertBuilderConfig = function convertBuilderConfig(config) {
|
|
|
13049
12963
|
apiOverrides: filteredApiOverrides
|
|
13050
12964
|
});
|
|
13051
12965
|
}
|
|
13052
|
-
|
|
13053
|
-
if (!isWsUrl) {
|
|
12966
|
+
if (!isUrl(config)) {
|
|
13054
12967
|
throw new UnsupportedOperationError('Swap module does not support API client override');
|
|
13055
12968
|
}
|
|
13056
12969
|
};
|
|
@@ -13483,30 +13396,21 @@ var buildAutoNativeAsset = function buildAutoNativeAsset(entry) {
|
|
|
13483
13396
|
var _requireNativeAssetFi = requireNativeAssetFields(entry),
|
|
13484
13397
|
symbol = _requireNativeAssetFi.symbol,
|
|
13485
13398
|
decimals = _requireNativeAssetFi.decimals;
|
|
13486
|
-
|
|
13399
|
+
if (entry.nativeExistentialDeposit === undefined) {
|
|
13400
|
+
throw new CustomChainInvalidError("Custom chain '".concat(entry.name, "' failed to automatically fetch the native existential deposit. Please declare the native asset with existentialDeposit."));
|
|
13401
|
+
}
|
|
13402
|
+
return {
|
|
13487
13403
|
symbol: symbol,
|
|
13488
13404
|
decimals: decimals,
|
|
13489
13405
|
location: buildNativeLocation(entry.paraId),
|
|
13490
|
-
isNative: true
|
|
13491
|
-
}, entry.nativeExistentialDeposit !== undefined && {
|
|
13406
|
+
isNative: true,
|
|
13492
13407
|
existentialDeposit: entry.nativeExistentialDeposit
|
|
13493
|
-
}
|
|
13408
|
+
};
|
|
13494
13409
|
};
|
|
13495
13410
|
var resolveAssets = function resolveAssets(entry) {
|
|
13496
|
-
|
|
13411
|
+
return entry.assets.some(function (asset) {
|
|
13497
13412
|
return asset.isNative;
|
|
13498
|
-
});
|
|
13499
|
-
if (declaredNativeAsset) {
|
|
13500
|
-
if (declaredNativeAsset.existentialDeposit === undefined && entry.nativeExistentialDeposit) {
|
|
13501
|
-
return entry.assets.map(function (asset) {
|
|
13502
|
-
return asset === declaredNativeAsset ? _objectSpread2(_objectSpread2({}, asset), {}, {
|
|
13503
|
-
existentialDeposit: entry.nativeExistentialDeposit
|
|
13504
|
-
}) : asset;
|
|
13505
|
-
});
|
|
13506
|
-
}
|
|
13507
|
-
return entry.assets;
|
|
13508
|
-
}
|
|
13509
|
-
return [buildAutoNativeAsset(entry)].concat(_toConsumableArray(entry.assets));
|
|
13413
|
+
}) ? entry.assets : [buildAutoNativeAsset(entry)].concat(_toConsumableArray(entry.assets));
|
|
13510
13414
|
};
|
|
13511
13415
|
var buildCustomChainAssetsInfo = function buildCustomChainAssetsInfo(entry) {
|
|
13512
13416
|
var _entry$ss58Prefix;
|
|
@@ -13735,9 +13639,9 @@ var PolkadotApi = /*#__PURE__*/function () {
|
|
|
13735
13639
|
return hasXcmPaymentApiSupportImpl(chain, this._customCtx);
|
|
13736
13640
|
}
|
|
13737
13641
|
}, {
|
|
13738
|
-
key: "
|
|
13739
|
-
value: function
|
|
13740
|
-
return
|
|
13642
|
+
key: "getExistentialDeposit",
|
|
13643
|
+
value: function getExistentialDeposit(chain, currency) {
|
|
13644
|
+
return getExistentialDepositImpl(chain, currency, this._customCtx);
|
|
13741
13645
|
}
|
|
13742
13646
|
}, {
|
|
13743
13647
|
key: "hasPallet",
|
|
@@ -14152,4 +14056,4 @@ var createClientCache = function createClientCache(maxSize, pingClient, onEvicti
|
|
|
14152
14056
|
};
|
|
14153
14057
|
};
|
|
14154
14058
|
|
|
14155
|
-
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, CustomChainConflictError, CustomChainInvalidError, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, aggregateHopFees, applyDecimalAbstraction, assertAddressIsString, assertCurrencyCore, assertEvmAddress, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2b256, blake2b512, buildCustomChainAssetsInfo, buildCustomChainConfig, buildDestInfo, buildDryRunError, buildErc20StorageMint, buildHopInfo, buildOriginInfo, calcPreviewMintAmount, compareAddresses, compareLocationOrder, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAllCountedFilter, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createBridgedXcmPrefix, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getAssetReserveChainImpl, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainConfigImpl, getChainLocation, getChainProviders, getChainProvidersImpl, getChainVersion, getDryRunError, getErrorInstruction, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getParaIdImpl, getRelayChainOf, getRelayChainOfImpl, getRelayChainSymbolOf, getSwapExtensionOrThrow, getTChain, getTSubstrateChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isExchange, isNativeAssetTeleport, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, localizeLocationImpl, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeCustomChains, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickOtherMintPallet, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateFeeAssetSupport, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
|
14059
|
+
export { API_TYPES, AmountTooLowError, ApiNotInitializedError, BaseAssetsPallet, BatchMode, BatchValidationError, BridgeHaltedError, Builder, CustomChainConflictError, CustomChainInvalidError, DEFAULT_TTL_MS, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETH_MAINNET_CHAIN_ID, ETH_TESTNET_CHAIN_ID, EXCHANGE_CHAINS, EXTENSION_MS, ExtensionNotInstalledError, FeatureTemporarilyDisabledError, GeneralBuilder, InvalidAddressError, MAX_CLIENTS, MissingChainApiError, MissingParameterError, NoXCMSupportImplementedError, NumberFormatError, OverrideConflictError, PolkadotApi, PolkadotXcmError, PolkadotXcmExecutionError, ProviderUnavailableError, RELAY_LOCATION, RoutingResolutionError, RuntimeApiError, RuntimeApiUnavailableError, ScenarioNotSupportedError, SubmitTransactionError, TRANSACT_ORIGINS, TX_CLIENT_TIMEOUT_MS, TypeAndThenUnavailableError, UnableToComputeError, UnsupportedOperationError, ValidationError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, aggregateHopFees, applyDecimalAbstraction, assertAddressIsString, assertCurrencyCore, assertEvmAddress, assertExtensionInstalled, assertHasId, assertNotEvmTransfer, assertSender, assertSenderSource, assertSubstrateOrigin, assertSwapSupport, assertToIsString, blake2128Concat, blake2b256, blake2b512, buildCustomChainAssetsInfo, buildCustomChainConfig, buildDestInfo, buildDryRunError, buildErc20StorageMint, buildHopInfo, buildOriginInfo, calcPreviewMintAmount, compareAddresses, compareLocationOrder, computeOverridenAmount, constructTypeAndThenCall, convertBuilderConfig, convertSs58, createAllCountedFilter, createAsset, createAssetId, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createBridgedXcmPrefix, createChainClient, createClientCache, createClientPoolHelpers, createCustomXcmOnDest, createDestination, createDirectExecuteXcm, createEthereumBridgeInstructions, createExecuteCall, createExecuteExchangeXcm, createSwapBuilder, createTransfer, createTransferOrSwap, createTransferOrSwapAll, createTxOverrideAmount, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createVersionedDestination, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, executeWithSwap, formatAssetIdToERC20, formatUnits, generateMessageId, getAssetBalanceInternal, getAssetReserveChain, getAssetReserveChainImpl, getBalance, getBalanceInternal, getBridgeStatus, getChain, getChainConfig, getChainConfigImpl, getChainLocation, getChainProviders, getChainProvidersImpl, getChainVersion, getDryRunError, getErrorInstruction, getEthErc20Balance, getEvmExtensionOrThrow, getEvmPrivateKeyHex, getEvmSnowbridgeExtensionOrThrow, getLocalTransferAmount, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginXcmFee, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getParaIdImpl, getRelayChainOf, getRelayChainOfImpl, getRelayChainSymbolOf, getSwapExtensionOrThrow, getTChain, getTSubstrateChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, isExchange, isNativeAssetTeleport, isSenderSigner, isViemSigner, keyFromWs, localizeLocation, localizeLocationImpl, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, normalizeCustomChains, normalizeExchange, overrideTxAmount, padFee, padValueBy, parseUnits, pickCompatibleXcmVersion, pickOtherMintPallet, pickRouterCompatibleXcmVersion, registerEvmExtension, registerEvmSnowbridgeExtension, registerSwapExtension, resolveAssetCount, resolveDestChain, resolveModuleError, resolveParaId, resolveTransferParams, reverseTransformLocation, selectXcmVersion, sortAssets, throwUnsupportedCurrency, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, validateDestinationAddress, validateFeeAssetSupport, validateTransact, verifyEdOnDestination, wrapTxBypass };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.4.2",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@noble/hashes": "^2.
|
|
26
|
-
"@paraspell/assets": "14.
|
|
27
|
-
"@paraspell/pallets": "14.
|
|
28
|
-
"@paraspell/sdk-common": "14.
|
|
29
|
-
"@scure/base": "^2.
|
|
30
|
-
"viem": "^2.
|
|
25
|
+
"@noble/hashes": "^2.4.0",
|
|
26
|
+
"@paraspell/assets": "14.4.2",
|
|
27
|
+
"@paraspell/pallets": "14.4.2",
|
|
28
|
+
"@paraspell/sdk-common": "14.4.2",
|
|
29
|
+
"@scure/base": "^2.4.0",
|
|
30
|
+
"viem": "^2.57.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-syntax-import-attributes": "^7.29.7",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"@rollup/plugin-babel": "^7.1.0",
|
|
37
37
|
"@rollup/plugin-json": "^6.1.0",
|
|
38
38
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
39
|
-
"@vitest/coverage-v8": "^
|
|
40
|
-
"axios": "^1.
|
|
41
|
-
"dotenv": "^
|
|
42
|
-
"rollup": "^4.
|
|
39
|
+
"@vitest/coverage-v8": "^5.0.2",
|
|
40
|
+
"axios": "^1.20.0",
|
|
41
|
+
"dotenv": "^18.0.4",
|
|
42
|
+
"rollup": "^4.63.5",
|
|
43
43
|
"rollup-plugin-dts": "^6.5.1",
|
|
44
44
|
"ts-morph": "^28.0.0",
|
|
45
|
-
"tsx": "^4.23.
|
|
45
|
+
"tsx": "^4.23.15"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"compile": "tsc --noEmit",
|