@paraspell/sdk-core 9.2.2 → 10.0.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.
Files changed (4) hide show
  1. package/dist/index.cjs +5649 -5371
  2. package/dist/index.d.ts +256 -157
  3. package/dist/index.mjs +5649 -5369
  4. package/package.json +4 -4
package/dist/index.d.ts CHANGED
@@ -178,16 +178,17 @@ type TSendBaseOptions = {
178
178
  */
179
179
  method?: string;
180
180
  };
181
- type TSendBaseOptionsWithSenderAddress = Omit<TSendBaseOptions, 'senderAddress'> & {
181
+ /**
182
+ * Options for transferring from a parachain to another parachain or relay chain
183
+ */
184
+ type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions, TApi, TRes>;
185
+ type WithRequiredSenderAddress<TBase> = Omit<TBase, 'senderAddress'> & {
182
186
  /**
183
187
  * The sender address. A SS58 or H160 format.
184
188
  */
185
189
  senderAddress: string;
186
190
  };
187
- /**
188
- * Options for transferring from a parachain to another parachain or relay chain
189
- */
190
- type TSendOptions<TApi, TRes> = WithApi<TSendBaseOptions, TApi, TRes>;
191
+ type TSendBaseOptionsWithSenderAddress = WithRequiredSenderAddress<TSendBaseOptions>;
191
192
  type TSendInternalOptions<TApi, TRes> = Omit<TSendBaseOptions, 'from' | 'currency' | 'feeAsset'> & {
192
193
  api: IPolkadotApi<TApi, TRes>;
193
194
  asset: WithAmount<TAsset>;
@@ -394,27 +395,58 @@ type TGetMaxForeignTransferableAmountOptionsBase = {
394
395
  currency: TCurrencyCore;
395
396
  };
396
397
  type TGetMaxForeignTransferableAmountOptions<TApi, TRes> = WithApi<TGetMaxForeignTransferableAmountOptionsBase, TApi, TRes>;
397
- type TGetTransferableAmountOptionsBase = {
398
+ type TGetTransferableAmountOptionsBase<TRes> = {
398
399
  /**
399
- * The address of the account.
400
+ * The sender address of the account.
400
401
  */
401
- address: string;
402
+ senderAddress: string;
402
403
  /**
403
404
  * The node on which to query the balance.
404
405
  */
405
- node: TNodeDotKsmWithRelayChains;
406
+ origin: TNodeDotKsmWithRelayChains;
407
+ /**
408
+ * The destination node.
409
+ */
410
+ destination: TNodeWithRelayChains;
406
411
  /**
407
412
  * The currency to query.
408
413
  */
409
414
  currency: TCurrencyCore;
415
+ /**
416
+ * The transaction to calculate the fee for
417
+ */
418
+ tx: TRes;
419
+ feeAsset?: TCurrencyInput;
410
420
  };
411
- type TGetTransferableAmountOptions<TApi, TRes> = WithApi<TGetTransferableAmountOptionsBase, TApi, TRes>;
412
- type TVerifyEdOnDestinationOptionsBase = {
413
- node: TNodeDotKsmWithRelayChains;
421
+ type TGetTransferableAmountOptions<TApi, TRes> = WithApi<TGetTransferableAmountOptionsBase<TRes>, TApi, TRes>;
422
+ type TVerifyEdOnDestinationOptionsBase<TRes> = {
423
+ /**
424
+ * The origin node.
425
+ */
426
+ origin: TNodeDotKsmWithRelayChains;
427
+ /**
428
+ * The destination node.
429
+ */
430
+ destination: TNodeDotKsmWithRelayChains;
431
+ /**
432
+ * The address of the account.
433
+ */
414
434
  address: string;
435
+ /**
436
+ * The account of the sender.
437
+ */
438
+ senderAddress: string;
439
+ /**
440
+ * The currency to query.
441
+ */
415
442
  currency: WithAmount<TCurrencyCore>;
443
+ /**
444
+ * The transaction to calculate the fee for
445
+ */
446
+ tx: TRes;
447
+ feeAsset?: TCurrencyInput;
416
448
  };
417
- type TVerifyEdOnDestinationOptions<TApi, TRes> = WithApi<TVerifyEdOnDestinationOptionsBase, TApi, TRes>;
449
+ type TVerifyEdOnDestinationOptions<TApi, TRes> = WithApi<TVerifyEdOnDestinationOptionsBase<TRes>, TApi, TRes>;
418
450
 
419
451
  type TEvmNodeFrom = Extract<TNode, 'Ethereum' | 'Moonbeam' | 'Moonriver' | 'Darwinia'>;
420
452
  /**
@@ -503,6 +535,7 @@ type TDryRunBaseOptions<TRes> = {
503
535
  senderAddress: string;
504
536
  address: string;
505
537
  currency: TCurrencyInputWithAmount;
538
+ feeAsset?: TCurrencyInput;
506
539
  };
507
540
  type TDryRunOptions<TApi, TRes> = WithApi<TDryRunBaseOptions<TRes>, TApi, TRes>;
508
541
  type TDryRunCallBaseOptions<TRes> = {
@@ -518,6 +551,7 @@ type TDryRunCallBaseOptions<TRes> = {
518
551
  * The address to dry-run with
519
552
  */
520
553
  address: string;
554
+ isFeeAsset: boolean;
521
555
  };
522
556
  type TDryRunCallOptions<TApi, TRes> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes>;
523
557
  type TDryRunXcmBaseOptions = {
@@ -534,6 +568,10 @@ type TDryRunXcmBaseOptions = {
534
568
  * The origin node
535
569
  */
536
570
  origin: TNodeDotKsmWithRelayChains;
571
+ asset: TAsset;
572
+ feeAsset?: TAsset;
573
+ amount: bigint;
574
+ originFee: bigint;
537
575
  };
538
576
  type TDryRunXcmOptions<TApi, TRes> = WithApi<TDryRunXcmBaseOptions, TApi, TRes>;
539
577
  type TDryRunNodeSuccess = {
@@ -613,46 +651,174 @@ type TModuleError = {
613
651
 
614
652
  type TEdJsonMap = Record<TNodeDotKsmWithRelayChains, string | null>;
615
653
 
654
+ /**
655
+ * Error thrown when the Ethereum bridge is halted.
656
+ */
657
+ declare class BridgeHaltedError extends Error {
658
+ /**
659
+ * Constructs a new BridgeHaltedError.
660
+ *
661
+ * @param message - Optional custom error message.
662
+ */
663
+ constructor();
664
+ }
665
+
666
+ /**
667
+ * Error thrown when the Dry Run fails.
668
+ */
669
+ declare class DryRunFailedError extends Error {
670
+ /**
671
+ * Constructs a new DryRunFailedError.
672
+ *
673
+ * @param reason - The reason why the dry run failed.
674
+ * @param dryRunType - Optional. Specifies if the error is related to the 'origin' or 'destination' dry run.
675
+ */
676
+ constructor(reason: string, dryRunType?: 'origin' | 'destination');
677
+ }
678
+
679
+ /**
680
+ * Error thrown when nodes from different relay chains are incompatible.
681
+ */
682
+ declare class IncompatibleNodesError extends Error {
683
+ /**
684
+ * Constructs a new IncompatibleNodesError.
685
+ *
686
+ * @param message - Optional custom error message.
687
+ */
688
+ constructor(message?: string);
689
+ }
690
+
691
+ /**
692
+ * Error thrown when an invalid address is provided.
693
+ */
694
+ declare class InvalidAddressError extends Error {
695
+ /**
696
+ * Constructs a new InvalidAddressError.
697
+ *
698
+ * @param message - The error message.
699
+ */
700
+ constructor(message: string);
701
+ }
702
+
703
+ /**
704
+ * Error thrown when the Dry Run fails.
705
+ */
706
+ declare class InvalidParameterError extends Error {
707
+ /**
708
+ * Constructs a new InvalidParameterError.
709
+ *
710
+ * @param message - Required error message.
711
+ */
712
+ constructor(message: string);
713
+ }
714
+
715
+ /**
716
+ * Used to inform user, that Parachain they wish to use is not supported yet
717
+ */
718
+ declare class NodeNotSupportedError extends Error {
719
+ /**
720
+ * Constructs a new NodeNotSupportedError.
721
+ *
722
+ * @param message - Optional custom error message.
723
+ */
724
+ constructor(message?: string);
725
+ }
726
+
727
+ /**
728
+ * Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
729
+ */
730
+ declare class NoXCMSupportImplementedError extends Error {
731
+ /**
732
+ * Constructs a new NoXCMSupportImplementedError.
733
+ *
734
+ * @param node - The node for which XCM support is not implemented.
735
+ */
736
+ constructor(node: TNode);
737
+ }
738
+
739
+ /**
740
+ * Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
741
+ */
742
+ declare class ScenarioNotSupportedError extends Error {
743
+ /**
744
+ * Constructs a new ScenarioNotSupportedError.
745
+ *
746
+ * @param node - The node where the scenario is not supported.
747
+ * @param scenario - The scenario that is not supported.
748
+ * @param message - Optional custom error message.
749
+ */
750
+ constructor(node: TNode, scenario: TScenario, message?: string);
751
+ }
752
+
753
+ declare class TransferToAhNotSupported extends Error {
754
+ constructor(message?: string);
755
+ }
756
+
757
+ /**
758
+ * UnableToComputeError is thrown when a computation cannot be performed.
759
+ */
760
+ declare class UnableToComputeError extends Error {
761
+ /**
762
+ * Constructs a new UnableToComputeError.
763
+ *
764
+ * @param message - Required error message.
765
+ */
766
+ constructor(message: string);
767
+ }
768
+
616
769
  type TTransferInfo = {
617
770
  chain: {
618
771
  origin: TNodeWithRelayChains;
619
772
  destination: TNodeWithRelayChains;
620
773
  ecosystem: string;
621
774
  };
622
- currencyBalanceOrigin: {
623
- balance: bigint;
624
- currency: string;
625
- };
626
- originFeeBalance: {
627
- balance: bigint;
628
- expectedBalanceAfterXCMFee: bigint;
775
+ origin: {
776
+ selectedCurrency: {
777
+ sufficient: boolean;
778
+ balance: bigint;
779
+ balanceAfter: bigint;
780
+ currencySymbol: string;
781
+ existentialDeposit: bigint;
782
+ };
629
783
  xcmFee: {
630
- sufficientForXCM: boolean;
631
- xcmFee: bigint;
784
+ sufficient: boolean;
785
+ fee: bigint;
786
+ balance: bigint;
787
+ balanceAfter: bigint;
788
+ currencySymbol: string;
632
789
  };
633
- existentialDeposit: bigint;
634
- asset: string;
635
- minNativeTransferableAmount: bigint;
636
- maxNativeTransferableAmount: bigint;
637
790
  };
638
- destinationFeeBalance: {
639
- balance: bigint;
640
- currency: string;
641
- existentialDeposit: bigint;
791
+ destination: {
792
+ receivedCurrency: {
793
+ sufficient: boolean | UnableToComputeError;
794
+ receivedAmount: bigint | UnableToComputeError;
795
+ balance: bigint;
796
+ balanceAfter: bigint | UnableToComputeError;
797
+ currencySymbol: string;
798
+ existentialDeposit: bigint;
799
+ };
800
+ xcmFee: {
801
+ fee: bigint;
802
+ balance: bigint;
803
+ balanceAfter: bigint | UnableToComputeError;
804
+ currencySymbol: string;
805
+ };
642
806
  };
643
807
  };
644
808
  type TOriginFeeDetails = {
645
809
  sufficientForXCM: boolean;
646
810
  xcmFee: bigint;
647
811
  };
648
- type TGetTransferInfoOptionsBase = {
812
+ type TGetTransferInfoOptionsBase<TRes> = {
813
+ tx: TRes;
649
814
  origin: TNodeDotKsmWithRelayChains;
650
815
  destination: TNodeDotKsmWithRelayChains;
651
- accountOrigin: string;
652
- accountDestination: string;
816
+ senderAddress: string;
817
+ address: string;
653
818
  currency: WithAmount<TCurrencyCore>;
819
+ feeAsset?: TCurrencyCore;
654
820
  };
655
- type TGetTransferInfoOptions<TApi, TRes> = WithApi<TGetTransferInfoOptionsBase, TApi, TRes>;
821
+ type TGetTransferInfoOptions<TApi, TRes> = WithApi<TGetTransferInfoOptionsBase<TRes>, TApi, TRes>;
656
822
 
657
823
  type TGetXcmFeeBaseOptions<TRes> = {
658
824
  /**
@@ -673,21 +839,25 @@ type TGetXcmFeeBaseOptions<TRes> = {
673
839
  senderAddress: string;
674
840
  address: string;
675
841
  currency: TCurrencyInputWithAmount;
842
+ feeAsset?: TCurrencyInput;
676
843
  disableFallback: boolean;
677
844
  };
678
845
  type TGetXcmFeeOptions<TApi, TRes> = WithApi<TGetXcmFeeBaseOptions<TRes>, TApi, TRes>;
679
846
  type TGetXcmFeeEstimateOptions<TApi, TRes> = Omit<TGetXcmFeeOptions<TApi, TRes>, 'disableFallback'>;
847
+ type TGetOriginXcmFeeEstimateOptions<TApi, TRes> = Omit<TGetXcmFeeOptions<TApi, TRes>, 'disableFallback' | 'address' | 'currency'>;
680
848
  type TGetXcmFeeBuilderOptions = {
681
849
  disableFallback: boolean;
682
850
  };
683
- type TGetFeeForOriginNodeBaseOptions<TRes> = {
851
+ type TGetOriginXcmFeeBaseOptions<TRes> = {
684
852
  tx: TRes;
685
853
  origin: TNodeDotKsmWithRelayChains;
686
854
  destination: TNodeDotKsmWithRelayChains;
687
855
  senderAddress: string;
856
+ currency: TCurrencyInput;
857
+ feeAsset?: TCurrencyInput;
688
858
  disableFallback: boolean;
689
859
  };
690
- type TGetFeeForOriginNodeOptions<TApi, TRes> = WithApi<TGetFeeForOriginNodeBaseOptions<TRes>, TApi, TRes>;
860
+ type TGetOriginXcmFeeOptions<TApi, TRes> = WithApi<TGetOriginXcmFeeBaseOptions<TRes>, TApi, TRes>;
691
861
  type TGetFeeForDestNodeBaseOptions = {
692
862
  origin: TNodeDotKsmWithRelayChains;
693
863
  destination: TNodeDotKsmWithRelayChains;
@@ -695,6 +865,9 @@ type TGetFeeForDestNodeBaseOptions = {
695
865
  address: string;
696
866
  currency: TCurrencyInputWithAmount;
697
867
  forwardedXcms: any;
868
+ asset: TAsset;
869
+ originFee: bigint;
870
+ feeAsset?: TCurrencyInput;
698
871
  disableFallback: boolean;
699
872
  };
700
873
  type TGetFeeForDestNodeOptions<TApi, TRes> = WithApi<TGetFeeForDestNodeBaseOptions, TApi, TRes>;
@@ -952,17 +1125,50 @@ declare class GeneralBuilder<TApi, TRes, T extends Partial<TSendBaseOptions> = o
952
1125
  build(this: GeneralBuilder<TApi, TRes, TSendBaseOptions>): Promise<TRes>;
953
1126
  dryRun(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TDryRunResult>;
954
1127
  /**
955
- * Estimates the XCM fee for the transfer using paymentInfo function.
1128
+ * Returns the XCM fee for the transfer using dryRun or paymentInfo function.
1129
+ *
1130
+ * @returns An origin and destination fee.
1131
+ */
1132
+ getXcmFee(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, { disableFallback }?: TGetXcmFeeBuilderOptions): Promise<TGetXcmFeeResult>;
1133
+ /**
1134
+ * Returns the origin XCM fee for the transfer using dryRun or paymentInfo function.
1135
+ *
1136
+ * @returns An origin fee.
1137
+ */
1138
+ getOriginXcmFee(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, { disableFallback }?: TGetXcmFeeBuilderOptions): Promise<TXcmFeeDetail & {
1139
+ forwardedXcms?: any;
1140
+ destParaId?: number;
1141
+ }>;
1142
+ /**
1143
+ * Estimates the origin and destination XCM fee using paymentInfo function.
956
1144
  *
957
1145
  * @returns An origin and destination fee estimate.
958
1146
  */
959
1147
  getXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TGetXcmFeeEstimateResult>;
960
1148
  /**
961
- * Returns the XCM fee for the transfer using dryRun or paymentInfo function.
1149
+ * Estimates the origin XCM fee using paymentInfo function.
962
1150
  *
963
- * @returns An origin and destination fee.
1151
+ * @returns An origin fee estimate.
964
1152
  */
965
- getXcmFee(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>, { disableFallback }?: TGetXcmFeeBuilderOptions): Promise<TGetXcmFeeResult>;
1153
+ getOriginXcmFeeEstimate(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TGetXcmFeeEstimateDetail>;
1154
+ /**
1155
+ * Returns the max transferable amount for the transfer
1156
+ *
1157
+ * @returns The max transferable amount.
1158
+ */
1159
+ getTransferableAmount(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<bigint>;
1160
+ /**
1161
+ * Returns the max transferable amount for the transfer
1162
+ *
1163
+ * @returns The max transferable amount.
1164
+ */
1165
+ verifyEdOnDestination(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<boolean>;
1166
+ /**
1167
+ * Returns the transfer info for the transfer
1168
+ *
1169
+ * @returns The transfer info.
1170
+ */
1171
+ getTransferInfo(this: GeneralBuilder<TApi, TRes, TSendBaseOptionsWithSenderAddress>): Promise<TTransferInfo>;
966
1172
  /**
967
1173
  * Returns the API instance used by the builder.
968
1174
  *
@@ -1541,108 +1747,6 @@ declare const nodes: <TApi, TRes>() => {
1541
1747
  Polimec: Polimec<TApi, TRes>;
1542
1748
  };
1543
1749
 
1544
- /**
1545
- * Error thrown when the Ethereum bridge is halted.
1546
- */
1547
- declare class BridgeHaltedError extends Error {
1548
- /**
1549
- * Constructs a new BridgeHaltedError.
1550
- *
1551
- * @param message - Optional custom error message.
1552
- */
1553
- constructor();
1554
- }
1555
-
1556
- /**
1557
- * Error thrown when the Dry Run fails.
1558
- */
1559
- declare class DryRunFailedError extends Error {
1560
- /**
1561
- * Constructs a new DryRunFailedError.
1562
- *
1563
- * @param message - Optional custom error message.
1564
- */
1565
- constructor(reason: string);
1566
- }
1567
-
1568
- /**
1569
- * Error thrown when nodes from different relay chains are incompatible.
1570
- */
1571
- declare class IncompatibleNodesError extends Error {
1572
- /**
1573
- * Constructs a new IncompatibleNodesError.
1574
- *
1575
- * @param message - Optional custom error message.
1576
- */
1577
- constructor(message?: string);
1578
- }
1579
-
1580
- /**
1581
- * Error thrown when an invalid address is provided.
1582
- */
1583
- declare class InvalidAddressError extends Error {
1584
- /**
1585
- * Constructs a new InvalidAddressError.
1586
- *
1587
- * @param message - The error message.
1588
- */
1589
- constructor(message: string);
1590
- }
1591
-
1592
- /**
1593
- * Error thrown when the Dry Run fails.
1594
- */
1595
- declare class InvalidParameterError extends Error {
1596
- /**
1597
- * Constructs a new InvalidParameterError.
1598
- *
1599
- * @param message - Required error message.
1600
- */
1601
- constructor(message: string);
1602
- }
1603
-
1604
- /**
1605
- * Used to inform user, that Parachain they wish to use is not supported yet
1606
- */
1607
- declare class NodeNotSupportedError extends Error {
1608
- /**
1609
- * Constructs a new NodeNotSupportedError.
1610
- *
1611
- * @param message - Optional custom error message.
1612
- */
1613
- constructor(message?: string);
1614
- }
1615
-
1616
- /**
1617
- * Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
1618
- */
1619
- declare class NoXCMSupportImplementedError extends Error {
1620
- /**
1621
- * Constructs a new NoXCMSupportImplementedError.
1622
- *
1623
- * @param node - The node for which XCM support is not implemented.
1624
- */
1625
- constructor(node: TNode);
1626
- }
1627
-
1628
- /**
1629
- * Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
1630
- */
1631
- declare class ScenarioNotSupportedError extends Error {
1632
- /**
1633
- * Constructs a new ScenarioNotSupportedError.
1634
- *
1635
- * @param node - The node where the scenario is not supported.
1636
- * @param scenario - The scenario that is not supported.
1637
- * @param message - Optional custom error message.
1638
- */
1639
- constructor(node: TNode, scenario: TScenario, message?: string);
1640
- }
1641
-
1642
- declare class TransferToAhNotSupported extends Error {
1643
- constructor(message?: string);
1644
- }
1645
-
1646
1750
  declare const getNodeConfig: (node: TNodeDotKsmWithRelayChains) => TNodeConfig;
1647
1751
 
1648
1752
  declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
@@ -1677,14 +1781,10 @@ declare const getBalanceNative: <TApi, TRes>(options: TGetBalanceNativeOptions<T
1677
1781
  declare const getOriginFeeDetailsInternal: <TApi, TRes>({ api, account, accountDestination, ahAddress, currency, origin, destination, feeMarginPercentage }: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
1678
1782
  declare const getOriginFeeDetails: <TApi, TRes>(options: TGetOriginFeeDetailsOptions<TApi, TRes>) => Promise<TOriginFeeDetails>;
1679
1783
 
1680
- declare const getMaxNativeTransferableAmountInternal: <TApi, TRes>({ api, address, node, currency }: TGetMaxNativeTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1681
- declare const getMaxNativeTransferableAmount: <TApi, TRes>(options: TGetMaxNativeTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1682
- declare const getMaxForeignTransferableAmountInternal: <TApi, TRes>({ api, address, node, currency }: TGetMaxForeignTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1683
- declare const getMaxForeignTransferableAmount: <TApi, TRes>(options: TGetMaxForeignTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1684
- declare const getTransferableAmountInternal: <TApi, TRes>({ api, address, node, currency }: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1784
+ declare const getTransferableAmountInternal: <TApi, TRes>({ api, senderAddress, origin: node, destination, currency, tx, feeAsset }: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1685
1785
  declare const getTransferableAmount: <TApi, TRes>(options: TGetTransferableAmountOptions<TApi, TRes>) => Promise<bigint>;
1686
1786
 
1687
- declare const getTransferInfo: <TApi, TRes>({ origin, destination, accountOrigin, accountDestination, currency, api }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
1787
+ declare const getTransferInfo: <TApi, TRes>({ api, tx, origin, destination, senderAddress, address, currency, feeAsset }: TGetTransferInfoOptions<TApi, TRes>) => Promise<TTransferInfo>;
1688
1788
 
1689
1789
  declare const verifyEdOnDestination: <TApi, TRes>(options: TVerifyEdOnDestinationOptions<TApi, TRes>) => Promise<boolean>;
1690
1790
 
@@ -1701,17 +1801,16 @@ declare const transferMoonbeamToEth: <TApi, TRes>({ api, from, to, signer, addre
1701
1801
  declare const isEthersSigner: (signer: Signer | WalletClient) => signer is Signer;
1702
1802
  declare const isEthersContract: (contract: Contract | GetContractReturnType<Abi | readonly unknown[]>) => contract is Contract;
1703
1803
 
1704
- declare const getFeeForOriginNode: <TApi, TRes>({ api, tx, origin, destination, senderAddress, disableFallback }: TGetFeeForOriginNodeOptions<TApi, TRes>) => Promise<{
1705
- fee?: bigint;
1706
- feeType?: TFeeType;
1707
- dryRunError?: string;
1804
+ declare const getOriginXcmFee: <TApi, TRes>({ api, tx, origin, destination, senderAddress, disableFallback, feeAsset, currency }: TGetOriginXcmFeeOptions<TApi, TRes>) => Promise<TXcmFeeDetail & {
1708
1805
  forwardedXcms?: any;
1709
1806
  destParaId?: number;
1710
1807
  }>;
1711
1808
 
1712
- declare const getXcmFee: <TApi, TRes>({ api, tx, origin, destination, senderAddress, address, currency, disableFallback }: TGetXcmFeeOptions<TApi, TRes>) => Promise<TGetXcmFeeResult>;
1809
+ declare const getOriginXcmFeeEstimate: <TApi, TRes>({ api, tx, origin, destination, senderAddress }: TGetOriginXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateDetail>;
1810
+
1811
+ declare const getXcmFee: <TApi, TRes>({ api, tx, origin, destination, senderAddress, address, currency, feeAsset, disableFallback }: TGetXcmFeeOptions<TApi, TRes>) => Promise<TGetXcmFeeResult>;
1713
1812
 
1714
- declare const getXcmFeeEstimate: <TApi, TRes>({ api, tx, origin, destination, address, senderAddress, currency }: TGetXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateResult>;
1813
+ declare const getXcmFeeEstimate: <TApi, TRes>(options: TGetXcmFeeEstimateOptions<TApi, TRes>) => Promise<TGetXcmFeeEstimateResult>;
1715
1814
 
1716
1815
  declare const getBridgeStatus: <TApi, TRes>(api: IPolkadotApi<TApi, TRes>) => Promise<TBridgeStatus>;
1717
1816
 
@@ -1725,7 +1824,7 @@ declare const createVersionedBeneficiary: <TApi, TRes>(options: TCreateBeneficia
1725
1824
 
1726
1825
  declare const createX1Payload: (version: Version, junction: TJunction) => TJunctions;
1727
1826
 
1728
- declare const computeFeeFromDryRun: (dryRun: any, node: TNodeDotKsmWithRelayChains, executionFee: bigint) => bigint;
1827
+ declare const computeFeeFromDryRun: (dryRun: any, node: TNodeDotKsmWithRelayChains, executionFee: bigint, isFeeAsset?: boolean) => bigint;
1729
1828
 
1730
1829
  declare const computeFeeFromDryRunPjs: (dryRun: any, node: TNodeDotKsmWithRelayChains, executionFee: bigint) => bigint;
1731
1830
 
@@ -1768,5 +1867,5 @@ declare const validateAddress: (address: TAddress, node: TNodeWithRelayChains, i
1768
1867
  */
1769
1868
  declare const determineRelayChain: (node: TNodeWithRelayChains) => TRelaychain;
1770
1869
 
1771
- 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, 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, getFeeForOriginNode, getFees, getMaxForeignTransferableAmount, getMaxForeignTransferableAmountInternal, getMaxNativeTransferableAmount, getMaxNativeTransferableAmountInternal, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getParaEthTransferFees, getParaId, getTNode, getTransferInfo, getTransferableAmount, getTransferableAmountInternal, getXcmFee, getXcmFeeEstimate, isEthersContract, isEthersSigner, resolveModuleError, resolveParaId, reverseTransformMultiLocation, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, transformMultiLocation, validateAddress, verifyEdOnDestination };
1772
- 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, TGetFeeForOriginNodeBaseOptions, TGetFeeForOriginNodeOptions, TGetMaxForeignTransferableAmountOptions, TGetMaxForeignTransferableAmountOptionsBase, TGetMaxNativeTransferableAmountOptions, TGetMaxNativeTransferableAmountOptionsBase, TGetOriginFeeDetailsOptions, TGetOriginFeeDetailsOptionsBase, 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 };
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 };