@gzeoneth/gov-tracker 0.1.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/LICENSE +191 -0
- package/README.md +201 -0
- package/dist/abis.d.ts +79 -0
- package/dist/abis.d.ts.map +1 -0
- package/dist/abis.js +159 -0
- package/dist/abis.js.map +1 -0
- package/dist/cli/lib/cli.d.ts +92 -0
- package/dist/cli/lib/cli.d.ts.map +1 -0
- package/dist/cli/lib/cli.js +562 -0
- package/dist/cli/lib/cli.js.map +1 -0
- package/dist/cli/lib/election-check.d.ts +46 -0
- package/dist/cli/lib/election-check.d.ts.map +1 -0
- package/dist/cli/lib/election-check.js +136 -0
- package/dist/cli/lib/election-check.js.map +1 -0
- package/dist/cli/lib/json-state.d.ts +100 -0
- package/dist/cli/lib/json-state.d.ts.map +1 -0
- package/dist/cli/lib/json-state.js +225 -0
- package/dist/cli/lib/json-state.js.map +1 -0
- package/dist/cli/monitor.d.ts +3 -0
- package/dist/cli/monitor.d.ts.map +1 -0
- package/dist/cli/monitor.js +442 -0
- package/dist/cli/monitor.js.map +1 -0
- package/dist/constants.d.ts +235 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +293 -0
- package/dist/constants.js.map +1 -0
- package/dist/discovery/governor-discovery.d.ts +84 -0
- package/dist/discovery/governor-discovery.d.ts.map +1 -0
- package/dist/discovery/governor-discovery.js +310 -0
- package/dist/discovery/governor-discovery.js.map +1 -0
- package/dist/discovery/security-council.d.ts +68 -0
- package/dist/discovery/security-council.d.ts.map +1 -0
- package/dist/discovery/security-council.js +181 -0
- package/dist/discovery/security-council.js.map +1 -0
- package/dist/discovery/timelock-discovery.d.ts +99 -0
- package/dist/discovery/timelock-discovery.d.ts.map +1 -0
- package/dist/discovery/timelock-discovery.js +322 -0
- package/dist/discovery/timelock-discovery.js.map +1 -0
- package/dist/election.d.ts +172 -0
- package/dist/election.d.ts.map +1 -0
- package/dist/election.js +464 -0
- package/dist/election.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +164 -0
- package/dist/index.js.map +1 -0
- package/dist/stages/base.d.ts +127 -0
- package/dist/stages/base.d.ts.map +1 -0
- package/dist/stages/base.js +280 -0
- package/dist/stages/base.js.map +1 -0
- package/dist/stages/l2-to-l1-message.d.ts +108 -0
- package/dist/stages/l2-to-l1-message.d.ts.map +1 -0
- package/dist/stages/l2-to-l1-message.js +422 -0
- package/dist/stages/l2-to-l1-message.js.map +1 -0
- package/dist/stages/proposal-created.d.ts +20 -0
- package/dist/stages/proposal-created.d.ts.map +1 -0
- package/dist/stages/proposal-created.js +62 -0
- package/dist/stages/proposal-created.js.map +1 -0
- package/dist/stages/proposal-queued.d.ts +39 -0
- package/dist/stages/proposal-queued.d.ts.map +1 -0
- package/dist/stages/proposal-queued.js +131 -0
- package/dist/stages/proposal-queued.js.map +1 -0
- package/dist/stages/retryables.d.ts +79 -0
- package/dist/stages/retryables.d.ts.map +1 -0
- package/dist/stages/retryables.js +307 -0
- package/dist/stages/retryables.js.map +1 -0
- package/dist/stages/stage-builder.d.ts +46 -0
- package/dist/stages/stage-builder.d.ts.map +1 -0
- package/dist/stages/stage-builder.js +87 -0
- package/dist/stages/stage-builder.js.map +1 -0
- package/dist/stages/timelock.d.ts +100 -0
- package/dist/stages/timelock.d.ts.map +1 -0
- package/dist/stages/timelock.js +552 -0
- package/dist/stages/timelock.js.map +1 -0
- package/dist/stages/voting.d.ts +18 -0
- package/dist/stages/voting.d.ts.map +1 -0
- package/dist/stages/voting.js +109 -0
- package/dist/stages/voting.js.map +1 -0
- package/dist/tracker/context.d.ts +111 -0
- package/dist/tracker/context.d.ts.map +1 -0
- package/dist/tracker/context.js +264 -0
- package/dist/tracker/context.js.map +1 -0
- package/dist/tracker/discovery.d.ts +89 -0
- package/dist/tracker/discovery.d.ts.map +1 -0
- package/dist/tracker/discovery.js +228 -0
- package/dist/tracker/discovery.js.map +1 -0
- package/dist/tracker/execute.d.ts +44 -0
- package/dist/tracker/execute.d.ts.map +1 -0
- package/dist/tracker/execute.js +126 -0
- package/dist/tracker/execute.js.map +1 -0
- package/dist/tracker/index.d.ts +18 -0
- package/dist/tracker/index.d.ts.map +1 -0
- package/dist/tracker/index.js +70 -0
- package/dist/tracker/index.js.map +1 -0
- package/dist/tracker/pipeline.d.ts +47 -0
- package/dist/tracker/pipeline.d.ts.map +1 -0
- package/dist/tracker/pipeline.js +299 -0
- package/dist/tracker/pipeline.js.map +1 -0
- package/dist/tracker/query.d.ts +45 -0
- package/dist/tracker/query.d.ts.map +1 -0
- package/dist/tracker/query.js +159 -0
- package/dist/tracker/query.js.map +1 -0
- package/dist/tracker/state.d.ts +104 -0
- package/dist/tracker/state.d.ts.map +1 -0
- package/dist/tracker/state.js +287 -0
- package/dist/tracker/state.js.map +1 -0
- package/dist/tracker.d.ts +261 -0
- package/dist/tracker.d.ts.map +1 -0
- package/dist/tracker.js +556 -0
- package/dist/tracker.js.map +1 -0
- package/dist/types/config.d.ts +81 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +6 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/core.d.ts +51 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +6 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/cross-chain.d.ts +80 -0
- package/dist/types/cross-chain.d.ts.map +1 -0
- package/dist/types/cross-chain.js +6 -0
- package/dist/types/cross-chain.js.map +1 -0
- package/dist/types/election.d.ts +59 -0
- package/dist/types/election.d.ts.map +1 -0
- package/dist/types/election.js +6 -0
- package/dist/types/election.js.map +1 -0
- package/dist/types/governor.d.ts +71 -0
- package/dist/types/governor.d.ts.map +1 -0
- package/dist/types/governor.js +6 -0
- package/dist/types/governor.js.map +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +21 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/stages.d.ts +189 -0
- package/dist/types/stages.d.ts.map +1 -0
- package/dist/types/stages.js +23 -0
- package/dist/types/stages.js.map +1 -0
- package/dist/types/timelock.d.ts +108 -0
- package/dist/types/timelock.d.ts.map +1 -0
- package/dist/types/timelock.js +6 -0
- package/dist/types/timelock.js.map +1 -0
- package/dist/types/tracking.d.ts +180 -0
- package/dist/types/tracking.d.ts.map +1 -0
- package/dist/types/tracking.js +6 -0
- package/dist/types/tracking.js.map +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/chain.d.ts +18 -0
- package/dist/utils/chain.d.ts.map +1 -0
- package/dist/utils/chain.js +34 -0
- package/dist/utils/chain.js.map +1 -0
- package/dist/utils/log-filters.d.ts +67 -0
- package/dist/utils/log-filters.d.ts.map +1 -0
- package/dist/utils/log-filters.js +116 -0
- package/dist/utils/log-filters.js.map +1 -0
- package/dist/utils/log-search.d.ts +76 -0
- package/dist/utils/log-search.d.ts.map +1 -0
- package/dist/utils/log-search.js +142 -0
- package/dist/utils/log-search.js.map +1 -0
- package/dist/utils/logger.d.ts +41 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +50 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/operation-id.d.ts +48 -0
- package/dist/utils/operation-id.d.ts.map +1 -0
- package/dist/utils/operation-id.js +102 -0
- package/dist/utils/operation-id.js.map +1 -0
- package/dist/utils/rpc-utils.d.ts +30 -0
- package/dist/utils/rpc-utils.d.ts.map +1 -0
- package/dist/utils/rpc-utils.js +99 -0
- package/dist/utils/rpc-utils.js.map +1 -0
- package/dist/utils/salt-computation.d.ts +78 -0
- package/dist/utils/salt-computation.d.ts.map +1 -0
- package/dist/utils/salt-computation.js +132 -0
- package/dist/utils/salt-computation.js.map +1 -0
- package/dist/utils/salt-resolver.d.ts +63 -0
- package/dist/utils/salt-resolver.d.ts.map +1 -0
- package/dist/utils/salt-resolver.js +144 -0
- package/dist/utils/salt-resolver.js.map +1 -0
- package/dist/utils/scoped-logger.d.ts +43 -0
- package/dist/utils/scoped-logger.d.ts.map +1 -0
- package/dist/utils/scoped-logger.js +72 -0
- package/dist/utils/scoped-logger.js.map +1 -0
- package/dist/utils/stage-helpers.d.ts +51 -0
- package/dist/utils/stage-helpers.d.ts.map +1 -0
- package/dist/utils/stage-helpers.js +143 -0
- package/dist/utils/stage-helpers.js.map +1 -0
- package/dist/utils/stage-metadata.d.ts +62 -0
- package/dist/utils/stage-metadata.d.ts.map +1 -0
- package/dist/utils/stage-metadata.js +140 -0
- package/dist/utils/stage-metadata.js.map +1 -0
- package/dist/utils/timing.d.ts +115 -0
- package/dist/utils/timing.d.ts.map +1 -0
- package/dist/utils/timing.js +303 -0
- package/dist/utils/timing.js.map +1 -0
- package/dist/utils/urls.d.ts +20 -0
- package/dist/utils/urls.d.ts.map +1 -0
- package/dist/utils/urls.js +51 -0
- package/dist/utils/urls.js.map +1 -0
- package/package.json +72 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Arbitrum Governance Stage Tracking SDK
|
|
4
|
+
*
|
|
5
|
+
* A lightweight, high-performance library for tracking Arbitrum DAO
|
|
6
|
+
* governance proposal lifecycle stages.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { createTracker, findExecutableStage } from "@gzeoneth/gov-tracker";
|
|
11
|
+
*
|
|
12
|
+
* const tracker = createTracker({
|
|
13
|
+
* l2Provider: new ethers.providers.JsonRpcProvider(ARB1_RPC),
|
|
14
|
+
* l1Provider: new ethers.providers.JsonRpcProvider(ETH_RPC),
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* const results = await tracker.trackByTxHash(proposalCreationTxHash);
|
|
18
|
+
* const readyStage = findExecutableStage(results[0].stages);
|
|
19
|
+
* if (readyStage) {
|
|
20
|
+
* const prep = await tracker.prepareTransaction(readyStage);
|
|
21
|
+
* if (prep.success) {
|
|
22
|
+
* const tx = await signer.sendTransaction(prep.prepared);
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
* @packageDocumentation
|
|
27
|
+
*/
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.prepareTimelockStage = exports.prepareTimelockBatch = exports.prepareTimelockOperation = exports.tryFindSalt = exports.computeAndValidateOperationHash = exports.validateSaltBatch = exports.validateSalt = exports.decodeL1TimelockSchedule = exports.generateSecurityCouncilSalt = exports.saltFromDescription = exports.getL1BlockNumberFromL2 = exports.estimateTimestampFromBlock = exports.calculateRemainingSeconds = exports.calculateExpectedEta = exports.calculateEta = exports.checkVettingPeriod = exports.extractSecurityCouncilParamsForOperation = exports.extractSecurityCouncilParams = exports.isSecurityCouncilElectionProposal = exports.isSecurityCouncilOperation = exports.findCallScheduledByTxHash = exports.getTimelockState = exports.getTimelockOperationState = exports.isL1Timelock = exports.isKnownL2Timelock = exports.discoverProposalByTxHash = exports.getProposalState = exports.getTimelockAddress = exports.detectGovernorCapabilities = exports.isElectionProposal = exports.detectProposalType = exports.isTimelockStage = exports.extractOperationId = exports.areAllStagesComplete = exports.getCurrentStage = exports.getTrackingStatusSummary = exports.needsAction = exports.findAllExecutableStages = exports.findExecutableStage = exports.buildDefaultTargets = exports.isElectionGovernor = exports.CHUNK_SIZES = exports.DEFAULT_RPC_URLS = exports.CHAIN_IDS = exports.ADDRESSES = exports.getStageData = exports.isStageType = exports.extractTimelockLink = exports.createTracker = exports.ProposalStageTracker = void 0;
|
|
30
|
+
exports.createTrackingContext = exports.createCheckpoint = exports.prepareMemberElectionTrigger = exports.getElectionProposalParams = exports.getElectionProposalId = exports.trackElectionProposal = exports.hasVettingPeriod = exports.prepareElectionCreation = exports.checkElectionStatus = exports.getChainType = exports.isAddressIn = exports.addressEquals = exports.getTotalExpectedDuration = exports.formatStageTitle = exports.getActionableStages = exports.getAllStageMetadata = exports.getStageMetadata = exports.chainTypeToId = exports.getStageTransactionUrl = exports.getTxUrl = exports.prepareGovernorQueue = exports.prepareRetryableStage = exports.prepareAllRetryables = exports.prepareRetryableRedemption = exports.getL2ToL1Messages = exports.prepareL2ToL1MessageStage = exports.prepareL2ToL1Message = exports.calculateBatchRetryableValues = exports.calculateRetryableExecutionValue = void 0;
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// TIER 1: Core Public API
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// Main entry points
|
|
35
|
+
var tracker_1 = require("./tracker");
|
|
36
|
+
Object.defineProperty(exports, "ProposalStageTracker", { enumerable: true, get: function () { return tracker_1.ProposalStageTracker; } });
|
|
37
|
+
Object.defineProperty(exports, "createTracker", { enumerable: true, get: function () { return tracker_1.createTracker; } });
|
|
38
|
+
Object.defineProperty(exports, "extractTimelockLink", { enumerable: true, get: function () { return tracker_1.extractTimelockLink; } });
|
|
39
|
+
// Type guards
|
|
40
|
+
var types_1 = require("./types");
|
|
41
|
+
Object.defineProperty(exports, "isStageType", { enumerable: true, get: function () { return types_1.isStageType; } });
|
|
42
|
+
Object.defineProperty(exports, "getStageData", { enumerable: true, get: function () { return types_1.getStageData; } });
|
|
43
|
+
// Constants
|
|
44
|
+
var constants_1 = require("./constants");
|
|
45
|
+
Object.defineProperty(exports, "ADDRESSES", { enumerable: true, get: function () { return constants_1.ADDRESSES; } });
|
|
46
|
+
Object.defineProperty(exports, "CHAIN_IDS", { enumerable: true, get: function () { return constants_1.CHAIN_IDS; } });
|
|
47
|
+
Object.defineProperty(exports, "DEFAULT_RPC_URLS", { enumerable: true, get: function () { return constants_1.DEFAULT_RPC_URLS; } });
|
|
48
|
+
Object.defineProperty(exports, "CHUNK_SIZES", { enumerable: true, get: function () { return constants_1.CHUNK_SIZES; } });
|
|
49
|
+
Object.defineProperty(exports, "isElectionGovernor", { enumerable: true, get: function () { return constants_1.isElectionGovernor; } });
|
|
50
|
+
Object.defineProperty(exports, "buildDefaultTargets", { enumerable: true, get: function () { return constants_1.buildDefaultTargets; } });
|
|
51
|
+
// Stage utilities
|
|
52
|
+
var base_1 = require("./stages/base");
|
|
53
|
+
Object.defineProperty(exports, "findExecutableStage", { enumerable: true, get: function () { return base_1.findExecutableStage; } });
|
|
54
|
+
Object.defineProperty(exports, "findAllExecutableStages", { enumerable: true, get: function () { return base_1.findAllExecutableStages; } });
|
|
55
|
+
Object.defineProperty(exports, "needsAction", { enumerable: true, get: function () { return base_1.needsAction; } });
|
|
56
|
+
Object.defineProperty(exports, "getTrackingStatusSummary", { enumerable: true, get: function () { return base_1.getTrackingStatusSummary; } });
|
|
57
|
+
Object.defineProperty(exports, "getCurrentStage", { enumerable: true, get: function () { return base_1.getCurrentStage; } });
|
|
58
|
+
Object.defineProperty(exports, "areAllStagesComplete", { enumerable: true, get: function () { return base_1.areAllStagesComplete; } });
|
|
59
|
+
Object.defineProperty(exports, "extractOperationId", { enumerable: true, get: function () { return base_1.extractOperationId; } });
|
|
60
|
+
Object.defineProperty(exports, "isTimelockStage", { enumerable: true, get: function () { return base_1.isTimelockStage; } });
|
|
61
|
+
// ============================================================================
|
|
62
|
+
// TIER 2: Advanced API - Power user functions
|
|
63
|
+
// ============================================================================
|
|
64
|
+
// Governor introspection
|
|
65
|
+
var governor_discovery_1 = require("./discovery/governor-discovery");
|
|
66
|
+
Object.defineProperty(exports, "detectProposalType", { enumerable: true, get: function () { return governor_discovery_1.detectProposalType; } });
|
|
67
|
+
Object.defineProperty(exports, "isElectionProposal", { enumerable: true, get: function () { return governor_discovery_1.isElectionProposal; } });
|
|
68
|
+
Object.defineProperty(exports, "detectGovernorCapabilities", { enumerable: true, get: function () { return governor_discovery_1.detectGovernorCapabilities; } });
|
|
69
|
+
Object.defineProperty(exports, "getTimelockAddress", { enumerable: true, get: function () { return governor_discovery_1.getTimelockAddress; } });
|
|
70
|
+
Object.defineProperty(exports, "getProposalState", { enumerable: true, get: function () { return governor_discovery_1.getProposalState; } });
|
|
71
|
+
Object.defineProperty(exports, "discoverProposalByTxHash", { enumerable: true, get: function () { return governor_discovery_1.discoverProposalByTxHash; } });
|
|
72
|
+
// Timelock introspection
|
|
73
|
+
var timelock_discovery_1 = require("./discovery/timelock-discovery");
|
|
74
|
+
Object.defineProperty(exports, "isKnownL2Timelock", { enumerable: true, get: function () { return timelock_discovery_1.isKnownL2Timelock; } });
|
|
75
|
+
Object.defineProperty(exports, "isL1Timelock", { enumerable: true, get: function () { return timelock_discovery_1.isL1Timelock; } });
|
|
76
|
+
Object.defineProperty(exports, "getTimelockOperationState", { enumerable: true, get: function () { return timelock_discovery_1.getTimelockOperationState; } });
|
|
77
|
+
Object.defineProperty(exports, "getTimelockState", { enumerable: true, get: function () { return timelock_discovery_1.getTimelockState; } });
|
|
78
|
+
Object.defineProperty(exports, "findCallScheduledByTxHash", { enumerable: true, get: function () { return timelock_discovery_1.findCallScheduledByTxHash; } });
|
|
79
|
+
// Security Council
|
|
80
|
+
var security_council_1 = require("./discovery/security-council");
|
|
81
|
+
Object.defineProperty(exports, "isSecurityCouncilOperation", { enumerable: true, get: function () { return security_council_1.isSecurityCouncilOperation; } });
|
|
82
|
+
Object.defineProperty(exports, "isSecurityCouncilElectionProposal", { enumerable: true, get: function () { return security_council_1.isSecurityCouncilElectionProposal; } });
|
|
83
|
+
Object.defineProperty(exports, "extractSecurityCouncilParams", { enumerable: true, get: function () { return security_council_1.extractSecurityCouncilParams; } });
|
|
84
|
+
Object.defineProperty(exports, "extractSecurityCouncilParamsForOperation", { enumerable: true, get: function () { return security_council_1.extractSecurityCouncilParamsForOperation; } });
|
|
85
|
+
Object.defineProperty(exports, "checkVettingPeriod", { enumerable: true, get: function () { return security_council_1.checkVettingPeriod; } });
|
|
86
|
+
// Timing utilities
|
|
87
|
+
var timing_1 = require("./utils/timing");
|
|
88
|
+
Object.defineProperty(exports, "calculateEta", { enumerable: true, get: function () { return timing_1.calculateEta; } });
|
|
89
|
+
Object.defineProperty(exports, "calculateExpectedEta", { enumerable: true, get: function () { return timing_1.calculateExpectedEta; } });
|
|
90
|
+
Object.defineProperty(exports, "calculateRemainingSeconds", { enumerable: true, get: function () { return timing_1.calculateRemainingSeconds; } });
|
|
91
|
+
Object.defineProperty(exports, "estimateTimestampFromBlock", { enumerable: true, get: function () { return timing_1.estimateTimestampFromBlock; } });
|
|
92
|
+
Object.defineProperty(exports, "getL1BlockNumberFromL2", { enumerable: true, get: function () { return timing_1.getL1BlockNumberFromL2; } });
|
|
93
|
+
// Salt utilities
|
|
94
|
+
var salt_computation_1 = require("./utils/salt-computation");
|
|
95
|
+
Object.defineProperty(exports, "saltFromDescription", { enumerable: true, get: function () { return salt_computation_1.saltFromDescription; } });
|
|
96
|
+
Object.defineProperty(exports, "generateSecurityCouncilSalt", { enumerable: true, get: function () { return salt_computation_1.generateSecurityCouncilSalt; } });
|
|
97
|
+
Object.defineProperty(exports, "decodeL1TimelockSchedule", { enumerable: true, get: function () { return salt_computation_1.decodeL1TimelockSchedule; } });
|
|
98
|
+
// Operation ID utilities
|
|
99
|
+
var operation_id_1 = require("./utils/operation-id");
|
|
100
|
+
Object.defineProperty(exports, "validateSalt", { enumerable: true, get: function () { return operation_id_1.validateSalt; } });
|
|
101
|
+
Object.defineProperty(exports, "validateSaltBatch", { enumerable: true, get: function () { return operation_id_1.validateSaltBatch; } });
|
|
102
|
+
Object.defineProperty(exports, "computeAndValidateOperationHash", { enumerable: true, get: function () { return operation_id_1.computeAndValidateOperationHash; } });
|
|
103
|
+
Object.defineProperty(exports, "tryFindSalt", { enumerable: true, get: function () { return operation_id_1.tryFindSalt; } });
|
|
104
|
+
// ============================================================================
|
|
105
|
+
// TIER 3: Execution Preparation
|
|
106
|
+
// ============================================================================
|
|
107
|
+
// Timelock preparation
|
|
108
|
+
var timelock_1 = require("./stages/timelock");
|
|
109
|
+
Object.defineProperty(exports, "prepareTimelockOperation", { enumerable: true, get: function () { return timelock_1.prepareTimelockOperation; } });
|
|
110
|
+
Object.defineProperty(exports, "prepareTimelockBatch", { enumerable: true, get: function () { return timelock_1.prepareTimelockBatch; } });
|
|
111
|
+
Object.defineProperty(exports, "prepareTimelockStage", { enumerable: true, get: function () { return timelock_1.prepareTimelockStage; } });
|
|
112
|
+
Object.defineProperty(exports, "calculateRetryableExecutionValue", { enumerable: true, get: function () { return timelock_1.calculateRetryableExecutionValue; } });
|
|
113
|
+
Object.defineProperty(exports, "calculateBatchRetryableValues", { enumerable: true, get: function () { return timelock_1.calculateBatchRetryableValues; } });
|
|
114
|
+
// L2→L1 message preparation
|
|
115
|
+
var l2_to_l1_message_1 = require("./stages/l2-to-l1-message");
|
|
116
|
+
Object.defineProperty(exports, "prepareL2ToL1Message", { enumerable: true, get: function () { return l2_to_l1_message_1.prepareL2ToL1Message; } });
|
|
117
|
+
Object.defineProperty(exports, "prepareL2ToL1MessageStage", { enumerable: true, get: function () { return l2_to_l1_message_1.prepareL2ToL1MessageStage; } });
|
|
118
|
+
Object.defineProperty(exports, "getL2ToL1Messages", { enumerable: true, get: function () { return l2_to_l1_message_1.getL2ToL1Messages; } });
|
|
119
|
+
// Retryable preparation
|
|
120
|
+
var retryables_1 = require("./stages/retryables");
|
|
121
|
+
Object.defineProperty(exports, "prepareRetryableRedemption", { enumerable: true, get: function () { return retryables_1.prepareRetryableRedemption; } });
|
|
122
|
+
Object.defineProperty(exports, "prepareAllRetryables", { enumerable: true, get: function () { return retryables_1.prepareAllRetryables; } });
|
|
123
|
+
Object.defineProperty(exports, "prepareRetryableStage", { enumerable: true, get: function () { return retryables_1.prepareRetryableStage; } });
|
|
124
|
+
// Governor queue preparation
|
|
125
|
+
var proposal_queued_1 = require("./stages/proposal-queued");
|
|
126
|
+
Object.defineProperty(exports, "prepareGovernorQueue", { enumerable: true, get: function () { return proposal_queued_1.prepareGovernorQueue; } });
|
|
127
|
+
// ============================================================================
|
|
128
|
+
// TIER 4: Framework Utilities
|
|
129
|
+
// ============================================================================
|
|
130
|
+
// URL generation
|
|
131
|
+
var urls_1 = require("./utils/urls");
|
|
132
|
+
Object.defineProperty(exports, "getTxUrl", { enumerable: true, get: function () { return urls_1.getTxUrl; } });
|
|
133
|
+
Object.defineProperty(exports, "getStageTransactionUrl", { enumerable: true, get: function () { return urls_1.getStageTransactionUrl; } });
|
|
134
|
+
Object.defineProperty(exports, "chainTypeToId", { enumerable: true, get: function () { return urls_1.chainTypeToId; } });
|
|
135
|
+
// Stage metadata
|
|
136
|
+
var stage_metadata_1 = require("./utils/stage-metadata");
|
|
137
|
+
Object.defineProperty(exports, "getStageMetadata", { enumerable: true, get: function () { return stage_metadata_1.getStageMetadata; } });
|
|
138
|
+
Object.defineProperty(exports, "getAllStageMetadata", { enumerable: true, get: function () { return stage_metadata_1.getAllStageMetadata; } });
|
|
139
|
+
Object.defineProperty(exports, "getActionableStages", { enumerable: true, get: function () { return stage_metadata_1.getActionableStages; } });
|
|
140
|
+
Object.defineProperty(exports, "formatStageTitle", { enumerable: true, get: function () { return stage_metadata_1.formatStageTitle; } });
|
|
141
|
+
Object.defineProperty(exports, "getTotalExpectedDuration", { enumerable: true, get: function () { return stage_metadata_1.getTotalExpectedDuration; } });
|
|
142
|
+
// Address utilities
|
|
143
|
+
var chain_1 = require("./utils/chain");
|
|
144
|
+
Object.defineProperty(exports, "addressEquals", { enumerable: true, get: function () { return chain_1.addressEquals; } });
|
|
145
|
+
Object.defineProperty(exports, "isAddressIn", { enumerable: true, get: function () { return chain_1.isAddressIn; } });
|
|
146
|
+
Object.defineProperty(exports, "getChainType", { enumerable: true, get: function () { return chain_1.getChainType; } });
|
|
147
|
+
// ============================================================================
|
|
148
|
+
// TIER 5: Election Tracking
|
|
149
|
+
// ============================================================================
|
|
150
|
+
var election_1 = require("./election");
|
|
151
|
+
Object.defineProperty(exports, "checkElectionStatus", { enumerable: true, get: function () { return election_1.checkElectionStatus; } });
|
|
152
|
+
Object.defineProperty(exports, "prepareElectionCreation", { enumerable: true, get: function () { return election_1.prepareElectionCreation; } });
|
|
153
|
+
Object.defineProperty(exports, "hasVettingPeriod", { enumerable: true, get: function () { return election_1.hasVettingPeriod; } });
|
|
154
|
+
Object.defineProperty(exports, "trackElectionProposal", { enumerable: true, get: function () { return election_1.trackElectionProposal; } });
|
|
155
|
+
Object.defineProperty(exports, "getElectionProposalId", { enumerable: true, get: function () { return election_1.getElectionProposalId; } });
|
|
156
|
+
Object.defineProperty(exports, "getElectionProposalParams", { enumerable: true, get: function () { return election_1.getElectionProposalParams; } });
|
|
157
|
+
Object.defineProperty(exports, "prepareMemberElectionTrigger", { enumerable: true, get: function () { return election_1.prepareMemberElectionTrigger; } });
|
|
158
|
+
// ============================================================================
|
|
159
|
+
// TIER 6: Internal Utilities (for testing)
|
|
160
|
+
// ============================================================================
|
|
161
|
+
var context_1 = require("./tracker/context");
|
|
162
|
+
Object.defineProperty(exports, "createCheckpoint", { enumerable: true, get: function () { return context_1.createCheckpoint; } });
|
|
163
|
+
Object.defineProperty(exports, "createTrackingContext", { enumerable: true, get: function () { return context_1.createTrackingContext; } });
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;;AAEH,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E,oBAAoB;AACpB,qCAAqF;AAA5E,+GAAA,oBAAoB,OAAA;AAAE,wGAAA,aAAa,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AA2EjE,cAAc;AACd,iCAAoD;AAA3C,oGAAA,WAAW,OAAA;AAAE,qGAAA,YAAY,OAAA;AAElC,YAAY;AACZ,yCAOqB;AANnB,sGAAA,SAAS,OAAA;AACT,sGAAA,SAAS,OAAA;AACT,6GAAA,gBAAgB,OAAA;AAChB,wGAAA,WAAW,OAAA;AACX,+GAAA,kBAAkB,OAAA;AAClB,gHAAA,mBAAmB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E,2CAA2C;AAC3C,+EAA+E;AAE/E,6CAA4E;AAAnE,2GAAA,gBAAgB,OAAA;AAAE,gHAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for stage tracking
|
|
3
|
+
*
|
|
4
|
+
* Common patterns and helpers used across all stage modules
|
|
5
|
+
*/
|
|
6
|
+
import { ethers } from "ethers";
|
|
7
|
+
import { CallScheduledData, PrepareResult, SerializedCallScheduledData, StageType, TrackedStage } from "../types";
|
|
8
|
+
/** Generic serializer: converts BigNumber fields to strings for JSON storage. */
|
|
9
|
+
export declare function serialize<T>(data: T, bigNumFields: readonly string[]): T;
|
|
10
|
+
/** Generic deserializer: converts string fields back to BigNumber. */
|
|
11
|
+
export declare function deserialize<T>(data: T, bigNumFields: readonly string[]): T;
|
|
12
|
+
/** Serialize CallScheduledData for JSON storage. */
|
|
13
|
+
export declare const serializeCallScheduledData: (data: CallScheduledData) => SerializedCallScheduledData;
|
|
14
|
+
/** Deserialize CallScheduledData from JSON storage. */
|
|
15
|
+
export declare const deserializeCallScheduledData: (data: SerializedCallScheduledData) => CallScheduledData;
|
|
16
|
+
/** Serialize/deserialize arrays. */
|
|
17
|
+
export declare const serializeCallScheduledDataArray: (data: CallScheduledData[]) => SerializedCallScheduledData[];
|
|
18
|
+
export declare const deserializeCallScheduledDataArray: (data: SerializedCallScheduledData[]) => CallScheduledData[];
|
|
19
|
+
/**
|
|
20
|
+
* Calculate ETA from CallScheduled event data
|
|
21
|
+
*
|
|
22
|
+
* ETA = block timestamp + delay seconds
|
|
23
|
+
* This works even when operation is done (contract returns _DONE_TIMESTAMP=1)
|
|
24
|
+
*/
|
|
25
|
+
export declare function calculateEtaFromScheduledData(blockNumber: number, delaySeconds: number, provider: ethers.providers.Provider): Promise<number>;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a proposal is Constitutional (requires L1 round-trip).
|
|
28
|
+
*
|
|
29
|
+
* Constitutional proposals (from Constitutional Governor) go through:
|
|
30
|
+
* L2 Timelock (8 days) → L2→L1 Message → L1 Timelock (3 days) → Retryables
|
|
31
|
+
*
|
|
32
|
+
* Non-Constitutional proposals (from Non-Constitutional Governor) are L2-only:
|
|
33
|
+
* L2 Timelock (3 days) → L2 Execution
|
|
34
|
+
*
|
|
35
|
+
* Also works with timelock addresses for direct timelock entry.
|
|
36
|
+
*
|
|
37
|
+
* @see https://docs.arbitrum.foundation/concepts/lifecycle-anatomy-aip-proposal
|
|
38
|
+
*/
|
|
39
|
+
export declare function isConstitutional(governorOrTimelockAddress: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Get all stages for a governor path
|
|
42
|
+
*
|
|
43
|
+
* Always returns all 7 stages to ensure consistent stage arrays.
|
|
44
|
+
* For L2-only paths (Treasury Governor), the L2→L1 and L1 stages
|
|
45
|
+
* will be marked as SKIPPED during tracking.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getStagesForPath(_governorAddress: string, includeProposalStages?: boolean): StageType[];
|
|
48
|
+
/**
|
|
49
|
+
* Initialize all stages for a path
|
|
50
|
+
*/
|
|
51
|
+
export declare function initializeStagesForPath(governorAddress: string, includeProposalStages?: boolean): TrackedStage[];
|
|
52
|
+
/**
|
|
53
|
+
* Find a stage by type in a list of stages
|
|
54
|
+
*/
|
|
55
|
+
export declare function findStage(stages: TrackedStage[], type: StageType): TrackedStage | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Update a stage in a list of stages
|
|
58
|
+
*/
|
|
59
|
+
export declare function updateStageInList(stages: TrackedStage[], updatedStage: TrackedStage): TrackedStage[];
|
|
60
|
+
/**
|
|
61
|
+
* Get the current active stage (first non-completed stage)
|
|
62
|
+
*/
|
|
63
|
+
export declare function getCurrentStage(stages: TrackedStage[]): TrackedStage | null;
|
|
64
|
+
/**
|
|
65
|
+
* Check if all stages are complete
|
|
66
|
+
*/
|
|
67
|
+
export declare function areAllStagesComplete(stages: TrackedStage[]): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get block timestamp from provider
|
|
70
|
+
*/
|
|
71
|
+
export declare function getBlockTimestamp(blockNumber: number, provider: ethers.providers.Provider): Promise<number>;
|
|
72
|
+
/**
|
|
73
|
+
* Find first READY stage that's executable
|
|
74
|
+
*/
|
|
75
|
+
export declare function findExecutableStage(stages: TrackedStage[]): TrackedStage | null;
|
|
76
|
+
/** Timelock stage types (consolidated stages that require execution) */
|
|
77
|
+
export declare const TIMELOCK_STAGE_TYPES: readonly ["L2_TIMELOCK", "L1_TIMELOCK"];
|
|
78
|
+
/**
|
|
79
|
+
* Check if a stage type is a timelock stage
|
|
80
|
+
*/
|
|
81
|
+
export declare function isTimelockStage(type: StageType | string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Find all READY executable stages
|
|
84
|
+
*/
|
|
85
|
+
export declare function findAllExecutableStages(stages: TrackedStage[]): TrackedStage[];
|
|
86
|
+
/**
|
|
87
|
+
* Check if a tracking result has any stage ready for execution.
|
|
88
|
+
*
|
|
89
|
+
* This is a convenience wrapper around findExecutableStage() that returns
|
|
90
|
+
* a boolean, useful for filtering or conditional logic.
|
|
91
|
+
*
|
|
92
|
+
* @param stages - Array of tracked stages (typically from TrackingResult.stages)
|
|
93
|
+
* @returns true if any stage is ready for execution
|
|
94
|
+
*/
|
|
95
|
+
export declare function needsAction(stages: TrackedStage[]): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Get summary of stage statuses (single pass)
|
|
98
|
+
*/
|
|
99
|
+
export declare function getTrackingStatusSummary(stages: TrackedStage[]): {
|
|
100
|
+
total: number;
|
|
101
|
+
completed: number;
|
|
102
|
+
pending: number;
|
|
103
|
+
ready: number;
|
|
104
|
+
failed: number;
|
|
105
|
+
skipped: number;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Extract the operationId from tracked stages.
|
|
109
|
+
*
|
|
110
|
+
* The operationId links a governor proposal to its timelock operation.
|
|
111
|
+
* It can be found in PROPOSAL_QUEUED or L2_TIMELOCK stages.
|
|
112
|
+
*
|
|
113
|
+
* @param stages - Array of tracked stages
|
|
114
|
+
* @returns The operationId if found, undefined otherwise
|
|
115
|
+
*/
|
|
116
|
+
export declare function extractOperationId(stages: TrackedStage[]): string | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Create a failed PrepareResult with an error message.
|
|
119
|
+
* Reduces boilerplate for the common pattern: { success: false, error: "..." }
|
|
120
|
+
*/
|
|
121
|
+
export declare function failPrepare(error: string): PrepareResult;
|
|
122
|
+
/**
|
|
123
|
+
* Check if a timelock operation is ready for execution.
|
|
124
|
+
* Returns null if ready, or an error result if not ready or already executed.
|
|
125
|
+
*/
|
|
126
|
+
export declare function checkOperationReady(timelockAddress: string, operationId: string, provider: ethers.providers.Provider): Promise<PrepareResult | null>;
|
|
127
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/stages/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAa,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EACL,iBAAiB,EAEjB,aAAa,EACb,2BAA2B,EAE3B,SAAS,EACT,YAAY,EACb,MAAM,UAAU,CAAC;AAYlB,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,CAYxE;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,CAQ1E;AAED,oDAAoD;AACpD,eAAO,MAAM,0BAA0B,GAAI,MAAM,iBAAiB,KAAG,2BACoB,CAAC;AAE1F,uDAAuD;AACvD,eAAO,MAAM,4BAA4B,GACvC,MAAM,2BAA2B,KAChC,iBAC8E,CAAC;AAElF,oCAAoC;AACpC,eAAO,MAAM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YAAY,GAAG,IAAI,CAE/E;AAED,wEAAwE;AACxE,eAAO,MAAM,oBAAoB,yCAA0C,CAAC;AAE5E;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAEjE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAE3D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAiBA;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,GAAG,SAAS,CAa7E;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAExD;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,GAClC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAU/B"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared utilities for stage tracking
|
|
4
|
+
*
|
|
5
|
+
* Common patterns and helpers used across all stage modules
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.TIMELOCK_STAGE_TYPES = exports.deserializeCallScheduledDataArray = exports.serializeCallScheduledDataArray = exports.deserializeCallScheduledData = exports.serializeCallScheduledData = void 0;
|
|
9
|
+
exports.serialize = serialize;
|
|
10
|
+
exports.deserialize = deserialize;
|
|
11
|
+
exports.calculateEtaFromScheduledData = calculateEtaFromScheduledData;
|
|
12
|
+
exports.isConstitutional = isConstitutional;
|
|
13
|
+
exports.getStagesForPath = getStagesForPath;
|
|
14
|
+
exports.initializeStagesForPath = initializeStagesForPath;
|
|
15
|
+
exports.findStage = findStage;
|
|
16
|
+
exports.updateStageInList = updateStageInList;
|
|
17
|
+
exports.getCurrentStage = getCurrentStage;
|
|
18
|
+
exports.areAllStagesComplete = areAllStagesComplete;
|
|
19
|
+
exports.getBlockTimestamp = getBlockTimestamp;
|
|
20
|
+
exports.findExecutableStage = findExecutableStage;
|
|
21
|
+
exports.isTimelockStage = isTimelockStage;
|
|
22
|
+
exports.findAllExecutableStages = findAllExecutableStages;
|
|
23
|
+
exports.needsAction = needsAction;
|
|
24
|
+
exports.getTrackingStatusSummary = getTrackingStatusSummary;
|
|
25
|
+
exports.extractOperationId = extractOperationId;
|
|
26
|
+
exports.failPrepare = failPrepare;
|
|
27
|
+
exports.checkOperationReady = checkOperationReady;
|
|
28
|
+
const ethers_1 = require("ethers");
|
|
29
|
+
const abis_1 = require("../abis");
|
|
30
|
+
const constants_1 = require("../constants");
|
|
31
|
+
const chain_1 = require("../utils/chain");
|
|
32
|
+
const rpc_utils_1 = require("../utils/rpc-utils");
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// Serialization Utilities
|
|
35
|
+
// ============================================================================
|
|
36
|
+
const CALL_SCHEDULED_BIGNUM_FIELDS = ["index", "value", "delay"];
|
|
37
|
+
/** Generic serializer: converts BigNumber fields to strings for JSON storage. */
|
|
38
|
+
function serialize(data, bigNumFields) {
|
|
39
|
+
const result = {};
|
|
40
|
+
for (const key of Object.keys(data)) {
|
|
41
|
+
const val = data[key];
|
|
42
|
+
result[key] =
|
|
43
|
+
bigNumFields.includes(key) &&
|
|
44
|
+
val &&
|
|
45
|
+
typeof val.toString === "function"
|
|
46
|
+
? val.toString()
|
|
47
|
+
: val;
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
/** Generic deserializer: converts string fields back to BigNumber. */
|
|
52
|
+
function deserialize(data, bigNumFields) {
|
|
53
|
+
const result = {};
|
|
54
|
+
for (const key of Object.keys(data)) {
|
|
55
|
+
const val = data[key];
|
|
56
|
+
result[key] =
|
|
57
|
+
bigNumFields.includes(key) && typeof val === "string" ? ethers_1.BigNumber.from(val) : val;
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
/** Serialize CallScheduledData for JSON storage. */
|
|
62
|
+
const serializeCallScheduledData = (data) => serialize(data, CALL_SCHEDULED_BIGNUM_FIELDS);
|
|
63
|
+
exports.serializeCallScheduledData = serializeCallScheduledData;
|
|
64
|
+
/** Deserialize CallScheduledData from JSON storage. */
|
|
65
|
+
const deserializeCallScheduledData = (data) => deserialize(data, CALL_SCHEDULED_BIGNUM_FIELDS);
|
|
66
|
+
exports.deserializeCallScheduledData = deserializeCallScheduledData;
|
|
67
|
+
/** Serialize/deserialize arrays. */
|
|
68
|
+
const serializeCallScheduledDataArray = (data) => data.map(exports.serializeCallScheduledData);
|
|
69
|
+
exports.serializeCallScheduledDataArray = serializeCallScheduledDataArray;
|
|
70
|
+
const deserializeCallScheduledDataArray = (data) => data.map(exports.deserializeCallScheduledData);
|
|
71
|
+
exports.deserializeCallScheduledDataArray = deserializeCallScheduledDataArray;
|
|
72
|
+
// ============================================================================
|
|
73
|
+
// Stage Creation and Management
|
|
74
|
+
// ============================================================================
|
|
75
|
+
/**
|
|
76
|
+
* Create a new tracked stage with default values
|
|
77
|
+
*/
|
|
78
|
+
function createStage(type, chain, status = "NOT_STARTED") {
|
|
79
|
+
return {
|
|
80
|
+
type,
|
|
81
|
+
status,
|
|
82
|
+
chain,
|
|
83
|
+
transactions: [],
|
|
84
|
+
data: {},
|
|
85
|
+
executable: false,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Calculate ETA from CallScheduled event data
|
|
90
|
+
*
|
|
91
|
+
* ETA = block timestamp + delay seconds
|
|
92
|
+
* This works even when operation is done (contract returns _DONE_TIMESTAMP=1)
|
|
93
|
+
*/
|
|
94
|
+
async function calculateEtaFromScheduledData(blockNumber, delaySeconds, provider) {
|
|
95
|
+
const timestamp = await getBlockTimestamp(blockNumber, provider);
|
|
96
|
+
return timestamp + delaySeconds;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Check if a proposal is Constitutional (requires L1 round-trip).
|
|
100
|
+
*
|
|
101
|
+
* Constitutional proposals (from Constitutional Governor) go through:
|
|
102
|
+
* L2 Timelock (8 days) → L2→L1 Message → L1 Timelock (3 days) → Retryables
|
|
103
|
+
*
|
|
104
|
+
* Non-Constitutional proposals (from Non-Constitutional Governor) are L2-only:
|
|
105
|
+
* L2 Timelock (3 days) → L2 Execution
|
|
106
|
+
*
|
|
107
|
+
* Also works with timelock addresses for direct timelock entry.
|
|
108
|
+
*
|
|
109
|
+
* @see https://docs.arbitrum.foundation/concepts/lifecycle-anatomy-aip-proposal
|
|
110
|
+
*/
|
|
111
|
+
function isConstitutional(governorOrTimelockAddress) {
|
|
112
|
+
return (0, chain_1.isAddressIn)(governorOrTimelockAddress, [
|
|
113
|
+
constants_1.ADDRESSES.CONSTITUTIONAL_GOVERNOR,
|
|
114
|
+
constants_1.ADDRESSES.L2_CONSTITUTIONAL_TIMELOCK,
|
|
115
|
+
]);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Get all stages for a governor path
|
|
119
|
+
*
|
|
120
|
+
* Always returns all 7 stages to ensure consistent stage arrays.
|
|
121
|
+
* For L2-only paths (Treasury Governor), the L2→L1 and L1 stages
|
|
122
|
+
* will be marked as SKIPPED during tracking.
|
|
123
|
+
*/
|
|
124
|
+
function getStagesForPath(_governorAddress, includeProposalStages = true) {
|
|
125
|
+
const proposalStages = includeProposalStages
|
|
126
|
+
? ["PROPOSAL_CREATED", "VOTING_ACTIVE", "PROPOSAL_QUEUED"]
|
|
127
|
+
: [];
|
|
128
|
+
// Always return all 7 stages - L2-only paths mark extra stages as SKIPPED
|
|
129
|
+
return [
|
|
130
|
+
...proposalStages,
|
|
131
|
+
"L2_TIMELOCK",
|
|
132
|
+
"L2_TO_L1_MESSAGE",
|
|
133
|
+
"L1_TIMELOCK",
|
|
134
|
+
"RETRYABLE_EXECUTED",
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Initialize all stages for a path
|
|
139
|
+
*/
|
|
140
|
+
function initializeStagesForPath(governorAddress, includeProposalStages = true) {
|
|
141
|
+
const stageTypes = getStagesForPath(governorAddress, includeProposalStages);
|
|
142
|
+
return stageTypes.map((type) => {
|
|
143
|
+
// L1_TIMELOCK and RETRYABLE_EXECUTED are L1 stages
|
|
144
|
+
// L2_TO_L1_MESSAGE is cross-chain but logically completes on L1
|
|
145
|
+
const chain = type === "L1_TIMELOCK" || type === "RETRYABLE_EXECUTED" ? "L1" : "L2";
|
|
146
|
+
return createStage(type, chain, "NOT_STARTED");
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Find a stage by type in a list of stages
|
|
151
|
+
*/
|
|
152
|
+
function findStage(stages, type) {
|
|
153
|
+
return stages.find((s) => s.type === type);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Update a stage in a list of stages
|
|
157
|
+
*/
|
|
158
|
+
function updateStageInList(stages, updatedStage) {
|
|
159
|
+
return stages.map((s) => (s.type === updatedStage.type ? updatedStage : s));
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get the current active stage (first non-completed stage)
|
|
163
|
+
*/
|
|
164
|
+
function getCurrentStage(stages) {
|
|
165
|
+
for (const stage of stages) {
|
|
166
|
+
if (stage.status !== "COMPLETED" && stage.status !== "SKIPPED" && stage.status !== "FAILED") {
|
|
167
|
+
return stage;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Check if all stages are complete
|
|
174
|
+
*/
|
|
175
|
+
function areAllStagesComplete(stages) {
|
|
176
|
+
return stages.every((s) => s.status === "COMPLETED" || s.status === "SKIPPED" || s.status === "FAILED");
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Get block timestamp from provider
|
|
180
|
+
*/
|
|
181
|
+
async function getBlockTimestamp(blockNumber, provider) {
|
|
182
|
+
const block = await (0, rpc_utils_1.queryWithRetry)(() => provider.getBlock(blockNumber));
|
|
183
|
+
if (!block) {
|
|
184
|
+
throw new Error(`Block ${blockNumber} not found`);
|
|
185
|
+
}
|
|
186
|
+
return block.timestamp;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Find first READY stage that's executable
|
|
190
|
+
*/
|
|
191
|
+
function findExecutableStage(stages) {
|
|
192
|
+
return stages.find((s) => s.status === "READY" && s.executable === true) ?? null;
|
|
193
|
+
}
|
|
194
|
+
/** Timelock stage types (consolidated stages that require execution) */
|
|
195
|
+
exports.TIMELOCK_STAGE_TYPES = ["L2_TIMELOCK", "L1_TIMELOCK"];
|
|
196
|
+
/**
|
|
197
|
+
* Check if a stage type is a timelock stage
|
|
198
|
+
*/
|
|
199
|
+
function isTimelockStage(type) {
|
|
200
|
+
return exports.TIMELOCK_STAGE_TYPES.includes(type);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Find all READY executable stages
|
|
204
|
+
*/
|
|
205
|
+
function findAllExecutableStages(stages) {
|
|
206
|
+
return stages.filter((s) => s.status === "READY" && s.executable === true);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Check if a tracking result has any stage ready for execution.
|
|
210
|
+
*
|
|
211
|
+
* This is a convenience wrapper around findExecutableStage() that returns
|
|
212
|
+
* a boolean, useful for filtering or conditional logic.
|
|
213
|
+
*
|
|
214
|
+
* @param stages - Array of tracked stages (typically from TrackingResult.stages)
|
|
215
|
+
* @returns true if any stage is ready for execution
|
|
216
|
+
*/
|
|
217
|
+
function needsAction(stages) {
|
|
218
|
+
return findExecutableStage(stages) !== null;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Get summary of stage statuses (single pass)
|
|
222
|
+
*/
|
|
223
|
+
function getTrackingStatusSummary(stages) {
|
|
224
|
+
const counts = stages.reduce((acc, s) => {
|
|
225
|
+
acc[s.status]++;
|
|
226
|
+
return acc;
|
|
227
|
+
}, { COMPLETED: 0, PENDING: 0, READY: 0, FAILED: 0, SKIPPED: 0, NOT_STARTED: 0 });
|
|
228
|
+
return {
|
|
229
|
+
total: stages.length,
|
|
230
|
+
completed: counts.COMPLETED,
|
|
231
|
+
pending: counts.PENDING,
|
|
232
|
+
ready: counts.READY,
|
|
233
|
+
failed: counts.FAILED,
|
|
234
|
+
skipped: counts.SKIPPED,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Extract the operationId from tracked stages.
|
|
239
|
+
*
|
|
240
|
+
* The operationId links a governor proposal to its timelock operation.
|
|
241
|
+
* It can be found in PROPOSAL_QUEUED or L2_TIMELOCK stages.
|
|
242
|
+
*
|
|
243
|
+
* @param stages - Array of tracked stages
|
|
244
|
+
* @returns The operationId if found, undefined otherwise
|
|
245
|
+
*/
|
|
246
|
+
function extractOperationId(stages) {
|
|
247
|
+
// Check stages that contain operationId (in order of likelihood)
|
|
248
|
+
const stageTypes = ["PROPOSAL_QUEUED", "L2_TIMELOCK"];
|
|
249
|
+
for (const type of stageTypes) {
|
|
250
|
+
const stage = stages.find((s) => s.type === type);
|
|
251
|
+
const opId = stage?.data?.operationId;
|
|
252
|
+
if (typeof opId === "string" && opId.length > 0) {
|
|
253
|
+
return opId;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Create a failed PrepareResult with an error message.
|
|
260
|
+
* Reduces boilerplate for the common pattern: { success: false, error: "..." }
|
|
261
|
+
*/
|
|
262
|
+
function failPrepare(error) {
|
|
263
|
+
return { success: false, error };
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Check if a timelock operation is ready for execution.
|
|
267
|
+
* Returns null if ready, or an error result if not ready or already executed.
|
|
268
|
+
*/
|
|
269
|
+
async function checkOperationReady(timelockAddress, operationId, provider) {
|
|
270
|
+
const timelock = new ethers_1.ethers.Contract(timelockAddress, abis_1.TIMELOCK_ABI, provider);
|
|
271
|
+
const isReady = await (0, rpc_utils_1.queryWithRetry)(() => timelock.isOperationReady(operationId));
|
|
272
|
+
if (isReady)
|
|
273
|
+
return null; // Ready - no error
|
|
274
|
+
const isDone = await (0, rpc_utils_1.queryWithRetry)(() => timelock.isOperationDone(operationId));
|
|
275
|
+
if (isDone) {
|
|
276
|
+
return failPrepare("Operation already executed");
|
|
277
|
+
}
|
|
278
|
+
return failPrepare("Operation is not ready for execution");
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/stages/base.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAwBH,8BAYC;AAGD,kCAQC;AA8CD,sEAOC;AAeD,4CAKC;AASD,4CAgBC;AAKD,0DAaC;AAKD,8BAEC;AAKD,8CAKC;AAKD,0CAOC;AAKD,oDAIC;AAKD,8CASC;AAKD,kDAEC;AAQD,0CAEC;AAKD,0DAEC;AAWD,kCAEC;AAKD,4DAwBC;AAWD,gDAaC;AAMD,kCAEC;AAMD,kDAcC;AA3UD,mCAA2C;AAU3C,kCAAuC;AACvC,4CAAyC;AACzC,0CAA6C;AAC7C,kDAAoD;AAEpD,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E,MAAM,4BAA4B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