@gzeoneth/gov-tracker 0.1.2 → 0.2.0-0
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/abis.d.ts +0 -32
- package/dist/abis.d.ts.map +1 -1
- package/dist/abis.js +17 -17
- package/dist/abis.js.map +1 -1
- package/dist/calldata/decoder.d.ts +12 -3
- package/dist/calldata/decoder.d.ts.map +1 -1
- package/dist/calldata/decoder.js +50 -9
- package/dist/calldata/decoder.js.map +1 -1
- package/dist/calldata/index.d.ts +4 -7
- package/dist/calldata/index.d.ts.map +1 -1
- package/dist/calldata/index.js +5 -19
- package/dist/calldata/index.js.map +1 -1
- package/dist/calldata/parameter-decoder.d.ts +11 -2
- package/dist/calldata/parameter-decoder.d.ts.map +1 -1
- package/dist/calldata/parameter-decoder.js +61 -2
- package/dist/calldata/parameter-decoder.js.map +1 -1
- package/dist/calldata/retryable-ticket.d.ts +1 -17
- package/dist/calldata/retryable-ticket.d.ts.map +1 -1
- package/dist/calldata/retryable-ticket.js +10 -17
- package/dist/calldata/retryable-ticket.js.map +1 -1
- package/dist/calldata/signature-lookup.d.ts +0 -11
- package/dist/calldata/signature-lookup.d.ts.map +1 -1
- package/dist/calldata/signature-lookup.js +0 -8
- package/dist/calldata/signature-lookup.js.map +1 -1
- package/dist/cli/lib/cli.d.ts +1 -3
- package/dist/cli/lib/cli.d.ts.map +1 -1
- package/dist/cli/lib/cli.js +7 -21
- package/dist/cli/lib/cli.js.map +1 -1
- package/dist/cli/lib/election-check.d.ts +2 -2
- package/dist/cli/lib/election-check.d.ts.map +1 -1
- package/dist/cli/lib/election-check.js.map +1 -1
- package/dist/cli/lib/json-state.d.ts +2 -29
- package/dist/cli/lib/json-state.d.ts.map +1 -1
- package/dist/cli/lib/json-state.js +0 -45
- package/dist/cli/lib/json-state.js.map +1 -1
- package/dist/cli/monitor.js +1 -2
- package/dist/cli/monitor.js.map +1 -1
- package/dist/constants.d.ts +41 -7
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +64 -4
- package/dist/constants.js.map +1 -1
- package/dist/discovery/timelock-discovery.js +1 -1
- package/dist/discovery/timelock-discovery.js.map +1 -1
- package/dist/election.d.ts.map +1 -1
- package/dist/election.js +7 -4
- package/dist/election.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -13
- package/dist/index.js.map +1 -1
- package/dist/simulation/index.d.ts +3 -4
- package/dist/simulation/index.d.ts.map +1 -1
- package/dist/simulation/index.js +3 -9
- package/dist/simulation/index.js.map +1 -1
- package/dist/simulation/simulation-data.d.ts +6 -31
- package/dist/simulation/simulation-data.d.ts.map +1 -1
- package/dist/simulation/simulation-data.js +25 -58
- package/dist/simulation/simulation-data.js.map +1 -1
- package/dist/stages/base.d.ts.map +1 -1
- package/dist/stages/base.js +4 -1
- package/dist/stages/base.js.map +1 -1
- package/dist/stages/l2-to-l1-message.d.ts.map +1 -1
- package/dist/stages/l2-to-l1-message.js +7 -6
- package/dist/stages/l2-to-l1-message.js.map +1 -1
- package/dist/stages/proposal-created.js +2 -2
- package/dist/stages/proposal-created.js.map +1 -1
- package/dist/stages/proposal-queued.d.ts.map +1 -1
- package/dist/stages/proposal-queued.js +11 -10
- package/dist/stages/proposal-queued.js.map +1 -1
- package/dist/stages/retryables.d.ts +5 -5
- package/dist/stages/retryables.d.ts.map +1 -1
- package/dist/stages/retryables.js +68 -53
- package/dist/stages/retryables.js.map +1 -1
- package/dist/stages/stage-builder.d.ts +5 -4
- package/dist/stages/stage-builder.d.ts.map +1 -1
- package/dist/stages/stage-builder.js +7 -2
- package/dist/stages/stage-builder.js.map +1 -1
- package/dist/stages/timelock.d.ts +1 -22
- package/dist/stages/timelock.d.ts.map +1 -1
- package/dist/stages/timelock.js +18 -10
- package/dist/stages/timelock.js.map +1 -1
- package/dist/stages/voting.js +1 -1
- package/dist/stages/voting.js.map +1 -1
- package/dist/tracker/context.js +1 -1
- package/dist/tracker/context.js.map +1 -1
- package/dist/tracker/execute.js +1 -1
- package/dist/tracker/pipeline.d.ts +0 -29
- package/dist/tracker/pipeline.d.ts.map +1 -1
- package/dist/tracker/pipeline.js +2 -8
- package/dist/tracker/pipeline.js.map +1 -1
- package/dist/tracker/query.js +1 -1
- package/dist/tracker/query.js.map +1 -1
- package/dist/tracker.js +2 -2
- package/dist/tracker.js.map +1 -1
- package/dist/types/calldata.d.ts +4 -6
- package/dist/types/calldata.d.ts.map +1 -1
- package/dist/types/core.d.ts +36 -34
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/core.js +33 -0
- package/dist/types/core.js.map +1 -1
- package/dist/types/cross-chain.d.ts +5 -61
- package/dist/types/cross-chain.d.ts.map +1 -1
- package/dist/types/election.d.ts +3 -6
- package/dist/types/election.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +6 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/simulation.d.ts +5 -7
- package/dist/types/simulation.d.ts.map +1 -1
- package/dist/types/stages.d.ts +19 -16
- package/dist/types/stages.d.ts.map +1 -1
- package/dist/types/stages.js +8 -1
- package/dist/types/stages.js.map +1 -1
- package/dist/types/tracking.d.ts +3 -30
- package/dist/types/tracking.d.ts.map +1 -1
- package/dist/utils/chain.d.ts +7 -3
- package/dist/utils/chain.d.ts.map +1 -1
- package/dist/utils/chain.js +13 -9
- package/dist/utils/chain.js.map +1 -1
- package/dist/utils/logger.d.ts +9 -3
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +53 -19
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/rpc-utils.d.ts +7 -8
- package/dist/utils/rpc-utils.d.ts.map +1 -1
- package/dist/utils/rpc-utils.js +20 -2
- package/dist/utils/rpc-utils.js.map +1 -1
- package/dist/utils/salt-computation.d.ts.map +1 -1
- package/dist/utils/salt-computation.js +2 -3
- package/dist/utils/salt-computation.js.map +1 -1
- package/dist/utils/stage-helpers.d.ts +5 -6
- package/dist/utils/stage-helpers.d.ts.map +1 -1
- package/dist/utils/stage-helpers.js +2 -10
- package/dist/utils/stage-helpers.js.map +1 -1
- package/dist/utils/stage-metadata.d.ts +2 -2
- package/dist/utils/stage-metadata.d.ts.map +1 -1
- package/dist/utils/stage-metadata.js +5 -5
- package/dist/utils/stage-metadata.js.map +1 -1
- package/package.json +8 -5
- package/dist/calldata/address-utils.d.ts +0 -23
- package/dist/calldata/address-utils.d.ts.map +0 -1
- package/dist/calldata/address-utils.js +0 -84
- package/dist/calldata/address-utils.js.map +0 -1
- package/dist/calldata/extraction.d.ts +0 -17
- package/dist/calldata/extraction.d.ts.map +0 -1
- package/dist/calldata/extraction.js +0 -56
- package/dist/calldata/extraction.js.map +0 -1
- package/dist/tracker/index.d.ts +0 -18
- package/dist/tracker/index.d.ts.map +0 -1
- package/dist/tracker/index.js +0 -70
- package/dist/tracker/index.js.map +0 -1
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -22
- package/dist/types.js.map +0 -1
- package/dist/utils/error-classification.d.ts +0 -13
- package/dist/utils/error-classification.d.ts.map +0 -1
- package/dist/utils/error-classification.js +0 -28
- package/dist/utils/error-classification.js.map +0 -1
- package/dist/utils/scoped-logger.d.ts +0 -43
- package/dist/utils/scoped-logger.d.ts.map +0 -1
- package/dist/utils/scoped-logger.js +0 -72
- package/dist/utils/scoped-logger.js.map +0 -1
- package/dist/utils/urls.d.ts +0 -28
- package/dist/utils/urls.d.ts.map +0 -1
- package/dist/utils/urls.js +0 -71
- package/dist/utils/urls.js.map +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Address Utilities
|
|
4
|
-
*
|
|
5
|
-
* Chain-aware address labeling for known governance contracts.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.getAddressLabel = getAddressLabel;
|
|
9
|
-
exports.getKnownAddresses = getKnownAddresses;
|
|
10
|
-
/**
|
|
11
|
-
* Known addresses registry organized by chain
|
|
12
|
-
*/
|
|
13
|
-
const KNOWN_ADDRESSES = {
|
|
14
|
-
arb1: {
|
|
15
|
-
// Governors
|
|
16
|
-
"0xf07DeD9dC292157749B6Fd268E37DF6EA38395B9": "Core Governor",
|
|
17
|
-
"0x789fC99093B09aD01C34DC7251D0C89ce743e5a4": "Treasury Governor",
|
|
18
|
-
"0x8a1cDA8dee421cD06023470608605934c16A05a0": "Nominee Election Governor",
|
|
19
|
-
"0x467923B9AE90BDB36BA88eCA11604D45F13b712C": "Member Election Governor",
|
|
20
|
-
// Timelocks
|
|
21
|
-
"0x34d45e99f7D8c45ed05B5cA72D54bbD1fb3F98f0": "L2 Core Timelock",
|
|
22
|
-
"0xbFc1FECa8B09A5c5D3EFfE7429eBE24b9c09EF58": "L2 Treasury Timelock",
|
|
23
|
-
// Other contracts
|
|
24
|
-
"0x912CE59144191C1204E64559FE8253a0e49E6548": "ARB Token",
|
|
25
|
-
"0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827": "Arb1 UpgradeExecutor",
|
|
26
|
-
"0xD509E5f5aEe2A205F554f36E8a7d56094494eDFC": "Security Council Manager",
|
|
27
|
-
// Precompiles
|
|
28
|
-
"0x0000000000000000000000000000000000000064": "ArbSys",
|
|
29
|
-
"0x000000000000000000000000000000000000006E": "ArbRetryableTx",
|
|
30
|
-
},
|
|
31
|
-
nova: {
|
|
32
|
-
"0x86a02dD71363c440b21F4c0E5B2Ad01Ffe1A7482": "Nova UpgradeExecutor",
|
|
33
|
-
},
|
|
34
|
-
ethereum: {
|
|
35
|
-
// Timelock
|
|
36
|
-
"0xE6841D92B0C345144506576eC13ECf5103aC7f49": "L1 Timelock",
|
|
37
|
-
// UpgradeExecutor
|
|
38
|
-
"0x3ffFbAdAF827559da092217e474760E2b2c3CeDd": "L1 UpgradeExecutor",
|
|
39
|
-
// Delayed Inboxes
|
|
40
|
-
"0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f": "Arb1 Delayed Inbox",
|
|
41
|
-
"0xc4448b71118c9071Bcb9734A0EAc55D18A153949": "Nova Delayed Inbox",
|
|
42
|
-
// Special addresses
|
|
43
|
-
"0xa723C008e76E379c55599D2E4d93879BeaFDa79C": "Retryable Ticket Magic",
|
|
44
|
-
// Outboxes
|
|
45
|
-
"0x0B9857ae2D4A3DBe74ffE1d7DF045bb7F96E4840": "Arb1 Outbox",
|
|
46
|
-
"0xD4B80C3D7240325D18E645B49e6535A3Bf95cc58": "Nova Outbox",
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Get known address label
|
|
51
|
-
*
|
|
52
|
-
* @param address - Contract address
|
|
53
|
-
* @param chain - Chain context (or undefined for unknown chains)
|
|
54
|
-
* @returns Label if known, undefined otherwise
|
|
55
|
-
*/
|
|
56
|
-
function getAddressLabel(address, chain) {
|
|
57
|
-
if (!chain)
|
|
58
|
-
return undefined;
|
|
59
|
-
const chainAddresses = KNOWN_ADDRESSES[chain];
|
|
60
|
-
const lowerAddress = address.toLowerCase();
|
|
61
|
-
for (const [addr, label] of Object.entries(chainAddresses)) {
|
|
62
|
-
if (addr.toLowerCase() === lowerAddress) {
|
|
63
|
-
return label;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Get all known addresses for a chain
|
|
70
|
-
*
|
|
71
|
-
* @param chain - Chain context
|
|
72
|
-
* @returns Array of known address entries
|
|
73
|
-
*/
|
|
74
|
-
function getKnownAddresses(chain) {
|
|
75
|
-
const chainAddresses = KNOWN_ADDRESSES[chain];
|
|
76
|
-
if (!chainAddresses)
|
|
77
|
-
return [];
|
|
78
|
-
return Object.entries(chainAddresses).map(([address, label]) => ({
|
|
79
|
-
address,
|
|
80
|
-
label,
|
|
81
|
-
chain,
|
|
82
|
-
}));
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=address-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address-utils.js","sourceRoot":"","sources":["../../src/calldata/address-utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA2DH,0CAiBC;AAQD,8CASC;AAxFD;;GAEG;AACH,MAAM,eAAe,GAAiD;IACpE,IAAI,EAAE;QACJ,YAAY;QACZ,4CAA4C,EAAE,eAAe;QAC7D,4CAA4C,EAAE,mBAAmB;QACjE,4CAA4C,EAAE,2BAA2B;QACzE,4CAA4C,EAAE,0BAA0B;QAExE,YAAY;QACZ,4CAA4C,EAAE,kBAAkB;QAChE,4CAA4C,EAAE,sBAAsB;QAEpE,kBAAkB;QAClB,4CAA4C,EAAE,WAAW;QACzD,4CAA4C,EAAE,sBAAsB;QACpE,4CAA4C,EAAE,0BAA0B;QAExE,cAAc;QACd,4CAA4C,EAAE,QAAQ;QACtD,4CAA4C,EAAE,gBAAgB;KAC/D;IACD,IAAI,EAAE;QACJ,4CAA4C,EAAE,sBAAsB;KACrE;IACD,QAAQ,EAAE;QACR,WAAW;QACX,4CAA4C,EAAE,aAAa;QAE3D,kBAAkB;QAClB,4CAA4C,EAAE,oBAAoB;QAElE,kBAAkB;QAClB,4CAA4C,EAAE,oBAAoB;QAClE,4CAA4C,EAAE,oBAAoB;QAElE,oBAAoB;QACpB,4CAA4C,EAAE,wBAAwB;QAEtE,WAAW;QACX,4CAA4C,EAAE,aAAa;QAC3D,4CAA4C,EAAE,aAAa;KAC5D;CACF,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,eAAe,CAC7B,OAAe,EACf,KAA+B;IAE/B,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,MAAM,cAAc,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAE3C,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QAC3D,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,KAAmB;IACnD,MAAM,cAAc,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAE/B,OAAO,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/D,OAAO;QACP,KAAK;QACL,KAAK;KACN,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calldata Extraction Module
|
|
3
|
-
*
|
|
4
|
-
* Utilities for extracting raw calldata, execution targets, and ETH values
|
|
5
|
-
* from different types of tracked stages (Proposal, Timelock, etc.).
|
|
6
|
-
*/
|
|
7
|
-
import { TrackedStage, ExtractedCalldata } from "../types";
|
|
8
|
-
/**
|
|
9
|
-
* Extract calldata, targets, and values from a tracked stage.
|
|
10
|
-
* Handles different data structures for Proposals vs Timelock operations.
|
|
11
|
-
* Ensures all returned arrays have the same length.
|
|
12
|
-
*
|
|
13
|
-
* @param stage The tracked stage to inspect
|
|
14
|
-
* @returns Object containing aligned arrays of calldatas, targets, and values
|
|
15
|
-
*/
|
|
16
|
-
export declare function extractCalldataFromStage(stage: TrackedStage): ExtractedCalldata;
|
|
17
|
-
//# sourceMappingURL=extraction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/calldata/extraction.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAoB,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7E;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,YAAY,GAAG,iBAAiB,CA4C/E"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Calldata Extraction Module
|
|
4
|
-
*
|
|
5
|
-
* Utilities for extracting raw calldata, execution targets, and ETH values
|
|
6
|
-
* from different types of tracked stages (Proposal, Timelock, etc.).
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.extractCalldataFromStage = extractCalldataFromStage;
|
|
10
|
-
/**
|
|
11
|
-
* Extract calldata, targets, and values from a tracked stage.
|
|
12
|
-
* Handles different data structures for Proposals vs Timelock operations.
|
|
13
|
-
* Ensures all returned arrays have the same length.
|
|
14
|
-
*
|
|
15
|
-
* @param stage The tracked stage to inspect
|
|
16
|
-
* @returns Object containing aligned arrays of calldatas, targets, and values
|
|
17
|
-
*/
|
|
18
|
-
function extractCalldataFromStage(stage) {
|
|
19
|
-
const data = stage.data;
|
|
20
|
-
const result = { calldatas: [], targets: [], values: [] };
|
|
21
|
-
// 1. Check for explicit calldatas array (Proposals)
|
|
22
|
-
// ProposalCreatedData and ProposalQueuedData use plural 'calldatas', 'targets', 'values'
|
|
23
|
-
if (data.calldatas && data.calldatas.length > 0) {
|
|
24
|
-
const count = data.calldatas.length;
|
|
25
|
-
const targets = data.targets || [];
|
|
26
|
-
const values = data.values || [];
|
|
27
|
-
// Strict length checks - these are part of the logic to ensure data integrity
|
|
28
|
-
if (targets.length !== count) {
|
|
29
|
-
throw new Error(`Mismatch in targets length: expected ${count}, got ${targets.length}`);
|
|
30
|
-
}
|
|
31
|
-
if (values.length !== count) {
|
|
32
|
-
throw new Error(`Mismatch in values length: expected ${count}, got ${values.length}`);
|
|
33
|
-
}
|
|
34
|
-
for (let i = 0; i < count; i++) {
|
|
35
|
-
result.calldatas.push(data.calldatas[i]);
|
|
36
|
-
result.targets.push(targets[i]);
|
|
37
|
-
result.values.push(values[i]);
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
// 2. Check for Timelock scheduled data (L1/L2 Timelock)
|
|
42
|
-
// Timelock stages usually have `callScheduledData` array containing the operations
|
|
43
|
-
if (data.callScheduledData) {
|
|
44
|
-
for (const scheduled of data.callScheduledData) {
|
|
45
|
-
// scheduled.data and scheduled.target are strictly typed in CallScheduledData
|
|
46
|
-
result.calldatas.push(scheduled.data);
|
|
47
|
-
result.targets.push(scheduled.target);
|
|
48
|
-
result.values.push(scheduled.value || "0");
|
|
49
|
-
}
|
|
50
|
-
if (result.calldatas.length > 0) {
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=extraction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extraction.js","sourceRoot":"","sources":["../../src/calldata/extraction.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAYH,4DA4CC;AApDD;;;;;;;GAOG;AACH,SAAgB,wBAAwB,CAAC,KAAmB;IAC1D,MAAM,IAAI,GAAG,KAAK,CAAC,IAAwB,CAAC;IAC5C,MAAM,MAAM,GAAsB,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAE7E,oDAAoD;IACpD,yFAAyF;IACzF,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QAEpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QAEjC,8EAA8E;QAC9E,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,wCAAwC,KAAK,SAAS,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1F,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,uCAAuC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACxF,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,wDAAwD;IACxD,mFAAmF;IACnF,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC/C,8EAA8E;YAC9E,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACtC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/tracker/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracker module re-exports
|
|
3
|
-
*
|
|
4
|
-
* This module consolidates exports from the tracker subsystem:
|
|
5
|
-
* - context.ts: TrackingContext state management
|
|
6
|
-
* - pipeline.ts: Stage tracking pipeline functions
|
|
7
|
-
* - discovery.ts: Proposal and timelock discovery
|
|
8
|
-
* - query.ts: Cache query operations
|
|
9
|
-
* - execute.ts: Transaction preparation
|
|
10
|
-
* - state.ts: Cache utilities
|
|
11
|
-
*/
|
|
12
|
-
export { Providers, CreateTrackingContextOptions, TrackingContext, createTrackingContext, addStage, isStageCompleted, getCompletedStage, getCachedStage, isComplete, getGovernorAddress, getProposalId, getTimelockAddress, getOperationId, getCallScheduledData, getFirstCallScheduledData, getQueueBlockNumber, getProposalData, getProposalType, getIsElection, getProposalState, getL2ExecutionTxHash, getFirstExecutableBlock, getOutboxExecutionTx, getL1ExecutionTxHash, createCheckpoint, toResult, } from "./context";
|
|
13
|
-
export { trackGovernorPipeline, trackTimelockPipeline } from "./pipeline";
|
|
14
|
-
export { discoverAll, discoverProposals, discoverTimelockOps, DiscoveredProposal, DiscoveredTimelockOp, loadWatermarks, saveWatermarks, WATERMARKS_KEY, } from "./discovery";
|
|
15
|
-
export { listCheckpointKeys, getCheckpoint, getAllCheckpoints, queryIncompleteCheckpoints, getStats, } from "./query";
|
|
16
|
-
export { prepareTransaction } from "./execute";
|
|
17
|
-
export { txHashCacheKey, readCacheStatus } from "./state";
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tracker/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAEL,SAAS,EACT,4BAA4B,EAC5B,eAAe,EAEf,qBAAqB,EAErB,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,UAAU,EAEV,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EAEpB,gBAAgB,EAChB,QAAQ,GACT,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAG1E,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,0BAA0B,EAC1B,QAAQ,GACT,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/tracker/index.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Tracker module re-exports
|
|
4
|
-
*
|
|
5
|
-
* This module consolidates exports from the tracker subsystem:
|
|
6
|
-
* - context.ts: TrackingContext state management
|
|
7
|
-
* - pipeline.ts: Stage tracking pipeline functions
|
|
8
|
-
* - discovery.ts: Proposal and timelock discovery
|
|
9
|
-
* - query.ts: Cache query operations
|
|
10
|
-
* - execute.ts: Transaction preparation
|
|
11
|
-
* - state.ts: Cache utilities
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.readCacheStatus = exports.txHashCacheKey = exports.prepareTransaction = exports.getStats = exports.queryIncompleteCheckpoints = exports.getAllCheckpoints = exports.getCheckpoint = exports.listCheckpointKeys = exports.WATERMARKS_KEY = exports.saveWatermarks = exports.loadWatermarks = exports.discoverTimelockOps = exports.discoverProposals = exports.discoverAll = exports.trackTimelockPipeline = exports.trackGovernorPipeline = exports.toResult = exports.createCheckpoint = exports.getL1ExecutionTxHash = exports.getOutboxExecutionTx = exports.getFirstExecutableBlock = exports.getL2ExecutionTxHash = exports.getProposalState = exports.getIsElection = exports.getProposalType = exports.getProposalData = exports.getQueueBlockNumber = exports.getFirstCallScheduledData = exports.getCallScheduledData = exports.getOperationId = exports.getTimelockAddress = exports.getProposalId = exports.getGovernorAddress = exports.isComplete = exports.getCachedStage = exports.getCompletedStage = exports.isStageCompleted = exports.addStage = exports.createTrackingContext = void 0;
|
|
15
|
-
// Context - TrackingContext state management
|
|
16
|
-
var context_1 = require("./context");
|
|
17
|
-
// State creation
|
|
18
|
-
Object.defineProperty(exports, "createTrackingContext", { enumerable: true, get: function () { return context_1.createTrackingContext; } });
|
|
19
|
-
// Stage management
|
|
20
|
-
Object.defineProperty(exports, "addStage", { enumerable: true, get: function () { return context_1.addStage; } });
|
|
21
|
-
Object.defineProperty(exports, "isStageCompleted", { enumerable: true, get: function () { return context_1.isStageCompleted; } });
|
|
22
|
-
Object.defineProperty(exports, "getCompletedStage", { enumerable: true, get: function () { return context_1.getCompletedStage; } });
|
|
23
|
-
Object.defineProperty(exports, "getCachedStage", { enumerable: true, get: function () { return context_1.getCachedStage; } });
|
|
24
|
-
Object.defineProperty(exports, "isComplete", { enumerable: true, get: function () { return context_1.isComplete; } });
|
|
25
|
-
// Derived getters
|
|
26
|
-
Object.defineProperty(exports, "getGovernorAddress", { enumerable: true, get: function () { return context_1.getGovernorAddress; } });
|
|
27
|
-
Object.defineProperty(exports, "getProposalId", { enumerable: true, get: function () { return context_1.getProposalId; } });
|
|
28
|
-
Object.defineProperty(exports, "getTimelockAddress", { enumerable: true, get: function () { return context_1.getTimelockAddress; } });
|
|
29
|
-
Object.defineProperty(exports, "getOperationId", { enumerable: true, get: function () { return context_1.getOperationId; } });
|
|
30
|
-
Object.defineProperty(exports, "getCallScheduledData", { enumerable: true, get: function () { return context_1.getCallScheduledData; } });
|
|
31
|
-
Object.defineProperty(exports, "getFirstCallScheduledData", { enumerable: true, get: function () { return context_1.getFirstCallScheduledData; } });
|
|
32
|
-
Object.defineProperty(exports, "getQueueBlockNumber", { enumerable: true, get: function () { return context_1.getQueueBlockNumber; } });
|
|
33
|
-
Object.defineProperty(exports, "getProposalData", { enumerable: true, get: function () { return context_1.getProposalData; } });
|
|
34
|
-
Object.defineProperty(exports, "getProposalType", { enumerable: true, get: function () { return context_1.getProposalType; } });
|
|
35
|
-
Object.defineProperty(exports, "getIsElection", { enumerable: true, get: function () { return context_1.getIsElection; } });
|
|
36
|
-
Object.defineProperty(exports, "getProposalState", { enumerable: true, get: function () { return context_1.getProposalState; } });
|
|
37
|
-
Object.defineProperty(exports, "getL2ExecutionTxHash", { enumerable: true, get: function () { return context_1.getL2ExecutionTxHash; } });
|
|
38
|
-
Object.defineProperty(exports, "getFirstExecutableBlock", { enumerable: true, get: function () { return context_1.getFirstExecutableBlock; } });
|
|
39
|
-
Object.defineProperty(exports, "getOutboxExecutionTx", { enumerable: true, get: function () { return context_1.getOutboxExecutionTx; } });
|
|
40
|
-
Object.defineProperty(exports, "getL1ExecutionTxHash", { enumerable: true, get: function () { return context_1.getL1ExecutionTxHash; } });
|
|
41
|
-
// Checkpoint
|
|
42
|
-
Object.defineProperty(exports, "createCheckpoint", { enumerable: true, get: function () { return context_1.createCheckpoint; } });
|
|
43
|
-
Object.defineProperty(exports, "toResult", { enumerable: true, get: function () { return context_1.toResult; } });
|
|
44
|
-
// Pipeline - Stage tracking functions
|
|
45
|
-
var pipeline_1 = require("./pipeline");
|
|
46
|
-
Object.defineProperty(exports, "trackGovernorPipeline", { enumerable: true, get: function () { return pipeline_1.trackGovernorPipeline; } });
|
|
47
|
-
Object.defineProperty(exports, "trackTimelockPipeline", { enumerable: true, get: function () { return pipeline_1.trackTimelockPipeline; } });
|
|
48
|
-
// Discovery
|
|
49
|
-
var discovery_1 = require("./discovery");
|
|
50
|
-
Object.defineProperty(exports, "discoverAll", { enumerable: true, get: function () { return discovery_1.discoverAll; } });
|
|
51
|
-
Object.defineProperty(exports, "discoverProposals", { enumerable: true, get: function () { return discovery_1.discoverProposals; } });
|
|
52
|
-
Object.defineProperty(exports, "discoverTimelockOps", { enumerable: true, get: function () { return discovery_1.discoverTimelockOps; } });
|
|
53
|
-
Object.defineProperty(exports, "loadWatermarks", { enumerable: true, get: function () { return discovery_1.loadWatermarks; } });
|
|
54
|
-
Object.defineProperty(exports, "saveWatermarks", { enumerable: true, get: function () { return discovery_1.saveWatermarks; } });
|
|
55
|
-
Object.defineProperty(exports, "WATERMARKS_KEY", { enumerable: true, get: function () { return discovery_1.WATERMARKS_KEY; } });
|
|
56
|
-
// Query
|
|
57
|
-
var query_1 = require("./query");
|
|
58
|
-
Object.defineProperty(exports, "listCheckpointKeys", { enumerable: true, get: function () { return query_1.listCheckpointKeys; } });
|
|
59
|
-
Object.defineProperty(exports, "getCheckpoint", { enumerable: true, get: function () { return query_1.getCheckpoint; } });
|
|
60
|
-
Object.defineProperty(exports, "getAllCheckpoints", { enumerable: true, get: function () { return query_1.getAllCheckpoints; } });
|
|
61
|
-
Object.defineProperty(exports, "queryIncompleteCheckpoints", { enumerable: true, get: function () { return query_1.queryIncompleteCheckpoints; } });
|
|
62
|
-
Object.defineProperty(exports, "getStats", { enumerable: true, get: function () { return query_1.getStats; } });
|
|
63
|
-
// Execute
|
|
64
|
-
var execute_1 = require("./execute");
|
|
65
|
-
Object.defineProperty(exports, "prepareTransaction", { enumerable: true, get: function () { return execute_1.prepareTransaction; } });
|
|
66
|
-
// State utilities
|
|
67
|
-
var state_1 = require("./state");
|
|
68
|
-
Object.defineProperty(exports, "txHashCacheKey", { enumerable: true, get: function () { return state_1.txHashCacheKey; } });
|
|
69
|
-
Object.defineProperty(exports, "readCacheStatus", { enumerable: true, get: function () { return state_1.readCacheStatus; } });
|
|
70
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tracker/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,6CAA6C;AAC7C,qCAgCmB;AA3BjB,iBAAiB;AACjB,gHAAA,qBAAqB,OAAA;AACrB,mBAAmB;AACnB,mGAAA,QAAQ,OAAA;AACR,2GAAA,gBAAgB,OAAA;AAChB,4GAAA,iBAAiB,OAAA;AACjB,yGAAA,cAAc,OAAA;AACd,qGAAA,UAAU,OAAA;AACV,kBAAkB;AAClB,6GAAA,kBAAkB,OAAA;AAClB,wGAAA,aAAa,OAAA;AACb,6GAAA,kBAAkB,OAAA;AAClB,yGAAA,cAAc,OAAA;AACd,+GAAA,oBAAoB,OAAA;AACpB,oHAAA,yBAAyB,OAAA;AACzB,8GAAA,mBAAmB,OAAA;AACnB,0GAAA,eAAe,OAAA;AACf,0GAAA,eAAe,OAAA;AACf,wGAAA,aAAa,OAAA;AACb,2GAAA,gBAAgB,OAAA;AAChB,+GAAA,oBAAoB,OAAA;AACpB,kHAAA,uBAAuB,OAAA;AACvB,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,aAAa;AACb,2GAAA,gBAAgB,OAAA;AAChB,mGAAA,QAAQ,OAAA;AAGV,sCAAsC;AACtC,uCAA0E;AAAjE,iHAAA,qBAAqB,OAAA;AAAE,iHAAA,qBAAqB,OAAA;AAErD,YAAY;AACZ,yCASqB;AARnB,wGAAA,WAAW,OAAA;AACX,8GAAA,iBAAiB,OAAA;AACjB,gHAAA,mBAAmB,OAAA;AAGnB,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AAGhB,QAAQ;AACR,iCAMiB;AALf,2GAAA,kBAAkB,OAAA;AAClB,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AACjB,mHAAA,0BAA0B,OAAA;AAC1B,iGAAA,QAAQ,OAAA;AAGV,UAAU;AACV,qCAA+C;AAAtC,6GAAA,kBAAkB,OAAA;AAE3B,kBAAkB;AAClB,iCAA0D;AAAjD,uGAAA,cAAc,OAAA;AAAE,wGAAA,eAAe,OAAA"}
|
package/dist/types.d.ts
DELETED
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,eAAe,CAAC"}
|
package/dist/types.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/**
|
|
18
|
-
* Type definitions for Arbitrum Governance Stage Tracking SDK
|
|
19
|
-
* Re-exports from domain modules in ./types/
|
|
20
|
-
*/
|
|
21
|
-
__exportStar(require("./types/index"), exports);
|
|
22
|
-
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,gDAA8B"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Classification Utilities
|
|
3
|
-
*
|
|
4
|
-
* Classifies errors for better error handling and tracking.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Check if an error is a gas estimation error.
|
|
8
|
-
* Gas estimation errors should not count against consecutive error tracking
|
|
9
|
-
* because they are often temporary (insufficient funds, contract state changes, etc.)
|
|
10
|
-
* and should be retried in the next run.
|
|
11
|
-
*/
|
|
12
|
-
export declare function isGasEstimationError(error: unknown): boolean;
|
|
13
|
-
//# sourceMappingURL=error-classification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-classification.d.ts","sourceRoot":"","sources":["../../src/utils/error-classification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAe5D"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Error Classification Utilities
|
|
4
|
-
*
|
|
5
|
-
* Classifies errors for better error handling and tracking.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.isGasEstimationError = isGasEstimationError;
|
|
9
|
-
/**
|
|
10
|
-
* Check if an error is a gas estimation error.
|
|
11
|
-
* Gas estimation errors should not count against consecutive error tracking
|
|
12
|
-
* because they are often temporary (insufficient funds, contract state changes, etc.)
|
|
13
|
-
* and should be retried in the next run.
|
|
14
|
-
*/
|
|
15
|
-
function isGasEstimationError(error) {
|
|
16
|
-
const message = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
|
|
17
|
-
return (message.includes("gas required exceeds") ||
|
|
18
|
-
message.includes("execution reverted") ||
|
|
19
|
-
message.includes("out of gas") ||
|
|
20
|
-
message.includes("intrinsic gas too low") ||
|
|
21
|
-
message.includes("insufficient funds for gas") ||
|
|
22
|
-
message.includes("cannot estimate gas") ||
|
|
23
|
-
message.includes("gas estimation") ||
|
|
24
|
-
message.includes("transaction may fail") ||
|
|
25
|
-
message.includes("gas limit") ||
|
|
26
|
-
message.includes("revert"));
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=error-classification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-classification.js","sourceRoot":"","sources":["../../src/utils/error-classification.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAQH,oDAeC;AArBD;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,KAAc;IACjD,MAAM,OAAO,GACX,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IACrF,OAAO,CACL,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACxC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QACtC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC9B,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACzC,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAC;QAC9C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QACvC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAClC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;QAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scoped Logger using AsyncLocalStorage
|
|
3
|
-
*
|
|
4
|
-
* Provides automatic context prefixing for concurrent operations.
|
|
5
|
-
* All log calls within a scope automatically include the scope prefix.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* import { withScope, scopedLog } from "./scoped-logger";
|
|
9
|
-
*
|
|
10
|
-
* // Create scoped logger
|
|
11
|
-
* const log = scopedLog("gov-tracker:discovery");
|
|
12
|
-
*
|
|
13
|
-
* // Run with scope - all nested logs get the prefix
|
|
14
|
-
* await withScope("core-gov", async () => {
|
|
15
|
-
* log("discovering..."); // outputs: [core-gov] discovering...
|
|
16
|
-
* await nestedFunction(); // nested calls also get prefix
|
|
17
|
-
* });
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Get current scope prefix, or empty string if not in a scope.
|
|
21
|
-
*/
|
|
22
|
-
export declare function getCurrentScope(): string;
|
|
23
|
-
/**
|
|
24
|
-
* Run a function within a logging scope.
|
|
25
|
-
* All scopedLog calls within this function (and nested calls) will
|
|
26
|
-
* automatically include the scope prefix.
|
|
27
|
-
*
|
|
28
|
-
* Scopes can be nested - inner scopes override outer scopes.
|
|
29
|
-
*/
|
|
30
|
-
export declare function withScope<T>(prefix: string, fn: () => T): T;
|
|
31
|
-
/**
|
|
32
|
-
* Create a scoped debug logger.
|
|
33
|
-
* Returns a function that automatically prepends the current scope.
|
|
34
|
-
*
|
|
35
|
-
* Unlike regular debug loggers, the scope is dynamically determined
|
|
36
|
-
* at call time using AsyncLocalStorage.
|
|
37
|
-
*/
|
|
38
|
-
export declare function scopedLog(namespace: string): (fmt: string, ...args: unknown[]) => void;
|
|
39
|
-
/**
|
|
40
|
-
* Create multiple scoped loggers for common namespaces.
|
|
41
|
-
*/
|
|
42
|
-
export declare function createScopedLoggers<K extends string>(namespaces: Record<K, string>): Record<K, (fmt: string, ...args: unknown[]) => void>;
|
|
43
|
-
//# sourceMappingURL=scoped-logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-logger.d.ts","sourceRoot":"","sources":["../../src/utils/scoped-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAWH;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAQtF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAClD,UAAU,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,GAC5B,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC,CAMtD"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Scoped Logger using AsyncLocalStorage
|
|
4
|
-
*
|
|
5
|
-
* Provides automatic context prefixing for concurrent operations.
|
|
6
|
-
* All log calls within a scope automatically include the scope prefix.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* import { withScope, scopedLog } from "./scoped-logger";
|
|
10
|
-
*
|
|
11
|
-
* // Create scoped logger
|
|
12
|
-
* const log = scopedLog("gov-tracker:discovery");
|
|
13
|
-
*
|
|
14
|
-
* // Run with scope - all nested logs get the prefix
|
|
15
|
-
* await withScope("core-gov", async () => {
|
|
16
|
-
* log("discovering..."); // outputs: [core-gov] discovering...
|
|
17
|
-
* await nestedFunction(); // nested calls also get prefix
|
|
18
|
-
* });
|
|
19
|
-
*/
|
|
20
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.getCurrentScope = getCurrentScope;
|
|
25
|
-
exports.withScope = withScope;
|
|
26
|
-
exports.scopedLog = scopedLog;
|
|
27
|
-
exports.createScopedLoggers = createScopedLoggers;
|
|
28
|
-
const async_hooks_1 = require("async_hooks");
|
|
29
|
-
const debug_1 = __importDefault(require("debug"));
|
|
30
|
-
const scopeStorage = new async_hooks_1.AsyncLocalStorage();
|
|
31
|
-
/**
|
|
32
|
-
* Get current scope prefix, or empty string if not in a scope.
|
|
33
|
-
*/
|
|
34
|
-
function getCurrentScope() {
|
|
35
|
-
return scopeStorage.getStore()?.prefix ?? "";
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Run a function within a logging scope.
|
|
39
|
-
* All scopedLog calls within this function (and nested calls) will
|
|
40
|
-
* automatically include the scope prefix.
|
|
41
|
-
*
|
|
42
|
-
* Scopes can be nested - inner scopes override outer scopes.
|
|
43
|
-
*/
|
|
44
|
-
function withScope(prefix, fn) {
|
|
45
|
-
return scopeStorage.run({ prefix }, fn);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Create a scoped debug logger.
|
|
49
|
-
* Returns a function that automatically prepends the current scope.
|
|
50
|
-
*
|
|
51
|
-
* Unlike regular debug loggers, the scope is dynamically determined
|
|
52
|
-
* at call time using AsyncLocalStorage.
|
|
53
|
-
*/
|
|
54
|
-
function scopedLog(namespace) {
|
|
55
|
-
const baseLog = (0, debug_1.default)(namespace);
|
|
56
|
-
return (fmt, ...args) => {
|
|
57
|
-
const scope = getCurrentScope();
|
|
58
|
-
const prefix = scope ? `[${scope}] ` : "";
|
|
59
|
-
baseLog(prefix + fmt, ...args);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Create multiple scoped loggers for common namespaces.
|
|
64
|
-
*/
|
|
65
|
-
function createScopedLoggers(namespaces) {
|
|
66
|
-
const loggers = {};
|
|
67
|
-
for (const [key, ns] of Object.entries(namespaces)) {
|
|
68
|
-
loggers[key] = scopedLog(ns);
|
|
69
|
-
}
|
|
70
|
-
return loggers;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=scoped-logger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-logger.js","sourceRoot":"","sources":["../../src/utils/scoped-logger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;AAcH,0CAEC;AASD,8BAEC;AASD,8BAQC;AAKD,kDAQC;AAvDD,6CAAgD;AAChD,kDAAgC;AAMhC,MAAM,YAAY,GAAG,IAAI,+BAAiB,EAAY,CAAC;AAEvD;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO,YAAY,CAAC,QAAQ,EAAE,EAAE,MAAM,IAAI,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,SAAS,CAAI,MAAc,EAAE,EAAW;IACtD,OAAO,YAAY,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,SAAiB;IACzC,MAAM,OAAO,GAAG,IAAA,eAAW,EAAC,SAAS,CAAC,CAAC;IAEvC,OAAO,CAAC,GAAW,EAAE,GAAG,IAAe,EAAE,EAAE;QACzC,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,UAA6B;IAE7B,MAAM,OAAO,GAAG,EAA0D,CAAC;IAC3E,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAkB,EAAE,CAAC;QACpE,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/utils/urls.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ChainType, StageTransaction, ChainContext } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Map ChainType to numeric chain ID
|
|
4
|
-
*/
|
|
5
|
-
export declare function chainTypeToId(chain: ChainType): number;
|
|
6
|
-
export declare function getExplorerUrl(chainId: number, type: "tx" | "address", hash: string): string;
|
|
7
|
-
export declare function getTxUrl(chainId: number, txHash: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Get block explorer URL for a stage transaction
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const stage = result.stages[0];
|
|
14
|
-
* for (const tx of stage.transactions) {
|
|
15
|
-
* console.log(`${tx.hash}: ${getStageTransactionUrl(tx)}`);
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare function getStageTransactionUrl(tx: StageTransaction): string;
|
|
20
|
-
/**
|
|
21
|
-
* Get block explorer URL for a transaction
|
|
22
|
-
*
|
|
23
|
-
* @param txHash - Transaction hash
|
|
24
|
-
* @param chain - Chain context
|
|
25
|
-
* @returns Full explorer URL
|
|
26
|
-
*/
|
|
27
|
-
export declare function getTxExplorerUrl(txHash: string, chain: ChainContext): string;
|
|
28
|
-
//# sourceMappingURL=urls.d.ts.map
|
package/dist/utils/urls.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../src/utils/urls.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE1E;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAStD;AAWD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAW5F;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAGnE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAG5E"}
|
package/dist/utils/urls.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.chainTypeToId = chainTypeToId;
|
|
4
|
-
exports.getExplorerUrl = getExplorerUrl;
|
|
5
|
-
exports.getTxUrl = getTxUrl;
|
|
6
|
-
exports.getStageTransactionUrl = getStageTransactionUrl;
|
|
7
|
-
exports.getTxExplorerUrl = getTxExplorerUrl;
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
|
-
/**
|
|
10
|
-
* Map ChainType to numeric chain ID
|
|
11
|
-
*/
|
|
12
|
-
function chainTypeToId(chain) {
|
|
13
|
-
switch (chain) {
|
|
14
|
-
case "L1":
|
|
15
|
-
return constants_1.CHAIN_IDS.ETHEREUM;
|
|
16
|
-
case "L2":
|
|
17
|
-
return constants_1.CHAIN_IDS.ARB_ONE;
|
|
18
|
-
case "NOVA":
|
|
19
|
-
return constants_1.CHAIN_IDS.NOVA;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Explorer base URLs by chain
|
|
24
|
-
*/
|
|
25
|
-
const EXPLORER_URLS = {
|
|
26
|
-
arb1: "https://arbiscan.io",
|
|
27
|
-
nova: "https://nova.arbiscan.io",
|
|
28
|
-
ethereum: "https://etherscan.io",
|
|
29
|
-
};
|
|
30
|
-
function getExplorerUrl(chainId, type, hash) {
|
|
31
|
-
switch (chainId) {
|
|
32
|
-
case 1: // Ethereum
|
|
33
|
-
return `https://etherscan.io/${type}/${hash}`;
|
|
34
|
-
case constants_1.CHAIN_IDS.ARB_ONE:
|
|
35
|
-
return `https://arbiscan.io/${type}/${hash}`;
|
|
36
|
-
case constants_1.CHAIN_IDS.NOVA:
|
|
37
|
-
return `https://nova.arbiscan.io/${type}/${hash}`;
|
|
38
|
-
default:
|
|
39
|
-
return `https://etherscan.io/${type}/${hash}`;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function getTxUrl(chainId, txHash) {
|
|
43
|
-
return getExplorerUrl(chainId, "tx", txHash);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Get block explorer URL for a stage transaction
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* const stage = result.stages[0];
|
|
51
|
-
* for (const tx of stage.transactions) {
|
|
52
|
-
* console.log(`${tx.hash}: ${getStageTransactionUrl(tx)}`);
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
function getStageTransactionUrl(tx) {
|
|
57
|
-
const chainId = chainTypeToId(tx.chain);
|
|
58
|
-
return getTxUrl(chainId, tx.hash);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Get block explorer URL for a transaction
|
|
62
|
-
*
|
|
63
|
-
* @param txHash - Transaction hash
|
|
64
|
-
* @param chain - Chain context
|
|
65
|
-
* @returns Full explorer URL
|
|
66
|
-
*/
|
|
67
|
-
function getTxExplorerUrl(txHash, chain) {
|
|
68
|
-
const baseUrl = EXPLORER_URLS[chain] ?? EXPLORER_URLS.ethereum;
|
|
69
|
-
return `${baseUrl}/tx/${txHash}`;
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=urls.js.map
|
package/dist/utils/urls.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../src/utils/urls.ts"],"names":[],"mappings":";;AAMA,sCASC;AAWD,wCAWC;AAED,4BAEC;AAaD,wDAGC;AASD,4CAGC;AArED,4CAAyC;AAGzC;;GAEG;AACH,SAAgB,aAAa,CAAC,KAAgB;IAC5C,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,IAAI;YACP,OAAO,qBAAS,CAAC,QAAQ,CAAC;QAC5B,KAAK,IAAI;YACP,OAAO,qBAAS,CAAC,OAAO,CAAC;QAC3B,KAAK,MAAM;YACT,OAAO,qBAAS,CAAC,IAAI,CAAC;IAC1B,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,aAAa,GAAiC;IAClD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,0BAA0B;IAChC,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AAEF,SAAgB,cAAc,CAAC,OAAe,EAAE,IAAsB,EAAE,IAAY;IAClF,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,CAAC,EAAE,WAAW;YACjB,OAAO,wBAAwB,IAAI,IAAI,IAAI,EAAE,CAAC;QAChD,KAAK,qBAAS,CAAC,OAAO;YACpB,OAAO,uBAAuB,IAAI,IAAI,IAAI,EAAE,CAAC;QAC/C,KAAK,qBAAS,CAAC,IAAI;YACjB,OAAO,4BAA4B,IAAI,IAAI,IAAI,EAAE,CAAC;QACpD;YACE,OAAO,wBAAwB,IAAI,IAAI,IAAI,EAAE,CAAC;IAClD,CAAC;AACH,CAAC;AAED,SAAgB,QAAQ,CAAC,OAAe,EAAE,MAAc;IACtD,OAAO,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,sBAAsB,CAAC,EAAoB;IACzD,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,MAAc,EAAE,KAAmB;IAClE,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC;IAC/D,OAAO,GAAG,OAAO,OAAO,MAAM,EAAE,CAAC;AACnC,CAAC"}
|