@gzeoneth/gov-tracker 0.4.0-beta.fb8713f → 0.5.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/README.md +94 -7
- package/dist/abis-json.d.ts +2315 -0
- package/dist/abis-json.d.ts.map +1 -0
- package/dist/abis-json.js +3207 -0
- package/dist/abis-json.js.map +1 -0
- package/dist/abis.d.ts +12 -7
- package/dist/abis.d.ts.map +1 -1
- package/dist/abis.js +32 -1
- package/dist/abis.js.map +1 -1
- package/dist/calldata/parameter-decoder.d.ts.map +1 -1
- package/dist/calldata/parameter-decoder.js +19 -25
- package/dist/calldata/parameter-decoder.js.map +1 -1
- package/dist/cli/cli.js +73 -1
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/lib/cli.d.ts.map +1 -1
- package/dist/cli/lib/cli.js +3 -2
- package/dist/cli/lib/cli.js.map +1 -1
- package/dist/cli/lib/election-check.d.ts.map +1 -1
- package/dist/cli/lib/election-check.js +2 -1
- package/dist/cli/lib/election-check.js.map +1 -1
- package/dist/cli/tui/components/VotingStats.d.ts.map +1 -1
- package/dist/cli/tui/components/VotingStats.js +2 -1
- package/dist/cli/tui/components/VotingStats.js.map +1 -1
- package/dist/cli/tui/hooks/useNavigation.d.ts.map +1 -1
- package/dist/cli/tui/hooks/useNavigation.js +2 -3
- package/dist/cli/tui/hooks/useNavigation.js.map +1 -1
- package/dist/cli/tui/hooks/useProposals.js +2 -2
- package/dist/cli/tui/hooks/useProposals.js.map +1 -1
- package/dist/cli/tui/utils/index.d.ts +2 -2
- package/dist/cli/tui/utils/index.d.ts.map +1 -1
- package/dist/cli/tui/utils/index.js +5 -1
- package/dist/cli/tui/utils/index.js.map +1 -1
- package/dist/cli/tui/utils/navigation.d.ts +1 -0
- package/dist/cli/tui/utils/navigation.d.ts.map +1 -1
- package/dist/cli/tui/utils/navigation.js +4 -4
- package/dist/cli/tui/utils/navigation.js.map +1 -1
- package/dist/cli/tui/utils/stage-status.d.ts +4 -0
- package/dist/cli/tui/utils/stage-status.d.ts.map +1 -1
- package/dist/cli/tui/utils/stage-status.js +47 -1
- package/dist/cli/tui/utils/stage-status.js.map +1 -1
- package/dist/cli/tui/views/CalldataView.d.ts.map +1 -1
- package/dist/cli/tui/views/CalldataView.js +3 -2
- package/dist/cli/tui/views/CalldataView.js.map +1 -1
- package/dist/cli/tui/views/ElectionView.d.ts.map +1 -1
- package/dist/cli/tui/views/ElectionView.js +4 -9
- package/dist/cli/tui/views/ElectionView.js.map +1 -1
- package/dist/constants.d.ts +43 -22
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +62 -17
- package/dist/constants.js.map +1 -1
- package/dist/data/bundled-cache.json +393 -20
- package/dist/data/delegate-cache.json +118014 -0
- package/dist/deduplication.d.ts.map +1 -1
- package/dist/deduplication.js +28 -51
- package/dist/deduplication.js.map +1 -1
- package/dist/delegates/cache.d.ts +44 -0
- package/dist/delegates/cache.d.ts.map +1 -0
- package/dist/delegates/cache.js +202 -0
- package/dist/delegates/cache.js.map +1 -0
- package/dist/delegates/index.d.ts +13 -0
- package/dist/delegates/index.d.ts.map +1 -0
- package/dist/delegates/index.js +32 -0
- package/dist/delegates/index.js.map +1 -0
- package/dist/delegates/indexer.d.ts +32 -0
- package/dist/delegates/indexer.d.ts.map +1 -0
- package/dist/delegates/indexer.js +191 -0
- package/dist/delegates/indexer.js.map +1 -0
- package/dist/delegates/queries.d.ts +30 -0
- package/dist/delegates/queries.d.ts.map +1 -0
- package/dist/delegates/queries.js +79 -0
- package/dist/delegates/queries.js.map +1 -0
- package/dist/discovery/governor-discovery.d.ts +21 -1
- package/dist/discovery/governor-discovery.d.ts.map +1 -1
- package/dist/discovery/governor-discovery.js +46 -12
- package/dist/discovery/governor-discovery.js.map +1 -1
- package/dist/discovery/timelock-discovery.d.ts.map +1 -1
- package/dist/discovery/timelock-discovery.js +1 -2
- package/dist/discovery/timelock-discovery.js.map +1 -1
- package/dist/election/details.d.ts.map +1 -1
- package/dist/election/details.js +2 -2
- package/dist/election/details.js.map +1 -1
- package/dist/election/index.d.ts +3 -1
- package/dist/election/index.d.ts.map +1 -1
- package/dist/election/index.js +12 -1
- package/dist/election/index.js.map +1 -1
- package/dist/election/params.d.ts.map +1 -1
- package/dist/election/params.js +11 -16
- package/dist/election/params.js.map +1 -1
- package/dist/election/proposal-ids.js +2 -2
- package/dist/election/proposal-ids.js.map +1 -1
- package/dist/election/status.d.ts +28 -1
- package/dist/election/status.d.ts.map +1 -1
- package/dist/election/status.js +110 -3
- package/dist/election/status.js.map +1 -1
- package/dist/election/write.d.ts +132 -0
- package/dist/election/write.d.ts.map +1 -0
- package/dist/election/write.js +184 -0
- package/dist/election/write.js.map +1 -0
- package/dist/governance/index.d.ts +5 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +28 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/read.d.ts +50 -0
- package/dist/governance/read.d.ts.map +1 -0
- package/dist/governance/read.js +194 -0
- package/dist/governance/read.js.map +1 -0
- package/dist/governance/write.d.ts +54 -0
- package/dist/governance/write.d.ts.map +1 -0
- package/dist/governance/write.js +132 -0
- package/dist/governance/write.js.map +1 -0
- package/dist/index.d.ts +40 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +149 -13
- package/dist/index.js.map +1 -1
- package/dist/simulation/index.d.ts +4 -1
- package/dist/simulation/index.d.ts.map +1 -1
- package/dist/simulation/index.js +5 -1
- package/dist/simulation/index.js.map +1 -1
- package/dist/simulation/simulation-data.d.ts +31 -0
- package/dist/simulation/simulation-data.d.ts.map +1 -1
- package/dist/simulation/simulation-data.js +34 -0
- package/dist/simulation/simulation-data.js.map +1 -1
- package/dist/simulation/tenderly-payloads.d.ts +107 -0
- package/dist/simulation/tenderly-payloads.d.ts.map +1 -0
- package/dist/simulation/tenderly-payloads.js +103 -0
- package/dist/simulation/tenderly-payloads.js.map +1 -0
- package/dist/stages/l2-to-l1-message.d.ts.map +1 -1
- package/dist/stages/l2-to-l1-message.js +40 -60
- package/dist/stages/l2-to-l1-message.js.map +1 -1
- package/dist/stages/proposal-queued.js.map +1 -1
- package/dist/stages/retryables.js.map +1 -1
- package/dist/stages/timelock.d.ts +41 -3
- package/dist/stages/timelock.d.ts.map +1 -1
- package/dist/stages/timelock.js +159 -48
- package/dist/stages/timelock.js.map +1 -1
- package/dist/stages/utils.d.ts +56 -1
- package/dist/stages/utils.d.ts.map +1 -1
- package/dist/stages/utils.js +144 -28
- package/dist/stages/utils.js.map +1 -1
- package/dist/tracker/bundled-cache.d.ts +136 -0
- package/dist/tracker/bundled-cache.d.ts.map +1 -0
- package/dist/tracker/bundled-cache.js +207 -0
- package/dist/tracker/bundled-cache.js.map +1 -0
- package/dist/tracker/checkpoint-helpers.d.ts +18 -0
- package/dist/tracker/checkpoint-helpers.d.ts.map +1 -1
- package/dist/tracker/checkpoint-helpers.js +37 -0
- package/dist/tracker/checkpoint-helpers.js.map +1 -1
- package/dist/tracker/discovery.d.ts +3 -0
- package/dist/tracker/discovery.d.ts.map +1 -1
- package/dist/tracker/discovery.js +3 -0
- package/dist/tracker/discovery.js.map +1 -1
- package/dist/tracker/pipeline.d.ts +3 -10
- package/dist/tracker/pipeline.d.ts.map +1 -1
- package/dist/tracker/pipeline.js +18 -32
- package/dist/tracker/pipeline.js.map +1 -1
- package/dist/tracker.d.ts +27 -4
- package/dist/tracker.d.ts.map +1 -1
- package/dist/tracker.js +47 -14
- package/dist/tracker.js.map +1 -1
- package/dist/types/config.d.ts +39 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/delegates.d.ts +55 -0
- package/dist/types/delegates.d.ts.map +1 -0
- package/dist/types/delegates.js +9 -0
- package/dist/types/delegates.js.map +1 -0
- package/dist/types/election.d.ts +23 -0
- package/dist/types/election.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/tracking.d.ts +2 -2
- package/dist/types/tracking.d.ts.map +1 -1
- package/dist/utils/chain.d.ts +5 -1
- package/dist/utils/chain.d.ts.map +1 -1
- package/dist/utils/chain.js +7 -0
- package/dist/utils/chain.js.map +1 -1
- package/dist/utils/formatters.d.ts +2 -6
- package/dist/utils/formatters.d.ts.map +1 -1
- package/dist/utils/formatters.js +9 -12
- package/dist/utils/formatters.js.map +1 -1
- package/dist/utils/logger.d.ts +2 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +2 -0
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/rpc-utils.d.ts +0 -6
- package/dist/utils/rpc-utils.d.ts.map +1 -1
- package/dist/utils/rpc-utils.js +0 -9
- package/dist/utils/rpc-utils.js.map +1 -1
- package/dist/utils/stage-metadata.d.ts +19 -0
- package/dist/utils/stage-metadata.d.ts.map +1 -1
- package/dist/utils/stage-metadata.js +44 -0
- package/dist/utils/stage-metadata.js.map +1 -1
- package/dist/utils/timing.d.ts +2 -9
- package/dist/utils/timing.d.ts.map +1 -1
- package/dist/utils/timing.js +3 -20
- package/dist/utils/timing.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://codecov.io/gh/gzeoneth/gov-tracker)
|
|
5
5
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
6
|
|
|
7
|
-
Track and execute Arbitrum DAO governance proposal lifecycle stages
|
|
7
|
+
Track and execute Arbitrum DAO governance proposal lifecycle stages, Security Council elections, and delegate participation.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -15,14 +15,13 @@ yarn add @gzeoneth/gov-tracker ethers@^5.8.0
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
|
-
import {
|
|
19
|
-
import { createTracker, findExecutableStage, ADDRESSES } from "@gzeoneth/gov-tracker";
|
|
18
|
+
import { createTracker, findExecutableStage } from "@gzeoneth/gov-tracker";
|
|
20
19
|
|
|
21
|
-
//
|
|
20
|
+
// Accepts RPC URLs directly (or ethers Provider objects)
|
|
22
21
|
const tracker = createTracker({
|
|
23
|
-
l2Provider:
|
|
24
|
-
l1Provider:
|
|
25
|
-
novaProvider:
|
|
22
|
+
l2Provider: process.env.ARB1_RPC, // URL string or Provider
|
|
23
|
+
l1Provider: process.env.ETH_RPC,
|
|
24
|
+
novaProvider: process.env.NOVA_RPC,
|
|
26
25
|
cachePath: "./gov-tracker-cache.json",
|
|
27
26
|
});
|
|
28
27
|
|
|
@@ -56,6 +55,76 @@ if (readyStage) {
|
|
|
56
55
|
|
|
57
56
|
Statuses: `NOT_STARTED`, `PENDING`, `READY`, `COMPLETED`, `FAILED`, `SKIPPED`
|
|
58
57
|
|
|
58
|
+
## Voting & Write Actions
|
|
59
|
+
|
|
60
|
+
Prepare-only functions return `PreparedTransaction` objects — `{ to, data, value, chain, chainId, description }` plus optional `operationId` / `hashValidation` — and you always sign and send yourself.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { ethers } from "ethers";
|
|
64
|
+
import {
|
|
65
|
+
prepareCastVote,
|
|
66
|
+
prepareCastVoteWithReason,
|
|
67
|
+
VOTE_SUPPORT,
|
|
68
|
+
prepareNomineeElectionVote,
|
|
69
|
+
prepareContenderRegistration,
|
|
70
|
+
NOMINEE_ELECTION_GOVERNOR_ABI,
|
|
71
|
+
ADDRESSES,
|
|
72
|
+
} from "@gzeoneth/gov-tracker";
|
|
73
|
+
|
|
74
|
+
// Governor proposal vote
|
|
75
|
+
const tx = prepareCastVote(proposalId, VOTE_SUPPORT.FOR, "constitutional");
|
|
76
|
+
await signer.sendTransaction(tx);
|
|
77
|
+
|
|
78
|
+
// Vote with on-chain reason
|
|
79
|
+
const tx2 = prepareCastVoteWithReason(proposalId, VOTE_SUPPORT.AGAINST, "Insufficient detail");
|
|
80
|
+
|
|
81
|
+
// Security Council nominee vote (castVoteWithReasonAndParams)
|
|
82
|
+
const tx3 = prepareNomineeElectionVote(proposalId, nomineeAddress, votes);
|
|
83
|
+
|
|
84
|
+
// Contender registration (two-phase: sign EIP-712 typed data, then submit)
|
|
85
|
+
// governorName MUST match the governor's on-chain name() value (EIP-712 domain)
|
|
86
|
+
const governor = new ethers.Contract(
|
|
87
|
+
ADDRESSES.ELECTION_NOMINEE_GOVERNOR,
|
|
88
|
+
NOMINEE_ELECTION_GOVERNOR_ABI,
|
|
89
|
+
l2Provider
|
|
90
|
+
);
|
|
91
|
+
const governorName: string = await governor.name();
|
|
92
|
+
const { typedData, buildTransaction } = prepareContenderRegistration(governorName, proposalId);
|
|
93
|
+
const signature = await signer._signTypedData(typedData.domain, typedData.types, typedData.message);
|
|
94
|
+
await signer.sendTransaction(buildTransaction(signature));
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
See [API Reference](./docs/API.md#governance-vote-preparation) and [Examples](./docs/EXAMPLES.md#voting) for details.
|
|
98
|
+
|
|
99
|
+
## Delegates
|
|
100
|
+
|
|
101
|
+
Indexed ARB delegate registry with cached voting power and live queries:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import {
|
|
105
|
+
loadBundledDelegateCache,
|
|
106
|
+
getTopDelegates,
|
|
107
|
+
getDelegateRankInfo,
|
|
108
|
+
queryDelegatesNotVoted,
|
|
109
|
+
} from "@gzeoneth/gov-tracker";
|
|
110
|
+
|
|
111
|
+
// Load bundled cache (sync, no RPC)
|
|
112
|
+
const cache = loadBundledDelegateCache();
|
|
113
|
+
const top10 = getTopDelegates(cache, 10);
|
|
114
|
+
|
|
115
|
+
// O(1) rank lookup
|
|
116
|
+
const info = getDelegateRankInfo(cache, "0x1234...");
|
|
117
|
+
console.log(`Rank ${info?.rank}, voting power ${info?.votingPower}`);
|
|
118
|
+
|
|
119
|
+
// Live: find top delegates who haven't voted yet on an active proposal
|
|
120
|
+
const notVoted = await queryDelegatesNotVoted(l2Provider, proposalId, "constitutional", {
|
|
121
|
+
limit: 10,
|
|
122
|
+
maxDelegatesToCheck: 100,
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Build or refresh the cache via CLI: `npx @gzeoneth/gov-tracker delegates`.
|
|
127
|
+
|
|
59
128
|
## CLI
|
|
60
129
|
|
|
61
130
|
```bash
|
|
@@ -94,6 +163,12 @@ npx @gzeoneth/gov-tracker ui
|
|
|
94
163
|
|
|
95
164
|
# Track election creation tx (auto-switches to election view)
|
|
96
165
|
npx @gzeoneth/gov-tracker track 0x82a0baf3...
|
|
166
|
+
|
|
167
|
+
# Build or refresh delegate cache from live RPC
|
|
168
|
+
npx @gzeoneth/gov-tracker delegates # Incremental update
|
|
169
|
+
npx @gzeoneth/gov-tracker delegates --force # Rebuild from genesis
|
|
170
|
+
npx @gzeoneth/gov-tracker delegates --min-power 1000 \
|
|
171
|
+
--output ./my-delegates.json # Custom filters/output
|
|
97
172
|
```
|
|
98
173
|
|
|
99
174
|
**Shorthands:** `-v` (verbose), `-p` (prepare), `-w` (write), `-i` (inspect)
|
|
@@ -174,6 +249,18 @@ PRIVATE_KEY=0x... # For execution
|
|
|
174
249
|
|
|
175
250
|
The CLI warns when using default public RPCs. For production, set these environment variables.
|
|
176
251
|
|
|
252
|
+
### RPC Provider Recommendations
|
|
253
|
+
|
|
254
|
+
For reliable operation, especially during election tracking which makes many RPC calls:
|
|
255
|
+
|
|
256
|
+
| Chain | Recommended Providers |
|
|
257
|
+
|-------|----------------------|
|
|
258
|
+
| Ethereum | [Alchemy](https://www.alchemy.com/), [Infura](https://infura.io/), [ethereum.publicnode.com](https://ethereum.publicnode.com/) |
|
|
259
|
+
| Arbitrum One | [Alchemy](https://www.alchemy.com/), [arb1.arbitrum.io/rpc](https://arb1.arbitrum.io/rpc), [arbitrum.publicnode.com](https://arbitrum.publicnode.com/) |
|
|
260
|
+
| Arbitrum Nova | [nova.arbitrum.io/rpc](https://nova.arbitrum.io/rpc) |
|
|
261
|
+
|
|
262
|
+
**Note:** Some public RPCs like `cloudflare-eth.com` may return `-32603` internal errors during high load. If you experience intermittent failures, try switching to a dedicated provider.
|
|
263
|
+
|
|
177
264
|
## Security & Privacy
|
|
178
265
|
|
|
179
266
|
**External API Lookups**: When decoding calldata, unknown function selectors are looked up via [4byte.directory](https://www.4byte.directory/). To disable:
|