@raac/rpc 1.2.0-beta.3 → 1.2.0-beta.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/dist/RPCLibrary.js
CHANGED
|
@@ -169,6 +169,7 @@ const getProposalThreshold_1 = require("./contracts/governance/proposals/getProp
|
|
|
169
169
|
const getVotes_1 = require("./contracts/governance/proposals/getVotes");
|
|
170
170
|
const propose_1 = require("./contracts/governance/proposals/propose");
|
|
171
171
|
const getProposal_1 = require("./contracts/governance/proposals/getProposal");
|
|
172
|
+
const getProposalCount_1 = require("./contracts/governance/proposals/getProposalCount");
|
|
172
173
|
const getQuorum_1 = require("./contracts/governance/proposals/getQuorum");
|
|
173
174
|
const getVotingDelay_1 = require("./contracts/governance/proposals/getVotingDelay");
|
|
174
175
|
// Timelock
|
|
@@ -464,6 +465,7 @@ class RPCLibrary {
|
|
|
464
465
|
getVotes: getVotes_1.getVotes,
|
|
465
466
|
propose: propose_1.propose,
|
|
466
467
|
getProposal: getProposal_1.getProposal,
|
|
468
|
+
getProposalCount: getProposalCount_1.getProposalCount,
|
|
467
469
|
getQuorum: getQuorum_1.getQuorum,
|
|
468
470
|
getVotingDelay: getVotingDelay_1.getVotingDelay,
|
|
469
471
|
},
|
|
@@ -36,18 +36,21 @@ const getProposal = async (chainId, proposalId, provider) => {
|
|
|
36
36
|
const abi = (0, artifacts_1.getABI)("governance");
|
|
37
37
|
const contract = new ethers_1.ethers.Contract(contractAddress, abi, provider);
|
|
38
38
|
const proposal = await contract.getProposal(proposalId);
|
|
39
|
+
// Destructure by index: ethers v6 Result extends Array, so `proposal.values`
|
|
40
|
+
// resolves to Array.prototype.values (the iterator) instead of the struct field.
|
|
41
|
+
const [id, proposer, proposalType, startTime, endTime, executed, canceled, descriptionHash, targets, rawValues, calldatas,] = proposal;
|
|
39
42
|
return {
|
|
40
|
-
id: Number(
|
|
41
|
-
proposer
|
|
42
|
-
proposalType: Number(
|
|
43
|
-
startTime: Number(
|
|
44
|
-
endTime: Number(
|
|
45
|
-
executed
|
|
46
|
-
canceled
|
|
47
|
-
descriptionHash
|
|
48
|
-
targets:
|
|
49
|
-
values:
|
|
50
|
-
calldatas:
|
|
43
|
+
id: Number(id),
|
|
44
|
+
proposer,
|
|
45
|
+
proposalType: Number(proposalType),
|
|
46
|
+
startTime: Number(startTime),
|
|
47
|
+
endTime: Number(endTime),
|
|
48
|
+
executed,
|
|
49
|
+
canceled,
|
|
50
|
+
descriptionHash,
|
|
51
|
+
targets: Array.from(targets),
|
|
52
|
+
values: Array.from(rawValues).map((v) => ethers_1.ethers.formatEther(v)),
|
|
53
|
+
calldatas: Array.from(calldatas),
|
|
51
54
|
};
|
|
52
55
|
};
|
|
53
56
|
exports.getProposal = getProposal;
|
|
@@ -137,6 +137,7 @@ import { getProposalThreshold as getProposalThresholdProposals } from "./contrac
|
|
|
137
137
|
import { getVotes as getVotesProposals } from "./contracts/governance/proposals/getVotes";
|
|
138
138
|
import { propose as proposeProposals } from "./contracts/governance/proposals/propose";
|
|
139
139
|
import { getProposal as getProposalProposals } from "./contracts/governance/proposals/getProposal";
|
|
140
|
+
import { getProposalCount as getProposalCountProposals } from "./contracts/governance/proposals/getProposalCount";
|
|
140
141
|
import { getQuorum as getQuorumProposals } from "./contracts/governance/proposals/getQuorum";
|
|
141
142
|
import { getVotingDelay as getVotingDelayProposals } from "./contracts/governance/proposals/getVotingDelay";
|
|
142
143
|
import { getConstants as getConstantsTimelock } from "./contracts/governance/timelock/getConstants";
|
|
@@ -335,6 +336,7 @@ declare class RPCLibrary {
|
|
|
335
336
|
getVotes: typeof getVotesProposals;
|
|
336
337
|
propose: typeof proposeProposals;
|
|
337
338
|
getProposal: typeof getProposalProposals;
|
|
339
|
+
getProposalCount: typeof getProposalCountProposals;
|
|
338
340
|
getQuorum: typeof getQuorumProposals;
|
|
339
341
|
getVotingDelay: typeof getVotingDelayProposals;
|
|
340
342
|
};
|