@agoric/governance 0.10.4-dev-5dc325b.0 → 0.10.4-getting-started-dev-d127d1d.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/CHANGELOG.md +448 -0
- package/package.json +26 -32
- package/src/binaryVoteCounter.d.ts +16 -0
- package/src/binaryVoteCounter.d.ts.map +1 -0
- package/src/binaryVoteCounter.js +0 -1
- package/src/breakTie.d.ts +2 -0
- package/src/breakTie.d.ts.map +1 -0
- package/src/closingRule.d.ts +3 -0
- package/src/closingRule.d.ts.map +1 -0
- package/src/committee.d.ts +23 -0
- package/src/committee.d.ts.map +1 -0
- package/src/committee.js +11 -20
- package/src/constants.d.ts +16 -0
- package/src/constants.d.ts.map +1 -0
- package/src/contractGovernance/assertions.d.ts +7 -0
- package/src/contractGovernance/assertions.d.ts.map +1 -0
- package/src/contractGovernance/governApi.d.ts +30 -0
- package/src/contractGovernance/governApi.d.ts.map +1 -0
- package/src/contractGovernance/governFilter.d.ts +25 -0
- package/src/contractGovernance/governFilter.d.ts.map +1 -0
- package/src/contractGovernance/governParam.d.ts +33 -0
- package/src/contractGovernance/governParam.d.ts.map +1 -0
- package/src/contractGovernance/paramManager.d.ts +45 -0
- package/src/contractGovernance/paramManager.d.ts.map +1 -0
- package/src/contractGovernance/paramManager.js +2 -3
- package/src/contractGovernance/typedParamManager.d.ts +29 -0
- package/src/contractGovernance/typedParamManager.d.ts.map +1 -0
- package/src/contractGovernor.d.ts +23 -0
- package/src/contractGovernor.d.ts.map +1 -0
- package/src/contractGovernor.js +4 -10
- package/src/contractGovernorKit.d.ts +80 -0
- package/src/contractGovernorKit.d.ts.map +1 -0
- package/src/contractGovernorKit.js +3 -3
- package/src/contractHelper.d.ts +136 -0
- package/src/contractHelper.d.ts.map +1 -0
- package/src/contractHelper.js +3 -3
- package/src/electorateTools.d.ts +46 -0
- package/src/electorateTools.d.ts.map +1 -0
- package/src/electorateTools.js +11 -15
- package/src/index.d.ts +9 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +5 -4
- package/src/multiCandidateVoteCounter.d.ts +16 -0
- package/src/multiCandidateVoteCounter.d.ts.map +1 -0
- package/src/multiCandidateVoteCounter.js +2 -3
- package/src/noActionElectorate.d.ts +8 -0
- package/src/noActionElectorate.d.ts.map +1 -0
- package/src/noActionElectorate.js +2 -7
- package/src/question.d.ts +27 -0
- package/src/question.d.ts.map +1 -0
- package/src/quorumCounter.d.ts +6 -0
- package/src/quorumCounter.d.ts.map +1 -0
- package/src/typeGuards.d.ts +173 -0
- package/src/typeGuards.d.ts.map +1 -0
- package/src/types-ambient.d.ts +1047 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/types-ambient.js +5 -5
- package/src/types.d.ts +561 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.js +5 -5
- package/src/validators.d.ts +16 -0
- package/src/validators.d.ts.map +1 -0
- package/src/validators.js +3 -2
- package/src/voterKit.d.ts +19 -0
- package/src/voterKit.d.ts.map +1 -0
- package/tools/puppetContractGovernor.d.ts +51 -0
- package/tools/puppetContractGovernor.d.ts.map +1 -0
- package/tools/puppetGovernance.d.ts +101 -0
- package/tools/puppetGovernance.d.ts.map +1 -0
- package/tools/puppetGovernance.js +2 -0
- package/tools/storageDoc.d.ts +10 -0
- package/tools/storageDoc.d.ts.map +1 -0
package/src/committee.js
CHANGED
|
@@ -5,7 +5,6 @@ import { E } from '@endo/eventual-send';
|
|
|
5
5
|
|
|
6
6
|
import { StorageNodeShape } from '@agoric/internal';
|
|
7
7
|
import { prepareExo, provideDurableMapStore } from '@agoric/vat-data';
|
|
8
|
-
import { EmptyProposalShape } from '@agoric/zoe/src/typeGuards.js';
|
|
9
8
|
import {
|
|
10
9
|
getOpenQuestions,
|
|
11
10
|
getPoserInvitation,
|
|
@@ -24,15 +23,11 @@ const { ceilDivide } = natSafeMath;
|
|
|
24
23
|
* }} CommitteeElectorateCreatorFacet
|
|
25
24
|
*/
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
storageNode: StorageNodeShape,
|
|
31
|
-
marshaller: M.remotable('Marshaller'),
|
|
32
|
-
},
|
|
33
|
-
upgradability: 'canUpgrade',
|
|
26
|
+
export const privateArgsShape = {
|
|
27
|
+
storageNode: StorageNodeShape,
|
|
28
|
+
marshaller: M.remotable('Marshaller'),
|
|
34
29
|
};
|
|
35
|
-
harden(
|
|
30
|
+
harden(privateArgsShape);
|
|
36
31
|
|
|
37
32
|
/**
|
|
38
33
|
* Each Committee (an Electorate) represents a particular set of voters. The
|
|
@@ -51,7 +46,7 @@ harden(meta);
|
|
|
51
46
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
52
47
|
* @returns {{creatorFacet: CommitteeElectorateCreatorFacet, publicFacet: CommitteeElectoratePublic}}
|
|
53
48
|
*/
|
|
54
|
-
export const
|
|
49
|
+
export const prepare = (zcf, privateArgs, baggage) => {
|
|
55
50
|
/** @type {MapStore<Handle<'Question'>, import('./electorateTools.js').QuestionRecord>} */
|
|
56
51
|
const allQuestions = provideDurableMapStore(baggage, 'Question');
|
|
57
52
|
|
|
@@ -80,15 +75,10 @@ export const start = (zcf, privateArgs, baggage) => {
|
|
|
80
75
|
// This will produce unique descriptions because
|
|
81
76
|
// makeCommitteeVoterInvitation() is only called within the following loop,
|
|
82
77
|
// which is only called once per Electorate.
|
|
83
|
-
return zcf.makeInvitation(
|
|
84
|
-
seat
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
`Voter${index}`,
|
|
89
|
-
undefined,
|
|
90
|
-
EmptyProposalShape,
|
|
91
|
-
);
|
|
78
|
+
return zcf.makeInvitation(seat => {
|
|
79
|
+
seat.exit();
|
|
80
|
+
return makeVoterKit(index);
|
|
81
|
+
}, `Voter${index}`);
|
|
92
82
|
};
|
|
93
83
|
|
|
94
84
|
const { committeeName, committeeSize } = zcf.getTerms();
|
|
@@ -180,4 +170,5 @@ export const start = (zcf, privateArgs, baggage) => {
|
|
|
180
170
|
|
|
181
171
|
return { publicFacet, creatorFacet };
|
|
182
172
|
};
|
|
183
|
-
|
|
173
|
+
|
|
174
|
+
harden(prepare);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export namespace ParamTypes {
|
|
2
|
+
const AMOUNT: "amount";
|
|
3
|
+
const BRAND: "brand";
|
|
4
|
+
const INSTALLATION: "installation";
|
|
5
|
+
const INSTANCE: "instance";
|
|
6
|
+
const INVITATION: "invitation";
|
|
7
|
+
const NAT: "nat";
|
|
8
|
+
const RATIO: "ratio";
|
|
9
|
+
const STRING: "string";
|
|
10
|
+
const PASSABLE_RECORD: "record";
|
|
11
|
+
const TIMESTAMP: "timestamp";
|
|
12
|
+
const RELATIVE_TIME: "relativeTime";
|
|
13
|
+
const UNKNOWN: "unknown";
|
|
14
|
+
}
|
|
15
|
+
export type ParamType = (typeof ParamTypes)[keyof typeof ParamTypes];
|
|
16
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":";;;;;;;;;;;;;;wBAuBc,CAAA,iBAAiB,EAAC,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function makeLooksLikeBrand(name: any): (brand: Brand) => void;
|
|
2
|
+
export function makeAssertInstallation(name: any): (installation: any) => void;
|
|
3
|
+
export function makeAssertInstance(name: any): (instance: any) => void;
|
|
4
|
+
export function makeAssertBrandedRatio(name: any, modelRatio: any): (ratio: any) => boolean;
|
|
5
|
+
export function assertRelativeTime(value: any): void;
|
|
6
|
+
export function assertTimestamp(value: any): void;
|
|
7
|
+
//# sourceMappingURL=assertions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["assertions.js"],"names":[],"mappings":"AAOA,uDACc,KAAK,UAIlB;AAGD,+EAMC;AAGD,uEAMC;AAGD,4FASC;AAGD,qDAEC;AAGD,kDAEC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* manage contracts that allow governance to invoke functions.
|
|
3
|
+
*
|
|
4
|
+
* @param {ERef<{ [methodName: string]: (...args: any) => unknown }>} governedApis
|
|
5
|
+
* @param {Array<string | symbol>} governedNames names of the governed API methods
|
|
6
|
+
* @param {ERef<import('@agoric/time/src/types').TimerService>} timer
|
|
7
|
+
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
8
|
+
* @returns {ApiGovernor}
|
|
9
|
+
*/
|
|
10
|
+
export function setupApiGovernance(governedApis: ERef<{
|
|
11
|
+
[methodName: string]: (...args: any) => unknown;
|
|
12
|
+
}>, governedNames: Array<string | symbol>, timer: ERef<import('@agoric/time/src/types').TimerService>, getUpdatedPoserFacet: () => Promise<PoserFacet>): ApiGovernor;
|
|
13
|
+
/**
|
|
14
|
+
* Make a pair of positions for a question about whether to invoke an API. If
|
|
15
|
+
* the vote passes, the method will be called on the governedApis facet with the
|
|
16
|
+
* arguments that were provided.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} apiMethodName
|
|
19
|
+
* @param {unknown[]} methodArgs
|
|
20
|
+
*/
|
|
21
|
+
export function makeApiInvocationPositions(apiMethodName: string, methodArgs: unknown[]): {
|
|
22
|
+
positive: {
|
|
23
|
+
apiMethodName: string;
|
|
24
|
+
methodArgs: unknown[];
|
|
25
|
+
};
|
|
26
|
+
negative: {
|
|
27
|
+
dontInvoke: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=governApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governApi.d.ts","sourceRoot":"","sources":["governApi.js"],"names":[],"mappings":"AA2BA;;;;;;;;GAQG;AACH;oCANkD,GAAG,KAAK,OAAO;mBACtD,MAAM,MAAM,GAAG,MAAM,CAAC,SACtB,KAAK,OAAO,wBAAwB,EAAE,YAAY,CAAC,wBACnD,MAAM,QAAQ,UAAU,CAAC,GACvB,WAAW,CAwFvB;AA7GD;;;;;;;GAOG;AACH,0DAHW,MAAM,cACN,OAAO,EAAE;;;;;;;;EAMnB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup to allow governance to block some invitations.
|
|
3
|
+
*
|
|
4
|
+
* @param {ERef<import('@agoric/time/src/types').TimerService>} timer
|
|
5
|
+
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
6
|
+
* @param {GovernedCreatorFacet<{}>} governedCF
|
|
7
|
+
* @returns {FilterGovernor}
|
|
8
|
+
*/
|
|
9
|
+
export function setupFilterGovernance(timer: ERef<import('@agoric/time/src/types').TimerService>, getUpdatedPoserFacet: () => Promise<PoserFacet>, governedCF: GovernedCreatorFacet<{}>): FilterGovernor;
|
|
10
|
+
/**
|
|
11
|
+
* Make a pair of positions for a question about whether to update the offer
|
|
12
|
+
* filter. If the vote passes, the list of blocked invitation strings will be
|
|
13
|
+
* updated.
|
|
14
|
+
*
|
|
15
|
+
* @param {string[]} strings
|
|
16
|
+
*/
|
|
17
|
+
export function makeOfferFilterPositions(strings: string[]): {
|
|
18
|
+
positive: {
|
|
19
|
+
strings: string[];
|
|
20
|
+
};
|
|
21
|
+
negative: {
|
|
22
|
+
dontUpdate: string[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=governFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governFilter.d.ts","sourceRoot":"","sources":["governFilter.js"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,6CALW,KAAK,OAAO,wBAAwB,EAAE,YAAY,CAAC,wBACnD,MAAM,QAAQ,UAAU,CAAC,cACzB,qBAAqB,EAAE,CAAC,GACtB,cAAc,CAqE1B;AAxFD;;;;;;GAMG;AACH,kDAFW,MAAM,EAAE;;;;;;;EAMlB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {ERef<ParamManagerRetriever>} paramManagerRetriever
|
|
3
|
+
* @param {Instance} contractInstance
|
|
4
|
+
* @param {import('@agoric/time/src/types').TimerService} timer
|
|
5
|
+
* @param {() => Promise<PoserFacet>} getUpdatedPoserFacet
|
|
6
|
+
* @returns {ParamGovernor}
|
|
7
|
+
*/
|
|
8
|
+
export function setupParamGovernance(paramManagerRetriever: ERef<ParamManagerRetriever>, contractInstance: Instance, timer: import('@agoric/time/src/types').TimerService, getUpdatedPoserFacet: () => Promise<PoserFacet>): ParamGovernor;
|
|
9
|
+
/**
|
|
10
|
+
* Return a record containing the positive and negative positions for a
|
|
11
|
+
* question on changing the param to the proposedValue.
|
|
12
|
+
*
|
|
13
|
+
* @param {Record<string, ParamValue>} changes
|
|
14
|
+
* @returns {ParamChangePositions}
|
|
15
|
+
*/
|
|
16
|
+
export function makeParamChangePositions(changes: Record<string, ParamValue>): ParamChangePositions;
|
|
17
|
+
/**
|
|
18
|
+
* assert that the parameter described by paramSpec is proposed to be changed in
|
|
19
|
+
* the question described by questionSpec.
|
|
20
|
+
*
|
|
21
|
+
* @param {{ parameterName: string, paramPath: unknown}} paramSpec
|
|
22
|
+
* @param {QuestionSpec<ParamChangeIssue<unknown>>} questionSpec
|
|
23
|
+
*/
|
|
24
|
+
export function assertBallotConcernsParam(paramSpec: {
|
|
25
|
+
parameterName: string;
|
|
26
|
+
paramPath: unknown;
|
|
27
|
+
}, questionSpec: QuestionSpec<ParamChangeIssue<unknown>>): void;
|
|
28
|
+
/**
|
|
29
|
+
* The electorate that governs changes to the contract's parameters. It must be
|
|
30
|
+
* declared in the governed contract.
|
|
31
|
+
*/
|
|
32
|
+
export const CONTRACT_ELECTORATE: "Electorate";
|
|
33
|
+
//# sourceMappingURL=governParam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governParam.d.ts","sourceRoot":"","sources":["governParam.js"],"names":[],"mappings":"AAqDA;;;;;;GAMG;AACH,4DANW,KAAK,qBAAqB,CAAC,oBAC3B,QAAQ,SACR,OAAO,wBAAwB,EAAE,YAAY,wBAC7C,MAAM,QAAQ,UAAU,CAAC,GACvB,aAAa,CAwFzB;AA9HD;;;;;;GAMG;AACH,kDAHW,OAAO,MAAM,EAAE,UAAU,CAAC,GACxB,oBAAoB,CAQhC;AAED;;;;;;GAMG;AACH;mBAH4B,MAAM;eAAa,OAAO;iBAC3C,aAAa,iBAAiB,OAAO,CAAC,CAAC,QAWjD;AArCD;;;GAGG;AACH,+CAAyC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type ParamManagerBuilder = {
|
|
2
|
+
addAmount: (name: string, value: Amount) => ParamManagerBuilder;
|
|
3
|
+
addBrand: (name: string, value: Brand) => ParamManagerBuilder;
|
|
4
|
+
addInstallation: (name: string, value: Installation) => ParamManagerBuilder;
|
|
5
|
+
addInstance: (name: string, value: Instance) => ParamManagerBuilder;
|
|
6
|
+
addInvitation: (name: string, value: Invitation) => ParamManagerBuilder;
|
|
7
|
+
addNat: (name: string, value: bigint) => ParamManagerBuilder;
|
|
8
|
+
addRatio: (name: string, value: Ratio) => ParamManagerBuilder;
|
|
9
|
+
addRecord: (name: string, value: import('@endo/marshal').CopyRecord<unknown>) => ParamManagerBuilder;
|
|
10
|
+
addString: (name: string, value: string) => ParamManagerBuilder;
|
|
11
|
+
addTimestamp: (name: string, value: import('@agoric/time/src/types').Timestamp) => ParamManagerBuilder;
|
|
12
|
+
addRelativeTime: (name: string, value: import('@agoric/time/src/types').RelativeTime) => ParamManagerBuilder;
|
|
13
|
+
addUnknown: (name: string, value: any) => ParamManagerBuilder;
|
|
14
|
+
build: () => AnyParamManager;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @param {ParamManagerBase} paramManager
|
|
18
|
+
* @param {{[CONTRACT_ELECTORATE]: ParamValueTyped<'invitation'>}} governedParams
|
|
19
|
+
*/
|
|
20
|
+
export function assertElectorateMatches(paramManager: ParamManagerBase, governedParams: {
|
|
21
|
+
[CONTRACT_ELECTORATE]: ParamValueTyped<'invitation'>;
|
|
22
|
+
}): void;
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {object} ParamManagerBuilder
|
|
25
|
+
* @property {(name: string, value: Amount) => ParamManagerBuilder} addAmount
|
|
26
|
+
* @property {(name: string, value: Brand) => ParamManagerBuilder} addBrand
|
|
27
|
+
* @property {(name: string, value: Installation) => ParamManagerBuilder} addInstallation
|
|
28
|
+
* @property {(name: string, value: Instance) => ParamManagerBuilder} addInstance
|
|
29
|
+
* @property {(name: string, value: Invitation) => ParamManagerBuilder} addInvitation
|
|
30
|
+
* @property {(name: string, value: bigint) => ParamManagerBuilder} addNat
|
|
31
|
+
* @property {(name: string, value: Ratio) => ParamManagerBuilder} addRatio
|
|
32
|
+
* @property {(name: string, value: import('@endo/marshal').CopyRecord<unknown>) => ParamManagerBuilder} addRecord
|
|
33
|
+
* @property {(name: string, value: string) => ParamManagerBuilder} addString
|
|
34
|
+
* @property {(name: string, value: import('@agoric/time/src/types').Timestamp) => ParamManagerBuilder} addTimestamp
|
|
35
|
+
* @property {(name: string, value: import('@agoric/time/src/types').RelativeTime) => ParamManagerBuilder} addRelativeTime
|
|
36
|
+
* @property {(name: string, value: any) => ParamManagerBuilder} addUnknown
|
|
37
|
+
* @property {() => AnyParamManager} build
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @param {import('@agoric/notifier').StoredPublisherKit<GovernanceSubscriptionState>} publisherKit
|
|
41
|
+
* @param {ERef<ZoeService>} [zoe]
|
|
42
|
+
*/
|
|
43
|
+
export function makeParamManagerBuilder(publisherKit: import('@agoric/notifier').StoredPublisherKit<GovernanceSubscriptionState>, zoe?: ERef<ZoeService> | undefined): ParamManagerBuilder;
|
|
44
|
+
import { CONTRACT_ELECTORATE } from "./governParam.js";
|
|
45
|
+
//# sourceMappingURL=paramManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paramManager.d.ts","sourceRoot":"","sources":["paramManager.js"],"names":[],"mappings":";sBAuCqB,MAAM,SAAS,MAAM,KAAK,mBAAmB;qBAC7C,MAAM,SAAS,KAAK,KAAK,mBAAmB;4BAC5C,MAAM,SAAS,YAAY,KAAK,mBAAmB;wBACnD,MAAM,SAAS,QAAQ,KAAK,mBAAmB;0BAC/C,MAAM,SAAS,UAAU,KAAK,mBAAmB;mBACjD,MAAM,SAAS,MAAM,KAAK,mBAAmB;qBAC7C,MAAM,SAAS,KAAK,KAAK,mBAAmB;sBAC5C,MAAM,SAAS,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,mBAAmB;sBAClF,MAAM,SAAS,MAAM,KAAK,mBAAmB;yBAC7C,MAAM,SAAS,OAAO,wBAAwB,EAAE,SAAS,KAAK,mBAAmB;4BACjF,MAAM,SAAS,OAAO,wBAAwB,EAAE,YAAY,KAAK,mBAAmB;uBACpF,MAAM,SAAS,GAAG,KAAK,mBAAmB;WACjD,MAAM,eAAe;;AA9BnC;;;GAGG;AACH,sDAHW,gBAAgB,kBAChB;IAAC,qBAAqB,EAAE,gBAAgB,YAAY,CAAC,CAAA;CAAC,QAYhE;AAED;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,sDAHW,OAAO,kBAAkB,EAAE,kBAAkB,CAAC,2BAA2B,CAAC,2DAmXpF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
2
1
|
import { Far, passStyleOf } from '@endo/marshal';
|
|
3
2
|
import { AmountMath } from '@agoric/ertp';
|
|
4
3
|
import { assertKeywordName } from '@agoric/zoe/src/cleanProposal.js';
|
|
@@ -367,10 +366,10 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
|
|
|
367
366
|
const prepared = await Promise.all(asyncResults);
|
|
368
367
|
|
|
369
368
|
// actually update
|
|
370
|
-
|
|
369
|
+
paramNames.forEach((name, i) => {
|
|
371
370
|
const setFn = setters[`update${name}`];
|
|
372
371
|
setFn(prepared[i]);
|
|
373
|
-
}
|
|
372
|
+
});
|
|
374
373
|
publish();
|
|
375
374
|
};
|
|
376
375
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function makeParamManager<T extends Record<string, SyncSpecTuple | AsyncSpecTuple>>(publisherKit: import('@agoric/notifier').StoredPublisherKit<GovernanceSubscriptionState>, spec: T, zcf: ZCF): TypedParamManager<{ [K in keyof T]: T[K][0]; }>;
|
|
2
|
+
export function makeParamManagerSync<T extends Record<string, SyncSpecTuple>>(publisherKit: import('@agoric/notifier').StoredPublisherKit<GovernanceSubscriptionState>, spec: T): TypedParamManager<{ [K in keyof T]: T[K][0]; }>;
|
|
3
|
+
export function makeParamManagerFromTerms<I extends Record<string, Invitation<unknown, never>> & {
|
|
4
|
+
Electorate: Invitation;
|
|
5
|
+
}, M extends ParamTypesMap>(publisherKit: import('@agoric/notifier').StoredPublisherKit<GovernanceSubscriptionState>, zcf: ZCF<GovernanceTerms<M>>, invitations: I, paramTypesMap: M): TypedParamManager<M & { [K in keyof I]: "invitation"; }>;
|
|
6
|
+
export type ParamTypesMap = Record<Keyword, ParamType>;
|
|
7
|
+
export type ParamTypesMapFromRecord<M extends ParamStateRecord> = { [R in keyof M]: M[R]["type"]; };
|
|
8
|
+
export type ParamRecordsFromTypes<M extends ParamTypesMap> = { [T in keyof M]: {
|
|
9
|
+
type: M[T];
|
|
10
|
+
value: ParamValueForType<M[T]>;
|
|
11
|
+
}; };
|
|
12
|
+
export type Getters<M extends ParamTypesMap> = { [K in keyof M as `get${string & K}`]: () => ParamValueForType<M[K]>; };
|
|
13
|
+
export type Updaters<T extends ParamTypesMap> = { [K in keyof T as `update${string & K}`]: (value: ParamValueForType<T[K]>) => void; };
|
|
14
|
+
export type TypedParamManager<M extends ParamTypesMap> = ParamManagerBase & Getters<M> & Updaters<M> & {
|
|
15
|
+
readonly: () => Getters<M>;
|
|
16
|
+
} & {
|
|
17
|
+
updateParams: UpdateParams;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* param spec tuple
|
|
21
|
+
*/
|
|
22
|
+
export type ST<T extends import("../constants.js").ParamType> = [type: T, value: ParamValueForType<T>];
|
|
23
|
+
export type InvitationParam = {
|
|
24
|
+
type: 'invitation';
|
|
25
|
+
value: Amount<'set'>;
|
|
26
|
+
};
|
|
27
|
+
export type SyncSpecTuple = [type: "amount", value: Amount<any>] | ST<"brand"> | ST<"installation"> | ST<"instance"> | ST<"nat"> | ST<"ratio"> | ST<"string"> | ST<"timestamp"> | ST<"relativeTime"> | ST<"unknown">;
|
|
28
|
+
export type AsyncSpecTuple = ['invitation', Invitation];
|
|
29
|
+
//# sourceMappingURL=typedParamManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typedParamManager.d.ts","sourceRoot":"","sources":["typedParamManager.js"],"names":[],"mappings":"AAoFO,yGALI,OAAO,kBAAkB,EAAE,kBAAkB,CAAC,2BAA2B,CAAC,gBAE1E,GAAG,mDAwBb;AAaM,4FAJI,OAAO,kBAAkB,EAAE,kBAAkB,CAAC,2BAA2B,CAAC,4DAepF;AAYM;gBARiD,UAAU;0CAEvD,OAAO,kBAAkB,EAAE,kBAAkB,CAAC,2BAA2B,CAAC,4HAiCpF;4BAhKY,OAAO,OAAO,EAAE,SAAS,CAAC;;;;;;;+HAqB2C,IAAI;yDAMzE,gBAAgB,GAAG,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG;IAAC,QAAQ,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAA;CAAC,GAAG;IAAC,YAAY,EAAE,YAAY,CAAA;CAAC;;;;gEAgBzG,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC;8BAItC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,OAAO,KAAK,CAAC,CAAA;CAAE;4BAO5C,wLASK;6BAEL,CAAC,YAAY,EAAE,UAAU,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function validateQuestionDetails(zoe: ERef<ZoeService>, electorate: Instance, details: ParamChangeIssueDetails): Promise<[void, void, void]>;
|
|
2
|
+
export function validateQuestionFromCounter(zoe: ERef<ZoeService>, electorate: Instance, voteCounter: Instance): Promise<[void, void, void]>;
|
|
3
|
+
export function prepare<SF extends GovernableStartFn>(zcf: ZCF<{
|
|
4
|
+
timer: import('@agoric/time/src/types').TimerService;
|
|
5
|
+
governedContractInstallation: Installation<SF>;
|
|
6
|
+
governed: {
|
|
7
|
+
issuerKeywordRecord: IssuerKeywordRecord;
|
|
8
|
+
terms: {
|
|
9
|
+
governedParams: {
|
|
10
|
+
[CONTRACT_ELECTORATE]: import('./contractGovernance/typedParamManager.js').InvitationParam;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
label?: string;
|
|
14
|
+
};
|
|
15
|
+
}>, privateArgs: {
|
|
16
|
+
governed: Record<string, unknown>;
|
|
17
|
+
}, baggage: MapStore<string, unknown>): Promise<{
|
|
18
|
+
creatorFacet: GovernorCreatorFacet<SF>;
|
|
19
|
+
publicFacet: GovernorPublic;
|
|
20
|
+
}>;
|
|
21
|
+
export type ContractGovernorTerms = StandardTerms;
|
|
22
|
+
import { CONTRACT_ELECTORATE } from "./contractGovernance/governParam.js";
|
|
23
|
+
//# sourceMappingURL=contractGovernor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractGovernor.d.ts","sourceRoot":"","sources":["contractGovernor.js"],"names":[],"mappings":"AAsBO,6CAJI,KAAK,UAAU,CAAC,cAChB,QAAQ,WACR,uBAAuB,+BAkBjC;AAYM,iDAJI,KAAK,UAAU,CAAC,cAChB,QAAQ,eACR,QAAQ,+BAWlB;AA0FM;WAjBK,OAAO,wBAAwB,EAAE,YAAY;;cAE1C;QACd,mBAAyB,EAAE,mBAAmB,CAAC;QAC/C,KAAW,EAAE;YAAC,cAAc,EAAE;gBAAC,qBAAqB,EAAE,OAAO,2CAA2C,EAAE,eAAe,CAAA;aAAC,CAAA;SAAC,CAAC;QAC5H,KAAW,CAAC,EAAE,MAAM,CAAC;KAChB;iBAEK;IACV,QAAY,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;;iBAGc,cAAc;GA+D/B;oCAjJY,aAAa"}
|
package/src/contractGovernor.js
CHANGED
|
@@ -11,12 +11,6 @@ const { Fail } = assert;
|
|
|
11
11
|
|
|
12
12
|
const trace = makeTracer('CGov', false);
|
|
13
13
|
|
|
14
|
-
/** @type {ContractMeta} */
|
|
15
|
-
export const meta = {
|
|
16
|
-
upgradability: 'canUpgrade',
|
|
17
|
-
};
|
|
18
|
-
harden(meta);
|
|
19
|
-
|
|
20
14
|
/**
|
|
21
15
|
* Validate that the question details correspond to a parameter change question
|
|
22
16
|
* that the electorate hosts, and that the voteCounter and other details are
|
|
@@ -153,8 +147,8 @@ harden(validateQuestionFromCounter);
|
|
|
153
147
|
* }>}
|
|
154
148
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
155
149
|
*/
|
|
156
|
-
export const
|
|
157
|
-
trace('
|
|
150
|
+
export const prepare = async (zcf, privateArgs, baggage) => {
|
|
151
|
+
trace('prepare');
|
|
158
152
|
const zoe = zcf.getZoeService();
|
|
159
153
|
trace('getTerms', zcf.getTerms());
|
|
160
154
|
const {
|
|
@@ -208,9 +202,9 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
208
202
|
// Specifically, to the vat of the governed contract for its API names. The exo
|
|
209
203
|
// defers that until API governance is requested to be invoked or validated.
|
|
210
204
|
|
|
211
|
-
trace('
|
|
205
|
+
trace('prepare complete');
|
|
212
206
|
|
|
213
207
|
// CRUCIAL: only contractGovernor should get the ability to update params
|
|
214
208
|
return { creatorFacet: governorKit.creator, publicFacet: governorKit.public };
|
|
215
209
|
};
|
|
216
|
-
harden(
|
|
210
|
+
harden(prepare);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export function prepareContractGovernorKit(baggage: MapStore<string, unknown>, powers: {
|
|
2
|
+
timer: import('@agoric/time/src/types').TimerService;
|
|
3
|
+
zoe: ERef<ZoeService>;
|
|
4
|
+
}): (startedInstanceKit: import("@agoric/zoe/src/zoeService/utils.js").StartedInstanceKit<GovernableStartFn>, limitedCreatorFacet: any) => {
|
|
5
|
+
helper: {
|
|
6
|
+
/** @type {() => Promise<Instance>} */
|
|
7
|
+
getElectorateInstance(): Promise<Instance>;
|
|
8
|
+
/** @type {() => Promise<PoserFacet>} */
|
|
9
|
+
getUpdatedPoserFacet(): Promise<PoserFacet>;
|
|
10
|
+
provideApiGovernance(): Promise<ApiGovernor>;
|
|
11
|
+
provideFilterGovernance(): FilterGovernor;
|
|
12
|
+
provideParamGovernance(): ParamGovernor;
|
|
13
|
+
};
|
|
14
|
+
creator: {
|
|
15
|
+
/**
|
|
16
|
+
* @param {Invitation} poserInvitation
|
|
17
|
+
* @returns {Promise<void>}
|
|
18
|
+
*/
|
|
19
|
+
replaceElectorate(poserInvitation: Invitation): Promise<void>;
|
|
20
|
+
/** @type {VoteOnParamChanges} */
|
|
21
|
+
voteOnParamChanges(voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp, paramSpec: ParamChangesSpec<StandardParamPath>): ContractGovernanceVoteResult;
|
|
22
|
+
/** @type {VoteOnApiInvocation} */
|
|
23
|
+
voteOnApiInvocation(apiMethodName: string, methodArgs: unknown[], voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp): Promise<ContractGovernanceVoteResult>;
|
|
24
|
+
/** @type {VoteOnOfferFilter} */
|
|
25
|
+
voteOnOfferFilter(voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp, strings: string[]): ContractGovernanceVoteResult;
|
|
26
|
+
getCreatorFacet(): any;
|
|
27
|
+
getAdminFacet(): import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
28
|
+
getInstance(): import("@agoric/zoe/src/zoeService/utils.js").Instance<GovernableStartFn>;
|
|
29
|
+
getPublicFacet(): GovernedPublicFacetMethods;
|
|
30
|
+
};
|
|
31
|
+
public: {
|
|
32
|
+
getElectorate(): Promise<Instance>;
|
|
33
|
+
getGovernedContract(): import("@agoric/zoe/src/zoeService/utils.js").Instance<GovernableStartFn>;
|
|
34
|
+
/** @param {Instance} counter */
|
|
35
|
+
validateVoteCounter(counter: Instance): Promise<void>;
|
|
36
|
+
/** @param {Instance} regP */
|
|
37
|
+
validateElectorate(regP: Instance): Promise<void>;
|
|
38
|
+
/** @param {ClosingRule} closingRule */
|
|
39
|
+
validateTimer(closingRule: ClosingRule): void;
|
|
40
|
+
};
|
|
41
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
42
|
+
helper: {
|
|
43
|
+
/** @type {() => Promise<Instance>} */
|
|
44
|
+
getElectorateInstance(): Promise<Instance>;
|
|
45
|
+
/** @type {() => Promise<PoserFacet>} */
|
|
46
|
+
getUpdatedPoserFacet(): Promise<PoserFacet>;
|
|
47
|
+
provideApiGovernance(): Promise<ApiGovernor>;
|
|
48
|
+
provideFilterGovernance(): FilterGovernor;
|
|
49
|
+
provideParamGovernance(): ParamGovernor;
|
|
50
|
+
};
|
|
51
|
+
creator: {
|
|
52
|
+
/**
|
|
53
|
+
* @param {Invitation} poserInvitation
|
|
54
|
+
* @returns {Promise<void>}
|
|
55
|
+
*/
|
|
56
|
+
replaceElectorate(poserInvitation: Invitation): Promise<void>;
|
|
57
|
+
/** @type {VoteOnParamChanges} */
|
|
58
|
+
voteOnParamChanges(voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp, paramSpec: ParamChangesSpec<StandardParamPath>): ContractGovernanceVoteResult;
|
|
59
|
+
/** @type {VoteOnApiInvocation} */
|
|
60
|
+
voteOnApiInvocation(apiMethodName: string, methodArgs: unknown[], voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp): Promise<ContractGovernanceVoteResult>;
|
|
61
|
+
/** @type {VoteOnOfferFilter} */
|
|
62
|
+
voteOnOfferFilter(voteCounterInstallation: Installation<any>, deadline: import("@agoric/time/src/types").Timestamp, strings: string[]): ContractGovernanceVoteResult;
|
|
63
|
+
getCreatorFacet(): any;
|
|
64
|
+
getAdminFacet(): import("@agoric/zoe/src/zoeService/utils.js").AdminFacet;
|
|
65
|
+
getInstance(): import("@agoric/zoe/src/zoeService/utils.js").Instance<GovernableStartFn>;
|
|
66
|
+
getPublicFacet(): GovernedPublicFacetMethods;
|
|
67
|
+
};
|
|
68
|
+
public: {
|
|
69
|
+
getElectorate(): Promise<Instance>;
|
|
70
|
+
getGovernedContract(): import("@agoric/zoe/src/zoeService/utils.js").Instance<GovernableStartFn>;
|
|
71
|
+
/** @param {Instance} counter */
|
|
72
|
+
validateVoteCounter(counter: Instance): Promise<void>;
|
|
73
|
+
/** @param {Instance} regP */
|
|
74
|
+
validateElectorate(regP: Instance): Promise<void>;
|
|
75
|
+
/** @param {ClosingRule} closingRule */
|
|
76
|
+
validateTimer(closingRule: ClosingRule): void;
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
79
|
+
export type ContractGovernorKit = ReturnType<ReturnType<typeof prepareContractGovernorKit>>;
|
|
80
|
+
//# sourceMappingURL=contractGovernorKit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractGovernorKit.d.ts","sourceRoot":"","sources":["contractGovernorKit.js"],"names":[],"mappings":"AAqBO,uFALI;IACV,KAAS,EAAE,OAAO,wBAAwB,EAAE,YAAY,CAAC;IACzD,GAAO,EAAE,KAAK,UAAU,CAAC,CAAC;CACvB;;QAiCI,sCAAsC;iCAArB,QAAQ,QAAQ,CAAC;QAQlC,wCAAwC;gCAAvB,QAAQ,UAAU,CAAC;;;;;;QAkEpC;;;WAGG;2CAFQ,UAAU,GACR,QAAQ,IAAI,CAAC;QAgB1B,iCAAiC;;QAOjC,kCAAkC;;QAelC,gCAAgC;;;;;;;;;;QA4BhC,gCAAgC;qCAApB,QAAQ;QAepB,6BAA6B;iCAAjB,QAAQ;QAWpB,uCAAuC;mCAA3B,WAAW;;;;QAxKvB,sCAAsC;iCAArB,QAAQ,QAAQ,CAAC;QAQlC,wCAAwC;gCAAvB,QAAQ,UAAU,CAAC;;;;;;QAkEpC;;;WAGG;2CAFQ,UAAU,GACR,QAAQ,IAAI,CAAC;QAgB1B,iCAAiC;;QAOjC,kCAAkC;;QAelC,gCAAgC;;;;;;;;;;QA4BhC,gCAAgC;qCAApB,QAAQ;QAepB,6BAA6B;iCAAjB,QAAQ;QAWpB,uCAAuC;mCAA3B,WAAW;;GAY9B;kCAEa,WAAW,WAAW,iCAAiC,CAAC,CAAC"}
|
|
@@ -53,8 +53,9 @@ export const prepareContractGovernorKit = (baggage, powers) => {
|
|
|
53
53
|
/** @type {() => Promise<Instance>} */
|
|
54
54
|
async getElectorateInstance() {
|
|
55
55
|
const { publicFacet } = this.state;
|
|
56
|
-
const invitationAmount =
|
|
57
|
-
|
|
56
|
+
const invitationAmount = await E(publicFacet).getInvitationAmount(
|
|
57
|
+
CONTRACT_ELECTORATE,
|
|
58
|
+
);
|
|
58
59
|
return invitationAmount.value[0].instance;
|
|
59
60
|
},
|
|
60
61
|
/** @type {() => Promise<PoserFacet>} */
|
|
@@ -75,7 +76,6 @@ export const prepareContractGovernorKit = (baggage, powers) => {
|
|
|
75
76
|
async provideApiGovernance() {
|
|
76
77
|
const { timer } = powers;
|
|
77
78
|
const { creatorFacet } = this.state;
|
|
78
|
-
await null;
|
|
79
79
|
if (!apiGovernance) {
|
|
80
80
|
trace('awaiting governed API dependencies');
|
|
81
81
|
const [governedApis, governedNames] = await Promise.all([
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export const GOVERNANCE_STORAGE_KEY: "governance";
|
|
2
|
+
export function validateElectorate(zcf: ZCF<GovernanceTerms<{}> & {}>, paramManager: import('./contractGovernance/typedParamManager').TypedParamManager<unknown>): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Helper for the 90% of contracts that will have only a single set of
|
|
5
|
+
* parameters. Using this for managed parameters, a contract only has to
|
|
6
|
+
*
|
|
7
|
+
* - Define the parameter template, which includes name, type and value
|
|
8
|
+
* - Add any methods needed in the public and creator facets.
|
|
9
|
+
*
|
|
10
|
+
* It's also crucial that the governed contract not interact with the product of
|
|
11
|
+
* makeGovernorFacet(). The wrapped creatorFacet has the power to change
|
|
12
|
+
* parameter values, and the governance guarantees only hold if they're not used
|
|
13
|
+
* directly by the governed contract.
|
|
14
|
+
*
|
|
15
|
+
* @template {import('./contractGovernance/typedParamManager').ParamTypesMap} M
|
|
16
|
+
* Map of types of custom governed terms
|
|
17
|
+
* @param {ZCF<GovernanceTerms<M>>} zcf
|
|
18
|
+
* @param {Invitation} initialPoserInvitation
|
|
19
|
+
* @param {M} paramTypesMap
|
|
20
|
+
* @param {ERef<StorageNode>} [storageNode]
|
|
21
|
+
* @param {ERef<Marshaller>} [marshaller]
|
|
22
|
+
*/
|
|
23
|
+
export function handleParamGovernance<M extends import("./contractGovernance/typedParamManager.js").ParamTypesMap>(zcf: ZCF<GovernanceTerms<M>>, initialPoserInvitation: Invitation, paramTypesMap: M, storageNode?: ERef<StorageNode> | undefined, marshaller?: ERef<Marshaller<unknown>> | undefined): {
|
|
24
|
+
publicMixin: {
|
|
25
|
+
getAmount: (name: string) => Amount<AssetKind>;
|
|
26
|
+
getBrand: (name: string) => Brand<AssetKind>;
|
|
27
|
+
getInstance: (name: string) => Instance;
|
|
28
|
+
getInstallation: (name: string) => Installation<any>;
|
|
29
|
+
getInvitationAmount: (name: string) => Amount<"set">;
|
|
30
|
+
getNat: (name: string) => bigint;
|
|
31
|
+
getRatio: (name: string) => Ratio;
|
|
32
|
+
getString: (name: string) => string;
|
|
33
|
+
getTimestamp: (name: string) => import("@agoric/time/src/types.js").TimestampRecord;
|
|
34
|
+
getRelativeTime: (name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord;
|
|
35
|
+
getUnknown: (name: string) => any;
|
|
36
|
+
getSubscription: () => StoredSubscription<GovernanceSubscriptionState>;
|
|
37
|
+
getGovernedParams: () => ERef<ParamStateRecord>;
|
|
38
|
+
};
|
|
39
|
+
augmentPublicFacet: <PF extends {}>(originalPublicFacet: PF) => GovernedPublicFacet<PF>;
|
|
40
|
+
augmentVirtualPublicFacet: <OPF extends {}>(originalPublicFacet: OPF) => OPF & {
|
|
41
|
+
getAmount: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
42
|
+
getBrand: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
43
|
+
getInstance: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
44
|
+
getInstallation: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
45
|
+
getInvitationAmount: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
46
|
+
getNat: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
47
|
+
getRatio: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
48
|
+
getString: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
49
|
+
getTimestamp: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
50
|
+
getRelativeTime: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
51
|
+
getUnknown: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
52
|
+
getSubscription: () => StoredSubscription<GovernanceSubscriptionState>;
|
|
53
|
+
getGovernedParams: () => ERef<ParamStateRecord>;
|
|
54
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, OPF & {
|
|
55
|
+
getAmount: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
56
|
+
getBrand: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
57
|
+
getInstance: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
58
|
+
getInstallation: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
59
|
+
getInvitationAmount: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
60
|
+
getNat: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
61
|
+
getRatio: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
62
|
+
getString: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
63
|
+
getTimestamp: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
64
|
+
getRelativeTime: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
65
|
+
getUnknown: import("@agoric/vat-data/src/types.js").PlusContext<never, ((name: string) => Amount<AssetKind>) | ((name: string) => Brand<AssetKind>) | ((name: string) => Instance) | ((name: string) => Installation<any>) | ((name: string) => Amount<"set">) | ((name: string) => bigint) | ((name: string) => Ratio) | ((name: string) => string) | ((name: string) => import("@agoric/time/src/types.js").TimestampRecord) | ((name: string) => import("@agoric/time/src/types.js").RelativeTimeRecord) | ((name: string) => any)>;
|
|
66
|
+
getSubscription: () => StoredSubscription<GovernanceSubscriptionState>;
|
|
67
|
+
getGovernedParams: () => ERef<ParamStateRecord>;
|
|
68
|
+
}>;
|
|
69
|
+
makeGovernorFacet: <CF extends {}>(originalCreatorFacet: CF, governedApis?: {} | undefined) => GovernedCreatorFacet<CF>;
|
|
70
|
+
makeFarGovernorFacet: <CF_1 extends {}>(limitedCreatorFacet: CF_1, governedApis?: Record<string, (...any: any[]) => unknown> | undefined) => GovernedCreatorFacet<CF_1>;
|
|
71
|
+
makeVirtualGovernorFacet: (limitedCreatorFacet: {
|
|
72
|
+
[methodName: string]: (context?: unknown, ...rest: unknown[]) => unknown;
|
|
73
|
+
}) => {
|
|
74
|
+
governorFacet: import("@agoric/vat-data/src/types.js").FunctionsPlusContext<unknown, GovernedCreatorFacet<{
|
|
75
|
+
[methodName: string]: (context?: unknown, ...rest: unknown[]) => unknown;
|
|
76
|
+
}>>;
|
|
77
|
+
limitedCreatorFacet: {
|
|
78
|
+
[methodName: string]: (context?: unknown, ...rest: unknown[]) => unknown;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
makeDurableGovernorFacet: <CF_2>(baggage: MapStore<string, unknown>, limitedCreatorFacet: CF_2, governedApis?: Record<string, (...any: any[]) => unknown> | undefined) => {
|
|
82
|
+
governorFacet: {
|
|
83
|
+
getParamMgrRetriever: () => {
|
|
84
|
+
get: () => import("./contractGovernance/typedParamManager.js").TypedParamManager<M & {
|
|
85
|
+
Electorate: "invitation";
|
|
86
|
+
}>;
|
|
87
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
88
|
+
get: () => import("./contractGovernance/typedParamManager.js").TypedParamManager<M & {
|
|
89
|
+
Electorate: "invitation";
|
|
90
|
+
}>;
|
|
91
|
+
}>;
|
|
92
|
+
getInvitation: (name: any) => Promise<Invitation<unknown, never>>;
|
|
93
|
+
getLimitedCreatorFacet: () => CF_2;
|
|
94
|
+
/** @type {() => GovernedApis} */
|
|
95
|
+
getGovernedApis: () => GovernedApis;
|
|
96
|
+
getGovernedApiNames: () => string[];
|
|
97
|
+
setOfferFilter: (strings: any) => Promise<void>;
|
|
98
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
99
|
+
getParamMgrRetriever: () => {
|
|
100
|
+
get: () => import("./contractGovernance/typedParamManager.js").TypedParamManager<M & {
|
|
101
|
+
Electorate: "invitation";
|
|
102
|
+
}>;
|
|
103
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
104
|
+
get: () => import("./contractGovernance/typedParamManager.js").TypedParamManager<M & {
|
|
105
|
+
Electorate: "invitation";
|
|
106
|
+
}>;
|
|
107
|
+
}>;
|
|
108
|
+
getInvitation: (name: any) => Promise<Invitation<unknown, never>>;
|
|
109
|
+
getLimitedCreatorFacet: () => CF_2;
|
|
110
|
+
/** @type {() => GovernedApis} */
|
|
111
|
+
getGovernedApis: () => GovernedApis;
|
|
112
|
+
getGovernedApiNames: () => string[];
|
|
113
|
+
setOfferFilter: (strings: any) => Promise<void>;
|
|
114
|
+
}>;
|
|
115
|
+
limitedCreatorFacet: CF_2;
|
|
116
|
+
};
|
|
117
|
+
params: import("./contractGovernance/typedParamManager.js").Getters<M & {
|
|
118
|
+
Electorate: "invitation";
|
|
119
|
+
}>;
|
|
120
|
+
};
|
|
121
|
+
export namespace publicMixinAPI {
|
|
122
|
+
const getSubscription: any;
|
|
123
|
+
const getGovernedParams: any;
|
|
124
|
+
const getAmount: any;
|
|
125
|
+
const getBrand: any;
|
|
126
|
+
const getInstance: any;
|
|
127
|
+
const getInstallation: any;
|
|
128
|
+
const getInvitationAmount: any;
|
|
129
|
+
const getNat: any;
|
|
130
|
+
const getRatio: any;
|
|
131
|
+
const getString: any;
|
|
132
|
+
const getTimestamp: any;
|
|
133
|
+
const getRelativeTime: any;
|
|
134
|
+
const getUnknown: any;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=contractHelper.d.ts.map
|