@volr/react 0.1.69 → 0.1.70
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 +0 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -18890,10 +18890,8 @@ function useDepositListener(input) {
|
|
|
18890
18890
|
try {
|
|
18891
18891
|
if (!rpcUrlRef.current) {
|
|
18892
18892
|
rpcUrlRef.current = await getRpcUrl(input.chainId);
|
|
18893
|
-
console.log("[DepositListener] RPC URL:", rpcUrlRef.current);
|
|
18894
18893
|
}
|
|
18895
18894
|
const initial = await fetchBalance();
|
|
18896
|
-
console.log("[DepositListener] Initial balance:", initial.toString());
|
|
18897
18895
|
if (cancelled) return;
|
|
18898
18896
|
setStatus({ state: "listening", balance: initial });
|
|
18899
18897
|
} catch (e) {
|
|
@@ -18903,16 +18901,13 @@ function useDepositListener(input) {
|
|
|
18903
18901
|
return;
|
|
18904
18902
|
}
|
|
18905
18903
|
const intervalMs = input.pollIntervalMs ?? config.deposit?.pollIntervalMs ?? 6e3;
|
|
18906
|
-
console.log("[DepositListener] Polling interval:", intervalMs, "ms");
|
|
18907
18904
|
intervalRef.current = window.setInterval(async () => {
|
|
18908
18905
|
try {
|
|
18909
18906
|
const current = await fetchBalance();
|
|
18910
|
-
console.log("[DepositListener] Current balance:", current.toString());
|
|
18911
18907
|
if (cancelled) return;
|
|
18912
18908
|
setStatus((prev) => {
|
|
18913
18909
|
if (prev.state === "listening") {
|
|
18914
18910
|
if (current > prev.balance) {
|
|
18915
|
-
console.log("[DepositListener] \u2705 DEPOSIT DETECTED! Previous:", prev.balance.toString(), "New:", current.toString());
|
|
18916
18911
|
return {
|
|
18917
18912
|
state: "detected",
|
|
18918
18913
|
previousBalance: prev.balance,
|
|
@@ -18921,7 +18916,6 @@ function useDepositListener(input) {
|
|
|
18921
18916
|
};
|
|
18922
18917
|
}
|
|
18923
18918
|
if (current !== prev.balance) {
|
|
18924
|
-
console.log("[DepositListener] \u26A0\uFE0F Balance changed (decreased or other). Previous:", prev.balance.toString(), "New:", current.toString());
|
|
18925
18919
|
return {
|
|
18926
18920
|
state: "detected",
|
|
18927
18921
|
previousBalance: prev.balance,
|
|
@@ -18932,7 +18926,6 @@ function useDepositListener(input) {
|
|
|
18932
18926
|
return prev;
|
|
18933
18927
|
}
|
|
18934
18928
|
if (prev.state === "detected") {
|
|
18935
|
-
console.log("[DepositListener] Resuming listening from new balance:", current.toString());
|
|
18936
18929
|
return { state: "listening", balance: current };
|
|
18937
18930
|
}
|
|
18938
18931
|
return prev;
|