@blockrun/clawrouter 0.12.18 → 0.12.19
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/cli.js +10 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2877,12 +2877,14 @@ var BalanceMonitor = class {
|
|
|
2877
2877
|
*/
|
|
2878
2878
|
async checkBalance() {
|
|
2879
2879
|
const now = Date.now();
|
|
2880
|
-
if (this.cachedBalance !== null && now - this.cachedAt < CACHE_TTL_MS) {
|
|
2880
|
+
if (this.cachedBalance !== null && this.cachedBalance > 0n && now - this.cachedAt < CACHE_TTL_MS) {
|
|
2881
2881
|
return this.buildInfo(this.cachedBalance);
|
|
2882
2882
|
}
|
|
2883
2883
|
const balance = await this.fetchBalance();
|
|
2884
|
-
|
|
2885
|
-
|
|
2884
|
+
if (balance > 0n) {
|
|
2885
|
+
this.cachedBalance = balance;
|
|
2886
|
+
this.cachedAt = now;
|
|
2887
|
+
}
|
|
2886
2888
|
return this.buildInfo(balance);
|
|
2887
2889
|
}
|
|
2888
2890
|
/**
|
|
@@ -2985,12 +2987,14 @@ var SolanaBalanceMonitor = class {
|
|
|
2985
2987
|
}
|
|
2986
2988
|
async checkBalance() {
|
|
2987
2989
|
const now = Date.now();
|
|
2988
|
-
if (this.cachedBalance !== null && now - this.cachedAt < CACHE_TTL_MS2) {
|
|
2990
|
+
if (this.cachedBalance !== null && this.cachedBalance > 0n && now - this.cachedAt < CACHE_TTL_MS2) {
|
|
2989
2991
|
return this.buildInfo(this.cachedBalance);
|
|
2990
2992
|
}
|
|
2991
2993
|
const balance = await this.fetchBalance();
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
+
if (balance > 0n) {
|
|
2995
|
+
this.cachedBalance = balance;
|
|
2996
|
+
this.cachedAt = now;
|
|
2997
|
+
}
|
|
2994
2998
|
return this.buildInfo(balance);
|
|
2995
2999
|
}
|
|
2996
3000
|
deductEstimated(amountMicros) {
|