@agoric/inter-protocol 0.16.2-other-dev-fbe72e7.0.fbe72e7 → 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 +17 -17
- package/src/auction/auctionBook.d.ts +3 -1
- package/src/auction/auctionBook.d.ts.map +1 -1
- package/src/auction/auctionBook.js +7 -6
- package/src/auction/auctioneer.d.ts +15 -10
- package/src/auction/auctioneer.d.ts.map +1 -1
- package/src/auction/auctioneer.js +23 -12
- package/src/auction/params.d.ts +14 -6
- package/src/auction/params.d.ts.map +1 -1
- package/src/auction/params.js +11 -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 +8 -3
- package/src/auction/scheduler.d.ts.map +1 -1
- package/src/auction/scheduler.js +14 -6
- package/src/clientSupport.d.ts +28 -73
- package/src/clientSupport.d.ts.map +1 -1
- package/src/clientSupport.js +24 -128
- package/src/econCommitteeCharter.d.ts +9 -5
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/econCommitteeCharter.js +10 -8
- package/src/feeDistributor.d.ts +10 -16
- package/src/feeDistributor.d.ts.map +1 -1
- package/src/feeDistributor.js +3 -3
- package/src/index.js +1 -1
- package/src/price/fluxAggregatorContract.d.ts +14 -5
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.js +17 -9
- package/src/price/fluxAggregatorKit.d.ts +11 -6
- package/src/price/fluxAggregatorKit.d.ts.map +1 -1
- package/src/price/fluxAggregatorKit.js +12 -7
- package/src/price/priceOracleKit.d.ts +2 -1
- package/src/price/priceOracleKit.d.ts.map +1 -1
- package/src/price/priceOracleKit.js +2 -1
- package/src/price/roundsManager.d.ts +6 -4
- package/src/price/roundsManager.d.ts.map +1 -1
- package/src/price/roundsManager.js +4 -2
- package/src/proposals/add-auction.js +7 -2
- package/src/proposals/addAssetToVault.js +7 -3
- package/src/proposals/committee-proposal.js +10 -5
- package/src/proposals/core-proposal.js +9 -3
- package/src/proposals/deploy-price-feeds.js +7 -4
- package/src/proposals/econ-behaviors.js +14 -9
- package/src/proposals/price-feed-proposal.js +10 -3
- package/src/proposals/replace-fee-distributor.js +7 -4
- package/src/proposals/startEconCommittee.js +5 -1
- package/src/proposals/startPSM.js +7 -4
- package/src/proposals/upgrade-vaults.js +9 -4
- package/src/proposals/utils.d.ts +6 -4
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +8 -8
- package/src/proposals/withdraw-reserve-proposal.js +1 -1
- package/src/provisionPool.d.ts +16 -8
- package/src/provisionPool.d.ts.map +1 -1
- package/src/provisionPool.js +15 -9
- package/src/provisionPoolKit.d.ts +19 -74
- package/src/provisionPoolKit.d.ts.map +1 -1
- package/src/provisionPoolKit.js +26 -22
- package/src/psm/psm.d.ts +5 -6
- package/src/psm/psm.d.ts.map +1 -1
- package/src/psm/psm.js +12 -11
- package/src/reserve/assetReserve.d.ts +3 -2
- package/src/reserve/assetReserve.d.ts.map +1 -1
- package/src/reserve/assetReserve.js +10 -6
- package/src/reserve/assetReserveKit.d.ts +6 -3
- package/src/reserve/assetReserveKit.d.ts.map +1 -1
- package/src/reserve/assetReserveKit.js +7 -5
- package/src/vaultFactory/burn.js +1 -1
- package/src/vaultFactory/liquidation.d.ts +5 -3
- package/src/vaultFactory/liquidation.d.ts.map +1 -1
- package/src/vaultFactory/liquidation.js +9 -7
- package/src/vaultFactory/orderedVaultStore.d.ts +2 -2
- package/src/vaultFactory/params.d.ts +20 -7
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/params.js +24 -9
- package/src/vaultFactory/prioritizedVaults.d.ts +12 -12
- package/src/vaultFactory/types-ambient.d.ts.map +1 -1
- package/src/vaultFactory/types-ambient.js +1 -0
- package/src/vaultFactory/vault.d.ts +23 -20
- package/src/vaultFactory/vault.d.ts.map +1 -1
- package/src/vaultFactory/vault.js +17 -14
- package/src/vaultFactory/vaultDirector.d.ts +28 -16
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultDirector.js +28 -22
- package/src/vaultFactory/vaultFactory.d.ts +17 -52
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultFactory.js +22 -16
- package/src/vaultFactory/vaultHolder.d.ts +9 -5
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
- package/src/vaultFactory/vaultHolder.js +8 -4
- package/src/vaultFactory/vaultKit.d.ts +4 -1
- package/src/vaultFactory/vaultKit.d.ts.map +1 -1
- package/src/vaultFactory/vaultKit.js +7 -4
- package/src/vaultFactory/vaultManager.d.ts +37 -25
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +28 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/inter-protocol",
|
|
3
|
-
"version": "0.16.2-other-dev-
|
|
3
|
+
"version": "0.16.2-other-dev-d15096d.0.d15096d",
|
|
4
4
|
"description": "Core cryptoeconomy contracts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agoric/base-zone": "0.1.1-other-dev-
|
|
35
|
-
"@agoric/ertp": "0.16.3-other-dev-
|
|
36
|
-
"@agoric/governance": "0.10.4-other-dev-
|
|
37
|
-
"@agoric/internal": "0.3.3-other-dev-
|
|
38
|
-
"@agoric/notifier": "0.6.3-other-dev-
|
|
39
|
-
"@agoric/store": "0.9.3-other-dev-
|
|
40
|
-
"@agoric/time": "0.3.3-other-dev-
|
|
41
|
-
"@agoric/vat-data": "0.5.3-other-dev-
|
|
42
|
-
"@agoric/vats": "0.15.2-other-dev-
|
|
43
|
-
"@agoric/zoe": "0.26.3-other-dev-
|
|
44
|
-
"@agoric/zone": "0.2.3-other-dev-
|
|
34
|
+
"@agoric/base-zone": "0.1.1-other-dev-d15096d.0.d15096d",
|
|
35
|
+
"@agoric/ertp": "0.16.3-other-dev-d15096d.0.d15096d",
|
|
36
|
+
"@agoric/governance": "0.10.4-other-dev-d15096d.0.d15096d",
|
|
37
|
+
"@agoric/internal": "0.3.3-other-dev-d15096d.0.d15096d",
|
|
38
|
+
"@agoric/notifier": "0.6.3-other-dev-d15096d.0.d15096d",
|
|
39
|
+
"@agoric/store": "0.9.3-other-dev-d15096d.0.d15096d",
|
|
40
|
+
"@agoric/time": "0.3.3-other-dev-d15096d.0.d15096d",
|
|
41
|
+
"@agoric/vat-data": "0.5.3-other-dev-d15096d.0.d15096d",
|
|
42
|
+
"@agoric/vats": "0.15.2-other-dev-d15096d.0.d15096d",
|
|
43
|
+
"@agoric/zoe": "0.26.3-other-dev-d15096d.0.d15096d",
|
|
44
|
+
"@agoric/zone": "0.2.3-other-dev-d15096d.0.d15096d",
|
|
45
45
|
"@endo/captp": "^4.4.8",
|
|
46
46
|
"@endo/errors": "^1.2.13",
|
|
47
47
|
"@endo/eventual-send": "^1.3.4",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"jessie.js": "^0.3.4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@agoric/smart-wallet": "0.5.4-other-dev-
|
|
56
|
-
"@agoric/swingset-liveslots": "0.10.3-other-dev-
|
|
57
|
-
"@agoric/swingset-vat": "0.32.3-other-dev-
|
|
55
|
+
"@agoric/smart-wallet": "0.5.4-other-dev-d15096d.0.d15096d",
|
|
56
|
+
"@agoric/swingset-liveslots": "0.10.3-other-dev-d15096d.0.d15096d",
|
|
57
|
+
"@agoric/swingset-vat": "0.32.3-other-dev-d15096d.0.d15096d",
|
|
58
58
|
"@endo/bundle-source": "^4.1.2",
|
|
59
59
|
"@endo/init": "^1.1.12",
|
|
60
60
|
"@endo/promise-kit": "^1.1.13",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
85
|
"typeCoverage": {
|
|
86
|
-
"atLeast": 95.
|
|
86
|
+
"atLeast": 95.65
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "d15096dc4ff8b96e9b6cd11954c20d3a9efbb393"
|
|
89
89
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function makeOfferSpecShape(bidBrand: Brand<"nat">, collateralBrand: Brand<"nat">): import("@endo/patterns").Matcher;
|
|
2
|
-
export function prepareAuctionBook(baggage: Baggage, zcf: ZCF, makeRecorderKit:
|
|
2
|
+
export function prepareAuctionBook(baggage: Baggage, zcf: ZCF, makeRecorderKit: MakeRecorderKit): (bidBrand: globalThis.Brand<"nat">, collateralBrand: globalThis.Brand<"nat">, pAuthority: PriceAuthority, node: Remote<globalThis.StorageNode>) => ReturnType<(bidBrand: globalThis.Brand<"nat">, collateralBrand: globalThis.Brand<"nat">, pAuthority: PriceAuthority, node: Remote<globalThis.StorageNode>) => import("@endo/exo").GuardedKit<{
|
|
3
3
|
helper: {
|
|
4
4
|
/**
|
|
5
5
|
* remove the key from the appropriate book, indicated by whether the
|
|
@@ -142,6 +142,8 @@ export type BookDataNotification = {
|
|
|
142
142
|
};
|
|
143
143
|
export type AuctionBook = EReturn<EReturn<typeof prepareAuctionBook>>;
|
|
144
144
|
import type { Baggage } from '@agoric/vat-data';
|
|
145
|
+
import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
145
146
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
147
|
+
import type { Remote } from '@agoric/internal';
|
|
146
148
|
import type { EReturn } from '@endo/far';
|
|
147
149
|
//# sourceMappingURL=auctionBook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auctionBook.d.ts","sourceRoot":"","sources":["auctionBook.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auctionBook.d.ts","sourceRoot":"","sources":["auctionBook.js"],"names":[],"mappings":"AAgFO,6CAHI,KAAK,CAAC,KAAK,CAAC,mBACZ,KAAK,CAAC,KAAK,CAAC,oCAiBtB;AAwBM,4CAJI,OAAO,OACP,GAAG,mBACH,eAAe,sJA8pBhB,UAAU;;QAriBZ;;;;;;WAMG;+BAFQ,MAAM,SACN,KAAK,GAAG,SAAS;QAW5B;;;;;;;WAOG;2BAHQ,MAAM,kBACN,MAAM,SACN,KAAK,GAAG,SAAS;QAW5B;;;;;;WAMG;qBAFQ,OAAO,oBACP,MAAM,CAAC,KAAK,CAAC;QA+DxB;;;;;;;;;;;WAWG;+BANQ,OAAO,SACP,KAAK,UACL,MAAM,CAAC,KAAK,CAAC,+BAErB;YAAsB,SAAS,EAAvB,OAAO;YACQ,YAAY;SAAC;QAsCvC;;;;;;;;;;;WAWG;mCANQ,OAAO,cACP,KAAK,UACL,MAAM,CAAC,KAAK,CAAC,+BAErB;YAAsB,SAAS,EAAvB,OAAO;YACQ,YAAY;SAAC;;;;;QAyHvC;;;;;;;;WAQG;+BAPQ,MAAM,CAAC,KAAK,CAAC,cACb,OAAO,iBACP,MAAM,CAAC,KAAK,CAAC;mCA2ED,KAAK,GAAK,IAAI;;;;;QAuGrC;;;;WAIG;4BAHQ,SAAS,QACT,OAAO,aACP,OAAO;;;;;;;;;;;;GAqFqB,CAAC,MAAM,CAAC,CAItD;wBAxtBY;IACR,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CACvB,GAAG;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,CACE;IACE,UAAU,EAAE,KAAK,CAAC;CACnB,GACD;IACE,eAAe,EAAE,KAAK,CAAC;CACxB,CACJ;;;;;gBAyBQ,KAAK,GAAG,IAAI;;;;;uBACZ,KAAK,GAAG,IAAI;;;;;uBAEZ,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI;;;;;2BAEpB,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI;;;;;oBAEpB,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS;;;;;qBAEzB,MAAM,CAAC,KAAK,CAAC;;;;;yBAEb,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI;;0BA4qBpB,QAAQ,QAAQ,OAAO,kBAAkB,CAAC,CAAC;6BA3vB/B,kBAAkB;qCAGV,6CAA6C;oCAF9C,4BAA4B;4BACtB,kBAAkB;6BAH/B,WAAW"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="@agoric/internal/exported" />
|
|
2
|
-
/// <reference types="@agoric/governance/exported" />
|
|
3
|
-
/// <reference types="@agoric/zoe/exported" />
|
|
1
|
+
/// <reference types="@agoric/internal/exported.js" />
|
|
2
|
+
/// <reference types="@agoric/governance/exported.js" />
|
|
3
|
+
/// <reference types="@agoric/zoe/exported.js" />
|
|
4
4
|
|
|
5
5
|
import { Fail } from '@endo/errors';
|
|
6
6
|
import { E } from '@endo/captp';
|
|
@@ -31,7 +31,8 @@ import {
|
|
|
31
31
|
* @import {EReturn} from '@endo/far';
|
|
32
32
|
* @import {Baggage} from '@agoric/vat-data';
|
|
33
33
|
* @import {PriceAuthority} from '@agoric/zoe/tools/types.js';
|
|
34
|
-
* @import {TypedPattern} from '@agoric/internal';
|
|
34
|
+
* @import {TypedPattern, Remote} from '@agoric/internal';
|
|
35
|
+
* @import {MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
35
36
|
*/
|
|
36
37
|
|
|
37
38
|
const { makeEmpty } = AmountMath;
|
|
@@ -114,7 +115,7 @@ export const makeOfferSpecShape = (bidBrand, collateralBrand) => {
|
|
|
114
115
|
/**
|
|
115
116
|
* @param {Baggage} baggage
|
|
116
117
|
* @param {ZCF} zcf
|
|
117
|
-
* @param {
|
|
118
|
+
* @param {MakeRecorderKit} makeRecorderKit
|
|
118
119
|
*/
|
|
119
120
|
export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
|
|
120
121
|
const makeScaledBidBook = prepareScaledBidBook(baggage);
|
|
@@ -149,7 +150,7 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
|
|
|
149
150
|
* @param {Brand<'nat'>} bidBrand
|
|
150
151
|
* @param {Brand<'nat'>} collateralBrand
|
|
151
152
|
* @param {PriceAuthority} pAuthority
|
|
152
|
-
* @param {StorageNode} node
|
|
153
|
+
* @param {Remote<StorageNode>} node
|
|
153
154
|
*/
|
|
154
155
|
(bidBrand, collateralBrand, pAuthority, node) => {
|
|
155
156
|
assertAllDefined({ bidBrand, collateralBrand, pAuthority });
|
|
@@ -4,13 +4,13 @@ export function distributeProportionalSharesWithLimits(unsoldCollateral: Amount<
|
|
|
4
4
|
goal: Amount<"nat">;
|
|
5
5
|
}[], collateralSeat: ZCFSeat, bidHoldingSeat: ZCFSeat, collateralKeyword: string, reserveSeat: ZCFSeat, brand: Brand): globalThis.TransferPart[];
|
|
6
6
|
export function start(zcf: ZCF<GovernanceTerms<typeof auctioneerParamTypes> & {
|
|
7
|
-
timerService:
|
|
7
|
+
timerService: TimerService;
|
|
8
8
|
reservePublicFacet: AssetReservePublicFacet;
|
|
9
9
|
priceAuthority: PriceAuthority;
|
|
10
10
|
}>, privateArgs: {
|
|
11
11
|
initialPoserInvitation: Invitation;
|
|
12
|
-
storageNode: StorageNode
|
|
13
|
-
marshaller: Marshaller
|
|
12
|
+
storageNode: Remote<StorageNode>;
|
|
13
|
+
marshaller: Remote<Marshaller>;
|
|
14
14
|
}, baggage: Baggage): Promise<{
|
|
15
15
|
publicFacet: globalThis.GovernedPublicFacet<{
|
|
16
16
|
getElectorate: () => import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
@@ -22,17 +22,17 @@ export function start(zcf: ZCF<GovernanceTerms<typeof auctioneerParamTypes> & {
|
|
|
22
22
|
getAuctionStartDelay: () => RelativeTime;
|
|
23
23
|
getPriceLockPeriod: () => RelativeTime;
|
|
24
24
|
/** @param {Brand<'nat'>} collateralBrand */
|
|
25
|
-
makeBidInvitation(collateralBrand: Brand<"nat">): Promise<globalThis.Invitation<string,
|
|
25
|
+
makeBidInvitation(collateralBrand: Brand<"nat">): Promise<globalThis.Invitation<string, OfferSpec>>;
|
|
26
26
|
getSchedules(): {
|
|
27
27
|
liveAuctionSchedule: import("./scheduler.js").Schedule | null;
|
|
28
28
|
nextAuctionSchedule: import("./scheduler.js").Schedule | null;
|
|
29
29
|
};
|
|
30
|
-
getScheduleUpdates(): globalThis.Subscriber<
|
|
30
|
+
getScheduleUpdates(): globalThis.Subscriber<ScheduleNotification>;
|
|
31
31
|
getBookDataUpdates(brand: any): globalThis.Subscriber<import("./auctionBook.js").BookDataNotification>;
|
|
32
32
|
getPublicTopics(brand: any): {
|
|
33
33
|
bookData: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./auctionBook.js").BookDataNotification>;
|
|
34
34
|
} | {
|
|
35
|
-
schedule: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<
|
|
35
|
+
schedule: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<ScheduleNotification>;
|
|
36
36
|
};
|
|
37
37
|
makeDepositInvitation: () => Promise<globalThis.Invitation<string, {
|
|
38
38
|
goal: Amount<"nat">;
|
|
@@ -44,16 +44,16 @@ export function start(zcf: ZCF<GovernanceTerms<typeof auctioneerParamTypes> & {
|
|
|
44
44
|
* @param {Keyword} kwd
|
|
45
45
|
*/
|
|
46
46
|
addBrand(issuer: Issuer<"nat">, kwd: Keyword): Promise<void>;
|
|
47
|
-
/** @returns {Promise<
|
|
48
|
-
getSchedule(): Promise<
|
|
47
|
+
/** @returns {Promise<FullSchedule>} */
|
|
48
|
+
getSchedule(): Promise<FullSchedule>;
|
|
49
49
|
} & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
50
50
|
/**
|
|
51
51
|
* @param {Issuer<'nat'>} issuer
|
|
52
52
|
* @param {Keyword} kwd
|
|
53
53
|
*/
|
|
54
54
|
addBrand(issuer: Issuer<"nat">, kwd: Keyword): Promise<void>;
|
|
55
|
-
/** @returns {Promise<
|
|
56
|
-
getSchedule(): Promise<
|
|
55
|
+
/** @returns {Promise<FullSchedule>} */
|
|
56
|
+
getSchedule(): Promise<FullSchedule>;
|
|
57
57
|
}>>;
|
|
58
58
|
}>;
|
|
59
59
|
/** @typedef {ContractOf<typeof start>} AuctioneerContract */
|
|
@@ -64,7 +64,12 @@ export type AuctioneerContract = ContractOf<typeof start>;
|
|
|
64
64
|
export type AuctioneerPublicFacet = AuctioneerContract["publicFacet"];
|
|
65
65
|
export type AuctioneerCreatorFacet = AuctioneerContract["creatorFacet"];
|
|
66
66
|
import { auctioneerParamTypes } from './params.js';
|
|
67
|
+
import type { TimerService } from '@agoric/time';
|
|
67
68
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
69
|
+
import type { Remote } from '@agoric/internal';
|
|
68
70
|
import type { Baggage } from '@agoric/vat-data';
|
|
71
|
+
import type { OfferSpec } from './auctionBook.js';
|
|
72
|
+
import type { ScheduleNotification } from './scheduler.js';
|
|
73
|
+
import type { FullSchedule } from './scheduler.js';
|
|
69
74
|
import type { ContractOf } from '@agoric/zoe/src/zoeService/utils.js';
|
|
70
75
|
//# sourceMappingURL=auctioneer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auctioneer.d.ts","sourceRoot":"","sources":["auctioneer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auctioneer.d.ts","sourceRoot":"","sources":["auctioneer.js"],"names":[],"mappings":"AA0LO,yEAXI,MAAM,CAAC,KAAK,CAAC,YACb,MAAM,CAAC,KAAK,CAAC,YACb;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CAAE,EAAE,kBAC/D,OAAO,kBACP,OAAO,qBAEP,MAAM,eAEN,OAAO,SACP,KAAK,6BAgNf;AAiBM,2BAdI,GAAG,CACT,eAAe,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAC7C,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,cAAc,EAAE,cAAc,CAAC;CAChC,CACF,eACO;IACN,sBAAsB,EAAE,UAAU,CAAC;IACnC,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;CAChC,WACO,OAAO;;;;;;;;;;QAyOZ,4CAA4C;2CAAhC,KAAK,CAAC,KAAK,CAAC;;;;;;;;;;;;;kBApCT,MAAM,CAAC,KAAK,CAAC;;;;QAkG5B;;;WAGG;yBAFQ,MAAM,CAAC,KAAK,CAAC,OACb,OAAO;QAyBlB,uCAAuC;uBAAzB,OAAO,CAAC,YAAY,CAAC;;QA3BnC;;;WAGG;yBAFQ,MAAM,CAAC,KAAK,CAAC,OACb,OAAO;QAyBlB,uCAAuC;uBAAzB,OAAO,CAAC,YAAY,CAAC;;GAQxC;AAED,6DAA6D;AAC7D,yEAAyE;AACzE,2EAA2E;AAE3E,8DAAkE;iCAJpD,WAAW,OAAO,KAAK,CAAC;oCACxB,kBAAkB,CAAC,aAAa,CAAC;qCACjC,kBAAkB,CAAC,cAAc,CAAC;qCApsBX,aAAa;kCAUnB,cAAc;oCADgD,4BAA4B;4BAJlF,kBAAkB;6BAE/B,kBAAkB;+BAMhB,kBAAkB;0CADP,gBAAgB;kCAExB,gBAAgB;gCANlB,qCAAqC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="@agoric/governance/exported" />
|
|
2
|
-
/// <reference types="@agoric/zoe/exported" />
|
|
1
|
+
/// <reference types="@agoric/governance/exported.js" />
|
|
2
|
+
/// <reference types="@agoric/zoe/exported.js" />
|
|
3
3
|
|
|
4
4
|
import { Fail, q } from '@endo/errors';
|
|
5
5
|
import { E } from '@endo/eventual-send';
|
|
@@ -7,6 +7,7 @@ import { Far } from '@endo/marshal';
|
|
|
7
7
|
import { AmountMath, AmountShape, BrandShape } from '@agoric/ertp';
|
|
8
8
|
import { handleParamGovernance } from '@agoric/governance';
|
|
9
9
|
import { makeTracer } from '@agoric/internal';
|
|
10
|
+
import { wrapRemoteMarshaller } from '@agoric/internal/src/marshal/wrap-marshaller.js';
|
|
10
11
|
import { prepareDurablePublishKit } from '@agoric/notifier';
|
|
11
12
|
import { mustMatch } from '@agoric/store';
|
|
12
13
|
import { appendToStoredArray } from '@agoric/store/src/stores/store-utils.js';
|
|
@@ -35,11 +36,16 @@ import { makeScheduler } from './scheduler.js';
|
|
|
35
36
|
import { AuctionState } from './util.js';
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
|
-
* @import {TypedPattern} from '@agoric/internal';
|
|
39
|
+
* @import {Remote, TypedPattern} from '@agoric/internal';
|
|
39
40
|
* @import {MapStore} from '@agoric/store';
|
|
40
41
|
* @import {Baggage} from '@agoric/vat-data';
|
|
41
42
|
* @import {ContractOf} from '@agoric/zoe/src/zoeService/utils.js';
|
|
42
43
|
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
44
|
+
* @import {TimerService} from '@agoric/time';
|
|
45
|
+
* @import {AuctionBook} from './auctionBook.js';
|
|
46
|
+
* @import {ScheduleNotification} from './scheduler.js';
|
|
47
|
+
* @import {OfferSpec} from './auctionBook.js';
|
|
48
|
+
* @import {FullSchedule} from './scheduler.js';
|
|
43
49
|
*/
|
|
44
50
|
|
|
45
51
|
const BASIS_POINTS = 10_000n;
|
|
@@ -389,15 +395,15 @@ export const distributeProportionalSharesWithLimits = (
|
|
|
389
395
|
/**
|
|
390
396
|
* @param {ZCF<
|
|
391
397
|
* GovernanceTerms<typeof auctioneerParamTypes> & {
|
|
392
|
-
* timerService:
|
|
398
|
+
* timerService: TimerService;
|
|
393
399
|
* reservePublicFacet: AssetReservePublicFacet;
|
|
394
400
|
* priceAuthority: PriceAuthority;
|
|
395
401
|
* }
|
|
396
402
|
* >} zcf
|
|
397
403
|
* @param {{
|
|
398
404
|
* initialPoserInvitation: Invitation;
|
|
399
|
-
* storageNode: StorageNode
|
|
400
|
-
* marshaller: Marshaller
|
|
405
|
+
* storageNode: Remote<StorageNode>;
|
|
406
|
+
* marshaller: Remote<Marshaller>;
|
|
401
407
|
* }} privateArgs
|
|
402
408
|
* @param {Baggage} baggage
|
|
403
409
|
*/
|
|
@@ -408,7 +414,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
408
414
|
|
|
409
415
|
const bidAmountShape = { brand: brands.Bid, value: M.nat() };
|
|
410
416
|
|
|
411
|
-
/** @type {MapStore<Brand,
|
|
417
|
+
/** @type {MapStore<Brand, AuctionBook>} */
|
|
412
418
|
const books = provideDurableMapStore(baggage, 'auctionBooks');
|
|
413
419
|
/**
|
|
414
420
|
* @type {MapStore<
|
|
@@ -424,11 +430,15 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
424
430
|
|
|
425
431
|
let bookCounter = 0;
|
|
426
432
|
|
|
433
|
+
const { marshaller: remoteMarshaller } = privateArgs;
|
|
434
|
+
|
|
435
|
+
const cachingMarshaller = wrapRemoteMarshaller(remoteMarshaller);
|
|
436
|
+
|
|
427
437
|
const makeDurablePublishKit = prepareDurablePublishKit(
|
|
428
438
|
baggage,
|
|
429
439
|
'Auction publish kit',
|
|
430
440
|
);
|
|
431
|
-
const makeRecorder = prepareRecorder(baggage,
|
|
441
|
+
const makeRecorder = prepareRecorder(baggage, cachingMarshaller);
|
|
432
442
|
|
|
433
443
|
const makeRecorderKit = defineRecorderKit({
|
|
434
444
|
makeRecorder,
|
|
@@ -444,7 +454,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
444
454
|
const scheduleKit = makeERecorderKit(
|
|
445
455
|
E(privateArgs.storageNode).makeChildNode('schedule'),
|
|
446
456
|
/**
|
|
447
|
-
* @type {TypedPattern<
|
|
457
|
+
* @type {TypedPattern<ScheduleNotification>}
|
|
448
458
|
*/ (M.any()),
|
|
449
459
|
);
|
|
450
460
|
|
|
@@ -534,7 +544,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
534
544
|
privateArgs.initialPoserInvitation,
|
|
535
545
|
auctioneerParamTypes,
|
|
536
546
|
privateArgs.storageNode,
|
|
537
|
-
|
|
547
|
+
cachingMarshaller,
|
|
538
548
|
);
|
|
539
549
|
|
|
540
550
|
const tradeEveryBook = () => {
|
|
@@ -636,7 +646,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
636
646
|
const offerSpecShape = makeOfferSpecShape(brands.Bid, collateralBrand);
|
|
637
647
|
/**
|
|
638
648
|
* @param {ZCFSeat} zcfSeat
|
|
639
|
-
* @param {
|
|
649
|
+
* @param {OfferSpec} offerSpec
|
|
640
650
|
*/
|
|
641
651
|
const newBidHandler = (zcfSeat, offerSpec) => {
|
|
642
652
|
// xxx consider having Zoe guard the offerArgs with a provided shape
|
|
@@ -702,6 +712,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
702
712
|
|
|
703
713
|
const bookId = `book${bookCounter}`;
|
|
704
714
|
bookCounter += 1;
|
|
715
|
+
/** @type {Remote<StorageNode>} */
|
|
705
716
|
const bNode = await E(privateArgs.storageNode).makeChildNode(bookId);
|
|
706
717
|
|
|
707
718
|
const newBook = await makeAuctionBook(
|
|
@@ -716,7 +727,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
716
727
|
books.init(brand, newBook);
|
|
717
728
|
brandToKeyword.init(brand, kwd);
|
|
718
729
|
},
|
|
719
|
-
/** @returns {Promise<
|
|
730
|
+
/** @returns {Promise<FullSchedule>} */
|
|
720
731
|
getSchedule() {
|
|
721
732
|
return E(scheduler).getSchedule();
|
|
722
733
|
},
|
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,9 +86,9 @@ 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
94
|
makeAddCollateralInvitation(): Promise<globalThis.Invitation<string, never>>;
|
|
@@ -92,7 +96,7 @@ export function makeGovernedTerms({ storageNode: _storageNode, marshaller: _mars
|
|
|
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,9 +141,13 @@ export type AuctionParams = {
|
|
|
137
141
|
DiscountStep: bigint;
|
|
138
142
|
AuctionStartDelay: RelativeTime;
|
|
139
143
|
PriceLockPeriod: RelativeTime;
|
|
140
|
-
TimerBrand:
|
|
144
|
+
TimerBrand: TimerBrand;
|
|
141
145
|
};
|
|
142
146
|
export type AuctionParamRecord = ReturnType<typeof makeAuctioneerParams>;
|
|
143
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';
|
|
144
151
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
152
|
+
import type { TimerBrand } from '@agoric/time';
|
|
145
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
|
*/
|
|
@@ -150,8 +154,11 @@ harden(makeAuctioneerParamManager);
|
|
|
150
154
|
/** @typedef {ReturnType<typeof makeAuctioneerParams>} AuctionParamRecord */
|
|
151
155
|
|
|
152
156
|
/**
|
|
153
|
-
* @param {{
|
|
154
|
-
*
|
|
157
|
+
* @param {{
|
|
158
|
+
* storageNode: Remote<StorageNode>;
|
|
159
|
+
* marshaller: Remote<Marshaller>;
|
|
160
|
+
* }} caps
|
|
161
|
+
* @param {ERef<TimerService>} timer
|
|
155
162
|
* @param {ERef<PriceAuthority>} priceAuthority
|
|
156
163
|
* @param {ERef<AssetReservePublicFacet>} reservePublicFacet
|
|
157
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,4 +1,4 @@
|
|
|
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;
|
|
@@ -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
|