@kimafinance/kima-transaction-widget 1.3.11 → 1.3.12

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.js CHANGED
@@ -2774,12 +2774,14 @@ function useEvmAllowance() {
2774
2774
  const appkitAccountInfo = useAppKitAccount4();
2775
2775
  const sourceChain = useSelector4(selectSourceChain);
2776
2776
  const networkOption = useSelector4(selectNetworkOption);
2777
- const { totalFeeUsd, allowanceAmount, decimals } = useSelector4(selectServiceFee);
2777
+ const { totalFeeUsd, allowanceAmount, submitAmount, decimals } = useSelector4(selectServiceFee);
2778
2778
  const selectedCoin = useSelector4(selectSourceCurrency);
2779
2779
  const tokenOptions = useSelector4(selectTokenOptions);
2780
2780
  const backendUrl = useSelector4(selectBackendUrl);
2781
2781
  const feeDeduct = useSelector4(selectFeeDeduct);
2782
- const allowanceNumber = Number(formatUnits4(allowanceAmount ?? "0", decimals));
2782
+ const allowanceNumber = Number(
2783
+ formatUnits4(feeDeduct ? submitAmount : allowanceAmount ?? "0", decimals)
2784
+ );
2783
2785
  const amount = useSelector4(selectAmount);
2784
2786
  const { pools } = useGetPools_default(backendUrl, networkOption);
2785
2787
  const walletAddress = externalProvider?.signer?.address || appkitAccountInfo?.address;
@@ -3095,10 +3097,13 @@ import { PublicKey as PublicKey5, Transaction } from "@solana/web3.js";
3095
3097
  import { formatUnits as formatUnits5 } from "ethers";
3096
3098
  function useSolanaAllowance() {
3097
3099
  const sourceChain = useSelector6(selectSourceChain);
3098
- const { allowanceAmount, decimals } = useSelector6(selectServiceFee);
3100
+ const { allowanceAmount, submitAmount, decimals } = useSelector6(selectServiceFee);
3101
+ const feeDeduct = useSelector6(selectFeeDeduct);
3099
3102
  const backendUrl = useSelector6(selectBackendUrl);
3100
3103
  const networkOption = useSelector6(selectNetworkOption);
3101
- const allowanceNumber = Number(formatUnits5(allowanceAmount ?? "0", decimals));
3104
+ const allowanceNumber = Number(
3105
+ formatUnits5(feeDeduct ? submitAmount : allowanceAmount ?? "0", decimals)
3106
+ );
3102
3107
  const { externalProvider } = useKimaContext();
3103
3108
  const { connection: internalConnection } = useConnection2();
3104
3109
  const {
@@ -3688,11 +3693,14 @@ function useTronAllowance() {
3688
3693
  const sourceChain = useSelector9(selectSourceChain);
3689
3694
  const networkOption = useSelector9(selectNetworkOption);
3690
3695
  const backendUrl = useSelector9(selectBackendUrl);
3691
- const { allowanceAmount, decimals } = useSelector9(selectServiceFee);
3696
+ const { allowanceAmount, submitAmount, decimals } = useSelector9(selectServiceFee);
3692
3697
  useTronWallet();
3693
3698
  const selectedCoin = useSelector9(selectSourceCurrency);
3694
3699
  const tokenOptions = useSelector9(selectTokenOptions);
3695
- const allowanceNumber = Number(formatUnits7(allowanceAmount ?? "0", decimals));
3700
+ const feeDeduct = useSelector9(selectFeeDeduct);
3701
+ const allowanceNumber = Number(
3702
+ formatUnits7(feeDeduct ? submitAmount : allowanceAmount ?? "0", decimals)
3703
+ );
3696
3704
  const { pools } = useGetPools_default(backendUrl, networkOption);
3697
3705
  const {
3698
3706
  address: internalUserAddress,