@fangorn-network/sdk 2026.10.1-9.0-dev → 2026.10.20-dev

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/README.md CHANGED
@@ -609,6 +609,11 @@ gadget_ behind the same handle shape, so committed data doesn't change form.
609
609
  Use it from the SDK with `Fangorn.create({ config: BaseSepoliaConfig, ... })`, or
610
610
  from the CLI with `CHAIN_NAME=baseSepolia` (or pick it in `fangorn init`).
611
611
 
612
+ Its default RPC is `base-sepolia-rpc.publicnode.com`, not `sepolia.base.org`: the
613
+ official endpoint caps `eth_getLogs` at 200 blocks, too narrow to scan the registry's
614
+ history. Each config's `logWindow` is the most blocks one log query spans on its RPC
615
+ (Base 10,000, Arbitrum 100,000); `FANGORN_LOG_WINDOW` overrides it for a private RPC.
616
+
612
617
  `FangornConfig` (Arbitrum Sepolia) and `BaseSepoliaConfig` in `src/config.ts` are the authoritative list and what the SDK
613
618
  uses by default — prefer it over any address copied out of a document,
614
619
  including this table. The sources are `fangorn-network/contracts`
@@ -1,8 +1,8 @@
1
1
  import "./cli.js";
2
- import * as viem5646 from "viem";
2
+ import * as viem0 from "viem";
3
3
 
4
4
  //#region src/cli/index.d.ts
5
- declare const getChain: (chainStr: string) => viem5646.Chain;
5
+ declare const getChain: (chainStr: string) => viem0.Chain;
6
6
  declare const handleCancel: (value: unknown) => void;
7
7
  declare const selectChain: () => Promise<string>;
8
8
  declare function parseGadgetArg(raw: string): {
package/lib/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as viem0 from "viem";
1
+ import * as viem1 from "viem";
2
2
  import { Chain, Hex } from "viem";
3
3
  import * as viem_chains0 from "viem/chains";
4
4
  import * as abitype0 from "abitype";
@@ -24,6 +24,7 @@ interface AppConfig {
24
24
  rpcUrl: string;
25
25
  caip2: number;
26
26
  ipfsGateway: string;
27
+ logWindow?: bigint;
27
28
  }
28
29
  declare const FangornConfig: {
29
30
  dataRegistryContractAddress: "0x72B5f83526F3893aF9f1eE0f32A27218EA09f8aE";
@@ -63,21 +64,22 @@ declare const FangornConfig: {
63
64
  testnet: true;
64
65
  custom?: Record<string, unknown> | undefined;
65
66
  extendSchema?: Record<string, unknown> | undefined;
66
- fees?: viem0.ChainFees<undefined> | undefined;
67
+ fees?: viem1.ChainFees<undefined> | undefined;
67
68
  formatters?: undefined;
68
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
69
+ prepareTransactionRequest?: ((args: viem1.PrepareTransactionRequestParameters, options: {
69
70
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
70
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
71
+ }) => Promise<viem1.PrepareTransactionRequestParameters>) | [fn: ((args: viem1.PrepareTransactionRequestParameters, options: {
71
72
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
72
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
73
+ }) => Promise<viem1.PrepareTransactionRequestParameters>) | undefined, options: {
73
74
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
74
75
  }] | undefined;
75
- serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
76
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
76
+ serializers?: viem1.ChainSerializers<undefined, viem1.TransactionSerializable> | undefined;
77
+ verifyHash?: ((client: viem1.Client, parameters: viem1.VerifyHashActionParameters) => Promise<viem1.VerifyHashActionReturnType>) | undefined;
77
78
  };
78
79
  rpcUrl: string;
79
80
  caip2: number;
80
81
  ipfsGateway: string;
82
+ logWindow: bigint;
81
83
  };
82
84
  declare const BaseSepoliaConfig: {
83
85
  dataRegistryContractAddress: "0xE9183f768865dd2Cde5f1B71F8446F0Cd798ebe0";
@@ -157,7 +159,7 @@ declare const BaseSepoliaConfig: {
157
159
  testnet: true;
158
160
  custom?: Record<string, unknown> | undefined;
159
161
  extendSchema?: Record<string, unknown> | undefined;
160
- fees?: viem0.ChainFees<undefined> | undefined;
162
+ fees?: viem1.ChainFees<undefined> | undefined;
161
163
  formatters: {
162
164
  readonly block: {
163
165
  exclude: [] | undefined;
@@ -166,28 +168,28 @@ declare const BaseSepoliaConfig: {
166
168
  blobGasUsed: bigint;
167
169
  difficulty: bigint;
168
170
  excessBlobGas: bigint;
169
- extraData: viem0.Hex;
171
+ extraData: viem1.Hex;
170
172
  gasLimit: bigint;
171
173
  gasUsed: bigint;
172
174
  hash: `0x${string}` | null;
173
175
  logsBloom: `0x${string}` | null;
174
176
  miner: abitype0.Address;
175
- mixHash: viem0.Hash;
177
+ mixHash: viem1.Hash;
176
178
  nonce: `0x${string}` | null;
177
179
  number: bigint | null;
178
180
  parentBeaconBlockRoot?: `0x${string}` | undefined;
179
- parentHash: viem0.Hash;
180
- receiptsRoot: viem0.Hex;
181
- sealFields: viem0.Hex[];
182
- sha3Uncles: viem0.Hash;
181
+ parentHash: viem1.Hash;
182
+ receiptsRoot: viem1.Hex;
183
+ sealFields: viem1.Hex[];
184
+ sha3Uncles: viem1.Hash;
183
185
  size: bigint;
184
- stateRoot: viem0.Hash;
186
+ stateRoot: viem1.Hash;
185
187
  timestamp: bigint;
186
188
  totalDifficulty: bigint | null;
187
189
  transactions: `0x${string}`[] | viem_chains0.OpStackTransaction<boolean>[];
188
- transactionsRoot: viem0.Hash;
189
- uncles: viem0.Hash[];
190
- withdrawals?: viem0.Withdrawal[] | undefined | undefined;
190
+ transactionsRoot: viem1.Hash;
191
+ uncles: viem1.Hash[];
192
+ withdrawals?: viem1.Withdrawal[] | undefined | undefined;
191
193
  withdrawalsRoot?: `0x${string}` | undefined;
192
194
  } & {};
193
195
  type: "block";
@@ -199,14 +201,14 @@ declare const BaseSepoliaConfig: {
199
201
  blockNumber: bigint | null;
200
202
  from: abitype0.Address;
201
203
  gas: bigint;
202
- hash: viem0.Hash;
203
- input: viem0.Hex;
204
+ hash: viem1.Hash;
205
+ input: viem1.Hex;
204
206
  nonce: number;
205
- r: viem0.Hex;
206
- s: viem0.Hex;
207
+ r: viem1.Hex;
208
+ s: viem1.Hex;
207
209
  to: abitype0.Address | null;
208
210
  transactionIndex: number | null;
209
- typeHex: viem0.Hex | null;
211
+ typeHex: viem1.Hex | null;
210
212
  v: bigint;
211
213
  value: bigint;
212
214
  yParity: number;
@@ -216,11 +218,11 @@ declare const BaseSepoliaConfig: {
216
218
  maxPriorityFeePerGas: bigint;
217
219
  isSystemTx?: boolean;
218
220
  mint?: bigint | undefined | undefined;
219
- sourceHash: viem0.Hex;
221
+ sourceHash: viem1.Hex;
220
222
  type: "deposit";
221
223
  } | {
222
- r: viem0.Hex;
223
- s: viem0.Hex;
224
+ r: viem1.Hex;
225
+ s: viem1.Hex;
224
226
  v: bigint;
225
227
  to: abitype0.Address | null;
226
228
  from: abitype0.Address;
@@ -229,10 +231,10 @@ declare const BaseSepoliaConfig: {
229
231
  value: bigint;
230
232
  blockHash: `0x${string}` | null;
231
233
  blockNumber: bigint | null;
232
- hash: viem0.Hash;
233
- input: viem0.Hex;
234
+ hash: viem1.Hash;
235
+ input: viem1.Hex;
234
236
  transactionIndex: number | null;
235
- typeHex: viem0.Hex | null;
237
+ typeHex: viem1.Hex | null;
236
238
  accessList?: undefined | undefined;
237
239
  authorizationList?: undefined | undefined;
238
240
  blobVersionedHashes?: undefined | undefined;
@@ -251,18 +253,18 @@ declare const BaseSepoliaConfig: {
251
253
  blockNumber: bigint | null;
252
254
  from: abitype0.Address;
253
255
  gas: bigint;
254
- hash: viem0.Hash;
255
- input: viem0.Hex;
256
+ hash: viem1.Hash;
257
+ input: viem1.Hex;
256
258
  nonce: number;
257
- r: viem0.Hex;
258
- s: viem0.Hex;
259
+ r: viem1.Hex;
260
+ s: viem1.Hex;
259
261
  to: abitype0.Address | null;
260
262
  transactionIndex: number | null;
261
- typeHex: viem0.Hex | null;
263
+ typeHex: viem1.Hex | null;
262
264
  v: bigint;
263
265
  value: bigint;
264
266
  yParity: number;
265
- accessList: viem0.AccessList;
267
+ accessList: viem1.AccessList;
266
268
  authorizationList?: undefined | undefined;
267
269
  blobVersionedHashes?: undefined | undefined;
268
270
  chainId: number;
@@ -279,18 +281,18 @@ declare const BaseSepoliaConfig: {
279
281
  blockNumber: bigint | null;
280
282
  from: abitype0.Address;
281
283
  gas: bigint;
282
- hash: viem0.Hash;
283
- input: viem0.Hex;
284
+ hash: viem1.Hash;
285
+ input: viem1.Hex;
284
286
  nonce: number;
285
- r: viem0.Hex;
286
- s: viem0.Hex;
287
+ r: viem1.Hex;
288
+ s: viem1.Hex;
287
289
  to: abitype0.Address | null;
288
290
  transactionIndex: number | null;
289
- typeHex: viem0.Hex | null;
291
+ typeHex: viem1.Hex | null;
290
292
  v: bigint;
291
293
  value: bigint;
292
294
  yParity: number;
293
- accessList: viem0.AccessList;
295
+ accessList: viem1.AccessList;
294
296
  authorizationList?: undefined | undefined;
295
297
  blobVersionedHashes?: undefined | undefined;
296
298
  chainId: number;
@@ -307,20 +309,20 @@ declare const BaseSepoliaConfig: {
307
309
  blockNumber: bigint | null;
308
310
  from: abitype0.Address;
309
311
  gas: bigint;
310
- hash: viem0.Hash;
311
- input: viem0.Hex;
312
+ hash: viem1.Hash;
313
+ input: viem1.Hex;
312
314
  nonce: number;
313
- r: viem0.Hex;
314
- s: viem0.Hex;
315
+ r: viem1.Hex;
316
+ s: viem1.Hex;
315
317
  to: abitype0.Address | null;
316
318
  transactionIndex: number | null;
317
- typeHex: viem0.Hex | null;
319
+ typeHex: viem1.Hex | null;
318
320
  v: bigint;
319
321
  value: bigint;
320
322
  yParity: number;
321
- accessList: viem0.AccessList;
323
+ accessList: viem1.AccessList;
322
324
  authorizationList?: undefined | undefined;
323
- blobVersionedHashes: readonly viem0.Hex[];
325
+ blobVersionedHashes: readonly viem1.Hex[];
324
326
  chainId: number;
325
327
  type: "eip4844";
326
328
  gasPrice?: undefined | undefined;
@@ -335,19 +337,19 @@ declare const BaseSepoliaConfig: {
335
337
  blockNumber: bigint | null;
336
338
  from: abitype0.Address;
337
339
  gas: bigint;
338
- hash: viem0.Hash;
339
- input: viem0.Hex;
340
+ hash: viem1.Hash;
341
+ input: viem1.Hex;
340
342
  nonce: number;
341
- r: viem0.Hex;
342
- s: viem0.Hex;
343
+ r: viem1.Hex;
344
+ s: viem1.Hex;
343
345
  to: abitype0.Address | null;
344
346
  transactionIndex: number | null;
345
- typeHex: viem0.Hex | null;
347
+ typeHex: viem1.Hex | null;
346
348
  v: bigint;
347
349
  value: bigint;
348
350
  yParity: number;
349
- accessList: viem0.AccessList;
350
- authorizationList: viem0.SignedAuthorizationList;
351
+ accessList: viem1.AccessList;
352
+ authorizationList: viem1.SignedAuthorizationList;
351
353
  blobVersionedHashes?: undefined | undefined;
352
354
  chainId: number;
353
355
  type: "eip7702";
@@ -366,7 +368,7 @@ declare const BaseSepoliaConfig: {
366
368
  format: (args: viem_chains0.OpStackRpcTransactionReceipt, action?: string | undefined) => {
367
369
  blobGasPrice?: bigint | undefined;
368
370
  blobGasUsed?: bigint | undefined;
369
- blockHash: viem0.Hash;
371
+ blockHash: viem1.Hash;
370
372
  blockNumber: bigint;
371
373
  blockTimestamp?: bigint | undefined;
372
374
  contractAddress: abitype0.Address | null | undefined;
@@ -374,14 +376,14 @@ declare const BaseSepoliaConfig: {
374
376
  effectiveGasPrice: bigint;
375
377
  from: abitype0.Address;
376
378
  gasUsed: bigint;
377
- logs: viem0.Log<bigint, number, false>[];
378
- logsBloom: viem0.Hex;
379
+ logs: viem1.Log<bigint, number, false>[];
380
+ logsBloom: viem1.Hex;
379
381
  root?: `0x${string}` | undefined;
380
382
  status: "success" | "reverted";
381
383
  to: abitype0.Address | null;
382
- transactionHash: viem0.Hash;
384
+ transactionHash: viem1.Hash;
383
385
  transactionIndex: number;
384
- type: viem0.TransactionType;
386
+ type: viem1.TransactionType;
385
387
  l1GasPrice: bigint | null;
386
388
  l1GasUsed: bigint | null;
387
389
  l1Fee: bigint | null;
@@ -390,22 +392,23 @@ declare const BaseSepoliaConfig: {
390
392
  type: "transactionReceipt";
391
393
  };
392
394
  };
393
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
395
+ prepareTransactionRequest?: ((args: viem1.PrepareTransactionRequestParameters, options: {
394
396
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
395
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
397
+ }) => Promise<viem1.PrepareTransactionRequestParameters>) | [fn: ((args: viem1.PrepareTransactionRequestParameters, options: {
396
398
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
397
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
399
+ }) => Promise<viem1.PrepareTransactionRequestParameters>) | undefined, options: {
398
400
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
399
401
  }] | undefined;
400
402
  serializers: {
401
403
  readonly transaction: typeof viem_chains0.serializeTransactionOpStack;
402
404
  };
403
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
405
+ verifyHash?: ((client: viem1.Client, parameters: viem1.VerifyHashActionParameters) => Promise<viem1.VerifyHashActionReturnType>) | undefined;
404
406
  readonly network: "base-sepolia";
405
407
  };
406
408
  rpcUrl: string;
407
409
  caip2: number;
408
410
  ipfsGateway: string;
411
+ logWindow: bigint;
409
412
  };
410
413
  /**
411
414
  * The networks supported by Fangorn, by the name `CHAIN_NAME` takes.
package/lib/config.js CHANGED
@@ -30,7 +30,8 @@ const FangornConfig = {
30
30
  chain: arbitrumSepolia,
31
31
  rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
32
32
  caip2: 421614,
33
- ipfsGateway: "https://ipfs.io"
33
+ ipfsGateway: "https://ipfs.io",
34
+ logWindow: 100000n
34
35
  };
35
36
  const BaseSepoliaConfig = {
36
37
  dataRegistryContractAddress: "0xE9183f768865dd2Cde5f1B71F8446F0Cd798ebe0",
@@ -38,9 +39,10 @@ const BaseSepoliaConfig = {
38
39
  membershipRegistryContractAddress: "0x0e96C012b5c53622EcDAA82F342E31C2623A04f5",
39
40
  appRegistryFromBlock: 48340483n,
40
41
  chain: baseSepolia,
41
- rpcUrl: "https://sepolia.base.org",
42
+ rpcUrl: "https://base-sepolia-rpc.publicnode.com",
42
43
  caip2: 84532,
43
- ipfsGateway: "https://ipfs.io"
44
+ ipfsGateway: "https://ipfs.io",
45
+ logWindow: 10000n
44
46
  };
45
47
  /**
46
48
  * The networks supported by Fangorn, by the name `CHAIN_NAME` takes.
@@ -32,7 +32,8 @@ declare class AppRegistryClient {
32
32
  private appId;
33
33
  private publicClient;
34
34
  private walletClient;
35
- constructor(contractAddress: Address, appId: Hex | undefined, publicClient: PublicClient, walletClient: WalletClient);
35
+ private logWindow?;
36
+ constructor(contractAddress: Address, appId: Hex | undefined, publicClient: PublicClient, walletClient: WalletClient, logWindow?: bigint | undefined);
36
37
  getAppId(): Hex | undefined;
37
38
  setAppId(appId: Hex | undefined): void;
38
39
  getAddress(): Address;
@@ -13,11 +13,12 @@ import { erc20Abi, hexToBigInt } from "viem";
13
13
  * Scoped to one app, which may be unset: then only the calls that take no app work.
14
14
  */
15
15
  var AppRegistryClient = class {
16
- constructor(contractAddress, appId, publicClient, walletClient) {
16
+ constructor(contractAddress, appId, publicClient, walletClient, logWindow) {
17
17
  this.contractAddress = contractAddress;
18
18
  this.appId = appId;
19
19
  this.publicClient = publicClient;
20
20
  this.walletClient = walletClient;
21
+ this.logWindow = logWindow;
21
22
  }
22
23
  getAppId() {
23
24
  return this.appId;
@@ -195,7 +196,7 @@ var AppRegistryClient = class {
195
196
  fromBlock: from,
196
197
  toBlock: to,
197
198
  strict: true
198
- }))).map((log) => ({
199
+ }), this.logWindow)).map((log) => ({
199
200
  appId: log.args.app_id,
200
201
  agentUri: log.args.agent_uri,
201
202
  blockNumber: log.blockNumber,
@@ -6,16 +6,12 @@ import { PublicClient } from "viem";
6
6
  * Run `fetch` over [fromBlock, toBlock] in consecutive block windows and
7
7
  * concatenate the results, oldest window first.
8
8
  *
9
- * RPC providers limit how many blocks one `eth_getLogs` call can cover. The
10
- * public Arbitrum Sepolia endpoint rejects anything past a couple of thousand
11
- * blocks with a bare "internal server errror". So a single wide-range call fails
12
- * outright, and whatever depends on it (a catch-up, a directory listing) fails
13
- * with it. Tune the window with `FANGORN_LOG_WINDOW`; a private RPC will take far
14
- * more.
15
- *
16
- * `defaultWindow` is for a query the endpoint is known to serve over a wider
17
- * range. `FANGORN_LOG_WINDOW` still overrides it.
9
+ * RPC providers limit how many blocks one `eth_getLogs` call can cover (the
10
+ * Base Sepolia one 50,000, sepolia.base.org 200), and a call past the limit fails
11
+ * outright, taking whatever depends on it (a catch-up, a directory listing) with
12
+ * it. Each network's config says what its RPC takes (`AppConfig.logWindow`, passed
13
+ * here as `defaultWindow`); `FANGORN_LOG_WINDOW` overrides it, for a private RPC.
18
14
  */
19
- declare function getLogsInWindows<T>(publicClient: PublicClient, fromBlock: bigint, toBlock: bigint | undefined, fetch: (fromBlock: bigint, toBlock: bigint) => Promise<T[]>, defaultWindow?: bigint): Promise<T[]>;
15
+ declare function getLogsInWindows<T>(publicClient: PublicClient, fromBlock: bigint, toBlock: bigint | undefined, fetch: (fromBlock: bigint, toBlock: bigint) => Promise<T[]>, defaultWindow?: bigint | undefined): Promise<T[]>;
20
16
  //#endregion
21
17
  export { getLogsInWindows };
@@ -5,15 +5,11 @@ import { nonBlank } from "../config.js";
5
5
  * Run `fetch` over [fromBlock, toBlock] in consecutive block windows and
6
6
  * concatenate the results, oldest window first.
7
7
  *
8
- * RPC providers limit how many blocks one `eth_getLogs` call can cover. The
9
- * public Arbitrum Sepolia endpoint rejects anything past a couple of thousand
10
- * blocks with a bare "internal server errror". So a single wide-range call fails
11
- * outright, and whatever depends on it (a catch-up, a directory listing) fails
12
- * with it. Tune the window with `FANGORN_LOG_WINDOW`; a private RPC will take far
13
- * more.
14
- *
15
- * `defaultWindow` is for a query the endpoint is known to serve over a wider
16
- * range. `FANGORN_LOG_WINDOW` still overrides it.
8
+ * RPC providers limit how many blocks one `eth_getLogs` call can cover (the
9
+ * Base Sepolia one 50,000, sepolia.base.org 200), and a call past the limit fails
10
+ * outright, taking whatever depends on it (a catch-up, a directory listing) with
11
+ * it. Each network's config says what its RPC takes (`AppConfig.logWindow`, passed
12
+ * here as `defaultWindow`); `FANGORN_LOG_WINDOW` overrides it, for a private RPC.
17
13
  */
18
14
  async function getLogsInWindows(publicClient, fromBlock, toBlock, fetch, defaultWindow = 1000n) {
19
15
  const tuned = typeof process !== "undefined" ? nonBlank(process.env.FANGORN_LOG_WINDOW) : void 0;
package/lib/fangorn.js CHANGED
@@ -560,7 +560,7 @@ var Fangorn = class Fangorn {
560
560
  * bill the app's subscription, and the app presents its repos.
561
561
  */
562
562
  getAppRegistry() {
563
- this._apps ??= new AppRegistryClient(this.ctx.config.appRegistryContractAddress, this.ctx.appId, this.ctx.publicClient, this.ctx.walletClient);
563
+ this._apps ??= new AppRegistryClient(this.ctx.config.appRegistryContractAddress, this.ctx.appId, this.ctx.publicClient, this.ctx.walletClient, this.ctx.config.logWindow);
564
564
  return this._apps;
565
565
  }
566
566
  getMembershipRegistry() {
package/lib/registry.d.ts CHANGED
@@ -75,6 +75,7 @@ declare function exclusionId(x: Exclusion): Hex;
75
75
  interface ChainRegistryConfig {
76
76
  dataRegistryContractAddress: Address;
77
77
  appRegistryContractAddress: Address;
78
+ logWindow?: bigint;
78
79
  }
79
80
  /**
80
81
  * The registry on the contracts: H and U in the DataRegistry; membership, X and C
@@ -96,6 +97,7 @@ declare class ChainRegistry implements Registry {
96
97
  private walletClient?;
97
98
  private readonly data;
98
99
  private readonly apps;
100
+ private readonly logWindow?;
99
101
  constructor(config: ChainRegistryConfig, publicClient: PublicClient, walletClient?: WalletClient | undefined);
100
102
  epoch(): Promise<number>;
101
103
  head(ref: RepoRef): Promise<Hex>;
package/lib/registry.js CHANGED
@@ -58,11 +58,13 @@ function exclusionId(x) {
58
58
  var ChainRegistry = class {
59
59
  data;
60
60
  apps;
61
+ logWindow;
61
62
  constructor(config, publicClient, walletClient) {
62
63
  this.publicClient = publicClient;
63
64
  this.walletClient = walletClient;
64
65
  this.data = config.dataRegistryContractAddress;
65
66
  this.apps = config.appRegistryContractAddress;
67
+ this.logWindow = config.logWindow;
66
68
  }
67
69
  async epoch() {
68
70
  return epochOf((await this.publicClient.getBlock()).timestamp);
@@ -141,7 +143,7 @@ var ChainRegistry = class {
141
143
  fromBlock,
142
144
  toBlock,
143
145
  strict: true
144
- }))).sort((a, b) => a.blockNumber === b.blockNumber ? a.logIndex - b.logIndex : a.blockNumber < b.blockNumber ? -1 : 1).map(toEntry);
146
+ }), this.logWindow)).sort((a, b) => a.blockNumber === b.blockNumber ? a.logIndex - b.logIndex : a.blockNumber < b.blockNumber ? -1 : 1).map(toEntry);
145
147
  }
146
148
  watch(filter, onEntry, onError, pollingInterval) {
147
149
  return this.publicClient.watchContractEvent({