@agoric/inter-protocol 0.16.2-dev-857e650.0 → 0.16.2-dev-fb922d3.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/bundles/bundle-auctioneer-js-meta.json +181 -181
- package/bundles/bundle-auctioneer.js +1 -1
- package/bundles/bundle-econCommitteeCharter-js-meta.json +129 -129
- package/bundles/bundle-econCommitteeCharter.js +1 -1
- package/bundles/bundle-feeDistributor-js-meta.json +115 -115
- package/bundles/bundle-feeDistributor.js +1 -1
- package/bundles/bundle-fluxAggregatorKit-js-meta.json +169 -169
- package/bundles/bundle-fluxAggregatorKit.js +1 -1
- package/bundles/bundle-psm-js-meta.json +167 -167
- package/bundles/bundle-psm.js +1 -1
- package/bundles/bundle-reserve-js-meta.json +169 -169
- package/bundles/bundle-reserve.js +1 -1
- package/bundles/bundle-scaledPriceAuthority-js-meta.json +142 -142
- package/bundles/bundle-scaledPriceAuthority.js +1 -1
- package/bundles/bundle-vaultFactory-js-meta.json +200 -200
- package/bundles/bundle-vaultFactory.js +1 -1
- package/package.json +17 -17
- package/scripts/deploy-contracts.js +12 -2
- package/scripts/init-core.js +5 -6
- package/scripts/manual-price-feed.js +20 -15
- package/src/auction/auctionBook.d.ts +16 -13
- package/src/auction/auctionBook.d.ts.map +1 -1
- package/src/auction/auctionBook.js +68 -56
- package/src/auction/auctioneer.d.ts.map +1 -1
- package/src/auction/auctioneer.js +54 -42
- package/src/auction/offerBook.d.ts.map +1 -1
- package/src/auction/offerBook.js +12 -11
- package/src/auction/params.d.ts +1 -1
- package/src/auction/params.d.ts.map +1 -1
- package/src/auction/params.js +3 -5
- package/src/auction/scheduleMath.d.ts.map +1 -1
- package/src/auction/scheduleMath.js +13 -13
- package/src/auction/scheduler.d.ts +4 -4
- package/src/auction/scheduler.d.ts.map +1 -1
- package/src/auction/scheduler.js +20 -20
- package/src/auction/sortedOffers.d.ts.map +1 -1
- package/src/auction/sortedOffers.js +8 -7
- package/src/auction/util.d.ts +1 -1
- package/src/auction/util.js +4 -4
- package/src/clientSupport.d.ts +65 -27
- package/src/clientSupport.d.ts.map +1 -1
- package/src/clientSupport.js +92 -34
- package/src/contractSupport.js +5 -5
- package/src/econCommitteeCharter.d.ts +4 -6
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/econCommitteeCharter.js +7 -11
- package/src/feeDistributor.d.ts +8 -24
- package/src/feeDistributor.d.ts.map +1 -1
- package/src/feeDistributor.js +26 -28
- package/src/interest.d.ts +1 -0
- package/src/interest.d.ts.map +1 -1
- package/src/interest.js +22 -15
- package/src/price/fluxAggregatorContract.d.ts +1 -0
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.js +24 -19
- package/src/price/fluxAggregatorKit.d.ts +23 -18
- package/src/price/fluxAggregatorKit.d.ts.map +1 -1
- package/src/price/fluxAggregatorKit.js +47 -32
- package/src/price/priceOracleKit.d.ts +2 -8
- package/src/price/priceOracleKit.d.ts.map +1 -1
- package/src/price/priceOracleKit.js +11 -13
- package/src/price/roundsManager.d.ts +28 -46
- package/src/price/roundsManager.d.ts.map +1 -1
- package/src/price/roundsManager.js +51 -63
- package/src/proposals/committee-proposal.d.ts.map +1 -1
- package/src/proposals/committee-proposal.js +5 -9
- package/src/proposals/core-proposal.d.ts.map +1 -1
- package/src/proposals/core-proposal.js +3 -5
- package/src/proposals/econ-behaviors.d.ts.map +1 -1
- package/src/proposals/econ-behaviors.js +55 -28
- package/src/proposals/price-feed-proposal.d.ts.map +1 -1
- package/src/proposals/price-feed-proposal.js +30 -11
- package/src/proposals/startPSM.d.ts.map +1 -1
- package/src/proposals/startPSM.js +24 -17
- package/src/proposals/utils.d.ts +1 -1
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +26 -7
- package/src/psm/psm.d.ts +14 -22
- package/src/psm/psm.d.ts.map +1 -1
- package/src/psm/psm.js +34 -31
- package/src/reserve/assetReserve.d.ts.map +1 -1
- package/src/reserve/assetReserve.js +16 -13
- package/src/reserve/assetReserveKit.d.ts +14 -26
- package/src/reserve/assetReserveKit.d.ts.map +1 -1
- package/src/reserve/assetReserveKit.js +13 -21
- package/src/tokens.d.ts +3 -3
- package/src/tokens.d.ts.map +1 -1
- package/src/tokens.js +5 -5
- package/src/typeGuards.d.ts +1 -3
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +1 -3
- package/src/vaultFactory/liquidation.d.ts.map +1 -1
- package/src/vaultFactory/liquidation.js +29 -16
- package/src/vaultFactory/math.d.ts.map +1 -1
- package/src/vaultFactory/math.js +8 -9
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -1
- package/src/vaultFactory/orderedVaultStore.js +6 -9
- package/src/vaultFactory/params.d.ts +1 -4
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/params.js +24 -18
- package/src/vaultFactory/prioritizedVaults.js +2 -2
- package/src/vaultFactory/proceeds.d.ts +3 -3
- package/src/vaultFactory/proceeds.d.ts.map +1 -1
- package/src/vaultFactory/proceeds.js +24 -18
- package/src/vaultFactory/storeUtils.d.ts +2 -6
- package/src/vaultFactory/storeUtils.d.ts.map +1 -1
- package/src/vaultFactory/storeUtils.js +8 -12
- package/src/vaultFactory/types.d.ts +16 -11
- package/src/vaultFactory/types.d.ts.map +1 -1
- package/src/vaultFactory/types.js +37 -27
- package/src/vaultFactory/vault.d.ts +103 -159
- package/src/vaultFactory/vault.d.ts.map +1 -1
- package/src/vaultFactory/vault.js +84 -85
- package/src/vaultFactory/vaultDirector.d.ts +21 -43
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultDirector.js +30 -40
- package/src/vaultFactory/vaultFactory.d.ts +8 -6
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultFactory.js +13 -11
- package/src/vaultFactory/vaultHolder.d.ts +12 -16
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
- package/src/vaultFactory/vaultHolder.js +7 -12
- package/src/vaultFactory/vaultKit.d.ts +1 -1
- package/src/vaultFactory/vaultKit.d.ts.map +1 -1
- package/src/vaultFactory/vaultKit.js +3 -2
- package/src/vaultFactory/vaultManager.d.ts +454 -68
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +120 -110
|
@@ -44,30 +44,34 @@ const trace = makeTracer('VD', true);
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* @typedef {{
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* collaterals: Brand[];
|
|
48
|
+
* rewardPoolAllocation: AmountKeywordRecord;
|
|
49
49
|
* }} MetricsNotification
|
|
50
50
|
*
|
|
51
|
-
* @typedef {Readonly<{
|
|
52
|
-
* }>} ImmutableState
|
|
51
|
+
* @typedef {Readonly<{}>} ImmutableState
|
|
53
52
|
*
|
|
54
|
-
* @typedef {{
|
|
55
|
-
* }} MutableState
|
|
53
|
+
* @typedef {{}} MutableState
|
|
56
54
|
*
|
|
57
55
|
* @typedef {ImmutableState & MutableState} State
|
|
58
56
|
*
|
|
59
57
|
* @typedef {{
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
58
|
+
* burnDebt: BurnDebt;
|
|
59
|
+
* getGovernedParams: (
|
|
60
|
+
* collateralBrand: Brand,
|
|
61
|
+
* ) => import('./vaultManager.js').GovernedParamGetters;
|
|
62
|
+
* mintAndTransfer: MintAndTransfer;
|
|
63
|
+
* getShortfallReporter: () => Promise<
|
|
64
|
+
* import('../reserve/assetReserve.js').ShortfallReporter
|
|
65
|
+
* >;
|
|
64
66
|
* }} FactoryPowersFacet
|
|
65
67
|
*
|
|
66
68
|
* @typedef {Readonly<{
|
|
67
69
|
* state: State;
|
|
68
70
|
* }>} MethodContext
|
|
69
71
|
*
|
|
70
|
-
* @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager').TypedParamManager<
|
|
72
|
+
* @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager').TypedParamManager<
|
|
73
|
+
* import('./params.js').VaultDirectorParams
|
|
74
|
+
* >} VaultDirectorParamManager
|
|
71
75
|
*/
|
|
72
76
|
|
|
73
77
|
const shortfallInvitationKey = 'shortfallInvitation';
|
|
@@ -76,7 +80,7 @@ const shortfallInvitationKey = 'shortfallInvitation';
|
|
|
76
80
|
* @param {import('@agoric/ertp').Baggage} baggage
|
|
77
81
|
* @param {import('./vaultFactory.js').VaultFactoryZCF} zcf
|
|
78
82
|
* @param {VaultDirectorParamManager} directorParamManager
|
|
79
|
-
* @param {ZCFMint<
|
|
83
|
+
* @param {ZCFMint<'nat'>} debtMint
|
|
80
84
|
* @param {ERef<import('@agoric/time/src/types').TimerService>} timer
|
|
81
85
|
* @param {ERef<import('../auction/auctioneer.js').AuctioneerPublicFacet>} auctioneer
|
|
82
86
|
* @param {ERef<StorageNode>} storageNode
|
|
@@ -126,9 +130,7 @@ const prepareVaultDirector = (
|
|
|
126
130
|
|
|
127
131
|
const managersNode = E(storageNode).makeChildNode('managers');
|
|
128
132
|
|
|
129
|
-
/**
|
|
130
|
-
* @returns {MetricsNotification}
|
|
131
|
-
*/
|
|
133
|
+
/** @returns {MetricsNotification} */
|
|
132
134
|
const sampleMetrics = () => {
|
|
133
135
|
return harden({
|
|
134
136
|
collaterals: Array.from(collateralManagers.keys()),
|
|
@@ -188,8 +190,8 @@ const prepareVaultDirector = (
|
|
|
188
190
|
},
|
|
189
191
|
|
|
190
192
|
/**
|
|
191
|
-
* Let the manager add rewards to the rewardPoolSeat without
|
|
192
|
-
*
|
|
193
|
+
* Let the manager add rewards to the rewardPoolSeat without exposing the
|
|
194
|
+
* rewardPoolSeat to them.
|
|
193
195
|
*
|
|
194
196
|
* @type {MintAndTransfer}
|
|
195
197
|
*/
|
|
@@ -264,9 +266,7 @@ const prepareVaultDirector = (
|
|
|
264
266
|
});
|
|
265
267
|
};
|
|
266
268
|
|
|
267
|
-
/**
|
|
268
|
-
* @returns {State}
|
|
269
|
-
*/
|
|
269
|
+
/** @returns {State} */
|
|
270
270
|
const initState = () => {
|
|
271
271
|
return {};
|
|
272
272
|
};
|
|
@@ -276,7 +276,7 @@ const prepareVaultDirector = (
|
|
|
276
276
|
*
|
|
277
277
|
* @param {import('./vaultFactory.js').VaultFactoryZCF} zcf
|
|
278
278
|
* @param {VaultDirectorParamManager} directorParamManager
|
|
279
|
-
* @param {ZCFMint<
|
|
279
|
+
* @param {ZCFMint<'nat'>} debtMint
|
|
280
280
|
*/
|
|
281
281
|
const makeVaultDirector = prepareExoClassKit(
|
|
282
282
|
baggage,
|
|
@@ -331,9 +331,7 @@ const prepareVaultDirector = (
|
|
|
331
331
|
}
|
|
332
332
|
},
|
|
333
333
|
}),
|
|
334
|
-
/**
|
|
335
|
-
* @param {string} name
|
|
336
|
-
*/
|
|
334
|
+
/** @param {string} name */
|
|
337
335
|
getInvitation(name) {
|
|
338
336
|
return directorParamManager.getInternalParamValue(name);
|
|
339
337
|
},
|
|
@@ -442,9 +440,7 @@ const prepareVaultDirector = (
|
|
|
442
440
|
},
|
|
443
441
|
},
|
|
444
442
|
public: {
|
|
445
|
-
/**
|
|
446
|
-
* @param {Brand} brandIn
|
|
447
|
-
*/
|
|
443
|
+
/** @param {Brand} brandIn */
|
|
448
444
|
getCollateralManager(brandIn) {
|
|
449
445
|
collateralManagers.has(brandIn) ||
|
|
450
446
|
Fail`Not a supported collateral type ${brandIn}`;
|
|
@@ -465,22 +461,16 @@ const prepareVaultDirector = (
|
|
|
465
461
|
getPublicTopics() {
|
|
466
462
|
return topics;
|
|
467
463
|
},
|
|
468
|
-
/**
|
|
469
|
-
* subscription for the paramManager for the vaultFactory's electorate
|
|
470
|
-
*/
|
|
464
|
+
/** subscription for the paramManager for the vaultFactory's electorate */
|
|
471
465
|
getElectorateSubscription() {
|
|
472
466
|
return directorParamManager.getSubscription();
|
|
473
467
|
},
|
|
474
|
-
/**
|
|
475
|
-
* @param {{ collateralBrand: Brand }} selector
|
|
476
|
-
*/
|
|
468
|
+
/** @param {{ collateralBrand: Brand }} selector */
|
|
477
469
|
getGovernedParams({ collateralBrand }) {
|
|
478
470
|
// TODO use named getters of TypedParamManager
|
|
479
471
|
return vaultParamManagers.get(collateralBrand).getParams();
|
|
480
472
|
},
|
|
481
|
-
/**
|
|
482
|
-
* @param {string} name
|
|
483
|
-
*/
|
|
473
|
+
/** @param {string} name */
|
|
484
474
|
getInvitationAmount(name) {
|
|
485
475
|
return directorParamManager.getInvitationAmount(name);
|
|
486
476
|
},
|
|
@@ -500,9 +490,7 @@ const prepareVaultDirector = (
|
|
|
500
490
|
rescheduleWaker,
|
|
501
491
|
);
|
|
502
492
|
},
|
|
503
|
-
/**
|
|
504
|
-
* Start non-durable processes (or restart if needed after vat restart)
|
|
505
|
-
*/
|
|
493
|
+
/** Start non-durable processes (or restart if needed after vat restart) */
|
|
506
494
|
async start() {
|
|
507
495
|
const { helper, machine } = this.facets;
|
|
508
496
|
|
|
@@ -527,7 +515,9 @@ harden(prepareVaultDirector);
|
|
|
527
515
|
/**
|
|
528
516
|
* Prepare the VaultDirector kind, get or make the singleton
|
|
529
517
|
*
|
|
530
|
-
* @type {(
|
|
518
|
+
* @type {(
|
|
519
|
+
* ...pvdArgs: Parameters<typeof prepareVaultDirector>
|
|
520
|
+
* ) => ReturnType<ReturnType<typeof prepareVaultDirector>>}
|
|
531
521
|
*/
|
|
532
522
|
export const provideDirector = (...args) => {
|
|
533
523
|
const makeVaultDirector = prepareVaultDirector(...args);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {ZCF<
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* @typedef {ZCF<
|
|
3
|
+
* GovernanceTerms<import('./params').VaultDirectorParams> & {
|
|
4
|
+
* auctioneerPublicFacet: import('../auction/auctioneer.js').AuctioneerPublicFacet;
|
|
5
|
+
* priceAuthority: ERef<PriceAuthority>;
|
|
6
|
+
* reservePublicFacet: AssetReservePublicFacet;
|
|
7
|
+
* timerService: import('@agoric/time/src/types').TimerService;
|
|
8
|
+
* }
|
|
9
|
+
* >} VaultFactoryZCF
|
|
8
10
|
*/
|
|
9
11
|
export const privateArgsShape: import("@endo/patterns").Matcher;
|
|
10
12
|
export function prepare(zcf: VaultFactoryZCF, privateArgs: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vaultFactory.d.ts","sourceRoot":"","sources":["vaultFactory.js"],"names":[],"mappings":"AAmCA
|
|
1
|
+
{"version":3,"file":"vaultFactory.d.ts","sourceRoot":"","sources":["vaultFactory.js"],"names":[],"mappings":"AAmCA;;;;;;;;;GASG;AAEH,gEAWE;AAcK,6BAVI,eAAe;mBAEN,aAAa;4BACJ,UAAU;gCACN,UAAU;iBACzB,KAAK,WAAW,CAAC;gBAClB,KAAK,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFhC;8BAhHY,IACZ,gBAAoB,OAAO,UAAU,EAAE,mBAAmB,CAAC,GAAG;IAC9D,qBAA2B,EAAE,OAAO,0BAA0B,EAAE,qBAAqB,CAAC;IACtF,cAAoB,EAAE,KAAK,cAAc,CAAC,CAAC;IAC3C,kBAAwB,EAAE,uBAAuB,CAAC;IAClD,YAAkB,EAAE,OAAO,wBAAwB,EAAE,YAAY,CAAC;CAC7D,CACF;mCA2GU,WAAW,cAAc,CAAC"}
|
|
@@ -34,12 +34,14 @@ import { provideDirector } from './vaultDirector.js';
|
|
|
34
34
|
const trace = makeTracer('VF', true);
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* @typedef {ZCF<
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
37
|
+
* @typedef {ZCF<
|
|
38
|
+
* GovernanceTerms<import('./params').VaultDirectorParams> & {
|
|
39
|
+
* auctioneerPublicFacet: import('../auction/auctioneer.js').AuctioneerPublicFacet;
|
|
40
|
+
* priceAuthority: ERef<PriceAuthority>;
|
|
41
|
+
* reservePublicFacet: AssetReservePublicFacet;
|
|
42
|
+
* timerService: import('@agoric/time/src/types').TimerService;
|
|
43
|
+
* }
|
|
44
|
+
* >} VaultFactoryZCF
|
|
43
45
|
*/
|
|
44
46
|
|
|
45
47
|
export const privateArgsShape = M.splitRecord(
|
|
@@ -59,11 +61,11 @@ harden(privateArgsShape);
|
|
|
59
61
|
/**
|
|
60
62
|
* @param {VaultFactoryZCF} zcf
|
|
61
63
|
* @param {{
|
|
62
|
-
* feeMintAccess: FeeMintAccess
|
|
63
|
-
* initialPoserInvitation: Invitation
|
|
64
|
-
* initialShortfallInvitation: Invitation
|
|
65
|
-
* storageNode: ERef<StorageNode
|
|
66
|
-
* marshaller: ERef<Marshaller
|
|
64
|
+
* feeMintAccess: FeeMintAccess;
|
|
65
|
+
* initialPoserInvitation: Invitation;
|
|
66
|
+
* initialShortfallInvitation: Invitation;
|
|
67
|
+
* storageNode: ERef<StorageNode>;
|
|
68
|
+
* marshaller: ERef<Marshaller>;
|
|
67
69
|
* }} privateArgs
|
|
68
70
|
* @param {import('@agoric/ertp').Baggage} baggage
|
|
69
71
|
*/
|
|
@@ -24,8 +24,8 @@ export function prepareVaultHolder(baggage: MapStore<string, unknown>, makeRecor
|
|
|
24
24
|
makeAdjustBalancesInvitation(): Promise<Invitation<R, A>>;
|
|
25
25
|
makeCloseInvitation(): Promise<Invitation<R, A>>;
|
|
26
26
|
/**
|
|
27
|
-
* Starting a transfer revokes the vault holder. The associated updater
|
|
28
|
-
* get a special notification that the vault is being transferred.
|
|
27
|
+
* Starting a transfer revokes the vault holder. The associated updater
|
|
28
|
+
* will get a special notification that the vault is being transferred.
|
|
29
29
|
*/
|
|
30
30
|
makeTransferInvitation(): Promise<Invitation<R, A>>;
|
|
31
31
|
getCollateralAmount(): Amount<"nat">;
|
|
@@ -45,9 +45,7 @@ export function prepareVaultHolder(baggage: MapStore<string, unknown>, makeRecor
|
|
|
45
45
|
getNormalizedDebt(): import("./storeUtils.js").NormalizedDebt;
|
|
46
46
|
}, storageNode: StorageNode) => {
|
|
47
47
|
helper: {
|
|
48
|
-
/**
|
|
49
|
-
* @throws if this holder no longer owns the vault
|
|
50
|
-
*/
|
|
48
|
+
/** @throws if this holder no longer owns the vault */
|
|
51
49
|
owned(): {
|
|
52
50
|
getVaultSeat(): ZCFSeat;
|
|
53
51
|
initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
|
|
@@ -74,8 +72,8 @@ export function prepareVaultHolder(baggage: MapStore<string, unknown>, makeRecor
|
|
|
74
72
|
makeAdjustBalancesInvitation(): Promise<Invitation<R, A>>;
|
|
75
73
|
makeCloseInvitation(): Promise<Invitation<R, A>>;
|
|
76
74
|
/**
|
|
77
|
-
* Starting a transfer revokes the vault holder. The associated updater
|
|
78
|
-
* get a special notification that the vault is being transferred.
|
|
75
|
+
* Starting a transfer revokes the vault holder. The associated updater
|
|
76
|
+
* will get a special notification that the vault is being transferred.
|
|
79
77
|
*/
|
|
80
78
|
makeTransferInvitation(): Promise<Invitation<R, A>>;
|
|
81
79
|
getCollateralAmount(): Amount<"nat">;
|
|
@@ -112,8 +110,8 @@ export function prepareVaultHolder(baggage: MapStore<string, unknown>, makeRecor
|
|
|
112
110
|
makeAdjustBalancesInvitation(): Promise<Invitation<R, A>>;
|
|
113
111
|
makeCloseInvitation(): Promise<Invitation<R, A>>;
|
|
114
112
|
/**
|
|
115
|
-
* Starting a transfer revokes the vault holder. The associated updater
|
|
116
|
-
* get a special notification that the vault is being transferred.
|
|
113
|
+
* Starting a transfer revokes the vault holder. The associated updater
|
|
114
|
+
* will get a special notification that the vault is being transferred.
|
|
117
115
|
*/
|
|
118
116
|
makeTransferInvitation(): Promise<Invitation<R, A>>;
|
|
119
117
|
getCollateralAmount(): Amount<"nat">;
|
|
@@ -122,9 +120,7 @@ export function prepareVaultHolder(baggage: MapStore<string, unknown>, makeRecor
|
|
|
122
120
|
};
|
|
123
121
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
124
122
|
helper: {
|
|
125
|
-
/**
|
|
126
|
-
* @throws if this holder no longer owns the vault
|
|
127
|
-
*/
|
|
123
|
+
/** @throws if this holder no longer owns the vault */
|
|
128
124
|
owned(): {
|
|
129
125
|
getVaultSeat(): ZCFSeat;
|
|
130
126
|
initVaultKit(seat: ZCFSeat, storageNode: StorageNode): Promise<{
|
|
@@ -151,8 +147,8 @@ export function prepareVaultHolder(baggage: MapStore<string, unknown>, makeRecor
|
|
|
151
147
|
makeAdjustBalancesInvitation(): Promise<Invitation<R, A>>;
|
|
152
148
|
makeCloseInvitation(): Promise<Invitation<R, A>>;
|
|
153
149
|
/**
|
|
154
|
-
* Starting a transfer revokes the vault holder. The associated updater
|
|
155
|
-
* get a special notification that the vault is being transferred.
|
|
150
|
+
* Starting a transfer revokes the vault holder. The associated updater
|
|
151
|
+
* will get a special notification that the vault is being transferred.
|
|
156
152
|
*/
|
|
157
153
|
makeTransferInvitation(): Promise<Invitation<R, A>>;
|
|
158
154
|
getCollateralAmount(): Amount<"nat">;
|
|
@@ -189,8 +185,8 @@ export function prepareVaultHolder(baggage: MapStore<string, unknown>, makeRecor
|
|
|
189
185
|
makeAdjustBalancesInvitation(): Promise<Invitation<R, A>>;
|
|
190
186
|
makeCloseInvitation(): Promise<Invitation<R, A>>;
|
|
191
187
|
/**
|
|
192
|
-
* Starting a transfer revokes the vault holder. The associated updater
|
|
193
|
-
* get a special notification that the vault is being transferred.
|
|
188
|
+
* Starting a transfer revokes the vault holder. The associated updater
|
|
189
|
+
* will get a special notification that the vault is being transferred.
|
|
194
190
|
*/
|
|
195
191
|
makeTransferInvitation(): Promise<Invitation<R, A>>;
|
|
196
192
|
getCollateralAmount(): Amount<"nat">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vaultHolder.d.ts","sourceRoot":"","sources":["vaultHolder.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vaultHolder.d.ts","sourceRoot":"","sources":["vaultHolder.js"],"names":[],"mappings":"AAkCO,wFAFI,OAAO,6CAA6C,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;YAoExE;;;eAGG;;;;;;;;;;;;;;;;;;;QA3CH,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;oBAwCtD;;;uBAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAHH;;;WAGG;;;;;;;;QA3CH,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;oBAwCtD;;;uBAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAHH;;;WAGG;;;;;;GAoBV;oBAlHY;IACZ,QAAY,EAAE,OAAO,6CAA6C,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACnG,KAAS,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Use-object for the owner of a vault
|
|
3
|
-
*/
|
|
1
|
+
/** @file Use-object for the owner of a vault */
|
|
4
2
|
import { AmountShape } from '@agoric/ertp';
|
|
5
3
|
import { M, prepareExoClassKit } from '@agoric/vat-data';
|
|
6
4
|
import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/index.js';
|
|
@@ -10,8 +8,8 @@ const { Fail } = assert;
|
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
* @typedef {{
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* topicKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<VaultNotification>;
|
|
12
|
+
* vault: Vault | null;
|
|
15
13
|
* }} State
|
|
16
14
|
*/
|
|
17
15
|
|
|
@@ -25,7 +23,7 @@ const HolderI = M.interface('holder', {
|
|
|
25
23
|
makeTransferInvitation: M.call().returns(M.promise()),
|
|
26
24
|
});
|
|
27
25
|
|
|
28
|
-
/** @type {{ [name: string]: [
|
|
26
|
+
/** @type {{ [name: string]: [description: string, valueShape: Pattern] }} */
|
|
29
27
|
const PUBLIC_TOPICS = {
|
|
30
28
|
vault: ['Vault holder status', M.any()],
|
|
31
29
|
};
|
|
@@ -48,7 +46,6 @@ export const prepareVaultHolder = (baggage, makeRecorderKit) => {
|
|
|
48
46
|
}),
|
|
49
47
|
},
|
|
50
48
|
/**
|
|
51
|
-
*
|
|
52
49
|
* @param {Vault} vault
|
|
53
50
|
* @param {StorageNode} storageNode
|
|
54
51
|
* @returns {State}
|
|
@@ -61,9 +58,7 @@ export const prepareVaultHolder = (baggage, makeRecorderKit) => {
|
|
|
61
58
|
},
|
|
62
59
|
{
|
|
63
60
|
helper: {
|
|
64
|
-
/**
|
|
65
|
-
* @throws if this holder no longer owns the vault
|
|
66
|
-
*/
|
|
61
|
+
/** @throws if this holder no longer owns the vault */
|
|
67
62
|
owned() {
|
|
68
63
|
const { vault } = this.state;
|
|
69
64
|
if (!vault) {
|
|
@@ -104,8 +99,8 @@ export const prepareVaultHolder = (baggage, makeRecorderKit) => {
|
|
|
104
99
|
return this.facets.helper.owned().makeCloseInvitation();
|
|
105
100
|
},
|
|
106
101
|
/**
|
|
107
|
-
* Starting a transfer revokes the vault holder. The associated updater
|
|
108
|
-
* get a special notification that the vault is being transferred.
|
|
102
|
+
* Starting a transfer revokes the vault holder. The associated updater
|
|
103
|
+
* will get a special notification that the vault is being transferred.
|
|
109
104
|
*/
|
|
110
105
|
makeTransferInvitation() {
|
|
111
106
|
const vault = this.facets.helper.owned();
|
|
@@ -28,5 +28,5 @@ export function prepareVaultKit(baggage: MapStore<string, unknown>, makeRecorder
|
|
|
28
28
|
};
|
|
29
29
|
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
30
30
|
};
|
|
31
|
-
export type VaultKit =
|
|
31
|
+
export type VaultKit = ReturnType<ReturnType<typeof prepareVaultKit>>;
|
|
32
32
|
//# sourceMappingURL=vaultKit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vaultKit.d.ts","sourceRoot":"","sources":["vaultKit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vaultKit.d.ts","sourceRoot":"","sources":["vaultKit.js"],"names":[],"mappings":"AAgBO,qFAFI,OAAO,6CAA6C,EAAE,eAAe,WASnE,KAAK,eACL,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBvB;uBAEa,WAAW,WAAW,sBAAsB,CAAC,CAAC"}
|
|
@@ -8,7 +8,8 @@ import { prepareVaultHolder } from './vaultHolder.js';
|
|
|
8
8
|
const trace = makeTracer('VK', true);
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Wrap the VaultHolder duration object in a record suitable for the result of
|
|
11
|
+
* Wrap the VaultHolder duration object in a record suitable for the result of
|
|
12
|
+
* an invitation.
|
|
12
13
|
*
|
|
13
14
|
* @param {import('@agoric/ertp').Baggage} baggage
|
|
14
15
|
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit
|
|
@@ -43,4 +44,4 @@ export const prepareVaultKit = (baggage, makeRecorderKit) => {
|
|
|
43
44
|
return makeVaultKit;
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
/** @typedef {
|
|
47
|
+
/** @typedef {ReturnType<ReturnType<typeof prepareVaultKit>>} VaultKit */
|