@paraspell/sdk-core 10.0.2 → 10.1.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.d.ts CHANGED
@@ -427,7 +427,7 @@ type TVerifyEdOnDestinationOptionsBase<TRes> = {
427
427
  /**
428
428
  * The destination node.
429
429
  */
430
- destination: TNodeDotKsmWithRelayChains;
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: TNodeDotKsmWithRelayChains;
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;
@@ -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: TNodeDotKsmWithRelayChains;
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: TNodeDotKsmWithRelayChains;
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: TNodeDotKsmWithRelayChains;
864
+ destination: TNodeWithRelayChains;
855
865
  senderAddress: string;
856
866
  currency: TCurrencyInput;
857
867
  feeAsset?: TCurrencyInput;
@@ -860,7 +870,7 @@ type TGetOriginXcmFeeBaseOptions<TRes> = {
860
870
  type TGetOriginXcmFeeOptions<TApi, TRes> = WithApi<TGetOriginXcmFeeBaseOptions<TRes>, TApi, TRes>;
861
871
  type TGetFeeForDestNodeBaseOptions = {
862
872
  origin: TNodeDotKsmWithRelayChains;
863
- destination: TNodeDotKsmWithRelayChains;
873
+ destination: TNodeWithRelayChains;
864
874
  senderAddress: string;
865
875
  address: string;
866
876
  currency: TCurrencyInputWithAmount;
@@ -871,8 +881,11 @@ type TGetFeeForDestNodeBaseOptions = {
871
881
  disableFallback: boolean;
872
882
  };
873
883
  type TGetFeeForDestNodeOptions<TApi, TRes> = WithApi<TGetFeeForDestNodeBaseOptions, TApi, TRes>;
884
+ type TGetReverseTxFeeOptions<TApi, TRes> = Omit<TGetFeeForDestNodeOptions<TApi, TRes>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee'> & {
885
+ destination: TNodeDotKsmWithRelayChains;
886
+ };
874
887
  type THubKey = 'assetHub' | 'bridgeHub';
875
- type TFeeType = 'dryRun' | 'paymentInfo';
888
+ type TFeeType = 'dryRun' | 'paymentInfo' | 'noFeeRequired';
876
889
  type TXcmFeeDetail = {
877
890
  fee: bigint;
878
891
  currency: string;
@@ -912,6 +925,7 @@ interface IPolkadotApi<TApi, TRes> {
912
925
  objectToHex(obj: unknown, typeName: string): Promise<string>;
913
926
  hexToUint8a(hex: string): Uint8Array;
914
927
  stringToUint8a(str: string): Uint8Array;
928
+ getMethod(tx: TRes): string;
915
929
  calculateTransactionFee(tx: TRes, address: string): Promise<bigint>;
916
930
  quoteAhPrice(fromMl: TMultiLocation, toMl: TMultiLocation, amountIn: bigint, includeFee?: boolean): Promise<bigint | undefined>;
917
931
  getBalanceNative(address: string): Promise<bigint>;
@@ -1784,7 +1798,7 @@ declare const getOriginFeeDetails: <TApi, TRes>(options: TGetOriginFeeDetailsOpt
1784
1798
  declare const getTransferableAmountInternal: <TApi, TRes>({ api, senderAddress, origin: node, destination, currency, tx, feeAsset }: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1785
1799
  declare const getTransferableAmount: <TApi, TRes>(options: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1786
1800
 
1787
- declare const getTransferInfo: <TApi, TRes>({ api, tx, origin, destination, senderAddress, address, currency, feeAsset }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
1801
+ declare const getTransferInfo: <TApi, TRes>({ api, tx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
1788
1802
 
1789
1803
  declare const verifyEdOnDestination: <TApi, TRes>(options: TVerifyEdOnDestinationOptions<TApi, TRes>) => Promise<boolean>;
1790
1804
 
@@ -1868,4 +1882,4 @@ declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, i
1868
1882
  declare const determineRelayChain: (node: TNodeWithRelayChains) => TRelaychain;
1869
1883
 
1870
1884
  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 };
1885
+ 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 };