From 55584a70079ccc48daee073b2faef0a0ee97a06d Mon Sep 17 00:00:00 2001 From: martbost Date: Thu, 8 Oct 2026 06:25:06 -0500 Subject: [PATCH] Wallet sends carry an explicit gas limit from the server's estimate (wallets that cannot estimate showed 'unable to get a gas fee' on buy and activate); Control Room rail expanded by default with a remembered Collapse toggle Co-Authored-By: Claude Fable 5.1 --- chain.js | 7 ++++++- public/ads.html | 4 ++-- public/assets/cr-shell.js | 7 ++++--- public/assets/cr.css | 16 +++++++++++++++- public/assets/wallet.js | 6 +++++- public/credits.html | 6 +++--- public/links.html | 4 ++-- public/my.html | 2 +- public/pages.html | 4 ++-- public/reports.html | 4 ++-- public/team.html | 4 ++-- public/wallet.html | 4 ++-- public/zones.html | 4 ++-- server.js | 7 ++++++- 14 files changed, 54 insertions(+), 25 deletions(-) diff --git a/chain.js b/chain.js index e2df305..5d2f3ac 100644 --- a/chain.js +++ b/chain.js @@ -262,6 +262,11 @@ function init(opts) { // We hand the wallet correct fees so the tx clears the floor: a priority tip at // or above the network suggestion (floored at 30 gwei for headroom) and a // maxFee that covers 2x base + tip so MetaMask never flags "max fee too low". +// eth_estimateGas for a prepared call, padded 30%: handed to the wallet as an explicit gas limit so wallets whose own +// estimation fails ('unable to get a gas fee', Marty 2026-10-08) can still sign. null when the call would revert. +async function estimateGas(tx) { + try { const g = BigInt(await rpc('eth_estimateGas', [tx])); return '0x' + (g + g * 30n / 100n).toString(16); } catch (e) { return null; } +} async function suggestedFees() { let tip = 0n, base = 0n; try { tip = BigInt(await rpc('eth_maxPriorityFeePerGas', [])); } catch (e) {} @@ -272,5 +277,5 @@ async function suggestedFees() { return { maxPriorityFeePerGas: '0x' + priority.toString(16), maxFeePerGas: '0x' + maxFee.toString(16) }; } -module.exports = { init, getConfig, reloadConfig, memberIdByAccount, memberCount, member, +module.exports = { init, getConfig, reloadConfig, memberIdByAccount, memberCount, member, estimateGas, product, productCount, quoteWei, creditBalance, catalog, recentEvents, totals, rpc, decodeLog, suggestedFees }; diff --git a/public/ads.html b/public/ads.html index 7fc6912..e091012 100644 --- a/public/ads.html +++ b/public/ads.html @@ -6,7 +6,7 @@ Ads · LinkSpin - +