@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/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
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",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "^
|
|
8
|
+
"node": "^20.9 || ^22.11"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "yarn build:bundles",
|
|
12
12
|
"build:bundles": "node ./scripts/build-bundles.js",
|
|
13
|
-
"prepack": "tsc --build tsconfig.build.json",
|
|
14
|
-
"postpack": "git clean -f '*.d
|
|
13
|
+
"prepack": "yarn run -T tsc --build tsconfig.build.json",
|
|
14
|
+
"postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
|
|
15
15
|
"test": "ava",
|
|
16
|
-
"test:c8": "c8 --all $C8_OPTIONS ava",
|
|
16
|
+
"test:c8": "c8 --all ${C8_OPTIONS:-} ava",
|
|
17
17
|
"test:xs": "exit 0",
|
|
18
18
|
"lint-fix": "yarn lint:eslint --fix",
|
|
19
|
-
"lint": "run-s --continue-on-error lint:*",
|
|
20
|
-
"lint:eslint": "eslint .",
|
|
21
|
-
"lint:types": "tsc"
|
|
19
|
+
"lint": "yarn run -T run-s --continue-on-error 'lint:*'",
|
|
20
|
+
"lint:eslint": "yarn run -T eslint .",
|
|
21
|
+
"lint:types": "yarn run -T tsc"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -31,37 +31,38 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agoric/
|
|
35
|
-
"@agoric/
|
|
36
|
-
"@agoric/
|
|
37
|
-
"@agoric/
|
|
38
|
-
"@agoric/
|
|
39
|
-
"@agoric/
|
|
40
|
-
"@agoric/
|
|
41
|
-
"@agoric/
|
|
42
|
-
"@agoric/
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@endo/
|
|
46
|
-
"@endo/
|
|
47
|
-
"@endo/
|
|
48
|
-
"@endo/
|
|
49
|
-
"@endo/
|
|
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
|
+
"@endo/captp": "^4.4.8",
|
|
46
|
+
"@endo/errors": "^1.2.13",
|
|
47
|
+
"@endo/eventual-send": "^1.3.4",
|
|
48
|
+
"@endo/far": "^1.1.14",
|
|
49
|
+
"@endo/marshal": "^1.8.0",
|
|
50
|
+
"@endo/nat": "^5.1.3",
|
|
51
|
+
"@endo/promise-kit": "^1.1.13",
|
|
50
52
|
"jessie.js": "^0.3.4"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"@agoric/smart-wallet": "0.5.4-other-dev-
|
|
54
|
-
"@agoric/swingset-liveslots": "0.10.3-other-dev-
|
|
55
|
-
"@agoric/swingset-vat": "0.32.3-other-dev-
|
|
56
|
-
"@
|
|
57
|
-
"@endo/
|
|
58
|
-
"@endo/
|
|
59
|
-
"@endo/promise-kit": "^1.1.8",
|
|
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
|
+
"@endo/bundle-source": "^4.1.2",
|
|
59
|
+
"@endo/init": "^1.1.12",
|
|
60
|
+
"@endo/promise-kit": "^1.1.13",
|
|
60
61
|
"@fast-check/ava": "^1.1.5",
|
|
61
62
|
"ava": "^5.3.0",
|
|
62
|
-
"c8": "^10.1.
|
|
63
|
+
"c8": "^10.1.3",
|
|
63
64
|
"deep-object-diff": "^1.1.9",
|
|
64
|
-
"import-meta-resolve": "^
|
|
65
|
+
"import-meta-resolve": "^4.1.0"
|
|
65
66
|
},
|
|
66
67
|
"files": [
|
|
67
68
|
"scripts",
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
"access": "public"
|
|
83
84
|
},
|
|
84
85
|
"typeCoverage": {
|
|
85
|
-
"atLeast": 95.
|
|
86
|
+
"atLeast": 95.65
|
|
86
87
|
},
|
|
87
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "d15096dc4ff8b96e9b6cd11954c20d3a9efbb393"
|
|
88
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
|
|
@@ -59,7 +59,7 @@ export function prepareAuctionBook(baggage: Baggage, zcf: ZCF, makeRecorderKit:
|
|
|
59
59
|
exitAfterBuy?: boolean | undefined;
|
|
60
60
|
}): void;
|
|
61
61
|
publishBookData(): Promise<void>;
|
|
62
|
-
|
|
62
|
+
ensureQuoteNotifierObserved(): void;
|
|
63
63
|
};
|
|
64
64
|
self: {
|
|
65
65
|
/**
|
|
@@ -71,8 +71,7 @@ export function prepareAuctionBook(baggage: Baggage, zcf: ZCF, makeRecorderKit:
|
|
|
71
71
|
* sell more if there is more than one supplier of collateral, and
|
|
72
72
|
* they request inconsistent limits.
|
|
73
73
|
*/
|
|
74
|
-
addAssets(assetAmount: Amount<"nat">, sourceSeat: ZCFSeat, proceedsGoal?:
|
|
75
|
-
/** @type {(reduction: Ratio) => void} */
|
|
74
|
+
addAssets(assetAmount: Amount<"nat">, sourceSeat: ZCFSeat, proceedsGoal?: Amount<"nat">): void;
|
|
76
75
|
settleAtNewRate(reduction: Ratio): void;
|
|
77
76
|
getCurrentPrice(): Ratio | null;
|
|
78
77
|
hasOrders(): boolean;
|
|
@@ -85,8 +84,8 @@ export function prepareAuctionBook(baggage: Baggage, zcf: ZCF, makeRecorderKit:
|
|
|
85
84
|
*/
|
|
86
85
|
addOffer(offerSpec: OfferSpec, seat: ZCFSeat, trySettle: boolean): void;
|
|
87
86
|
getSeats(): {
|
|
88
|
-
collateralSeat: ZCFSeat;
|
|
89
|
-
bidHoldingSeat: ZCFSeat;
|
|
87
|
+
collateralSeat: globalThis.ZCFSeat;
|
|
88
|
+
bidHoldingSeat: globalThis.ZCFSeat;
|
|
90
89
|
};
|
|
91
90
|
exitAllSeats(): void;
|
|
92
91
|
endAuction(): void;
|
|
@@ -141,7 +140,10 @@ export type BookDataNotification = {
|
|
|
141
140
|
*/
|
|
142
141
|
collateralAvailable: Amount<"nat"> | null;
|
|
143
142
|
};
|
|
144
|
-
export type AuctionBook =
|
|
143
|
+
export type AuctionBook = EReturn<EReturn<typeof prepareAuctionBook>>;
|
|
145
144
|
import type { Baggage } from '@agoric/vat-data';
|
|
145
|
+
import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
146
146
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
147
|
+
import type { Remote } from '@agoric/internal';
|
|
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';
|
|
@@ -28,9 +28,11 @@ import {
|
|
|
28
28
|
} from './util.js';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
+
* @import {EReturn} from '@endo/far';
|
|
31
32
|
* @import {Baggage} from '@agoric/vat-data';
|
|
32
33
|
* @import {PriceAuthority} from '@agoric/zoe/tools/types.js';
|
|
33
|
-
* @import {TypedPattern} from '@agoric/internal';
|
|
34
|
+
* @import {TypedPattern, Remote} from '@agoric/internal';
|
|
35
|
+
* @import {MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
34
36
|
*/
|
|
35
37
|
|
|
36
38
|
const { makeEmpty } = AmountMath;
|
|
@@ -113,11 +115,13 @@ export const makeOfferSpecShape = (bidBrand, collateralBrand) => {
|
|
|
113
115
|
/**
|
|
114
116
|
* @param {Baggage} baggage
|
|
115
117
|
* @param {ZCF} zcf
|
|
116
|
-
* @param {
|
|
118
|
+
* @param {MakeRecorderKit} makeRecorderKit
|
|
117
119
|
*/
|
|
118
120
|
export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
|
|
119
121
|
const makeScaledBidBook = prepareScaledBidBook(baggage);
|
|
120
122
|
const makePriceBook = preparePriceBook(baggage);
|
|
123
|
+
// Brands that have or are making active quoteNotifier Observers
|
|
124
|
+
const observedBrands = new Set();
|
|
121
125
|
|
|
122
126
|
const AuctionBookStateShape = harden({
|
|
123
127
|
collateralBrand: M.any(),
|
|
@@ -146,7 +150,7 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
|
|
|
146
150
|
* @param {Brand<'nat'>} bidBrand
|
|
147
151
|
* @param {Brand<'nat'>} collateralBrand
|
|
148
152
|
* @param {PriceAuthority} pAuthority
|
|
149
|
-
* @param {StorageNode} node
|
|
153
|
+
* @param {Remote<StorageNode>} node
|
|
150
154
|
*/
|
|
151
155
|
(bidBrand, collateralBrand, pAuthority, node) => {
|
|
152
156
|
assertAllDefined({ bidBrand, collateralBrand, pAuthority });
|
|
@@ -454,38 +458,59 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
|
|
|
454
458
|
});
|
|
455
459
|
return state.bookDataKit.recorder.write(bookData);
|
|
456
460
|
},
|
|
457
|
-
|
|
461
|
+
// Ensure that there is an observer monitoring the quoteNotifier. We
|
|
462
|
+
// assume that all failure modes for quoteNotifier eventually lead to
|
|
463
|
+
// fail or finish.
|
|
464
|
+
ensureQuoteNotifierObserved() {
|
|
458
465
|
const { state, facets } = this;
|
|
459
466
|
const { collateralBrand, bidBrand, priceAuthority } = state;
|
|
460
467
|
|
|
468
|
+
if (observedBrands.has(collateralBrand)) {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
observedBrands.add(collateralBrand);
|
|
461
472
|
trace('observing');
|
|
462
473
|
|
|
463
|
-
const
|
|
474
|
+
const quoteNotifierP = E(priceAuthority).makeQuoteNotifier(
|
|
464
475
|
AmountMath.make(collateralBrand, QUOTE_SCALE),
|
|
465
476
|
bidBrand,
|
|
466
477
|
);
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
478
|
+
|
|
479
|
+
void E.when(
|
|
480
|
+
quoteNotifierP,
|
|
481
|
+
quoteNotifier =>
|
|
482
|
+
observeNotifier(quoteNotifier, {
|
|
483
|
+
updateState: quote => {
|
|
484
|
+
trace(
|
|
485
|
+
`BOOK notifier ${priceFrom(quote).numerator.value}/${
|
|
486
|
+
priceFrom(quote).denominator.value
|
|
487
|
+
}`,
|
|
488
|
+
);
|
|
489
|
+
state.updatingOracleQuote = priceFrom(quote);
|
|
490
|
+
},
|
|
491
|
+
fail: reason => {
|
|
492
|
+
trace(
|
|
493
|
+
`Failure from quoteNotifier (${reason}) setting to null`,
|
|
494
|
+
);
|
|
495
|
+
// lack of quote will trigger restart
|
|
496
|
+
state.updatingOracleQuote = null;
|
|
497
|
+
observedBrands.delete(collateralBrand);
|
|
498
|
+
},
|
|
499
|
+
finish: done => {
|
|
500
|
+
trace(
|
|
501
|
+
`quoteNotifier invoked finish(${done}). setting quote to null`,
|
|
502
|
+
);
|
|
503
|
+
// lack of quote will trigger restart
|
|
504
|
+
state.updatingOracleQuote = null;
|
|
505
|
+
observedBrands.delete(collateralBrand);
|
|
506
|
+
},
|
|
507
|
+
}),
|
|
508
|
+
e => {
|
|
509
|
+
trace('makeQuoteNotifier failed, resetting', e);
|
|
486
510
|
state.updatingOracleQuote = null;
|
|
511
|
+
observedBrands.delete(collateralBrand);
|
|
487
512
|
},
|
|
488
|
-
|
|
513
|
+
);
|
|
489
514
|
|
|
490
515
|
void facets.helper.publishBookData();
|
|
491
516
|
},
|
|
@@ -645,8 +670,9 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
|
|
|
645
670
|
|
|
646
671
|
trace(`capturing oracle price `, state.updatingOracleQuote);
|
|
647
672
|
if (!state.updatingOracleQuote) {
|
|
648
|
-
// if the price
|
|
649
|
-
|
|
673
|
+
// if the price feed has died (or hasn't been started for this
|
|
674
|
+
// incarnation), (re)start it.
|
|
675
|
+
facets.helper.ensureQuoteNotifierObserved();
|
|
650
676
|
return;
|
|
651
677
|
}
|
|
652
678
|
|
|
@@ -750,7 +776,7 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
|
|
|
750
776
|
const { collateralBrand, bidBrand, priceAuthority } = state;
|
|
751
777
|
assertAllDefined({ collateralBrand, bidBrand, priceAuthority });
|
|
752
778
|
|
|
753
|
-
facets.helper.
|
|
779
|
+
facets.helper.ensureQuoteNotifierObserved();
|
|
754
780
|
},
|
|
755
781
|
stateShape: AuctionBookStateShape,
|
|
756
782
|
},
|
|
@@ -766,4 +792,4 @@ export const prepareAuctionBook = (baggage, zcf, makeRecorderKit) => {
|
|
|
766
792
|
};
|
|
767
793
|
harden(prepareAuctionBook);
|
|
768
794
|
|
|
769
|
-
/** @typedef {
|
|
795
|
+
/** @typedef {EReturn<EReturn<typeof prepareAuctionBook>>} AuctionBook */
|
|
@@ -4,7 +4,7 @@ export function amountsToSettle({ bidAlloc, collateralWanted, collateralAvailabl
|
|
|
4
4
|
collateralAvailable: Amount<"nat">;
|
|
5
5
|
curAuctionPrice: Ratio;
|
|
6
6
|
remainingProceedsGoal: Amount<"nat"> | null;
|
|
7
|
-
}, log?: (
|
|
7
|
+
}, log?: (...msgs: any[]) => void): {
|
|
8
8
|
proceedsExpected: null;
|
|
9
9
|
proceedsTarget?: undefined;
|
|
10
10
|
collateralTarget?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auctionMath.d.ts","sourceRoot":"","sources":["auctionMath.js"],"names":[],"mappings":"AAoBO,8HARJ;IAAyB,QAAQ,EAAzB,OAAO,KAAK,CAAC;IACI,gBAAgB,EAAjC,OAAO,KAAK,CAAC;IACI,mBAAmB,EAApC,OAAO,KAAK,CAAC;IACJ,eAAe,EAAxB,KAAK;IACmB,qBAAqB,EAA7C,OAAO,KAAK,CAAC,GAAG,IAAI;CAE5B,
|
|
1
|
+
{"version":3,"file":"auctionMath.d.ts","sourceRoot":"","sources":["auctionMath.js"],"names":[],"mappings":"AAoBO,8HARJ;IAAyB,QAAQ,EAAzB,OAAO,KAAK,CAAC;IACI,gBAAgB,EAAjC,OAAO,KAAK,CAAC;IACI,mBAAmB,EAApC,OAAO,KAAK,CAAC;IACJ,eAAe,EAAxB,KAAK;IACmB,qBAAqB,EAA7C,OAAO,KAAK,CAAC,GAAG,IAAI;CAE5B,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI;;;;;;;;EA6DlC;4BAxEwB,2BAA2B"}
|
|
@@ -2,15 +2,15 @@ export function distributeProportionalSharesWithLimits(unsoldCollateral: Amount<
|
|
|
2
2
|
seat: ZCFSeat;
|
|
3
3
|
amount: Amount<"nat">;
|
|
4
4
|
goal: Amount<"nat">;
|
|
5
|
-
}[], collateralSeat: ZCFSeat, bidHoldingSeat: ZCFSeat, collateralKeyword: string, reserveSeat: ZCFSeat, brand: Brand): TransferPart[];
|
|
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,19 +22,19 @@ 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<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
|
-
makeDepositInvitation: () => Promise<Invitation<string, {
|
|
37
|
+
makeDepositInvitation: () => Promise<globalThis.Invitation<string, {
|
|
38
38
|
goal: Amount<"nat">;
|
|
39
39
|
}>>;
|
|
40
40
|
}>;
|
|
@@ -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<
|
|
49
|
-
} &
|
|
47
|
+
/** @returns {Promise<FullSchedule>} */
|
|
48
|
+
getSchedule(): Promise<FullSchedule>;
|
|
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,6 +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';
|
|
74
|
+
import type { ContractOf } from '@agoric/zoe/src/zoeService/utils.js';
|
|
69
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,9 +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';
|
|
40
|
+
* @import {MapStore} from '@agoric/store';
|
|
39
41
|
* @import {Baggage} from '@agoric/vat-data';
|
|
42
|
+
* @import {ContractOf} from '@agoric/zoe/src/zoeService/utils.js';
|
|
40
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';
|
|
41
49
|
*/
|
|
42
50
|
|
|
43
51
|
const BASIS_POINTS = 10_000n;
|
|
@@ -387,15 +395,15 @@ export const distributeProportionalSharesWithLimits = (
|
|
|
387
395
|
/**
|
|
388
396
|
* @param {ZCF<
|
|
389
397
|
* GovernanceTerms<typeof auctioneerParamTypes> & {
|
|
390
|
-
* timerService:
|
|
398
|
+
* timerService: TimerService;
|
|
391
399
|
* reservePublicFacet: AssetReservePublicFacet;
|
|
392
400
|
* priceAuthority: PriceAuthority;
|
|
393
401
|
* }
|
|
394
402
|
* >} zcf
|
|
395
403
|
* @param {{
|
|
396
404
|
* initialPoserInvitation: Invitation;
|
|
397
|
-
* storageNode: StorageNode
|
|
398
|
-
* marshaller: Marshaller
|
|
405
|
+
* storageNode: Remote<StorageNode>;
|
|
406
|
+
* marshaller: Remote<Marshaller>;
|
|
399
407
|
* }} privateArgs
|
|
400
408
|
* @param {Baggage} baggage
|
|
401
409
|
*/
|
|
@@ -406,7 +414,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
406
414
|
|
|
407
415
|
const bidAmountShape = { brand: brands.Bid, value: M.nat() };
|
|
408
416
|
|
|
409
|
-
/** @type {MapStore<Brand,
|
|
417
|
+
/** @type {MapStore<Brand, AuctionBook>} */
|
|
410
418
|
const books = provideDurableMapStore(baggage, 'auctionBooks');
|
|
411
419
|
/**
|
|
412
420
|
* @type {MapStore<
|
|
@@ -422,11 +430,15 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
422
430
|
|
|
423
431
|
let bookCounter = 0;
|
|
424
432
|
|
|
433
|
+
const { marshaller: remoteMarshaller } = privateArgs;
|
|
434
|
+
|
|
435
|
+
const cachingMarshaller = wrapRemoteMarshaller(remoteMarshaller);
|
|
436
|
+
|
|
425
437
|
const makeDurablePublishKit = prepareDurablePublishKit(
|
|
426
438
|
baggage,
|
|
427
439
|
'Auction publish kit',
|
|
428
440
|
);
|
|
429
|
-
const makeRecorder = prepareRecorder(baggage,
|
|
441
|
+
const makeRecorder = prepareRecorder(baggage, cachingMarshaller);
|
|
430
442
|
|
|
431
443
|
const makeRecorderKit = defineRecorderKit({
|
|
432
444
|
makeRecorder,
|
|
@@ -442,7 +454,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
442
454
|
const scheduleKit = makeERecorderKit(
|
|
443
455
|
E(privateArgs.storageNode).makeChildNode('schedule'),
|
|
444
456
|
/**
|
|
445
|
-
* @type {TypedPattern<
|
|
457
|
+
* @type {TypedPattern<ScheduleNotification>}
|
|
446
458
|
*/ (M.any()),
|
|
447
459
|
);
|
|
448
460
|
|
|
@@ -532,7 +544,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
532
544
|
privateArgs.initialPoserInvitation,
|
|
533
545
|
auctioneerParamTypes,
|
|
534
546
|
privateArgs.storageNode,
|
|
535
|
-
|
|
547
|
+
cachingMarshaller,
|
|
536
548
|
);
|
|
537
549
|
|
|
538
550
|
const tradeEveryBook = () => {
|
|
@@ -634,7 +646,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
634
646
|
const offerSpecShape = makeOfferSpecShape(brands.Bid, collateralBrand);
|
|
635
647
|
/**
|
|
636
648
|
* @param {ZCFSeat} zcfSeat
|
|
637
|
-
* @param {
|
|
649
|
+
* @param {OfferSpec} offerSpec
|
|
638
650
|
*/
|
|
639
651
|
const newBidHandler = (zcfSeat, offerSpec) => {
|
|
640
652
|
// xxx consider having Zoe guard the offerArgs with a provided shape
|
|
@@ -700,6 +712,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
700
712
|
|
|
701
713
|
const bookId = `book${bookCounter}`;
|
|
702
714
|
bookCounter += 1;
|
|
715
|
+
/** @type {Remote<StorageNode>} */
|
|
703
716
|
const bNode = await E(privateArgs.storageNode).makeChildNode(bookId);
|
|
704
717
|
|
|
705
718
|
const newBook = await makeAuctionBook(
|
|
@@ -714,7 +727,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
714
727
|
books.init(brand, newBook);
|
|
715
728
|
brandToKeyword.init(brand, kwd);
|
|
716
729
|
},
|
|
717
|
-
/** @returns {Promise<
|
|
730
|
+
/** @returns {Promise<FullSchedule>} */
|
|
718
731
|
getSchedule() {
|
|
719
732
|
return E(scheduler).getSchedule();
|
|
720
733
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function prepareScaledBidBook(baggage: Baggage): (bidScalingPattern:
|
|
1
|
+
export function prepareScaledBidBook(baggage: Baggage): (bidScalingPattern: Pattern, collateralBrand: globalThis.Brand) => import("@endo/exo").Guarded<{
|
|
2
2
|
/**
|
|
3
3
|
* @param {ZCFSeat} seat
|
|
4
4
|
* @param {Ratio} bidScaling
|
|
@@ -13,7 +13,7 @@ export function prepareScaledBidBook(baggage: Baggage): (bidScalingPattern: glob
|
|
|
13
13
|
updateReceived(key: any, sold: any): void;
|
|
14
14
|
exitAllSeats(): void;
|
|
15
15
|
}>;
|
|
16
|
-
export function preparePriceBook(baggage: Baggage): (priceRatioPattern:
|
|
16
|
+
export function preparePriceBook(baggage: Baggage): (priceRatioPattern: Pattern, collateralBrand: globalThis.Brand) => import("@endo/exo").Guarded<{
|
|
17
17
|
/**
|
|
18
18
|
* @param {ZCFSeat} seat
|
|
19
19
|
* @param {Ratio} price
|
|
@@ -42,4 +42,5 @@ export type BidderRecord = {
|
|
|
42
42
|
price: Ratio;
|
|
43
43
|
});
|
|
44
44
|
import type { Baggage } from '@agoric/vat-data';
|
|
45
|
+
import type { Pattern } from '@endo/patterns';
|
|
45
46
|
//# sourceMappingURL=offerBook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offerBook.d.ts","sourceRoot":"","sources":["offerBook.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"offerBook.d.ts","sourceRoot":"","sources":["offerBook.js"],"names":[],"mappings":"AAsDO,8CAFI,OAAO;IAkBZ;;;;;OAKG;cAJQ,OAAO,cACP,KAAK,UACL,MAAM,CAAC,KAAK,CAAC,gBACb,OAAO;IAsBlB,gCAAgC;4BAApB,KAAK;;;;;GAqCpB;AAcI,0CAFI,OAAO;IAkBZ;;;;;OAKG;cAJQ,OAAO,SACP,KAAK,UACL,MAAM,CAAC,KAAK,CAAC,gBACb,OAAO;;;;;;GA0DrB;2BAnMU;IACR,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CACzB,GAAG;IAAE,YAAY,EAAE,OAAO,CAAA;CAAE,GAAG,CAC1B;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACzC;IAAE,UAAU,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAC1C;6BAtBoB,kBAAkB;6BACb,gBAAgB"}
|
package/src/auction/offerBook.js
CHANGED
|
@@ -12,7 +12,11 @@ import {
|
|
|
12
12
|
toScaledRateOfferKey,
|
|
13
13
|
} from './sortedOffers.js';
|
|
14
14
|
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @import {MapStore} from '@agoric/store';
|
|
17
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
18
|
+
* @import {Key, Pattern} from '@endo/patterns';
|
|
19
|
+
*/
|
|
16
20
|
|
|
17
21
|
// multiple offers might be provided at the same time (since the time
|
|
18
22
|
// granularity is limited to blocks), so we increment a sequenceNumber with each
|