@morpho-dev/router 0.0.22 → 0.0.24

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.
@@ -18,6 +18,7 @@ type ChainName = (typeof chainNames)[number];
18
18
  declare const ChainId: {
19
19
  ETHEREUM: bigint;
20
20
  BASE: bigint;
21
+ "ETHEREUM-VIRTUAL-TESTNET": bigint;
21
22
  };
22
23
  type ChainId = (typeof ChainId)[keyof typeof ChainId];
23
24
  declare const chainIds: Set<bigint>;
@@ -26,6 +27,11 @@ type Chain = Compute<Omit<Chain$2, "id" | "name"> & {
26
27
  name: ChainName;
27
28
  whitelistedAssets: Set<Address>;
28
29
  morpho: Address;
30
+ mempool?: {
31
+ address: Address;
32
+ deploymentBlock: number;
33
+ reindexBuffer: number;
34
+ };
29
35
  }>;
30
36
  declare function getChain(chainId: ChainId): Chain | undefined;
31
37
  declare const chains: Record<ChainName, Chain>;
@@ -422,6 +428,19 @@ type OfferStore = {
422
428
  nonce: Offer.Offer["nonce"];
423
429
  consumed: bigint;
424
430
  }) => Promise<void>;
431
+ /** Persist latest indexing progress for a chain and event type. */
432
+ saveLatestBlockNumberProcessed: (parameters: {
433
+ chainId: Offer.Offer["chainId"];
434
+ eventType: "offer_created" | "offer_matched";
435
+ latestBlockNumber: number;
436
+ }) => Promise<void>;
437
+ /** Retrieve latest indexing progress for a chain and event type. */
438
+ getLatestBlockNumberProcessed: (parameters: {
439
+ chainId: Offer.Offer["chainId"];
440
+ eventType: "offer_created" | "offer_matched";
441
+ }) => Promise<{
442
+ latestBlockNumber: number;
443
+ } | null>;
425
444
  };
426
445
  type GetOffersFilters = {
427
446
  creators?: string[];
@@ -18,6 +18,7 @@ type ChainName = (typeof chainNames)[number];
18
18
  declare const ChainId: {
19
19
  ETHEREUM: bigint;
20
20
  BASE: bigint;
21
+ "ETHEREUM-VIRTUAL-TESTNET": bigint;
21
22
  };
22
23
  type ChainId = (typeof ChainId)[keyof typeof ChainId];
23
24
  declare const chainIds: Set<bigint>;
@@ -26,6 +27,11 @@ type Chain = Compute<Omit<Chain$2, "id" | "name"> & {
26
27
  name: ChainName;
27
28
  whitelistedAssets: Set<Address>;
28
29
  morpho: Address;
30
+ mempool?: {
31
+ address: Address;
32
+ deploymentBlock: number;
33
+ reindexBuffer: number;
34
+ };
29
35
  }>;
30
36
  declare function getChain(chainId: ChainId): Chain | undefined;
31
37
  declare const chains: Record<ChainName, Chain>;
@@ -422,6 +428,19 @@ type OfferStore = {
422
428
  nonce: Offer.Offer["nonce"];
423
429
  consumed: bigint;
424
430
  }) => Promise<void>;
431
+ /** Persist latest indexing progress for a chain and event type. */
432
+ saveLatestBlockNumberProcessed: (parameters: {
433
+ chainId: Offer.Offer["chainId"];
434
+ eventType: "offer_created" | "offer_matched";
435
+ latestBlockNumber: number;
436
+ }) => Promise<void>;
437
+ /** Retrieve latest indexing progress for a chain and event type. */
438
+ getLatestBlockNumberProcessed: (parameters: {
439
+ chainId: Offer.Offer["chainId"];
440
+ eventType: "offer_created" | "offer_matched";
441
+ }) => Promise<{
442
+ latestBlockNumber: number;
443
+ } | null>;
425
444
  };
426
445
  type GetOffersFilters = {
427
446
  creators?: string[];
@@ -28,7 +28,8 @@ __export(Chain_exports, {
28
28
  var chainNames = ["ethereum", "base", "ethereum-virtual-testnet"];
29
29
  var ChainId = {
30
30
  ETHEREUM: BigInt(chains$1.mainnet.id),
31
- BASE: BigInt(chains$1.base.id)
31
+ BASE: BigInt(chains$1.base.id),
32
+ "ETHEREUM-VIRTUAL-TESTNET": 121212n
32
33
  };
33
34
  var chainIds = new Set(Object.values(ChainId));
34
35
  var chainNameLookup = new Map(Object.entries(ChainId).map(([key, value]) => [value, key]));
@@ -70,7 +71,7 @@ var chains = {
70
71
  },
71
72
  "ethereum-virtual-testnet": {
72
73
  ...chains$1.mainnet,
73
- id: 1111n,
74
+ id: 121212n,
74
75
  name: "ethereum-virtual-testnet",
75
76
  whitelistedAssets: new Set(
76
77
  [
@@ -80,7 +81,12 @@ var chains = {
80
81
  // DAI
81
82
  ].map((address) => address.toLowerCase())
82
83
  ),
83
- morpho: "0x0000000000000000000000000000000000000000"
84
+ morpho: "0x0000000000000000000000000000000000000000",
85
+ mempool: {
86
+ address: "0x7be3164eeee8b35092f6128ec32c2e6ff8f6c890",
87
+ deploymentBlock: 23225668,
88
+ reindexBuffer: 10
89
+ }
84
90
  }
85
91
  };
86
92
 
@@ -1105,6 +1111,7 @@ __export(OfferStore_exports, {
1105
1111
  function memory(parameters) {
1106
1112
  const map = parameters.offers;
1107
1113
  const filled = parameters.filled;
1114
+ const indexingProgress = /* @__PURE__ */ new Map();
1108
1115
  const create = async (parameters2) => {
1109
1116
  if (map.has(parameters2.offer.hash.toLowerCase())) return parameters2.offer.hash;
1110
1117
  map.set(parameters2.offer.hash.toLowerCase(), {
@@ -1445,6 +1452,15 @@ function memory(parameters) {
1445
1452
  filledForOffering.set(nonce, parameters2.consumed);
1446
1453
  filledForChain.set(address, filledForOffering);
1447
1454
  filled.set(chainId, filledForChain);
1455
+ },
1456
+ saveLatestBlockNumberProcessed: async (parameters2) => {
1457
+ const key = `${parameters2.chainId.toString()}:${parameters2.eventType}`;
1458
+ indexingProgress.set(key, parameters2.latestBlockNumber);
1459
+ },
1460
+ getLatestBlockNumberProcessed: async (parameters2) => {
1461
+ const key = `${parameters2.chainId.toString()}:${parameters2.eventType}`;
1462
+ const value = indexingProgress.get(key);
1463
+ return value === void 0 ? null : { latestBlockNumber: value };
1448
1464
  }
1449
1465
  };
1450
1466
  }