@paraspell/sdk-core 10.4.2 → 10.4.4
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 +398 -347
- package/dist/index.d.ts +12 -24
- package/dist/index.mjs +383 -331
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _paraspell_sdk_common from '@paraspell/sdk-common';
|
|
2
|
-
import { TMultiLocation, TNodeDotKsmWithRelayChains, TNodeWithRelayChains, TNodePolkadotKusama, TNode, TJunction, TEcosystemType, TJunctions } from '@paraspell/sdk-common';
|
|
2
|
+
import { Version, TMultiLocation, TNodeDotKsmWithRelayChains, TNodeWithRelayChains, TNodePolkadotKusama, TNode, TJunction, TEcosystemType, TJunctions } from '@paraspell/sdk-common';
|
|
3
3
|
export * from '@paraspell/sdk-common';
|
|
4
4
|
import * as _paraspell_assets from '@paraspell/assets';
|
|
5
5
|
import { TMultiAsset, TCurrencyInputWithAmount, TCurrencyInput, WithAmount, TAsset, TMultiAssetWithFee, TCurrencyCore, TAmount } from '@paraspell/assets';
|
|
@@ -75,7 +75,7 @@ type TPolkadotXCMTransferOptions<TApi, TRes> = {
|
|
|
75
75
|
feeAsset?: TAsset;
|
|
76
76
|
destination: TDestination;
|
|
77
77
|
paraIdTo?: number;
|
|
78
|
-
version
|
|
78
|
+
version: Version;
|
|
79
79
|
senderAddress?: string;
|
|
80
80
|
ahAddress?: string;
|
|
81
81
|
pallet?: string;
|
|
@@ -117,18 +117,6 @@ interface IXTransferTransfer {
|
|
|
117
117
|
transferXTransfer: <TApi, TRes>(input: TXTransferTransferOptions<TApi, TRes>) => TRes;
|
|
118
118
|
}
|
|
119
119
|
type TScenario = 'ParaToRelay' | 'ParaToPara' | 'RelayToPara';
|
|
120
|
-
/**
|
|
121
|
-
* The XCM version.
|
|
122
|
-
*/
|
|
123
|
-
declare enum Version {
|
|
124
|
-
V3 = "V3",
|
|
125
|
-
V4 = "V4",
|
|
126
|
-
V5 = "V5"
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* The supported XCM versions for asset claims.
|
|
130
|
-
*/
|
|
131
|
-
type TVersionClaimAssets = Version.V3;
|
|
132
120
|
type TAddress = string | TMultiLocation;
|
|
133
121
|
type TDestination = TNodeWithRelayChains | TMultiLocation;
|
|
134
122
|
type TRelayToParaDestination = TNodePolkadotKusama | TMultiLocation;
|
|
@@ -189,11 +177,12 @@ type WithRequiredSenderAddress<TBase> = Omit<TBase, 'senderAddress'> & {
|
|
|
189
177
|
senderAddress: string;
|
|
190
178
|
};
|
|
191
179
|
type TSendBaseOptionsWithSenderAddress = WithRequiredSenderAddress<TSendBaseOptions>;
|
|
192
|
-
type TSendInternalOptions<TApi, TRes> = Omit<TSendBaseOptions, 'from' | 'feeAsset'> & {
|
|
180
|
+
type TSendInternalOptions<TApi, TRes> = Omit<TSendBaseOptions, 'from' | 'feeAsset' | 'version'> & {
|
|
193
181
|
api: IPolkadotApi<TApi, TRes>;
|
|
194
182
|
asset: WithAmount<TAsset>;
|
|
195
183
|
feeAsset?: TAsset;
|
|
196
184
|
overriddenAsset?: TMultiLocation | TMultiAssetWithFee[];
|
|
185
|
+
version: Version;
|
|
197
186
|
};
|
|
198
187
|
type TRelayToParaBaseOptions = {
|
|
199
188
|
/**
|
|
@@ -215,7 +204,7 @@ type TRelayToParaBaseOptions = {
|
|
|
215
204
|
/**
|
|
216
205
|
* The optional overrided XCM version
|
|
217
206
|
*/
|
|
218
|
-
version
|
|
207
|
+
version: Version;
|
|
219
208
|
/**
|
|
220
209
|
* The DOT or KSM asset to transfer
|
|
221
210
|
*/
|
|
@@ -271,7 +260,7 @@ type TAssetClaimOptionsBase = {
|
|
|
271
260
|
node: TNodeWithRelayChains;
|
|
272
261
|
multiAssets: TMultiAsset[];
|
|
273
262
|
address: TAddress;
|
|
274
|
-
version?:
|
|
263
|
+
version?: Version;
|
|
275
264
|
};
|
|
276
265
|
type TAssetClaimOptions<TApi, TRes> = WithApi<TAssetClaimOptionsBase, TApi, TRes>;
|
|
277
266
|
|
|
@@ -938,6 +927,7 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
938
927
|
getMethod(tx: TRes): string;
|
|
939
928
|
calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
|
|
940
929
|
quoteAhPrice(fromMl: TMultiLocation, toMl: TMultiLocation, amountIn: bigint, includeFee?: boolean): Promise<bigint | undefined>;
|
|
930
|
+
getXcmWeight(xcm: any): Promise<TWeight>;
|
|
941
931
|
getBalanceNative(address: string): Promise<bigint>;
|
|
942
932
|
getBalanceNativeAcala(address: string, symbol: string): Promise<bigint>;
|
|
943
933
|
getBalanceForeignPolkadotXcm(address: string, id?: string): Promise<bigint>;
|
|
@@ -996,8 +986,8 @@ declare class AssetClaimBuilder<TApi, TRes, T extends Partial<TAssetClaimOptions
|
|
|
996
986
|
* @param version - The XCM version.
|
|
997
987
|
* @returns An instance of Builder
|
|
998
988
|
*/
|
|
999
|
-
xcmVersion(version:
|
|
1000
|
-
version:
|
|
989
|
+
xcmVersion(version: Version): AssetClaimBuilder<TApi, TRes, T & {
|
|
990
|
+
version: Version;
|
|
1001
991
|
}>;
|
|
1002
992
|
/**
|
|
1003
993
|
* Builds and returns the asset claim extrinsic.
|
|
@@ -1793,7 +1783,7 @@ declare const transferRelayToPara: <TApi, TRes>(options: TRelayToParaOptions<TAp
|
|
|
1793
1783
|
declare const createApiInstanceForNode: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, node: TNodeDotKsmWithRelayChains) => Promise<TApi>;
|
|
1794
1784
|
|
|
1795
1785
|
declare const createBeneficiary: <TApi, TRes>(options: TCreateBeneficiaryOptions<TApi, TRes>) => _paraspell_sdk_common.TMultiLocation;
|
|
1796
|
-
declare const createVersionedBeneficiary: <TApi, TRes>(options: TCreateBeneficiaryOptions<TApi, TRes>) => OneKey<Version, _paraspell_sdk_common.TMultiLocation>;
|
|
1786
|
+
declare const createVersionedBeneficiary: <TApi, TRes>(options: TCreateBeneficiaryOptions<TApi, TRes>) => OneKey<_paraspell_sdk_common.Version, _paraspell_sdk_common.TMultiLocation>;
|
|
1797
1787
|
|
|
1798
1788
|
declare const createX1Payload: (version: Version, junction: TJunction) => TJunctions;
|
|
1799
1789
|
|
|
@@ -1803,8 +1793,6 @@ declare const computeFeeFromDryRunPjs: (dryRun: any, node: TNodeDotKsmWithRelayC
|
|
|
1803
1793
|
|
|
1804
1794
|
declare const resolveModuleError: (node: TNodeDotKsmWithRelayChains, error: TModuleError) => XTokensError | PolkadotXcmError;
|
|
1805
1795
|
|
|
1806
|
-
declare const generateAddressMultiLocationV4: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: TAddress) => TXcmVersioned<TMultiLocation>;
|
|
1807
|
-
|
|
1808
1796
|
declare const getFees: (scenario: TScenario) => number;
|
|
1809
1797
|
|
|
1810
1798
|
/**
|
|
@@ -1842,5 +1830,5 @@ declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, i
|
|
|
1842
1830
|
*/
|
|
1843
1831
|
declare const determineRelayChain: (node: TNodeWithRelayChains) => TRelaychain;
|
|
1844
1832
|
|
|
1845
|
-
export { AssetClaimBuilder, BatchMode, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidParameterError, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError,
|
|
1846
|
-
export type { IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimOptions, TAssetClaimOptionsBase, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TCreateBeneficiaryOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunNodeFailure, TDryRunNodeResult, TDryRunNodeResultInternal, TDryRunNodeSuccess, TDryRunOptions, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEdJsonMap, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmNodeFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestNodeBaseOptions, TGetFeeForDestNodeOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodeConfig, TNodeConfigMap, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TRelaychain, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TTransferInfo, TTransferLocalOptions, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase,
|
|
1833
|
+
export { AssetClaimBuilder, BatchMode, BridgeHaltedError, Builder, DRY_RUN_CLIENT_TIMEOUT_MS, DryRunFailedError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidParameterError, NoXCMSupportImplementedError, NodeNotSupportedError, PolkadotXcmError, ScenarioNotSupportedError, TX_CLIENT_TIMEOUT_MS, TransferToAhNotSupported, UnableToComputeError, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiary, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, replaceBigInt, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
|
|
1834
|
+
export type { IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimOptions, TAssetClaimOptionsBase, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TCreateBeneficiaryOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, TDryRunChain, TDryRunNodeFailure, TDryRunNodeResult, TDryRunNodeResultInternal, TDryRunNodeSuccess, TDryRunOptions, TDryRunResult, TDryRunXcmBaseOptions, TDryRunXcmOptions, TEdJsonMap, TEvmBuilderOptions, TEvmBuilderOptionsBase, TEvmNodeFrom, TFeeType, TForeignAssetId, TForeignOrNativeAsset, TForeignOrTokenAsset, TGetAssetBalanceOptions, TGetAssetBalanceOptionsBase, TGetBalanceForeignOptions, TGetBalanceForeignOptionsBase, TGetBalanceNativeOptions, TGetBalanceNativeOptionsBase, TGetFeeForDestNodeBaseOptions, TGetFeeForDestNodeOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, TGetOriginXcmFeeBaseOptions, TGetOriginXcmFeeEstimateOptions, TGetOriginXcmFeeOptions, TGetReverseTxFeeOptions, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodeConfig, TNodeConfigMap, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmMethod, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TRelaychain, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TTransferInfo, TTransferLocalOptions, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TWeight, TXTokensCurrencySelection, TXTokensMethod, TXTokensTransferOptions, TXTransferMethod, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeChain, TXcmFeeDetail, TXcmForeignAsset, TXcmPalletMethod, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|