@paraspell/sdk-core 11.1.1 → 11.2.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 +474 -34
- package/dist/index.d.ts +39 -12
- package/dist/index.mjs +475 -38
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -179,7 +179,7 @@ type TRelayToParaOverrides = {
|
|
|
179
179
|
*/
|
|
180
180
|
type TRelayToParaOptions<TApi, TRes> = WithApi<TRelayToParaBaseOptions, TApi, TRes>;
|
|
181
181
|
type TSerializedApiCall = {
|
|
182
|
-
module: TPallet
|
|
182
|
+
module: TPallet;
|
|
183
183
|
method: string;
|
|
184
184
|
parameters: Record<string, unknown>;
|
|
185
185
|
};
|
|
@@ -844,6 +844,11 @@ type TDryRunCallBaseOptions<TRes> = {
|
|
|
844
844
|
* The address to dry-run with
|
|
845
845
|
*/
|
|
846
846
|
address: string;
|
|
847
|
+
/**
|
|
848
|
+
* Whether to use the root origin
|
|
849
|
+
*/
|
|
850
|
+
useRootOrigin?: boolean;
|
|
851
|
+
asset: WithAmount<TAssetInfo>;
|
|
847
852
|
feeAsset?: TAssetInfo;
|
|
848
853
|
};
|
|
849
854
|
type TDryRunCallOptions<TApi, TRes> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes>;
|
|
@@ -1251,6 +1256,7 @@ type TGetOriginXcmFeeBaseOptions<TRes> = {
|
|
|
1251
1256
|
currency: WithComplexAmount<TCurrencyCore>;
|
|
1252
1257
|
feeAsset?: TCurrencyInput;
|
|
1253
1258
|
disableFallback: boolean;
|
|
1259
|
+
useRootOrigin?: boolean;
|
|
1254
1260
|
};
|
|
1255
1261
|
type TGetOriginXcmFeeOptions<TApi, TRes> = WithApi<TGetOriginXcmFeeBaseOptions<TRes>, TApi, TRes>;
|
|
1256
1262
|
type TAttemptDryRunFeeOptions<TApi, TRes> = Omit<TGetOriginXcmFeeOptions<TApi, TRes>, 'tx'> & {
|
|
@@ -1298,6 +1304,15 @@ type TXcmFeeDetail = {
|
|
|
1298
1304
|
sufficient?: boolean;
|
|
1299
1305
|
dryRunError: string;
|
|
1300
1306
|
};
|
|
1307
|
+
type TXcmFeeHopResult = {
|
|
1308
|
+
fee?: bigint;
|
|
1309
|
+
feeType?: TFeeType;
|
|
1310
|
+
sufficient?: boolean;
|
|
1311
|
+
dryRunError?: string;
|
|
1312
|
+
forwardedXcms?: any;
|
|
1313
|
+
destParaId?: number;
|
|
1314
|
+
currency?: string;
|
|
1315
|
+
};
|
|
1301
1316
|
type TConditionalXcmFeeDetail<TDisableFallback extends boolean> = TDisableFallback extends false ? TXcmFeeDetailWithFallback : TXcmFeeDetail;
|
|
1302
1317
|
type TDestXcmFeeDetail<TDisableFallback extends boolean> = Omit<TConditionalXcmFeeDetail<TDisableFallback>, 'currency'> & {
|
|
1303
1318
|
forwardedXcms?: any;
|
|
@@ -1340,6 +1355,7 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
1340
1355
|
accountToUint8a(address: string): Uint8Array;
|
|
1341
1356
|
callTxMethod(serializedCall: TSerializedApiCall): TRes;
|
|
1342
1357
|
callBatchMethod(calls: TRes[], mode: BatchMode): TRes;
|
|
1358
|
+
callDispatchAsMethod(call: TRes, address: string): TRes;
|
|
1343
1359
|
objectToHex(obj: unknown, typeName: string): Promise<string>;
|
|
1344
1360
|
hexToUint8a(hex: string): Uint8Array;
|
|
1345
1361
|
stringToUint8a(str: string): Uint8Array;
|
|
@@ -1348,6 +1364,7 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
1348
1364
|
quoteAhPrice(fromMl: TLocation, toMl: TLocation, amountIn: bigint, includeFee?: boolean): Promise<bigint | undefined>;
|
|
1349
1365
|
getXcmWeight(xcm: any): Promise<TWeight>;
|
|
1350
1366
|
getXcmPaymentApiFee(chain: TSubstrateChain, xcm: any, asset: TAssetInfo, transformXcm: boolean): Promise<bigint>;
|
|
1367
|
+
getEvmStorage(contract: string, slot: string): Promise<string>;
|
|
1351
1368
|
getBalanceNative(address: string): Promise<bigint>;
|
|
1352
1369
|
getBalanceNativeAcala(address: string, symbol: string): Promise<bigint>;
|
|
1353
1370
|
getBalanceForeignPolkadotXcm(address: string, id?: string): Promise<bigint>;
|
|
@@ -1993,6 +2010,18 @@ declare const DRY_RUN_CLIENT_TIMEOUT_MS: number;
|
|
|
1993
2010
|
|
|
1994
2011
|
declare const claimAssets: <TApi, TRes>(options: TAssetClaimOptions<TApi, TRes>) => Promise<TRes>;
|
|
1995
2012
|
|
|
2013
|
+
type TSetBalanceRes = {
|
|
2014
|
+
assetStatusTx?: TSerializedApiCall;
|
|
2015
|
+
balanceTx: TSerializedApiCall;
|
|
2016
|
+
};
|
|
2017
|
+
interface IAssetsPallet {
|
|
2018
|
+
setBalance<TApi, TRes>(address: string, assetInfo: WithAmount<TAssetInfo>, chain: TSubstrateChain, api: IPolkadotApi<TApi, TRes>): Promise<TSetBalanceRes>;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
declare class AssetsPallet implements IAssetsPallet {
|
|
2022
|
+
setBalance(address: string, asset: WithAmount<TAssetInfo>, chain: TSubstrateChain): Promise<TSetBalanceRes>;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
1996
2025
|
declare const getAssetBalanceInternal: <TApi, TRes>({ address, chain, currency, api }: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
1997
2026
|
declare const getAssetBalance: <TApi, TRes>(options: TGetAssetBalanceOptions<TApi, TRes>) => Promise<bigint>;
|
|
1998
2027
|
|
|
@@ -2021,29 +2050,27 @@ declare const addEthereumBridgeFees: <TApi, TRes, TResult extends {
|
|
|
2021
2050
|
fee?: bigint;
|
|
2022
2051
|
}>(api: IPolkadotApi<TApi, TRes>, bridgeHubResult: TResult | undefined, destination: TChain, assetHubChain: TSubstrateChain) => Promise<TResult | undefined>;
|
|
2023
2052
|
|
|
2053
|
+
declare const wrapTxBypass: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, chain: TSubstrateChain, asset: WithAmount<TAssetInfo>, feeAsset: TAssetInfo | undefined, address: string, tx: TRes) => Promise<TRes>;
|
|
2054
|
+
|
|
2024
2055
|
declare const getParaEthTransferFees: <TApi, TRes>(ahApi: IPolkadotApi<TApi, TRes>) => Promise<[bigint, bigint]>;
|
|
2025
2056
|
|
|
2026
2057
|
declare const transferMoonbeamEvm: <TApi, TRes>({ api, from, to, signer, address, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<string>;
|
|
2027
2058
|
|
|
2028
2059
|
declare const transferMoonbeamToEth: <TApi, TRes>({ api, from, to, signer, address, ahAddress, currency }: TEvmBuilderOptions<TApi, TRes>) => Promise<`0x${string}`>;
|
|
2029
2060
|
|
|
2030
|
-
declare const getOriginXcmFee: <TApi, TRes>(
|
|
2061
|
+
declare const getOriginXcmFee: <TApi, TRes>(options: TGetOriginXcmFeeOptions<TApi, TRes>) => Promise<TXcmFeeDetail & {
|
|
2031
2062
|
forwardedXcms?: any;
|
|
2032
2063
|
destParaId?: number;
|
|
2033
2064
|
}>;
|
|
2034
2065
|
|
|
2035
2066
|
declare const getOriginXcmFeeEstimate: <TApi, TRes>({ api, tx, origin, destination, currency, senderAddress, feeAsset }: TGetOriginXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateDetail>;
|
|
2036
2067
|
|
|
2037
|
-
|
|
2038
|
-
fee?: bigint;
|
|
2039
|
-
feeType?: TFeeType;
|
|
2040
|
-
sufficient?: boolean;
|
|
2041
|
-
dryRunError?: string;
|
|
2068
|
+
declare const getOriginXcmFeeInternal: <TApi, TRes>({ api, tx, origin, destination, senderAddress, disableFallback, feeAsset, currency, useRootOrigin }: TGetOriginXcmFeeOptions<TApi, TRes>) => Promise<TXcmFeeDetail & {
|
|
2042
2069
|
forwardedXcms?: any;
|
|
2043
2070
|
destParaId?: number;
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
declare const getXcmFee: <TApi, TRes, TDisableFallback extends boolean>(
|
|
2071
|
+
}>;
|
|
2072
|
+
|
|
2073
|
+
declare const getXcmFee: <TApi, TRes, TDisableFallback extends boolean>(options: TGetXcmFeeOptions<TApi, TRes, TDisableFallback>) => Promise<TGetXcmFeeResult<TDisableFallback>>;
|
|
2047
2074
|
|
|
2048
2075
|
declare const getXcmFeeEstimate: <TApi, TRes>(options: TGetXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateResult>;
|
|
2049
2076
|
|
|
@@ -2159,5 +2186,5 @@ declare const handleToAhTeleport: <TApi, TRes>(origin: TParachain, input: TPolka
|
|
|
2159
2186
|
|
|
2160
2187
|
declare const validateAddress: (address: TAddress, chain: TChain, isDestination?: boolean) => void;
|
|
2161
2188
|
|
|
2162
|
-
export { AssetClaimBuilder, 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, getParaEthTransferFees, getParaId, getRelayChainOf, getTChain, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, handleExecuteTransfer, handleSwapExecuteTransfer, handleToAhTeleport, isConfig, localizeLocation, maybeOverrideAsset, maybeOverrideAssets, padFee, padFeeBy, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination };
|
|
2163
|
-
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, TDryRunChainResultInternal, TDryRunChainSuccess, TDryRunOptions, 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, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress
|
|
2189
|
+
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, resolveModuleError, resolveParaId, reverseTransformLocation, send, sortAssets, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, traverseXcmHops, validateAddress, verifyEdOnDestination, wrapTxBypass };
|
|
2190
|
+
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, TDryRunChainResultInternal, TDryRunChainSuccess, TDryRunOptions, 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, TXcmFeeChain, TXcmFeeDetail, TXcmFeeDetailWithFallback, TXcmFeeHopInfo, TXcmFeeHopResult, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|