@agoric/inter-protocol 0.16.2-other-dev-3eb1a1d.0 → 0.16.2-other-dev-d15096d.0.d15096d
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 +36 -35
- package/src/auction/auctionBook.d.ts +9 -7
- package/src/auction/auctionBook.d.ts.map +1 -1
- package/src/auction/auctionBook.js +58 -32
- package/src/auction/auctionMath.d.ts +1 -1
- package/src/auction/auctionMath.d.ts.map +1 -1
- package/src/auction/auctioneer.d.ts +19 -13
- package/src/auction/auctioneer.d.ts.map +1 -1
- package/src/auction/auctioneer.js +25 -12
- package/src/auction/offerBook.d.ts +3 -2
- package/src/auction/offerBook.d.ts.map +1 -1
- package/src/auction/offerBook.js +5 -1
- package/src/auction/params.d.ts +16 -7
- package/src/auction/params.d.ts.map +1 -1
- package/src/auction/params.js +12 -4
- package/src/auction/scheduleMath.d.ts +5 -3
- package/src/auction/scheduleMath.d.ts.map +1 -1
- package/src/auction/scheduleMath.js +11 -7
- package/src/auction/scheduler.d.ts +9 -4
- package/src/auction/scheduler.d.ts.map +1 -1
- package/src/auction/scheduler.js +14 -6
- package/src/auction/util.d.ts +2 -1
- package/src/auction/util.d.ts.map +1 -1
- package/src/auction/util.js +4 -1
- package/src/clientSupport.d.ts +29 -73
- package/src/clientSupport.d.ts.map +1 -1
- package/src/clientSupport.js +29 -128
- package/src/contractSupport.d.ts +2 -2
- package/src/contractSupport.d.ts.map +1 -1
- package/src/econCommitteeCharter.d.ts +15 -8
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/econCommitteeCharter.js +14 -8
- package/src/feeDistributor.d.ts +43 -49
- package/src/feeDistributor.d.ts.map +1 -1
- package/src/feeDistributor.js +7 -3
- package/src/index.js +1 -1
- package/src/interest-math.d.ts +1 -0
- package/src/interest-math.d.ts.map +1 -1
- package/src/interest-math.js +5 -1
- package/src/interest.d.ts +3 -1
- package/src/interest.d.ts.map +1 -1
- package/src/interest.js +2 -5
- package/src/price/README.md +1 -1
- package/src/price/fluxAggregatorContract.d.ts +20 -11
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.js +17 -9
- package/src/price/fluxAggregatorKit.d.ts +15 -9
- package/src/price/fluxAggregatorKit.d.ts.map +1 -1
- package/src/price/fluxAggregatorKit.js +15 -9
- package/src/price/priceOracleKit.d.ts +4 -2
- package/src/price/priceOracleKit.d.ts.map +1 -1
- package/src/price/priceOracleKit.js +7 -2
- package/src/price/roundsManager.d.ts +8 -6
- package/src/price/roundsManager.d.ts.map +1 -1
- package/src/price/roundsManager.js +5 -2
- package/src/proposals/add-auction.js +38 -4
- package/src/proposals/addAssetToVault.js +8 -4
- package/src/proposals/committee-proposal.js +10 -5
- package/src/proposals/core-proposal.js +9 -3
- package/src/proposals/deploy-price-feeds.js +35 -7
- package/src/proposals/econ-behaviors.js +33 -12
- package/src/proposals/price-feed-proposal.js +10 -3
- package/src/proposals/replace-fee-distributor.js +12 -6
- package/src/proposals/replaceElectorate.js +105 -16
- package/src/proposals/startEconCommittee.js +5 -1
- package/src/proposals/startPSM.js +7 -4
- package/src/proposals/upgrade-vaults.js +15 -5
- package/src/proposals/utils.d.ts +8 -4
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +32 -9
- package/src/proposals/withdraw-reserve-proposal.js +63 -0
- package/src/provisionPool.d.ts +34 -120
- package/src/provisionPool.d.ts.map +1 -1
- package/src/provisionPool.js +43 -21
- package/src/provisionPoolKit.d.ts +43 -328
- package/src/provisionPoolKit.d.ts.map +1 -1
- package/src/provisionPoolKit.js +210 -120
- package/src/psm/psm.d.ts +20 -13
- package/src/psm/psm.d.ts.map +1 -1
- package/src/psm/psm.js +18 -12
- package/src/reserve/assetReserve.d.ts +18 -6
- package/src/reserve/assetReserve.d.ts.map +1 -1
- package/src/reserve/assetReserve.js +26 -23
- package/src/reserve/assetReserveKit.d.ts +38 -6
- package/src/reserve/assetReserveKit.d.ts.map +1 -1
- package/src/reserve/assetReserveKit.js +117 -7
- package/src/reserve/params.d.ts +9 -3
- package/src/reserve/params.d.ts.map +1 -1
- package/src/reserve/params.js +8 -2
- package/src/vaultFactory/burn.d.ts +1 -1
- package/src/vaultFactory/burn.d.ts.map +1 -1
- package/src/vaultFactory/burn.js +1 -1
- package/src/vaultFactory/liquidation.d.ts +7 -3
- package/src/vaultFactory/liquidation.d.ts.map +1 -1
- package/src/vaultFactory/liquidation.js +14 -12
- package/src/vaultFactory/math.d.ts +1 -1
- package/src/vaultFactory/math.d.ts.map +1 -1
- package/src/vaultFactory/math.js +1 -1
- package/src/vaultFactory/orderedVaultStore.d.ts +21 -20
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -1
- package/src/vaultFactory/orderedVaultStore.js +4 -2
- package/src/vaultFactory/params.d.ts +25 -9
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/params.js +29 -11
- package/src/vaultFactory/prioritizedVaults.d.ts +70 -69
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -1
- package/src/vaultFactory/prioritizedVaults.js +5 -2
- package/src/vaultFactory/storeUtils.d.ts +2 -2
- package/src/vaultFactory/storeUtils.d.ts.map +1 -1
- package/src/vaultFactory/types-ambient.d.ts +2 -2
- package/src/vaultFactory/types-ambient.d.ts.map +1 -1
- package/src/vaultFactory/types-ambient.js +6 -2
- package/src/vaultFactory/vault.d.ts +34 -30
- package/src/vaultFactory/vault.d.ts.map +1 -1
- package/src/vaultFactory/vault.js +19 -15
- package/src/vaultFactory/vaultDirector.d.ts +81 -63
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultDirector.js +38 -24
- package/src/vaultFactory/vaultFactory.d.ts +35 -22
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultFactory.js +27 -17
- package/src/vaultFactory/vaultHolder.d.ts +77 -29
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
- package/src/vaultFactory/vaultHolder.js +12 -4
- package/src/vaultFactory/vaultKit.d.ts +12 -8
- package/src/vaultFactory/vaultKit.d.ts.map +1 -1
- package/src/vaultFactory/vaultKit.js +12 -5
- package/src/vaultFactory/vaultManager.d.ts +102 -88
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +86 -53
- package/src/proposals/add-auction.d.ts +0 -109
- package/src/proposals/add-auction.d.ts.map +0 -1
- package/src/proposals/addAssetToVault.d.ts +0 -173
- package/src/proposals/addAssetToVault.d.ts.map +0 -1
- package/src/proposals/committee-proposal.d.ts +0 -113
- package/src/proposals/committee-proposal.d.ts.map +0 -1
- package/src/proposals/core-proposal.d.ts +0 -149
- package/src/proposals/core-proposal.d.ts.map +0 -1
- package/src/proposals/deploy-price-feeds.d.ts +0 -76
- package/src/proposals/deploy-price-feeds.d.ts.map +0 -1
- package/src/proposals/econ-behaviors.d.ts +0 -541
- package/src/proposals/econ-behaviors.d.ts.map +0 -1
- package/src/proposals/price-feed-proposal.d.ts +0 -84
- package/src/proposals/price-feed-proposal.d.ts.map +0 -1
- package/src/proposals/replace-fee-distributor.d.ts +0 -48
- package/src/proposals/replace-fee-distributor.d.ts.map +0 -1
- package/src/proposals/replace-scaledPriceAuthorities.d.ts +0 -30
- package/src/proposals/replace-scaledPriceAuthorities.d.ts.map +0 -1
- package/src/proposals/replaceElectorate.d.ts +0 -55
- package/src/proposals/replaceElectorate.d.ts.map +0 -1
- package/src/proposals/startEconCommittee.d.ts +0 -34
- package/src/proposals/startEconCommittee.d.ts.map +0 -1
- package/src/proposals/startPSM.d.ts +0 -59
- package/src/proposals/startPSM.d.ts.map +0 -1
- package/src/proposals/upgrade-scaledPriceAuthorities.d.ts +0 -24
- package/src/proposals/upgrade-scaledPriceAuthorities.d.ts.map +0 -1
- package/src/proposals/upgrade-vaults.d.ts +0 -41
- package/src/proposals/upgrade-vaults.d.ts.map +0 -1
package/src/auction/params.d.ts
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* @import {AsyncSpecTuple} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
3
3
|
* @import {SyncSpecTuple} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
4
4
|
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
5
|
+
* @import {Remote} from '@agoric/internal';
|
|
6
|
+
* @import {TimerBrand} from '@agoric/time';
|
|
7
|
+
* @import {StoredPublisherKit} from '@agoric/notifier';
|
|
8
|
+
* @import {TimerService} from '@agoric/time';
|
|
5
9
|
*/
|
|
6
10
|
export const InvitationShape: import("@endo/patterns").Matcher;
|
|
7
11
|
/**
|
|
@@ -71,7 +75,7 @@ export function makeAuctioneerParams({ ElectorateInvitationAmount, StartFrequenc
|
|
|
71
75
|
value: bigint;
|
|
72
76
|
};
|
|
73
77
|
};
|
|
74
|
-
export function makeAuctioneerParamManager(publisherKit:
|
|
78
|
+
export function makeAuctioneerParamManager(publisherKit: StoredPublisherKit<GovernanceSubscriptionState>, zcf: ZCF, initial: AuctionParams): import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
75
79
|
Electorate: "invitation";
|
|
76
80
|
StartFrequency: "relativeTime";
|
|
77
81
|
ClockStep: "relativeTime";
|
|
@@ -82,17 +86,17 @@ export function makeAuctioneerParamManager(publisherKit: import("@agoric/notifie
|
|
|
82
86
|
PriceLockPeriod: "relativeTime";
|
|
83
87
|
}>;
|
|
84
88
|
export function makeGovernedTerms({ storageNode: _storageNode, marshaller: _marshaller }: {
|
|
85
|
-
storageNode:
|
|
86
|
-
marshaller:
|
|
87
|
-
}, timer: ERef<
|
|
89
|
+
storageNode: Remote<StorageNode>;
|
|
90
|
+
marshaller: Remote<Marshaller>;
|
|
91
|
+
}, timer: ERef<TimerService>, priceAuthority: ERef<PriceAuthority>, reservePublicFacet: ERef<AssetReservePublicFacet>, params: AuctionParams): {
|
|
88
92
|
priceAuthority: globalThis.ERef<PriceAuthority>;
|
|
89
93
|
reservePublicFacet: globalThis.ERef<globalThis.GovernedPublicFacet<import("@endo/exo").Guarded<{
|
|
90
|
-
makeAddCollateralInvitation(): Promise<Invitation<string, never>>;
|
|
94
|
+
makeAddCollateralInvitation(): Promise<globalThis.Invitation<string, never>>;
|
|
91
95
|
getPublicTopics(): {
|
|
92
96
|
metrics: import("@agoric/zoe/src/contractSupport").PublicTopic<import("../reserve/assetReserveKit").MetricsNotification>;
|
|
93
97
|
};
|
|
94
98
|
}>>>;
|
|
95
|
-
timerService: globalThis.ERef<
|
|
99
|
+
timerService: globalThis.ERef<TimerService>;
|
|
96
100
|
governedParams: {
|
|
97
101
|
Electorate: {
|
|
98
102
|
type: "invitation";
|
|
@@ -137,8 +141,13 @@ export type AuctionParams = {
|
|
|
137
141
|
DiscountStep: bigint;
|
|
138
142
|
AuctionStartDelay: RelativeTime;
|
|
139
143
|
PriceLockPeriod: RelativeTime;
|
|
140
|
-
TimerBrand:
|
|
144
|
+
TimerBrand: TimerBrand;
|
|
141
145
|
};
|
|
146
|
+
export type AuctionParamRecord = ReturnType<typeof makeAuctioneerParams>;
|
|
142
147
|
export type AuctionParamManager = ReturnType<typeof makeAuctioneerParamManager>;
|
|
148
|
+
import type { StoredPublisherKit } from '@agoric/notifier';
|
|
149
|
+
import type { Remote } from '@agoric/internal';
|
|
150
|
+
import type { TimerService } from '@agoric/time';
|
|
143
151
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
152
|
+
import type { TimerBrand } from '@agoric/time';
|
|
144
153
|
//# sourceMappingURL=params.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["params.js"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["params.js"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AAGH,+DAAyD;AAEzD;;;;;;GAMG;AACH,8BAA+B,gBAAgB,CAAC;AAChD,gDAAgD;AAChD,yBAA0B,WAAW,CAAC;AACtC,iFAAiF;AACjF,+BAAgC,cAAc,CAAC;AAC/C,4DAA4D;AAC5D,6BAA8B,YAAY,CAAC;AAC3C,4EAA4E;AAC5E,+BAAgC,cAAc,CAAC;AAC/C;;;GAGG;AACH,kCAAmC,mBAAmB,CAAC;AAIvD,gCAAiC,iBAAiB,CAAC;AAEnD,sEASG;;;;;;;;;;;AA2BI,yLADK,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCxB;AAQM,yDAJI,mBAAmB,2BAA2B,CAAC,OAC/C,GAAG,WACH,aAAa;;;;;;;;;GA0BvB;AAcM,0FATI;IACN,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;CAChC,SACO,IAAI,CAAC,YAAY,CAAC,kBAClB,IAAI,CAAC,cAAc,CAAC,sBACpB,IAAI,CAAC,uBAAuB,CAAC,UAC7B,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBvB;;gCA5Ga,MAAM,CAAC,KAAK,CAAC;oBACb,YAAY;eACZ,YAAY;kBACZ,MAAM;gBACN,MAAM;kBACN,MAAM;uBACN,YAAY;qBACZ,YAAY;gBACZ,UAAU;;iCA0EV,UAAU,CAAC,OAAO,oBAAoB,CAAC;kCA6BvC,UAAU,CAAC,OAAO,0BAA0B,CAAC;wCAxKtB,kBAAkB;4BAF9B,kBAAkB;kCAGZ,cAAc;oCAJgD,4BAA4B;gCAE5F,cAAc"}
|
package/src/auction/params.js
CHANGED
|
@@ -10,6 +10,10 @@ import { M } from '@agoric/store';
|
|
|
10
10
|
* @import {AsyncSpecTuple} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
11
11
|
* @import {SyncSpecTuple} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
12
12
|
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
13
|
+
* @import {Remote} from '@agoric/internal';
|
|
14
|
+
* @import {TimerBrand} from '@agoric/time';
|
|
15
|
+
* @import {StoredPublisherKit} from '@agoric/notifier';
|
|
16
|
+
* @import {TimerService} from '@agoric/time';
|
|
13
17
|
*/
|
|
14
18
|
|
|
15
19
|
// TODO duplicated with zoe/src/TypeGuards.js
|
|
@@ -73,7 +77,7 @@ export const auctioneerParamTypes = harden({
|
|
|
73
77
|
* @property {bigint} DiscountStep
|
|
74
78
|
* @property {RelativeTime} AuctionStartDelay
|
|
75
79
|
* @property {RelativeTime} PriceLockPeriod
|
|
76
|
-
* @property {
|
|
80
|
+
* @property {TimerBrand} TimerBrand
|
|
77
81
|
*/
|
|
78
82
|
|
|
79
83
|
/** @param {AuctionParams} initial */
|
|
@@ -117,7 +121,7 @@ export const makeAuctioneerParams = ({
|
|
|
117
121
|
harden(makeAuctioneerParams);
|
|
118
122
|
|
|
119
123
|
/**
|
|
120
|
-
* @param {
|
|
124
|
+
* @param {StoredPublisherKit<GovernanceSubscriptionState>} publisherKit
|
|
121
125
|
* @param {ZCF} zcf
|
|
122
126
|
* @param {AuctionParams} initial
|
|
123
127
|
*/
|
|
@@ -147,10 +151,14 @@ export const makeAuctioneerParamManager = (publisherKit, zcf, initial) => {
|
|
|
147
151
|
);
|
|
148
152
|
};
|
|
149
153
|
harden(makeAuctioneerParamManager);
|
|
154
|
+
/** @typedef {ReturnType<typeof makeAuctioneerParams>} AuctionParamRecord */
|
|
150
155
|
|
|
151
156
|
/**
|
|
152
|
-
* @param {{
|
|
153
|
-
*
|
|
157
|
+
* @param {{
|
|
158
|
+
* storageNode: Remote<StorageNode>;
|
|
159
|
+
* marshaller: Remote<Marshaller>;
|
|
160
|
+
* }} caps
|
|
161
|
+
* @param {ERef<TimerService>} timer
|
|
154
162
|
* @param {ERef<PriceAuthority>} priceAuthority
|
|
155
163
|
* @param {ERef<AssetReservePublicFacet>} reservePublicFacet
|
|
156
164
|
* @param {AuctionParams} params
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export function computeRoundTiming(params: Awaited<
|
|
2
|
-
export function nextDescendingStepTime(liveSchedule:
|
|
3
|
-
export function timeVsSchedule(time: Timestamp, schedule:
|
|
1
|
+
export function computeRoundTiming(params: Awaited<AuctionParamManager>, baseTime: TimestampRecord): Schedule;
|
|
2
|
+
export function nextDescendingStepTime(liveSchedule: Schedule | null, nextSchedule: Schedule | null, now: Timestamp): Timestamp | null;
|
|
3
|
+
export function timeVsSchedule(time: Timestamp, schedule: Schedule): "before" | "during" | "endExactly" | "after";
|
|
4
|
+
import type { AuctionParamManager } from './params.js';
|
|
4
5
|
import type { TimestampRecord } from '@agoric/time';
|
|
6
|
+
import type { Schedule } from './scheduler.js';
|
|
5
7
|
//# sourceMappingURL=scheduleMath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduleMath.d.ts","sourceRoot":"","sources":["scheduleMath.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduleMath.d.ts","sourceRoot":"","sources":["scheduleMath.js"],"names":[],"mappings":"AA8CO,2CAJI,OAAO,CAAC,mBAAmB,CAAC,YAC5B,eAAe,GACb,QAAQ,CAqEpB;AAcM,qDALI,QAAQ,GAAG,IAAI,gBACf,QAAQ,GAAG,IAAI,OACf,SAAS,GACP,SAAS,GAAG,IAAI,CAuB5B;AAQM,qCAJI,SAAS,YACT,QAAQ,GACN,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAiBxD;yCAlKqC,aAAa;qCADjB,cAAc;8BAErB,gBAAgB"}
|
|
@@ -5,7 +5,11 @@ import { TimeMath } from '@agoric/time';
|
|
|
5
5
|
import { natSafeMath } from '@agoric/zoe/src/contractSupport/index.js';
|
|
6
6
|
import { assertAllDefined, makeTracer } from '@agoric/internal';
|
|
7
7
|
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @import {TimestampRecord} from '@agoric/time';
|
|
10
|
+
* @import {AuctionParamManager} from './params.js';
|
|
11
|
+
* @import {Schedule} from './scheduler.js';
|
|
12
|
+
*/
|
|
9
13
|
|
|
10
14
|
const { subtract, multiply, floorDivide } = natSafeMath;
|
|
11
15
|
|
|
@@ -36,9 +40,9 @@ const subtract1 = relTime =>
|
|
|
36
40
|
* selling early (e.g. reaching their target debt to raise or selling all of
|
|
37
41
|
* their collateral).
|
|
38
42
|
*
|
|
39
|
-
* @param {Awaited<
|
|
43
|
+
* @param {Awaited<AuctionParamManager>} params
|
|
40
44
|
* @param {TimestampRecord} baseTime
|
|
41
|
-
* @returns {
|
|
45
|
+
* @returns {Schedule}
|
|
42
46
|
*/
|
|
43
47
|
export const computeRoundTiming = (params, baseTime) => {
|
|
44
48
|
const freq = params.getStartFrequency();
|
|
@@ -96,7 +100,7 @@ export const computeRoundTiming = (params, baseTime) => {
|
|
|
96
100
|
const endTime = TimeMath.addAbsRel(startTime, actualDuration);
|
|
97
101
|
const lockTime = TimeMath.subtractAbsRel(startTime, lockPeriod);
|
|
98
102
|
|
|
99
|
-
/** @type {
|
|
103
|
+
/** @type {Schedule} */
|
|
100
104
|
const next = {
|
|
101
105
|
startTime,
|
|
102
106
|
endTime,
|
|
@@ -116,8 +120,8 @@ harden(computeRoundTiming);
|
|
|
116
120
|
* started, then it'll be nextSchedule.startTime. Otherwise, it's the start of
|
|
117
121
|
* the step following the current step.
|
|
118
122
|
*
|
|
119
|
-
* @param {
|
|
120
|
-
* @param {
|
|
123
|
+
* @param {Schedule | null} liveSchedule
|
|
124
|
+
* @param {Schedule | null} nextSchedule
|
|
121
125
|
* @param {Timestamp} now
|
|
122
126
|
* @returns {Timestamp | null}
|
|
123
127
|
*/
|
|
@@ -147,7 +151,7 @@ harden(nextDescendingStepTime);
|
|
|
147
151
|
|
|
148
152
|
/**
|
|
149
153
|
* @param {Timestamp} time
|
|
150
|
-
* @param {
|
|
154
|
+
* @param {Schedule} schedule
|
|
151
155
|
* @returns {'before' | 'during' | 'endExactly' | 'after'}
|
|
152
156
|
*/
|
|
153
157
|
export const timeVsSchedule = (time, schedule) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export function makeScheduler(auctionDriver: AuctionDriver, timer:
|
|
1
|
+
export function makeScheduler(auctionDriver: AuctionDriver, timer: TimerService, params: Awaited<AuctionParamManager>, timerBrand: TimerBrand, scheduleRecorder: Recorder<ScheduleNotification>, paramUpdateSubscription: StoredSubscription<GovernanceSubscriptionState>): Promise<{
|
|
2
2
|
getSchedule: () => {
|
|
3
3
|
liveAuctionSchedule: Schedule | null;
|
|
4
4
|
nextAuctionSchedule: Schedule | null;
|
|
5
5
|
};
|
|
6
6
|
getAuctionState: () => AuctionState;
|
|
7
|
-
} &
|
|
7
|
+
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
8
8
|
getSchedule: () => {
|
|
9
9
|
liveAuctionSchedule: Schedule | null;
|
|
10
10
|
nextAuctionSchedule: Schedule | null;
|
|
@@ -34,8 +34,8 @@ export type ScheduleNotification = {
|
|
|
34
34
|
nextDescendingStepTime: Timestamp | null;
|
|
35
35
|
};
|
|
36
36
|
export type Schedule = {
|
|
37
|
-
startTime:
|
|
38
|
-
endTime:
|
|
37
|
+
startTime: TimestampRecord;
|
|
38
|
+
endTime: TimestampRecord;
|
|
39
39
|
steps: NatValue;
|
|
40
40
|
endRate: NatValue;
|
|
41
41
|
startDelay: RelativeTime;
|
|
@@ -46,5 +46,10 @@ export type FullSchedule = {
|
|
|
46
46
|
nextAuctionSchedule: Schedule | null;
|
|
47
47
|
liveAuctionSchedule: Schedule | null;
|
|
48
48
|
};
|
|
49
|
+
import type { TimerService } from '@agoric/time';
|
|
50
|
+
import type { AuctionParamManager } from './params.js';
|
|
51
|
+
import type { TimerBrand } from '@agoric/time';
|
|
52
|
+
import type { Recorder } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
49
53
|
import { AuctionState } from './util.js';
|
|
54
|
+
import type { TimestampRecord } from '@agoric/time';
|
|
50
55
|
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["scheduler.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["scheduler.js"],"names":[],"mappings":"AAsFO,6CAPI,aAAa,SACb,YAAY,UACZ,OAAO,CAAC,mBAAmB,CAAC,cAC5B,UAAU,oBACV,SAAS,oBAAoB,CAAC,2BAC9B,kBAAkB,CAAC,2BAA2B,CAAC;;;;;;;;;;;;IA0RzD;;yBA3Ta,MAAM,IAAI;cACV,MAAM,IAAI;gBACV,MAAM,IAAI;mBACV,MAAM,IAAI;;;;;;;qBAKV,SAAS,GAAG,IAAI;;;;mBAEhB,SAAS,GAAG,IAAI;;;;;4BAChB,SAAS,GAAG,IAAI;;;eAoThB,eAAe;aACf,eAAe;WACf,QAAQ;aACR,QAAQ;gBACR,YAAY;eACZ,YAAY;;;;yBAMZ,QAAQ,GAAG,IAAI;yBACf,QAAQ,GAAG,IAAI;;kCA/WE,cAAc;yCACP,aAAa;gCACtB,cAAc;8BAChB,6CAA6C;6BAXrB,WAAW;qCAY5B,cAAc"}
|
package/src/auction/scheduler.js
CHANGED
|
@@ -12,6 +12,14 @@ import {
|
|
|
12
12
|
timeVsSchedule,
|
|
13
13
|
} from './scheduleMath.js';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @import {TimerService} from '@agoric/time';
|
|
17
|
+
* @import {AuctionParamManager} from './params.js';
|
|
18
|
+
* @import {TimerBrand} from '@agoric/time';
|
|
19
|
+
* @import {Recorder} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
20
|
+
* @import {TimestampRecord} from '@agoric/time';
|
|
21
|
+
*/
|
|
22
|
+
|
|
15
23
|
const trace = makeTracer('SCHED', true);
|
|
16
24
|
|
|
17
25
|
// If the startAuction wakeup is no more than 5 minutes late, go ahead with it.
|
|
@@ -70,10 +78,10 @@ const nominalStartTime = nextSchedule =>
|
|
|
70
78
|
|
|
71
79
|
/**
|
|
72
80
|
* @param {AuctionDriver} auctionDriver
|
|
73
|
-
* @param {
|
|
74
|
-
* @param {Awaited<
|
|
75
|
-
* @param {
|
|
76
|
-
* @param {
|
|
81
|
+
* @param {TimerService} timer
|
|
82
|
+
* @param {Awaited<AuctionParamManager>} params
|
|
83
|
+
* @param {TimerBrand} timerBrand
|
|
84
|
+
* @param {Recorder<ScheduleNotification>} scheduleRecorder
|
|
77
85
|
* @param {StoredSubscription<GovernanceSubscriptionState>} paramUpdateSubscription
|
|
78
86
|
*/
|
|
79
87
|
export const makeScheduler = async (
|
|
@@ -360,8 +368,8 @@ export const makeScheduler = async (
|
|
|
360
368
|
|
|
361
369
|
/**
|
|
362
370
|
* @typedef {object} Schedule
|
|
363
|
-
* @property {
|
|
364
|
-
* @property {
|
|
371
|
+
* @property {TimestampRecord} startTime
|
|
372
|
+
* @property {TimestampRecord} endTime
|
|
365
373
|
* @property {NatValue} steps
|
|
366
374
|
* @property {NatValue} endRate
|
|
367
375
|
* @property {RelativeTime} startDelay
|
package/src/auction/util.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export function makeBrandedRatioPattern(numeratorAmountShape: {
|
|
|
25
25
|
export function isScaledBidPriceHigher(bidScaling: Ratio, currentPrice: Ratio, oraclePrice: Ratio): boolean;
|
|
26
26
|
/** @type {(quote: PriceQuote) => Ratio} */
|
|
27
27
|
export const priceFrom: (quote: PriceQuote) => Ratio;
|
|
28
|
-
export function makeCancelTokenMaker(name: any): () =>
|
|
28
|
+
export function makeCancelTokenMaker(name: any): () => RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {}>;
|
|
29
|
+
import type { Pattern } from '@endo/patterns';
|
|
29
30
|
import type { PriceQuote } from '@agoric/zoe/tools/types.js';
|
|
30
31
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.js"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.js"],"names":[],"mappings":";;;2BAiBU,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC;;;;;AAYnD,8DAHI;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,0BAChC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE;;eADvB,KAAK;eAAS,OAAO;;;eACrB,KAAK;eAAS,OAAO;;EAUxC;AASM,mDANI,KAAK,gBACL,KAAK,eACL,KAAK,GACH,OAAO,CAI6C;AAEjE,2CAA2C;AAC3C,wBADW,CAAC,KAAK,EAAE,UAAU,KAAK,KAAK,CAKnC;AAEG,oJAIN;6BAlD8B,gBAAgB;gCAC8C,4BAA4B"}
|
package/src/auction/util.js
CHANGED
|
@@ -7,7 +7,10 @@ import {
|
|
|
7
7
|
} from '@agoric/zoe/src/contractSupport/index.js';
|
|
8
8
|
import { Far } from '@endo/marshal';
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @import {Key, Pattern} from '@endo/patterns';
|
|
12
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
13
|
+
*/
|
|
11
14
|
|
|
12
15
|
/**
|
|
13
16
|
* Constants for Auction State.
|
package/src/clientSupport.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
export function lookupOfferIdForVault(vaultId: string, currentP: Promise<
|
|
2
|
-
export function makeParseAmount(agoricNames: Pick<
|
|
1
|
+
export function lookupOfferIdForVault(vaultId: string, currentP: Promise<CurrentWalletRecord>): Promise<string>;
|
|
2
|
+
export function makeParseAmount(agoricNames: Pick<AgoricNamesRemotes, "brand" | "vbankAsset">, makeError?: (msg: string) => Error): (a: string) => Amount<"nat">;
|
|
3
3
|
export namespace Offers {
|
|
4
|
-
namespace auction {
|
|
5
|
-
export { makeBidOffer as Bid };
|
|
6
|
-
}
|
|
7
4
|
namespace fluxAggregator {
|
|
8
5
|
export { makePushPriceOffer as PushPrice };
|
|
9
6
|
}
|
|
@@ -19,36 +16,9 @@ export namespace Offers {
|
|
|
19
16
|
export { makeAddCollateralOffer as AddCollateral };
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* 'brand' | 'vbankAsset'
|
|
26
|
-
* >} agoricNames
|
|
27
|
-
* @param {{
|
|
28
|
-
* offerId: string;
|
|
29
|
-
* give: string;
|
|
30
|
-
* maxBuy: string;
|
|
31
|
-
* wantMinimum?: string;
|
|
32
|
-
* } & (
|
|
33
|
-
* | {
|
|
34
|
-
* price: number;
|
|
35
|
-
* }
|
|
36
|
-
* | {
|
|
37
|
-
* discount: number; // -1 to 1. e.g. 0.10 for 10% discount, -0.05 for 5% markup
|
|
38
|
-
* }
|
|
39
|
-
* )} opts
|
|
40
|
-
* @returns {import('@agoric/smart-wallet/src/offers.js').OfferSpec}
|
|
41
|
-
*/
|
|
42
|
-
declare function makeBidOffer(agoricNames: Pick<import("@agoric/vats/tools/board-utils.js").AgoricNamesRemotes, "brand" | "vbankAsset">, opts: {
|
|
43
|
-
offerId: string;
|
|
44
|
-
give: string;
|
|
45
|
-
maxBuy: string;
|
|
46
|
-
wantMinimum?: string;
|
|
47
|
-
} & ({
|
|
48
|
-
price: number;
|
|
49
|
-
} | {
|
|
50
|
-
discount: number;
|
|
51
|
-
})): import("@agoric/smart-wallet/src/offers.js").OfferSpec;
|
|
19
|
+
import type { CurrentWalletRecord } from '@agoric/smart-wallet/src/smartWallet.js';
|
|
20
|
+
import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js';
|
|
21
|
+
import type { Amount } from '@agoric/ertp';
|
|
52
22
|
/**
|
|
53
23
|
* @param {unknown} _agoricNames
|
|
54
24
|
* @param {{
|
|
@@ -57,26 +27,23 @@ declare function makeBidOffer(agoricNames: Pick<import("@agoric/vats/tools/board
|
|
|
57
27
|
* unitPrice: bigint;
|
|
58
28
|
* }} opts
|
|
59
29
|
* @param {string} previousOffer
|
|
60
|
-
* @returns {
|
|
30
|
+
* @returns {OfferSpec}
|
|
61
31
|
*/
|
|
62
32
|
declare function makePushPriceOffer(_agoricNames: unknown, opts: {
|
|
63
33
|
offerId: string;
|
|
64
34
|
roundId?: bigint;
|
|
65
35
|
unitPrice: bigint;
|
|
66
|
-
}, previousOffer: string):
|
|
36
|
+
}, previousOffer: string): OfferSpec;
|
|
67
37
|
/**
|
|
68
|
-
* @param {Pick<
|
|
69
|
-
*
|
|
70
|
-
* 'brand'
|
|
71
|
-
* >} agoricNames
|
|
72
|
-
* @param {Instance} instance
|
|
38
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
39
|
+
* @param {Instance<unknown>} instance
|
|
73
40
|
* @param {{ offerId: string; feePct?: number; pair: [string, string] } & (
|
|
74
41
|
* | { wantMinted: number }
|
|
75
42
|
* | { giveMinted: number }
|
|
76
43
|
* )} opts
|
|
77
|
-
* @returns {
|
|
44
|
+
* @returns {OfferSpec}
|
|
78
45
|
*/
|
|
79
|
-
declare function makePsmSwapOffer({ brand }: Pick<
|
|
46
|
+
declare function makePsmSwapOffer({ brand }: Pick<AgoricNamesRemotes, "brand">, instance: Instance<unknown>, opts: {
|
|
80
47
|
offerId: string;
|
|
81
48
|
feePct?: number;
|
|
82
49
|
pair: [string, string];
|
|
@@ -84,31 +51,25 @@ declare function makePsmSwapOffer({ brand }: Pick<import("@agoric/vats/tools/boa
|
|
|
84
51
|
wantMinted: number;
|
|
85
52
|
} | {
|
|
86
53
|
giveMinted: number;
|
|
87
|
-
})):
|
|
54
|
+
})): OfferSpec;
|
|
88
55
|
/**
|
|
89
|
-
* @param {Pick<
|
|
90
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
91
|
-
* 'brand'
|
|
92
|
-
* >} agoricNames
|
|
56
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
93
57
|
* @param {{
|
|
94
58
|
* offerId: string;
|
|
95
59
|
* wantMinted: number;
|
|
96
60
|
* giveCollateral: number;
|
|
97
61
|
* collateralBrandKey: string;
|
|
98
62
|
* }} opts
|
|
99
|
-
* @returns {
|
|
63
|
+
* @returns {OfferSpec}
|
|
100
64
|
*/
|
|
101
|
-
declare function makeOpenOffer({ brand }: Pick<
|
|
65
|
+
declare function makeOpenOffer({ brand }: Pick<AgoricNamesRemotes, "brand">, opts: {
|
|
102
66
|
offerId: string;
|
|
103
67
|
wantMinted: number;
|
|
104
68
|
giveCollateral: number;
|
|
105
69
|
collateralBrandKey: string;
|
|
106
|
-
}):
|
|
70
|
+
}): OfferSpec;
|
|
107
71
|
/**
|
|
108
|
-
* @param {Pick<
|
|
109
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
110
|
-
* 'brand'
|
|
111
|
-
* >} agoricNames
|
|
72
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
112
73
|
* @param {{
|
|
113
74
|
* offerId: string;
|
|
114
75
|
* collateralBrandKey?: string;
|
|
@@ -118,50 +79,45 @@ declare function makeOpenOffer({ brand }: Pick<import("@agoric/vats/tools/board-
|
|
|
118
79
|
* wantMinted?: number;
|
|
119
80
|
* }} opts
|
|
120
81
|
* @param {string} previousOffer
|
|
121
|
-
* @returns {
|
|
82
|
+
* @returns {OfferSpec}
|
|
122
83
|
*/
|
|
123
|
-
declare function makeAdjustOffer({ brand }: Pick<
|
|
84
|
+
declare function makeAdjustOffer({ brand }: Pick<AgoricNamesRemotes, "brand">, opts: {
|
|
124
85
|
offerId: string;
|
|
125
86
|
collateralBrandKey?: string;
|
|
126
87
|
giveCollateral?: number;
|
|
127
88
|
wantCollateral?: number;
|
|
128
89
|
giveMinted?: number;
|
|
129
90
|
wantMinted?: number;
|
|
130
|
-
}, previousOffer: string):
|
|
91
|
+
}, previousOffer: string): OfferSpec;
|
|
131
92
|
/**
|
|
132
|
-
* @param {Pick<
|
|
133
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
134
|
-
* 'brand'
|
|
135
|
-
* >} agoricNames
|
|
93
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
136
94
|
* @param {{
|
|
137
95
|
* offerId: string;
|
|
138
96
|
* collateralBrandKey?: string;
|
|
139
97
|
* giveMinted: number;
|
|
140
98
|
* }} opts
|
|
141
99
|
* @param {string} previousOffer
|
|
142
|
-
* @returns {
|
|
100
|
+
* @returns {OfferSpec}
|
|
143
101
|
*/
|
|
144
|
-
declare function makeCloseOffer({ brand }: Pick<
|
|
102
|
+
declare function makeCloseOffer({ brand }: Pick<AgoricNamesRemotes, "brand">, opts: {
|
|
145
103
|
offerId: string;
|
|
146
104
|
collateralBrandKey?: string;
|
|
147
105
|
giveMinted: number;
|
|
148
|
-
}, previousOffer: string):
|
|
106
|
+
}, previousOffer: string): OfferSpec;
|
|
149
107
|
/**
|
|
150
|
-
* @param {Pick<
|
|
151
|
-
* import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes,
|
|
152
|
-
* 'brand'
|
|
153
|
-
* >} agoricNames
|
|
108
|
+
* @param {Pick<AgoricNamesRemotes, 'brand'>} agoricNames
|
|
154
109
|
* @param {{
|
|
155
110
|
* offerId: string;
|
|
156
111
|
* give: number;
|
|
157
112
|
* collateralBrandKey: string;
|
|
158
113
|
* }} opts
|
|
159
|
-
* @returns {
|
|
114
|
+
* @returns {OfferSpec}
|
|
160
115
|
*/
|
|
161
|
-
declare function makeAddCollateralOffer({ brand }: Pick<
|
|
116
|
+
declare function makeAddCollateralOffer({ brand }: Pick<AgoricNamesRemotes, "brand">, opts: {
|
|
162
117
|
offerId: string;
|
|
163
118
|
give: number;
|
|
164
119
|
collateralBrandKey: string;
|
|
165
|
-
}):
|
|
120
|
+
}): OfferSpec;
|
|
121
|
+
import type { OfferSpec } from '@agoric/smart-wallet/src/offers.js';
|
|
166
122
|
export {};
|
|
167
123
|
//# sourceMappingURL=clientSupport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientSupport.d.ts","sourceRoot":"","sources":["clientSupport.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clientSupport.d.ts","sourceRoot":"","sources":["clientSupport.js"],"names":[],"mappings":"AAgKO,+CAJI,MAAM,YACN,OAAO,CAAC,mBAAmB,CAAC,GAC1B,OAAO,CAAC,MAAM,CAAC,CAW3B;AA0EM,6CAJI,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,YAAY,CAAC,cAChD,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,GACpB,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,KAAK,CAAC,CAmCtC;;;;;;;;;;;;;;;;;yCA1QmC,yCAAyC;wCAF1C,mCAAmC;4BAFxB,cAAc;AAgT9D;;;;;;;;;GASG;AACH,kDATW,OAAO,QACP;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,iBACO,MAAM,GACJ,SAAS,CAerB;AApID;;;;;;;;GAQG;AACH,6CARW,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,YACjC,QAAQ,CAAC,OAAO,CAAC,QACjB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CACnE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GACtB;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CACzB,GACS,SAAS,CA4BrB;AAxKD;;;;;;;;;GASG;AACH,0CATW,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,QACjC;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,GACS,SAAS,CAuBrB;AAED;;;;;;;;;;;;GAYG;AACH,4CAZW,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,QACjC;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,iBACO,MAAM,GACJ,SAAS,CAiBrB;AAED;;;;;;;;;GASG;AACH,2CATW,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,QACjC;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,iBACO,MAAM,GACJ,SAAS,CAcrB;AA6HD;;;;;;;;GAQG;AACH,mDARW,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,QACjC;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;CAC5B,GACS,SAAS,CAuBrB;+BA3S2B,oCAAoC"}
|