WalletConnect buy: set EIP-1559 fees above Polygon's min priority fee
Amoy/Polygon reject txs whose priority fee is under ~25 gwei ("gas tip below
minimum"); wallets lowball it. Set explicit maxPriorityFeePerGas 30 gwei,
maxFeePerGas 250 gwei ceiling, and a 600k gas limit so buys/activations aren't
rejected or mis-estimated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -161,6 +161,13 @@ window.IAPWallet = (function () {
|
|||||||
await ensureChain(c);
|
await ensureChain(c);
|
||||||
const tx = { from: addr, to: c.contract, data };
|
const tx = { from: addr, to: c.contract, data };
|
||||||
if (valueWei) tx.value = '0x' + BigInt(valueWei).toString(16);
|
if (valueWei) tx.value = '0x' + BigInt(valueWei).toString(16);
|
||||||
|
// Polygon (mainnet + Amoy) enforce a ~25 gwei minimum priority fee; wallets
|
||||||
|
// routinely lowball it and the RPC rejects "gas tip below minimum". Set
|
||||||
|
// explicit EIP-1559 fees above the floor, plus a safe gas limit so the wallet
|
||||||
|
// doesn't mis-estimate. Unused gas is never charged.
|
||||||
|
tx.maxPriorityFeePerGas = '0x' + (30n * 10n ** 9n).toString(16); // 30 gwei
|
||||||
|
tx.maxFeePerGas = '0x' + (250n * 10n ** 9n).toString(16); // 250 gwei ceiling
|
||||||
|
tx.gas = '0x' + (600000n).toString(16); // 600k limit
|
||||||
return eth().request({ method: 'eth_sendTransaction', params: [tx] });
|
return eth().request({ method: 'eth_sendTransaction', params: [tx] });
|
||||||
}
|
}
|
||||||
async function waitTx(hash) {
|
async function waitTx(hash) {
|
||||||
|
|||||||
+1
-1
@@ -439,7 +439,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script src="/assets/common.js?v=20260908c"></script>
|
<script src="/assets/common.js?v=20260908c"></script>
|
||||||
<script src="/assets/wallet.js?v=20260908d"></script>
|
<script src="/assets/wallet.js?v=20260908e"></script>
|
||||||
<script src="/assets/home.js?v=20260906m"></script>
|
<script src="/assets/home.js?v=20260906m"></script>
|
||||||
<script src="/assets/chat.js?v=20260906m"></script>
|
<script src="/assets/chat.js?v=20260906m"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+1
-1
@@ -690,7 +690,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="/assets/common.js?v=20260908c"></script>
|
<script src="/assets/common.js?v=20260908c"></script>
|
||||||
<script src="/assets/wallet.js?v=20260908d"></script>
|
<script src="/assets/wallet.js?v=20260908e"></script>
|
||||||
<script src="/assets/my.js?v=20260908i"></script>
|
<script src="/assets/my.js?v=20260908i"></script>
|
||||||
<script src="/assets/chat.js?v=20260907l"></script>
|
<script src="/assets/chat.js?v=20260907l"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user