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