@paraspell/sdk-core 10.0.2 → 10.1.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 +1306 -948
- package/dist/index.d.ts +37 -20
- package/dist/index.mjs +1308 -951
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -427,7 +427,7 @@ type TVerifyEdOnDestinationOptionsBase<TRes> = {
|
|
|
427
427
|
/**
|
|
428
428
|
* The destination node.
|
|
429
429
|
*/
|
|
430
|
-
destination:
|
|
430
|
+
destination: TNodeWithRelayChains;
|
|
431
431
|
/**
|
|
432
432
|
* The address of the account.
|
|
433
433
|
*/
|
|
@@ -531,7 +531,7 @@ type TNodeConfigMap = Record<TNodeDotKsmWithRelayChains, TNodeConfig>;
|
|
|
531
531
|
type TDryRunBaseOptions<TRes> = {
|
|
532
532
|
tx: TRes;
|
|
533
533
|
origin: TNodeDotKsmWithRelayChains;
|
|
534
|
-
destination:
|
|
534
|
+
destination: TNodeWithRelayChains;
|
|
535
535
|
senderAddress: string;
|
|
536
536
|
address: string;
|
|
537
537
|
currency: TCurrencyInputWithAmount;
|
|
@@ -568,7 +568,7 @@ type TDryRunXcmBaseOptions = {
|
|
|
568
568
|
* The origin node
|
|
569
569
|
*/
|
|
570
570
|
origin: TNodeDotKsmWithRelayChains;
|
|
571
|
-
asset: TAsset;
|
|
571
|
+
asset: TAsset | null;
|
|
572
572
|
feeAsset?: TAsset;
|
|
573
573
|
amount: bigint;
|
|
574
574
|
originFee: bigint;
|
|
@@ -673,7 +673,7 @@ declare class DryRunFailedError extends Error {
|
|
|
673
673
|
* @param reason - The reason why the dry run failed.
|
|
674
674
|
* @param dryRunType - Optional. Specifies if the error is related to the 'origin' or 'destination' dry run.
|
|
675
675
|
*/
|
|
676
|
-
constructor(reason: string, dryRunType?: 'origin' | 'destination');
|
|
676
|
+
constructor(reason: string, dryRunType?: 'origin' | 'destination' | 'assetHub' | 'bridgeHub');
|
|
677
677
|
}
|
|
678
678
|
|
|
679
679
|
/**
|
|
@@ -766,6 +766,11 @@ declare class UnableToComputeError extends Error {
|
|
|
766
766
|
constructor(message: string);
|
|
767
767
|
}
|
|
768
768
|
|
|
769
|
+
type TXcmFeeBase = {
|
|
770
|
+
fee: bigint;
|
|
771
|
+
balance: bigint;
|
|
772
|
+
currencySymbol: string;
|
|
773
|
+
};
|
|
769
774
|
type TTransferInfo = {
|
|
770
775
|
chain: {
|
|
771
776
|
origin: TNodeWithRelayChains;
|
|
@@ -780,14 +785,21 @@ type TTransferInfo = {
|
|
|
780
785
|
currencySymbol: string;
|
|
781
786
|
existentialDeposit: bigint;
|
|
782
787
|
};
|
|
783
|
-
xcmFee: {
|
|
788
|
+
xcmFee: TXcmFeeBase & {
|
|
784
789
|
sufficient: boolean;
|
|
785
|
-
fee: bigint;
|
|
786
|
-
balance: bigint;
|
|
787
790
|
balanceAfter: bigint;
|
|
788
|
-
currencySymbol: string;
|
|
789
791
|
};
|
|
790
792
|
};
|
|
793
|
+
assetHub?: {
|
|
794
|
+
balance: bigint;
|
|
795
|
+
currencySymbol: string;
|
|
796
|
+
existentialDeposit: bigint;
|
|
797
|
+
xcmFee: TXcmFeeBase;
|
|
798
|
+
};
|
|
799
|
+
bridgeHub?: {
|
|
800
|
+
currencySymbol: string;
|
|
801
|
+
xcmFee: TXcmFeeBase;
|
|
802
|
+
};
|
|
791
803
|
destination: {
|
|
792
804
|
receivedCurrency: {
|
|
793
805
|
sufficient: boolean | UnableToComputeError;
|
|
@@ -797,11 +809,8 @@ type TTransferInfo = {
|
|
|
797
809
|
currencySymbol: string;
|
|
798
810
|
existentialDeposit: bigint;
|
|
799
811
|
};
|
|
800
|
-
xcmFee: {
|
|
801
|
-
fee: bigint;
|
|
802
|
-
balance: bigint;
|
|
812
|
+
xcmFee: TXcmFeeBase & {
|
|
803
813
|
balanceAfter: bigint | UnableToComputeError;
|
|
804
|
-
currencySymbol: string;
|
|
805
814
|
};
|
|
806
815
|
};
|
|
807
816
|
};
|
|
@@ -812,8 +821,9 @@ type TOriginFeeDetails = {
|
|
|
812
821
|
type TGetTransferInfoOptionsBase<TRes> = {
|
|
813
822
|
tx: TRes;
|
|
814
823
|
origin: TNodeDotKsmWithRelayChains;
|
|
815
|
-
destination:
|
|
824
|
+
destination: TNodeWithRelayChains;
|
|
816
825
|
senderAddress: string;
|
|
826
|
+
ahAddress?: string;
|
|
817
827
|
address: string;
|
|
818
828
|
currency: WithAmount<TCurrencyCore>;
|
|
819
829
|
feeAsset?: TCurrencyCore;
|
|
@@ -832,7 +842,7 @@ type TGetXcmFeeBaseOptions<TRes> = {
|
|
|
832
842
|
/**
|
|
833
843
|
* The destination node
|
|
834
844
|
*/
|
|
835
|
-
destination:
|
|
845
|
+
destination: TNodeWithRelayChains;
|
|
836
846
|
/**
|
|
837
847
|
* The sender address
|
|
838
848
|
*/
|
|
@@ -851,7 +861,7 @@ type TGetXcmFeeBuilderOptions = {
|
|
|
851
861
|
type TGetOriginXcmFeeBaseOptions<TRes> = {
|
|
852
862
|
tx: TRes;
|
|
853
863
|
origin: TNodeDotKsmWithRelayChains;
|
|
854
|
-
destination:
|
|
864
|
+
destination: TNodeWithRelayChains;
|
|
855
865
|
senderAddress: string;
|
|
856
866
|
currency: TCurrencyInput;
|
|
857
867
|
feeAsset?: TCurrencyInput;
|
|
@@ -859,8 +869,9 @@ type TGetOriginXcmFeeBaseOptions<TRes> = {
|
|
|
859
869
|
};
|
|
860
870
|
type TGetOriginXcmFeeOptions<TApi, TRes> = WithApi<TGetOriginXcmFeeBaseOptions<TRes>, TApi, TRes>;
|
|
861
871
|
type TGetFeeForDestNodeBaseOptions = {
|
|
872
|
+
prevNode: TNodeDotKsmWithRelayChains;
|
|
862
873
|
origin: TNodeDotKsmWithRelayChains;
|
|
863
|
-
destination:
|
|
874
|
+
destination: TNodeWithRelayChains;
|
|
864
875
|
senderAddress: string;
|
|
865
876
|
address: string;
|
|
866
877
|
currency: TCurrencyInputWithAmount;
|
|
@@ -871,8 +882,11 @@ type TGetFeeForDestNodeBaseOptions = {
|
|
|
871
882
|
disableFallback: boolean;
|
|
872
883
|
};
|
|
873
884
|
type TGetFeeForDestNodeOptions<TApi, TRes> = WithApi<TGetFeeForDestNodeBaseOptions, TApi, TRes>;
|
|
885
|
+
type TGetReverseTxFeeOptions<TApi, TRes> = Omit<TGetFeeForDestNodeOptions<TApi, TRes>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee' | 'prevNode'> & {
|
|
886
|
+
destination: TNodeDotKsmWithRelayChains;
|
|
887
|
+
};
|
|
874
888
|
type THubKey = 'assetHub' | 'bridgeHub';
|
|
875
|
-
type TFeeType = 'dryRun' | 'paymentInfo';
|
|
889
|
+
type TFeeType = 'dryRun' | 'paymentInfo' | 'noFeeRequired';
|
|
876
890
|
type TXcmFeeDetail = {
|
|
877
891
|
fee: bigint;
|
|
878
892
|
currency: string;
|
|
@@ -912,6 +926,7 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
912
926
|
objectToHex(obj: unknown, typeName: string): Promise<string>;
|
|
913
927
|
hexToUint8a(hex: string): Uint8Array;
|
|
914
928
|
stringToUint8a(str: string): Uint8Array;
|
|
929
|
+
getMethod(tx: TRes): string;
|
|
915
930
|
calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
|
|
916
931
|
quoteAhPrice(fromMl: TMultiLocation, toMl: TMultiLocation, amountIn: bigint, includeFee?: boolean): Promise<bigint | undefined>;
|
|
917
932
|
getBalanceNative(address: string): Promise<bigint>;
|
|
@@ -1784,7 +1799,7 @@ declare const getOriginFeeDetails: <TApi, TRes>(options: TGetOriginFeeDetailsOpt
|
|
|
1784
1799
|
declare const getTransferableAmountInternal: <TApi, TRes>({ api, senderAddress, origin: node, destination, currency, tx, feeAsset }: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
|
|
1785
1800
|
declare const getTransferableAmount: <TApi, TRes>(options: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
|
|
1786
1801
|
|
|
1787
|
-
declare const getTransferInfo: <TApi, TRes>({ api, tx, origin, destination, senderAddress, address, currency, feeAsset }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
|
|
1802
|
+
declare const getTransferInfo: <TApi, TRes>({ api, tx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
|
|
1788
1803
|
|
|
1789
1804
|
declare const verifyEdOnDestination: <TApi, TRes>(options: TVerifyEdOnDestinationOptions<TApi, TRes>) => Promise<boolean>;
|
|
1790
1805
|
|
|
@@ -1855,6 +1870,8 @@ declare const reverseTransformMultiLocation: (multiLocation: TMultiLocation) =>
|
|
|
1855
1870
|
*/
|
|
1856
1871
|
declare const transformMultiLocation: (multiLocation: TMultiLocation) => TMultiLocation;
|
|
1857
1872
|
|
|
1873
|
+
declare const replaceBigInt: (_key: string, value: unknown) => unknown;
|
|
1874
|
+
|
|
1858
1875
|
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
1859
1876
|
|
|
1860
1877
|
declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, isDestination?: boolean) => void;
|
|
@@ -1867,5 +1884,5 @@ declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, i
|
|
|
1867
1884
|
*/
|
|
1868
1885
|
declare const determineRelayChain: (node: TNodeWithRelayChains) => TRelaychain;
|
|
1869
1886
|
|
|
1870
|
-
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, Version, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, generateAddressMultiLocationV4, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, isEthersContract, isEthersSigner, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
|
|
1871
|
-
export type { IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimOptions, TAssetClaimOptionsBase, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TCreateBeneficiaryOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, 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, TGetTransferInfoOptions, TGetTransferInfoOptionsBase, TGetTransferableAmountOptions, TGetTransferableAmountOptionsBase, TGetXcmFeeBaseOptions, TGetXcmFeeBuilderOptions, TGetXcmFeeEstimateDetail, TGetXcmFeeEstimateOptions, TGetXcmFeeEstimateResult, TGetXcmFeeOptions, TGetXcmFeeResult, THubKey, TMantaAsset, TModuleError, TNativeTokenAsset, TNodeConfig, TNodeConfigMap, TNodleAsset, TOriginFeeDetails, TOtherReserveAsset, TPolkadotXCMTransferOptions, TPolkadotXcmSection, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TRelaychain, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TTransferInfo, TTransferLocalOptions, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TVersionClaimAssets, TWeight, TXTokensCurrencySelection, TXTokensSection, TXTokensTransferOptions, TXTransferSection, TXTransferTransferOptions, TXcmAsset, TXcmFeeDetail, TXcmForeignAsset, TXcmPalletSection, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|
|
1887
|
+
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, Version, XTokensError, blake2b256, blake2b512, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, convertSs58, createApiInstanceForNode, createBeneficiaryMultiLocation, createVersionedBeneficiary, createX1Payload, deriveAccountId, determineRelayChain, dryRun, dryRunOrigin, encodeSs58, generateAddressMultiLocationV4, getAssetBalance, getAssetBalanceInternal, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getBridgeStatus, getFees, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOriginXcmFee, getOriginXcmFeeEstimate, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, isEthersContract, isEthersSigner, replaceBigInt, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
|
|
1888
|
+
export type { IPolkadotApi, IPolkadotXCMTransfer, IXTokensTransfer, IXTransferTransfer, OneKey, TAddress, TApiOrUrl, TAssetClaimOptions, TAssetClaimOptionsBase, TBalanceResponse, TBatchOptions, TBifrostToken, TBridgeStatus, TCreateBeneficiaryOptions, TDestWeight, TDestination, TDryRunBaseOptions, TDryRunCallBaseOptions, TDryRunCallOptions, 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, TPolkadotXcmSection, TProviderEntry, TRelayToParaDestination, TRelayToParaOptions, TRelayToParaOverrides, TRelaychain, TReserveAsset, TScenario, TSelfReserveAsset, TSendBaseOptions, TSendBaseOptionsWithSenderAddress, TSendInternalOptions, TSendOptions, TSerializeEthTransferOptions, TSerializedApiCall, TSerializedEthTransfer, TTransferInfo, TTransferLocalOptions, TVerifyEdOnDestinationOptions, TVerifyEdOnDestinationOptionsBase, TVersionClaimAssets, TWeight, TXTokensCurrencySelection, TXTokensSection, TXTokensTransferOptions, TXTransferSection, TXTransferTransferOptions, TXcmAsset, TXcmFeeBase, TXcmFeeDetail, TXcmForeignAsset, TXcmPalletSection, TXcmVersioned, TZeitgeistAsset, WithApi, WithRequiredSenderAddress };
|