apow-cli 0.11.10 → 0.11.11

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.
Files changed (2) hide show
  1. package/dist/mint.js +17 -9
  2. package/package.json +1 -1
package/dist/mint.js CHANGED
@@ -168,15 +168,23 @@ async function runMintFlow(options = {}) {
168
168
  throw new Error("Challenge request reverted on-chain");
169
169
  }
170
170
  challengeSpinner.stop(`Requesting challenge${attempt > 1 ? ` (retry ${attempt}/2)` : ""}... done`);
171
- // Read the seed at the exact receipt block so we do not burn the 20s window
172
- // waiting for latest-state propagation on slower RPCs.
173
- let challengeSeed = (await wallet_1.publicClient.readContract({
174
- address: config_1.config.miningAgentAddress,
175
- abi: miningAgentAbi,
176
- functionName: "challengeSeeds",
177
- args: [account.address],
178
- blockNumber: challengeReceipt.blockNumber,
179
- }));
171
+ // Try reading the seed at the exact receipt block to avoid burning the 20s
172
+ // window waiting for latest-state propagation. Many public RPCs are NOT
173
+ // archive nodes, so they throw "header not found" for historical blocks —
174
+ // catch that and fall through to latest-state polling.
175
+ let challengeSeed = ZERO_SEED;
176
+ try {
177
+ challengeSeed = (await wallet_1.publicClient.readContract({
178
+ address: config_1.config.miningAgentAddress,
179
+ abi: miningAgentAbi,
180
+ functionName: "challengeSeeds",
181
+ args: [account.address],
182
+ blockNumber: challengeReceipt.blockNumber,
183
+ }));
184
+ }
185
+ catch {
186
+ // Non-archive RPC — fall through to latest-state polling below.
187
+ }
180
188
  if (challengeSeed.toLowerCase() === ZERO_SEED.toLowerCase()) {
181
189
  // Fall back to latest-state polling if the provider does not expose the
182
190
  // just-mined storage view reliably.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apow-cli",
3
- "version": "0.11.10",
3
+ "version": "0.11.11",
4
4
  "description": "Mine AGENT tokens on Base L2 with Agentic Proof of Work",
5
5
  "keywords": [
6
6
  "apow",