@agoric/inter-protocol 0.16.2-dev-857e650.0 → 0.16.2-dev-fb922d3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/bundle-auctioneer-js-meta.json +181 -181
- package/bundles/bundle-auctioneer.js +1 -1
- package/bundles/bundle-econCommitteeCharter-js-meta.json +129 -129
- package/bundles/bundle-econCommitteeCharter.js +1 -1
- package/bundles/bundle-feeDistributor-js-meta.json +115 -115
- package/bundles/bundle-feeDistributor.js +1 -1
- package/bundles/bundle-fluxAggregatorKit-js-meta.json +169 -169
- package/bundles/bundle-fluxAggregatorKit.js +1 -1
- package/bundles/bundle-psm-js-meta.json +167 -167
- package/bundles/bundle-psm.js +1 -1
- package/bundles/bundle-reserve-js-meta.json +169 -169
- package/bundles/bundle-reserve.js +1 -1
- package/bundles/bundle-scaledPriceAuthority-js-meta.json +142 -142
- package/bundles/bundle-scaledPriceAuthority.js +1 -1
- package/bundles/bundle-vaultFactory-js-meta.json +200 -200
- package/bundles/bundle-vaultFactory.js +1 -1
- package/package.json +17 -17
- package/scripts/deploy-contracts.js +12 -2
- package/scripts/init-core.js +5 -6
- package/scripts/manual-price-feed.js +20 -15
- package/src/auction/auctionBook.d.ts +16 -13
- package/src/auction/auctionBook.d.ts.map +1 -1
- package/src/auction/auctionBook.js +68 -56
- package/src/auction/auctioneer.d.ts.map +1 -1
- package/src/auction/auctioneer.js +54 -42
- package/src/auction/offerBook.d.ts.map +1 -1
- package/src/auction/offerBook.js +12 -11
- package/src/auction/params.d.ts +1 -1
- package/src/auction/params.d.ts.map +1 -1
- package/src/auction/params.js +3 -5
- package/src/auction/scheduleMath.d.ts.map +1 -1
- package/src/auction/scheduleMath.js +13 -13
- package/src/auction/scheduler.d.ts +4 -4
- package/src/auction/scheduler.d.ts.map +1 -1
- package/src/auction/scheduler.js +20 -20
- package/src/auction/sortedOffers.d.ts.map +1 -1
- package/src/auction/sortedOffers.js +8 -7
- package/src/auction/util.d.ts +1 -1
- package/src/auction/util.js +4 -4
- package/src/clientSupport.d.ts +65 -27
- package/src/clientSupport.d.ts.map +1 -1
- package/src/clientSupport.js +92 -34
- package/src/contractSupport.js +5 -5
- package/src/econCommitteeCharter.d.ts +4 -6
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/econCommitteeCharter.js +7 -11
- package/src/feeDistributor.d.ts +8 -24
- package/src/feeDistributor.d.ts.map +1 -1
- package/src/feeDistributor.js +26 -28
- package/src/interest.d.ts +1 -0
- package/src/interest.d.ts.map +1 -1
- package/src/interest.js +22 -15
- package/src/price/fluxAggregatorContract.d.ts +1 -0
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.js +24 -19
- package/src/price/fluxAggregatorKit.d.ts +23 -18
- package/src/price/fluxAggregatorKit.d.ts.map +1 -1
- package/src/price/fluxAggregatorKit.js +47 -32
- package/src/price/priceOracleKit.d.ts +2 -8
- package/src/price/priceOracleKit.d.ts.map +1 -1
- package/src/price/priceOracleKit.js +11 -13
- package/src/price/roundsManager.d.ts +28 -46
- package/src/price/roundsManager.d.ts.map +1 -1
- package/src/price/roundsManager.js +51 -63
- package/src/proposals/committee-proposal.d.ts.map +1 -1
- package/src/proposals/committee-proposal.js +5 -9
- package/src/proposals/core-proposal.d.ts.map +1 -1
- package/src/proposals/core-proposal.js +3 -5
- package/src/proposals/econ-behaviors.d.ts.map +1 -1
- package/src/proposals/econ-behaviors.js +55 -28
- package/src/proposals/price-feed-proposal.d.ts.map +1 -1
- package/src/proposals/price-feed-proposal.js +30 -11
- package/src/proposals/startPSM.d.ts.map +1 -1
- package/src/proposals/startPSM.js +24 -17
- package/src/proposals/utils.d.ts +1 -1
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +26 -7
- package/src/psm/psm.d.ts +14 -22
- package/src/psm/psm.d.ts.map +1 -1
- package/src/psm/psm.js +34 -31
- package/src/reserve/assetReserve.d.ts.map +1 -1
- package/src/reserve/assetReserve.js +16 -13
- package/src/reserve/assetReserveKit.d.ts +14 -26
- package/src/reserve/assetReserveKit.d.ts.map +1 -1
- package/src/reserve/assetReserveKit.js +13 -21
- package/src/tokens.d.ts +3 -3
- package/src/tokens.d.ts.map +1 -1
- package/src/tokens.js +5 -5
- package/src/typeGuards.d.ts +1 -3
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +1 -3
- package/src/vaultFactory/liquidation.d.ts.map +1 -1
- package/src/vaultFactory/liquidation.js +29 -16
- package/src/vaultFactory/math.d.ts.map +1 -1
- package/src/vaultFactory/math.js +8 -9
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -1
- package/src/vaultFactory/orderedVaultStore.js +6 -9
- package/src/vaultFactory/params.d.ts +1 -4
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/params.js +24 -18
- package/src/vaultFactory/prioritizedVaults.js +2 -2
- package/src/vaultFactory/proceeds.d.ts +3 -3
- package/src/vaultFactory/proceeds.d.ts.map +1 -1
- package/src/vaultFactory/proceeds.js +24 -18
- package/src/vaultFactory/storeUtils.d.ts +2 -6
- package/src/vaultFactory/storeUtils.d.ts.map +1 -1
- package/src/vaultFactory/storeUtils.js +8 -12
- package/src/vaultFactory/types.d.ts +16 -11
- package/src/vaultFactory/types.d.ts.map +1 -1
- package/src/vaultFactory/types.js +37 -27
- package/src/vaultFactory/vault.d.ts +103 -159
- package/src/vaultFactory/vault.d.ts.map +1 -1
- package/src/vaultFactory/vault.js +84 -85
- package/src/vaultFactory/vaultDirector.d.ts +21 -43
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultDirector.js +30 -40
- package/src/vaultFactory/vaultFactory.d.ts +8 -6
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultFactory.js +13 -11
- package/src/vaultFactory/vaultHolder.d.ts +12 -16
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
- package/src/vaultFactory/vaultHolder.js +7 -12
- package/src/vaultFactory/vaultKit.d.ts +1 -1
- package/src/vaultFactory/vaultKit.d.ts.map +1 -1
- package/src/vaultFactory/vaultKit.js +3 -2
- package/src/vaultFactory/vaultManager.d.ts +454 -68
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +120 -110
package/src/proposals/utils.js
CHANGED
|
@@ -10,7 +10,6 @@ const { Fail } = assert;
|
|
|
10
10
|
*/
|
|
11
11
|
export const reserveThenGetNamePaths = async (nameAdmin, paths) => {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
13
|
* @param {ERef<import('@agoric/vats').NameAdmin>} nextAdmin
|
|
15
14
|
* @param {string[]} path
|
|
16
15
|
*/
|
|
@@ -54,7 +53,7 @@ export const reserveThenGetNames = async (nameAdmin, names) =>
|
|
|
54
53
|
* @param {string} debugName
|
|
55
54
|
* @param {ERef<import('@agoric/vats').NameAdmin>} namesByAddressAdmin
|
|
56
55
|
* @param {string} addr
|
|
57
|
-
* @param {
|
|
56
|
+
* @param {ERef<Payment>[]} payments
|
|
58
57
|
*/
|
|
59
58
|
export const reserveThenDeposit = async (
|
|
60
59
|
debugName,
|
|
@@ -79,7 +78,15 @@ export const reserveThenDeposit = async (
|
|
|
79
78
|
);
|
|
80
79
|
};
|
|
81
80
|
|
|
82
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* @type {<T>(
|
|
83
|
+
* store: ERef<
|
|
84
|
+
* Map<string, T> | import('@agoric/internal/src/scratch.js').ScratchPad
|
|
85
|
+
* >,
|
|
86
|
+
* key: string,
|
|
87
|
+
* make: () => T,
|
|
88
|
+
* ) => Promise<T>}
|
|
89
|
+
*/
|
|
83
90
|
const provideWhen = async (store, key, make) => {
|
|
84
91
|
const found = await E(store).get(key);
|
|
85
92
|
if (found) {
|
|
@@ -91,21 +98,33 @@ const provideWhen = async (store, key, make) => {
|
|
|
91
98
|
};
|
|
92
99
|
|
|
93
100
|
/**
|
|
94
|
-
* @param {{
|
|
101
|
+
* @param {{
|
|
102
|
+
* scratch: ERef<import('@agoric/internal/src/scratch.js').ScratchPad>;
|
|
103
|
+
* }} homeP
|
|
95
104
|
* @param {object} opts
|
|
96
|
-
* @param {(specifier: string) => Promise<{default: Bundle}>} opts.loadBundle
|
|
105
|
+
* @param {(specifier: string) => Promise<{ default: Bundle }>} opts.loadBundle
|
|
97
106
|
* @param {string} [opts.installCacheKey]
|
|
98
107
|
*/
|
|
99
108
|
export const makeInstallCache = async (
|
|
100
109
|
homeP,
|
|
101
110
|
{ installCacheKey = 'installCache', loadBundle },
|
|
102
111
|
) => {
|
|
103
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* @type {CopyMap<
|
|
114
|
+
* string,
|
|
115
|
+
* { installation: Installation; boardId: string; path?: string }
|
|
116
|
+
* >}
|
|
117
|
+
*/
|
|
104
118
|
const initial = await provideWhen(E.get(homeP).scratch, installCacheKey, () =>
|
|
105
119
|
makeCopyMap([]),
|
|
106
120
|
);
|
|
107
121
|
// ISSUE: getCopyMapEntries of CopyMap<K, V> loses K, V.
|
|
108
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* @type {Map<
|
|
124
|
+
* string,
|
|
125
|
+
* { installation: Installation; boardId: string; path?: string }
|
|
126
|
+
* >}
|
|
127
|
+
*/
|
|
109
128
|
const working = new Map(getCopyMapEntries(initial));
|
|
110
129
|
|
|
111
130
|
const saveCache = async () => {
|
package/src/psm/psm.d.ts
CHANGED
|
@@ -46,9 +46,7 @@ export function prepare(zcf: ZCF<GovernanceTerms<{
|
|
|
46
46
|
WantMintedFee: "ratio";
|
|
47
47
|
} & {
|
|
48
48
|
Electorate: "invitation";
|
|
49
|
-
}>;
|
|
50
|
-
* @param {Amount<'nat'>} toMint
|
|
51
|
-
*/
|
|
49
|
+
}>;
|
|
52
50
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
53
51
|
get: () => import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
54
52
|
GiveMintedFee: "ratio";
|
|
@@ -56,9 +54,7 @@ export function prepare(zcf: ZCF<GovernanceTerms<{
|
|
|
56
54
|
WantMintedFee: "ratio";
|
|
57
55
|
} & {
|
|
58
56
|
Electorate: "invitation";
|
|
59
|
-
}>;
|
|
60
|
-
* @param {Amount<'nat'>} toMint
|
|
61
|
-
*/
|
|
57
|
+
}>;
|
|
62
58
|
}>;
|
|
63
59
|
getInvitation: (name: any) => Promise<Invitation<R, A>>;
|
|
64
60
|
getLimitedCreatorFacet: () => {
|
|
@@ -81,9 +77,7 @@ export function prepare(zcf: ZCF<GovernanceTerms<{
|
|
|
81
77
|
WantMintedFee: "ratio";
|
|
82
78
|
} & {
|
|
83
79
|
Electorate: "invitation";
|
|
84
|
-
}>;
|
|
85
|
-
* @param {Amount<'nat'>} toMint
|
|
86
|
-
*/
|
|
80
|
+
}>;
|
|
87
81
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
88
82
|
get: () => import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
89
83
|
GiveMintedFee: "ratio";
|
|
@@ -91,9 +85,7 @@ export function prepare(zcf: ZCF<GovernanceTerms<{
|
|
|
91
85
|
WantMintedFee: "ratio";
|
|
92
86
|
} & {
|
|
93
87
|
Electorate: "invitation";
|
|
94
|
-
}>;
|
|
95
|
-
* @param {Amount<'nat'>} toMint
|
|
96
|
-
*/
|
|
88
|
+
}>;
|
|
97
89
|
}>;
|
|
98
90
|
getInvitation: (name: any) => Promise<Invitation<R, A>>;
|
|
99
91
|
getLimitedCreatorFacet: () => {
|
|
@@ -154,13 +146,13 @@ export function prepare(zcf: ZCF<GovernanceTerms<{
|
|
|
154
146
|
}>;
|
|
155
147
|
}>;
|
|
156
148
|
/**
|
|
157
|
-
* Metrics naming scheme is that nouns are
|
|
158
|
-
* are accumulative.
|
|
149
|
+
* Metrics naming scheme is that nouns are
|
|
150
|
+
* present values and past-participles are accumulative.
|
|
159
151
|
*/
|
|
160
152
|
export type MetricsNotification = {
|
|
161
153
|
/**
|
|
162
|
-
* amount of Anchor token
|
|
163
|
-
*
|
|
154
|
+
* amount of Anchor token available
|
|
155
|
+
* to be swapped
|
|
164
156
|
*/
|
|
165
157
|
anchorPoolBalance: Amount<'nat'>;
|
|
166
158
|
/**
|
|
@@ -169,18 +161,18 @@ export type MetricsNotification = {
|
|
|
169
161
|
*/
|
|
170
162
|
mintedPoolBalance: Amount<'nat'>;
|
|
171
163
|
/**
|
|
172
|
-
* amount of Minted token
|
|
173
|
-
*
|
|
164
|
+
* amount of Minted token fees
|
|
165
|
+
* available to be collected
|
|
174
166
|
*/
|
|
175
167
|
feePoolBalance: Amount<'nat'>;
|
|
176
168
|
/**
|
|
177
|
-
* running sum of Anchor
|
|
178
|
-
*
|
|
169
|
+
* running sum of Anchor ever
|
|
170
|
+
* given by this contract
|
|
179
171
|
*/
|
|
180
172
|
totalAnchorProvided: Amount<'nat'>;
|
|
181
173
|
/**
|
|
182
|
-
* running sum of Minted
|
|
183
|
-
*
|
|
174
|
+
* running sum of Minted ever
|
|
175
|
+
* given by this contract
|
|
184
176
|
*/
|
|
185
177
|
totalMintedProvided: Amount<'nat'>;
|
|
186
178
|
};
|
package/src/psm/psm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psm.d.ts","sourceRoot":"","sources":["psm.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"psm.d.ts","sourceRoot":"","sources":["psm.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,gEAUE;AAsBK;mBAhBe,OAAO;mBACP,OAAO;eACX,QAAQ;;iBAEN,MAAM,KAAK,CAAC;qBACR,KAAK;iBAGlB;IACV,aAAiB,EAAE,aAAa,CAAC;IACjC,sBAA0B,EAAE,UAAU,CAAC;IACvC,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuUH;;;;;;;;;;uBAxYa,OAAO,KAAK,CAAC;;;;;uBAEb,OAAO,KAAK,CAAC;;;;;oBAEb,OAAO,KAAK,CAAC;;;;;yBAEb,OAAO,KAAK,CAAC;;;;;yBAEb,OAAO,KAAK,CAAC;;sBAIb,OAAO,kBAAkB,EAAE,OAAO;6BA8XlC,QAAQ,WAAW,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;2BAxbA,cAAc;2BAAd,cAAc;oCA0BvE,+BAA+B;4BA1B0B,cAAc"}
|
package/src/psm/psm.js
CHANGED
|
@@ -41,28 +41,25 @@ const { Fail } = assert;
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @file The Parity Stability Module supports efficiently minting/burning a
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* token are specified separately.
|
|
44
|
+
* stable token at a specified fixed ratio to a reference stable token, which
|
|
45
|
+
* thereby acts as an anchor to provide additional stability. For flexible
|
|
46
|
+
* economic policies, the fee percentage for trading into and out of the
|
|
47
|
+
* stable token are specified separately.
|
|
48
48
|
*/
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* @typedef {object} MetricsNotification
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @property {Amount<'nat'>}
|
|
56
|
-
*
|
|
57
|
-
* @property {Amount<'nat'>}
|
|
58
|
-
*
|
|
59
|
-
* @property {Amount<'nat'>}
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* ever given by this contract
|
|
64
|
-
* @property {Amount<'nat'>} totalMintedProvided running sum of Minted
|
|
65
|
-
* ever given by this contract
|
|
51
|
+
* @typedef {object} MetricsNotification Metrics naming scheme is that nouns are
|
|
52
|
+
* present values and past-participles are accumulative.
|
|
53
|
+
* @property {Amount<'nat'>} anchorPoolBalance amount of Anchor token available
|
|
54
|
+
* to be swapped
|
|
55
|
+
* @property {Amount<'nat'>} mintedPoolBalance amount of Minted token
|
|
56
|
+
* outstanding (the amount minted minus the amount burned).
|
|
57
|
+
* @property {Amount<'nat'>} feePoolBalance amount of Minted token fees
|
|
58
|
+
* available to be collected
|
|
59
|
+
* @property {Amount<'nat'>} totalAnchorProvided running sum of Anchor ever
|
|
60
|
+
* given by this contract
|
|
61
|
+
* @property {Amount<'nat'>} totalMintedProvided running sum of Minted ever
|
|
62
|
+
* given by this contract
|
|
66
63
|
*/
|
|
67
64
|
|
|
68
65
|
/** @typedef {import('@agoric/vat-data').Baggage} Baggage */
|
|
@@ -103,15 +100,22 @@ export const privateArgsShape = M.splitRecord(
|
|
|
103
100
|
harden(privateArgsShape);
|
|
104
101
|
|
|
105
102
|
/**
|
|
106
|
-
* @param {ZCF<
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
103
|
+
* @param {ZCF<
|
|
104
|
+
* GovernanceTerms<{
|
|
105
|
+
* GiveMintedFee: 'ratio';
|
|
106
|
+
* WantMintedFee: 'ratio';
|
|
107
|
+
* MintLimit: 'amount';
|
|
110
108
|
* }> & {
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
109
|
+
* anchorBrand: Brand<'nat'>;
|
|
110
|
+
* anchorPerMinted: Ratio;
|
|
111
|
+
* }
|
|
112
|
+
* >} zcf
|
|
113
|
+
* @param {{
|
|
114
|
+
* feeMintAccess: FeeMintAccess;
|
|
115
|
+
* initialPoserInvitation: Invitation;
|
|
116
|
+
* storageNode: StorageNode;
|
|
117
|
+
* marshaller: Marshaller;
|
|
118
|
+
* }} privateArgs
|
|
115
119
|
* @param {Baggage} baggage
|
|
116
120
|
*/
|
|
117
121
|
export const prepare = async (zcf, privateArgs, baggage) => {
|
|
@@ -231,9 +235,7 @@ export const prepare = async (zcf, privateArgs, baggage) => {
|
|
|
231
235
|
updateMetrics();
|
|
232
236
|
};
|
|
233
237
|
|
|
234
|
-
/**
|
|
235
|
-
* @param {Amount<'nat'>} toMint
|
|
236
|
-
*/
|
|
238
|
+
/** @param {Amount<'nat'>} toMint */
|
|
237
239
|
const assertUnderLimit = toMint => {
|
|
238
240
|
const mintedAfter = AmountMath.add(
|
|
239
241
|
baggage.get('mintedPoolBalance'),
|
|
@@ -262,7 +264,8 @@ export const prepare = async (zcf, privateArgs, baggage) => {
|
|
|
262
264
|
/**
|
|
263
265
|
* @param {ZCFSeat} seat
|
|
264
266
|
* @param {Amount<'nat'>} given
|
|
265
|
-
* @param {Amount<'nat'>} [wanted] defaults to maximum anchor (given exchange
|
|
267
|
+
* @param {Amount<'nat'>} [wanted] defaults to maximum anchor (given exchange
|
|
268
|
+
* rate minus fees)
|
|
266
269
|
*/
|
|
267
270
|
const giveMinted = (seat, given, wanted = emptyAnchor) => {
|
|
268
271
|
const fee = ceilMultiplyBy(given, params.getGiveMintedFee());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetReserve.d.ts","sourceRoot":"","sources":["assetReserve.js"],"names":[],"mappings":"AAyCO,6BAbI,
|
|
1
|
+
{"version":3,"file":"assetReserve.d.ts","sourceRoot":"","sources":["assetReserve.js"],"names":[],"mappings":"AAyCO,6BAbI,IACV,gBAAoB,EAAE,CAAC,GAAG;IAC1B,YAAkB,EAAE,CAAC,2BAA2B,CAAC,CAAC;CAC7C,CACF;mBAEgB,aAAa;4BACJ,UAAU;gBACtB,KAAK,UAAU,CAAC;iBACf,KAAK,WAAW,CAAC;;IA+D/B,mEAAmE;;;;;;IAEnE,iEAAiE;;;;;;;GAKpE;;6CA7F6C,MAAM,KAAK,IAAI;4CAChB,MAAM,KAAK,IAAI;;sBAI9C,OAAO,kBAAkB,EAAE,OAAO;;8CA6FtB,MAAM,KAAK,IAAI;4CACf,MAAM,KAAK,IAAI;;;wBAKlB,MAAM,OAAO,MAAM,KAAK,IAAI;oBACrC,MAAM,UAAU;sCAChB,MAAM,QAAQ,WAAW,iBAAiB,CAAC,CAAC;;sCAG5C,QAAQ,WAAW,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;;;;uCAEnD,QAAQ,WAAW,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC"}
|
|
@@ -12,30 +12,30 @@ const trace = makeTracer('AR', true);
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @typedef {{
|
|
15
|
-
* increaseLiquidationShortfall: (increase: Amount) => void
|
|
16
|
-
* reduceLiquidationShortfall: (reduction: Amount) => void
|
|
15
|
+
* increaseLiquidationShortfall: (increase: Amount) => void;
|
|
16
|
+
* reduceLiquidationShortfall: (reduction: Amount) => void;
|
|
17
17
|
* }} ShortfallReportingFacet
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/** @typedef {import('@agoric/vat-data').Baggage} Baggage */
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Asset Reserve holds onto assets for the Inter Protocol, and can
|
|
24
|
-
*
|
|
23
|
+
* Asset Reserve holds onto assets for the Inter Protocol, and can dispense it
|
|
24
|
+
* for various purposes under governance control.
|
|
25
25
|
*
|
|
26
26
|
* This contract has the ability to mint Fee tokens, granted through its private
|
|
27
27
|
* arguments.
|
|
28
28
|
*
|
|
29
|
-
* @param {ZCF<
|
|
30
|
-
* {
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* @param {ZCF<
|
|
30
|
+
* GovernanceTerms<{}> & {
|
|
31
|
+
* governedApis: ['burnFeesToReduceShortfall'];
|
|
32
|
+
* }
|
|
33
33
|
* >} zcf
|
|
34
34
|
* @param {{
|
|
35
|
-
* feeMintAccess: FeeMintAccess
|
|
36
|
-
* initialPoserInvitation: Invitation
|
|
37
|
-
* marshaller: ERef<Marshaller
|
|
38
|
-
* storageNode: ERef<StorageNode
|
|
35
|
+
* feeMintAccess: FeeMintAccess;
|
|
36
|
+
* initialPoserInvitation: Invitation;
|
|
37
|
+
* marshaller: ERef<Marshaller>;
|
|
38
|
+
* storageNode: ERef<StorageNode>;
|
|
39
39
|
* }} privateArgs
|
|
40
40
|
* @param {Baggage} baggage
|
|
41
41
|
*/
|
|
@@ -122,4 +122,7 @@ harden(prepare);
|
|
|
122
122
|
*/
|
|
123
123
|
|
|
124
124
|
/** @typedef {Awaited<ReturnType<typeof prepare>>['publicFacet']} AssetReservePublicFacet */
|
|
125
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* @typedef {Awaited<ReturnType<typeof prepare>>['creatorFacet']} AssetReserveCreatorFacet
|
|
127
|
+
* the creator facet for the governor
|
|
128
|
+
*/
|
|
@@ -16,7 +16,6 @@ export function prepareAssetReserveKit(baggage: MapStore<string, unknown>, { fee
|
|
|
16
16
|
};
|
|
17
17
|
governedApis: {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
19
|
* @param {Amount<'nat'>} reduction
|
|
21
20
|
* @returns {void}
|
|
22
21
|
*/
|
|
@@ -33,26 +32,21 @@ export function prepareAssetReserveKit(baggage: MapStore<string, unknown>, { fee
|
|
|
33
32
|
makeShortfallReportingInvitation(): Promise<Invitation<R, A>>;
|
|
34
33
|
};
|
|
35
34
|
/**
|
|
36
|
-
* XXX missing governance public methods
|
|
35
|
+
* XXX missing governance public methods
|
|
36
|
+
* https://github.com/Agoric/agoric-sdk/issues/5200
|
|
37
37
|
*/
|
|
38
38
|
public: {
|
|
39
|
-
/**
|
|
40
|
-
* Anyone can deposit any assets to the reserve
|
|
41
|
-
*/
|
|
39
|
+
/** Anyone can deposit any assets to the reserve */
|
|
42
40
|
makeAddCollateralInvitation(): Promise<Invitation<R, A>>;
|
|
43
41
|
getPublicTopics(): {
|
|
44
42
|
metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<MetricsNotification>;
|
|
45
43
|
};
|
|
46
44
|
};
|
|
47
45
|
shortfallReportingFacet: {
|
|
48
|
-
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @param {Amount<"nat">} reduction
|
|
54
|
-
*/
|
|
55
|
-
reduceLiquidationShortfall(reduction: Amount<"nat">): void;
|
|
46
|
+
/** @param {Amount<'nat'>} shortfall */
|
|
47
|
+
increaseLiquidationShortfall(shortfall: Amount<'nat'>): void;
|
|
48
|
+
/** @param {Amount<'nat'>} reduction */
|
|
49
|
+
reduceLiquidationShortfall(reduction: Amount<'nat'>): void;
|
|
56
50
|
};
|
|
57
51
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
58
52
|
helper: {
|
|
@@ -67,7 +61,6 @@ export function prepareAssetReserveKit(baggage: MapStore<string, unknown>, { fee
|
|
|
67
61
|
};
|
|
68
62
|
governedApis: {
|
|
69
63
|
/**
|
|
70
|
-
*
|
|
71
64
|
* @param {Amount<'nat'>} reduction
|
|
72
65
|
* @returns {void}
|
|
73
66
|
*/
|
|
@@ -84,26 +77,21 @@ export function prepareAssetReserveKit(baggage: MapStore<string, unknown>, { fee
|
|
|
84
77
|
makeShortfallReportingInvitation(): Promise<Invitation<R, A>>;
|
|
85
78
|
};
|
|
86
79
|
/**
|
|
87
|
-
* XXX missing governance public methods
|
|
80
|
+
* XXX missing governance public methods
|
|
81
|
+
* https://github.com/Agoric/agoric-sdk/issues/5200
|
|
88
82
|
*/
|
|
89
83
|
public: {
|
|
90
|
-
/**
|
|
91
|
-
* Anyone can deposit any assets to the reserve
|
|
92
|
-
*/
|
|
84
|
+
/** Anyone can deposit any assets to the reserve */
|
|
93
85
|
makeAddCollateralInvitation(): Promise<Invitation<R, A>>;
|
|
94
86
|
getPublicTopics(): {
|
|
95
87
|
metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<MetricsNotification>;
|
|
96
88
|
};
|
|
97
89
|
};
|
|
98
90
|
shortfallReportingFacet: {
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @param {Amount<"nat">} reduction
|
|
105
|
-
*/
|
|
106
|
-
reduceLiquidationShortfall(reduction: Amount<"nat">): void;
|
|
91
|
+
/** @param {Amount<'nat'>} shortfall */
|
|
92
|
+
increaseLiquidationShortfall(shortfall: Amount<'nat'>): void;
|
|
93
|
+
/** @param {Amount<'nat'>} reduction */
|
|
94
|
+
reduceLiquidationShortfall(reduction: Amount<'nat'>): void;
|
|
107
95
|
};
|
|
108
96
|
}>>>;
|
|
109
97
|
export type MetricsNotification = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetReserveKit.d.ts","sourceRoot":"","sources":["assetReserveKit.js"],"names":[],"mappings":"AAmCO,
|
|
1
|
+
{"version":3,"file":"assetReserveKit.d.ts","sourceRoot":"","sources":["assetReserveKit.js"],"names":[],"mappings":"AAmCO,2HAPI;IACV,OAAW,EAAE,QAAQ,KAAK,CAAC,CAAC;IAC5B,eAAmB,EAAE,OAAO,6CAA6C,EAAE,eAAe,CAAC;IAC3F,WAAe,EAAE,WAAW,CAAC;IAC7B,GAAO,EAAE,GAAG,CAAC;CACV;;QAsEI,2BAA2B;kCAAf,KAAK;QAUjB;;;WAGG;gCAFQ,KAAK,WACL,OAAO;;;;QAqBlB;;;WAGG;6CAFQ,OAAO,KAAK,CAAC,GACX,IAAI;;;QA2BjB;;;WAGG;0BAFQ,MAAM,WACN,MAAM;QAmBjB,8DAA8D;;;;IAiBhE;;;OAGG;;QAED,mDAAmD;;;;;;;QAqCnD,uCAAuC;gDAA3B,OAAO,KAAK,CAAC;QAWzB,uCAAuC;8CAA3B,OAAO,KAAK,CAAC;;;;QAzJzB,2BAA2B;kCAAf,KAAK;QAUjB;;;WAGG;gCAFQ,KAAK,WACL,OAAO;;;;QAqBlB;;;WAGG;6CAFQ,OAAO,KAAK,CAAC,GACX,IAAI;;;QA2BjB;;;WAGG;0BAFQ,MAAM,WACN,MAAM;QAmBjB,8DAA8D;;;;IAiBhE;;;OAGG;;QAED,mDAAmD;;;;;;;QAqCnD,uCAAuC;gDAA3B,OAAO,KAAK,CAAC;QAWzB,uCAAuC;8CAA3B,OAAO,KAAK,CAAC;;KA8BhC;;iBA3Qa,mBAAmB;;;;;sBACnB,OAAO,KAAK,CAAC;;;;oBAEb,OAAO,KAAK,CAAC;;;;oBACb,OAAO,KAAK,CAAC;;8BAyQb,WAAW,QAAQ,WAAW,6BAA6B,CAAC,CAAC,CAAC"}
|
|
@@ -17,7 +17,6 @@ const trace = makeTracer('ReserveKit', true);
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @typedef {object} MetricsNotification
|
|
20
|
-
*
|
|
21
20
|
* @property {AmountKeywordRecord} allocations
|
|
22
21
|
* @property {Amount<'nat'>} shortfallBalance shortfall from liquidation that
|
|
23
22
|
* has not yet been compensated.
|
|
@@ -28,10 +27,11 @@ const trace = makeTracer('ReserveKit', true);
|
|
|
28
27
|
/**
|
|
29
28
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
30
29
|
* @param {{
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
30
|
+
* feeMint: ZCFMint<'nat'>;
|
|
31
|
+
* makeRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit;
|
|
32
|
+
* storageNode: StorageNode;
|
|
33
|
+
* zcf: ZCF;
|
|
34
|
+
* }} powers
|
|
35
35
|
*/
|
|
36
36
|
export const prepareAssetReserveKit = async (
|
|
37
37
|
baggage,
|
|
@@ -63,10 +63,7 @@ export const prepareAssetReserveKit = async (
|
|
|
63
63
|
reduceLiquidationShortfall: M.call(AmountShape).returns(),
|
|
64
64
|
}),
|
|
65
65
|
},
|
|
66
|
-
/**
|
|
67
|
-
*
|
|
68
|
-
* @param {StorageNode} metricsNode
|
|
69
|
-
*/
|
|
66
|
+
/** @param {StorageNode} metricsNode */
|
|
70
67
|
metricsNode => {
|
|
71
68
|
/**
|
|
72
69
|
* Used to look up the unique keyword for each brand, including Fee brand.
|
|
@@ -77,7 +74,8 @@ export const prepareAssetReserveKit = async (
|
|
|
77
74
|
durable: true,
|
|
78
75
|
});
|
|
79
76
|
/**
|
|
80
|
-
* Used to look up the brands for keywords, excluding Fee because it's a
|
|
77
|
+
* Used to look up the brands for keywords, excluding Fee because it's a
|
|
78
|
+
* special case.
|
|
81
79
|
*
|
|
82
80
|
* @type {MapStore<Keyword, Brand>}
|
|
83
81
|
*/
|
|
@@ -137,7 +135,6 @@ export const prepareAssetReserveKit = async (
|
|
|
137
135
|
},
|
|
138
136
|
governedApis: {
|
|
139
137
|
/**
|
|
140
|
-
*
|
|
141
138
|
* @param {Amount<'nat'>} reduction
|
|
142
139
|
* @returns {void}
|
|
143
140
|
*/
|
|
@@ -205,12 +202,11 @@ export const prepareAssetReserveKit = async (
|
|
|
205
202
|
},
|
|
206
203
|
},
|
|
207
204
|
/**
|
|
208
|
-
* XXX missing governance public methods
|
|
205
|
+
* XXX missing governance public methods
|
|
206
|
+
* https://github.com/Agoric/agoric-sdk/issues/5200
|
|
209
207
|
*/
|
|
210
208
|
public: {
|
|
211
|
-
/**
|
|
212
|
-
* Anyone can deposit any assets to the reserve
|
|
213
|
-
*/
|
|
209
|
+
/** Anyone can deposit any assets to the reserve */
|
|
214
210
|
makeAddCollateralInvitation() {
|
|
215
211
|
/** @type {OfferHandler<Promise<string>>} */
|
|
216
212
|
const handler = async seat => {
|
|
@@ -247,9 +243,7 @@ export const prepareAssetReserveKit = async (
|
|
|
247
243
|
},
|
|
248
244
|
},
|
|
249
245
|
shortfallReportingFacet: {
|
|
250
|
-
/**
|
|
251
|
-
* @param {Amount<"nat">} shortfall
|
|
252
|
-
*/
|
|
246
|
+
/** @param {Amount<'nat'>} shortfall */
|
|
253
247
|
increaseLiquidationShortfall(shortfall) {
|
|
254
248
|
const { facets, state } = this;
|
|
255
249
|
state.shortfallBalance = AmountMath.add(
|
|
@@ -260,9 +254,7 @@ export const prepareAssetReserveKit = async (
|
|
|
260
254
|
},
|
|
261
255
|
|
|
262
256
|
// currently exposed for testing. Maybe it only gets called internally?
|
|
263
|
-
/**
|
|
264
|
-
* @param {Amount<"nat">} reduction
|
|
265
|
-
*/
|
|
257
|
+
/** @param {Amount<'nat'>} reduction */
|
|
266
258
|
reduceLiquidationShortfall(reduction) {
|
|
267
259
|
const { state } = this;
|
|
268
260
|
if (AmountMath.isGTE(reduction, state.shortfallBalance)) {
|
package/src/tokens.d.ts
CHANGED
|
@@ -24,10 +24,10 @@ export namespace Stake {
|
|
|
24
24
|
export { displayInfo_1 as displayInfo };
|
|
25
25
|
}
|
|
26
26
|
export type TokenKeyword = 'IST' | 'BLD';
|
|
27
|
-
/** @typedef {
|
|
27
|
+
/** @typedef {'IST' | 'BLD'} TokenKeyword */
|
|
28
28
|
/**
|
|
29
|
-
* Use static type check and unit tests rather than runtime import
|
|
30
|
-
*
|
|
29
|
+
* Use static type check and unit tests rather than runtime import to avoid
|
|
30
|
+
* bundling all of ERTP just to get Stable.symbol.
|
|
31
31
|
*
|
|
32
32
|
* @type {typeof import('@agoric/ertp').AssetKind.NAT}
|
|
33
33
|
*/
|
package/src/tokens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["tokens.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["tokens.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;2BAEc,KAAK,GAAG,KAAK;AAA3B,4CAA4C;AAE5C;;;;;GAKG;AACH,mBAFU,cAAc,cAAc,EAAE,SAAS,CAAC,GAAG,CAEnC"}
|
package/src/tokens.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
/** @typedef {
|
|
3
|
+
/** @typedef {'IST' | 'BLD'} TokenKeyword */
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Use static type check and unit tests rather than runtime import
|
|
7
|
-
*
|
|
6
|
+
* Use static type check and unit tests rather than runtime import to avoid
|
|
7
|
+
* bundling all of ERTP just to get Stable.symbol.
|
|
8
8
|
*
|
|
9
9
|
* @type {typeof import('@agoric/ertp').AssetKind.NAT}
|
|
10
10
|
*/
|
|
11
11
|
const NAT = 'nat';
|
|
12
12
|
|
|
13
13
|
export const Stable = harden(
|
|
14
|
-
/** @type {const
|
|
14
|
+
/** @type {const} */ ({
|
|
15
15
|
symbol: 'IST',
|
|
16
16
|
denom: 'uist',
|
|
17
17
|
proposedName: 'Agoric stable token',
|
|
@@ -24,7 +24,7 @@ export const Stable = harden(
|
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
export const Stake = harden(
|
|
27
|
-
/** @type {const
|
|
27
|
+
/** @type {const} */ ({
|
|
28
28
|
symbol: 'BLD',
|
|
29
29
|
denom: 'ubld',
|
|
30
30
|
proposedName: 'Agoric staking token',
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* To be used only for 'helper' facets where the calls are from trusted code.
|
|
3
|
-
*/
|
|
1
|
+
/** To be used only for 'helper' facets where the calls are from trusted code. */
|
|
4
2
|
export const UnguardedHelperI: import("@endo/patterns").InterfaceGuard<any>;
|
|
5
3
|
//# sourceMappingURL=typeGuards.d.ts.map
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA,iFAAiF;AACjF,4EAKE"}
|
package/src/typeGuards.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { M } from '@agoric/store';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* To be used only for 'helper' facets where the calls are from trusted code.
|
|
7
|
-
*/
|
|
5
|
+
/** To be used only for 'helper' facets where the calls are from trusted code. */
|
|
8
6
|
export const UnguardedHelperI = M.interface(
|
|
9
7
|
'helper',
|
|
10
8
|
{},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liquidation.d.ts","sourceRoot":"","sources":["liquidation.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"liquidation.d.ts","sourceRoot":"","sources":["liquidation.js"],"names":[],"mappings":"AAoJO,gEAPI,KAAK,OAAO,0BAA0B,EAAE,qBAAqB,CAAC,SAC9D,KAAK,YAAY,CAAC,kBAClB,UAAU,oBACV,UAAU,oBACV,UAAU,GACR,QAAQ,IAAI,CAAC,CAqCzB;AAQM,yCAJI,OAAO,KAAK,CAAC,UACb,OAAO,KAAK,CAAC;aACA,OAAO,KAAK,CAAC;eAAa,OAAO,KAAK,CAAC;EAY9D;AAWM,gEALI,KAAK,OAAO,0BAA0B,EAAE,qBAAqB,CAAC,SAC9D,KAAK,YAAY,CAAC,oBAClB,UAAU,GACR,IAAI,CA0BhB;AAwBM,2CArBI,GAAG;IAEkC,KAAK,EAA1C,UAAU;IACsB,QAAQ,EAAxC,KAAK;IAC2B,MAAM,EAAtC,KAAK;sBACL,WACV,cAAkB,wBAAwB,EAAE,qBAAqB,CAC9D,qBACO,SAAS,KAAK,CAAC,aACf,MAAM,KAAK,CAAC,mBACZ,MAAM,KAAK,CAAC;eAEP,SACf,KAAW,EACX;QAAQ,gBAAgB,EAAE,OAAO,KAAK,CAAC,CAAC;QAAC,UAAU,EAAE,OAAO,KAAK,CAAC,CAAA;KAAE,CAC/D;eACU,OAAO,KAAK,CAAC;qBACP,OAAO,KAAK,CAAC;aACrB,OAAO;EAkDpB;2BApSa,OAAO,wBAAwB,EAAE,YAAY;yBAC7C,OAAO,wBAAwB,EAAE,UAAU;0BAC3C,OAAO,wBAAwB,EAAE,WAAW;iCAC5C,OAAO,wBAAwB,EAAE,kBAAkB"}
|