@agoric/inter-protocol 0.16.2-other-dev-8f8782b.0 → 0.16.2-other-dev-fbe72e7.0.fbe72e7
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/README.md +6 -6
- package/package.json +46 -39
- package/scripts/build-bundles.js +5 -21
- package/src/auction/auctionBook.d.ts +147 -0
- package/src/auction/auctionBook.d.ts.map +1 -0
- package/src/auction/auctionBook.js +182 -151
- package/src/auction/auctionMath.d.ts +17 -0
- package/src/auction/auctionMath.d.ts.map +1 -0
- package/src/auction/auctionMath.js +81 -0
- package/src/auction/auctioneer.d.ts +70 -0
- package/src/auction/auctioneer.d.ts.map +1 -0
- package/src/auction/auctioneer.js +72 -59
- package/src/auction/offerBook.d.ts +46 -0
- package/src/auction/offerBook.d.ts.map +1 -0
- package/src/auction/offerBook.js +17 -12
- package/src/auction/params.d.ts +145 -0
- package/src/auction/params.d.ts.map +1 -0
- package/src/auction/params.js +11 -9
- package/src/auction/scheduleMath.d.ts +5 -0
- package/src/auction/scheduleMath.d.ts.map +1 -0
- package/src/auction/scheduleMath.js +18 -16
- package/src/auction/scheduler.d.ts +50 -0
- package/src/auction/scheduler.d.ts.map +1 -0
- package/src/auction/scheduler.js +53 -47
- package/src/auction/sortedOffers.d.ts +8 -0
- package/src/auction/sortedOffers.d.ts.map +1 -0
- package/src/auction/sortedOffers.js +10 -9
- package/src/auction/util.d.ts +31 -0
- package/src/auction/util.d.ts.map +1 -0
- package/src/auction/util.js +12 -6
- package/src/clientSupport.d.ts +168 -0
- package/src/clientSupport.d.ts.map +1 -0
- package/src/clientSupport.js +161 -98
- package/src/collectFees.d.ts +2 -0
- package/src/collectFees.d.ts.map +1 -0
- package/src/contractSupport.d.ts +28 -0
- package/src/contractSupport.d.ts.map +1 -0
- package/src/contractSupport.js +19 -13
- package/src/econCommitteeCharter.d.ts +43 -0
- package/src/econCommitteeCharter.d.ts.map +1 -0
- package/src/econCommitteeCharter.js +25 -20
- package/src/feeDistributor.d.ts +224 -0
- package/src/feeDistributor.d.ts.map +1 -0
- package/src/feeDistributor.js +41 -33
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +1 -0
- package/src/interest-math.d.ts +4 -0
- package/src/interest-math.d.ts.map +1 -0
- package/src/interest-math.js +5 -1
- package/src/interest.d.ts +30 -0
- package/src/interest.d.ts.map +1 -0
- package/src/interest.js +25 -23
- package/src/price/README.md +14 -1
- package/src/price/fluxAggregatorContract.d.ts +71 -0
- package/src/price/fluxAggregatorContract.d.ts.map +1 -0
- package/src/price/fluxAggregatorContract.js +64 -55
- package/src/price/fluxAggregatorKit.d.ts +104 -0
- package/src/price/fluxAggregatorKit.d.ts.map +1 -0
- package/src/price/fluxAggregatorKit.js +55 -42
- package/src/price/priceOracleKit.d.ts +39 -0
- package/src/price/priceOracleKit.d.ts.map +1 -0
- package/src/price/priceOracleKit.js +17 -15
- package/src/price/roundsManager.d.ts +204 -0
- package/src/price/roundsManager.d.ts.map +1 -0
- package/src/price/roundsManager.js +132 -85
- package/src/proposals/README.md +2 -3
- package/src/proposals/add-auction.js +285 -0
- package/src/proposals/addAssetToVault.js +192 -40
- package/src/proposals/committee-proposal.js +25 -31
- package/src/proposals/core-proposal.js +9 -11
- package/src/proposals/deploy-price-feeds.js +341 -0
- package/src/proposals/econ-behaviors.js +84 -49
- package/src/proposals/price-feed-proposal.js +109 -51
- package/src/proposals/replace-fee-distributor.js +198 -0
- package/src/proposals/replace-scaledPriceAuthorities.js +124 -0
- package/src/proposals/replaceElectorate.js +610 -0
- package/src/proposals/startEconCommittee.js +2 -2
- package/src/proposals/startPSM.js +44 -29
- package/src/proposals/upgrade-scaledPriceAuthorities.js +78 -0
- package/src/proposals/upgrade-vaults.js +207 -0
- package/src/proposals/utils.d.ts +21 -0
- package/src/proposals/utils.d.ts.map +1 -0
- package/src/proposals/utils.js +66 -9
- package/src/proposals/withdraw-reserve-proposal.js +63 -0
- package/src/provisionPool.d.ts +69 -0
- package/src/provisionPool.d.ts.map +1 -0
- package/src/provisionPool.js +138 -0
- package/src/provisionPoolKit.d.ts +129 -0
- package/src/provisionPoolKit.d.ts.map +1 -0
- package/src/provisionPoolKit.js +608 -0
- package/src/psm/psm.d.ts +133 -0
- package/src/psm/psm.d.ts.map +1 -0
- package/src/psm/psm.js +85 -79
- package/src/psm/types-ambient.d.ts +2 -0
- package/src/psm/types-ambient.d.ts.map +1 -0
- package/src/psm/types-ambient.js +3 -0
- package/src/reserve/assetReserve.d.ts +58 -0
- package/src/reserve/assetReserve.d.ts.map +1 -0
- package/src/reserve/assetReserve.js +42 -34
- package/src/reserve/assetReserveKit.d.ts +103 -0
- package/src/reserve/assetReserveKit.d.ts.map +1 -0
- package/src/reserve/assetReserveKit.js +134 -32
- package/src/reserve/params.d.ts +16 -0
- package/src/reserve/params.d.ts.map +1 -0
- package/src/reserve/params.js +8 -2
- package/src/tokens.d.ts +3 -0
- package/src/tokens.d.ts.map +1 -0
- package/src/tokens.js +5 -0
- package/src/vaultFactory/burn.d.ts +2 -0
- package/src/vaultFactory/burn.d.ts.map +1 -0
- package/src/vaultFactory/burn.js +1 -1
- package/src/vaultFactory/liquidation.d.ts +25 -0
- package/src/vaultFactory/liquidation.d.ts.map +1 -0
- package/src/vaultFactory/liquidation.js +37 -24
- package/src/vaultFactory/math.d.ts +11 -0
- package/src/vaultFactory/math.d.ts.map +1 -0
- package/src/vaultFactory/math.js +11 -10
- package/src/vaultFactory/orderedVaultStore.d.ts +94 -0
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -0
- package/src/vaultFactory/orderedVaultStore.js +9 -10
- package/src/vaultFactory/params.d.ts +143 -0
- package/src/vaultFactory/params.d.ts.map +1 -0
- package/src/vaultFactory/params.js +56 -25
- package/src/vaultFactory/prioritizedVaults.d.ts +280 -0
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -0
- package/src/vaultFactory/prioritizedVaults.js +7 -4
- package/src/vaultFactory/proceeds.d.ts +35 -0
- package/src/vaultFactory/proceeds.d.ts.map +1 -0
- package/src/vaultFactory/proceeds.js +26 -18
- package/src/vaultFactory/storeUtils.d.ts +25 -0
- package/src/vaultFactory/storeUtils.d.ts.map +1 -0
- package/src/vaultFactory/storeUtils.js +10 -12
- package/src/vaultFactory/types-ambient.d.ts +137 -0
- package/src/vaultFactory/types-ambient.d.ts.map +1 -0
- package/src/vaultFactory/{types.js → types-ambient.js} +47 -44
- package/src/vaultFactory/vault.d.ts +344 -0
- package/src/vaultFactory/vault.d.ts.map +1 -0
- package/src/vaultFactory/vault.js +107 -100
- package/src/vaultFactory/vaultDirector.d.ts +347 -0
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -0
- package/src/vaultFactory/vaultDirector.js +94 -64
- package/src/vaultFactory/vaultFactory.d.ts +250 -0
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -0
- package/src/vaultFactory/vaultFactory.js +56 -33
- package/src/vaultFactory/vaultHolder.d.ts +170 -0
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -0
- package/src/vaultFactory/vaultHolder.js +14 -15
- package/src/vaultFactory/vaultKit.d.ts +33 -0
- package/src/vaultFactory/vaultKit.d.ts.map +1 -0
- package/src/vaultFactory/vaultKit.js +9 -4
- package/src/vaultFactory/vaultManager.d.ts +676 -0
- package/src/vaultFactory/vaultManager.d.ts.map +1 -0
- package/src/vaultFactory/vaultManager.js +286 -167
- package/CHANGELOG.md +0 -1041
- package/exported.js +0 -2
- package/scripts/add-collateral-core.js +0 -112
- package/scripts/deploy-contracts.js +0 -100
- package/scripts/init-core.js +0 -198
- package/scripts/invite-committee-core.js +0 -42
- package/scripts/manual-price-feed.js +0 -117
- package/scripts/price-feed-core.js +0 -104
- package/scripts/start-local-chain.sh +0 -84
- package/src/psm/types.js +0 -3
- package/src/typeGuards.js +0 -13
- package/src/vaultFactory/type-imports.js +0 -4
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ import { makeFollower } from '@agoric/casting';
|
|
|
42
42
|
|
|
43
43
|
The canonical keys (under `published`) are as follows. Non-terminal nodes could have data but don't yet. A `0` indicates the index of that child in added order. To get the actual key look it up in parent. High cardinality types get a parent key for enumeration (e.g. `vaults`.)
|
|
44
44
|
- `published`
|
|
45
|
-
- `vaultFactory` - [snapshot of details](./test/vaultFactory/snapshots/
|
|
45
|
+
- `vaultFactory` - [snapshot of details](./test/vaultFactory/snapshots/vaultFactory.test.js.md)
|
|
46
46
|
- `governance`
|
|
47
47
|
- `metrics`
|
|
48
48
|
- `managers`
|
|
@@ -51,22 +51,22 @@ The canonical keys (under `published`) are as follows. Non-terminal nodes could
|
|
|
51
51
|
- `governance`
|
|
52
52
|
- `vaults`
|
|
53
53
|
- `vault0`
|
|
54
|
-
- `auction` - [snapshot of details](./test/auction/snapshots/
|
|
54
|
+
- `auction` - [snapshot of details](./test/auction/snapshots/auctionContract.test.js.md)
|
|
55
55
|
- `schedule`
|
|
56
56
|
- `governance`
|
|
57
57
|
- `book0`
|
|
58
|
-
- `reserve` - [snapshot of details](./test/reserve/snapshots/
|
|
58
|
+
- `reserve` - [snapshot of details](./test/reserve/snapshots/reserve.test.js.md)
|
|
59
59
|
- `governance`
|
|
60
60
|
- `metrics`
|
|
61
|
-
- `priceFeed` - [snapshot of details](./test/price/snapshots/
|
|
61
|
+
- `priceFeed` - [snapshot of details](./test/price/snapshots/fluxAggregatorKit.test.js.md)
|
|
62
62
|
- `${inputBrand}-${outputBrand}_price_feed`
|
|
63
63
|
- `${inputBrand}-${outputBrand}_price_feed.latestRound`
|
|
64
|
-
- `psm` - [snapshot of details](./test/psm/snapshots/
|
|
64
|
+
- `psm` - [snapshot of details](./test/psm/snapshots/psm.test.js.md)
|
|
65
65
|
- `<minted>`
|
|
66
66
|
- `<anchor>`
|
|
67
67
|
- `governance`
|
|
68
68
|
- `metrics`
|
|
69
|
-
- `committees` - [snapshot of details](../governance/test/unitTests/snapshots/
|
|
69
|
+
- `committees` - [snapshot of details](../governance/test/unitTests/snapshots/committee.test.js.md)
|
|
70
70
|
- `Economic_Committee`
|
|
71
71
|
- `latestQuestion`
|
|
72
72
|
- `latestOutcome`
|
package/package.json
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/inter-protocol",
|
|
3
|
-
"version": "0.16.2-other-dev-
|
|
3
|
+
"version": "0.16.2-other-dev-fbe72e7.0.fbe72e7",
|
|
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": "yarn run -T tsc --build tsconfig.build.json",
|
|
14
|
+
"postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
|
|
13
15
|
"test": "ava",
|
|
14
|
-
"test:c8": "c8 $C8_OPTIONS ava
|
|
16
|
+
"test:c8": "c8 --all ${C8_OPTIONS:-} ava",
|
|
15
17
|
"test:xs": "exit 0",
|
|
16
18
|
"lint-fix": "yarn lint:eslint --fix",
|
|
17
|
-
"lint": "run-s --continue-on-error lint:*",
|
|
18
|
-
"lint:eslint": "eslint .",
|
|
19
|
-
"lint:types": "
|
|
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"
|
|
20
22
|
},
|
|
21
23
|
"repository": {
|
|
22
24
|
"type": "git",
|
|
@@ -29,54 +31,59 @@
|
|
|
29
31
|
},
|
|
30
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
31
33
|
"dependencies": {
|
|
32
|
-
"@agoric/
|
|
33
|
-
"@agoric/ertp": "0.16.3-other-dev-
|
|
34
|
-
"@agoric/governance": "0.10.4-other-dev-
|
|
35
|
-
"@agoric/internal": "0.3.3-other-dev-
|
|
36
|
-
"@agoric/notifier": "0.6.3-other-dev-
|
|
37
|
-
"@agoric/store": "0.9.3-other-dev-
|
|
38
|
-
"@agoric/time": "0.3.3-other-dev-
|
|
39
|
-
"@agoric/vat-data": "0.5.3-other-dev-
|
|
40
|
-
"@agoric/vats": "0.15.2-other-dev-
|
|
41
|
-
"@agoric/zoe": "0.26.3-other-dev-
|
|
42
|
-
"@
|
|
43
|
-
"@endo/
|
|
44
|
-
"@endo/
|
|
45
|
-
"@endo/
|
|
46
|
-
"@endo/
|
|
47
|
-
"
|
|
48
|
-
"
|
|
34
|
+
"@agoric/base-zone": "0.1.1-other-dev-fbe72e7.0.fbe72e7",
|
|
35
|
+
"@agoric/ertp": "0.16.3-other-dev-fbe72e7.0.fbe72e7",
|
|
36
|
+
"@agoric/governance": "0.10.4-other-dev-fbe72e7.0.fbe72e7",
|
|
37
|
+
"@agoric/internal": "0.3.3-other-dev-fbe72e7.0.fbe72e7",
|
|
38
|
+
"@agoric/notifier": "0.6.3-other-dev-fbe72e7.0.fbe72e7",
|
|
39
|
+
"@agoric/store": "0.9.3-other-dev-fbe72e7.0.fbe72e7",
|
|
40
|
+
"@agoric/time": "0.3.3-other-dev-fbe72e7.0.fbe72e7",
|
|
41
|
+
"@agoric/vat-data": "0.5.3-other-dev-fbe72e7.0.fbe72e7",
|
|
42
|
+
"@agoric/vats": "0.15.2-other-dev-fbe72e7.0.fbe72e7",
|
|
43
|
+
"@agoric/zoe": "0.26.3-other-dev-fbe72e7.0.fbe72e7",
|
|
44
|
+
"@agoric/zone": "0.2.3-other-dev-fbe72e7.0.fbe72e7",
|
|
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",
|
|
52
|
+
"jessie.js": "^0.3.4"
|
|
49
53
|
},
|
|
50
54
|
"devDependencies": {
|
|
51
|
-
"@agoric/
|
|
52
|
-
"@agoric/
|
|
53
|
-
"@agoric/swingset-
|
|
54
|
-
"@
|
|
55
|
-
"@endo/
|
|
56
|
-
"@endo/
|
|
57
|
-
"@
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"c8": "^7.13.0",
|
|
55
|
+
"@agoric/smart-wallet": "0.5.4-other-dev-fbe72e7.0.fbe72e7",
|
|
56
|
+
"@agoric/swingset-liveslots": "0.10.3-other-dev-fbe72e7.0.fbe72e7",
|
|
57
|
+
"@agoric/swingset-vat": "0.32.3-other-dev-fbe72e7.0.fbe72e7",
|
|
58
|
+
"@endo/bundle-source": "^4.1.2",
|
|
59
|
+
"@endo/init": "^1.1.12",
|
|
60
|
+
"@endo/promise-kit": "^1.1.13",
|
|
61
|
+
"@fast-check/ava": "^1.1.5",
|
|
62
|
+
"ava": "^5.3.0",
|
|
63
|
+
"c8": "^10.1.3",
|
|
61
64
|
"deep-object-diff": "^1.1.9",
|
|
62
|
-
"import-meta-resolve": "^
|
|
65
|
+
"import-meta-resolve": "^4.1.0"
|
|
63
66
|
},
|
|
64
67
|
"files": [
|
|
65
|
-
"scripts
|
|
68
|
+
"scripts",
|
|
66
69
|
"src/",
|
|
67
|
-
"exported.js",
|
|
68
70
|
"NEWS.md"
|
|
69
71
|
],
|
|
70
72
|
"ava": {
|
|
71
73
|
"files": [
|
|
72
|
-
"test
|
|
74
|
+
"test/**/*.test.*"
|
|
75
|
+
],
|
|
76
|
+
"require": [
|
|
77
|
+
"@endo/init/debug.js"
|
|
73
78
|
],
|
|
74
|
-
"concurrency": 2,
|
|
75
79
|
"workerThreads": false,
|
|
76
80
|
"timeout": "10m"
|
|
77
81
|
},
|
|
78
82
|
"publishConfig": {
|
|
79
83
|
"access": "public"
|
|
80
84
|
},
|
|
81
|
-
"
|
|
85
|
+
"typeCoverage": {
|
|
86
|
+
"atLeast": 95.64
|
|
87
|
+
},
|
|
88
|
+
"gitHead": "fbe72e72107f9997f788674e668c660d92ec4492"
|
|
82
89
|
}
|
package/scripts/build-bundles.js
CHANGED
|
@@ -1,36 +1,20 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
import '@endo/init';
|
|
3
|
-
import {
|
|
4
|
-
createBundles,
|
|
5
|
-
extractProposalBundles,
|
|
6
|
-
} from '@agoric/internal/src/node/createBundles.js';
|
|
7
|
-
import url from 'url';
|
|
8
|
-
import process from 'process';
|
|
9
|
-
|
|
10
|
-
import { defaultProposalBuilder } from './init-core.js';
|
|
11
|
-
import { defaultProposalBuilder as collateralProposalBuilder } from './add-collateral-core.js';
|
|
12
3
|
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
import { createBundles } from '@agoric/internal/src/node/createBundles.js';
|
|
5
|
+
import url from 'url';
|
|
15
6
|
|
|
16
7
|
const dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
17
|
-
await extractProposalBundles(
|
|
18
|
-
[
|
|
19
|
-
['.', defaultProposalBuilder],
|
|
20
|
-
['.', collateralProposalBuilder],
|
|
21
|
-
],
|
|
22
|
-
dirname,
|
|
23
|
-
);
|
|
24
8
|
|
|
25
9
|
await createBundles(
|
|
26
10
|
[
|
|
27
|
-
['
|
|
11
|
+
['@agoric/inter-protocol/src/psm/psm.js', '../bundles/bundle-psm.js'],
|
|
28
12
|
[
|
|
29
|
-
'
|
|
13
|
+
'@agoric/inter-protocol/src/econCommitteeCharter.js',
|
|
30
14
|
'../bundles/bundle-econCommitteeCharter.js',
|
|
31
15
|
],
|
|
32
16
|
[
|
|
33
|
-
'
|
|
17
|
+
'@agoric/inter-protocol/src/price/fluxAggregatorContract.js',
|
|
34
18
|
'../bundles/bundle-fluxAggregatorKit.js',
|
|
35
19
|
],
|
|
36
20
|
],
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export function makeOfferSpecShape(bidBrand: Brand<"nat">, collateralBrand: Brand<"nat">): import("@endo/patterns").Matcher;
|
|
2
|
+
export function prepareAuctionBook(baggage: Baggage, zcf: ZCF, makeRecorderKit: import("@agoric/zoe/src/contractSupport/recorder.js").MakeRecorderKit): (bidBrand: globalThis.Brand<"nat">, collateralBrand: globalThis.Brand<"nat">, pAuthority: PriceAuthority, node: globalThis.StorageNode) => ReturnType<(bidBrand: globalThis.Brand<"nat">, collateralBrand: globalThis.Brand<"nat">, pAuthority: PriceAuthority, node: globalThis.StorageNode) => import("@endo/exo").GuardedKit<{
|
|
3
|
+
helper: {
|
|
4
|
+
/**
|
|
5
|
+
* remove the key from the appropriate book, indicated by whether the
|
|
6
|
+
* price is defined.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} key
|
|
9
|
+
* @param {Ratio | undefined} price
|
|
10
|
+
*/
|
|
11
|
+
removeFromItsBook(key: string, price: Ratio | undefined): void;
|
|
12
|
+
/**
|
|
13
|
+
* Update the entry in the appropriate book, indicated by whether the
|
|
14
|
+
* price is defined.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} key
|
|
17
|
+
* @param {Amount} collateralSold
|
|
18
|
+
* @param {Ratio | undefined} price
|
|
19
|
+
*/
|
|
20
|
+
updateItsBook(key: string, collateralSold: Amount, price: Ratio | undefined): void;
|
|
21
|
+
/**
|
|
22
|
+
* Settle with seat. The caller is responsible for updating the book, if
|
|
23
|
+
* any.
|
|
24
|
+
*
|
|
25
|
+
* @param {ZCFSeat} seat
|
|
26
|
+
* @param {Amount<'nat'>} collateralWanted
|
|
27
|
+
*/
|
|
28
|
+
settle(seat: ZCFSeat, collateralWanted: Amount<"nat">): import("@agoric/ertp").NatAmount;
|
|
29
|
+
/**
|
|
30
|
+
* Accept an offer expressed as a price. If the auction is active,
|
|
31
|
+
* attempt to buy collateral. If any of the offer remains add it to the
|
|
32
|
+
* book.
|
|
33
|
+
*
|
|
34
|
+
* @param {ZCFSeat} seat
|
|
35
|
+
* @param {Ratio} price
|
|
36
|
+
* @param {Amount<'nat'>} maxBuy
|
|
37
|
+
* @param {object} opts
|
|
38
|
+
* @param {boolean} opts.trySettle
|
|
39
|
+
* @param {boolean} [opts.exitAfterBuy]
|
|
40
|
+
*/
|
|
41
|
+
acceptPriceOffer(seat: ZCFSeat, price: Ratio, maxBuy: Amount<"nat">, { trySettle, exitAfterBuy }: {
|
|
42
|
+
trySettle: boolean;
|
|
43
|
+
exitAfterBuy?: boolean | undefined;
|
|
44
|
+
}): void;
|
|
45
|
+
/**
|
|
46
|
+
* Accept an offer expressed as a discount (or markup). If the auction
|
|
47
|
+
* is active, attempt to buy collateral. If any of the offer remains add
|
|
48
|
+
* it to the book.
|
|
49
|
+
*
|
|
50
|
+
* @param {ZCFSeat} seat
|
|
51
|
+
* @param {Ratio} bidScaling
|
|
52
|
+
* @param {Amount<'nat'>} maxBuy
|
|
53
|
+
* @param {object} opts
|
|
54
|
+
* @param {boolean} opts.trySettle
|
|
55
|
+
* @param {boolean} [opts.exitAfterBuy]
|
|
56
|
+
*/
|
|
57
|
+
acceptScaledBidOffer(seat: ZCFSeat, bidScaling: Ratio, maxBuy: Amount<"nat">, { trySettle, exitAfterBuy }: {
|
|
58
|
+
trySettle: boolean;
|
|
59
|
+
exitAfterBuy?: boolean | undefined;
|
|
60
|
+
}): void;
|
|
61
|
+
publishBookData(): Promise<void>;
|
|
62
|
+
ensureQuoteNotifierObserved(): void;
|
|
63
|
+
};
|
|
64
|
+
self: {
|
|
65
|
+
/**
|
|
66
|
+
* @param {Amount<'nat'>} assetAmount
|
|
67
|
+
* @param {ZCFSeat} sourceSeat
|
|
68
|
+
* @param {Amount<'nat'>} [proceedsGoal] an amount that the depositor
|
|
69
|
+
* would like to raise. The auction is requested to not sell more
|
|
70
|
+
* collateral than required to raise that much. The auctioneer might
|
|
71
|
+
* sell more if there is more than one supplier of collateral, and
|
|
72
|
+
* they request inconsistent limits.
|
|
73
|
+
*/
|
|
74
|
+
addAssets(assetAmount: Amount<"nat">, sourceSeat: ZCFSeat, proceedsGoal?: Amount<"nat">): void;
|
|
75
|
+
settleAtNewRate(reduction: Ratio): void;
|
|
76
|
+
getCurrentPrice(): Ratio | null;
|
|
77
|
+
hasOrders(): boolean;
|
|
78
|
+
captureOraclePriceForRound(): void;
|
|
79
|
+
setStartingRate(rate: any): void;
|
|
80
|
+
/**
|
|
81
|
+
* @param {OfferSpec} offerSpec
|
|
82
|
+
* @param {ZCFSeat} seat
|
|
83
|
+
* @param {boolean} trySettle
|
|
84
|
+
*/
|
|
85
|
+
addOffer(offerSpec: OfferSpec, seat: ZCFSeat, trySettle: boolean): void;
|
|
86
|
+
getSeats(): {
|
|
87
|
+
collateralSeat: globalThis.ZCFSeat;
|
|
88
|
+
bidHoldingSeat: globalThis.ZCFSeat;
|
|
89
|
+
};
|
|
90
|
+
exitAllSeats(): void;
|
|
91
|
+
endAuction(): void;
|
|
92
|
+
getDataUpdates(): globalThis.Subscriber<BookDataNotification>;
|
|
93
|
+
getPublicTopics(): {
|
|
94
|
+
bookData: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<BookDataNotification>;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
}>>["self"];
|
|
98
|
+
export type OfferSpec = {
|
|
99
|
+
maxBuy: Amount<"nat">;
|
|
100
|
+
} & {
|
|
101
|
+
exitAfterBuy?: boolean;
|
|
102
|
+
} & ({
|
|
103
|
+
offerPrice: Ratio;
|
|
104
|
+
} | {
|
|
105
|
+
offerBidScaling: Ratio;
|
|
106
|
+
});
|
|
107
|
+
export type BookDataNotification = {
|
|
108
|
+
/**
|
|
109
|
+
* identifies the priceAuthority and price
|
|
110
|
+
*/
|
|
111
|
+
startPrice: Ratio | null;
|
|
112
|
+
/**
|
|
113
|
+
* the price at the current auction
|
|
114
|
+
* tier
|
|
115
|
+
*/
|
|
116
|
+
currentPriceLevel: Ratio | null;
|
|
117
|
+
/**
|
|
118
|
+
* The proceeds the sellers
|
|
119
|
+
* were targeting to raise
|
|
120
|
+
*/
|
|
121
|
+
startProceedsGoal: Amount<"nat"> | null;
|
|
122
|
+
/**
|
|
123
|
+
* The remainder of the
|
|
124
|
+
* proceeds the sellers were targeting to raise
|
|
125
|
+
*/
|
|
126
|
+
remainingProceedsGoal: Amount<"nat"> | null;
|
|
127
|
+
/**
|
|
128
|
+
* The proceeds raised so
|
|
129
|
+
* far in the auction
|
|
130
|
+
*/
|
|
131
|
+
proceedsRaised: Amount<"nat"> | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* How much collateral was available
|
|
134
|
+
* for sale at the start. (If more is deposited later, it'll be added in.)
|
|
135
|
+
*/
|
|
136
|
+
startCollateral: Amount<"nat">;
|
|
137
|
+
/**
|
|
138
|
+
* The amount of collateral
|
|
139
|
+
* remaining
|
|
140
|
+
*/
|
|
141
|
+
collateralAvailable: Amount<"nat"> | null;
|
|
142
|
+
};
|
|
143
|
+
export type AuctionBook = EReturn<EReturn<typeof prepareAuctionBook>>;
|
|
144
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
145
|
+
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
146
|
+
import type { EReturn } from '@endo/far';
|
|
147
|
+
//# sourceMappingURL=auctionBook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auctionBook.d.ts","sourceRoot":"","sources":["auctionBook.js"],"names":[],"mappings":"AA+EO,6CAHI,KAAK,CAAC,KAAK,CAAC,mBACZ,KAAK,CAAC,KAAK,CAAC,oCAiBtB;AAwBM,4CAJI,OAAO,OACP,GAAG,mBACH,OAAO,6CAA6C,EAAE,eAAe,8IA8pBtE,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;6BA1vB/B,kBAAkB;oCACX,4BAA4B;6BAFnC,WAAW"}
|