@kimafinance/kima-transaction-widget 1.5.13 → 1.5.14
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 +25 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -16
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5935,7 +5935,9 @@ var COIN_LIST2 = {
|
|
|
5935
5935
|
USD: USD_default,
|
|
5936
5936
|
USDT: USDT_default,
|
|
5937
5937
|
USD1: USD1_default,
|
|
5938
|
-
WBTC: BTC_default
|
|
5938
|
+
WBTC: BTC_default,
|
|
5939
|
+
WETH: Ethereum_default,
|
|
5940
|
+
WSOL: Solana_default
|
|
5939
5941
|
};
|
|
5940
5942
|
function TokenIcon({
|
|
5941
5943
|
symbol,
|
|
@@ -7828,6 +7830,14 @@ var useValidateTransaction = (inputs) => {
|
|
|
7828
7830
|
const { data: envOptions } = useGetEnvOptions({ kimaBackendUrl });
|
|
7829
7831
|
const mode = useSelector41(selectMode);
|
|
7830
7832
|
const networkOption = useSelector41(selectNetworkOption);
|
|
7833
|
+
const srcNet = useSelector41(selectSourceChain);
|
|
7834
|
+
const tgtNet = useSelector41(selectTargetChain);
|
|
7835
|
+
const srcCur = useSelector41(selectSourceCurrency);
|
|
7836
|
+
const tgtCur = useSelector41(selectTargetCurrency);
|
|
7837
|
+
const isSwap = useMemo29(
|
|
7838
|
+
() => !isSamePeggedToken(srcNet, srcCur, tgtNet, tgtCur),
|
|
7839
|
+
[srcNet, srcCur, tgtNet, tgtCur]
|
|
7840
|
+
);
|
|
7831
7841
|
const maxValue = useMemo29(() => {
|
|
7832
7842
|
logger_default.debug("useValidateTransaction: maxValue: ", inputs);
|
|
7833
7843
|
if (!balance) return 0n;
|
|
@@ -7882,10 +7892,7 @@ var useValidateTransaction = (inputs) => {
|
|
|
7882
7892
|
}
|
|
7883
7893
|
const isFiatSrc = sourceChain === "BANK" || sourceChain === "CC";
|
|
7884
7894
|
if (totalFee <= 0n && !isFiatSrc) {
|
|
7885
|
-
return {
|
|
7886
|
-
error: "ValidationError" /* Error */,
|
|
7887
|
-
message: "Fee calculation error"
|
|
7888
|
-
};
|
|
7895
|
+
return { error: "ValidationError" /* Error */, message: "Fee calculation error" };
|
|
7889
7896
|
}
|
|
7890
7897
|
if (compliantOption) {
|
|
7891
7898
|
if (!sourceCompliant?.isCompliant && sourceChain !== "CC") {
|
|
@@ -7925,17 +7932,19 @@ var useValidateTransaction = (inputs) => {
|
|
|
7925
7932
|
message: "Allowance is insufficient for the transaction"
|
|
7926
7933
|
};
|
|
7927
7934
|
}
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7935
|
+
if (!isSwap) {
|
|
7936
|
+
const { isPoolAvailable, error } = checkPoolBalance({
|
|
7937
|
+
pools,
|
|
7938
|
+
targetChain,
|
|
7939
|
+
targetCurrency,
|
|
7940
|
+
amount: formatUnits2(amount, decimals)
|
|
7941
|
+
});
|
|
7942
|
+
if (!isPoolAvailable) {
|
|
7943
|
+
return {
|
|
7944
|
+
error: "ValidationError" /* Error */,
|
|
7945
|
+
message: error || "Pool balance check failed"
|
|
7946
|
+
};
|
|
7947
|
+
}
|
|
7939
7948
|
}
|
|
7940
7949
|
return { error: "None" /* None */, message: "Validation passed" };
|
|
7941
7950
|
};
|