@agoric/inter-protocol 0.13.2-dev-4e866ab.0 → 0.13.2-dev-2354e8d.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 (36) hide show
  1. package/README.md +8 -7
  2. package/bundles/bundle-auctioneer-js-meta.json +115 -115
  3. package/bundles/bundle-auctioneer.js +1 -1
  4. package/bundles/bundle-econCommitteeCharter-js-meta.json +71 -71
  5. package/bundles/bundle-econCommitteeCharter.js +1 -1
  6. package/bundles/bundle-feeDistributor-js-meta.json +57 -57
  7. package/bundles/bundle-feeDistributor.js +1 -1
  8. package/bundles/bundle-fluxAggregatorKit-js-meta.json +110 -110
  9. package/bundles/bundle-fluxAggregatorKit.js +1 -1
  10. package/bundles/bundle-psm-js-meta.json +108 -108
  11. package/bundles/bundle-psm.js +1 -1
  12. package/bundles/bundle-reserve-js-meta.json +106 -106
  13. package/bundles/bundle-reserve.js +1 -1
  14. package/bundles/bundle-scaledPriceAuthority-js-meta.json +77 -77
  15. package/bundles/bundle-scaledPriceAuthority.js +1 -1
  16. package/bundles/bundle-stakeFactory-js-meta.json +114 -114
  17. package/bundles/bundle-stakeFactory.js +1 -1
  18. package/bundles/bundle-vaultFactory-js-meta.json +131 -131
  19. package/bundles/bundle-vaultFactory.js +1 -1
  20. package/package.json +17 -17
  21. package/scripts/init-core.js +0 -2
  22. package/src/auction/auctionBook.js +0 -1
  23. package/src/auction/params.js +4 -4
  24. package/src/auction/scheduleMath.js +1 -1
  25. package/src/auction/scheduler.js +3 -3
  26. package/src/auction/sortedOffers.js +0 -1
  27. package/src/interest-math.js +0 -3
  28. package/src/interest.js +0 -1
  29. package/src/price/roundsManager.js +1 -1
  30. package/src/proposals/utils.js +0 -1
  31. package/src/stakeFactory/stakeFactory.js +0 -1
  32. package/src/stakeFactory/stakeFactoryManager.js +0 -1
  33. package/src/vaultFactory/liquidation.js +1 -1
  34. package/src/vaultFactory/prioritizedVaults.js +0 -2
  35. package/src/vaultFactory/vaultDirector.js +2 -1
  36. package/src/vaultFactory/vaultHolder.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/inter-protocol",
3
- "version": "0.13.2-dev-4e866ab.0+4e866ab",
3
+ "version": "0.13.2-dev-2354e8d.0+2354e8d",
4
4
  "description": "Core cryptoeconomy contracts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -29,29 +29,29 @@
29
29
  },
30
30
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
31
31
  "dependencies": {
32
- "@agoric/assert": "0.5.2-dev-4e866ab.0+4e866ab",
33
- "@agoric/ertp": "0.15.4-dev-4e866ab.0+4e866ab",
34
- "@agoric/governance": "0.9.2-dev-4e866ab.0+4e866ab",
35
- "@agoric/internal": "0.2.2-dev-4e866ab.0+4e866ab",
36
- "@agoric/notifier": "0.5.2-dev-4e866ab.0+4e866ab",
37
- "@agoric/store": "0.8.4-dev-4e866ab.0+4e866ab",
38
- "@agoric/time": "0.2.2-dev-4e866ab.0+4e866ab",
39
- "@agoric/vat-data": "0.4.4-dev-4e866ab.0+4e866ab",
40
- "@agoric/vats": "0.13.1-dev-4e866ab.0+4e866ab",
41
- "@agoric/zoe": "0.25.4-dev-4e866ab.0+4e866ab",
32
+ "@agoric/assert": "0.5.2-dev-2354e8d.0+2354e8d",
33
+ "@agoric/ertp": "0.15.4-dev-2354e8d.0+2354e8d",
34
+ "@agoric/governance": "0.9.2-dev-2354e8d.0+2354e8d",
35
+ "@agoric/internal": "0.2.2-dev-2354e8d.0+2354e8d",
36
+ "@agoric/notifier": "0.5.2-dev-2354e8d.0+2354e8d",
37
+ "@agoric/store": "0.8.4-dev-2354e8d.0+2354e8d",
38
+ "@agoric/time": "0.2.2-dev-2354e8d.0+2354e8d",
39
+ "@agoric/vat-data": "0.4.4-dev-2354e8d.0+2354e8d",
40
+ "@agoric/vats": "0.13.1-dev-2354e8d.0+2354e8d",
41
+ "@agoric/zoe": "0.25.4-dev-2354e8d.0+2354e8d",
42
42
  "@endo/captp": "^3.1.1",
43
43
  "@endo/eventual-send": "^0.17.2",
44
44
  "@endo/far": "^0.2.18",
45
45
  "@endo/marshal": "^0.8.5",
46
46
  "@endo/nat": "^4.1.27",
47
- "agoric": "0.18.3-dev-4e866ab.0+4e866ab",
47
+ "agoric": "0.18.3-dev-2354e8d.0+2354e8d",
48
48
  "jessie.js": "^0.3.2"
49
49
  },
50
50
  "devDependencies": {
51
- "@agoric/deploy-script-support": "0.9.5-dev-4e866ab.0+4e866ab",
52
- "@agoric/smart-wallet": "0.4.3-dev-4e866ab.0+4e866ab",
53
- "@agoric/swingset-liveslots": "0.9.1-dev-4e866ab.0+4e866ab",
54
- "@agoric/swingset-vat": "0.30.3-dev-4e866ab.0+4e866ab",
51
+ "@agoric/deploy-script-support": "0.9.5-dev-2354e8d.0+2354e8d",
52
+ "@agoric/smart-wallet": "0.4.3-dev-2354e8d.0+2354e8d",
53
+ "@agoric/swingset-liveslots": "0.9.1-dev-2354e8d.0+2354e8d",
54
+ "@agoric/swingset-vat": "0.30.3-dev-2354e8d.0+2354e8d",
55
55
  "@endo/bundle-source": "^2.5.1",
56
56
  "@endo/init": "^0.5.56",
57
57
  "@endo/promise-kit": "^0.2.56",
@@ -77,5 +77,5 @@
77
77
  "publishConfig": {
78
78
  "access": "public"
79
79
  },
80
- "gitHead": "4e866abef894254783ddc54ea684d2f23a94ef01"
80
+ "gitHead": "2354e8d4e23b6a9cc4be67a41d3c5a5119ef7d51"
81
81
  }
@@ -53,7 +53,6 @@ const installKeyGroups = {
53
53
  };
54
54
 
55
55
  /**
56
- *
57
56
  * @param {object} opts
58
57
  * @param {(i: I) => R} opts.publishRef
59
58
  * @param {(m: string, b: string, opts?: any) => I} opts.install
@@ -90,7 +89,6 @@ export const committeeProposalBuilder = async (
90
89
  };
91
90
 
92
91
  /**
93
- *
94
92
  * @param {object} opts
95
93
  * @param {(i: I) => R} opts.publishRef
96
94
  * @param {(m: string, b: string, opts?: any) => I} opts.install
@@ -64,7 +64,6 @@ const trace = makeTracer('AucBook', false);
64
64
  * })} OfferSpec
65
65
  */
66
66
  /**
67
- *
68
67
  * @param {Brand<'nat'>} bidBrand
69
68
  * @param {Brand<'nat'>} collateralBrand
70
69
  */
@@ -94,19 +94,19 @@ export const makeAuctioneerParams = ({
94
94
  },
95
95
  [START_FREQUENCY]: {
96
96
  type: ParamTypes.RELATIVE_TIME,
97
- value: TimeMath.toRel(StartFreq, TimerBrand),
97
+ value: TimeMath.coerceRelativeTimeRecord(StartFreq, TimerBrand),
98
98
  },
99
99
  [CLOCK_STEP]: {
100
100
  type: ParamTypes.RELATIVE_TIME,
101
- value: TimeMath.toRel(ClockStep, TimerBrand),
101
+ value: TimeMath.coerceRelativeTimeRecord(ClockStep, TimerBrand),
102
102
  },
103
103
  [AUCTION_START_DELAY]: {
104
104
  type: ParamTypes.RELATIVE_TIME,
105
- value: TimeMath.toRel(AuctionStartDelay, TimerBrand),
105
+ value: TimeMath.coerceRelativeTimeRecord(AuctionStartDelay, TimerBrand),
106
106
  },
107
107
  [PRICE_LOCK_PERIOD]: {
108
108
  type: ParamTypes.RELATIVE_TIME,
109
- value: TimeMath.toRel(PriceLockPeriod, TimerBrand),
109
+ value: TimeMath.coerceRelativeTimeRecord(PriceLockPeriod, TimerBrand),
110
110
  },
111
111
  [STARTING_RATE_BP]: { type: ParamTypes.NAT, value: StartingRate },
112
112
  [LOWEST_RATE_BP]: { type: ParamTypes.NAT, value: LowestRate },
@@ -48,7 +48,7 @@ export const computeRoundTiming = (params, baseTime) => {
48
48
  const targetDuration =
49
49
  TimeMath.compareRel(requestedDuration, freq) < 0
50
50
  ? requestedDuration
51
- : TimeMath.subtractRelRel(freq, TimeMath.toRel(1n));
51
+ : TimeMath.subtractRelRel(freq, 1n);
52
52
  const steps = TimeMath.divideRelRel(targetDuration, clockStep);
53
53
  const duration = TimeMath.multiplyRelNat(clockStep, steps);
54
54
 
@@ -79,7 +79,7 @@ export const makeScheduler = async (
79
79
  now => {
80
80
  const nextSchedule = computeRoundTiming(
81
81
  params,
82
- TimeMath.toAbs(now, timerBrand),
82
+ TimeMath.coerceTimestampRecord(now, timerBrand),
83
83
  );
84
84
  return { now, nextSchedule };
85
85
  },
@@ -147,7 +147,7 @@ export const makeScheduler = async (
147
147
  if (nextLock && TimeMath.compareAbs(now, nextLock) < 0) {
148
148
  const afterNow = TimeMath.addAbsRel(
149
149
  now,
150
- TimeMath.toRel(1n, timerBrand),
150
+ TimeMath.coerceRelativeTimeRecord(1n, timerBrand),
151
151
  );
152
152
  nextSchedule = computeRoundTiming(params, afterNow);
153
153
  }
@@ -223,7 +223,7 @@ export const makeScheduler = async (
223
223
 
224
224
  const after = TimeMath.addAbsRel(
225
225
  liveSchedule.endTime,
226
- TimeMath.toRel(1n, timerBrand),
226
+ TimeMath.coerceRelativeTimeRecord(1n, timerBrand),
227
227
  );
228
228
  nextSchedule = computeRoundTiming(params, after);
229
229
 
@@ -52,7 +52,6 @@ export const toPriceOfferKey = (offerPrice, sequenceNumber) => {
52
52
  };
53
53
 
54
54
  /**
55
- *
56
55
  * @param {number} floatPrice
57
56
  * @param {Brand<'nat'>} numBrand
58
57
  * @param {Brand<'nat'>} denomBrand
@@ -9,7 +9,6 @@ import {
9
9
  } from '@agoric/zoe/src/contractSupport/ratio.js';
10
10
 
11
11
  /**
12
- *
13
12
  * @param {Ratio} currentCompoundedInterest as coefficient
14
13
  * @param {Ratio} previousCompoundedInterest as coefficient
15
14
  * @returns {Ratio} additional compounding since the previous
@@ -26,7 +25,6 @@ const calculateRelativeCompounding = (
26
25
  };
27
26
 
28
27
  /**
29
- *
30
28
  * @param {Amount<'nat'>} debtSnapshot
31
29
  * @param {Ratio} interestSnapshot as coefficient
32
30
  * @param {Ratio} currentCompoundedInterest as coefficient
@@ -50,7 +48,6 @@ export const calculateCurrentDebt = (
50
48
  };
51
49
 
52
50
  /**
53
- *
54
51
  * @param {Amount<'nat'>} debt
55
52
  * @param {Ratio} interestApplied
56
53
  * @returns {Amount<'nat'>}
package/src/interest.js CHANGED
@@ -131,7 +131,6 @@ export const calculateCompoundedInterest = (
131
131
  };
132
132
 
133
133
  /**
134
- *
135
134
  * @template {AssetKind} K
136
135
  * @param {ZCFMint<K>} mint
137
136
  * @param {Amount<K>} debt
@@ -338,7 +338,7 @@ export const prepareRoundsManagerKit = baggage =>
338
338
  // TODO Better would be to make `roundTimeout` a `RelativeTime`
339
339
  // everywhere, and to rename it to a name that does not
340
340
  // mistakenly imply that it is an absolute time.
341
- const roundTimeoutDuration = TimeMath.toRel(roundTimeout);
341
+ const roundTimeoutDuration = TimeMath.relValue(BigInt(roundTimeout));
342
342
  const roundTimedOut =
343
343
  TimeMath.absValue(startedAt) > 0n &&
344
344
  TimeMath.relValue(roundTimeoutDuration) > 0n &&
@@ -91,7 +91,6 @@ const provideWhen = async (store, key, make) => {
91
91
  };
92
92
 
93
93
  /**
94
- *
95
94
  * @param {{ scratch: ERef<import('@agoric/internal/src/scratch.js').ScratchPad> }} homeP
96
95
  * @param {object} opts
97
96
  * @param {(specifier: string) => Promise<{default: Bundle}>} opts.loadBundle
@@ -78,7 +78,6 @@ import { makeStakeFactoryManager } from './stakeFactoryManager.js';
78
78
  */
79
79
 
80
80
  /**
81
- *
82
81
  * @param {ZCF<StakeFactoryTerms>} zcf
83
82
  * @param {StakeFactoryPrivateArgs} privateArgs
84
83
  */
@@ -111,7 +111,6 @@ const initState = (
111
111
  };
112
112
 
113
113
  /**
114
- *
115
114
  * @param {MethodContext} context
116
115
  */
117
116
  const finish = ({ state, facets }) => {
@@ -57,7 +57,7 @@ const scheduleLiquidationWakeups = async (
57
57
  nominalStart,
58
58
  priceLockPeriod,
59
59
  );
60
- const afterStart = TimeMath.addAbsRel(startTime, TimeMath.toRel(1n));
60
+ const afterStart = TimeMath.addAbsRel(startTime, 1n);
61
61
  const a = t => TimeMath.absValue(t);
62
62
  trace('scheduling ', a(priceLockWakeTime), a(nominalStart), a(startTime));
63
63
  void E(timer).setWakeup(priceLockWakeTime, priceLockWaker);
@@ -19,7 +19,6 @@ import {
19
19
  const trace = makeTracer('PVaults', false);
20
20
 
21
21
  /**
22
- *
23
22
  * @param {Amount<'nat'>} debtAmount
24
23
  * @param {Amount<'nat'>} collateralAmount
25
24
  * @returns {Ratio}
@@ -35,7 +34,6 @@ const calculateDebtToCollateral = (debtAmount, collateralAmount) => {
35
34
  };
36
35
 
37
36
  /**
38
- *
39
37
  * @param {Vault} vault
40
38
  * @returns {Ratio}
41
39
  */
@@ -137,6 +137,7 @@ export const prepareVaultDirector = (
137
137
  wake: timestamp => func(timestamp),
138
138
  });
139
139
  };
140
+ const managersNode = E(storageNode).makeChildNode('managers');
140
141
 
141
142
  const managerBaggages = provideChildBaggage(baggage, 'Vault Manager baggage');
142
143
 
@@ -296,7 +297,7 @@ export const prepareVaultDirector = (
296
297
 
297
298
  // counter to be incremented at end of addVaultType
298
299
  const managerId = `manager${state.managerCounter}`;
299
- const managerStorageNode = await E(storageNode).makeChildNode(
300
+ const managerStorageNode = await E(managersNode).makeChildNode(
300
301
  managerId,
301
302
  );
302
303
 
@@ -35,7 +35,6 @@ const PUBLIC_TOPICS = {
35
35
  };
36
36
 
37
37
  /**
38
- *
39
38
  * @param {import('@agoric/ertp').Baggage} baggage
40
39
  * @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit
41
40
  */