@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.
- package/dist/index.browser.d.cts +19 -0
- package/dist/index.browser.d.ts +19 -0
- package/dist/index.browser.js +19 -3
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +19 -3
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.cts +19 -0
- package/dist/index.node.d.ts +19 -0
- package/dist/index.node.js +19 -3
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +19 -3
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.node.d.cts
CHANGED
|
@@ -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[];
|
package/dist/index.node.d.ts
CHANGED
|
@@ -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[];
|
package/dist/index.node.js
CHANGED
|
@@ -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:
|
|
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
|
}
|