@paraspell/sdk-core 11.14.0 → 11.14.1
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 +374 -277
- package/dist/index.d.ts +21 -7
- package/dist/index.mjs +373 -279
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -826,6 +826,7 @@ type TGetXcmFeeBaseOptions<TRes, TDisableFallback extends boolean = boolean> = {
|
|
|
826
826
|
feeAsset?: TCurrencyInput;
|
|
827
827
|
disableFallback: TDisableFallback;
|
|
828
828
|
swapConfig?: TXcmFeeSwapConfig;
|
|
829
|
+
skipReverseFeeCalculation?: boolean;
|
|
829
830
|
};
|
|
830
831
|
type TGetXcmFeeOptions<TApi, TRes, TDisableFallback extends boolean = boolean> = WithApi<TGetXcmFeeBaseOptions<TRes, TDisableFallback>, TApi, TRes>;
|
|
831
832
|
type TGetXcmFeeInternalOptions<TApi, TRes, TDisableFallback extends boolean = boolean> = Omit<TGetXcmFeeOptions<TApi, TRes, TDisableFallback>, 'buildTx'> & {
|
|
@@ -866,6 +867,7 @@ type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
|
866
867
|
disableFallback: boolean;
|
|
867
868
|
hasPassedExchange?: boolean;
|
|
868
869
|
swapConfig?: TXcmFeeSwapConfig;
|
|
870
|
+
skipReverseFeeCalculation?: boolean;
|
|
869
871
|
};
|
|
870
872
|
type TGetFeeForDestChainOptions<TApi, TRes> = WithApi<TGetFeeForDestChainBaseOptions<TRes>, TApi, TRes>;
|
|
871
873
|
type TGetReverseTxFeeOptions<TApi, TRes> = Omit<TGetFeeForDestChainOptions<TApi, TRes>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee' | 'prevChain'> & {
|
|
@@ -1484,12 +1486,12 @@ type TTypeAndThenCallContext<TApi, TRes> = {
|
|
|
1484
1486
|
dest: TChainWithApi<TApi, TRes>;
|
|
1485
1487
|
reserve: TChainWithApi<TApi, TRes, TSubstrateChain>;
|
|
1486
1488
|
isSubBridge: boolean;
|
|
1489
|
+
isRelayAsset: boolean;
|
|
1487
1490
|
assetInfo: WithAmount<TAssetWithLocation>;
|
|
1488
1491
|
options: TPolkadotXCMTransferOptions<TApi, TRes>;
|
|
1489
1492
|
};
|
|
1490
1493
|
type TTypeAndThenFees = {
|
|
1491
|
-
|
|
1492
|
-
refundFee: bigint;
|
|
1494
|
+
hopFees: bigint;
|
|
1493
1495
|
destFee: bigint;
|
|
1494
1496
|
};
|
|
1495
1497
|
|
|
@@ -1597,6 +1599,7 @@ declare class Acala<TApi, TRes> extends Parachain<TApi, TRes> implements IXToken
|
|
|
1597
1599
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1598
1600
|
getCurrencySelection(asset: TAssetInfo): TForeignOrTokenAsset;
|
|
1599
1601
|
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1602
|
+
transferRelayToPara(): Promise<TSerializedApiCall>;
|
|
1600
1603
|
transferLocalNativeAsset(options: TTransferLocalOptions<TApi, TRes>): Promise<TRes>;
|
|
1601
1604
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1602
1605
|
}
|
|
@@ -1659,6 +1662,7 @@ declare class Astar<TApi, TRes> extends Parachain<TApi, TRes> implements IPolkad
|
|
|
1659
1662
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1660
1663
|
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
1661
1664
|
canUseXTokens({ assetInfo }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1665
|
+
transferRelayToPara(): Promise<TSerializedApiCall>;
|
|
1662
1666
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1663
1667
|
}
|
|
1664
1668
|
|
|
@@ -2049,6 +2053,7 @@ declare class Shiden<TApi, TRes> extends Parachain<TApi, TRes> implements IPolka
|
|
|
2049
2053
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
2050
2054
|
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
2051
2055
|
canUseXTokens({ assetInfo }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
2056
|
+
transferRelayToPara(): Promise<TSerializedApiCall>;
|
|
2052
2057
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
2053
2058
|
}
|
|
2054
2059
|
|
|
@@ -2220,11 +2225,12 @@ declare const getOriginXcmFeeInternal: <TApi, TRes>({ api, tx, origin, destinati
|
|
|
2220
2225
|
destParaId?: number;
|
|
2221
2226
|
}>;
|
|
2222
2227
|
|
|
2228
|
+
declare const getXcmFeeInternal: <TApi, TRes, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2223
2229
|
declare const getXcmFee: <TApi, TRes, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2224
2230
|
|
|
2225
2231
|
declare const getXcmFeeEstimate: <TApi, TRes>(options: TGetXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateResult>;
|
|
2226
2232
|
|
|
2227
|
-
declare const
|
|
2233
|
+
declare const getXcmFeeOnce: <TApi, TRes, TDisableFallback extends boolean>({ api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback, swapConfig, useRootOrigin, skipReverseFeeCalculation }: TGetXcmFeeInternalOptions<TApi, TRes, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2228
2234
|
|
|
2229
2235
|
declare const getBridgeStatus: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>) => Promise<TBridgeStatus>;
|
|
2230
2236
|
|
|
@@ -2240,11 +2246,19 @@ declare const getTransferableAmount: <TApi, TRes>(options: TGetTransferableAmoun
|
|
|
2240
2246
|
|
|
2241
2247
|
declare const transferRelayToPara: <TApi, TRes>(options: TRelayToParaOptions<TApi, TRes>) => Promise<TRes>;
|
|
2242
2248
|
|
|
2249
|
+
declare const constructTypeAndThenCall: <TApi, TRes>(context: TTypeAndThenCallContext<TApi, TRes>, fees?: TTypeAndThenFees | null) => TSerializedApiCall;
|
|
2243
2250
|
/**
|
|
2244
2251
|
* Creates a type and then call for transferring assets using XCM. Works only for DOT and snowbridge assets so far.
|
|
2245
2252
|
*/
|
|
2246
2253
|
declare const createTypeAndThenCall: <TApi, TRes>(chain: TSubstrateChain, options: TPolkadotXCMTransferOptions<TApi, TRes>, overrideReserve?: TSubstrateChain) => Promise<TSerializedApiCall>;
|
|
2247
2254
|
|
|
2255
|
+
/**
|
|
2256
|
+
* Creates a type-and-then call but auto-selects the asset reserve between AssetHub and the Relay chain
|
|
2257
|
+
* by dry-running both variants and preferring the one that succeeds. If both fail, returns the
|
|
2258
|
+
* AssetHub variant. Supports only relaychain assets.
|
|
2259
|
+
*/
|
|
2260
|
+
declare const createTypeThenAutoReserve: <TApi, TRes>(chain: TSubstrateChain, options: TPolkadotXCMTransferOptions<TApi, TRes>) => Promise<TSerializedApiCall>;
|
|
2261
|
+
|
|
2248
2262
|
declare const validateCurrency: (currency: TCurrencyInput, feeAsset?: TCurrencyInput) => void;
|
|
2249
2263
|
declare const validateDestination: (origin: TSubstrateChain, destination: TDestination) => void;
|
|
2250
2264
|
declare const validateAssetSpecifiers: (assetCheckEnabled: boolean, currency: TCurrencyInput) => void;
|
|
@@ -2263,7 +2277,7 @@ declare const assertIsForeign: (asset: TAssetInfo) => asserts asset is TForeignA
|
|
|
2263
2277
|
declare const createAsset: (version: Version, amount: bigint, location: TLocation) => TAsset;
|
|
2264
2278
|
declare const createVersionedAssets: (version: Version, amount: bigint, location: TLocation) => OneKey<Version, TAsset[]>;
|
|
2265
2279
|
|
|
2266
|
-
declare const getCurrencySelection: (asset: TAssetInfo) => TCurrencyCore;
|
|
2280
|
+
declare const getCurrencySelection: (chain: TSubstrateChain, asset: TAssetInfo) => TCurrencyCore;
|
|
2267
2281
|
|
|
2268
2282
|
declare const maybeOverrideAssets: (version: Version, amount: bigint, assets: TAsset[], overriddenCurrency?: TLocation | TAsset[]) => TAsset[];
|
|
2269
2283
|
declare const maybeOverrideAsset: (version: Version, amount: bigint, asset: TAsset, overriddenCurrency?: TLocation | TAsset[]) => TAsset;
|
|
@@ -2276,6 +2290,8 @@ declare const createTx: <TApi, TRes>(options: TCreateTxsOptions<TApi, TRes>, bui
|
|
|
2276
2290
|
|
|
2277
2291
|
declare const isConfig: <TApi>(value: any) => value is TBuilderConfig<TApi>;
|
|
2278
2292
|
|
|
2293
|
+
declare const getAssetReserveChain: (chain: TSubstrateChain, assetLocation: TLocation) => TSubstrateChain;
|
|
2294
|
+
|
|
2279
2295
|
declare const getChainVersion: <TApi, TRes>(chain: TChain) => Version;
|
|
2280
2296
|
|
|
2281
2297
|
/**
|
|
@@ -2353,8 +2369,6 @@ declare const createExecuteExchangeXcm: <TApi, TRes>(input: TPolkadotXCMTransfer
|
|
|
2353
2369
|
|
|
2354
2370
|
declare const createDirectExecuteXcm: <TApi, TRes>(options: TCreateTransferXcmOptions<TApi, TRes>) => OneKey<_paraspell_sdk_common.Version, unknown[]>;
|
|
2355
2371
|
|
|
2356
|
-
declare const getAssetReserveChain: (chain: TSubstrateChain, assetLocation: TLocation) => TSubstrateChain;
|
|
2357
|
-
|
|
2358
2372
|
declare const handleExecuteTransfer: <TApi, TRes>(chain: TParachain, options: TPolkadotXCMTransferOptions<TApi, TRes>) => Promise<TSerializedApiCall>;
|
|
2359
2373
|
|
|
2360
2374
|
declare const handleSwapExecuteTransfer: <TApi, TRes>(options: TCreateSwapXcmOptions<TApi, TRes>) => Promise<TRes>;
|
|
@@ -2366,5 +2380,5 @@ declare const formatUnits: typeof formatUnits$1;
|
|
|
2366
2380
|
|
|
2367
2381
|
declare const validateAddress: (address: TAddress, chain: TChain, isDestination?: boolean) => void;
|
|
2368
2382
|
|
|
2369
|
-
export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, PolkadotXcmExecutionError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
|
2383
|
+
export { AmountTooLowError, AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, PolkadotXcmExecutionError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertSenderAddress, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, computeOverridenAmount, constructTypeAndThenCall, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTx, createTypeAndThenCall, createTypeThenAutoReserve, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunInternal, dryRunOrigin, encodeSs58, formatUnits, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getFailureInfo, getMinTransferableAmount, getMinTransferableAmountInternal, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, getXcmFeeInternal, getXcmFeeOnce, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, normalizeAmount, overrideTxAmount, padFee, padValueBy, parseUnits, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, validateAssetSpecifiers, validateCurrency, validateDestination, verifyEdOnDestination, wrapTxBypass };
|
|
2370
2384
|
export type { BuildHopInfoOptions, HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TBatchOptions, TBatchedSendOptions, TBifrostToken, TBridgeStatus, TBuildDestInfoOptions, TBuildInternalRes, TBuilderConfig, TBuilderOptions, TBypassOptions, TChainConfig, TChainConfigMap, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TCreateTxsOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunError, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignByAssetOptions, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMinTransferableAmountOptions, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeInternalOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeInternalOptions, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TResolveHopParams, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapConfig, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTxFactory, TTypeAndThenCallContext, TTypeAndThenFees, TUrl, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmFeeSwapConfig, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|