@moonwell-fi/moonwell-sdk 0.20.2 → 0.20.4
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/CHANGELOG.md +18 -0
- package/_cjs/actions/governance/common.js +9 -7
- package/_cjs/actions/governance/common.js.map +1 -1
- package/_cjs/actions/governance/getStakingInfo.js +1 -1
- package/_cjs/actions/governance/getStakingInfo.js.map +1 -1
- package/_cjs/actions/governance/getUserStakingInfo.js +2 -2
- package/_cjs/actions/governance/getUserStakingInfo.js.map +1 -1
- package/_cjs/actions/governance/governor-api-client.js +3 -2
- package/_cjs/actions/governance/governor-api-client.js.map +1 -1
- package/_cjs/actions/governance/proposals/common.js +11 -296
- package/_cjs/actions/governance/proposals/common.js.map +1 -1
- package/_cjs/actions/governance/proposals/getProposal.js +9 -25
- package/_cjs/actions/governance/proposals/getProposal.js.map +1 -1
- package/_cjs/actions/governance/proposals/getProposals.js +23 -14
- package/_cjs/actions/governance/proposals/getProposals.js.map +1 -1
- package/_cjs/actions/morpho/user-rewards/common.js +2 -1
- package/_cjs/actions/morpho/user-rewards/common.js.map +1 -1
- package/_cjs/common/lunar-indexer-helpers.js +6 -0
- package/_cjs/common/lunar-indexer-helpers.js.map +1 -1
- package/_cjs/environments/definitions/base/environment.js +2 -1
- package/_cjs/environments/definitions/base/environment.js.map +1 -1
- package/_cjs/environments/definitions/ethereum/environment.js +2 -1
- package/_cjs/environments/definitions/ethereum/environment.js.map +1 -1
- package/_cjs/environments/definitions/moonbeam/environment.js +2 -1
- package/_cjs/environments/definitions/moonbeam/environment.js.map +1 -1
- package/_cjs/environments/definitions/optimism/environment.js +2 -1
- package/_cjs/environments/definitions/optimism/environment.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/types/proposal.js.map +1 -1
- package/_esm/actions/governance/common.js +12 -7
- package/_esm/actions/governance/common.js.map +1 -1
- package/_esm/actions/governance/getStakingInfo.js +1 -1
- package/_esm/actions/governance/getStakingInfo.js.map +1 -1
- package/_esm/actions/governance/getUserStakingInfo.js +2 -2
- package/_esm/actions/governance/getUserStakingInfo.js.map +1 -1
- package/_esm/actions/governance/governor-api-client.js +21 -4
- package/_esm/actions/governance/governor-api-client.js.map +1 -1
- package/_esm/actions/governance/ipfs.js +2 -2
- package/_esm/actions/governance/proposals/common.js +28 -302
- package/_esm/actions/governance/proposals/common.js.map +1 -1
- package/_esm/actions/governance/proposals/getProposal.js +23 -35
- package/_esm/actions/governance/proposals/getProposal.js.map +1 -1
- package/_esm/actions/governance/proposals/getProposals.js +48 -20
- package/_esm/actions/governance/proposals/getProposals.js.map +1 -1
- package/_esm/actions/morpho/user-rewards/common.js +2 -1
- package/_esm/actions/morpho/user-rewards/common.js.map +1 -1
- package/_esm/common/lunar-indexer-helpers.js +23 -0
- package/_esm/common/lunar-indexer-helpers.js.map +1 -1
- package/_esm/environments/definitions/base/environment.js +2 -1
- package/_esm/environments/definitions/base/environment.js.map +1 -1
- package/_esm/environments/definitions/ethereum/environment.js +2 -1
- package/_esm/environments/definitions/ethereum/environment.js.map +1 -1
- package/_esm/environments/definitions/moonbeam/environment.js +2 -1
- package/_esm/environments/definitions/moonbeam/environment.js.map +1 -1
- package/_esm/environments/definitions/optimism/environment.js +2 -1
- package/_esm/environments/definitions/optimism/environment.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/types/proposal.js.map +1 -1
- package/_types/actions/governance/common.d.ts +3 -3
- package/_types/actions/governance/common.d.ts.map +1 -1
- package/_types/actions/governance/getUserStakingInfo.d.ts.map +1 -1
- package/_types/actions/governance/getUserVoteReceipt.d.ts +4 -4
- package/_types/actions/governance/governor-api-client.d.ts +34 -4
- package/_types/actions/governance/governor-api-client.d.ts.map +1 -1
- package/_types/actions/governance/ipfs.d.ts +2 -2
- package/_types/actions/governance/proposals/common.d.ts +12 -39
- package/_types/actions/governance/proposals/common.d.ts.map +1 -1
- package/_types/actions/governance/proposals/getProposal.d.ts +2 -1
- package/_types/actions/governance/proposals/getProposal.d.ts.map +1 -1
- package/_types/actions/governance/proposals/getProposals.d.ts.map +1 -1
- package/_types/actions/morpho/user-rewards/common.d.ts.map +1 -1
- package/_types/common/lunar-indexer-helpers.d.ts +19 -0
- package/_types/common/lunar-indexer-helpers.d.ts.map +1 -1
- package/_types/environments/definitions/base/environment.d.ts.map +1 -1
- package/_types/environments/definitions/ethereum/environment.d.ts.map +1 -1
- package/_types/environments/definitions/moonbeam/environment.d.ts.map +1 -1
- package/_types/environments/definitions/optimism/environment.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/types/proposal.d.ts +11 -0
- package/_types/types/proposal.d.ts.map +1 -1
- package/actions/governance/common.ts +14 -5
- package/actions/governance/getStakingInfo.ts +1 -1
- package/actions/governance/getUserStakingInfo.ts +4 -1
- package/actions/governance/getUserVoteReceipt.ts +4 -4
- package/actions/governance/governor-api-client.ts +35 -4
- package/actions/governance/ipfs.ts +2 -2
- package/actions/governance/proposals/common.ts +28 -466
- package/actions/governance/proposals/getProposal.ts +25 -49
- package/actions/governance/proposals/getProposals.ts +57 -30
- package/actions/morpho/user-rewards/common.ts +2 -1
- package/common/lunar-indexer-helpers.ts +26 -0
- package/environments/definitions/base/environment.ts +2 -2
- package/environments/definitions/ethereum/environment.ts +2 -2
- package/environments/definitions/moonbeam/environment.ts +2 -2
- package/environments/definitions/optimism/environment.ts +2 -2
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/types/proposal.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"governor-api-client.d.ts","sourceRoot":"","sources":["../../../actions/governance/governor-api-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAW/D
|
|
1
|
+
{"version":3,"file":"governor-api-client.d.ts","sourceRoot":"","sources":["../../../actions/governance/governor-api-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6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BrC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,EAAE,CAAC,CAepB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,MAAM,EAC3B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CAS3B"}
|
|
@@ -22,8 +22,8 @@ export declare const fetchIpfsContent: (hash: string) => Promise<string>;
|
|
|
22
22
|
* fetches run in parallel.
|
|
23
23
|
*
|
|
24
24
|
* Failures are logged via console.warn AND surfaced through
|
|
25
|
-
* `env.onError` (matching the convention used by `
|
|
26
|
-
* `
|
|
25
|
+
* `env.onError` (matching the convention used by `getProposalsOnChainData` /
|
|
26
|
+
* `readCrossChainQuorums`), then swallowed per-proposal: the `ipfs://` URI
|
|
27
27
|
* is left untouched so consumers can detect (e.g. via
|
|
28
28
|
* `description.startsWith("ipfs://")`) and render a fallback. The bulk call
|
|
29
29
|
* never rejects, so a single bad pin doesn't kill `getProposals()` for
|
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
import { Amount } from "../../../common/index.js";
|
|
2
2
|
import type { Environment } from "../../../environments/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ProposalState } from "../../../types/proposal.js";
|
|
4
4
|
import type { ApiProposal } from "../governor-api-client.js";
|
|
5
5
|
export declare const WORMHOLE_CONTRACT = "0xc8e2b0cd52cf01b0ce87d389daa3d414d4ce29f3";
|
|
6
|
-
type PonderExtendedProposalData = {
|
|
7
|
-
id: number;
|
|
8
|
-
title: string;
|
|
9
|
-
subtitle: string;
|
|
10
|
-
description: string;
|
|
11
|
-
targets: string[];
|
|
12
|
-
calldatas: string[];
|
|
13
|
-
signatures: string[];
|
|
14
|
-
stateChanges: {
|
|
15
|
-
blockNumber: number;
|
|
16
|
-
transactionHash: string;
|
|
17
|
-
state: string;
|
|
18
|
-
}[];
|
|
19
|
-
};
|
|
20
6
|
/**
|
|
21
7
|
* Extract proposal subtitle from description
|
|
22
8
|
*/
|
|
@@ -58,12 +44,20 @@ export declare const isMultichainHomeChain: (chainId: number) => boolean;
|
|
|
58
44
|
* falls back to the home/bridge checks. Omit it or pass `undefined` when the
|
|
59
45
|
* count read failed so the unknown-cutoff bias above applies. (No `= 0` default:
|
|
60
46
|
* that would coerce an explicit `undefined` back to 0 and defeat the bias.)
|
|
47
|
+
*
|
|
48
|
+
* `hasMultichainGovernor` gates rule 4: the unknown-cutoff bias only makes sense
|
|
49
|
+
* on a chain that actually has a multichain governor to route to. On a
|
|
50
|
+
* legacy-only chain (Moonriver — legacy `governor`, no `multichainGovernor`) a
|
|
51
|
+
* failed Artemis count must NOT flip the proposal to multichain, which would
|
|
52
|
+
* route reads to a null contract and surface a spurious `multichain` field.
|
|
53
|
+
* Defaults to `true` so callers that don't supply it keep the dual-governor
|
|
54
|
+
* (Moonbeam) bias behavior.
|
|
61
55
|
*/
|
|
62
56
|
export declare const classifyProposalMultichain: (proposal: {
|
|
63
57
|
targets?: string[];
|
|
64
58
|
proposalId: number;
|
|
65
59
|
chainId: number;
|
|
66
|
-
}, legacyArtemisMaxId?: number) => boolean;
|
|
60
|
+
}, legacyArtemisMaxId?: number, hasMultichainGovernor?: boolean) => boolean;
|
|
67
61
|
/**
|
|
68
62
|
* @deprecated Use `classifyProposalMultichain` — this variant misses hub-homed
|
|
69
63
|
* proposals when the Artemis count is unavailable. Kept for compatibility.
|
|
@@ -127,9 +121,8 @@ export type ProposalOnChainData = {
|
|
|
127
121
|
* the `options.crossChainQuorums?.get(...) ?? 0n` pattern.
|
|
128
122
|
*
|
|
129
123
|
* Read failures are routed through `onError` so Sentry-wired consumers see
|
|
130
|
-
* them — matching `
|
|
131
|
-
* `
|
|
132
|
-
* `onError` since we don't have one per foreign chain in scope.
|
|
124
|
+
* them — matching `getProposalsOnChainData`. The caller's `governanceEnvironment`
|
|
125
|
+
* carries `onError` since we don't have one per foreign chain in scope.
|
|
133
126
|
*/
|
|
134
127
|
export declare const getEnvironmentByChainId: (chainId: number) => Environment | undefined;
|
|
135
128
|
export declare const readCrossChainQuorums: (apiProposals: ApiProposal[], governanceEnvironment: Environment) => Promise<Map<number, bigint>>;
|
|
@@ -139,24 +132,4 @@ export declare const readCrossChainQuorums: (apiProposals: ApiProposal[], govern
|
|
|
139
132
|
export declare const getProposalsOnChainData: (apiProposals: ApiProposal[], governanceEnvironment: Environment, options?: {
|
|
140
133
|
crossChainQuorums?: Map<number, bigint>;
|
|
141
134
|
}) => Promise<ProposalOnChainData[]>;
|
|
142
|
-
/**
|
|
143
|
-
* Get proposal data from on-chain (Ponder-based, for Moonriver)
|
|
144
|
-
*/
|
|
145
|
-
export declare const getProposalData: (params: {
|
|
146
|
-
environment: Environment;
|
|
147
|
-
id?: number;
|
|
148
|
-
}) => Promise<Proposal[]>;
|
|
149
|
-
/**
|
|
150
|
-
* Get cross-chain proposal data (Ponder-based, for Moonriver)
|
|
151
|
-
*/
|
|
152
|
-
export declare const getCrossChainProposalData: (params: {
|
|
153
|
-
environment: Environment;
|
|
154
|
-
id?: number;
|
|
155
|
-
}) => Promise<Proposal[]>;
|
|
156
|
-
export declare const appendProposalExtendedData: (proposals: Proposal[], extendedDatas: PonderExtendedProposalData[]) => void;
|
|
157
|
-
export declare const getExtendedProposalData: (params: {
|
|
158
|
-
environment: Environment;
|
|
159
|
-
id?: number;
|
|
160
|
-
}) => Promise<PonderExtendedProposalData[]>;
|
|
161
|
-
export {};
|
|
162
135
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../actions/governance/proposals/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../actions/governance/proposals/common.ts"],"names":[],"mappings":"AACA,OAAO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AE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GACrC,WAAW,oBAAoB,EAC/B,aAAa,WAAW,EACxB,KAAK,MAAM,KACV,aAWF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,aAAa,WAAW,KACvB,oBAkDF,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,GAAG,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA0CF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,MAAM,KACd,WAAW,GAAG,SAGd,CAAC;AAEJ,eAAO,MAAM,qBAAqB,GAChC,cAAc,WAAW,EAAE,EAC3B,uBAAuB,WAAW,KACjC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA6B7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,cAAc,WAAW,EAAE,EAC3B,uBAAuB,WAAW,EAClC,UAAU;IAAE,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,KACpD,OAAO,CAAC,mBAAmB,EAAE,CA0L/B,CAAC"}
|
|
@@ -6,7 +6,8 @@ export type GetProposalParameters<environments, network extends Chain | undefine
|
|
|
6
6
|
proposalId: number;
|
|
7
7
|
/**
|
|
8
8
|
* The chain the proposal lives on (1 = Ethereum multigov,
|
|
9
|
-
* 1284 = Moonbeam historical). When omitted,
|
|
9
|
+
* 1284 = Moonbeam historical, 1285 = Moonriver legacy). When omitted, the
|
|
10
|
+
* supported chains are tried in turn.
|
|
10
11
|
*/
|
|
11
12
|
chainId?: number;
|
|
12
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProposal.d.ts","sourceRoot":"","sources":["../../../../actions/governance/proposals/getProposal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"getProposal.d.ts","sourceRoot":"","sources":["../../../../actions/governance/proposals/getProposal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,4BAA4B,CAAC;AAc1E,MAAM,MAAM,qBAAqB,CAC/B,YAAY,EACZ,OAAO,SAAS,KAAK,GAAG,SAAS,IAC/B,oBAAoB,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;AAElE,wBAAsB,WAAW,CAC/B,YAAY,EACZ,OAAO,SAAS,KAAK,GAAG,SAAS,EAEjC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,qBAAqB,CAAC,YAAY,EAAE,OAAO,CAAC,GACjD,qBAAqB,CAuCvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProposals.d.ts","sourceRoot":"","sources":["../../../../actions/governance/proposals/getProposals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"getProposals.d.ts","sourceRoot":"","sources":["../../../../actions/governance/proposals/getProposals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,4BAA4B,CAAC;AAS1E,MAAM,MAAM,sBAAsB,CAChC,YAAY,EACZ,OAAO,SAAS,KAAK,GAAG,SAAS,IAC/B,4BAA4B,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAExD,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AAEzD,wBAAsB,YAAY,CAChC,YAAY,EACZ,OAAO,SAAS,KAAK,GAAG,SAAS,EAEjC,MAAM,EAAE,cAAc,EACtB,IAAI,CAAC,EAAE,sBAAsB,CAAC,YAAY,EAAE,OAAO,CAAC,GACnD,sBAAsB,CAyCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../actions/morpho/user-rewards/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../actions/morpho/user-rewards/common.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,gCAAgC,CAAC;AAKxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAGzF;;;;;;;GAOG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,MAAM,EAAE;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAChC,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAWF;AAED,wBAAsB,wBAAwB,CAAC,MAAM,EAAE;IACrD,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAsF9B;AAED,wBAAsB,+BAA+B,CAAC,MAAM,EAAE;IAC5D,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;CACxB,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC,CA4GrC"}
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Helper functions for working with Lunar Indexer marketId and tokenId formats
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Default lunar-indexer worker URL, used when an environment has no
|
|
6
|
+
* `lunarIndexerUrl` configured. Shared with the environment definitions so the
|
|
7
|
+
* production host has a single source of truth.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_LUNAR_INDEXER_URL = "https://lunar-services-worker.moonwell.workers.dev";
|
|
10
|
+
/**
|
|
11
|
+
* Build the base URL for the Merkl proxy exposed by the lunar-indexer worker.
|
|
12
|
+
*
|
|
13
|
+
* Merkl's v4 API needs a server-side API key for production rate limits, and
|
|
14
|
+
* the SDK runs in the browser where it cannot hold that secret. So all Merkl
|
|
15
|
+
* requests go through the worker's `/api/v1/merkl` proxy, which injects the key
|
|
16
|
+
* and passes the query/response through unchanged.
|
|
17
|
+
*
|
|
18
|
+
* @param lunarIndexerUrl - The environment's lunar-indexer base URL. Falls back
|
|
19
|
+
* to the production worker when missing or empty, so Merkl always resolves.
|
|
20
|
+
* @returns The Merkl proxy base URL, with no trailing slash
|
|
21
|
+
*/
|
|
22
|
+
export declare function getMerklProxyBaseUrl(lunarIndexerUrl?: string): string;
|
|
4
23
|
/**
|
|
5
24
|
* Build a marketId string from chainId and market address
|
|
6
25
|
* Format: {chainId}-{marketAddress}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lunar-indexer-helpers.d.ts","sourceRoot":"","sources":["../../common/lunar-indexer-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB,CAMA;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,CAMA"}
|
|
1
|
+
{"version":3,"file":"lunar-indexer-helpers.d.ts","sourceRoot":"","sources":["../../common/lunar-indexer-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,uDACgB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAIrE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB,CAMA;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,CAMA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../environments/definitions/base/environment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../environments/definitions/base/environment.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OA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0BAAmD,CAAC;;;;;;qFAA2P,CAAC;4BAAuD,CAAC;2BAAiD,CAAC;;;8BAAmJ,CAAC;;;;;;;;oBAAua,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CA5CzrW,CAAC;AAE3D,QAAA,MAAM,iBAAiB,GACrB,UAAU,MAAM,EAAE,EAClB,uBAAuB,MAAM,EAC7B,kBAAkB,MAAM,KACvB,WAAW,CACZ,OAAO,MAAM,EACb,OAAO,OAAO,EACd,OAAO,MAAM,EACb,OAAO,SAAS,EAChB,OAAO,MAAM,CA8BZ,CAAC;AAEJ,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../environments/definitions/ethereum/environment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../environments/definitions/ethereum/environment.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA8C,CAAC;AAE7D,QAAA,MAAM,iBAAiB,GACrB,UAAU,MAAM,EAAE,EAClB,uBAAuB,MAAM,EAC7B,kBAAkB,MAAM,KACvB,WAAW,CACZ,OAAO,MAAM,EACb,OAAO,OAAO,EACd,EAAE,EACF,OAAO,SAAS,EAChB,OAAO,MAAM,CAwBX,CAAC;AAEL,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../environments/definitions/moonbeam/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../environments/definitions/moonbeam/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,QAAA,MAAM,iBAAiB,GACrB,UAAU,MAAM,EAAE,EAClB,uBAAuB,MAAM,EAC7B,kBAAkB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBtB,CAAC;AAEL,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../environments/definitions/optimism/environment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../../environments/definitions/optimism/environment.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,QAAA,MAAM,iBAAiB,GACrB,UAAU,MAAM,EAAE,EAClB,uBAAuB,MAAM,EAC7B,kBAAkB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBtB,CAAC;AAEL,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,MAAM,EACN,MAAM,EACN,aAAa,EACb,SAAS,EACT,MAAM,GACP,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "0.20.
|
|
1
|
+
export declare const version = "0.20.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -22,6 +22,17 @@ export type Proposal = {
|
|
|
22
22
|
id: number;
|
|
23
23
|
votesCollected: boolean;
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Authoritative per-chain voting-power snapshot blocks resolved by the
|
|
27
|
+
* lunar-indexer, keyed by chain name (`mainnet` → 1, `base` → 8453,
|
|
28
|
+
* `optimism` → 10, `moonbeam` → 1284). Block numbers are decimal strings.
|
|
29
|
+
*
|
|
30
|
+
* Present on indexer-sourced multichain proposals; absent for older
|
|
31
|
+
* proposals indexed before the field existed and for on-chain (Moonriver)
|
|
32
|
+
* proposals. Consumers reading voting power should prefer these blocks over
|
|
33
|
+
* resolving the snapshot timestamp to a block client-side.
|
|
34
|
+
*/
|
|
35
|
+
snapshotBlocks?: Record<string, string>;
|
|
25
36
|
title?: string;
|
|
26
37
|
subtitle?: string;
|
|
27
38
|
description?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposal.d.ts","sourceRoot":"","sources":["../../types/proposal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"proposal.d.ts","sourceRoot":"","sources":["../../types/proposal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,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WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,oBAAY,aAAa;IACvB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,SAAS,IAAI;IACb,MAAM,IAAI;IACV,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,gBAAgB,IAAI;IACpB,kBAAkB,IAAI;CACvB;AAGD,oBAAY,uBAAuB;IACjC,MAAM,IAAI;IACV,wBAAwB,IAAI;IAC5B,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,SAAS,IAAI;IACb,QAAQ,IAAI;CACb;AAGD,eAAO,MAAM,8BAA8B;;;;;;;CAO1C,CAAC;AAGF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import { MOONWELL_FETCH_JSON_HEADERS } from "../../common/fetch-headers.js";
|
|
3
|
+
import { getMerklProxyBaseUrl } from "../../common/lunar-indexer-helpers.js";
|
|
3
4
|
|
|
4
5
|
type MerklRewardsResponse = {
|
|
5
6
|
chain: {
|
|
@@ -84,8 +85,13 @@ export function resetMerklCampaignIdsCache(): void {
|
|
|
84
85
|
* Fetches all Moonwell Merkl campaign IDs from the API.
|
|
85
86
|
* Results are cached in memory for 4 hours since campaigns only change monthly.
|
|
86
87
|
*/
|
|
87
|
-
export async function getMerklCampaignIds(
|
|
88
|
+
export async function getMerklCampaignIds(
|
|
89
|
+
lunarIndexerUrl?: string,
|
|
90
|
+
): Promise<string[]> {
|
|
88
91
|
const now = Date.now();
|
|
92
|
+
// The cache intentionally ignores `lunarIndexerUrl`: the Moonwell campaign set
|
|
93
|
+
// is the same regardless of which proxy host serves it, so a differing URL
|
|
94
|
+
// within the TTL still returns the cached IDs.
|
|
89
95
|
if (
|
|
90
96
|
campaignIdsCache !== null &&
|
|
91
97
|
now - campaignIdsCache.fetchedAt < CAMPAIGN_IDS_CACHE_TTL_MS
|
|
@@ -95,7 +101,7 @@ export async function getMerklCampaignIds(): Promise<string[]> {
|
|
|
95
101
|
|
|
96
102
|
try {
|
|
97
103
|
const response = await fetch(
|
|
98
|
-
|
|
104
|
+
`${getMerklProxyBaseUrl(lunarIndexerUrl)}/campaigns?creatorAddress=${MOONWELL_MERKL_CREATOR}&excludeSubCampaigns=true&items=100`,
|
|
99
105
|
{ headers: MOONWELL_FETCH_JSON_HEADERS },
|
|
100
106
|
);
|
|
101
107
|
|
|
@@ -120,10 +126,12 @@ export async function getMerklRewardsData(
|
|
|
120
126
|
campaignId: string[],
|
|
121
127
|
chainId: number,
|
|
122
128
|
account: Address,
|
|
129
|
+
lunarIndexerUrl?: string,
|
|
123
130
|
): Promise<MerklReward[]> {
|
|
131
|
+
const merklProxyBaseUrl = getMerklProxyBaseUrl(lunarIndexerUrl);
|
|
124
132
|
try {
|
|
125
133
|
const page0Response = await fetch(
|
|
126
|
-
|
|
134
|
+
`${merklProxyBaseUrl}/users/${account}/rewards?chainId=${chainId}&test=false&breakdownPage=0&reloadChainId=${chainId}`,
|
|
127
135
|
{
|
|
128
136
|
headers: MOONWELL_FETCH_JSON_HEADERS,
|
|
129
137
|
},
|
|
@@ -145,7 +153,7 @@ export async function getMerklRewardsData(
|
|
|
145
153
|
// Paginate through remaining breakdown pages to collect all breakdowns
|
|
146
154
|
for (let page = 1; page < MAX_BREAKDOWN_PAGES; page++) {
|
|
147
155
|
const pageResponse = await fetch(
|
|
148
|
-
|
|
156
|
+
`${merklProxyBaseUrl}/users/${account}/rewards?chainId=${chainId}&test=false&breakdownPage=${page}&reloadChainId=${chainId}`,
|
|
149
157
|
{
|
|
150
158
|
headers: MOONWELL_FETCH_JSON_HEADERS,
|
|
151
159
|
},
|
|
@@ -214,12 +222,13 @@ export async function getMerklRewardsData(
|
|
|
214
222
|
|
|
215
223
|
export async function getMerklStakingApr(
|
|
216
224
|
contractAddress: string,
|
|
225
|
+
lunarIndexerUrl?: string,
|
|
217
226
|
): Promise<number> {
|
|
218
227
|
const now = Math.floor(Date.now() / 1000);
|
|
219
228
|
|
|
220
229
|
try {
|
|
221
230
|
const response = await fetch(
|
|
222
|
-
|
|
231
|
+
`${getMerklProxyBaseUrl(lunarIndexerUrl)}/campaigns?creatorAddress=${MOONWELL_MERKL_CREATOR}&excludeSubCampaigns=true&items=100`,
|
|
223
232
|
{ headers: MOONWELL_FETCH_JSON_HEADERS },
|
|
224
233
|
);
|
|
225
234
|
|
|
@@ -207,7 +207,7 @@ export async function getStakingInfo<
|
|
|
207
207
|
? baseTokens?.[baseStakingTokenKey]?.address
|
|
208
208
|
: undefined;
|
|
209
209
|
const baseStakingApr = baseStkTokenAddress
|
|
210
|
-
? await getMerklStakingApr(baseStkTokenAddress)
|
|
210
|
+
? await getMerklStakingApr(baseStkTokenAddress, baseEnv?.lunarIndexerUrl)
|
|
211
211
|
: 0;
|
|
212
212
|
|
|
213
213
|
const result = envsWithStaking.flatMap((curr, index) => {
|
|
@@ -186,11 +186,14 @@ export async function getUserStakingInfo<
|
|
|
186
186
|
}),
|
|
187
187
|
);
|
|
188
188
|
|
|
189
|
-
const campaignIds = await getMerklCampaignIds(
|
|
189
|
+
const campaignIds = await getMerklCampaignIds(
|
|
190
|
+
baseEnvironment?.lunarIndexerUrl,
|
|
191
|
+
);
|
|
190
192
|
const merklRewards = await getMerklRewardsData(
|
|
191
193
|
campaignIds,
|
|
192
194
|
base.id,
|
|
193
195
|
userAddress,
|
|
196
|
+
baseEnvironment?.lunarIndexerUrl,
|
|
194
197
|
);
|
|
195
198
|
|
|
196
199
|
const result = envsWithStaking.flatMap((curr, index) => {
|
|
@@ -23,10 +23,10 @@ export type GetUserVoteReceiptParameters<
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The chain the proposal lives on (1 = Ethereum multigov,
|
|
26
|
-
* 1284 = Moonbeam historical). When omitted, every
|
|
27
|
-
* and non-empty receipts are concatenated —
|
|
28
|
-
* chains (they represent different proposals),
|
|
29
|
-
* can have votes on
|
|
26
|
+
* 1284 = Moonbeam historical, 1285 = Moonriver legacy). When omitted, every
|
|
27
|
+
* supported chain is queried and non-empty receipts are concatenated —
|
|
28
|
+
* proposalIds may collide across chains (they represent different proposals),
|
|
29
|
+
* so a single bare proposalId can have votes on more than one chain.
|
|
30
30
|
*/
|
|
31
31
|
chainId?: number;
|
|
32
32
|
};
|
|
@@ -12,9 +12,26 @@ const getGovernorApiUrl = (environment: Environment): string => {
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Chains the governor indexer serves. Ethereum first because that's where the
|
|
15
|
-
* active multigov contract lives; Moonbeam follows for the historical archive
|
|
15
|
+
* active multigov contract lives; Moonbeam follows for the historical archive,
|
|
16
|
+
* then Moonriver (legacy standalone governor).
|
|
17
|
+
*
|
|
18
|
+
* This is the fan-out set for `getUserVoteReceipt` — a bare proposalId is
|
|
19
|
+
* queried on every chain and non-empty receipts are concatenated. Do NOT use it
|
|
20
|
+
* as the single-proposal fallback in `getProposal`: Moonriver has its own
|
|
21
|
+
* explicit route there, and reaching a 1285 proposal through a Moonbeam env
|
|
22
|
+
* would surface a degraded result (see `MULTIGOV_PROPOSAL_FALLBACK_CHAIN_IDS`).
|
|
23
|
+
*/
|
|
24
|
+
export const SUPPORTED_GOVERNOR_CHAIN_IDS = [1, 1284, 1285] as const;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Fallback chains for a single multigov proposal lookup (`getProposal` with no
|
|
28
|
+
* explicit `chainId`), tried first-hit-wins. Deliberately excludes Moonriver
|
|
29
|
+
* (1285): Moonriver proposals are fetched through their own env via an explicit
|
|
30
|
+
* chainId, so a bare Moonbeam/Ethereum lookup must never resolve to a 1285
|
|
31
|
+
* proposal — that would return `quorum: 0n` (cross-chain quorum skips
|
|
32
|
+
* governor-less chains) and the wrong `environment`.
|
|
16
33
|
*/
|
|
17
|
-
export const
|
|
34
|
+
export const MULTIGOV_PROPOSAL_FALLBACK_CHAIN_IDS = [1, 1284] as const;
|
|
18
35
|
|
|
19
36
|
/**
|
|
20
37
|
* Build the chain-prefixed proposal key the indexer requires
|
|
@@ -103,6 +120,13 @@ export type ApiProposal = {
|
|
|
103
120
|
targets: string[];
|
|
104
121
|
values: string[];
|
|
105
122
|
calldatas: string[];
|
|
123
|
+
/**
|
|
124
|
+
* Legacy/Artemis-governor function signatures (e.g. "setDirectPrice(address,uint256)"),
|
|
125
|
+
* parallel to `targets`/`calldatas`. Present for legacy-governor proposals
|
|
126
|
+
* (Moonriver, early Moonbeam) whose calldata carries no 4-byte selector;
|
|
127
|
+
* empty/absent for multichain-governor proposals (selector is in the calldata).
|
|
128
|
+
*/
|
|
129
|
+
signatures?: string[];
|
|
106
130
|
votingStartTime: number;
|
|
107
131
|
votingEndTime: number;
|
|
108
132
|
description: string;
|
|
@@ -113,6 +137,12 @@ export type ApiProposal = {
|
|
|
113
137
|
timestamp: number;
|
|
114
138
|
transactionHash: string;
|
|
115
139
|
stateChanges?: ApiProposalStateChange[];
|
|
140
|
+
/**
|
|
141
|
+
* Per-chain voting-power snapshot blocks resolved by the indexer, keyed by
|
|
142
|
+
* chain name (`mainnet`, `base`, `optimism`, `moonbeam`). Decimal strings.
|
|
143
|
+
* Omitted for proposals indexed before this field existed.
|
|
144
|
+
*/
|
|
145
|
+
snapshotBlocks?: Record<string, string>;
|
|
116
146
|
};
|
|
117
147
|
|
|
118
148
|
export type ApiVote = {
|
|
@@ -168,8 +198,9 @@ export type FetchProposalsOptions = PaginationOptions & {
|
|
|
168
198
|
/**
|
|
169
199
|
* Fetch proposals from Governor API
|
|
170
200
|
*
|
|
171
|
-
* `chainId` is required by the indexer — 1 (Ethereum multigov)
|
|
172
|
-
* 1284 (Moonbeam historical). Missing/unsupported
|
|
201
|
+
* `chainId` is required by the indexer — 1 (Ethereum multigov),
|
|
202
|
+
* 1284 (Moonbeam historical), or 1285 (Moonriver legacy). Missing/unsupported
|
|
203
|
+
* chainId returns 400.
|
|
173
204
|
*/
|
|
174
205
|
export async function fetchProposals(
|
|
175
206
|
environment: Environment,
|
|
@@ -50,8 +50,8 @@ export const fetchIpfsContent = async (hash: string): Promise<string> => {
|
|
|
50
50
|
* fetches run in parallel.
|
|
51
51
|
*
|
|
52
52
|
* Failures are logged via console.warn AND surfaced through
|
|
53
|
-
* `env.onError` (matching the convention used by `
|
|
54
|
-
* `
|
|
53
|
+
* `env.onError` (matching the convention used by `getProposalsOnChainData` /
|
|
54
|
+
* `readCrossChainQuorums`), then swallowed per-proposal: the `ipfs://` URI
|
|
55
55
|
* is left untouched so consumers can detect (e.g. via
|
|
56
56
|
* `description.startsWith("ipfs://")`) and render a fallback. The bulk call
|
|
57
57
|
* never rejects, so a single bad pin doesn't kill `getProposals()` for
|