@agoric/inter-protocol 0.16.2-upgrade-22-dev-2f770ff.0.2f770ff → 0.16.2-upgrade-23-dev-04dbab2.0.04dbab2
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
package/src/clientSupport.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
import { Fail } from '@endo/errors';
|
|
4
3
|
import { AmountMath } from '@agoric/ertp';
|
|
5
|
-
import {
|
|
6
|
-
import { parseRatio } from '@agoric/ertp/src/ratio.js';
|
|
4
|
+
import { Fail } from '@endo/errors';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* @import {Amount, Brand, Payment, Purse} from '@agoric/ertp';
|
|
10
|
-
* @import {Proposal} from '@agoric/zoe';
|
|
8
|
+
* @import {AmountKeywordRecord, Instance, Proposal} from '@agoric/zoe';
|
|
9
|
+
* @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js';
|
|
10
|
+
* @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js';
|
|
11
|
+
* @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js';
|
|
12
|
+
* @import {BoardRemote} from '@agoric/internal/src/marshal/board-client-utils.js';
|
|
13
|
+
* @import {OfferMaker} from '@agoric/smart-wallet/src/types.js';
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
16
|
// XXX support other decimal places
|
|
@@ -20,10 +23,7 @@ const scaleDecimals = num => BigInt(num * Number(COSMOS_UNIT));
|
|
|
20
23
|
/**
|
|
21
24
|
* Give/want
|
|
22
25
|
*
|
|
23
|
-
* @param {Pick<
|
|
24
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
25
|
-
* 'brand'
|
|
26
|
-
* >} agoricNames
|
|
26
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
27
27
|
* @param {{ giveMinted?: number; wantMinted?: number }
|
|
28
28
|
* | {
|
|
29
29
|
* collateralBrandKey: string;
|
|
@@ -67,17 +67,14 @@ const makeVaultProposal = ({ brand }, opts) => {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
* @param {Pick<
|
|
71
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
72
|
-
* 'brand'
|
|
73
|
-
* >} agoricNames
|
|
70
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
74
71
|
* @param {{
|
|
75
72
|
* offerId: string;
|
|
76
73
|
* wantMinted: number;
|
|
77
74
|
* giveCollateral: number;
|
|
78
75
|
* collateralBrandKey: string;
|
|
79
76
|
* }} opts
|
|
80
|
-
* @returns {
|
|
77
|
+
* @returns {OfferSpec}
|
|
81
78
|
*/
|
|
82
79
|
const makeOpenOffer = ({ brand }, opts) => {
|
|
83
80
|
const proposal = makeVaultProposal({ brand }, opts);
|
|
@@ -103,10 +100,7 @@ const makeOpenOffer = ({ brand }, opts) => {
|
|
|
103
100
|
};
|
|
104
101
|
|
|
105
102
|
/**
|
|
106
|
-
* @param {Pick<
|
|
107
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
108
|
-
* 'brand'
|
|
109
|
-
* >} agoricNames
|
|
103
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
110
104
|
* @param {{
|
|
111
105
|
* offerId: string;
|
|
112
106
|
* collateralBrandKey?: string;
|
|
@@ -116,7 +110,7 @@ const makeOpenOffer = ({ brand }, opts) => {
|
|
|
116
110
|
* wantMinted?: number;
|
|
117
111
|
* }} opts
|
|
118
112
|
* @param {string} previousOffer
|
|
119
|
-
* @returns {
|
|
113
|
+
* @returns {OfferSpec}
|
|
120
114
|
*/
|
|
121
115
|
const makeAdjustOffer = ({ brand }, opts, previousOffer) => {
|
|
122
116
|
// NB: not really a Proposal because the brands are not remotes
|
|
@@ -136,17 +130,14 @@ const makeAdjustOffer = ({ brand }, opts, previousOffer) => {
|
|
|
136
130
|
};
|
|
137
131
|
|
|
138
132
|
/**
|
|
139
|
-
* @param {Pick<
|
|
140
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
141
|
-
* 'brand'
|
|
142
|
-
* >} agoricNames
|
|
133
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
143
134
|
* @param {{
|
|
144
135
|
* offerId: string;
|
|
145
136
|
* collateralBrandKey?: string;
|
|
146
137
|
* giveMinted: number;
|
|
147
138
|
* }} opts
|
|
148
139
|
* @param {string} previousOffer
|
|
149
|
-
* @returns {
|
|
140
|
+
* @returns {OfferSpec}
|
|
150
141
|
*/
|
|
151
142
|
const makeCloseOffer = ({ brand }, opts, previousOffer) => {
|
|
152
143
|
const proposal = makeVaultProposal({ brand }, opts);
|
|
@@ -164,9 +155,7 @@ const makeCloseOffer = ({ brand }, opts, previousOffer) => {
|
|
|
164
155
|
|
|
165
156
|
/**
|
|
166
157
|
* @param {string} vaultId
|
|
167
|
-
* @param {Promise<
|
|
168
|
-
* import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord
|
|
169
|
-
* >} currentP
|
|
158
|
+
* @param {Promise<CurrentWalletRecord>} currentP
|
|
170
159
|
* @returns {Promise<string>} offer id in which the vault was made
|
|
171
160
|
*/
|
|
172
161
|
export const lookupOfferIdForVault = async (vaultId, currentP) => {
|
|
@@ -181,10 +170,7 @@ export const lookupOfferIdForVault = async (vaultId, currentP) => {
|
|
|
181
170
|
};
|
|
182
171
|
|
|
183
172
|
/**
|
|
184
|
-
* @param {Record<
|
|
185
|
-
* string,
|
|
186
|
-
* import('@agoric/internal/src/marshal.js').BoardRemote
|
|
187
|
-
* >} brands
|
|
173
|
+
* @param {Record<string, BoardRemote>} brands
|
|
188
174
|
* @param {{ wantMinted: number; giveMinted?: undefined }
|
|
189
175
|
* | { giveMinted: number; wantMinted?: undefined }} opts
|
|
190
176
|
* @param {number} [fee]
|
|
@@ -214,16 +200,13 @@ const makePsmProposal = (brands, opts, fee = 0, anchor = 'AUSD') => {
|
|
|
214
200
|
};
|
|
215
201
|
|
|
216
202
|
/**
|
|
217
|
-
* @param {Pick<
|
|
218
|
-
*
|
|
219
|
-
* 'brand'
|
|
220
|
-
* >} agoricNames
|
|
221
|
-
* @param {Instance} instance
|
|
203
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
204
|
+
* @param {Instance<unknown>} instance
|
|
222
205
|
* @param {{ offerId: string; feePct?: number; pair: [string, string] } & (
|
|
223
206
|
* | { wantMinted: number }
|
|
224
207
|
* | { giveMinted: number }
|
|
225
208
|
* )} opts
|
|
226
|
-
* @returns {
|
|
209
|
+
* @returns {OfferSpec}
|
|
227
210
|
*/
|
|
228
211
|
const makePsmSwapOffer = ({ brand }, instance, opts) => {
|
|
229
212
|
const method =
|
|
@@ -254,10 +237,7 @@ const makePsmSwapOffer = ({ brand }, instance, opts) => {
|
|
|
254
237
|
};
|
|
255
238
|
|
|
256
239
|
/**
|
|
257
|
-
* @param {Pick<
|
|
258
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
259
|
-
* 'brand' | 'vbankAsset'
|
|
260
|
-
* >} agoricNames
|
|
240
|
+
* @param {Pick<AgoricNamesRemotes, 'brand' | 'vbankAsset'>} agoricNames
|
|
261
241
|
* @param {(msg: string) => Error} makeError error constructor
|
|
262
242
|
* @returns {(a: string) => Amount<'nat'>}
|
|
263
243
|
*/
|
|
@@ -297,91 +277,13 @@ export const makeParseAmount =
|
|
|
297
277
|
};
|
|
298
278
|
|
|
299
279
|
/**
|
|
300
|
-
* @param {Pick<
|
|
301
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
302
|
-
* 'brand' | 'vbankAsset'
|
|
303
|
-
* >} agoricNames
|
|
304
|
-
* @param {{
|
|
305
|
-
* offerId: string;
|
|
306
|
-
* give: string;
|
|
307
|
-
* maxBuy: string;
|
|
308
|
-
* wantMinimum?: string;
|
|
309
|
-
* } & (
|
|
310
|
-
* | {
|
|
311
|
-
* price: number;
|
|
312
|
-
* }
|
|
313
|
-
* | {
|
|
314
|
-
* discount: number; // -1 to 1. e.g. 0.10 for 10% discount, -0.05 for 5% markup
|
|
315
|
-
* }
|
|
316
|
-
* )} opts
|
|
317
|
-
* @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
|
|
318
|
-
*/
|
|
319
|
-
const makeBidOffer = (agoricNames, opts) => {
|
|
320
|
-
assertAllDefined({
|
|
321
|
-
offerId: opts.offerId,
|
|
322
|
-
give: opts.give,
|
|
323
|
-
maxBuy: opts.maxBuy,
|
|
324
|
-
});
|
|
325
|
-
const parseAmount = makeParseAmount(agoricNames);
|
|
326
|
-
const proposal = {
|
|
327
|
-
give: { Bid: parseAmount(opts.give) },
|
|
328
|
-
...(opts.wantMinimum
|
|
329
|
-
? { want: { Collateral: parseAmount(opts.wantMinimum) } }
|
|
330
|
-
: {}),
|
|
331
|
-
};
|
|
332
|
-
const istBrand = proposal.give.Bid.brand;
|
|
333
|
-
const maxBuy = parseAmount(opts.maxBuy);
|
|
334
|
-
|
|
335
|
-
const bounds = (x, lo, hi) => {
|
|
336
|
-
assert(x >= lo && x <= hi);
|
|
337
|
-
return x;
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
assert(
|
|
341
|
-
'price' in opts || 'discount' in opts,
|
|
342
|
-
'must specify price or discount',
|
|
343
|
-
);
|
|
344
|
-
/** @type {import('./auction/auctionBook.js').OfferSpec} */
|
|
345
|
-
const offerArgs =
|
|
346
|
-
'price' in opts
|
|
347
|
-
? {
|
|
348
|
-
maxBuy: parseAmount(opts.maxBuy),
|
|
349
|
-
offerPrice: parseRatio(opts.price, istBrand, maxBuy.brand),
|
|
350
|
-
}
|
|
351
|
-
: {
|
|
352
|
-
maxBuy,
|
|
353
|
-
offerBidScaling: parseRatio(
|
|
354
|
-
(1 - bounds(opts.discount, -1, 1)).toFixed(2),
|
|
355
|
-
istBrand,
|
|
356
|
-
istBrand,
|
|
357
|
-
),
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
/** @type {import('@agoric/smart-wallet/src/offers.js').OfferSpec} */
|
|
361
|
-
const offerSpec = {
|
|
362
|
-
id: opts.offerId,
|
|
363
|
-
invitationSpec: {
|
|
364
|
-
source: 'agoricContract',
|
|
365
|
-
instancePath: ['auctioneer'],
|
|
366
|
-
callPipe: [['makeBidInvitation', [maxBuy.brand]]],
|
|
367
|
-
},
|
|
368
|
-
proposal,
|
|
369
|
-
offerArgs,
|
|
370
|
-
};
|
|
371
|
-
return offerSpec;
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* @param {Pick<
|
|
376
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
377
|
-
* 'brand'
|
|
378
|
-
* >} agoricNames
|
|
280
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
379
281
|
* @param {{
|
|
380
282
|
* offerId: string;
|
|
381
283
|
* give: number;
|
|
382
284
|
* collateralBrandKey: string;
|
|
383
285
|
* }} opts
|
|
384
|
-
* @returns {
|
|
286
|
+
* @returns {OfferSpec}
|
|
385
287
|
*/
|
|
386
288
|
const makeAddCollateralOffer = ({ brand }, opts) => {
|
|
387
289
|
/** @type {AmountKeywordRecord} */
|
|
@@ -393,7 +295,7 @@ const makeAddCollateralOffer = ({ brand }, opts) => {
|
|
|
393
295
|
),
|
|
394
296
|
};
|
|
395
297
|
|
|
396
|
-
/** @type {
|
|
298
|
+
/** @type {OfferSpec} */
|
|
397
299
|
const offerSpec = {
|
|
398
300
|
id: opts.offerId,
|
|
399
301
|
invitationSpec: {
|
|
@@ -414,7 +316,7 @@ const makeAddCollateralOffer = ({ brand }, opts) => {
|
|
|
414
316
|
* unitPrice: bigint;
|
|
415
317
|
* }} opts
|
|
416
318
|
* @param {string} previousOffer
|
|
417
|
-
* @returns {
|
|
319
|
+
* @returns {OfferSpec}
|
|
418
320
|
*/
|
|
419
321
|
const makePushPriceOffer = (_agoricNames, opts, previousOffer) => {
|
|
420
322
|
return {
|
|
@@ -432,15 +334,9 @@ const makePushPriceOffer = (_agoricNames, opts, previousOffer) => {
|
|
|
432
334
|
};
|
|
433
335
|
|
|
434
336
|
/**
|
|
435
|
-
* @satisfies {Record<
|
|
436
|
-
* string,
|
|
437
|
-
* Record<string, import('@agoric/smart-wallet/src/types.js').OfferMaker>
|
|
438
|
-
* >}
|
|
337
|
+
* @satisfies {Record<string, Record<string, OfferMaker>>}
|
|
439
338
|
*/
|
|
440
339
|
export const Offers = {
|
|
441
|
-
auction: {
|
|
442
|
-
Bid: makeBidOffer,
|
|
443
|
-
},
|
|
444
340
|
fluxAggregator: {
|
|
445
341
|
PushPrice: makePushPriceOffer,
|
|
446
342
|
},
|
package/src/collectFees.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export function makeCollectFeesInvitation(zcf: ZCF, feeSeat: ZCFSeat, feeBrand: Brand, keyword: string): Promise<Invitation<string>>;
|
|
2
|
+
import type { ZCF } from '@agoric/zoe';
|
|
3
|
+
import type { ZCFSeat } from '@agoric/zoe';
|
|
4
|
+
import type { Brand } from '@agoric/ertp';
|
|
5
|
+
import type { Invitation } from '@agoric/zoe';
|
|
2
6
|
//# sourceMappingURL=collectFees.d.ts.map
|
package/src/collectFees.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectFees.d.ts","sourceRoot":"","sources":["collectFees.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collectFees.d.ts","sourceRoot":"","sources":["collectFees.js"],"names":[],"mappings":"AAgBO,+CANI,GAAG,WACH,OAAO,YACP,KAAK,WACL,MAAM,GACJ,OAAO,CAAC,WAAW,MAAM,CAAC,CAAC,CAYvC;yBAvB0C,aAAa;6BAAb,aAAa;2BAChC,cAAc;gCADK,aAAa"}
|
package/src/collectFees.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
|
|
3
1
|
import { atomicTransfer } from '@agoric/zoe/src/contractSupport/index.js';
|
|
4
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @import {Invitation, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
5
|
+
* @import {Brand} from '@agoric/ertp';
|
|
6
|
+
*/
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* Provide shared support for providing access to fees from a service contract.
|
|
7
10
|
*
|
package/src/contractSupport.d.ts
CHANGED
|
@@ -12,10 +12,10 @@ export function assertOnlyKeys(proposal: ProposalRecord, keys: string[]): void;
|
|
|
12
12
|
export function allEmpty(amounts: Amount[]): boolean;
|
|
13
13
|
export function checkDebtLimit(debtLimit: Amount<"nat">, totalDebt: Amount<"nat">, toMint: Amount<"nat">): void;
|
|
14
14
|
export function makeNatAmountShape(brand: Brand, min?: NatValue): {
|
|
15
|
-
brand:
|
|
15
|
+
brand: Brand;
|
|
16
16
|
value: import("@endo/patterns").Matcher;
|
|
17
17
|
};
|
|
18
|
-
export function quoteAsRatio(quoteAmount: Pick<PriceDescription, "amountIn" | "amountOut">): import("@agoric/ertp/src/ratio").Ratio;
|
|
18
|
+
export function quoteAsRatio(quoteAmount: Pick<PriceDescription, "amountIn" | "amountOut">): import("@agoric/ertp/src/ratio.js").Ratio;
|
|
19
19
|
export type MetricsPublisherKit<T> = {
|
|
20
20
|
metricsPublication: IterationObserver<T>;
|
|
21
21
|
metricsSubscription: StoredSubscription<T>;
|
|
@@ -24,5 +24,13 @@ export type MetricsPublishKit<T> = {
|
|
|
24
24
|
metricsPublisher: Publisher<T>;
|
|
25
25
|
metricsSubscriber: StoredSubscriber<T>;
|
|
26
26
|
};
|
|
27
|
+
import type { Amount } from '@agoric/ertp';
|
|
28
|
+
import type { ProposalRecord } from '@agoric/zoe';
|
|
29
|
+
import type { Brand } from '@agoric/ertp';
|
|
30
|
+
import type { NatValue } from '@agoric/ertp';
|
|
27
31
|
import type { PriceDescription } from '@agoric/zoe/tools/types.js';
|
|
32
|
+
import type { IterationObserver } from '@agoric/notifier';
|
|
33
|
+
import type { StoredSubscription } from '@agoric/notifier';
|
|
34
|
+
import type { Publisher } from '@agoric/notifier';
|
|
35
|
+
import type { StoredSubscriber } from '@agoric/notifier';
|
|
28
36
|
//# sourceMappingURL=contractSupport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractSupport.d.ts","sourceRoot":"","sources":["contractSupport.js"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"contractSupport.d.ts","sourceRoot":"","sources":["contractSupport.js"],"names":[],"mappings":";;;;;;;;AAiCO,4BANe,CAAC,SAAV,MAAQ,QACV,CAAC,QACD,CAAC,QACD,CAAC,GACC,CAAC,CAGyC;AAQhD,gCALe,CAAC,SAAV,MAAQ,QACV,CAAC,SACD,CAAC,GACC,CAAC,CAK2C;AAQlD,yCAHI,cAAc,QACd,MAAM,EAAE,QAQlB;AAMM,kCAHI,MAAM,EAAE,GACN,OAAO,CAInB;AAUM,0CAPI,OAAO,KAAK,CAAC,aACb,OAAO,KAAK,CAAC,UACb,OAAO,KAAK,CAAC,QAcvB;AAoBM,0CAHI,KAAK,QACL,QAAQ;;;EAGmC;AAG/C,0CADK,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,WAAW,CAAC,6CAEO;gCAtBtD,CAAC;wBAEA,kBAAkB,CAAC,CAAC;yBACpB,mBAAmB,CAAC,CAAC;;8BAItB,CAAC;sBAEA,UAAU,CAAC,CAAC;uBACZ,iBAAiB,CAAC,CAAC;;4BA5FR,cAAc;oCAKgB,aAAa;2BAJ5C,cAAc;8BACX,cAAc;sCAHoD,4BAA4B;uCAKnC,kBAAkB;wCAAlB,kBAAkB;+BAAlB,kBAAkB;sCAAlB,kBAAkB"}
|
package/src/contractSupport.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
|
|
3
1
|
import { Fail, q } from '@endo/errors';
|
|
4
2
|
import { AmountMath } from '@agoric/ertp';
|
|
5
3
|
import { M } from '@agoric/store';
|
|
6
4
|
import { makeRatioFromAmounts } from '@agoric/zoe/src/contractSupport/index.js';
|
|
7
5
|
|
|
8
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
8
|
+
* @import {Amount} from '@agoric/ertp';
|
|
9
|
+
* @import {Brand} from '@agoric/ertp';
|
|
10
|
+
* @import {NatValue} from '@agoric/ertp';
|
|
11
|
+
*/
|
|
12
|
+
/** @import {IterationObserver, Publisher, StoredSubscriber, StoredSubscription} from '@agoric/notifier'; */
|
|
13
|
+
/** @import {AmountKeywordRecord, ProposalRecord} from '@agoric/zoe'; */
|
|
9
14
|
|
|
10
15
|
export const amountPattern = harden({ brand: M.remotable(), value: M.any() });
|
|
11
16
|
export const ratioPattern = harden({
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {MapStore, SetStore} from '@agoric/store';
|
|
3
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
4
|
+
* @import {TimestampValue} from '@agoric/time';
|
|
5
|
+
* @import {ContractMeta, Installation, Instance, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
6
|
+
* @import {GovernorCreatorFacet} from '@agoric/governance/src/types.js';
|
|
3
7
|
*/
|
|
4
8
|
/**
|
|
5
9
|
* @file This contract makes it possible for those who govern contracts to call
|
|
@@ -12,26 +16,26 @@ export const INVITATION_MAKERS_DESC: "charter member invitation";
|
|
|
12
16
|
export const meta: ContractMeta<typeof start>;
|
|
13
17
|
export function start(zcf: ZCF<{
|
|
14
18
|
binaryVoteCounterInstallation: Installation;
|
|
15
|
-
}>,
|
|
19
|
+
}>, _privateArgs: undefined, baggage: Baggage): Promise<{
|
|
16
20
|
creatorFacet: import("@endo/exo").Guarded<{
|
|
17
21
|
/**
|
|
18
|
-
* @param {Instance} governedInstance
|
|
22
|
+
* @param {Instance<unknown>} governedInstance
|
|
19
23
|
* @param {GovernorCreatorFacet<any>} governorFacet
|
|
20
24
|
* @param {string} [label] for diagnostic use only
|
|
21
25
|
*/
|
|
22
|
-
addInstance: (governedInstance: Instance
|
|
23
|
-
makeCharterMemberInvitation: () => Promise<
|
|
26
|
+
addInstance: (governedInstance: Instance<unknown>, governorFacet: GovernorCreatorFacet<any>, label?: string) => void;
|
|
27
|
+
makeCharterMemberInvitation: () => Promise<import("@agoric/zoe").Invitation<{
|
|
24
28
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
25
|
-
VoteOnParamChange: () => Promise<
|
|
26
|
-
VoteOnPauseOffers: (instance: any, strings: any, deadline: any) => Promise<
|
|
27
|
-
VoteOnApiCall: (instance: Instance
|
|
29
|
+
VoteOnParamChange: () => Promise<import("@agoric/zoe").Invitation<import("@agoric/governance/src/types.js").ContractGovernanceVoteResult, ParamChangesOfferArgs>>;
|
|
30
|
+
VoteOnPauseOffers: (instance: any, strings: any, deadline: any) => Promise<import("@agoric/zoe").Invitation<import("@agoric/governance/src/types.js").ContractGovernanceVoteResult, undefined>>;
|
|
31
|
+
VoteOnApiCall: (instance: Instance<unknown>, methodName: string, methodArgs: string[], deadline: TimestampValue) => Promise<import("@agoric/zoe").Invitation<import("@agoric/governance/src/types.js").ContractGovernanceVoteResult, undefined>>;
|
|
28
32
|
}>;
|
|
29
33
|
}, undefined>>;
|
|
30
34
|
}>;
|
|
31
35
|
}>;
|
|
32
36
|
export type ParamChangesOfferArgs = {
|
|
33
37
|
deadline: bigint;
|
|
34
|
-
instance: Instance
|
|
38
|
+
instance: Instance<unknown>;
|
|
35
39
|
params: Record<string, unknown>;
|
|
36
40
|
/**
|
|
37
41
|
* paramPath is determined by contract
|
|
@@ -40,4 +44,11 @@ export type ParamChangesOfferArgs = {
|
|
|
40
44
|
paramPath: unknown;
|
|
41
45
|
} | undefined;
|
|
42
46
|
};
|
|
47
|
+
import type { ContractMeta } from '@agoric/zoe';
|
|
48
|
+
import type { Installation } from '@agoric/zoe';
|
|
49
|
+
import type { ZCF } from '@agoric/zoe';
|
|
50
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
51
|
+
import type { Instance } from '@agoric/zoe';
|
|
52
|
+
import type { GovernorCreatorFacet } from '@agoric/governance/src/types.js';
|
|
53
|
+
import type { TimestampValue } from '@agoric/time';
|
|
43
54
|
//# sourceMappingURL=econCommitteeCharter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"econCommitteeCharter.d.ts","sourceRoot":"","sources":["econCommitteeCharter.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"econCommitteeCharter.d.ts","sourceRoot":"","sources":["econCommitteeCharter.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AAEH;;;;;GAKG;AAEH,qCAAsC,2BAA2B,CAAC;AAoBlE,yCAAyC;AACzC,mBADW,aAAa,OAAO,KAAK,CAAC,CAMnC;AAQK,2BAJI,IAAI;IAAE,6BAA6B,EAAE,YAAY,CAAA;CAAE,CAAC,gBACpD,SAAS,WACT,OAAO;;QAsHZ;;;;WAIG;wCAHQ,SAAS,OAAO,CAAC,iBACjB,qBAAqB,GAAG,CAAC,UACzB,MAAM;;;;;0CAzEV,SAAS,OAAO,CAAC,cACjB,MAAM,cACN,MAAM,EAAE,YACR,cAAc;;;;GAkF1B;;cAjKa,MAAM;cACN,SAAS,OAAO,CAAC;YACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;mBACV,OAAO;;;kCAlBmC,aAAa;kCAAb,aAAa;yBAAb,aAAa;6BAFxD,kBAAkB;8BAEyB,aAAa;0CAC3C,iCAAiC;oCAFvC,cAAc"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
/// <reference types="@agoric/governance/exported" />
|
|
3
|
-
/// <reference types="@agoric/zoe/exported" />
|
|
4
|
-
|
|
5
1
|
import { M, mustMatch } from '@agoric/store';
|
|
6
2
|
import { TimestampShape } from '@agoric/time';
|
|
7
3
|
import { prepareExo, provideDurableMapStore } from '@agoric/vat-data';
|
|
@@ -13,6 +9,10 @@ import { E } from '@endo/far';
|
|
|
13
9
|
|
|
14
10
|
/**
|
|
15
11
|
* @import {MapStore, SetStore} from '@agoric/store';
|
|
12
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
13
|
+
* @import {TimestampValue} from '@agoric/time';
|
|
14
|
+
* @import {ContractMeta, Installation, Instance, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
15
|
+
* @import {GovernorCreatorFacet} from '@agoric/governance/src/types.js';
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -27,7 +27,7 @@ export const INVITATION_MAKERS_DESC = 'charter member invitation';
|
|
|
27
27
|
/**
|
|
28
28
|
* @typedef {object} ParamChangesOfferArgs
|
|
29
29
|
* @property {bigint} deadline
|
|
30
|
-
* @property {Instance} instance
|
|
30
|
+
* @property {Instance<unknown>} instance
|
|
31
31
|
* @property {Record<string, unknown>} params
|
|
32
32
|
* @property {{ paramPath: unknown }} [path] paramPath is determined by contract
|
|
33
33
|
*/
|
|
@@ -53,12 +53,12 @@ harden(meta);
|
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* @param {ZCF<{ binaryVoteCounterInstallation: Installation }>} zcf
|
|
56
|
-
* @param {undefined}
|
|
57
|
-
* @param {
|
|
56
|
+
* @param {undefined} _privateArgs
|
|
57
|
+
* @param {Baggage} baggage
|
|
58
58
|
*/
|
|
59
|
-
export const start = async (zcf,
|
|
59
|
+
export const start = async (zcf, _privateArgs, baggage) => {
|
|
60
60
|
const { binaryVoteCounterInstallation: counter } = zcf.getTerms();
|
|
61
|
-
/** @type {MapStore<Instance
|
|
61
|
+
/** @type {MapStore<Instance<unknown>, GovernorCreatorFacet<any>>} */
|
|
62
62
|
const instanceToGovernor = provideDurableMapStore(
|
|
63
63
|
baggage,
|
|
64
64
|
'instanceToGovernor',
|
|
@@ -102,10 +102,10 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
* @param {Instance} instance
|
|
105
|
+
* @param {Instance<unknown>} instance
|
|
106
106
|
* @param {string} methodName
|
|
107
107
|
* @param {string[]} methodArgs
|
|
108
|
-
* @param {
|
|
108
|
+
* @param {TimestampValue} deadline
|
|
109
109
|
*/
|
|
110
110
|
const makeApiInvocationInvitation = (
|
|
111
111
|
instance,
|
|
@@ -173,7 +173,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
173
173
|
CharterCreatorI,
|
|
174
174
|
{
|
|
175
175
|
/**
|
|
176
|
-
* @param {Instance} governedInstance
|
|
176
|
+
* @param {Instance<unknown>} governedInstance
|
|
177
177
|
* @param {GovernorCreatorFacet<any>} governorFacet
|
|
178
178
|
* @param {string} [label] for diagnostic use only
|
|
179
179
|
*/
|