@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,9 +1,3 @@
|
|
|
1
|
-
/// <reference types="@agoric/governance/exported" />
|
|
2
|
-
/// <reference types="@agoric/zoe/exported" />
|
|
3
|
-
|
|
4
|
-
import { Fail, q } from '@endo/errors';
|
|
5
|
-
import { E } from '@endo/eventual-send';
|
|
6
|
-
import { Far } from '@endo/marshal';
|
|
7
1
|
import { AmountMath, AmountShape, BrandShape, IssuerShape } from '@agoric/ertp';
|
|
8
2
|
import {
|
|
9
3
|
GovernorFacetShape,
|
|
@@ -24,11 +18,10 @@ import {
|
|
|
24
18
|
TopicsRecordShape,
|
|
25
19
|
unitAmount,
|
|
26
20
|
} from '@agoric/zoe/src/contractSupport/index.js';
|
|
21
|
+
import { Fail, q } from '@endo/errors';
|
|
22
|
+
import { E } from '@endo/eventual-send';
|
|
23
|
+
import { Far } from '@endo/marshal';
|
|
27
24
|
import { makeCollectFeesInvitation } from '../collectFees.js';
|
|
28
|
-
import {
|
|
29
|
-
setWakeupsForNextAuction,
|
|
30
|
-
watchForGovernanceChange,
|
|
31
|
-
} from './liquidation.js';
|
|
32
25
|
import {
|
|
33
26
|
provideVaultParamManagers,
|
|
34
27
|
SHORTFALL_INVITATION_KEY,
|
|
@@ -41,9 +34,30 @@ import {
|
|
|
41
34
|
|
|
42
35
|
/**
|
|
43
36
|
* @import {MapStore} from '@agoric/store';
|
|
44
|
-
* @import {TransferPart, ZCF, ZCFMint, ZCFSeat} from '@agoric/zoe';
|
|
37
|
+
* @import {AmountKeywordRecord, Keyword, TransferPart, ZCF, ZCFMint, ZCFSeat} from '@agoric/zoe';
|
|
45
38
|
* @import {EReturn} from '@endo/far';
|
|
46
|
-
* @import {TypedPattern} from '@agoric/internal';
|
|
39
|
+
* @import {TypedPattern, ERemote, Remote} from '@agoric/internal';
|
|
40
|
+
* @import {EMarshaller} from '@agoric/internal/src/marshal/wrap-marshaller.js';
|
|
41
|
+
* @import {GovernedParamGetters} from './vaultManager.js';
|
|
42
|
+
* @import {ShortfallReporter} from '../reserve/assetReserve.js';
|
|
43
|
+
* @import {TypedParamManager} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
44
|
+
* @import {VaultDirectorParams} from './params.js';
|
|
45
|
+
* @import {Baggage} from '@agoric/swingset-liveslots';
|
|
46
|
+
* @import {VaultFactoryZCF} from './vaultFactory.js';
|
|
47
|
+
* @import {TimerService} from '@agoric/time';
|
|
48
|
+
* @import {MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
49
|
+
* @import {MakeERecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
50
|
+
* @import {VaultManager} from './vaultManager.js';
|
|
51
|
+
* @import {VaultManagerParamOverrides} from './params.js';
|
|
52
|
+
* @import {BurnDebt, VaultManagerParamValues} from './types.js';
|
|
53
|
+
* @import {MintAndTransfer} from './types.js';
|
|
54
|
+
* @import {VaultFactoryParamPath} from './types.js';
|
|
55
|
+
* @import {GovernedApis} from '@agoric/governance/src/types.js';
|
|
56
|
+
* @import {Brand} from '@agoric/ertp';
|
|
57
|
+
* @import {Amount} from '@agoric/ertp';
|
|
58
|
+
* @import {Issuer} from '@agoric/ertp';
|
|
59
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
60
|
+
* @import {ERef} from '@agoric/vow';
|
|
47
61
|
*/
|
|
48
62
|
|
|
49
63
|
const trace = makeTracer('VD', true);
|
|
@@ -63,13 +77,9 @@ const trace = makeTracer('VD', true);
|
|
|
63
77
|
*
|
|
64
78
|
* @typedef {{
|
|
65
79
|
* burnDebt: BurnDebt;
|
|
66
|
-
* getGovernedParams: (
|
|
67
|
-
* collateralBrand: Brand,
|
|
68
|
-
* ) => import('./vaultManager.js').GovernedParamGetters;
|
|
80
|
+
* getGovernedParams: (collateralBrand: Brand) => GovernedParamGetters;
|
|
69
81
|
* mintAndTransfer: MintAndTransfer;
|
|
70
|
-
* getShortfallReporter: () => Promise<
|
|
71
|
-
* import('../reserve/assetReserve.js').ShortfallReporter
|
|
72
|
-
* >;
|
|
82
|
+
* getShortfallReporter: () => Promise<ShortfallReporter>;
|
|
73
83
|
* }} FactoryPowersFacet
|
|
74
84
|
*
|
|
75
85
|
*
|
|
@@ -77,9 +87,7 @@ const trace = makeTracer('VD', true);
|
|
|
77
87
|
* state: State;
|
|
78
88
|
* }>} MethodContext
|
|
79
89
|
*
|
|
80
|
-
* @typedef {
|
|
81
|
-
* import('./params.js').VaultDirectorParams
|
|
82
|
-
* >} VaultDirectorParamManager
|
|
90
|
+
* @typedef {TypedParamManager<VaultDirectorParams>} VaultDirectorParamManager
|
|
83
91
|
*/
|
|
84
92
|
|
|
85
93
|
const shortfallInvitationKey = 'shortfallInvitation';
|
|
@@ -100,17 +108,16 @@ export const makeAllManagersDo = (collateralManagers, vaultManagers) => {
|
|
|
100
108
|
};
|
|
101
109
|
|
|
102
110
|
/**
|
|
103
|
-
* @param {
|
|
104
|
-
* @param {
|
|
111
|
+
* @param {Baggage} baggage
|
|
112
|
+
* @param {VaultFactoryZCF} zcf
|
|
105
113
|
* @param {VaultDirectorParamManager} directorParamManager
|
|
106
114
|
* @param {ZCFMint<'nat'>} debtMint
|
|
107
|
-
* @param {ERef<
|
|
108
|
-
* @param {
|
|
109
|
-
* @param {
|
|
110
|
-
* @param {
|
|
111
|
-
* @param {
|
|
112
|
-
* @param {
|
|
113
|
-
* @param {Record<string, import('./params.js').VaultManagerParamOverrides>} managerParams
|
|
115
|
+
* @param {ERef<TimerService>} timer
|
|
116
|
+
* @param {ERemote<StorageNode>} storageNode
|
|
117
|
+
* @param {ERemote<EMarshaller>} marshaller
|
|
118
|
+
* @param {MakeRecorderKit} makeRecorderKit
|
|
119
|
+
* @param {MakeERecorderKit} makeERecorderKit
|
|
120
|
+
* @param {Record<string, VaultManagerParamOverrides>} managerParams
|
|
114
121
|
*/
|
|
115
122
|
const prepareVaultDirector = (
|
|
116
123
|
baggage,
|
|
@@ -118,14 +125,13 @@ const prepareVaultDirector = (
|
|
|
118
125
|
directorParamManager,
|
|
119
126
|
debtMint,
|
|
120
127
|
timer,
|
|
121
|
-
auctioneer,
|
|
122
128
|
storageNode,
|
|
123
129
|
marshaller,
|
|
124
130
|
makeRecorderKit,
|
|
125
131
|
makeERecorderKit,
|
|
126
132
|
managerParams,
|
|
127
133
|
) => {
|
|
128
|
-
/** @type {
|
|
134
|
+
/** @type {ShortfallReporter} */
|
|
129
135
|
let shortfallReporter;
|
|
130
136
|
|
|
131
137
|
/** For holding newly minted tokens until transferred */
|
|
@@ -280,14 +286,6 @@ const prepareVaultDirector = (
|
|
|
280
286
|
metrics: makeRecorderTopic('Vault Factory metrics', metricsKit),
|
|
281
287
|
});
|
|
282
288
|
|
|
283
|
-
const allManagersDo = makeAllManagersDo(collateralManagers, vaultManagers);
|
|
284
|
-
|
|
285
|
-
const makeWaker = (name, func) => {
|
|
286
|
-
return Far(name, {
|
|
287
|
-
wake: timestamp => func(timestamp),
|
|
288
|
-
});
|
|
289
|
-
};
|
|
290
|
-
|
|
291
289
|
/** @returns {State} */
|
|
292
290
|
const initState = () => {
|
|
293
291
|
return {};
|
|
@@ -296,7 +294,7 @@ const prepareVaultDirector = (
|
|
|
296
294
|
/**
|
|
297
295
|
* "Director" of the vault factory, overseeing "vault managers".
|
|
298
296
|
*
|
|
299
|
-
* @param {
|
|
297
|
+
* @param {VaultFactoryZCF} zcf
|
|
300
298
|
* @param {VaultDirectorParamManager} directorParamManager
|
|
301
299
|
* @param {ZCFMint<'nat'>} debtMint
|
|
302
300
|
*/
|
|
@@ -313,9 +311,6 @@ const prepareVaultDirector = (
|
|
|
313
311
|
),
|
|
314
312
|
makeCollectFeesInvitation: M.call().returns(M.promise()),
|
|
315
313
|
getRewardAllocation: M.call().returns({ Minted: AmountShape }),
|
|
316
|
-
makePriceLockWaker: M.call().returns(M.remotable('TimerWaker')),
|
|
317
|
-
makeLiquidationWaker: M.call().returns(M.remotable('TimerWaker')),
|
|
318
|
-
makeReschedulerWaker: M.call().returns(M.remotable('TimerWaker')),
|
|
319
314
|
setShortfallReporter: M.call(InvitationShape).returns(M.promise()),
|
|
320
315
|
}),
|
|
321
316
|
public: M.interface('public', {
|
|
@@ -333,7 +328,6 @@ const prepareVaultDirector = (
|
|
|
333
328
|
getPublicTopics: M.call().returns(TopicsRecordShape),
|
|
334
329
|
}),
|
|
335
330
|
helper: M.interface('helper', {
|
|
336
|
-
resetWakeupsForNextAuction: M.call().returns(M.promise()),
|
|
337
331
|
start: M.call().returns(M.promise()),
|
|
338
332
|
}),
|
|
339
333
|
},
|
|
@@ -401,6 +395,7 @@ const prepareVaultDirector = (
|
|
|
401
395
|
// zero-based index of the manager being made
|
|
402
396
|
const managerIndex = vaultManagers.length();
|
|
403
397
|
const managerId = `manager${managerIndex}`;
|
|
398
|
+
/** @type {Remote<StorageNode>} */
|
|
404
399
|
const managerStorageNode =
|
|
405
400
|
await E(managersNode).makeChildNode(managerId);
|
|
406
401
|
|
|
@@ -444,23 +439,6 @@ const prepareVaultDirector = (
|
|
|
444
439
|
return rewardPoolSeat.getCurrentAllocation();
|
|
445
440
|
},
|
|
446
441
|
|
|
447
|
-
makeLiquidationWaker() {
|
|
448
|
-
return makeWaker('liquidationWaker', _timestamp => {
|
|
449
|
-
// XXX floating promise
|
|
450
|
-
allManagersDo(vm => vm.liquidateVaults(auctioneer));
|
|
451
|
-
});
|
|
452
|
-
},
|
|
453
|
-
makeReschedulerWaker() {
|
|
454
|
-
const { facets } = this;
|
|
455
|
-
return makeWaker('reschedulerWaker', () => {
|
|
456
|
-
void facets.helper.resetWakeupsForNextAuction();
|
|
457
|
-
});
|
|
458
|
-
},
|
|
459
|
-
makePriceLockWaker() {
|
|
460
|
-
return makeWaker('priceLockWaker', () => {
|
|
461
|
-
allManagersDo(vm => vm.lockOraclePrices());
|
|
462
|
-
});
|
|
463
|
-
},
|
|
464
442
|
async setShortfallReporter(newInvitation) {
|
|
465
443
|
const zoe = zcf.getZoeService();
|
|
466
444
|
shortfallReporter = await E(
|
|
@@ -513,34 +491,14 @@ const prepareVaultDirector = (
|
|
|
513
491
|
},
|
|
514
492
|
},
|
|
515
493
|
helper: {
|
|
516
|
-
resetWakeupsForNextAuction() {
|
|
517
|
-
const { facets } = this;
|
|
518
|
-
|
|
519
|
-
const priceLockWaker = facets.machine.makePriceLockWaker();
|
|
520
|
-
const liquidationWaker = facets.machine.makeLiquidationWaker();
|
|
521
|
-
const rescheduleWaker = facets.machine.makeReschedulerWaker();
|
|
522
|
-
return setWakeupsForNextAuction(
|
|
523
|
-
auctioneer,
|
|
524
|
-
timer,
|
|
525
|
-
priceLockWaker,
|
|
526
|
-
liquidationWaker,
|
|
527
|
-
rescheduleWaker,
|
|
528
|
-
);
|
|
529
|
-
},
|
|
530
494
|
/** Start non-durable processes (or restart if needed after vat restart) */
|
|
531
495
|
async start() {
|
|
532
|
-
const { helper, machine } = this.facets;
|
|
533
|
-
|
|
534
|
-
await helper.resetWakeupsForNextAuction();
|
|
535
496
|
updateShortfallReporter().catch(err =>
|
|
536
497
|
console.error(
|
|
537
498
|
'🛠️ updateShortfallReporter failed during start(); repair by updating governance',
|
|
538
499
|
err,
|
|
539
500
|
),
|
|
540
501
|
);
|
|
541
|
-
// independent of the other one which can be canceled
|
|
542
|
-
const rescheduleWaker = machine.makeReschedulerWaker();
|
|
543
|
-
void watchForGovernanceChange(auctioneer, timer, rescheduleWaker);
|
|
544
502
|
},
|
|
545
503
|
},
|
|
546
504
|
},
|
|
@@ -1,68 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {ZCF<
|
|
3
|
-
* GovernanceTerms<
|
|
3
|
+
* GovernanceTerms<VaultDirectorParams> & {
|
|
4
4
|
* priceAuthority: ERef<PriceAuthority>;
|
|
5
5
|
* reservePublicFacet: AssetReservePublicFacet;
|
|
6
|
-
* timerService:
|
|
6
|
+
* timerService: TimerService;
|
|
7
7
|
* }
|
|
8
8
|
* >} VaultFactoryZCF
|
|
9
9
|
*/
|
|
10
|
-
/** @type {ContractMeta} */
|
|
11
|
-
export const meta: ContractMeta
|
|
10
|
+
/** @type {ContractMeta<typeof start>} */
|
|
11
|
+
export const meta: ContractMeta<typeof start>;
|
|
12
12
|
export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
13
13
|
feeMintAccess: FeeMintAccess;
|
|
14
14
|
initialPoserInvitation: Invitation;
|
|
15
15
|
initialShortfallInvitation: Invitation;
|
|
16
|
-
storageNode:
|
|
17
|
-
marshaller:
|
|
18
|
-
|
|
19
|
-
timerService: import("@agoric/time").TimerService;
|
|
20
|
-
reservePublicFacet: AssetReservePublicFacet;
|
|
21
|
-
priceAuthority: PriceAuthority;
|
|
22
|
-
}>, privateArgs: {
|
|
23
|
-
initialPoserInvitation: Invitation;
|
|
24
|
-
storageNode: StorageNode;
|
|
25
|
-
marshaller: Marshaller;
|
|
26
|
-
}, baggage: Baggage) => Promise<{
|
|
27
|
-
publicFacet: globalThis.GovernedPublicFacet<{
|
|
28
|
-
getElectorate: () => import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
29
|
-
getStartFrequency: () => RelativeTime;
|
|
30
|
-
getClockStep: () => RelativeTime;
|
|
31
|
-
getStartingRate: () => bigint;
|
|
32
|
-
getLowestRate: () => bigint;
|
|
33
|
-
getDiscountStep: () => bigint;
|
|
34
|
-
getAuctionStartDelay: () => RelativeTime;
|
|
35
|
-
getPriceLockPeriod: () => RelativeTime;
|
|
36
|
-
makeBidInvitation(collateralBrand: Brand<"nat">): Promise<Invitation<string, import("../auction/auctionBook.js").OfferSpec>>;
|
|
37
|
-
getSchedules(): {
|
|
38
|
-
liveAuctionSchedule: import("../auction/scheduler.js").Schedule | null;
|
|
39
|
-
nextAuctionSchedule: import("../auction/scheduler.js").Schedule | null;
|
|
40
|
-
};
|
|
41
|
-
getScheduleUpdates(): globalThis.Subscriber<import("../auction/scheduler.js").ScheduleNotification>;
|
|
42
|
-
getBookDataUpdates(brand: any): globalThis.Subscriber<import("../auction/auctionBook.js").BookDataNotification>;
|
|
43
|
-
getPublicTopics(brand: any): {
|
|
44
|
-
bookData: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("../auction/auctionBook.js").BookDataNotification>;
|
|
45
|
-
} | {
|
|
46
|
-
schedule: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("../auction/scheduler.js").ScheduleNotification>;
|
|
47
|
-
};
|
|
48
|
-
makeDepositInvitation: () => Promise<Invitation<string, {
|
|
49
|
-
goal: Amount<"nat">;
|
|
50
|
-
}>>;
|
|
51
|
-
}>;
|
|
52
|
-
creatorFacet: globalThis.GovernedCreatorFacet<{
|
|
53
|
-
addBrand(issuer: Issuer<"nat">, kwd: Keyword): Promise<void>;
|
|
54
|
-
getSchedule(): Promise<import("../auction/scheduler.js").FullSchedule>;
|
|
55
|
-
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
56
|
-
addBrand(issuer: Issuer<"nat">, kwd: Keyword): Promise<void>;
|
|
57
|
-
getSchedule(): Promise<import("../auction/scheduler.js").FullSchedule>;
|
|
58
|
-
}>>;
|
|
59
|
-
}>>;
|
|
60
|
-
managerParams: Record<string, import("./params.js").VaultManagerParamOverrides>;
|
|
16
|
+
storageNode: Remote<StorageNode>;
|
|
17
|
+
marshaller: Remote<Marshaller>;
|
|
18
|
+
managerParams: Record<string, VaultManagerParamOverrides>;
|
|
61
19
|
directorParamOverrides: [object];
|
|
62
|
-
}, baggage:
|
|
20
|
+
}, baggage: Baggage): Promise<{
|
|
63
21
|
creatorFacet: import("@endo/exo").Guarded<{
|
|
64
22
|
getParamMgrRetriever: () => {
|
|
65
|
-
get: (paramPath?: VaultFactoryParamPath) => import("./vaultDirector.js").VaultDirectorParamManager | import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
23
|
+
get: (paramPath?: import("./types.js").VaultFactoryParamPath) => import("./vaultDirector.js").VaultDirectorParamManager | import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
66
24
|
DebtLimit: "amount";
|
|
67
25
|
InterestRate: "ratio";
|
|
68
26
|
LiquidationPadding: "ratio";
|
|
@@ -70,8 +28,8 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
70
28
|
LiquidationPenalty: "ratio";
|
|
71
29
|
MintFee: "ratio";
|
|
72
30
|
}>;
|
|
73
|
-
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
74
|
-
get: (paramPath?: VaultFactoryParamPath) => import("./vaultDirector.js").VaultDirectorParamManager | import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
31
|
+
} & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
32
|
+
get: (paramPath?: import("./types.js").VaultFactoryParamPath) => import("./vaultDirector.js").VaultDirectorParamManager | import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
75
33
|
DebtLimit: "amount";
|
|
76
34
|
InterestRate: "ratio";
|
|
77
35
|
LiquidationPadding: "ratio";
|
|
@@ -82,13 +40,13 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
82
40
|
}>;
|
|
83
41
|
getInvitation(name: string): Promise<Invitation>;
|
|
84
42
|
getLimitedCreatorFacet(): import("@endo/exo").Guarded<{
|
|
85
|
-
addVaultType(collateralIssuer: Issuer<"nat">, collateralKeyword: Keyword, initialParamValues: VaultManagerParamValues): Promise<import("@endo/exo").Guarded<{
|
|
43
|
+
addVaultType(collateralIssuer: import("@agoric/ertp").Issuer<"nat">, collateralKeyword: import("@agoric/zoe").Keyword, initialParamValues: import("./types.js").VaultManagerParamValues): Promise<import("@endo/exo").Guarded<{
|
|
86
44
|
getGovernedParams(): import("./vaultManager.js").GovernedParamGetters;
|
|
87
45
|
makeVaultKit(seat: ZCFSeat): Promise<{
|
|
88
46
|
publicSubscribers: {
|
|
89
47
|
vault: {
|
|
90
48
|
description: string;
|
|
91
|
-
subscriber:
|
|
49
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
92
50
|
storagePath: Promise<string>;
|
|
93
51
|
};
|
|
94
52
|
};
|
|
@@ -101,7 +59,7 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
101
59
|
getPublicTopics(): {
|
|
102
60
|
vault: {
|
|
103
61
|
description: string;
|
|
104
|
-
subscriber:
|
|
62
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
105
63
|
storagePath: Promise<string>;
|
|
106
64
|
};
|
|
107
65
|
};
|
|
@@ -112,7 +70,7 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
112
70
|
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
113
71
|
getNormalizedDebt(): import("./storeUtils.js").NormalizedDebt;
|
|
114
72
|
}>;
|
|
115
|
-
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
73
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
116
74
|
}>;
|
|
117
75
|
getCollateralQuote(): PriceQuote;
|
|
118
76
|
getPublicFacet(): import("@endo/exo").Guarded<{
|
|
@@ -120,7 +78,7 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
120
78
|
publicSubscribers: {
|
|
121
79
|
vault: {
|
|
122
80
|
description: string;
|
|
123
|
-
subscriber:
|
|
81
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
124
82
|
storagePath: Promise<string>;
|
|
125
83
|
};
|
|
126
84
|
};
|
|
@@ -133,7 +91,7 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
133
91
|
getPublicTopics(): {
|
|
134
92
|
vault: {
|
|
135
93
|
description: string;
|
|
136
|
-
subscriber:
|
|
94
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
137
95
|
storagePath: Promise<string>;
|
|
138
96
|
};
|
|
139
97
|
};
|
|
@@ -144,48 +102,32 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
144
102
|
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
145
103
|
getNormalizedDebt(): import("./storeUtils.js").NormalizedDebt;
|
|
146
104
|
}>;
|
|
147
|
-
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
105
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
148
106
|
}, undefined>>;
|
|
149
107
|
getQuotes(): import("@agoric/notifier").StoredNotifier<PriceQuote>;
|
|
150
|
-
getCompoundedInterest(): Ratio;
|
|
108
|
+
getCompoundedInterest(): import("@agoric/ertp").Ratio;
|
|
151
109
|
getPublicTopics(): {
|
|
152
110
|
asset: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./vaultManager.js").AssetState>;
|
|
153
111
|
metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./vaultManager.js").MetricsNotification>;
|
|
154
112
|
};
|
|
155
113
|
}>;
|
|
156
114
|
lockOraclePrices(): PriceQuote;
|
|
157
|
-
liquidateVaults(auctionPF: ERef<AuctioneerPublicFacet>): Promise<void>;
|
|
158
115
|
}>>;
|
|
159
116
|
makeCollectFeesInvitation(): Promise<Invitation<string>>;
|
|
160
|
-
getRewardAllocation(): Allocation;
|
|
161
|
-
makeLiquidationWaker(): {
|
|
162
|
-
wake: (timestamp: any) => any;
|
|
163
|
-
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
164
|
-
wake: (timestamp: any) => any;
|
|
165
|
-
}>;
|
|
166
|
-
makeReschedulerWaker(): {
|
|
167
|
-
wake: (timestamp: any) => any;
|
|
168
|
-
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
169
|
-
wake: (timestamp: any) => any;
|
|
170
|
-
}>;
|
|
171
|
-
makePriceLockWaker(): {
|
|
172
|
-
wake: (timestamp: any) => any;
|
|
173
|
-
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
174
|
-
wake: (timestamp: any) => any;
|
|
175
|
-
}>;
|
|
117
|
+
getRewardAllocation(): import("@agoric/zoe").Allocation;
|
|
176
118
|
setShortfallReporter(newInvitation: any): Promise<void>;
|
|
177
119
|
}>;
|
|
178
|
-
getGovernedApis(): ERef<GovernedApis>;
|
|
120
|
+
getGovernedApis(): ERef<import("@agoric/governance").GovernedApis>;
|
|
179
121
|
getGovernedApiNames(): never[];
|
|
180
122
|
setOfferFilter: (strings: any) => Promise<void>;
|
|
181
123
|
}>;
|
|
182
124
|
publicFacet: import("@endo/exo").Guarded<{
|
|
183
|
-
getCollateralManager(brandIn: Brand): import("@endo/exo").Guarded<{
|
|
125
|
+
getCollateralManager(brandIn: import("@agoric/ertp").Brand): import("@endo/exo").Guarded<{
|
|
184
126
|
makeVaultInvitation(): Promise<Invitation<{
|
|
185
127
|
publicSubscribers: {
|
|
186
128
|
vault: {
|
|
187
129
|
description: string;
|
|
188
|
-
subscriber:
|
|
130
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
189
131
|
storagePath: Promise<string>;
|
|
190
132
|
};
|
|
191
133
|
};
|
|
@@ -198,7 +140,7 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
198
140
|
getPublicTopics(): {
|
|
199
141
|
vault: {
|
|
200
142
|
description: string;
|
|
201
|
-
subscriber:
|
|
143
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
202
144
|
storagePath: Promise<string>;
|
|
203
145
|
};
|
|
204
146
|
};
|
|
@@ -209,42 +151,52 @@ export function start(zcf: VaultFactoryZCF, privateArgs: {
|
|
|
209
151
|
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
210
152
|
getNormalizedDebt(): import("./storeUtils.js").NormalizedDebt;
|
|
211
153
|
}>;
|
|
212
|
-
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<VaultNotification>;
|
|
154
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
213
155
|
}, undefined>>;
|
|
214
156
|
getQuotes(): import("@agoric/notifier").StoredNotifier<PriceQuote>;
|
|
215
|
-
getCompoundedInterest(): Ratio;
|
|
157
|
+
getCompoundedInterest(): import("@agoric/ertp").Ratio;
|
|
216
158
|
getPublicTopics(): {
|
|
217
159
|
asset: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./vaultManager.js").AssetState>;
|
|
218
160
|
metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./vaultManager.js").MetricsNotification>;
|
|
219
161
|
};
|
|
220
162
|
}>;
|
|
221
|
-
getDebtIssuer():
|
|
163
|
+
getDebtIssuer(): import("@agoric/ertp").Issuer<"nat", import("@endo/patterns").Key>;
|
|
222
164
|
getSubscription({ collateralBrand }: {
|
|
223
|
-
collateralBrand: Brand;
|
|
224
|
-
}):
|
|
165
|
+
collateralBrand: import("@agoric/ertp").Brand;
|
|
166
|
+
}): import("@agoric/notifier").StoredSubscription<import("@agoric/governance").GovernanceSubscriptionState>;
|
|
225
167
|
getPublicTopics(): {
|
|
226
168
|
metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./vaultDirector.js").MetricsNotification>;
|
|
227
169
|
};
|
|
228
|
-
getElectorateSubscription():
|
|
170
|
+
getElectorateSubscription(): import("@agoric/notifier").StoredSubscription<import("@agoric/governance").GovernanceSubscriptionState>;
|
|
229
171
|
getGovernedParams({ collateralBrand }: {
|
|
230
|
-
collateralBrand: Brand;
|
|
231
|
-
}):
|
|
232
|
-
getDirectorGovernedParams():
|
|
172
|
+
collateralBrand: import("@agoric/ertp").Brand;
|
|
173
|
+
}): ERef<import("@agoric/governance").ParamStateRecord>;
|
|
174
|
+
getDirectorGovernedParams(): ERef<import("@agoric/governance").ParamStateRecord>;
|
|
233
175
|
getInvitationAmount(name: string): import("@agoric/ertp").SetAmount<import("@agoric/zoe").InvitationDetails>;
|
|
234
176
|
}>;
|
|
235
177
|
}>;
|
|
236
|
-
export type VaultFactoryZCF = ZCF<GovernanceTerms<
|
|
178
|
+
export type VaultFactoryZCF = ZCF<GovernanceTerms<VaultDirectorParams> & {
|
|
237
179
|
priceAuthority: ERef<PriceAuthority>;
|
|
238
180
|
reservePublicFacet: AssetReservePublicFacet;
|
|
239
|
-
timerService:
|
|
181
|
+
timerService: TimerService;
|
|
240
182
|
}>;
|
|
241
183
|
export type VaultFactoryContract = ContractOf<typeof start>;
|
|
242
184
|
import type { ContractMeta } from '@agoric/zoe';
|
|
243
185
|
import type { FeeMintAccess } from '@agoric/zoe';
|
|
244
186
|
import type { Invitation } from '@agoric/zoe';
|
|
245
|
-
import type {
|
|
246
|
-
import type {
|
|
187
|
+
import type { StorageNode } from '@agoric/internal/src/lib-chainStorage.js';
|
|
188
|
+
import type { Remote } from '@agoric/internal';
|
|
189
|
+
import type { Marshaller } from '@agoric/internal/src/lib-chainStorage.js';
|
|
190
|
+
import type { VaultManagerParamOverrides } from './params.js';
|
|
191
|
+
import type { Baggage } from '@agoric/swingset-liveslots';
|
|
247
192
|
import type { ZCFSeat } from '@agoric/zoe';
|
|
248
193
|
import type { PriceQuote } from '@agoric/zoe/tools/types.js';
|
|
194
|
+
import type { ERef } from '@agoric/vow';
|
|
195
|
+
import type { VaultDirectorParams } from './params.js';
|
|
196
|
+
import type { GovernanceTerms } from '@agoric/governance/src/types.js';
|
|
197
|
+
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
198
|
+
import type { AssetReservePublicFacet } from '../reserve/assetReserve.js';
|
|
199
|
+
import type { TimerService } from '@agoric/time';
|
|
200
|
+
import type { ZCF } from '@agoric/zoe';
|
|
249
201
|
import type { ContractOf } from '@agoric/zoe/src/zoeService/utils.js';
|
|
250
202
|
//# sourceMappingURL=vaultFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vaultFactory.d.ts","sourceRoot":"","sources":["vaultFactory.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vaultFactory.d.ts","sourceRoot":"","sources":["vaultFactory.js"],"names":[],"mappings":"AA6CA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAgBnC;AAgBK,2BAZI,eAAe,eACf;IACN,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,UAAU,CAAC;IACnC,0BAA0B,EAAE,UAAU,CAAC;IACvC,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAC1D,sBAAsB,EAAE,CAAC,MAAM,CAAC,CAAC;CAClC,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFjB;8BA1HY,IACZ,gBAAoB,mBAAmB,CAAC,GAAG;IACrC,cAAc,EAAE,KAAK,cAAc,CAAC,CAAC;IACrC,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B,CACF;mCAuHU,WAAW,OAAO,KAAK,CAAC;kCA9IoF,aAAa;mCAAb,aAAa;gCAAb,aAAa;iCASzG,0CAA0C;4BAV/C,kBAAkB;gCAWd,0CAA0C;gDAJ1B,aAAa;6BAChC,4BAA4B;6BAPoE,aAAa;gCAE1C,4BAA4B;0BASlG,aAAa;yCARE,aAAa;qCAKjB,iCAAiC;oCAN0B,4BAA4B;6CAG/E,4BAA4B;kCADvC,cAAc;yBAJ6E,aAAa;gCAC1G,qCAAqC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
/// <reference types="@agoric/governance/exported" />
|
|
3
|
-
/// <reference types="@agoric/zoe/exported" />
|
|
4
|
-
|
|
5
1
|
// The vaultFactory owns a number of VaultManagers and a mint for Minted.
|
|
6
2
|
//
|
|
7
3
|
// addVaultType is a closely held method that adds a brand new collateral type.
|
|
@@ -19,36 +15,47 @@ import { CONTRACT_ELECTORATE } from '@agoric/governance';
|
|
|
19
15
|
import { makeParamManagerFromTerms } from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
20
16
|
import { validateElectorate } from '@agoric/governance/src/contractHelper.js';
|
|
21
17
|
import { makeTracer, StorageNodeShape } from '@agoric/internal';
|
|
18
|
+
import { wrapRemoteMarshaller } from '@agoric/internal/src/marshal/wrap-marshaller.js';
|
|
22
19
|
import { makeStoredSubscription, makeSubscriptionKit } from '@agoric/notifier';
|
|
23
20
|
import { M } from '@agoric/store';
|
|
24
21
|
import { provideAll } from '@agoric/zoe/src/contractSupport/durability.js';
|
|
25
22
|
import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
26
23
|
import { E } from '@endo/eventual-send';
|
|
27
24
|
import { FeeMintAccessShape } from '@agoric/zoe/src/typeGuards.js';
|
|
28
|
-
import { InvitationShape } from '../auction/params.js';
|
|
29
25
|
import { SHORTFALL_INVITATION_KEY, vaultDirectorParamTypes } from './params.js';
|
|
30
26
|
import { provideDirector } from './vaultDirector.js';
|
|
31
27
|
|
|
32
28
|
/**
|
|
29
|
+
* @import {Remote} from '@agoric/internal';
|
|
33
30
|
* @import {ContractMeta, FeeMintAccess, HandleOffer, Invitation, OfferHandler, TransferPart, ZCF, ZCFMint, ZCFSeat} from '@agoric/zoe';
|
|
34
31
|
* @import {ContractOf} from '@agoric/zoe/src/zoeService/utils.js';
|
|
35
32
|
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
33
|
+
* @import {VaultDirectorParams} from './params.js';
|
|
34
|
+
* @import {TimerService} from '@agoric/time';
|
|
35
|
+
* @import {AssetReservePublicFacet} from '../reserve/assetReserve.js';
|
|
36
|
+
* @import {VaultManagerParamOverrides} from './params.js';
|
|
37
|
+
* @import {Baggage} from '@agoric/swingset-liveslots';
|
|
38
|
+
* @import {GovernanceTerms} from '@agoric/governance/src/types.js';
|
|
39
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
40
|
+
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js';
|
|
41
|
+
* @import {ERef} from '@agoric/vow';
|
|
36
42
|
*/
|
|
37
43
|
|
|
38
44
|
const trace = makeTracer('VF', true);
|
|
39
45
|
|
|
40
46
|
/**
|
|
41
47
|
* @typedef {ZCF<
|
|
42
|
-
* GovernanceTerms<
|
|
48
|
+
* GovernanceTerms<VaultDirectorParams> & {
|
|
43
49
|
* priceAuthority: ERef<PriceAuthority>;
|
|
44
50
|
* reservePublicFacet: AssetReservePublicFacet;
|
|
45
|
-
* timerService:
|
|
51
|
+
* timerService: TimerService;
|
|
46
52
|
* }
|
|
47
53
|
* >} VaultFactoryZCF
|
|
48
54
|
*/
|
|
49
55
|
|
|
50
|
-
/** @type {ContractMeta} */
|
|
56
|
+
/** @type {ContractMeta<typeof start>} */
|
|
51
57
|
export const meta = {
|
|
58
|
+
// @ts-expect-error splitRecord loses the property keys
|
|
52
59
|
privateArgsShape: M.splitRecord(
|
|
53
60
|
{
|
|
54
61
|
marshaller: M.remotable('Marshaller'),
|
|
@@ -57,8 +64,8 @@ export const meta = {
|
|
|
57
64
|
{
|
|
58
65
|
// only necessary on first invocation, not subsequent
|
|
59
66
|
feeMintAccess: FeeMintAccessShape,
|
|
60
|
-
initialPoserInvitation:
|
|
61
|
-
initialShortfallInvitation:
|
|
67
|
+
initialPoserInvitation: M.any(),
|
|
68
|
+
initialShortfallInvitation: M.any(),
|
|
62
69
|
},
|
|
63
70
|
),
|
|
64
71
|
upgradability: 'canUpgrade',
|
|
@@ -71,29 +78,26 @@ harden(meta);
|
|
|
71
78
|
* feeMintAccess: FeeMintAccess;
|
|
72
79
|
* initialPoserInvitation: Invitation;
|
|
73
80
|
* initialShortfallInvitation: Invitation;
|
|
74
|
-
* storageNode:
|
|
75
|
-
* marshaller:
|
|
76
|
-
*
|
|
77
|
-
* managerParams: Record<
|
|
78
|
-
* string,
|
|
79
|
-
* import('./params.js').VaultManagerParamOverrides
|
|
80
|
-
* >;
|
|
81
|
+
* storageNode: Remote<StorageNode>;
|
|
82
|
+
* marshaller: Remote<Marshaller>;
|
|
83
|
+
* managerParams: Record<string, VaultManagerParamOverrides>;
|
|
81
84
|
* directorParamOverrides: [object];
|
|
82
85
|
* }} privateArgs
|
|
83
|
-
* @param {
|
|
86
|
+
* @param {Baggage} baggage
|
|
84
87
|
*/
|
|
85
88
|
export const start = async (zcf, privateArgs, baggage) => {
|
|
86
89
|
trace('prepare start', privateArgs, [...baggage.keys()]);
|
|
87
90
|
const {
|
|
88
91
|
initialPoserInvitation,
|
|
89
92
|
initialShortfallInvitation,
|
|
90
|
-
marshaller,
|
|
93
|
+
marshaller: remoteMarshaller,
|
|
91
94
|
storageNode,
|
|
92
|
-
auctioneerInstance,
|
|
93
95
|
managerParams,
|
|
94
96
|
directorParamOverrides,
|
|
95
97
|
} = privateArgs;
|
|
96
98
|
|
|
99
|
+
const cachingMarshaller = wrapRemoteMarshaller(remoteMarshaller);
|
|
100
|
+
|
|
97
101
|
trace('awaiting debtMint');
|
|
98
102
|
const { debtMint } = await provideAll(baggage, {
|
|
99
103
|
debtMint: () => zcf.registerFeeMint('Minted', privateArgs.feeMintAccess),
|
|
@@ -105,12 +109,9 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
105
109
|
|
|
106
110
|
const { timerService } = zcf.getTerms();
|
|
107
111
|
|
|
108
|
-
const zoe = zcf.getZoeService();
|
|
109
|
-
const auctioneerPublicFacet = E(zoe).getPublicFacet(auctioneerInstance);
|
|
110
|
-
|
|
111
112
|
const { makeRecorderKit, makeERecorderKit } = prepareRecorderKitMakers(
|
|
112
113
|
baggage,
|
|
113
|
-
|
|
114
|
+
cachingMarshaller,
|
|
114
115
|
);
|
|
115
116
|
|
|
116
117
|
trace('making non-durable publishers');
|
|
@@ -120,7 +121,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
120
121
|
const governanceSubscriber = makeStoredSubscription(
|
|
121
122
|
governanceSubscriptionKit.subscription,
|
|
122
123
|
governanceNode,
|
|
123
|
-
|
|
124
|
+
cachingMarshaller,
|
|
124
125
|
);
|
|
125
126
|
/** a powerful object; can modify the invitation */
|
|
126
127
|
const vaultDirectorParamManager = await makeParamManagerFromTerms(
|
|
@@ -143,10 +144,9 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
143
144
|
vaultDirectorParamManager,
|
|
144
145
|
debtMint,
|
|
145
146
|
timerService,
|
|
146
|
-
auctioneerPublicFacet,
|
|
147
147
|
storageNode,
|
|
148
148
|
// XXX remove Recorder makers; remove once we excise deprecated kits for governance
|
|
149
|
-
|
|
149
|
+
cachingMarshaller,
|
|
150
150
|
makeRecorderKit,
|
|
151
151
|
makeERecorderKit,
|
|
152
152
|
managerParams,
|