@paraspell/sdk-core 11.3.1 → 11.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3694 -3472
- package/dist/index.d.ts +41 -8
- package/dist/index.mjs +3694 -3475
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -300,12 +300,19 @@ type TGetBalanceForeignOptionsBase = {
|
|
|
300
300
|
* The chain on which to query the balance.
|
|
301
301
|
*/
|
|
302
302
|
chain: TChain;
|
|
303
|
+
};
|
|
304
|
+
type TGetBalanceForeignOptions<TApi, TRes> = WithApi<TGetBalanceForeignOptionsBase & {
|
|
303
305
|
/**
|
|
304
306
|
* The currency to query.
|
|
305
307
|
*/
|
|
306
308
|
currency: TCurrencyCore;
|
|
307
|
-
}
|
|
308
|
-
type
|
|
309
|
+
}, TApi, TRes>;
|
|
310
|
+
type TGetBalanceForeignByAssetOptions<TApi, TRes> = WithApi<TGetBalanceForeignOptionsBase & {
|
|
311
|
+
/**
|
|
312
|
+
* The asset to query balance for.
|
|
313
|
+
*/
|
|
314
|
+
asset: TAssetInfo;
|
|
315
|
+
}, TApi, TRes>;
|
|
309
316
|
/**
|
|
310
317
|
* Retrieves the asset balance for a given account on a specified chain.
|
|
311
318
|
*/
|
|
@@ -505,6 +512,9 @@ type TBatchOptions = {
|
|
|
505
512
|
*/
|
|
506
513
|
mode: BatchMode;
|
|
507
514
|
};
|
|
515
|
+
type TDryRunPreviewOptions = {
|
|
516
|
+
mintFeeAssets?: boolean;
|
|
517
|
+
};
|
|
508
518
|
type TBuilderOptions<TApi> = TApi | TBuilderConfig<TApi>;
|
|
509
519
|
type TBuilderConfig<TApi> = {
|
|
510
520
|
apiOverrides?: Partial<Record<TChain, TApi>>;
|
|
@@ -584,6 +594,7 @@ type TDryRunBaseOptions<TRes> = {
|
|
|
584
594
|
exchangeChain: TParachain;
|
|
585
595
|
};
|
|
586
596
|
useRootOrigin?: boolean;
|
|
597
|
+
bypassOptions?: TBypassOptions;
|
|
587
598
|
};
|
|
588
599
|
type TDryRunOptions<TApi, TRes> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes>;
|
|
589
600
|
type TDryRunCallBaseOptions<TRes> = {
|
|
@@ -604,8 +615,10 @@ type TDryRunCallBaseOptions<TRes> = {
|
|
|
604
615
|
*/
|
|
605
616
|
useRootOrigin?: boolean;
|
|
606
617
|
asset: WithAmount<TAssetInfo>;
|
|
618
|
+
bypassOptions?: TBypassOptions;
|
|
607
619
|
feeAsset?: TAssetInfo;
|
|
608
620
|
};
|
|
621
|
+
type TDryRunBypassOptions<TApi, TRes> = WithApi<Omit<TDryRunCallBaseOptions<TRes>, 'useRootOrigin'>, TApi, TRes>;
|
|
609
622
|
type TDryRunCallOptions<TApi, TRes> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes>;
|
|
610
623
|
type TDryRunXcmBaseOptions = {
|
|
611
624
|
originLocation: any;
|
|
@@ -697,6 +710,10 @@ type HopTraversalResult<THopResult> = {
|
|
|
697
710
|
destination?: THopResult;
|
|
698
711
|
lastProcessedChain?: TSubstrateChain;
|
|
699
712
|
};
|
|
713
|
+
type TBypassOptions = {
|
|
714
|
+
mintFeeAssets?: boolean;
|
|
715
|
+
sentAssetMintMode?: 'preview' | 'bypass';
|
|
716
|
+
};
|
|
700
717
|
declare enum XTokensError {
|
|
701
718
|
AssetHasNoReserve = "AssetHasNoReserve",
|
|
702
719
|
NotCrossChainTransfer = "NotCrossChainTransfer",
|
|
@@ -744,13 +761,21 @@ declare enum PolkadotXcmError {
|
|
|
744
761
|
InvalidAssetUnknownReserve = "InvalidAssetUnknownReserve",
|
|
745
762
|
InvalidAssetUnsupportedReserve = "InvalidAssetUnsupportedReserve",
|
|
746
763
|
TooManyReserves = "TooManyReserves",
|
|
747
|
-
LocalExecutionIncomplete = "LocalExecutionIncomplete"
|
|
764
|
+
LocalExecutionIncomplete = "LocalExecutionIncomplete",
|
|
765
|
+
TooManyAuthorizedAliases = "TooManyAuthorizedAliases",
|
|
766
|
+
ExpiresInPast = "ExpiresInPast",
|
|
767
|
+
AliasNotFound = "AliasNotFound",
|
|
768
|
+
LocalExecutionIncompleteWithError = "LocalExecutionIncompleteWithError"
|
|
748
769
|
}
|
|
749
770
|
type TModuleError = {
|
|
750
771
|
index: string;
|
|
751
772
|
error: string;
|
|
752
773
|
};
|
|
753
774
|
|
|
775
|
+
declare class AmountTooLowError extends Error {
|
|
776
|
+
constructor(message?: string);
|
|
777
|
+
}
|
|
778
|
+
|
|
754
779
|
/**
|
|
755
780
|
* Error thrown when the Ethereum bridge is halted.
|
|
756
781
|
*/
|
|
@@ -1166,6 +1191,7 @@ declare class GeneralBuilder<TApi, TRes, T extends Partial<TSendBaseOptions> = o
|
|
|
1166
1191
|
*/
|
|
1167
1192
|
build(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>): Promise<TRes>;
|
|
1168
1193
|
dryRun(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TDryRunResult>;
|
|
1194
|
+
dryRunPreview(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, options?: TDryRunPreviewOptions): Promise<TDryRunResult>;
|
|
1169
1195
|
/**
|
|
1170
1196
|
* Returns the XCM fee for the transfer using dryRun or paymentInfo function.
|
|
1171
1197
|
*
|
|
@@ -1443,6 +1469,9 @@ declare abstract class Parachain<TApi, TRes> {
|
|
|
1443
1469
|
get version(): Version;
|
|
1444
1470
|
canUseXTokens(options: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1445
1471
|
transfer(sendOptions: TSendInternalOptions<TApi, TRes>): Promise<TRes>;
|
|
1472
|
+
throwIfTempDisabled(options: TSendInternalOptions<TApi, TRes>, destChain?: TChain): void;
|
|
1473
|
+
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1474
|
+
isReceivingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1446
1475
|
shouldUseNativeAssetTeleport({ assetInfo: asset, to }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1447
1476
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
1448
1477
|
transferRelayToPara(options: TRelayToParaOptions<TApi, TRes>): Promise<TSerializedApiCall>;
|
|
@@ -1468,6 +1497,8 @@ declare class Ajuna<TApi, TRes> extends Parachain<TApi, TRes> implements IXToken
|
|
|
1468
1497
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1469
1498
|
canUseXTokens({ assetInfo, to: destination }: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1470
1499
|
transferRelayToPara(): Promise<TSerializedApiCall>;
|
|
1500
|
+
isSendingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1501
|
+
isReceivingTempDisabled(_options: TSendInternalOptions<TApi, TRes>): boolean;
|
|
1471
1502
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1472
1503
|
}
|
|
1473
1504
|
|
|
@@ -2034,11 +2065,11 @@ type TSetBalanceRes = {
|
|
|
2034
2065
|
balanceTx: TSerializedApiCall;
|
|
2035
2066
|
};
|
|
2036
2067
|
interface IAssetsPallet {
|
|
2037
|
-
|
|
2068
|
+
mint<TApi, TRes>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain, api: IPolkadotApi<TApi, TRes>): Promise<TSetBalanceRes>;
|
|
2038
2069
|
}
|
|
2039
2070
|
|
|
2040
2071
|
declare class AssetsPallet implements IAssetsPallet {
|
|
2041
|
-
|
|
2072
|
+
mint(address: string, asset: WithAmount<TAssetInfo>, _balance: bigint, chain: TSubstrateChain): Promise<TSetBalanceRes>;
|
|
2042
2073
|
}
|
|
2043
2074
|
|
|
2044
2075
|
declare const getAssetBalanceInternal: <TApi, TRes>({ address, chain, currency, api }: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
@@ -2069,7 +2100,9 @@ declare const addEthereumBridgeFees: <TApi, TRes, TResult extends {
|
|
|
2069
2100
|
fee?: bigint;
|
|
2070
2101
|
}>(api: IPolkadotApi<TApi, TRes>, bridgeHubResult: TResult | undefined, destination: TChain, assetHubChain: TSubstrateChain) => Promise<TResult | undefined>;
|
|
2071
2102
|
|
|
2072
|
-
declare const
|
|
2103
|
+
declare const getCurrencySelection: (asset: TAssetInfo) => TCurrencyCore;
|
|
2104
|
+
declare const calcPreviewMintAmount: (balance: bigint, desired: bigint) => bigint | null;
|
|
2105
|
+
declare const wrapTxBypass: <TApi, TRes>(dryRunOptions: TDryRunBypassOptions<TApi, TRes>, options?: TBypassOptions) => Promise<TRes>;
|
|
2073
2106
|
|
|
2074
2107
|
declare const getParaEthTransferFees: <TApi, TRes>(ahApi: IPolkadotApi<TApi, TRes>) => Promise<[bigint, bigint]>;
|
|
2075
2108
|
|
|
@@ -2207,5 +2240,5 @@ declare const handleToAhTeleport: <TApi, TRes>(origin: TParachain, input: TPolka
|
|
|
2207
2240
|
|
|
2208
2241
|
declare const validateAddress: (address: TAddress, chain: TChain, isDestination?: boolean) => void;
|
|
2209
2242
|
|
|
2210
|
-
export { AssetClaimBuilder, AssetsPallet, BatchMode, BridgeHaltedError, Builder, ChainNotSupportedError, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleChainsError, InvalidAddressError, InvalidParameterError, MissingChainApiError, NoXCMSupportImplementedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertToIsString, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, padFee, padFeeBy, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
|
|
2211
|
-
export type { HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TAttemptDryRunFeeOptions, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TBuilderConfig, TBuilderOptions, TChainConfig, TChainConfigMap, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTypeAndThenCallContext, TTypeAndThenFees, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase$1 as TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|
|
2243
|
+
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, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, abstractDecimals, addEthereumBridgeFees, addXcmVersionHeader, applyDecimalAbstraction, assertAddressIsString, assertHasId, assertHasLocation, assertIsForeign, assertToIsString, blake2b256, blake2b512, calcPreviewMintAmount, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createAsset, createAssetsFilter, createBaseExecuteXcm, createBeneficiaryLocXTokens, createBeneficiaryLocation, createChainClient, createDirectExecuteXcm, createExecuteCall, createExecuteExchangeXcm, createTypeAndThenCall, createVersionedAssets, createX1Payload, deriveAccountId, dryRun, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getAssetReserveChain, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getChain, getChainConfig, getChainLocation, getChainProviders, getChainVersion, getCurrencySelection, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getOriginXcmFeeInternal, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, padFee, padFeeBy, resolveDestChain, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
|
|
2244
|
+
export type { HopProcessParams, HopTraversalConfig, HopTraversalResult, IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimInternalOptions, TAssetClaimOptions, TAssetClaimOptionsBase, TAttemptDryRunFeeOptions, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TBuilderConfig, TBuilderOptions, TBypassOptions, TChainConfig, TChainConfigMap, TChainWithApi, TConditionalXcmFeeDetail, TConditionalXcmFeeHopInfo, TCreateBaseSwapXcmOptions, TCreateBaseTransferXcmOptions, TCreateBeneficiaryOptions, TCreateBeneficiaryXTokensOptions, TCreateSwapXcmInternalOptions, TCreateSwapXcmOptions, TCreateTransferXcmOptions, TDestWeight, TDestXcmFeeDetail, TDestination, TDryRunBaseOptions, TDryRunBypassOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunChainFailure, TDryRunChainResult, TDryRunChainSuccess, TDryRunOptions, TDryRunPreviewOptions, TDryRunResBase, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmChainFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignByAssetOptions, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestChainBaseOptions, TGetFeeForDestChainOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THopInfo, THopTransferInfo, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TSwapFeeEstimates, TTransferFeeEstimates, TTransferInfo, TTransferLocalOptions, TTypeAndThenCallContext, TTypeAndThenFees, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase$1 as TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailError, TXcmFeeDetailSuccess, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|