@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.
Files changed (128) hide show
  1. package/bundles/bundle-auctioneer-js-meta.json +181 -181
  2. package/bundles/bundle-auctioneer.js +1 -1
  3. package/bundles/bundle-econCommitteeCharter-js-meta.json +129 -129
  4. package/bundles/bundle-econCommitteeCharter.js +1 -1
  5. package/bundles/bundle-feeDistributor-js-meta.json +115 -115
  6. package/bundles/bundle-feeDistributor.js +1 -1
  7. package/bundles/bundle-fluxAggregatorKit-js-meta.json +169 -169
  8. package/bundles/bundle-fluxAggregatorKit.js +1 -1
  9. package/bundles/bundle-psm-js-meta.json +167 -167
  10. package/bundles/bundle-psm.js +1 -1
  11. package/bundles/bundle-reserve-js-meta.json +169 -169
  12. package/bundles/bundle-reserve.js +1 -1
  13. package/bundles/bundle-scaledPriceAuthority-js-meta.json +142 -142
  14. package/bundles/bundle-scaledPriceAuthority.js +1 -1
  15. package/bundles/bundle-vaultFactory-js-meta.json +200 -200
  16. package/bundles/bundle-vaultFactory.js +1 -1
  17. package/package.json +17 -17
  18. package/scripts/deploy-contracts.js +12 -2
  19. package/scripts/init-core.js +5 -6
  20. package/scripts/manual-price-feed.js +20 -15
  21. package/src/auction/auctionBook.d.ts +16 -13
  22. package/src/auction/auctionBook.d.ts.map +1 -1
  23. package/src/auction/auctionBook.js +68 -56
  24. package/src/auction/auctioneer.d.ts.map +1 -1
  25. package/src/auction/auctioneer.js +54 -42
  26. package/src/auction/offerBook.d.ts.map +1 -1
  27. package/src/auction/offerBook.js +12 -11
  28. package/src/auction/params.d.ts +1 -1
  29. package/src/auction/params.d.ts.map +1 -1
  30. package/src/auction/params.js +3 -5
  31. package/src/auction/scheduleMath.d.ts.map +1 -1
  32. package/src/auction/scheduleMath.js +13 -13
  33. package/src/auction/scheduler.d.ts +4 -4
  34. package/src/auction/scheduler.d.ts.map +1 -1
  35. package/src/auction/scheduler.js +20 -20
  36. package/src/auction/sortedOffers.d.ts.map +1 -1
  37. package/src/auction/sortedOffers.js +8 -7
  38. package/src/auction/util.d.ts +1 -1
  39. package/src/auction/util.js +4 -4
  40. package/src/clientSupport.d.ts +65 -27
  41. package/src/clientSupport.d.ts.map +1 -1
  42. package/src/clientSupport.js +92 -34
  43. package/src/contractSupport.js +5 -5
  44. package/src/econCommitteeCharter.d.ts +4 -6
  45. package/src/econCommitteeCharter.d.ts.map +1 -1
  46. package/src/econCommitteeCharter.js +7 -11
  47. package/src/feeDistributor.d.ts +8 -24
  48. package/src/feeDistributor.d.ts.map +1 -1
  49. package/src/feeDistributor.js +26 -28
  50. package/src/interest.d.ts +1 -0
  51. package/src/interest.d.ts.map +1 -1
  52. package/src/interest.js +22 -15
  53. package/src/price/fluxAggregatorContract.d.ts +1 -0
  54. package/src/price/fluxAggregatorContract.d.ts.map +1 -1
  55. package/src/price/fluxAggregatorContract.js +24 -19
  56. package/src/price/fluxAggregatorKit.d.ts +23 -18
  57. package/src/price/fluxAggregatorKit.d.ts.map +1 -1
  58. package/src/price/fluxAggregatorKit.js +47 -32
  59. package/src/price/priceOracleKit.d.ts +2 -8
  60. package/src/price/priceOracleKit.d.ts.map +1 -1
  61. package/src/price/priceOracleKit.js +11 -13
  62. package/src/price/roundsManager.d.ts +28 -46
  63. package/src/price/roundsManager.d.ts.map +1 -1
  64. package/src/price/roundsManager.js +51 -63
  65. package/src/proposals/committee-proposal.d.ts.map +1 -1
  66. package/src/proposals/committee-proposal.js +5 -9
  67. package/src/proposals/core-proposal.d.ts.map +1 -1
  68. package/src/proposals/core-proposal.js +3 -5
  69. package/src/proposals/econ-behaviors.d.ts.map +1 -1
  70. package/src/proposals/econ-behaviors.js +55 -28
  71. package/src/proposals/price-feed-proposal.d.ts.map +1 -1
  72. package/src/proposals/price-feed-proposal.js +30 -11
  73. package/src/proposals/startPSM.d.ts.map +1 -1
  74. package/src/proposals/startPSM.js +24 -17
  75. package/src/proposals/utils.d.ts +1 -1
  76. package/src/proposals/utils.d.ts.map +1 -1
  77. package/src/proposals/utils.js +26 -7
  78. package/src/psm/psm.d.ts +14 -22
  79. package/src/psm/psm.d.ts.map +1 -1
  80. package/src/psm/psm.js +34 -31
  81. package/src/reserve/assetReserve.d.ts.map +1 -1
  82. package/src/reserve/assetReserve.js +16 -13
  83. package/src/reserve/assetReserveKit.d.ts +14 -26
  84. package/src/reserve/assetReserveKit.d.ts.map +1 -1
  85. package/src/reserve/assetReserveKit.js +13 -21
  86. package/src/tokens.d.ts +3 -3
  87. package/src/tokens.d.ts.map +1 -1
  88. package/src/tokens.js +5 -5
  89. package/src/typeGuards.d.ts +1 -3
  90. package/src/typeGuards.d.ts.map +1 -1
  91. package/src/typeGuards.js +1 -3
  92. package/src/vaultFactory/liquidation.d.ts.map +1 -1
  93. package/src/vaultFactory/liquidation.js +29 -16
  94. package/src/vaultFactory/math.d.ts.map +1 -1
  95. package/src/vaultFactory/math.js +8 -9
  96. package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -1
  97. package/src/vaultFactory/orderedVaultStore.js +6 -9
  98. package/src/vaultFactory/params.d.ts +1 -4
  99. package/src/vaultFactory/params.d.ts.map +1 -1
  100. package/src/vaultFactory/params.js +24 -18
  101. package/src/vaultFactory/prioritizedVaults.js +2 -2
  102. package/src/vaultFactory/proceeds.d.ts +3 -3
  103. package/src/vaultFactory/proceeds.d.ts.map +1 -1
  104. package/src/vaultFactory/proceeds.js +24 -18
  105. package/src/vaultFactory/storeUtils.d.ts +2 -6
  106. package/src/vaultFactory/storeUtils.d.ts.map +1 -1
  107. package/src/vaultFactory/storeUtils.js +8 -12
  108. package/src/vaultFactory/types.d.ts +16 -11
  109. package/src/vaultFactory/types.d.ts.map +1 -1
  110. package/src/vaultFactory/types.js +37 -27
  111. package/src/vaultFactory/vault.d.ts +103 -159
  112. package/src/vaultFactory/vault.d.ts.map +1 -1
  113. package/src/vaultFactory/vault.js +84 -85
  114. package/src/vaultFactory/vaultDirector.d.ts +21 -43
  115. package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
  116. package/src/vaultFactory/vaultDirector.js +30 -40
  117. package/src/vaultFactory/vaultFactory.d.ts +8 -6
  118. package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
  119. package/src/vaultFactory/vaultFactory.js +13 -11
  120. package/src/vaultFactory/vaultHolder.d.ts +12 -16
  121. package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
  122. package/src/vaultFactory/vaultHolder.js +7 -12
  123. package/src/vaultFactory/vaultKit.d.ts +1 -1
  124. package/src/vaultFactory/vaultKit.d.ts.map +1 -1
  125. package/src/vaultFactory/vaultKit.js +3 -2
  126. package/src/vaultFactory/vaultManager.d.ts +454 -68
  127. package/src/vaultFactory/vaultManager.d.ts.map +1 -1
  128. package/src/vaultFactory/vaultManager.js +120 -110
@@ -15,8 +15,16 @@ const scaleDecimals = num => BigInt(num * Number(COSMOS_UNIT));
15
15
  /**
16
16
  * Give/want
17
17
  *
18
- * @param {Pick<import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes, 'brand'>} agoricNames
19
- * @param {{ giveMinted?: number, wantMinted?: number } | { collateralBrandKey: string, giveCollateral?: number, wantCollateral?: number }} opts
18
+ * @param {Pick<
19
+ * import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
20
+ * 'brand'
21
+ * >} agoricNames
22
+ * @param {| { giveMinted?: number; wantMinted?: number }
23
+ * | {
24
+ * collateralBrandKey: string;
25
+ * giveCollateral?: number;
26
+ * wantCollateral?: number;
27
+ * }} opts
20
28
  * @returns {Proposal}
21
29
  */
22
30
  const makeVaultProposal = ({ brand }, opts) => {
@@ -54,8 +62,16 @@ const makeVaultProposal = ({ brand }, opts) => {
54
62
  };
55
63
 
56
64
  /**
57
- * @param {Pick<import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes, 'brand'>} agoricNames
58
- * @param {{ offerId: string, wantMinted: number, giveCollateral: number, collateralBrandKey: string }} opts
65
+ * @param {Pick<
66
+ * import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
67
+ * 'brand'
68
+ * >} agoricNames
69
+ * @param {{
70
+ * offerId: string;
71
+ * wantMinted: number;
72
+ * giveCollateral: number;
73
+ * collateralBrandKey: string;
74
+ * }} opts
59
75
  * @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
60
76
  */
61
77
  const makeOpenOffer = ({ brand }, opts) => {
@@ -82,8 +98,18 @@ const makeOpenOffer = ({ brand }, opts) => {
82
98
  };
83
99
 
84
100
  /**
85
- * @param {Pick<import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes, 'brand'>} agoricNames
86
- * @param {{ offerId: string, collateralBrandKey?: string, giveCollateral?: number, wantCollateral?: number, giveMinted?: number, wantMinted?: number }} opts
101
+ * @param {Pick<
102
+ * import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
103
+ * 'brand'
104
+ * >} agoricNames
105
+ * @param {{
106
+ * offerId: string;
107
+ * collateralBrandKey?: string;
108
+ * giveCollateral?: number;
109
+ * wantCollateral?: number;
110
+ * giveMinted?: number;
111
+ * wantMinted?: number;
112
+ * }} opts
87
113
  * @param {string} previousOffer
88
114
  * @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
89
115
  */
@@ -105,8 +131,15 @@ const makeAdjustOffer = ({ brand }, opts, previousOffer) => {
105
131
  };
106
132
 
107
133
  /**
108
- * @param {Pick<import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes, 'brand'>} agoricNames
109
- * @param {{ offerId: string, collateralBrandKey?: string, giveMinted: number }} opts
134
+ * @param {Pick<
135
+ * import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
136
+ * 'brand'
137
+ * >} agoricNames
138
+ * @param {{
139
+ * offerId: string;
140
+ * collateralBrandKey?: string;
141
+ * giveMinted: number;
142
+ * }} opts
110
143
  * @param {string} previousOffer
111
144
  * @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
112
145
  */
@@ -126,7 +159,9 @@ const makeCloseOffer = ({ brand }, opts, previousOffer) => {
126
159
 
127
160
  /**
128
161
  * @param {string} vaultId
129
- * @param {Promise<import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord>} currentP
162
+ * @param {Promise<
163
+ * import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord
164
+ * >} currentP
130
165
  * @returns {Promise<string>} offer id in which the vault was made
131
166
  */
132
167
  export const lookupOfferIdForVault = async (vaultId, currentP) => {
@@ -141,8 +176,12 @@ export const lookupOfferIdForVault = async (vaultId, currentP) => {
141
176
  };
142
177
 
143
178
  /**
144
- * @param {Record<string, import('@agoric/internal/src/marshal.js').BoardRemote>} brands
145
- * @param {({ wantMinted: number, giveMinted?: undefined } | { giveMinted: number, wantMinted?: undefined })} opts
179
+ * @param {Record<
180
+ * string,
181
+ * import('@agoric/internal/src/marshal.js').BoardRemote
182
+ * >} brands
183
+ * @param {| { wantMinted: number; giveMinted?: undefined }
184
+ * | { giveMinted: number; wantMinted?: undefined }} opts
146
185
  * @param {number} [fee]
147
186
  * @param {string} [anchor]
148
187
  */
@@ -170,10 +209,15 @@ const makePsmProposal = (brands, opts, fee = 0, anchor = 'AUSD') => {
170
209
  };
171
210
 
172
211
  /**
173
- * @param {Pick<import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes, 'brand'>} agoricNames
212
+ * @param {Pick<
213
+ * import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
214
+ * 'brand'
215
+ * >} agoricNames
174
216
  * @param {Instance} instance
175
- * @param {{ offerId: string, feePct?: number, pair: [string, string] } &
176
- * ({ wantMinted: number } | { giveMinted: number })} opts
217
+ * @param {{ offerId: string; feePct?: number; pair: [string, string] } & (
218
+ * | { wantMinted: number }
219
+ * | { giveMinted: number }
220
+ * )} opts
177
221
  * @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
178
222
  */
179
223
  const makePsmSwapOffer = ({ brand }, instance, opts) => {
@@ -205,7 +249,10 @@ const makePsmSwapOffer = ({ brand }, instance, opts) => {
205
249
  };
206
250
 
207
251
  /**
208
- * @param {Pick<import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes, 'brand' | 'vbankAsset'>} agoricNames
252
+ * @param {Pick<
253
+ * import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
254
+ * 'brand' | 'vbankAsset'
255
+ * >} agoricNames
209
256
  * @param {(msg: string) => Error} makeError error constructor
210
257
  * @returns {(a: string) => Amount<'nat'>}
211
258
  */
@@ -243,17 +290,23 @@ export const makeParseAmount =
243
290
  };
244
291
 
245
292
  /**
246
- * @param {Pick<import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes, 'brand' | 'vbankAsset'>} agoricNames
293
+ * @param {Pick<
294
+ * import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
295
+ * 'brand' | 'vbankAsset'
296
+ * >} agoricNames
247
297
  * @param {{
248
- * offerId: string,
249
- * give: string,
250
- * maxBuy: string,
251
- * wantMinimum?: string,
252
- * } & ({
253
- * price: number,
254
- * } | {
255
- * discount: number, // -1 to 1. e.g. 0.10 for 10% discount, -0.05 for 5% markup
256
- * })} opts
298
+ * offerId: string;
299
+ * give: string;
300
+ * maxBuy: string;
301
+ * wantMinimum?: string;
302
+ * } & (
303
+ * | {
304
+ * price: number;
305
+ * }
306
+ * | {
307
+ * discount: number; // -1 to 1. e.g. 0.10 for 10% discount, -0.05 for 5% markup
308
+ * }
309
+ * )} opts
257
310
  * @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
258
311
  */
259
312
  const makeBidOffer = (agoricNames, opts) => {
@@ -312,11 +365,14 @@ const makeBidOffer = (agoricNames, opts) => {
312
365
  };
313
366
 
314
367
  /**
315
- * @param {Pick<import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes, 'brand'>} agoricNames
368
+ * @param {Pick<
369
+ * import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
370
+ * 'brand'
371
+ * >} agoricNames
316
372
  * @param {{
317
- * offerId: string,
318
- * give: number,
319
- * collateralBrandKey: string,
373
+ * offerId: string;
374
+ * give: number;
375
+ * collateralBrandKey: string;
320
376
  * }} opts
321
377
  * @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
322
378
  */
@@ -344,12 +400,11 @@ const makeAddCollateralOffer = ({ brand }, opts) => {
344
400
  };
345
401
 
346
402
  /**
347
- *
348
403
  * @param {unknown} _agoricNames
349
404
  * @param {{
350
- * offerId: string,
351
- * roundId?: bigint,
352
- * unitPrice: bigint,
405
+ * offerId: string;
406
+ * roundId?: bigint;
407
+ * unitPrice: bigint;
353
408
  * }} opts
354
409
  * @param {string} previousOffer
355
410
  * @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
@@ -370,7 +425,10 @@ const makePushPriceOffer = (_agoricNames, opts, previousOffer) => {
370
425
  };
371
426
 
372
427
  /**
373
- * @satisfies {Record<string, Record<string, import('@agoric/smart-wallet/src/types.js').OfferMaker>>}
428
+ * @satisfies {Record<
429
+ * string,
430
+ * Record<string, import('@agoric/smart-wallet/src/types.js').OfferMaker>
431
+ * >}
374
432
  */
375
433
  export const Offers = {
376
434
  auction: {
@@ -13,11 +13,11 @@ export const ratioPattern = harden({
13
13
  });
14
14
 
15
15
  /**
16
- * Apply a delta to the `base` Amount, where the delta is represented as
17
- * an amount to gain and an amount to lose. Typically one of those will
18
- * be empty because gain/loss comes from the give/want for a specific asset
19
- * on a proposal. We use two Amounts because an Amount cannot represent
20
- * a negative number (so we use a "loss" that will be subtracted).
16
+ * Apply a delta to the `base` Amount, where the delta is represented as an
17
+ * amount to gain and an amount to lose. Typically one of those will be empty
18
+ * because gain/loss comes from the give/want for a specific asset on a
19
+ * proposal. We use two Amounts because an Amount cannot represent a negative
20
+ * number (so we use a "loss" that will be subtracted).
21
21
  *
22
22
  * @template {AssetKind} K
23
23
  * @param {Amount<K>} base
@@ -1,10 +1,8 @@
1
1
  /**
2
- * @file
3
- *
4
- * This contract makes it possible for those who govern contracts to call for
5
- * votes on changes. A more complete implementation would validate parameters,
6
- * constrain deadlines and possibly split the ability to call for votes into
7
- * separate capabilities for finer grain encapsulation.
2
+ * @file This contract makes it possible for those who govern contracts to call
3
+ * for votes on changes. A more complete implementation would validate
4
+ * parameters, constrain deadlines and possibly split the ability to call for
5
+ * votes into separate capabilities for finer grain encapsulation.
8
6
  */
9
7
  export const INVITATION_MAKERS_DESC: "charter member invitation";
10
8
  export namespace customTermsShape {
@@ -1 +1 @@
1
- {"version":3,"file":"econCommitteeCharter.d.ts","sourceRoot":"","sources":["econCommitteeCharter.js"],"names":[],"mappings":"AAcA;;;;;;;GAOG;AAEH,iEAAkE;;;;AAgC3D,6BAJI,IAAI;IAAC,6BAA6B,EAAE,YAAY,CAAA;CAAC,CAAC,eAClD,SAAS;;QAsHd;;;;WAIG;wCAHQ,QAAQ,iBACR,qBAAqB,GAAG,CAAC;;;QAFpC;;;;WAIG;wCAHQ,QAAQ,iBACR,qBAAqB,GAAG,CAAC;;;GAazC;;cA9Ja,MAAM;cACN,QAAQ;YACR,OAAO,MAAM,EAAE,OAAO,CAAC;;mBACX;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE;;;kCAnBlC,+BAA+B"}
1
+ {"version":3,"file":"econCommitteeCharter.d.ts","sourceRoot":"","sources":["econCommitteeCharter.js"],"names":[],"mappings":"AAcA;;;;;GAKG;AAEH,iEAAkE;;;;AA8B3D,6BAJI,IAAI;IAAE,6BAA6B,EAAE,YAAY,CAAA;CAAE,CAAC,eACpD,SAAS;;QAsHd;;;;WAIG;wCAHQ,QAAQ,iBACR,qBAAqB,GAAG,CAAC;;;QAFpC;;;;WAIG;wCAHQ,QAAQ,iBACR,qBAAqB,GAAG,CAAC;;;GAazC;;cA5Ja,MAAM;cACN,QAAQ;YACR,OAAO,MAAM,EAAE,OAAO,CAAC;;mBACV;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE;;;kCAjBnC,+BAA+B"}
@@ -13,12 +13,10 @@ import {
13
13
  import { E } from '@endo/far';
14
14
 
15
15
  /**
16
- * @file
17
- *
18
- * This contract makes it possible for those who govern contracts to call for
19
- * votes on changes. A more complete implementation would validate parameters,
20
- * constrain deadlines and possibly split the ability to call for votes into
21
- * separate capabilities for finer grain encapsulation.
16
+ * @file This contract makes it possible for those who govern contracts to call
17
+ * for votes on changes. A more complete implementation would validate
18
+ * parameters, constrain deadlines and possibly split the ability to call for
19
+ * votes into separate capabilities for finer grain encapsulation.
22
20
  */
23
21
 
24
22
  export const INVITATION_MAKERS_DESC = 'charter member invitation';
@@ -28,7 +26,7 @@ export const INVITATION_MAKERS_DESC = 'charter member invitation';
28
26
  * @property {bigint} deadline
29
27
  * @property {Instance} instance
30
28
  * @property {Record<string, unknown>} params
31
- * @property {{paramPath: { key: string }}} [path]
29
+ * @property {{ paramPath: { key: string } }} [path]
32
30
  */
33
31
  const ParamChangesOfferArgsShape = M.splitRecord(
34
32
  {
@@ -41,15 +39,13 @@ const ParamChangesOfferArgsShape = M.splitRecord(
41
39
  },
42
40
  );
43
41
 
44
- /**
45
- * A pattern for Zoe to check custom terms before `start()`ing the contract.
46
- */
42
+ /** A pattern for Zoe to check custom terms before `start()`ing the contract. */
47
43
  export const customTermsShape = harden({
48
44
  binaryVoteCounterInstallation: InstallationShape,
49
45
  });
50
46
 
51
47
  /**
52
- * @param {ZCF<{binaryVoteCounterInstallation: Installation}>} zcf
48
+ * @param {ZCF<{ binaryVoteCounterInstallation: Installation }>} zcf
53
49
  * @param {undefined} privateArgs
54
50
  * @param {import('@agoric/vat-data').Baggage} baggage
55
51
  */
@@ -35,9 +35,7 @@ export function makeFeeDistributor(feeIssuer: ERef<Issuer<'nat'>>, terms: {
35
35
  * @param {ERef<FeeCollector>} collectorP
36
36
  */
37
37
  startPeriodicCollection: (debugName: string, collectorP: ERef<FeeCollector>) => Promise<PeriodicFeeCollector>;
38
- /**
39
- * @param {import('@endo/far').EOnly<DepositFacet>} depositFacet
40
- */
38
+ /** @param {import('@endo/far').EOnly<DepositFacet>} depositFacet */
41
39
  makeDepositFacetDestination: (depositFacet: import('@endo/far').EOnly<DepositFacet>) => {
42
40
  pushPayment: (payment: any, _issuer: any) => Promise<Amount<AssetKind>>;
43
41
  } & import("@endo/eventual-send").RemotableBrand<{}, {
@@ -57,9 +55,7 @@ export function makeFeeDistributor(feeIssuer: ERef<Issuer<'nat'>>, terms: {
57
55
  } & import("@endo/eventual-send").RemotableBrand<{}, {
58
56
  pushPayment: (payment: any, issuer: any) => Promise<any>;
59
57
  }>;
60
- /**
61
- * @param {Record<Keyword, ERef<FeeDestination>>} newDestinations
62
- */
58
+ /** @param {Record<Keyword, ERef<FeeDestination>>} newDestinations */
63
59
  setDestinations: (newDestinations: Record<Keyword, ERef<FeeDestination>>) => Promise<void>;
64
60
  /** @param {Record<Keyword, bigint>} newShares */
65
61
  setKeywordShares: (newShares: Record<Keyword, bigint>) => void;
@@ -76,9 +72,7 @@ export function makeFeeDistributor(feeIssuer: ERef<Issuer<'nat'>>, terms: {
76
72
  * @param {ERef<FeeCollector>} collectorP
77
73
  */
78
74
  startPeriodicCollection: (debugName: string, collectorP: ERef<FeeCollector>) => Promise<PeriodicFeeCollector>;
79
- /**
80
- * @param {import('@endo/far').EOnly<DepositFacet>} depositFacet
81
- */
75
+ /** @param {import('@endo/far').EOnly<DepositFacet>} depositFacet */
82
76
  makeDepositFacetDestination: (depositFacet: import('@endo/far').EOnly<DepositFacet>) => {
83
77
  pushPayment: (payment: any, _issuer: any) => Promise<Amount<AssetKind>>;
84
78
  } & import("@endo/eventual-send").RemotableBrand<{}, {
@@ -98,9 +92,7 @@ export function makeFeeDistributor(feeIssuer: ERef<Issuer<'nat'>>, terms: {
98
92
  } & import("@endo/eventual-send").RemotableBrand<{}, {
99
93
  pushPayment: (payment: any, issuer: any) => Promise<any>;
100
94
  }>;
101
- /**
102
- * @param {Record<Keyword, ERef<FeeDestination>>} newDestinations
103
- */
95
+ /** @param {Record<Keyword, ERef<FeeDestination>>} newDestinations */
104
96
  setDestinations: (newDestinations: Record<Keyword, ERef<FeeDestination>>) => Promise<void>;
105
97
  /** @param {Record<Keyword, bigint>} newShares */
106
98
  setKeywordShares: (newShares: Record<Keyword, bigint>) => void;
@@ -131,9 +123,7 @@ export function start(zcf: ZCF<[feeIssuer: ERef<Issuer<"nat">>, terms: {
131
123
  * @param {ERef<FeeCollector>} collectorP
132
124
  */
133
125
  startPeriodicCollection: (debugName: string, collectorP: ERef<FeeCollector>) => Promise<PeriodicFeeCollector>;
134
- /**
135
- * @param {import('@endo/far').EOnly<DepositFacet>} depositFacet
136
- */
126
+ /** @param {import('@endo/far').EOnly<DepositFacet>} depositFacet */
137
127
  makeDepositFacetDestination: (depositFacet: import('@endo/far').EOnly<DepositFacet>) => {
138
128
  pushPayment: (payment: any, _issuer: any) => Promise<Amount<AssetKind>>;
139
129
  } & import("@endo/eventual-send").RemotableBrand<{}, {
@@ -153,9 +143,7 @@ export function start(zcf: ZCF<[feeIssuer: ERef<Issuer<"nat">>, terms: {
153
143
  } & import("@endo/eventual-send").RemotableBrand<{}, {
154
144
  pushPayment: (payment: any, issuer: any) => Promise<any>;
155
145
  }>;
156
- /**
157
- * @param {Record<Keyword, ERef<FeeDestination>>} newDestinations
158
- */
146
+ /** @param {Record<Keyword, ERef<FeeDestination>>} newDestinations */
159
147
  setDestinations: (newDestinations: Record<Keyword, ERef<FeeDestination>>) => Promise<void>;
160
148
  /** @param {Record<Keyword, bigint>} newShares */
161
149
  setKeywordShares: (newShares: Record<Keyword, bigint>) => void;
@@ -172,9 +160,7 @@ export function start(zcf: ZCF<[feeIssuer: ERef<Issuer<"nat">>, terms: {
172
160
  * @param {ERef<FeeCollector>} collectorP
173
161
  */
174
162
  startPeriodicCollection: (debugName: string, collectorP: ERef<FeeCollector>) => Promise<PeriodicFeeCollector>;
175
- /**
176
- * @param {import('@endo/far').EOnly<DepositFacet>} depositFacet
177
- */
163
+ /** @param {import('@endo/far').EOnly<DepositFacet>} depositFacet */
178
164
  makeDepositFacetDestination: (depositFacet: import('@endo/far').EOnly<DepositFacet>) => {
179
165
  pushPayment: (payment: any, _issuer: any) => Promise<Amount<AssetKind>>;
180
166
  } & import("@endo/eventual-send").RemotableBrand<{}, {
@@ -194,9 +180,7 @@ export function start(zcf: ZCF<[feeIssuer: ERef<Issuer<"nat">>, terms: {
194
180
  } & import("@endo/eventual-send").RemotableBrand<{}, {
195
181
  pushPayment: (payment: any, issuer: any) => Promise<any>;
196
182
  }>;
197
- /**
198
- * @param {Record<Keyword, ERef<FeeDestination>>} newDestinations
199
- */
183
+ /** @param {Record<Keyword, ERef<FeeDestination>>} newDestinations */
200
184
  setDestinations: (newDestinations: Record<Keyword, ERef<FeeDestination>>) => Promise<void>;
201
185
  /** @param {Record<Keyword, bigint>} newShares */
202
186
  setKeywordShares: (newShares: Record<Keyword, bigint>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"feeDistributor.d.ts","sourceRoot":"","sources":["feeDistributor.js"],"names":[],"mappings":";;;;;AAkDO,8CAHI,KAAK,UAAU,CAAC,gBAChB,KAAK,wBAAwB,CAAC;;;;GAWxC;AAaM,oDALI,MAAM,QAAQ,OAAO,CAAC,gBACtB,KAAK,YAAY,CAAC,wFA8B5B;AAQM;;;;;;EAaN;AAWM,sCAJI,QAAQ,KAAK,CAAC,UACd,KAAK,OAAO,KAAK,CAAC,CAAC,2BACnB,WAAW,iBA+DrB;AAMM,8CAHI,KAAK,OAAO,KAAK,CAAC,CAAC;mBACF,OAAO,OAAO,EAAE,QAAQ,CAAC;kBAAgB,KAAK,YAAY,CAAC;wBAAsB,YAAY;;;wCApJ9G,KAAK,UAAU,CAAC,gBAChB,KAAK,wBAAwB,CAAC;;;;;QAsLrC;;;;;WAKG;6CAFQ,MAAM,cACN,KAAK,YAAY,CAAC;QA6B7B;;WAEG;oDADQ,OAAO,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC;;;;;QASlD;;;;;;;;WAQG;oCALQ,KAAK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 
10
10
  const KeywordSharesShape = M.recordOf(KeywordShape, M.nat());
11
11
 
12
- /**
13
- * A pattern for Zoe to check custom terms before `start()`ing the contract.
14
- */
12
+ /** A pattern for Zoe to check custom terms before `start()`ing the contract. */
15
13
  export const customTermsShape = harden({
16
14
  keywordShares: KeywordSharesShape,
17
15
  timerService: M.eref(M.remotable('TimerService')),
@@ -20,12 +18,12 @@ export const customTermsShape = harden({
20
18
 
21
19
  /**
22
20
  * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime
21
+ *
23
22
  * @typedef {import('@agoric/time/src/types').TimerService} TimerService
24
23
  */
25
24
 
26
25
  /**
27
26
  * @typedef {object} FeeCollector
28
- *
29
27
  * @property {() => ERef<Payment<'nat'>>} collectFees
30
28
  */
31
29
 
@@ -65,10 +63,12 @@ export const makeContractFeeCollector = (zoe, creatorFacet) => {
65
63
  * for fees that have been collected to date and send that payment to the
66
64
  * depositFacet.
67
65
  *
68
- * @param {() => Promise<unknown>} schedulePayments - distribute to the destinations
69
- * @param {ERef<TimerService>} timerService - timer that is used to schedule collections
66
+ * @param {() => Promise<unknown>} schedulePayments - distribute to the
67
+ * destinations
68
+ * @param {ERef<TimerService>} timerService - timer that is used to schedule
69
+ * collections
70
70
  * @param {RelativeTime} [collectionInterval] - how often to collect fees in the
71
- * `timerService` unit
71
+ * `timerService` unit
72
72
  */
73
73
  export const startDistributing = (
74
74
  schedulePayments,
@@ -99,8 +99,9 @@ export const startDistributing = (
99
99
  };
100
100
 
101
101
  /**
102
- * @typedef {{ pushPayment: (payment: Payment, issuer: ERef<Issuer>) => Promise<Amount>}} FeeDestination
103
- *
102
+ * @typedef {{
103
+ * pushPayment: (payment: Payment, issuer: ERef<Issuer>) => Promise<Amount>;
104
+ * }} FeeDestination
104
105
  * @param {Record<Keyword, ERef<FeeDestination>>} [destinations]
105
106
  * @param {Record<Keyword, NatValue>} [keywordShares]
106
107
  */
@@ -161,17 +162,16 @@ export const sharePayment = async (
161
162
  .filter(([_, amt]) => !AmountMath.isEmpty(amt));
162
163
 
163
164
  /**
164
- * If the `sharedPayment[i]` payments that are sent to the fee
165
- * `destination` with `pushPayment` never arrive, or never get deposited
166
- * (or otherwise used up), then they remain in the recovery set of the
167
- * `recoveryPurse`. The purpose of this, and of recovery sets in general,
168
- * is to be able, in emergencies, to recover the assets of payments in flight
169
- * that seem to be stuck. This is much like cancelling a check that may still
170
- * be undeposited.
165
+ * If the `sharedPayment[i]` payments that are sent to the fee `destination`
166
+ * with `pushPayment` never arrive, or never get deposited (or otherwise used
167
+ * up), then they remain in the recovery set of the `recoveryPurse`. The
168
+ * purpose of this, and of recovery sets in general, is to be able, in
169
+ * emergencies, to recover the assets of payments in flight that seem to be
170
+ * stuck. This is much like cancelling a check that may still be undeposited.
171
171
  *
172
172
  * TODO: However, for this to be possible, the `recoveryPurse` holding that
173
- * recovery set must remain accessible to someone that should legitimately
174
- * be able to recover those payments. But this `recoveryPurse` is currently
173
+ * recovery set must remain accessible to someone that should legitimately be
174
+ * able to recover those payments. But this `recoveryPurse` is currently
175
175
  * dropped on the floor instead.
176
176
  */
177
177
  const recoveryPurse = E(issuer).makeEmptyPurse();
@@ -193,7 +193,11 @@ export const sharePayment = async (
193
193
 
194
194
  /**
195
195
  * @param {ERef<Issuer<'nat'>>} feeIssuer
196
- * @param {{ keywordShares: Record<Keyword, NatValue>, timerService: ERef<TimerService>, collectionInterval: RelativeTime}} terms
196
+ * @param {{
197
+ * keywordShares: Record<Keyword, NatValue>;
198
+ * timerService: ERef<TimerService>;
199
+ * collectionInterval: RelativeTime;
200
+ * }} terms
197
201
  */
198
202
  export const makeFeeDistributor = (feeIssuer, terms) => {
199
203
  const { timerService, collectionInterval } = terms;
@@ -261,9 +265,7 @@ export const makeFeeDistributor = (feeIssuer, terms) => {
261
265
  return periodicCollector;
262
266
  },
263
267
 
264
- /**
265
- * @param {import('@endo/far').EOnly<DepositFacet>} depositFacet
266
- */
268
+ /** @param {import('@endo/far').EOnly<DepositFacet>} depositFacet */
267
269
  makeDepositFacetDestination: depositFacet => {
268
270
  return Far(`DepositFacetDestination`, {
269
271
  pushPayment: async (payment, _issuer) => {
@@ -315,9 +317,7 @@ export const makeFeeDistributor = (feeIssuer, terms) => {
315
317
  });
316
318
  },
317
319
 
318
- /**
319
- * @param {Record<Keyword, ERef<FeeDestination>>} newDestinations
320
- */
320
+ /** @param {Record<Keyword, ERef<FeeDestination>>} newDestinations */
321
321
  setDestinations: async newDestinations => {
322
322
  destinations = newDestinations;
323
323
  shareConfig = makeShareConfig(destinations, keywordShares);
@@ -344,9 +344,7 @@ export const makeFeeDistributor = (feeIssuer, terms) => {
344
344
  /** @typedef {ReturnType<typeof makeFeeDistributor>['creatorFacet']} FeeDistributorCreatorFacet */
345
345
  /** @typedef {ReturnType<typeof makeFeeDistributor>['publicFacet']} FeeDistributorPublicFacet */
346
346
 
347
- /**
348
- * @param {ZCF<Parameters<typeof makeFeeDistributor>[1]>} zcf
349
- */
347
+ /** @param {ZCF<Parameters<typeof makeFeeDistributor>[1]>} zcf */
350
348
  export const start = async zcf => {
351
349
  const feeIssuer = E(zcf.getZoeService()).getFeeIssuer();
352
350
  return makeFeeDistributor(feeIssuer, zcf.getTerms());
package/src/interest.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp
3
+ *
3
4
  * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime
4
5
  */
5
6
  export const SECONDS_PER_YEAR: bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"interest.d.ts","sourceRoot":"","sources":["interest.js"],"names":[],"mappings":"AAYA;;;GAGG;AAEH,sCAAuD;AAgBhD,mDALI,KAAK,kBACL,YAAY,mBACZ,YAAY,GACV,aAAa,CA+EzB;AASM,6EAJI,KAAK,aACL,QAAQ,WACR,QAAQ,SAalB;AAkCM,uCAhBI;IACV,IAAO,EAAE,QAAQ,KAAK,CAAC,CAAC;IACxB,sBAAyB,EAAE,eAAe,CAAC;IAC3C,iBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAwB,EAAE,OAAO,CAAA;CAAE,UACzB;IACV,YAAe,EAAE,KAAK,CAAC;IACvB,cAAiB,EAAE,YAAY,CAAC;IAChC,eAAkB,EAAE,YAAY,CAAA;CAAC;8BAEJ,SAAS;4BACX,KAAK;eAClB,OAAO,KAAK,CAAC;iBACjB,SAAS;4BACkB,KAAK;8BAA4B,SAAS;eAAa,OAAO,KAAK,CAAC;EA8DzG;wBAnNY,OAAO,wBAAwB,EAAE,SAAS;2BAC1C,OAAO,wBAAwB,EAAE,YAAY"}
1
+ {"version":3,"file":"interest.d.ts","sourceRoot":"","sources":["interest.js"],"names":[],"mappings":"AAYA;;;;GAIG;AAEH,sCAAuD;AAchD,mDALI,KAAK,kBACL,YAAY,mBACZ,YAAY,GACV,aAAa,CA+EzB;AASM,6EAJI,KAAK,aACL,QAAQ,WACR,QAAQ,SAalB;AA0CM,uCAvBI;IACV,IAAQ,EAAE,QAAQ,KAAK,CAAC,CAAC;IACzB,sBAA0B,EAAE,eAAe,CAAC;IAC5C,iBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAyB,EAAE,OAAO,CAAC;CAChC,UACO;IACV,YAAgB,EAAE,KAAK,CAAC;IACxB,cAAkB,EAAE,YAAY,CAAC;IACjC,eAAmB,EAAE,YAAY,CAAC;CAC/B;8BAE2B,SAAS;4BACX,KAAK;eAClB,OAAO,KAAK,CAAC;iBAElB,SAAS;4BAES,KAAK;8BACH,SAAS;eACxB,OAAO,KAAK,CAAC;EA+D5B;wBA1NY,OAAO,wBAAwB,EAAE,SAAS;2BAE1C,OAAO,wBAAwB,EAAE,YAAY"}
package/src/interest.js CHANGED
@@ -12,6 +12,7 @@ import { TimeMath } from '@agoric/time';
12
12
 
13
13
  /**
14
14
  * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp
15
+ *
15
16
  * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime
16
17
  */
17
18
 
@@ -20,9 +21,7 @@ const BASIS_POINTS = 10000;
20
21
  // single digit APR is less than a basis point per day.
21
22
  const LARGE_DENOMINATOR = BASIS_POINTS * BASIS_POINTS;
22
23
 
23
- /**
24
- * Number chosen from 6 digits for a basis point, doubled for multiplication.
25
- */
24
+ /** Number chosen from 6 digits for a basis point, doubled for multiplication. */
26
25
  const COMPOUNDED_INTEREST_DENOMINATOR = 10n ** 20n;
27
26
 
28
27
  /**
@@ -144,23 +143,31 @@ const validatedBrand = (mint, debt) => {
144
143
  };
145
144
 
146
145
  /**
147
- * Charge interest accrued between `latestStabilityFeeUpdate` and `accruedUntil`.
146
+ * Charge interest accrued between `latestStabilityFeeUpdate` and
147
+ * `accruedUntil`.
148
148
  *
149
149
  * @param {{
150
- * mint: ZCFMint<'nat'>,
151
- * mintAndTransferWithFee: MintAndTransfer,
152
- * poolIncrementSeat: ZCFSeat,
153
- * seatAllocationKeyword: Keyword }} powers
150
+ * mint: ZCFMint<'nat'>;
151
+ * mintAndTransferWithFee: MintAndTransfer;
152
+ * poolIncrementSeat: ZCFSeat;
153
+ * seatAllocationKeyword: Keyword;
154
+ * }} powers
154
155
  * @param {{
155
- * stabilityFee: Ratio,
156
- * chargingPeriod: RelativeTime,
157
- * recordingPeriod: RelativeTime}} params
156
+ * stabilityFee: Ratio;
157
+ * chargingPeriod: RelativeTime;
158
+ * recordingPeriod: RelativeTime;
159
+ * }} params
158
160
  * @param {{
159
- * latestStabilityFeeUpdate: Timestamp,
160
- * compoundedStabilityFee: Ratio,
161
- * totalDebt: Amount<'nat'>}} prior
161
+ * latestStabilityFeeUpdate: Timestamp;
162
+ * compoundedStabilityFee: Ratio;
163
+ * totalDebt: Amount<'nat'>;
164
+ * }} prior
162
165
  * @param {Timestamp} accruedUntil
163
- * @returns {{compoundedStabilityFee: Ratio, latestStabilityFeeUpdate: Timestamp, totalDebt: Amount<'nat'> }}
166
+ * @returns {{
167
+ * compoundedStabilityFee: Ratio;
168
+ * latestStabilityFeeUpdate: Timestamp;
169
+ * totalDebt: Amount<'nat'>;
170
+ * }}
164
171
  */
165
172
  export const chargeInterest = (powers, params, prior, accruedUntil) => {
166
173
  const brand = validatedBrand(powers.mint, prior.totalDebt);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * @typedef {import('@agoric/vat-data').Baggage} Baggage
3
+ *
3
4
  * @typedef {import('@agoric/time/src/types').TimerService} TimerService
4
5
  */
5
6
  export const privateArgsShape: import("@endo/patterns").Matcher;
@@ -1 +1 @@
1
- {"version":3,"file":"fluxAggregatorContract.d.ts","sourceRoot":"","sources":["fluxAggregatorContract.js"],"names":[],"mappings":"AAkBA;;;GAGG;AAEH,gEAeE;AAuBK;WAfG,YAAY;aACV,MAAM,KAAK,CAAC;cACX,MAAM,KAAK,CAAC;iBACT,MAAM;;;;;;;;;;4BAKK,UAAU;gBACtB,KAAK,UAAU,CAAC;yBACP,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC;iBAC9C,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+H1B;sBArKY,OAAO,kBAAkB,EAAE,OAAO;2BAClC,OAAO,wBAAwB,EAAE,YAAY"}
1
+ {"version":3,"file":"fluxAggregatorContract.d.ts","sourceRoot":"","sources":["fluxAggregatorContract.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AAEH,gEAeE;AAyBK;WAhBO,YAAY;aACV,MAAM,KAAK,CAAC;cACX,MAAM,KAAK,CAAC;iBACT,MAAM;;;;;;;;;;4BAMG,UAAU;gBACtB,KAAK,UAAU,CAAC;yBACP,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC;iBAC9C,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiI5B;sBA1KY,OAAO,kBAAkB,EAAE,OAAO;2BAElC,OAAO,wBAAwB,EAAE,YAAY"}