@agoric/inter-protocol 0.17.0 → 0.17.1-upgrade-23-dev-bd79330.0.bd79330
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/package.json +23 -27
- package/source-spec-registry.js +67 -0
- package/src/auction/util.d.ts +3 -1
- package/src/auction/util.d.ts.map +1 -1
- package/src/auction/util.js +1 -2
- package/src/clientSupport.d.ts +29 -73
- package/src/clientSupport.d.ts.map +1 -1
- package/src/clientSupport.js +25 -129
- package/src/collectFees.d.ts +4 -0
- package/src/collectFees.d.ts.map +1 -1
- package/src/collectFees.js +5 -2
- package/src/contractSupport.d.ts +10 -2
- package/src/contractSupport.d.ts.map +1 -1
- package/src/contractSupport.js +8 -3
- package/src/econCommitteeCharter.d.ts +19 -8
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/econCommitteeCharter.js +12 -12
- package/src/feeDistributor.d.ts +56 -52
- package/src/feeDistributor.d.ts.map +1 -1
- package/src/feeDistributor.js +5 -3
- package/src/index.js +0 -3
- package/src/interest-math.d.ts +1 -0
- package/src/interest-math.d.ts.map +1 -1
- package/src/interest-math.js +1 -2
- package/src/interest.d.ts +13 -1
- package/src/interest.d.ts.map +1 -1
- package/src/interest.js +6 -3
- package/src/price/fluxAggregatorContract.d.ts +38 -14
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.js +26 -12
- package/src/price/fluxAggregatorKit.d.ts +18 -8
- package/src/price/fluxAggregatorKit.d.ts.map +1 -1
- package/src/price/fluxAggregatorKit.js +22 -8
- package/src/price/priceOracleKit.d.ts +3 -1
- package/src/price/priceOracleKit.d.ts.map +1 -1
- package/src/price/priceOracleKit.js +3 -1
- package/src/price/roundsManager.d.ts +15 -8
- package/src/price/roundsManager.d.ts.map +1 -1
- package/src/price/roundsManager.js +9 -2
- package/src/proposals/addAssetToVault.js +17 -105
- package/src/proposals/committee-proposal.js +14 -14
- package/src/proposals/core-proposal.js +12 -37
- package/src/proposals/deploy-price-feeds.js +12 -5
- package/src/proposals/econ-behaviors.js +23 -154
- package/src/proposals/price-feed-proposal.js +14 -4
- package/src/proposals/replace-fee-distributor.js +8 -4
- package/src/proposals/replace-scaledPriceAuthorities.js +8 -2
- package/src/proposals/replaceElectorate.js +7 -1
- package/src/proposals/startEconCommittee.js +5 -1
- package/src/proposals/startPSM.js +15 -6
- package/src/proposals/upgrade-scaledPriceAuthorities.js +5 -0
- package/src/proposals/utils.d.ts +10 -4
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +16 -8
- package/src/proposals/withdraw-reserve-proposal.js +6 -1
- package/src/provisionPool.d.ts +36 -18
- package/src/provisionPool.d.ts.map +1 -1
- package/src/provisionPool.js +19 -12
- package/src/provisionPoolKit.d.ts +29 -77
- package/src/provisionPoolKit.d.ts.map +1 -1
- package/src/provisionPoolKit.js +33 -23
- package/src/psm/psm.d.ts +36 -24
- package/src/psm/psm.d.ts.map +1 -1
- package/src/psm/psm.js +19 -15
- package/src/reserve/assetReserve.d.ts +16 -6
- package/src/reserve/assetReserve.d.ts.map +1 -1
- package/src/reserve/assetReserve.js +17 -9
- package/src/reserve/assetReserveKit.d.ts +13 -10
- package/src/reserve/assetReserveKit.d.ts.map +1 -1
- package/src/reserve/assetReserveKit.js +7 -5
- package/src/reserve/params.d.ts +1 -1
- package/src/reserve/params.d.ts.map +1 -1
- package/src/reserve/params.js +1 -3
- package/src/vaultFactory/burn.d.ts +4 -1
- package/src/vaultFactory/burn.d.ts.map +1 -1
- package/src/vaultFactory/burn.js +5 -4
- package/src/vaultFactory/math.d.ts +2 -0
- package/src/vaultFactory/math.d.ts.map +1 -1
- package/src/vaultFactory/math.js +5 -3
- package/src/vaultFactory/orderedVaultStore.d.ts +36 -36
- package/src/vaultFactory/params.d.ts +37 -10
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/params.js +34 -13
- package/src/vaultFactory/prioritizedVaults.d.ts +98 -95
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -1
- package/src/vaultFactory/prioritizedVaults.js +3 -2
- package/src/vaultFactory/storeUtils.d.ts +8 -3
- package/src/vaultFactory/storeUtils.d.ts.map +1 -1
- package/src/vaultFactory/storeUtils.js +8 -4
- package/src/vaultFactory/{types-ambient.d.ts → types.d.ts} +40 -40
- package/src/vaultFactory/types.d.ts.map +1 -0
- package/src/vaultFactory/{types-ambient.js → types.js} +26 -25
- package/src/vaultFactory/vault.d.ts +51 -35
- package/src/vaultFactory/vault.d.ts.map +1 -1
- package/src/vaultFactory/vault.js +29 -17
- package/src/vaultFactory/vaultDirector.d.ts +102 -112
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultDirector.js +40 -82
- package/src/vaultFactory/vaultFactory.d.ts +47 -95
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultFactory.js +27 -27
- package/src/vaultFactory/vaultHolder.d.ts +62 -55
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
- package/src/vaultFactory/vaultHolder.js +10 -4
- package/src/vaultFactory/vaultKit.d.ts +15 -10
- package/src/vaultFactory/vaultKit.d.ts.map +1 -1
- package/src/vaultFactory/vaultKit.js +8 -7
- package/src/vaultFactory/vaultManager.d.ts +112 -262
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +42 -319
- package/NEWS.md +0 -0
- package/scripts/build-bundles.js +0 -22
- package/src/auction/auctionBook.d.ts +0 -147
- package/src/auction/auctionBook.d.ts.map +0 -1
- package/src/auction/auctionBook.js +0 -794
- package/src/auction/auctionMath.d.ts +0 -17
- package/src/auction/auctionMath.d.ts.map +0 -1
- package/src/auction/auctionMath.js +0 -81
- package/src/auction/auctioneer.d.ts +0 -70
- package/src/auction/auctioneer.d.ts.map +0 -1
- package/src/auction/auctioneer.js +0 -733
- package/src/auction/offerBook.d.ts +0 -46
- package/src/auction/offerBook.d.ts.map +0 -1
- package/src/auction/offerBook.js +0 -226
- package/src/auction/params.d.ts +0 -145
- package/src/auction/params.d.ts.map +0 -1
- package/src/auction/params.js +0 -176
- package/src/auction/scheduleMath.d.ts +0 -5
- package/src/auction/scheduleMath.d.ts.map +0 -1
- package/src/auction/scheduleMath.js +0 -169
- package/src/auction/scheduler.d.ts +0 -50
- package/src/auction/scheduler.d.ts.map +0 -1
- package/src/auction/scheduler.js +0 -376
- package/src/auction/sortedOffers.d.ts +0 -8
- package/src/auction/sortedOffers.d.ts.map +0 -1
- package/src/auction/sortedOffers.js +0 -137
- package/src/proposals/add-auction.js +0 -285
- package/src/proposals/upgrade-vaults.js +0 -207
- package/src/psm/types-ambient.d.ts +0 -2
- package/src/psm/types-ambient.d.ts.map +0 -1
- package/src/psm/types-ambient.js +0 -3
- package/src/vaultFactory/liquidation.d.ts +0 -25
- package/src/vaultFactory/liquidation.d.ts.map +0 -1
- package/src/vaultFactory/liquidation.js +0 -309
- package/src/vaultFactory/proceeds.d.ts +0 -35
- package/src/vaultFactory/proceeds.d.ts.map +0 -1
- package/src/vaultFactory/proceeds.js +0 -282
- package/src/vaultFactory/types-ambient.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @agoric/group-jsdoc-imports -- due to conflicting `start` values */
|
|
2
2
|
|
|
3
3
|
import { AmountMath } from '@agoric/ertp';
|
|
4
4
|
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
|
|
@@ -6,23 +6,29 @@ import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
|
6
6
|
import { E } from '@endo/far';
|
|
7
7
|
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
8
8
|
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
9
|
-
import { makeGovernedTerms as makeGovernedATerms } from '../auction/params.js';
|
|
10
9
|
import { makeReserveTerms } from '../reserve/params.js';
|
|
11
10
|
import { makeGovernedTerms as makeGovernedVFTerms } from '../vaultFactory/params.js';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* @import {GovernorCreatorFacet, GovernanceFacetKit, GovernorStartedInstallationKit} from '@agoric/governance/src/types.js';
|
|
15
14
|
* @import {StartedInstanceKit} from '@agoric/zoe/src/zoeService/utils.js';
|
|
16
|
-
* @import {
|
|
15
|
+
* @import {Amount, Brand, NatValue, Payment} from '@agoric/ertp';
|
|
16
|
+
* @import {AdminFacet, Instance} from '@agoric/zoe';
|
|
17
17
|
* @import {MapStore, SetStore} from '@agoric/store';
|
|
18
|
+
* @import {RelativeTime} from '@agoric/time';
|
|
19
|
+
* @import {WellKnownSpaces} from '@agoric/vats/src/core/types.js';
|
|
20
|
+
* @import {ChainBootstrapSpace} from '@agoric/vats/src/core/types.js';
|
|
21
|
+
* @import {PromiseSpaceOf} from '@agoric/vats/src/core/types.js';
|
|
22
|
+
* @import {CommitteeElectorateCreatorFacet} from '@agoric/governance/src/committee.js';
|
|
23
|
+
* @import {PeriodicFeeCollector} from '../feeDistributor.js';
|
|
18
24
|
*/
|
|
19
25
|
|
|
20
|
-
// Duplicated from vaultFactory/types
|
|
26
|
+
// Duplicated from vaultFactory/types.js to solve a CI problem.
|
|
21
27
|
// Not worth refactoring to DRY because vaultFactory is going away.
|
|
22
28
|
/**
|
|
23
29
|
* @typedef {object} InterestTiming
|
|
24
|
-
* @property {
|
|
25
|
-
* @property {
|
|
30
|
+
* @property {RelativeTime} chargingPeriod in seconds
|
|
31
|
+
* @property {RelativeTime} recordingPeriod in seconds
|
|
26
32
|
*/
|
|
27
33
|
|
|
28
34
|
const trace = makeTracer('RunEconBehaviors', true);
|
|
@@ -38,58 +44,53 @@ export const SECONDS_PER_WEEK = 7n * SECONDS_PER_DAY;
|
|
|
38
44
|
/**
|
|
39
45
|
* @typedef {object} PSMKit
|
|
40
46
|
* @property {string} label
|
|
41
|
-
* @property {Instance<import('../psm/psm.js').start>} psm
|
|
47
|
+
* @property {Instance<typeof import('../psm/psm.js').start>} psm
|
|
42
48
|
* @property {Instance<
|
|
43
|
-
* import('../../../governance/src/contractGovernor.js').start
|
|
49
|
+
* typeof import('../../../governance/src/contractGovernor.js').start
|
|
44
50
|
* >} psmGovernor
|
|
45
51
|
* @property {Awaited<
|
|
46
52
|
* ReturnType<
|
|
47
53
|
* Awaited<
|
|
48
|
-
* ReturnType<import('../psm/psm.js')
|
|
54
|
+
* ReturnType<typeof import('../psm/psm.js').start>
|
|
49
55
|
* >['creatorFacet']['getLimitedCreatorFacet']
|
|
50
56
|
* >
|
|
51
57
|
* >} psmCreatorFacet
|
|
52
|
-
* @property {GovernorCreatorFacet<
|
|
58
|
+
* @property {GovernorCreatorFacet<
|
|
59
|
+
* typeof import('../../src/psm/psm.js').start
|
|
60
|
+
* >} psmGovernorCreatorFacet
|
|
53
61
|
* @property {AdminFacet} psmAdminFacet
|
|
54
62
|
*/
|
|
55
63
|
|
|
56
|
-
/** @typedef {GovernanceFacetKit<import('../auction/auctioneer.js').start>} AuctioneerKit */
|
|
57
|
-
|
|
58
64
|
/**
|
|
59
65
|
* @typedef {WellKnownSpaces & ChainBootstrapSpace & EconomyBootstrapSpace} EconomyBootstrapPowers
|
|
60
66
|
*
|
|
61
67
|
*
|
|
62
68
|
* @typedef {PromiseSpaceOf<{
|
|
63
69
|
* economicCommitteeKit: CommitteeStartResult;
|
|
64
|
-
* economicCommitteeCreatorFacet:
|
|
70
|
+
* economicCommitteeCreatorFacet: CommitteeElectorateCreatorFacet;
|
|
65
71
|
* feeDistributorKit: StartedInstanceKit<
|
|
66
72
|
* typeof import('../feeDistributor.js').start
|
|
67
73
|
* >;
|
|
68
|
-
* periodicFeeCollectors: MapStore<
|
|
69
|
-
* number,
|
|
70
|
-
* import('../feeDistributor.js').PeriodicFeeCollector
|
|
71
|
-
* >;
|
|
74
|
+
* periodicFeeCollectors: MapStore<number, PeriodicFeeCollector>;
|
|
72
75
|
* psmKit: MapStore<Brand, PSMKit>;
|
|
73
76
|
* anchorBalancePayments: MapStore<Brand, Payment<'nat'>>;
|
|
74
77
|
* econCharterKit: EconCharterStartResult;
|
|
75
78
|
* reserveKit: GovernanceFacetKit<
|
|
76
|
-
* import('../reserve/assetReserve.js')
|
|
79
|
+
* typeof import('../reserve/assetReserve.js').start
|
|
77
80
|
* >;
|
|
78
81
|
* vaultFactoryKit: GovernanceFacetKit<VFStart>;
|
|
79
|
-
* auctioneerKit: AuctioneerKit;
|
|
80
|
-
* newAuctioneerKit: AuctioneerKit | undefined;
|
|
81
82
|
* minInitialDebt: NatValue;
|
|
82
83
|
* }>} EconomyBootstrapSpace
|
|
83
84
|
*/
|
|
84
85
|
|
|
85
86
|
/**
|
|
86
87
|
* @typedef {StartedInstanceKit<
|
|
87
|
-
* import('../econCommitteeCharter.js')
|
|
88
|
+
* typeof import('../econCommitteeCharter.js').start
|
|
88
89
|
* >} EconCharterStartResult
|
|
89
90
|
*/
|
|
90
91
|
/**
|
|
91
92
|
* @typedef {StartedInstanceKit<
|
|
92
|
-
* import('@agoric/governance/src/committee.js')
|
|
93
|
+
* typeof import('@agoric/governance/src/committee.js').start
|
|
93
94
|
* >} CommitteeStartResult
|
|
94
95
|
*/
|
|
95
96
|
|
|
@@ -232,7 +233,6 @@ export const setupVaultFactoryArguments = async (
|
|
|
232
233
|
feeMintAccess: feeMintAccessP,
|
|
233
234
|
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
234
235
|
reserveKit,
|
|
235
|
-
auctioneerKit,
|
|
236
236
|
} = consume;
|
|
237
237
|
|
|
238
238
|
const poserInvitationP = E(electorateCreatorFacet).getPoserInvitation();
|
|
@@ -246,14 +246,12 @@ export const setupVaultFactoryArguments = async (
|
|
|
246
246
|
initialShortfallInvitation,
|
|
247
247
|
shortfallInvitationAmount,
|
|
248
248
|
feeMintAccess,
|
|
249
|
-
auctioneerInstance,
|
|
250
249
|
] = await Promise.all([
|
|
251
250
|
poserInvitationP,
|
|
252
251
|
E(E(zoe).getInvitationIssuer()).getAmountOf(poserInvitationP),
|
|
253
252
|
shortfallInvitationP,
|
|
254
253
|
E(E(zoe).getInvitationIssuer()).getAmountOf(shortfallInvitationP),
|
|
255
254
|
feeMintAccessP,
|
|
256
|
-
E.get(auctioneerKit).instance,
|
|
257
255
|
]);
|
|
258
256
|
|
|
259
257
|
const reservePublicFacet = await E.get(reserveKit).publicFacet;
|
|
@@ -273,7 +271,6 @@ export const setupVaultFactoryArguments = async (
|
|
|
273
271
|
});
|
|
274
272
|
|
|
275
273
|
const vaultFactoryPrivateArgs = {
|
|
276
|
-
auctioneerInstance,
|
|
277
274
|
feeMintAccess,
|
|
278
275
|
initialPoserInvitation,
|
|
279
276
|
initialShortfallInvitation,
|
|
@@ -479,7 +476,6 @@ export const startRewardDistributor = async ({
|
|
|
479
476
|
const instanceKit = await E(zoe).startInstance(
|
|
480
477
|
feeDistributor,
|
|
481
478
|
{ Fee: centralIssuer },
|
|
482
|
-
// @ts-expect-error XXX
|
|
483
479
|
feeDistributorTerms,
|
|
484
480
|
undefined,
|
|
485
481
|
'feeDistributor',
|
|
@@ -526,130 +522,3 @@ export const startRewardDistributor = async ({
|
|
|
526
522
|
);
|
|
527
523
|
};
|
|
528
524
|
harden(startRewardDistributor);
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* @param {EconomyBootstrapPowers} powers
|
|
532
|
-
* @param {object} config
|
|
533
|
-
* @param {any} [config.auctionParams]
|
|
534
|
-
*/
|
|
535
|
-
export const startAuctioneer = async (
|
|
536
|
-
{
|
|
537
|
-
consume: {
|
|
538
|
-
zoe,
|
|
539
|
-
board,
|
|
540
|
-
chainTimerService,
|
|
541
|
-
priceAuthority,
|
|
542
|
-
chainStorage,
|
|
543
|
-
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
544
|
-
},
|
|
545
|
-
produce: { auctioneerKit },
|
|
546
|
-
instance: {
|
|
547
|
-
produce: { auctioneer: auctionInstance },
|
|
548
|
-
consume: { reserve: reserveInstance },
|
|
549
|
-
},
|
|
550
|
-
installation: {
|
|
551
|
-
consume: {
|
|
552
|
-
auctioneer: auctionInstallation,
|
|
553
|
-
contractGovernor: contractGovernorInstallation,
|
|
554
|
-
},
|
|
555
|
-
},
|
|
556
|
-
issuer: {
|
|
557
|
-
consume: { [Stable.symbol]: stableIssuerP },
|
|
558
|
-
},
|
|
559
|
-
},
|
|
560
|
-
{
|
|
561
|
-
auctionParams = {
|
|
562
|
-
StartFrequency: 1n * SECONDS_PER_HOUR,
|
|
563
|
-
ClockStep: 3n * SECONDS_PER_MINUTE,
|
|
564
|
-
StartingRate: 10500n,
|
|
565
|
-
LowestRate: 6500n,
|
|
566
|
-
DiscountStep: 500n,
|
|
567
|
-
AuctionStartDelay: 2n,
|
|
568
|
-
PriceLockPeriod: SECONDS_PER_HOUR / 2n,
|
|
569
|
-
},
|
|
570
|
-
} = {},
|
|
571
|
-
) => {
|
|
572
|
-
trace('startAuctioneer');
|
|
573
|
-
const STORAGE_PATH = 'auction';
|
|
574
|
-
|
|
575
|
-
const poserInvitationP = E(electorateCreatorFacet).getPoserInvitation();
|
|
576
|
-
|
|
577
|
-
const [initialPoserInvitation, electorateInvitationAmount, stableIssuer] =
|
|
578
|
-
await Promise.all([
|
|
579
|
-
poserInvitationP,
|
|
580
|
-
E(E(zoe).getInvitationIssuer()).getAmountOf(poserInvitationP),
|
|
581
|
-
stableIssuerP,
|
|
582
|
-
]);
|
|
583
|
-
|
|
584
|
-
const timerBrand = await E(chainTimerService).getTimerBrand();
|
|
585
|
-
|
|
586
|
-
const storageNode = await makeStorageNodeChild(chainStorage, STORAGE_PATH);
|
|
587
|
-
const marshaller = await E(board).getReadonlyMarshaller();
|
|
588
|
-
|
|
589
|
-
const reservePublicFacet = await E(zoe).getPublicFacet(reserveInstance);
|
|
590
|
-
|
|
591
|
-
const auctionTerms = makeGovernedATerms(
|
|
592
|
-
{ storageNode, marshaller },
|
|
593
|
-
chainTimerService,
|
|
594
|
-
priceAuthority,
|
|
595
|
-
reservePublicFacet,
|
|
596
|
-
{
|
|
597
|
-
...auctionParams,
|
|
598
|
-
ElectorateInvitationAmount: electorateInvitationAmount,
|
|
599
|
-
TimerBrand: timerBrand,
|
|
600
|
-
},
|
|
601
|
-
);
|
|
602
|
-
|
|
603
|
-
const governorTerms = await deeplyFulfilledObject(
|
|
604
|
-
harden({
|
|
605
|
-
timer: chainTimerService,
|
|
606
|
-
governedContractInstallation: auctionInstallation,
|
|
607
|
-
governed: {
|
|
608
|
-
terms: auctionTerms,
|
|
609
|
-
issuerKeywordRecord: { Bid: stableIssuer },
|
|
610
|
-
storageNode,
|
|
611
|
-
marshaller,
|
|
612
|
-
label: 'auctioneer',
|
|
613
|
-
},
|
|
614
|
-
}),
|
|
615
|
-
);
|
|
616
|
-
|
|
617
|
-
/** @type {GovernorStartedInstallationKit<typeof auctionInstallation>} */
|
|
618
|
-
const governorStartResult = await E(zoe).startInstance(
|
|
619
|
-
contractGovernorInstallation,
|
|
620
|
-
undefined,
|
|
621
|
-
governorTerms,
|
|
622
|
-
harden({
|
|
623
|
-
electorateCreatorFacet,
|
|
624
|
-
governed: {
|
|
625
|
-
initialPoserInvitation,
|
|
626
|
-
storageNode,
|
|
627
|
-
marshaller,
|
|
628
|
-
},
|
|
629
|
-
}),
|
|
630
|
-
'auctioneer.governor',
|
|
631
|
-
);
|
|
632
|
-
|
|
633
|
-
const [governedInstance, governedCreatorFacet, governedPublicFacet] =
|
|
634
|
-
await Promise.all([
|
|
635
|
-
E(governorStartResult.creatorFacet).getInstance(),
|
|
636
|
-
E(governorStartResult.creatorFacet).getCreatorFacet(),
|
|
637
|
-
E(governorStartResult.creatorFacet).getPublicFacet(),
|
|
638
|
-
]);
|
|
639
|
-
|
|
640
|
-
auctioneerKit.resolve(
|
|
641
|
-
harden({
|
|
642
|
-
label: 'auctioneer',
|
|
643
|
-
creatorFacet: governedCreatorFacet,
|
|
644
|
-
adminFacet: governorStartResult.adminFacet,
|
|
645
|
-
publicFacet: governedPublicFacet,
|
|
646
|
-
instance: governedInstance,
|
|
647
|
-
|
|
648
|
-
governor: governorStartResult.instance,
|
|
649
|
-
governorCreatorFacet: governorStartResult.creatorFacet,
|
|
650
|
-
governorAdminFacet: governorStartResult.adminFacet,
|
|
651
|
-
}),
|
|
652
|
-
);
|
|
653
|
-
|
|
654
|
-
auctionInstance.resolve(governedInstance);
|
|
655
|
-
};
|
|
@@ -13,6 +13,14 @@ import {
|
|
|
13
13
|
reserveThenGetNames,
|
|
14
14
|
} from './utils.js';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* @import {ChainlinkConfig} from '@agoric/inter-protocol/src/price/fluxAggregatorKit.js';
|
|
18
|
+
* @import {EconomyBootstrapPowers} from './econ-behaviors.js';
|
|
19
|
+
* @import {start} from '@agoric/inter-protocol/src/price/fluxAggregatorContract.js';
|
|
20
|
+
* @import {Installation} from '@agoric/zoe';
|
|
21
|
+
* @import {ChainBootstrapSpace} from '@agoric/vats/src/core/types.js';
|
|
22
|
+
*/
|
|
23
|
+
|
|
16
24
|
// backwards compatibility
|
|
17
25
|
export { oracleBrandFeedName as instanceNameFor };
|
|
18
26
|
|
|
@@ -88,10 +96,10 @@ export const ensureOracleBrands = async (
|
|
|
88
96
|
* priceFeedOptions: {
|
|
89
97
|
* AGORIC_INSTANCE_NAME: string;
|
|
90
98
|
* oracleAddresses: string[];
|
|
91
|
-
* contractTerms:
|
|
99
|
+
* contractTerms: ChainlinkConfig;
|
|
92
100
|
* IN_BRAND_NAME: string;
|
|
93
101
|
* OUT_BRAND_NAME: string;
|
|
94
|
-
* priceAggregatorRef
|
|
102
|
+
* priceAggregatorRef?: Installation;
|
|
95
103
|
* };
|
|
96
104
|
* };
|
|
97
105
|
* }} config
|
|
@@ -167,7 +175,9 @@ export const createPriceFeed = async (
|
|
|
167
175
|
/**
|
|
168
176
|
* @type {[
|
|
169
177
|
* [Brand<'nat'>, Brand<'nat'>],
|
|
170
|
-
* Installation<
|
|
178
|
+
* Installation<
|
|
179
|
+
* typeof start
|
|
180
|
+
* >,
|
|
171
181
|
* Timer,
|
|
172
182
|
* ]}
|
|
173
183
|
*/
|
|
@@ -316,7 +326,7 @@ export const getManifestForPriceFeed = async (
|
|
|
316
326
|
});
|
|
317
327
|
|
|
318
328
|
/**
|
|
319
|
-
* @param {
|
|
329
|
+
* @param {EconomyBootstrapPowers} powers
|
|
320
330
|
* @param {object} [config]
|
|
321
331
|
* @param {object} [config.options]
|
|
322
332
|
* @param {string[]} [config.options.demoOracleAddresses]
|
|
@@ -3,12 +3,18 @@ import { Stable } from '@agoric/internal/src/tokens.js';
|
|
|
3
3
|
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
4
4
|
import { getInterfaceOf, E } from '@endo/far';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @import {EconomyBootstrapPowers} from './econ-behaviors.js';
|
|
8
|
+
* @import {start} from '@agoric/inter-protocol/src/feeDistributor.js';
|
|
9
|
+
* @import {StartedInstanceKit} from '@agoric/vats/src/core/types.js';
|
|
10
|
+
*/
|
|
11
|
+
|
|
6
12
|
const trace = makeTracer('ReplaceFeeDistributer', true);
|
|
7
13
|
|
|
8
14
|
/**
|
|
9
15
|
* Start the reward distributor.
|
|
10
16
|
*
|
|
11
|
-
* @param {
|
|
17
|
+
* @param {EconomyBootstrapPowers} powers
|
|
12
18
|
* @param {{
|
|
13
19
|
* options: {
|
|
14
20
|
* keywordShares: Record<string, bigint>;
|
|
@@ -76,9 +82,7 @@ export const replaceFeeDistributor = async (
|
|
|
76
82
|
});
|
|
77
83
|
|
|
78
84
|
/**
|
|
79
|
-
* @type {StartedInstanceKit<
|
|
80
|
-
* typeof import('@agoric/inter-protocol/src/feeDistributor.js').start
|
|
81
|
-
* >}
|
|
85
|
+
* @type {StartedInstanceKit<typeof start>}
|
|
82
86
|
*/
|
|
83
87
|
const instanceKit = await E(zoe).startInstance(
|
|
84
88
|
feeDistributor,
|
|
@@ -4,10 +4,16 @@ import { E } from '@endo/far';
|
|
|
4
4
|
import { startScaledPriceAuthority } from './addAssetToVault.js';
|
|
5
5
|
import { scaledPriceFeedName } from './utils.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @import {BootstrapPowers} from '@agoric/vats/src/core/types.js';
|
|
9
|
+
* @import {ChainBootstrapSpace} from '@agoric/vats/src/core/types.js';
|
|
10
|
+
* @import {EconomyBootstrapPowers} from './core-proposal.js';
|
|
11
|
+
*/
|
|
12
|
+
|
|
7
13
|
const trace = makeTracer('replaceScaledPA', true);
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
|
-
* @param {
|
|
16
|
+
* @param {EconomyBootstrapPowers} powers
|
|
11
17
|
* @param {object} config
|
|
12
18
|
* @param {object} config.options
|
|
13
19
|
*/
|
|
@@ -32,7 +38,7 @@ export const replaceScaledPriceAuthority = async (powers, { options }) => {
|
|
|
32
38
|
* scaledPriceAuthorities. The existing contracts will be left behind to be
|
|
33
39
|
* cleaned up later.
|
|
34
40
|
*
|
|
35
|
-
* @param {
|
|
41
|
+
* @param {EconomyBootstrapPowers} powers
|
|
36
42
|
* @param {{ options: { scaledPARef: { bundleID: string } } }} options
|
|
37
43
|
*/
|
|
38
44
|
export const replaceScaledPriceAuthorities = async (powers, { options }) => {
|
|
@@ -17,7 +17,12 @@ import {
|
|
|
17
17
|
} from '@agoric/internal/src/lib-chainStorage.js';
|
|
18
18
|
import { provideRetiredInstances, reserveThenDeposit } from './utils.js';
|
|
19
19
|
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @import {EconomyBootstrapPowers} from './econ-behaviors.js'
|
|
22
|
+
* @import {Instance, Invitation} from '@agoric/zoe';
|
|
23
|
+
* @import {MapStore} from '@agoric/store';
|
|
24
|
+
* @import {PromiseSpaceOf} from '@agoric/vats/src/core/types.js';
|
|
25
|
+
*/
|
|
21
26
|
/** @import {EconCharterStartResult} from './econ-behaviors.js' */
|
|
22
27
|
/** @import {CommitteeElectorateCreatorFacet} from '@agoric/governance/src/committee.js'; */
|
|
23
28
|
|
|
@@ -368,6 +373,7 @@ const startNewEconCharter = async ({
|
|
|
368
373
|
const terms = harden({
|
|
369
374
|
binaryVoteCounterInstallation: counterInstall,
|
|
370
375
|
});
|
|
376
|
+
/** @type {EconCharterStartResult} */
|
|
371
377
|
const startResult = await E(startUpgradable)({
|
|
372
378
|
label,
|
|
373
379
|
installation: charterInstall,
|
|
@@ -5,6 +5,10 @@ import {
|
|
|
5
5
|
} from '@agoric/internal/src/lib-chainStorage.js';
|
|
6
6
|
import { E } from '@endo/far';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @import {EconomyBootstrapPowers} from './econ-behaviors.js';
|
|
10
|
+
*/
|
|
11
|
+
|
|
8
12
|
const trace = makeTracer('RunEconCommittee', true);
|
|
9
13
|
|
|
10
14
|
/** @type {(name: string) => string} */
|
|
@@ -21,7 +25,7 @@ const sanitizePathSegment = name => {
|
|
|
21
25
|
*/
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
|
-
* @param {
|
|
28
|
+
* @param {EconomyBootstrapPowers} powers
|
|
25
29
|
* @param {object} config
|
|
26
30
|
* @param {object} [config.options]
|
|
27
31
|
* @param {EconCommitteeOptions} [config.options.econCommitteeOptions]
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
|
|
3
1
|
import { makeMap } from 'jessie.js';
|
|
4
2
|
import { X } from '@endo/errors';
|
|
5
3
|
import { E } from '@endo/far';
|
|
@@ -11,7 +9,7 @@ import {
|
|
|
11
9
|
makeHistoryReviver,
|
|
12
10
|
makeBoardRemote,
|
|
13
11
|
slotToBoardRemote,
|
|
14
|
-
} from '@agoric/internal/src/marshal.js';
|
|
12
|
+
} from '@agoric/internal/src/marshal/board-client-utils.js';
|
|
15
13
|
import { deeplyFulfilledObject } from '@agoric/internal';
|
|
16
14
|
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
17
15
|
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
@@ -24,7 +22,18 @@ import {
|
|
|
24
22
|
inviteToEconCharter,
|
|
25
23
|
} from './committee-proposal.js';
|
|
26
24
|
|
|
27
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @import {BootstrapManifest} from '@agoric/vats/src/core/lib-boot.js'
|
|
27
|
+
* @import {PSMKit} from './econ-behaviors.js';
|
|
28
|
+
* @import {FeeMintAccess} from '@agoric/zoe';
|
|
29
|
+
* @import {GovernanceSubscriptionState, GovernorStartedInstallationKit} from '@agoric/governance/src/types.js';
|
|
30
|
+
* @import {Brand} from '@agoric/ertp';
|
|
31
|
+
* @import {Issuer} from '@agoric/ertp';
|
|
32
|
+
* @import {Mint} from '@agoric/ertp';
|
|
33
|
+
* @import {MapStore} from '@agoric/store';
|
|
34
|
+
* @import {ChainStorageVatParams, WellKnownSpaces} from '@agoric/vats/src/core/types.js';
|
|
35
|
+
* @import {ERef} from '@agoric/vow';
|
|
36
|
+
*/
|
|
28
37
|
/** @import {MetricsNotification} from '../psm/psm.js' */
|
|
29
38
|
/** @import {EconomyBootstrapPowers} from './econ-behaviors.js' */
|
|
30
39
|
|
|
@@ -249,7 +258,7 @@ export const startPSM = async (
|
|
|
249
258
|
};
|
|
250
259
|
await (oldState.metrics && restoreMetrics(oldState.metrics));
|
|
251
260
|
|
|
252
|
-
/** @type {
|
|
261
|
+
/** @type {PSMKit} */
|
|
253
262
|
const newpsmKit = harden({
|
|
254
263
|
label: instanceKey,
|
|
255
264
|
psm,
|
|
@@ -262,7 +271,7 @@ export const startPSM = async (
|
|
|
262
271
|
// Provide pattern with a promise.
|
|
263
272
|
producepsmKit.resolve(makeScalarBigMapStore('PSM Kits', { durable: true }));
|
|
264
273
|
|
|
265
|
-
/** @type {MapStore<Brand,
|
|
274
|
+
/** @type {MapStore<Brand, PSMKit>} */
|
|
266
275
|
const psmKitMap = await psmKit;
|
|
267
276
|
|
|
268
277
|
// TODO init into governedContractKits too to simplify testing
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { makeTracer } from '@agoric/internal';
|
|
2
2
|
import { E } from '@endo/far';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @import {ChainBootstrapSpace} from '@agoric/vats/src/core/types.js';
|
|
6
|
+
* @import {StartedInstanceKit} from '@agoric/zoe/src/zoeService/utils.js';
|
|
7
|
+
*/
|
|
8
|
+
|
|
4
9
|
const trace = makeTracer('upgradeScaledPA', true);
|
|
5
10
|
|
|
6
11
|
/**
|
package/src/proposals/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export function reserveThenGetNamePaths(nameAdmin: ERef<
|
|
2
|
-
export function reserveThenGetNames(nameAdmin: ERef<
|
|
3
|
-
export function reserveThenDeposit(debugName: string, namesByAddressAdmin: ERef<
|
|
1
|
+
export function reserveThenGetNamePaths(nameAdmin: ERef<NameAdmin>, paths: string[][]): Promise<unknown[]>;
|
|
2
|
+
export function reserveThenGetNames(nameAdmin: ERef<NameAdmin>, names: string[]): Promise<any[]>;
|
|
3
|
+
export function reserveThenDeposit(debugName: string, namesByAddressAdmin: ERef<NameAdmin>, addr: string, payments: ERef<Payment>[]): Promise<void>;
|
|
4
4
|
export function makeInstallCache(homeP: Promise<{
|
|
5
|
-
scratch: ERef<
|
|
5
|
+
scratch: ERef<ScratchPad>;
|
|
6
6
|
}>, { installCacheKey, loadBundle }: {
|
|
7
7
|
loadBundle: (specifier: string) => Promise<{
|
|
8
8
|
default: Bundle;
|
|
@@ -17,5 +17,11 @@ export function scaledPriceFeedName(issuerName: any): string;
|
|
|
17
17
|
/** @type {(name: string) => string} */
|
|
18
18
|
export const sanitizePathSegment: (name: string) => string;
|
|
19
19
|
export function provideRetiredInstances(consume: Promise<MapStore>, produce: Producer<MapStore>): Promise<MapStore>;
|
|
20
|
+
import type { NameAdmin } from '@agoric/vats';
|
|
21
|
+
import type { ERef } from '@agoric/vow';
|
|
22
|
+
import type { Payment } from '@agoric/ertp';
|
|
23
|
+
import type { ScratchPad } from '@agoric/internal/src/scratch.js';
|
|
24
|
+
import type { Bundle } from '@agoric/swingset-vat';
|
|
20
25
|
import type { MapStore } from '@agoric/store';
|
|
26
|
+
import type { Producer } from '@agoric/vats/src/core/types.js';
|
|
21
27
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAuBO,mDAHI,KAAK,SAAS,CAAC,SACf,MAAM,EAAE,EAAE,sBAgCpB;AAOM,+CAJI,KAAK,SAAS,CAAC,SACf,MAAM,EAAE,GACN,OAAO,CAAC,GAAG,EAAE,CAAC,CAMxB;AAQI,8CALI,MAAM,uBACN,KAAK,SAAS,CAAC,QACf,MAAM,YACN,KAAK,OAAO,CAAC,EAAE,iBAwBzB;AA2BM,wCAPI,OAAO,CAAC;IACd,OAAO,EAAE,KAAK,UAAU,CAAC,CAAC;CAC3B,CAAC,mCAEF;IAAkE,UAAU,EAApE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,eAAe;CAAC;oCAkCD,UAAK,EAAE,UAAK,EAAE,SAAI;;GAkBzD;AAEM,iFACsC;AAEtC,6DAC+B;AAEtC,uCAAuC;AACvC,kCADW,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAKjC;AAUK,iDAJI,OAAO,CAAC,QAAQ,CAAC,WACjB,SAAS,QAAQ,CAAC,GAChB,OAAO,CAAC,QAAQ,CAAC,CAW7B;+BAjM2B,cAAc;0BAKnB,aAAa;6BADV,cAAc;gCAHX,iCAAiC;4BACrC,sBAAsB;8BAHV,eAAe;8BAOzB,gCAAgC"}
|
package/src/proposals/utils.js
CHANGED
|
@@ -8,16 +8,24 @@ import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
|
8
8
|
/**
|
|
9
9
|
* @import {CopyMap} from '@endo/patterns';
|
|
10
10
|
* @import {MapStore, SetStore} from '@agoric/store';
|
|
11
|
+
* @import {NameAdmin} from '@agoric/vats';
|
|
12
|
+
* @import {ScratchPad} from '@agoric/internal/src/scratch.js';
|
|
13
|
+
* @import {Bundle} from '@agoric/swingset-vat';
|
|
14
|
+
* @import {Installation} from '@agoric/zoe';
|
|
15
|
+
* @import {Payment} from '@agoric/ertp';
|
|
16
|
+
* @import {ERef} from '@agoric/vow';
|
|
17
|
+
* @import {Producer} from '@agoric/vats/src/core/types.js';
|
|
11
18
|
*/
|
|
12
19
|
|
|
13
20
|
/**
|
|
14
|
-
* @param {ERef<
|
|
21
|
+
* @param {ERef<NameAdmin>} nameAdmin
|
|
15
22
|
* @param {string[][]} paths
|
|
16
23
|
*/
|
|
17
24
|
export const reserveThenGetNamePaths = async (nameAdmin, paths) => {
|
|
18
25
|
/**
|
|
19
|
-
* @param {ERef<
|
|
26
|
+
* @param {ERef<NameAdmin>} nextAdmin
|
|
20
27
|
* @param {string[]} path
|
|
28
|
+
* @returns {Promise<unknown>}
|
|
21
29
|
*/
|
|
22
30
|
const nextPath = async (nextAdmin, path) => {
|
|
23
31
|
const [nextName, ...rest] = path;
|
|
@@ -46,8 +54,9 @@ export const reserveThenGetNamePaths = async (nameAdmin, paths) => {
|
|
|
46
54
|
};
|
|
47
55
|
|
|
48
56
|
/**
|
|
49
|
-
* @param {ERef<
|
|
57
|
+
* @param {ERef<NameAdmin>} nameAdmin
|
|
50
58
|
* @param {string[]} names
|
|
59
|
+
* @returns {Promise<any[]>}
|
|
51
60
|
*/
|
|
52
61
|
export const reserveThenGetNames = async (nameAdmin, names) =>
|
|
53
62
|
reserveThenGetNamePaths(
|
|
@@ -57,7 +66,7 @@ export const reserveThenGetNames = async (nameAdmin, names) =>
|
|
|
57
66
|
|
|
58
67
|
/**
|
|
59
68
|
* @param {string} debugName
|
|
60
|
-
* @param {ERef<
|
|
69
|
+
* @param {ERef<NameAdmin>} namesByAddressAdmin
|
|
61
70
|
* @param {string} addr
|
|
62
71
|
* @param {ERef<Payment>[]} payments
|
|
63
72
|
*/
|
|
@@ -68,6 +77,7 @@ export const reserveThenDeposit = async (
|
|
|
68
77
|
payments,
|
|
69
78
|
) => {
|
|
70
79
|
console.info('awaiting depositFacet for', debugName);
|
|
80
|
+
/** @type {any} */
|
|
71
81
|
const [depositFacet] = await reserveThenGetNamePaths(namesByAddressAdmin, [
|
|
72
82
|
[addr, WalletName.depositFacet],
|
|
73
83
|
]);
|
|
@@ -86,9 +96,7 @@ export const reserveThenDeposit = async (
|
|
|
86
96
|
|
|
87
97
|
/**
|
|
88
98
|
* @type {<T>(
|
|
89
|
-
* store: ERef<
|
|
90
|
-
* Map<string, T> | import('@agoric/internal/src/scratch.js').ScratchPad
|
|
91
|
-
* >,
|
|
99
|
+
* store: ERef<Map<string, T> | ScratchPad>,
|
|
92
100
|
* key: string,
|
|
93
101
|
* make: () => T,
|
|
94
102
|
* ) => Promise<T>}
|
|
@@ -105,7 +113,7 @@ const provideWhen = async (store, key, make) => {
|
|
|
105
113
|
|
|
106
114
|
/**
|
|
107
115
|
* @param {Promise<{
|
|
108
|
-
* scratch: ERef<
|
|
116
|
+
* scratch: ERef<ScratchPad>;
|
|
109
117
|
* }>} homeP
|
|
110
118
|
* @param {object} opts
|
|
111
119
|
* @param {(specifier: string) => Promise<{ default: Bundle }>} opts.loadBundle
|
|
@@ -2,11 +2,16 @@ import { E } from '@endo/far';
|
|
|
2
2
|
import { makeTracer } from '@agoric/internal/src/debug.js';
|
|
3
3
|
import { reserveThenDeposit } from './utils.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @import {start} from '../reserve/assetReserve.js';
|
|
7
|
+
* @import {BootstrapPowers} from '@agoric/vats/src/core/types.js';
|
|
8
|
+
*/
|
|
9
|
+
|
|
5
10
|
/**
|
|
6
11
|
* @param {BootstrapPowers & {
|
|
7
12
|
* consume: {
|
|
8
13
|
* reserveKit: Promise<
|
|
9
|
-
* ReturnType<
|
|
14
|
+
* ReturnType<typeof start>
|
|
10
15
|
* >;
|
|
11
16
|
* };
|
|
12
17
|
* }} powers
|