@agoric/governance 0.10.4-upgrade-14-dev-c8f9e7b.0 → 0.10.4-upgrade-16-fi-dev-8879538.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/exported.d.ts +32 -0
- package/exported.js +1 -1
- package/package.json +35 -29
- package/src/binaryVoteCounter.d.ts +6 -3
- package/src/binaryVoteCounter.d.ts.map +1 -1
- package/src/binaryVoteCounter.js +6 -2
- package/src/breakTie.d.ts +1 -0
- package/src/breakTie.d.ts.map +1 -1
- package/src/breakTie.js +4 -0
- package/src/closingRule.d.ts +4 -0
- package/src/closingRule.d.ts.map +1 -1
- package/src/closingRule.js +4 -0
- package/src/committee.d.ts +12 -8
- package/src/committee.d.ts.map +1 -1
- package/src/committee.js +24 -11
- package/src/constants.d.ts +12 -12
- package/src/constants.d.ts.map +1 -1
- package/src/contractGovernance/governApi.d.ts +11 -8
- package/src/contractGovernance/governApi.d.ts.map +1 -1
- package/src/contractGovernance/governApi.js +8 -3
- package/src/contractGovernance/governFilter.d.ts +8 -2
- package/src/contractGovernance/governFilter.d.ts.map +1 -1
- package/src/contractGovernance/governFilter.js +5 -1
- package/src/contractGovernance/governParam.d.ts +9 -2
- package/src/contractGovernance/governParam.d.ts.map +1 -1
- package/src/contractGovernance/governParam.js +6 -1
- package/src/contractGovernance/paramManager.d.ts +13 -9
- package/src/contractGovernance/paramManager.d.ts.map +1 -1
- package/src/contractGovernance/paramManager.js +18 -14
- package/src/contractGovernance/typedParamManager.d.ts +19 -10
- package/src/contractGovernance/typedParamManager.d.ts.map +1 -1
- package/src/contractGovernance/typedParamManager.js +5 -0
- package/src/contractGovernor.d.ts +11 -5
- package/src/contractGovernor.d.ts.map +1 -1
- package/src/contractGovernor.js +19 -9
- package/src/contractGovernorKit.d.ts +14 -48
- package/src/contractGovernorKit.d.ts.map +1 -1
- package/src/contractGovernorKit.js +56 -10
- package/src/contractHelper.d.ts +68 -78
- package/src/contractHelper.d.ts.map +1 -1
- package/src/contractHelper.js +21 -21
- package/src/electorateTools.d.ts +21 -17
- package/src/electorateTools.d.ts.map +1 -1
- package/src/electorateTools.js +20 -12
- package/src/index.js +3 -6
- package/src/multiCandidateVoteCounter.d.ts +6 -3
- package/src/multiCandidateVoteCounter.d.ts.map +1 -1
- package/src/multiCandidateVoteCounter.js +8 -4
- package/src/noActionElectorate.d.ts +6 -1
- package/src/noActionElectorate.d.ts.map +1 -1
- package/src/noActionElectorate.js +11 -2
- package/src/question.d.ts +15 -11
- package/src/question.d.ts.map +1 -1
- package/src/question.js +5 -0
- package/src/quorumCounter.d.ts +1 -1
- package/src/quorumCounter.d.ts.map +1 -1
- package/src/quorumCounter.js +4 -0
- package/src/typeGuards.d.ts +91 -54
- package/src/typeGuards.d.ts.map +1 -1
- package/src/types.d.ts +59 -62
- package/src/types.d.ts.map +1 -1
- package/src/types.js +35 -27
- package/src/validators.d.ts +5 -0
- package/src/validators.d.ts.map +1 -1
- package/src/validators.js +6 -3
- package/src/voterKit.d.ts +6 -11
- package/src/voterKit.d.ts.map +1 -1
- package/src/voterKit.js +4 -0
- package/tools/puppetContractGovernor.d.ts +15 -11
- package/tools/puppetContractGovernor.d.ts.map +1 -1
- package/tools/puppetContractGovernor.js +7 -5
- package/tools/puppetGovernance.d.ts +31 -30
- package/tools/puppetGovernance.d.ts.map +1 -1
- package/tools/puppetGovernance.js +6 -4
- package/tools/storageDoc.d.ts +3 -3
- package/tools/storageDoc.d.ts.map +1 -1
- package/CHANGELOG.md +0 -456
- package/src/types-ambient.d.ts +0 -1047
- package/src/types-ambient.d.ts.map +0 -1
- package/src/types-ambient.js +0 -731
package/src/types.d.ts
CHANGED
|
@@ -7,35 +7,31 @@
|
|
|
7
7
|
* When voters are limited to choosing a single candidate, either UNRANKED or
|
|
8
8
|
* ORDER would work. UNRANKED has a simpler representation so we use that.
|
|
9
9
|
*/
|
|
10
|
-
export type ChoiceMethod =
|
|
10
|
+
export type ChoiceMethod = "unranked" | "order" | "plurality";
|
|
11
11
|
/**
|
|
12
12
|
* param_change is very specific. Survey means multiple answers are possible,
|
|
13
13
|
* Election means some candidates are going to "win". It's not clear these are
|
|
14
14
|
* orthogonal. The important distinction is that param_change has a structured
|
|
15
15
|
* issue, while the others have a issue presented as a string.
|
|
16
16
|
*/
|
|
17
|
-
export type ElectionType =
|
|
18
|
-
export type
|
|
19
|
-
export type QuorumRule = 'majority' | 'all' | 'no_quorum';
|
|
17
|
+
export type ElectionType = "param_change" | "election" | "survey" | "api_invocation" | "offer_filter";
|
|
18
|
+
export type QuorumRule = "majority" | "all" | "no_quorum";
|
|
20
19
|
export type SimpleIssue = {
|
|
21
20
|
text: string;
|
|
22
21
|
};
|
|
23
|
-
export type ParamValue =
|
|
24
|
-
export type ParamValueForType<T extends
|
|
25
|
-
|
|
26
|
-
* <T>
|
|
27
|
-
*/
|
|
28
|
-
export type ParamValueTyped<T extends import("./constants.js").ParamType = import("./constants.js").ParamType> = {
|
|
22
|
+
export type ParamValue = string | number | bigint | globalThis.Brand | globalThis.Amount | import("@agoric/time").TimestampRecord | import("@agoric/time").RelativeTimeRecord | Instance | Installation<any> | Ratio | Container<any, any>;
|
|
23
|
+
export type ParamValueForType<T extends ParamType> = T extends "amount" ? Amount<any> : T extends "brand" ? Brand : T extends "installation" ? Installation : T extends "instance" ? Instance : T extends "invitation" ? Amount<"set"> : T extends "nat" ? bigint : T extends "ratio" ? Ratio : T extends "string" ? string : T extends "timestamp" ? import("@agoric/time").Timestamp : T extends "relativeTime" ? import("@agoric/time").RelativeTime : T extends "unknown" ? unknown : never;
|
|
24
|
+
export type ParamValueTyped<T extends ParamType = ParamType> = {
|
|
29
25
|
type: T;
|
|
30
26
|
value: ParamValueForType<T>;
|
|
31
27
|
};
|
|
32
28
|
/**
|
|
33
|
-
*
|
|
29
|
+
* Terms a contract must provide in order to be governed.
|
|
34
30
|
*/
|
|
35
31
|
export type GovernanceTerms<T extends import("./contractGovernance/typedParamManager.js").ParamTypesMap> = {
|
|
36
|
-
electionManager: import(
|
|
37
|
-
governedParams: import(
|
|
38
|
-
Electorate:
|
|
32
|
+
electionManager: import("@agoric/zoe/src/zoeService/utils.js").Instance<typeof import("./contractGovernor.js")["start"]>;
|
|
33
|
+
governedParams: import("./contractGovernance/typedParamManager.js").ParamRecordsFromTypes<T & {
|
|
34
|
+
Electorate: "invitation";
|
|
39
35
|
}>;
|
|
40
36
|
};
|
|
41
37
|
export type Issue = SimpleIssue | ParamChangeIssue<unknown> | ApiInvocationIssue | OfferFilterIssue;
|
|
@@ -54,22 +50,22 @@ export type TextPosition = {
|
|
|
54
50
|
};
|
|
55
51
|
export type Position = TextPosition | ChangeParamsPosition | NoChangeParamsPosition | InvokeApiPosition | DontInvokeApiPosition | OfferFilterPosition | NoChangeOfferFilterPosition | InvokeApiPosition;
|
|
56
52
|
export type OutcomeRecord = {
|
|
57
|
-
question: Handle<
|
|
53
|
+
question: Handle<"Question">;
|
|
58
54
|
} & ({
|
|
59
|
-
outcome:
|
|
55
|
+
outcome: "win";
|
|
60
56
|
position: Position;
|
|
61
57
|
} | {
|
|
62
|
-
outcome:
|
|
63
|
-
reason:
|
|
58
|
+
outcome: "fail";
|
|
59
|
+
reason: "No quorum";
|
|
64
60
|
});
|
|
65
61
|
export type MultiOutcomeRecord = {
|
|
66
|
-
question: Handle<
|
|
62
|
+
question: Handle<"Question">;
|
|
67
63
|
} & ({
|
|
68
|
-
outcome:
|
|
64
|
+
outcome: "win";
|
|
69
65
|
positions: Position[];
|
|
70
66
|
} | {
|
|
71
|
-
outcome:
|
|
72
|
-
reason:
|
|
67
|
+
outcome: "fail";
|
|
68
|
+
reason: "No quorum";
|
|
73
69
|
});
|
|
74
70
|
/**
|
|
75
71
|
* Specification when requesting creation of a Question
|
|
@@ -90,7 +86,7 @@ export type QuestionDetailsExtraProperties = {
|
|
|
90
86
|
* - instance of the VoteCounter
|
|
91
87
|
*/
|
|
92
88
|
counterInstance: Instance;
|
|
93
|
-
questionHandle: Handle<
|
|
89
|
+
questionHandle: Handle<"Question">;
|
|
94
90
|
};
|
|
95
91
|
/**
|
|
96
92
|
* complete question details: questionSpec plus counter and questionHandle
|
|
@@ -105,14 +101,14 @@ export type Question = {
|
|
|
105
101
|
getDetails: () => QuestionDetails;
|
|
106
102
|
};
|
|
107
103
|
export type CompleteUnrankedQuestion = {
|
|
108
|
-
questionHandle: Handle<
|
|
104
|
+
questionHandle: Handle<"Question">;
|
|
109
105
|
/**
|
|
110
106
|
* - a list of equal-weight preferred positions
|
|
111
107
|
*/
|
|
112
108
|
chosen: Position[];
|
|
113
109
|
};
|
|
114
110
|
export type CompleteWeightedBallot = {
|
|
115
|
-
questionHandle: Handle<
|
|
111
|
+
questionHandle: Handle<"Question">;
|
|
116
112
|
/**
|
|
117
113
|
* - list of positions with
|
|
118
114
|
* weights. VoteCounter may limit weights to a range or require uniqueness.
|
|
@@ -120,7 +116,7 @@ export type CompleteWeightedBallot = {
|
|
|
120
116
|
weighted: [Position, bigint][];
|
|
121
117
|
};
|
|
122
118
|
export type CompleteOrderedBallot = {
|
|
123
|
-
questionHandle: Handle<
|
|
119
|
+
questionHandle: Handle<"Question">;
|
|
124
120
|
/**
|
|
125
121
|
* - ordered list of position from most preferred
|
|
126
122
|
* to least preferred
|
|
@@ -187,9 +183,9 @@ export type CompletedBallet = {
|
|
|
187
183
|
chosen: Position;
|
|
188
184
|
shares: bigint;
|
|
189
185
|
};
|
|
190
|
-
export type SubmitVote = (voterHandle: Handle<
|
|
191
|
-
export type GetOpenQuestions = () => Promise<Handle<
|
|
192
|
-
export type GetQuestion = (h: Handle<
|
|
186
|
+
export type SubmitVote = (voterHandle: Handle<"Voter">, chosenPositions: Position[], weight?: bigint | undefined) => CompletedBallet;
|
|
187
|
+
export type GetOpenQuestions = () => Promise<Handle<"Question">[]>;
|
|
188
|
+
export type GetQuestion = (h: Handle<"Question">) => Promise<Question>;
|
|
193
189
|
export type ElectoratePublic = {
|
|
194
190
|
getQuestionSubscriber: () => Subscriber<QuestionDetails>;
|
|
195
191
|
/**
|
|
@@ -231,16 +227,16 @@ export type VoterFacet = {
|
|
|
231
227
|
submitVote: SubmitVote;
|
|
232
228
|
};
|
|
233
229
|
export type ClosingRule = {
|
|
234
|
-
timer: ERef<
|
|
235
|
-
deadline: import(
|
|
230
|
+
timer: ERef<import("@agoric/time").TimerService>;
|
|
231
|
+
deadline: import("@agoric/time").Timestamp;
|
|
236
232
|
};
|
|
237
233
|
export type CloseVoting = (closingRule: ClosingRule, closeVoting: () => void) => any;
|
|
238
234
|
export type AddQuestionReturn = {
|
|
239
235
|
publicFacet: VoteCounterPublicFacet;
|
|
240
236
|
creatorFacet: VoteCounterCreatorFacet;
|
|
241
|
-
instance: import(
|
|
242
|
-
deadline: import(
|
|
243
|
-
questionHandle: Handle<
|
|
237
|
+
instance: import("@agoric/zoe/src/zoeService/utils.js").Instance<typeof import("./binaryVoteCounter.js").start>;
|
|
238
|
+
deadline: import("@agoric/time").Timestamp;
|
|
239
|
+
questionHandle: Handle<"Question">;
|
|
244
240
|
};
|
|
245
241
|
export type AddQuestion = (voteCounter: ERef<Installation>, questionSpec: QuestionSpec) => Promise<AddQuestionReturn>;
|
|
246
242
|
export type CreateQuestion = (name: string, proposedValue: ParamValue, voteCounterInstallation: Installation, contractInstance: Instance, closingRule: ClosingRule) => Promise<QuestionDetails>;
|
|
@@ -275,7 +271,7 @@ export type ParamChangeIssueDetails = {
|
|
|
275
271
|
* - instance of the VoteCounter
|
|
276
272
|
*/
|
|
277
273
|
counterInstance: Instance;
|
|
278
|
-
questionHandle: Handle<
|
|
274
|
+
questionHandle: Handle<"Question">;
|
|
279
275
|
};
|
|
280
276
|
/**
|
|
281
277
|
* a Record containing
|
|
@@ -294,12 +290,12 @@ export type ParamManagerBase = {
|
|
|
294
290
|
getBrand: (name: string) => Brand;
|
|
295
291
|
getInstance: (name: string) => Instance;
|
|
296
292
|
getInstallation: (name: string) => Installation;
|
|
297
|
-
getInvitationAmount: (name: string) =>
|
|
293
|
+
getInvitationAmount: (name: string) => InvitationAmount;
|
|
298
294
|
getNat: (name: string) => bigint;
|
|
299
295
|
getRatio: (name: string) => Ratio;
|
|
300
296
|
getString: (name: string) => string;
|
|
301
|
-
getTimestamp: (name: string) => import(
|
|
302
|
-
getRelativeTime: (name: string) => import(
|
|
297
|
+
getTimestamp: (name: string) => import("@agoric/time").TimestampRecord;
|
|
298
|
+
getRelativeTime: (name: string) => import("@agoric/time").RelativeTimeRecord;
|
|
303
299
|
getUnknown: (name: string) => any;
|
|
304
300
|
/**
|
|
305
301
|
* - for
|
|
@@ -352,7 +348,7 @@ export type NoChangeOfferFilterPosition = {
|
|
|
352
348
|
};
|
|
353
349
|
export type InvokeApiPosition = {
|
|
354
350
|
apiMethodName: string;
|
|
355
|
-
methodArgs:
|
|
351
|
+
methodArgs: Passable[];
|
|
356
352
|
};
|
|
357
353
|
export type DontInvokeApiPosition = {
|
|
358
354
|
dontInvoke: string;
|
|
@@ -421,7 +417,7 @@ export type GovernorCreatorFacet<SF extends GovernableStartFn> = {
|
|
|
421
417
|
/**
|
|
422
418
|
* - public facet of the governed contract
|
|
423
419
|
*/
|
|
424
|
-
getPublicFacet: () => GovernedPublicFacet<Awaited<ReturnType<SF>>[
|
|
420
|
+
getPublicFacet: () => GovernedPublicFacet<Awaited<ReturnType<SF>>["publicFacet"]>;
|
|
425
421
|
/**
|
|
426
422
|
* - instance of the governed
|
|
427
423
|
* contract
|
|
@@ -438,7 +434,7 @@ export type GovernedPublicFacetMethods = {
|
|
|
438
434
|
getInvitationAmount: (name: string) => Amount;
|
|
439
435
|
};
|
|
440
436
|
export type GovernedPublicFacet<PF extends {}> = PF & GovernedPublicFacetMethods;
|
|
441
|
-
export type LimitedCF<SF extends GovernableStartFn> = ReturnType<Awaited<ReturnType<SF>>[
|
|
437
|
+
export type LimitedCF<SF extends GovernableStartFn> = ReturnType<Awaited<ReturnType<SF>>["creatorFacet"]["getLimitedCreatorFacet"]>;
|
|
442
438
|
/**
|
|
443
439
|
* What a governed contract must return as its creatorFacet in order to be governed
|
|
444
440
|
*/
|
|
@@ -466,9 +462,9 @@ export type StandardParamPath = {
|
|
|
466
462
|
export type ParamManagerRetriever = {
|
|
467
463
|
get: (paramKey?: ParamKey) => AnyParamManager;
|
|
468
464
|
};
|
|
469
|
-
export type VoteOnParamChanges<P = StandardParamPath> = (voteCounterInstallation: Installation, deadline: import(
|
|
470
|
-
export type VoteOnApiInvocation = (apiMethodName: string, methodArgs:
|
|
471
|
-
export type VoteOnOfferFilter = (voteCounterInstallation: Installation, deadline: import(
|
|
465
|
+
export type VoteOnParamChanges<P = StandardParamPath> = (voteCounterInstallation: Installation, deadline: import("@agoric/time").Timestamp, paramSpec: ParamChangesSpec<P>) => Promise<ContractGovernanceVoteResult>;
|
|
466
|
+
export type VoteOnApiInvocation = (apiMethodName: string, methodArgs: Passable[], voteCounterInstallation: Installation, deadline: import("@agoric/time").Timestamp) => Promise<ContractGovernanceVoteResult>;
|
|
467
|
+
export type VoteOnOfferFilter = (voteCounterInstallation: Installation, deadline: import("@agoric/time").Timestamp, strings: string[]) => Promise<ContractGovernanceVoteResult>;
|
|
472
468
|
export type ParamGovernor = {
|
|
473
469
|
voteOnParamChanges: VoteOnParamChanges;
|
|
474
470
|
createdQuestion: CreatedQuestion;
|
|
@@ -487,12 +483,12 @@ export type FilterGovernor = {
|
|
|
487
483
|
export type CreatedQuestion = (questionInstance: Instance) => boolean;
|
|
488
484
|
export type PositionIncluded = (positions: Position[], position: Position) => boolean;
|
|
489
485
|
export type GovernedContractTerms = {
|
|
490
|
-
timer: import(
|
|
486
|
+
timer: import("@agoric/time").TimerService;
|
|
491
487
|
issuerKeywordRecord: IssuerKeywordRecord;
|
|
492
488
|
privateArgs: object;
|
|
493
489
|
};
|
|
494
|
-
export type AssertContractGovernance = (zoe: ERef<ZoeService>, allegedGoverned: import("@agoric/zoe/src/zoeService/utils.js").Instance<(zcf: ZCF<GovernanceTerms<{}>>) => {}>, allegedGovernor: Instance, contractGovernorInstallation: Installation<(<SF extends
|
|
495
|
-
timer: import("@agoric/time
|
|
490
|
+
export type AssertContractGovernance = (zoe: ERef<ZoeService>, allegedGoverned: import("@agoric/zoe/src/zoeService/utils.js").Instance<(zcf: ZCF<GovernanceTerms<{}>>) => {}>, allegedGovernor: Instance, contractGovernorInstallation: Installation<(<SF extends GovernableStartFn>(zcf: ZCF<{
|
|
491
|
+
timer: import("@agoric/time").TimerService;
|
|
496
492
|
governedContractInstallation: Installation<SF>;
|
|
497
493
|
governed: {
|
|
498
494
|
issuerKeywordRecord: IssuerKeywordRecord;
|
|
@@ -504,32 +500,28 @@ export type AssertContractGovernance = (zoe: ERef<ZoeService>, allegedGoverned:
|
|
|
504
500
|
label?: string | undefined;
|
|
505
501
|
};
|
|
506
502
|
}>, privateArgs: {
|
|
507
|
-
governed: Record<string, unknown>;
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
*/
|
|
512
|
-
}, baggage: MapStore<string, unknown>) => Promise<{
|
|
513
|
-
creatorFacet: globalThis.GovernorCreatorFacet<SF>;
|
|
514
|
-
publicFacet: globalThis.GovernorPublic;
|
|
503
|
+
governed: Record<string, unknown>;
|
|
504
|
+
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
505
|
+
creatorFacet: GovernorCreatorFacet<SF>;
|
|
506
|
+
publicFacet: GovernorPublic;
|
|
515
507
|
}>)>) => Promise<GovernancePair>;
|
|
516
508
|
/**
|
|
517
509
|
* - assert that the contract uses the
|
|
518
510
|
* electorate
|
|
519
511
|
*/
|
|
520
|
-
export type AssertContractElectorate = (zoe: ERef<ZoeService>, allegedGovernor: Instance, allegedElectorate: Instance) =>
|
|
521
|
-
export type GovernableStartFn =
|
|
512
|
+
export type AssertContractElectorate = (zoe: ERef<ZoeService>, allegedGovernor: Instance, allegedElectorate: Instance) => Promise<true>;
|
|
513
|
+
export type GovernableStartFn = ContractStartFunction & ((zcf?: any, pa?: any, baggage?: any) => ERef<{
|
|
522
514
|
creatorFacet: GovernedCreatorFacet<{}>;
|
|
523
515
|
publicFacet: GovernedPublicFacet<{}>;
|
|
524
516
|
}>);
|
|
525
|
-
export type GovernorSF = typeof import("./contractGovernor.js")[
|
|
517
|
+
export type GovernorSF = typeof import("./contractGovernor.js")["start"];
|
|
526
518
|
/**
|
|
527
519
|
* Same result as StartedInstanceKit but:
|
|
528
520
|
* - typed for contractGovernor installation being started by Zoe. (It in turn starts the governed contract.)
|
|
529
521
|
* - parameterized by Installation instead of StartFunction
|
|
530
522
|
*/
|
|
531
|
-
export type GovernorStartedInstallationKit<I extends ERef<Installation<GovernableStartFn>>> = {
|
|
532
|
-
instance: import(
|
|
523
|
+
export type GovernorStartedInstallationKit<I extends globalThis.ERef<Installation<GovernableStartFn>>> = {
|
|
524
|
+
instance: import("@agoric/zoe/src/zoeService/utils.js").Instance<GovernorSF>;
|
|
533
525
|
adminFacet: AdminFacet;
|
|
534
526
|
creatorFacet: GovernorCreatorFacet<InstallationStart<Awaited<I>>>;
|
|
535
527
|
publicFacet: GovernorPublic;
|
|
@@ -549,13 +541,18 @@ export type GovernanceFacetKit<SF extends GovernableStartFn> = {
|
|
|
549
541
|
/**
|
|
550
542
|
* of the governing contract
|
|
551
543
|
*/
|
|
552
|
-
governorCreatorFacet: GovernorCreatorFacet<SF
|
|
544
|
+
governorCreatorFacet: Guarded<GovernorCreatorFacet<SF>>;
|
|
553
545
|
/**
|
|
554
546
|
* of the governing contract
|
|
555
547
|
*/
|
|
556
548
|
governorAdminFacet: AdminFacet;
|
|
557
|
-
publicFacet: Awaited<ReturnType<SF>>[
|
|
549
|
+
publicFacet: Awaited<ReturnType<SF>>["publicFacet"];
|
|
558
550
|
instance: Instance;
|
|
559
551
|
governor: Instance;
|
|
560
552
|
};
|
|
553
|
+
import type { Container } from '@endo/pass-style';
|
|
554
|
+
import type { ParamType } from './constants.js';
|
|
555
|
+
import type { Passable } from '@endo/pass-style';
|
|
556
|
+
import type { ContractStartFunction } from '@agoric/zoe/src/zoeService/utils.js';
|
|
557
|
+
import type { Guarded } from '@endo/exo';
|
|
561
558
|
//# sourceMappingURL=types.d.ts.map
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;;;;;;2BASc,UAAU,GAAG,OAAO,GAAG,WAAW;;;;;;;2BAWlC,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,gBAAgB,GACtE,cAAkB;yBAUL,UAAU,GAAG,KAAK,GAAG,WAAW;;UAKhC,MAAM;;;8BAwBnB,CAAG,sBAAH,CAAG,AAVU,SAAS,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,GAU5C,CAAG,AATA,SAAS,OAAO,GAAG,KAAK,GAS3B,CAAG,AARA,SAAS,cAAc,GAAG,YAAY,GAQzC,CAAG,AAPA,SAAS,UAAU,GAAG,QAAQ,GAOjC,CAAG,AANA,SAAS,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,GAMxC,CAAG,AALA,SAAS,KAAK,GAAG,MAAM,GAK1B,CAAG,AAJA,SAAS,OAAO,GAAG,KAAK,GAI3B,CAAG,AAHA,SAAS,QAAQ,GAAG,MAAM,GAG7B,CAAG,AAFA,SAAS,WAAW,GAAG,OAAO,cAAc,EAAE,SAAS,GAE1D,CAAG,AADA,SAAS,cAAc,GAAG,OAAO,cAAc,EAAE,YAAY,GAChE,CAAG,SAAS,SAAS,GAAG,OAAO,GAC/B,KAAO;4BAMyC,CAAC,kCAArC;IAAE,IAAI,EAA8B,CAAC,AAA5B,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;CAAE;;;;4BAS0C,CAAC,8EAFnF;IACZ,eAAmB,EAAE,OAAO,qCAAqC,EAAE,QAAQ,CAAC,uCAAgC,OA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,CAAC;;;;;6CAOzB,IAAI,CAAC,UAAU,CAAC,mBAChB,QAAQ,qBACR,QAAQ,KACN,OAAO,CAAC,IAAI,CAAC;gEAKb,GAAG,OAAO,GAAG,YAAY,GAAG,KAAK,IAAI,CAAC;IAAC,YAAY,EAAE,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAAC,WAAW,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAA;CAAC,CAAC;yBAIrH,uCAAgC,OAAO,CAAC;;;;;;2CAaQ,CAAC;cAFhD,OAAO,qCAAqC,EAAE,QAAQ,CAAC,UAAU,CAAC;gBAClE,UAAU;kBACV,oBAAoB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;iBACnD,cAAc;;;;;+BAYK,EAAE;;;;gBAJrB,UAAU;;;;kBACV,SAAS,CAGU,EAAE,AAHT,CAAC;;;;;;;;wBAEb,UAAU;iBACV,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;cACtC,QAAQ;cACR,QAAQ;;+BA9tBgB,kBAAkB;+BAwB3B,gBAAgB;8BAxBP,kBAAkB;2CAChB,qCAAqC;6BAFnD,WAAW"}
|
package/src/types.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @import {Guarded} from '@endo/exo';
|
|
5
|
+
* @import {Passable, Container} from '@endo/pass-style';
|
|
6
|
+
* @import {ContractStartFunction} from '@agoric/zoe/src/zoeService/utils.js';
|
|
7
|
+
*/
|
|
8
|
+
|
|
2
9
|
/**
|
|
3
10
|
* @typedef { 'unranked' | 'order' | 'plurality' } ChoiceMethod
|
|
4
11
|
* * UNRANKED: "unranked voting" means that the voter specifies some number of
|
|
@@ -19,7 +26,7 @@ export {};
|
|
|
19
26
|
* issue, while the others have a issue presented as a string.
|
|
20
27
|
*/
|
|
21
28
|
|
|
22
|
-
/** @
|
|
29
|
+
/** @import {ParamType} from './constants.js' */
|
|
23
30
|
|
|
24
31
|
/**
|
|
25
32
|
* @typedef { 'majority' | 'all' | 'no_quorum' } QuorumRule
|
|
@@ -31,9 +38,9 @@ export {};
|
|
|
31
38
|
*/
|
|
32
39
|
|
|
33
40
|
/**
|
|
34
|
-
* @typedef { Amount | Brand | Installation | Instance | bigint |
|
|
35
|
-
* Ratio | string | import('@agoric/time
|
|
36
|
-
* import('@agoric/time
|
|
41
|
+
* @typedef { Amount | Brand | Installation | Instance | number | bigint |
|
|
42
|
+
* Ratio | string | import('@agoric/time').TimestampRecord |
|
|
43
|
+
* import('@agoric/time').RelativeTimeRecord | Container<any, any> } ParamValue
|
|
37
44
|
*/
|
|
38
45
|
|
|
39
46
|
// XXX better to use the manifest constant ParamTypes
|
|
@@ -58,7 +65,7 @@ export {};
|
|
|
58
65
|
|
|
59
66
|
/**
|
|
60
67
|
* @template {ParamType} [T=ParamType]
|
|
61
|
-
* @typedef {{ type: T, value: ParamValueForType<T> }} ParamValueTyped
|
|
68
|
+
* @typedef {{ type: T, value: ParamValueForType<T> }} ParamValueTyped
|
|
62
69
|
*/
|
|
63
70
|
|
|
64
71
|
/**
|
|
@@ -66,11 +73,11 @@ export {};
|
|
|
66
73
|
*
|
|
67
74
|
* @template {import('./contractGovernance/typedParamManager.js').ParamTypesMap} T Governed parameters of contract
|
|
68
75
|
* @typedef {{
|
|
69
|
-
* electionManager: import('@agoric/zoe/src/zoeService/utils.js').Instance<import('./contractGovernor.js')['
|
|
76
|
+
* electionManager: import('@agoric/zoe/src/zoeService/utils.js').Instance<import('./contractGovernor.js')['start']>,
|
|
70
77
|
* governedParams: import('./contractGovernance/typedParamManager.js').ParamRecordsFromTypes<T & {
|
|
71
78
|
* Electorate: 'invitation'
|
|
72
79
|
* }>
|
|
73
|
-
* }} GovernanceTerms
|
|
80
|
+
* }} GovernanceTerms
|
|
74
81
|
*/
|
|
75
82
|
|
|
76
83
|
/**
|
|
@@ -332,8 +339,8 @@ export {};
|
|
|
332
339
|
|
|
333
340
|
/**
|
|
334
341
|
* @typedef {object} ClosingRule
|
|
335
|
-
* @property {ERef<
|
|
336
|
-
* @property {import('@agoric/time
|
|
342
|
+
* @property {ERef<import('@agoric/time').TimerService>} timer
|
|
343
|
+
* @property {import('@agoric/time').Timestamp} deadline
|
|
337
344
|
*/
|
|
338
345
|
|
|
339
346
|
/**
|
|
@@ -347,7 +354,7 @@ export {};
|
|
|
347
354
|
* @property {VoteCounterPublicFacet} publicFacet
|
|
348
355
|
* @property {VoteCounterCreatorFacet} creatorFacet
|
|
349
356
|
* @property {import('@agoric/zoe/src/zoeService/utils.js').Instance<typeof import('./binaryVoteCounter.js').start>} instance
|
|
350
|
-
* @property {import('@agoric/time
|
|
357
|
+
* @property {import('@agoric/time').Timestamp} deadline
|
|
351
358
|
* @property {Handle<'Question'>} questionHandle
|
|
352
359
|
*/
|
|
353
360
|
|
|
@@ -427,12 +434,12 @@ export {};
|
|
|
427
434
|
* @property {(name: string) => Brand} getBrand
|
|
428
435
|
* @property {(name: string) => Instance} getInstance
|
|
429
436
|
* @property {(name: string) => Installation} getInstallation
|
|
430
|
-
* @property {(name: string) =>
|
|
437
|
+
* @property {(name: string) => InvitationAmount} getInvitationAmount
|
|
431
438
|
* @property {(name: string) => bigint} getNat
|
|
432
439
|
* @property {(name: string) => Ratio} getRatio
|
|
433
440
|
* @property {(name: string) => string} getString
|
|
434
|
-
* @property {(name: string) => import('@agoric/time
|
|
435
|
-
* @property {(name: string) => import('@agoric/time
|
|
441
|
+
* @property {(name: string) => import('@agoric/time').TimestampRecord} getTimestamp
|
|
442
|
+
* @property {(name: string) => import('@agoric/time').RelativeTimeRecord} getRelativeTime
|
|
436
443
|
* @property {(name: string) => any} getUnknown
|
|
437
444
|
* @property {(name: string, proposedValue: ParamValue) => ParamValue} getVisibleValue - for
|
|
438
445
|
* most types, the visible value is the same as proposedValue. For Invitations
|
|
@@ -481,7 +488,7 @@ export {};
|
|
|
481
488
|
|
|
482
489
|
/**
|
|
483
490
|
* @typedef {object} ChangeParamsPosition
|
|
484
|
-
* @property {Record<string,ParamValue>} changes one or more changes to parameters
|
|
491
|
+
* @property {Record<string, ParamValue>} changes one or more changes to parameters
|
|
485
492
|
*/
|
|
486
493
|
|
|
487
494
|
/**
|
|
@@ -497,7 +504,7 @@ export {};
|
|
|
497
504
|
/**
|
|
498
505
|
* @typedef {object} InvokeApiPosition
|
|
499
506
|
* @property {string} apiMethodName
|
|
500
|
-
* @property {
|
|
507
|
+
* @property {Passable[]} methodArgs
|
|
501
508
|
*/
|
|
502
509
|
|
|
503
510
|
/**
|
|
@@ -614,26 +621,26 @@ export {};
|
|
|
614
621
|
*
|
|
615
622
|
* @callback VoteOnParamChanges
|
|
616
623
|
* @param {Installation} voteCounterInstallation
|
|
617
|
-
* @param {import('@agoric/time
|
|
624
|
+
* @param {import('@agoric/time').Timestamp} deadline
|
|
618
625
|
* @param {ParamChangesSpec<P>} paramSpec
|
|
619
|
-
* @returns {ContractGovernanceVoteResult}
|
|
626
|
+
* @returns {Promise<ContractGovernanceVoteResult>}
|
|
620
627
|
*/
|
|
621
628
|
|
|
622
629
|
/**
|
|
623
630
|
* @callback VoteOnApiInvocation
|
|
624
631
|
* @param {string} apiMethodName
|
|
625
|
-
* @param {
|
|
632
|
+
* @param {Passable[]} methodArgs
|
|
626
633
|
* @param {Installation} voteCounterInstallation
|
|
627
|
-
* @param {import('@agoric/time
|
|
634
|
+
* @param {import('@agoric/time').Timestamp} deadline
|
|
628
635
|
* @returns {Promise<ContractGovernanceVoteResult>}
|
|
629
636
|
*/
|
|
630
637
|
|
|
631
638
|
/**
|
|
632
639
|
* @callback VoteOnOfferFilter
|
|
633
640
|
* @param {Installation} voteCounterInstallation
|
|
634
|
-
* @param {import('@agoric/time
|
|
641
|
+
* @param {import('@agoric/time').Timestamp} deadline
|
|
635
642
|
* @param {string[]} strings
|
|
636
|
-
* @returns {ContractGovernanceVoteResult}
|
|
643
|
+
* @returns {Promise<ContractGovernanceVoteResult>}
|
|
637
644
|
*/
|
|
638
645
|
|
|
639
646
|
/**
|
|
@@ -670,7 +677,7 @@ export {};
|
|
|
670
677
|
|
|
671
678
|
/**
|
|
672
679
|
* @typedef {object} GovernedContractTerms
|
|
673
|
-
* @property {import('@agoric/time
|
|
680
|
+
* @property {import('@agoric/time').TimerService} timer
|
|
674
681
|
* @property {IssuerKeywordRecord} issuerKeywordRecord
|
|
675
682
|
* @property {object} privateArgs
|
|
676
683
|
*/
|
|
@@ -681,7 +688,7 @@ export {};
|
|
|
681
688
|
* @param {ERef<ZoeService>} zoe
|
|
682
689
|
* @param {import('@agoric/zoe/src/zoeService/utils.js').Instance<(zcf: ZCF<GovernanceTerms<{}>>) => {}>} allegedGoverned
|
|
683
690
|
* @param {Instance} allegedGovernor
|
|
684
|
-
* @param {Installation<import('@agoric/governance/src/contractGovernor.js').
|
|
691
|
+
* @param {Installation<import('@agoric/governance/src/contractGovernor.js').start>} contractGovernorInstallation
|
|
685
692
|
* @returns {Promise<GovernancePair>}
|
|
686
693
|
*/
|
|
687
694
|
|
|
@@ -692,15 +699,16 @@ export {};
|
|
|
692
699
|
* @param {ERef<ZoeService>} zoe
|
|
693
700
|
* @param {Instance} allegedGovernor
|
|
694
701
|
* @param {Instance} allegedElectorate
|
|
702
|
+
* @returns {Promise<true>}
|
|
695
703
|
*/
|
|
696
704
|
|
|
697
705
|
/**
|
|
698
|
-
* @typedef {
|
|
706
|
+
* @typedef {ContractStartFunction
|
|
699
707
|
* & ((zcf?: any, pa?: any, baggage?: any) => ERef<{creatorFacet: GovernedCreatorFacet<{}>, publicFacet: GovernedPublicFacet<{}>}>)} GovernableStartFn
|
|
700
708
|
*/
|
|
701
709
|
|
|
702
710
|
/**
|
|
703
|
-
* @typedef {import('./contractGovernor.js')['
|
|
711
|
+
* @typedef {import('./contractGovernor.js')['start']} GovernorSF
|
|
704
712
|
*/
|
|
705
713
|
|
|
706
714
|
// TODO find a way to parameterize the startInstance so the governed contract types flow
|
|
@@ -724,7 +732,7 @@ export {};
|
|
|
724
732
|
* Akin to StartedInstanceKit but designed for the results of starting governed contracts. Used in bootstrap space.
|
|
725
733
|
* @property {AdminFacet} adminFacet of the governed contract
|
|
726
734
|
* @property {LimitedCF<SF>} creatorFacet creator-like facet within the governed contract (without the powers the governor needs)
|
|
727
|
-
* @property {GovernorCreatorFacet<SF
|
|
735
|
+
* @property {Guarded<GovernorCreatorFacet<SF>>} governorCreatorFacet of the governing contract
|
|
728
736
|
* @property {AdminFacet} governorAdminFacet of the governing contract
|
|
729
737
|
* @property {Awaited<ReturnType<SF>>['publicFacet']} publicFacet
|
|
730
738
|
* @property {Instance} instance
|
package/src/validators.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, AssertContractGovernance, AssertContractElectorate} from './types.js';
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* Assert that the governed contract was started by the governor. Throws if
|
|
3
6
|
* either direction can't be established. If the call succeeds, then the
|
|
@@ -13,4 +16,6 @@ export const assertContractGovernance: AssertContractGovernance;
|
|
|
13
16
|
* @type {AssertContractElectorate}
|
|
14
17
|
*/
|
|
15
18
|
export const assertContractElectorate: AssertContractElectorate;
|
|
19
|
+
import type { AssertContractGovernance } from './types.js';
|
|
20
|
+
import type { AssertContractElectorate } from './types.js';
|
|
16
21
|
//# sourceMappingURL=validators.d.ts.map
|
package/src/validators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["validators.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["validators.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;GAOG;AACH,gEAgCE;AAEF;;;;GAIG;AACH,gEAWE;8CA7DiL,YAAY;8CAAZ,YAAY"}
|
package/src/validators.js
CHANGED
|
@@ -2,6 +2,10 @@ import { E } from '@endo/eventual-send';
|
|
|
2
2
|
|
|
3
3
|
const { Fail, quote: q } = assert;
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, AssertContractGovernance, AssertContractElectorate} from './types.js';
|
|
7
|
+
*/
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* Assert that the governed contract was started by the governor. Throws if
|
|
7
11
|
* either direction can't be established. If the call succeeds, then the
|
|
@@ -33,9 +37,8 @@ const assertContractGovernance = async (
|
|
|
33
37
|
'The alleged governed did not match the governed contract retrieved from the governor',
|
|
34
38
|
);
|
|
35
39
|
|
|
36
|
-
const governorInstallationFromGoverned =
|
|
37
|
-
zoe
|
|
38
|
-
).getInstallationForInstance(realGovernorInstance);
|
|
40
|
+
const governorInstallationFromGoverned =
|
|
41
|
+
await E(zoe).getInstallationForInstance(realGovernorInstance);
|
|
39
42
|
|
|
40
43
|
assert(
|
|
41
44
|
governorInstallationFromGoverned === contractGovernorInstallation,
|
package/src/voterKit.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
export function prepareVoterKit(baggage:
|
|
1
|
+
export function prepareVoterKit(baggage: import("@agoric/vat-data").Baggage, { submitVote, zcf }: {
|
|
2
2
|
zcf: ZCF;
|
|
3
|
-
submitVote: (questionHandle: Handle<
|
|
4
|
-
}): (id?: any) => {
|
|
3
|
+
submitVote: (questionHandle: Handle<"Question">, voterHandle: Handle<"Voter">, chosenPositions: Position[], weight: bigint) => globalThis.ERef<CompletedBallet>;
|
|
4
|
+
}): (id?: any) => import("@endo/exo").GuardedKit<{
|
|
5
5
|
voter: {
|
|
6
6
|
castBallotFor(questionHandle: any, positions: any, weight?: bigint): Promise<CompletedBallet>;
|
|
7
7
|
};
|
|
8
8
|
invitationMakers: {
|
|
9
|
-
makeVoteInvitation(positions: any, questionHandle: any): Promise<Invitation<CompletedBallet,
|
|
10
|
-
};
|
|
11
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
12
|
-
voter: {
|
|
13
|
-
castBallotFor(questionHandle: any, positions: any, weight?: bigint): Promise<CompletedBallet>;
|
|
14
|
-
};
|
|
15
|
-
invitationMakers: {
|
|
16
|
-
makeVoteInvitation(positions: any, questionHandle: any): Promise<Invitation<CompletedBallet, never>>;
|
|
9
|
+
makeVoteInvitation(positions: any, questionHandle: any): Promise<Invitation<CompletedBallet, undefined>>;
|
|
17
10
|
};
|
|
18
11
|
}>;
|
|
12
|
+
import type { Position } from './types.js';
|
|
13
|
+
import type { CompletedBallet } from './types.js';
|
|
19
14
|
//# sourceMappingURL=voterKit.d.ts.map
|
package/src/voterKit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voterKit.d.ts","sourceRoot":"","sources":["voterKit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"voterKit.d.ts","sourceRoot":"","sources":["voterKit.js"],"names":[],"mappings":"AA8BO,yCALI,OAAO,kBAAkB,EAAE,OAAO;SAElC,GAAG;iCACc,MAAM,CAAC,UAAU,CAAC,eAAe,MAAM,CAAC,OAAO,CAAC,uCAAuC,MAAM;;;;;;;;GAiCxH;8BAvDyJ,YAAY;qCAAZ,YAAY"}
|
package/src/voterKit.js
CHANGED
|
@@ -3,6 +3,10 @@ import { defineDurableHandle } from '@agoric/zoe/src/makeHandle.js';
|
|
|
3
3
|
import { E } from '@endo/eventual-send';
|
|
4
4
|
import { PositionShape, QuestionHandleShape } from './typeGuards.js';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, CompletedBallet, Position} from './types.js';
|
|
8
|
+
*/
|
|
9
|
+
|
|
6
10
|
const VoterI = M.interface('voter', {
|
|
7
11
|
castBallotFor: M.call(QuestionHandleShape, M.arrayOf(PositionShape)).returns(
|
|
8
12
|
M.promise(),
|