@agoric/inter-protocol 0.17.0-u18.4 → 0.17.0-u18.6
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 +28 -28
- package/src/auction/auctionBook.d.ts +1 -2
- package/src/auction/auctionBook.d.ts.map +1 -1
- package/src/auction/auctionMath.d.ts +1 -1
- package/src/auction/auctionMath.d.ts.map +1 -1
- package/src/auction/auctioneer.d.ts.map +1 -1
- package/src/auction/auctioneer.js +3 -3
- package/src/auction/params.d.ts.map +1 -1
- package/src/auction/scheduler.d.ts.map +1 -1
- package/src/auction/scheduler.js +0 -1
- package/src/contractSupport.d.ts +1 -1
- package/src/contractSupport.d.ts.map +1 -1
- package/src/econCommitteeCharter.d.ts +1 -1
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/feeDistributor.d.ts +6 -6
- package/src/feeDistributor.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorKit.d.ts.map +1 -1
- package/src/price/priceOracleKit.d.ts.map +1 -1
- package/src/price/roundsManager.d.ts +0 -1
- package/src/price/roundsManager.d.ts.map +1 -1
- package/src/proposals/add-auction.d.ts.map +1 -1
- package/src/proposals/add-auction.js +14 -1
- package/src/proposals/econ-behaviors.d.ts +15 -13
- package/src/proposals/econ-behaviors.d.ts.map +1 -1
- package/src/proposals/econ-behaviors.js +3 -2
- package/src/proposals/price-feed-proposal.d.ts +1 -1
- package/src/proposals/price-feed-proposal.d.ts.map +1 -1
- package/src/proposals/replace-fee-distributor.d.ts +48 -0
- package/src/proposals/replace-fee-distributor.d.ts.map +1 -0
- package/src/proposals/replace-fee-distributor.js +195 -0
- package/src/proposals/replaceElectorate.d.ts +3 -0
- package/src/proposals/replaceElectorate.d.ts.map +1 -1
- package/src/proposals/replaceElectorate.js +71 -12
- package/src/proposals/startPSM.d.ts +1 -1
- package/src/proposals/startPSM.d.ts.map +1 -1
- package/src/proposals/upgrade-vaults.d.ts.map +1 -1
- package/src/proposals/upgrade-vaults.js +6 -0
- package/src/provisionPool.d.ts +4 -110
- package/src/provisionPool.d.ts.map +1 -1
- package/src/provisionPool.js +12 -2
- package/src/provisionPoolKit.d.ts +10 -257
- package/src/provisionPoolKit.d.ts.map +1 -1
- package/src/provisionPoolKit.js +81 -63
- package/src/psm/psm.d.ts.map +1 -1
- package/src/psm/psm.js +2 -5
- package/src/reserve/assetReserve.d.ts.map +1 -1
- package/src/reserve/assetReserve.js +6 -15
- package/src/reserve/params.d.ts +5 -3
- package/src/reserve/params.d.ts.map +1 -1
- package/src/reserve/params.js +4 -2
- package/src/vaultFactory/math.d.ts +1 -1
- package/src/vaultFactory/math.d.ts.map +1 -1
- package/src/vaultFactory/orderedVaultStore.d.ts +4 -4
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -1
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/prioritizedVaults.d.ts +12 -12
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -1
- package/src/vaultFactory/vault.d.ts +2 -2
- package/src/vaultFactory/vaultDirector.d.ts +12 -11
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultDirector.js +5 -1
- package/src/vaultFactory/vaultFactory.d.ts +7 -6
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultHolder.d.ts +50 -6
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
- package/src/vaultFactory/vaultKit.d.ts +2 -2
- package/src/vaultFactory/vaultManager.d.ts +16 -18
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
|
@@ -1,268 +1,21 @@
|
|
|
1
|
-
export function
|
|
2
|
-
fromBridge
|
|
3
|
-
} & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
4
|
-
fromBridge: (obj: any) => Promise<void>;
|
|
1
|
+
export function prepareBridgeProvisionTool(zone: import("@agoric/zone").Zone): (bankManager?: any, walletFactory?: any, namesByAddressAdmin?: any, forHandler?: any) => import("@endo/exo").Guarded<{
|
|
2
|
+
fromBridge(obj: any): Promise<void>;
|
|
5
3
|
}>;
|
|
6
|
-
export function prepareProvisionPoolKit(
|
|
4
|
+
export function prepareProvisionPoolKit(zone: import("@agoric/zone").Zone, { makeRecorderKit, params, poolBank, zcf, makeBridgeProvisionTool }: {
|
|
7
5
|
makeRecorderKit: import("@agoric/zoe/src/contractSupport/recorder.js").MakeRecorderKit;
|
|
8
6
|
params: any;
|
|
9
7
|
poolBank: import("@endo/far").ERef<Bank>;
|
|
10
8
|
zcf: ZCF;
|
|
9
|
+
makeBridgeProvisionTool: ReturnType<typeof prepareBridgeProvisionTool>;
|
|
11
10
|
}): ({ poolBrand, storageNode }: {
|
|
12
11
|
poolBrand: Brand<"nat">;
|
|
13
12
|
storageNode: ERef<StorageNode>;
|
|
14
|
-
}) => Promise<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
reviveWallet(address: string): Promise<{
|
|
21
|
-
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string | null>, canSpend?: boolean | undefined): Promise<void>;
|
|
22
|
-
getDepositFacet(): import("@endo/exo").Guarded<{
|
|
23
|
-
receive(payment: Payment): Promise<Amount>;
|
|
24
|
-
}>;
|
|
25
|
-
getOffersFacet(): import("@endo/exo").Guarded<{
|
|
26
|
-
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
27
|
-
tryExitOffer(offerId: import("@agoric/smart-wallet/src/offers").OfferId): Promise<void>;
|
|
28
|
-
}>;
|
|
29
|
-
getCurrentSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
30
|
-
getUpdatesSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
31
|
-
getPublicTopics(): {
|
|
32
|
-
current: {
|
|
33
|
-
description: string;
|
|
34
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
35
|
-
storagePath: Promise<string>;
|
|
36
|
-
};
|
|
37
|
-
updates: {
|
|
38
|
-
description: string;
|
|
39
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
40
|
-
storagePath: Promise<string>;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
} & import("../../../node_modules/@endo/exo/src/get-interface").GetInterfaceGuard<{
|
|
44
|
-
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string | null>, canSpend?: boolean | undefined): Promise<void>;
|
|
45
|
-
getDepositFacet(): import("@endo/exo").Guarded<{
|
|
46
|
-
receive(payment: Payment): Promise<Amount>;
|
|
47
|
-
}>;
|
|
48
|
-
getOffersFacet(): import("@endo/exo").Guarded<{
|
|
49
|
-
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
50
|
-
tryExitOffer(offerId: import("@agoric/smart-wallet/src/offers").OfferId): Promise<void>;
|
|
51
|
-
}>;
|
|
52
|
-
getCurrentSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
53
|
-
getUpdatesSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
54
|
-
getPublicTopics(): {
|
|
55
|
-
current: {
|
|
56
|
-
description: string;
|
|
57
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
58
|
-
storagePath: Promise<string>;
|
|
59
|
-
};
|
|
60
|
-
updates: {
|
|
61
|
-
description: string;
|
|
62
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
63
|
-
storagePath: Promise<string>;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
}> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
67
|
-
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string | null>, canSpend?: boolean | undefined): Promise<void>;
|
|
68
|
-
getDepositFacet(): import("@endo/exo").Guarded<{
|
|
69
|
-
receive(payment: Payment): Promise<Amount>;
|
|
70
|
-
}>;
|
|
71
|
-
getOffersFacet(): import("@endo/exo").Guarded<{
|
|
72
|
-
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
73
|
-
tryExitOffer(offerId: import("@agoric/smart-wallet/src/offers").OfferId): Promise<void>;
|
|
74
|
-
}>;
|
|
75
|
-
getCurrentSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
76
|
-
getUpdatesSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
77
|
-
getPublicTopics(): {
|
|
78
|
-
current: {
|
|
79
|
-
description: string;
|
|
80
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
81
|
-
storagePath: Promise<string>;
|
|
82
|
-
};
|
|
83
|
-
updates: {
|
|
84
|
-
description: string;
|
|
85
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
86
|
-
storagePath: Promise<string>;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
} & import("../../../node_modules/@endo/exo/src/get-interface").GetInterfaceGuard<{
|
|
90
|
-
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string | null>, canSpend?: boolean | undefined): Promise<void>;
|
|
91
|
-
getDepositFacet(): import("@endo/exo").Guarded<{
|
|
92
|
-
receive(payment: Payment): Promise<Amount>;
|
|
93
|
-
}>;
|
|
94
|
-
getOffersFacet(): import("@endo/exo").Guarded<{
|
|
95
|
-
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
96
|
-
tryExitOffer(offerId: import("@agoric/smart-wallet/src/offers").OfferId): Promise<void>;
|
|
97
|
-
}>;
|
|
98
|
-
getCurrentSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
99
|
-
getUpdatesSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
100
|
-
getPublicTopics(): {
|
|
101
|
-
current: {
|
|
102
|
-
description: string;
|
|
103
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
104
|
-
storagePath: Promise<string>;
|
|
105
|
-
};
|
|
106
|
-
updates: {
|
|
107
|
-
description: string;
|
|
108
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
109
|
-
storagePath: Promise<string>;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
}>> & import("@endo/pass-style").RemotableObject>;
|
|
113
|
-
/**
|
|
114
|
-
* @param {string} address
|
|
115
|
-
* @returns {boolean} isRevive
|
|
116
|
-
*/
|
|
117
|
-
ackWallet(address: string): boolean;
|
|
118
|
-
}>;
|
|
119
|
-
/** @param {ProvisionPoolKitReferences} erefs */
|
|
120
|
-
setReferences(erefs: ProvisionPoolKitReferences): Promise<void>;
|
|
121
|
-
makeHandler(): {
|
|
122
|
-
fromBridge: (obj: any) => Promise<void>;
|
|
123
|
-
} & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
124
|
-
fromBridge: (obj: any) => Promise<void>;
|
|
125
|
-
}>;
|
|
126
|
-
/**
|
|
127
|
-
* @param {Brand} brand
|
|
128
|
-
* @param {PsmInstance} instance
|
|
129
|
-
*/
|
|
130
|
-
initPSM(brand: Brand, instance: PsmInstance): void;
|
|
131
|
-
};
|
|
132
|
-
walletReviver: {
|
|
133
|
-
/** @param {string} address */
|
|
134
|
-
reviveWallet(address: string): Promise<{
|
|
135
|
-
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string | null>, canSpend?: boolean | undefined): Promise<void>;
|
|
136
|
-
getDepositFacet(): import("@endo/exo").Guarded<{
|
|
137
|
-
receive(payment: Payment): Promise<Amount>;
|
|
138
|
-
}>;
|
|
139
|
-
getOffersFacet(): import("@endo/exo").Guarded<{
|
|
140
|
-
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
141
|
-
tryExitOffer(offerId: import("@agoric/smart-wallet/src/offers").OfferId): Promise<void>;
|
|
142
|
-
}>;
|
|
143
|
-
getCurrentSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
144
|
-
getUpdatesSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
145
|
-
getPublicTopics(): {
|
|
146
|
-
current: {
|
|
147
|
-
description: string;
|
|
148
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
149
|
-
storagePath: Promise<string>;
|
|
150
|
-
};
|
|
151
|
-
updates: {
|
|
152
|
-
description: string;
|
|
153
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
154
|
-
storagePath: Promise<string>;
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
} & import("../../../node_modules/@endo/exo/src/get-interface").GetInterfaceGuard<{
|
|
158
|
-
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string | null>, canSpend?: boolean | undefined): Promise<void>;
|
|
159
|
-
getDepositFacet(): import("@endo/exo").Guarded<{
|
|
160
|
-
receive(payment: Payment): Promise<Amount>;
|
|
161
|
-
}>;
|
|
162
|
-
getOffersFacet(): import("@endo/exo").Guarded<{
|
|
163
|
-
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
164
|
-
tryExitOffer(offerId: import("@agoric/smart-wallet/src/offers").OfferId): Promise<void>;
|
|
165
|
-
}>;
|
|
166
|
-
getCurrentSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
167
|
-
getUpdatesSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
168
|
-
getPublicTopics(): {
|
|
169
|
-
current: {
|
|
170
|
-
description: string;
|
|
171
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
172
|
-
storagePath: Promise<string>;
|
|
173
|
-
};
|
|
174
|
-
updates: {
|
|
175
|
-
description: string;
|
|
176
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
177
|
-
storagePath: Promise<string>;
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
}> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
181
|
-
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string | null>, canSpend?: boolean | undefined): Promise<void>;
|
|
182
|
-
getDepositFacet(): import("@endo/exo").Guarded<{
|
|
183
|
-
receive(payment: Payment): Promise<Amount>;
|
|
184
|
-
}>;
|
|
185
|
-
getOffersFacet(): import("@endo/exo").Guarded<{
|
|
186
|
-
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
187
|
-
tryExitOffer(offerId: import("@agoric/smart-wallet/src/offers").OfferId): Promise<void>;
|
|
188
|
-
}>;
|
|
189
|
-
getCurrentSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
190
|
-
getUpdatesSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
191
|
-
getPublicTopics(): {
|
|
192
|
-
current: {
|
|
193
|
-
description: string;
|
|
194
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
195
|
-
storagePath: Promise<string>;
|
|
196
|
-
};
|
|
197
|
-
updates: {
|
|
198
|
-
description: string;
|
|
199
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
200
|
-
storagePath: Promise<string>;
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
} & import("../../../node_modules/@endo/exo/src/get-interface").GetInterfaceGuard<{
|
|
204
|
-
handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string | null>, canSpend?: boolean | undefined): Promise<void>;
|
|
205
|
-
getDepositFacet(): import("@endo/exo").Guarded<{
|
|
206
|
-
receive(payment: Payment): Promise<Amount>;
|
|
207
|
-
}>;
|
|
208
|
-
getOffersFacet(): import("@endo/exo").Guarded<{
|
|
209
|
-
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
210
|
-
tryExitOffer(offerId: import("@agoric/smart-wallet/src/offers").OfferId): Promise<void>;
|
|
211
|
-
}>;
|
|
212
|
-
getCurrentSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
213
|
-
getUpdatesSubscriber(): globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
214
|
-
getPublicTopics(): {
|
|
215
|
-
current: {
|
|
216
|
-
description: string;
|
|
217
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").CurrentWalletRecord>;
|
|
218
|
-
storagePath: Promise<string>;
|
|
219
|
-
};
|
|
220
|
-
updates: {
|
|
221
|
-
description: string;
|
|
222
|
-
subscriber: globalThis.Subscriber<import("@agoric/smart-wallet/src/smartWallet").UpdateRecord>;
|
|
223
|
-
storagePath: Promise<string>;
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
}>> & import("@endo/pass-style").RemotableObject>;
|
|
227
|
-
/**
|
|
228
|
-
* @param {string} address
|
|
229
|
-
* @returns {boolean} isRevive
|
|
230
|
-
*/
|
|
231
|
-
ackWallet(address: string): boolean;
|
|
232
|
-
};
|
|
233
|
-
helper: {
|
|
234
|
-
publishMetrics(): void;
|
|
235
|
-
onTrade(converted: any): void;
|
|
236
|
-
onSendFunds(provided: any): void;
|
|
237
|
-
onProvisioned(): void;
|
|
238
|
-
/** @param {ERef<Bank>} destBank */
|
|
239
|
-
sendInitialPayment(destBank: ERef<Bank>): Promise<void>;
|
|
240
|
-
/**
|
|
241
|
-
* @param {ERef<Purse>} exchangePurse
|
|
242
|
-
* @param {ERef<Brand>} brand
|
|
243
|
-
*/
|
|
244
|
-
watchCurrentAmount(exchangePurse: ERef<Purse>, brand: ERef<Brand>): void;
|
|
245
|
-
watchAssetSubscription(): Promise<undefined>;
|
|
246
|
-
/**
|
|
247
|
-
* @param {object} [options]
|
|
248
|
-
* @param {MetricsNotification} [options.metrics]
|
|
249
|
-
*/
|
|
250
|
-
start({ metrics }?: {
|
|
251
|
-
metrics?: MetricsNotification | undefined;
|
|
252
|
-
} | undefined): void;
|
|
253
|
-
/**
|
|
254
|
-
* @param {ERef<Payment>} payIn
|
|
255
|
-
* @param {Amount} amount
|
|
256
|
-
* @param {PsmInstance} instance
|
|
257
|
-
*/
|
|
258
|
-
swap(payIn: ERef<Payment>, amount: Amount, instance: PsmInstance): Promise<import("@agoric/ertp").NatAmount>;
|
|
259
|
-
};
|
|
260
|
-
public: {
|
|
261
|
-
getPublicTopics(): {
|
|
262
|
-
metrics: import("@agoric/zoe/src/contractSupport").PublicTopic<MetricsNotification>;
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
|
-
}>>;
|
|
13
|
+
}) => Promise<ProvisionPoolKit>;
|
|
14
|
+
export type ProvisionPoolKit = {
|
|
15
|
+
machine: any;
|
|
16
|
+
helper: any;
|
|
17
|
+
public: any;
|
|
18
|
+
};
|
|
266
19
|
export type PsmInstance = import("@agoric/zoe/src/zoeService/utils.js").Instance<(zcf: ZCF<GovernanceTerms<{
|
|
267
20
|
GiveMintedFee: "ratio";
|
|
268
21
|
WantMintedFee: "ratio";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisionPoolKit.d.ts","sourceRoot":"","sources":["provisionPoolKit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provisionPoolKit.d.ts","sourceRoot":"","sources":["provisionPoolKit.js"],"names":[],"mappings":"AA6EO,iDAFI,OAAO,cAAc,EAAE,IAAI;;GAyCnC;AAYI,8CATI,OAAO,cAAc,EAAE,IAAI,uEAC3B;IACN,eAAe,EAAE,OAAO,6CAA6C,EAAE,eAAe,CAAC;IACvF,MAAM,EAAE,GAAG,CAAC;IACZ,QAAQ,EAAE,OAAO,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,GAAG,EAAE,GAAG,CAAC;IACT,uBAAuB,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;CACxE,gCA6YC;IAA2B,SAAS,EAA5B,KAAK,CAAC,KAAK,CAAC;IACY,WAAW,EAAnC,KAAK,WAAW,CAAC;CACzB,KAAU,OAAO,CAAC,gBAAgB,CAAC,CAcvC;+BApfY;IACR,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,GAAG,CAAC;CACb;0BAIS,OAAO,qCAAqC,EAAE,QAAQ,CAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAsWa,cAAW;kDAEX,cACR;;;;;;;;;;;;EAzWoD,CACtD;;iBAKU,KAAK,WAAW,CAAC;yBACjB,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC;mBACtC,KACb,OAAW,6CAA6C,EAAE,wBAAwB,CAAC,cAAc,CAAC,CAC/F;;;;;;;;;;wBAMU,MAAM;;;;;yBACN,OAAO,KAAK,CAAC;;;;;0BAEb,OAAO,KAAK,CAAC;;0BAjCS,8BAA8B;0BAF3C,WAAW;4BACT,2BAA2B;iCAChB,8BAA8B"}
|
package/src/provisionPoolKit.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { X, q, Fail } from '@endo/errors';
|
|
3
3
|
import { E } from '@endo/far';
|
|
4
|
-
import { Far } from '@endo/marshal';
|
|
5
4
|
|
|
6
5
|
import { AmountMath, BrandShape } from '@agoric/ertp';
|
|
7
6
|
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
|
|
@@ -15,7 +14,6 @@ import {
|
|
|
15
14
|
M,
|
|
16
15
|
makeScalarBigMapStore,
|
|
17
16
|
makeScalarBigSetStore,
|
|
18
|
-
prepareExoClassKit,
|
|
19
17
|
} from '@agoric/vat-data';
|
|
20
18
|
import { PowerFlags } from '@agoric/vats/src/walletFlags.js';
|
|
21
19
|
import {
|
|
@@ -37,6 +35,15 @@ const FIRST_LOWER_NEAR_KEYWORD = /^[a-z][a-zA-Z0-9_$]*$/;
|
|
|
37
35
|
* @import {Bank, BankManager} from '@agoric/vats/src/vat-bank.js'
|
|
38
36
|
*/
|
|
39
37
|
|
|
38
|
+
// XXX when inferred, error TS2742: cannot be named without a reference to '../../../node_modules/@endo/exo/src/get-interface.js'. This is likely not portable. A type annotation is necessary.
|
|
39
|
+
/**
|
|
40
|
+
* @typedef {{
|
|
41
|
+
* machine: any;
|
|
42
|
+
* helper: any;
|
|
43
|
+
* public: any;
|
|
44
|
+
* }} ProvisionPoolKit
|
|
45
|
+
*/
|
|
46
|
+
|
|
40
47
|
/**
|
|
41
48
|
* @typedef {import('@agoric/zoe/src/zoeService/utils.js').Instance<
|
|
42
49
|
* import('@agoric/inter-protocol/src/psm/psm.js').start
|
|
@@ -66,18 +73,22 @@ const FIRST_LOWER_NEAR_KEYWORD = /^[a-z][a-zA-Z0-9_$]*$/;
|
|
|
66
73
|
* Given attenuated access to the funding purse, handle requests to provision
|
|
67
74
|
* smart wallets.
|
|
68
75
|
*
|
|
69
|
-
* @param {(
|
|
70
|
-
* @param {() => void} onProvisioned
|
|
76
|
+
* @param {import('@agoric/zone').Zone} zone
|
|
71
77
|
*/
|
|
72
|
-
export const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
export const prepareBridgeProvisionTool = zone =>
|
|
79
|
+
zone.exoClass(
|
|
80
|
+
'smartWalletProvisioningHandler',
|
|
81
|
+
M.interface('ProvisionBridgeHandlerMaker', {
|
|
82
|
+
fromBridge: M.callWhen(M.record()).returns(),
|
|
83
|
+
}),
|
|
84
|
+
(bankManager, walletFactory, namesByAddressAdmin, forHandler) => ({
|
|
85
|
+
bankManager,
|
|
86
|
+
walletFactory,
|
|
87
|
+
namesByAddressAdmin,
|
|
88
|
+
forHandler,
|
|
89
|
+
}),
|
|
90
|
+
{
|
|
91
|
+
async fromBridge(obj) {
|
|
81
92
|
obj.type === 'PLEASE_PROVISION' ||
|
|
82
93
|
Fail`Unrecognized request ${obj.type}`;
|
|
83
94
|
trace('PLEASE_PROVISION', obj);
|
|
@@ -85,9 +96,12 @@ export const makeBridgeProvisionTool = (sendInitialPayment, onProvisioned) => {
|
|
|
85
96
|
powerFlags.includes(PowerFlags.SMART_WALLET) ||
|
|
86
97
|
Fail`missing SMART_WALLET in powerFlags`;
|
|
87
98
|
|
|
99
|
+
const { bankManager, walletFactory, namesByAddressAdmin, forHandler } =
|
|
100
|
+
this.state;
|
|
101
|
+
|
|
88
102
|
const bank = E(bankManager).getBankForAddress(address);
|
|
89
103
|
// only proceed if we can provide funds
|
|
90
|
-
await sendInitialPayment(bank);
|
|
104
|
+
await forHandler.sendInitialPayment(bank);
|
|
91
105
|
|
|
92
106
|
const [_, created] = await E(walletFactory).provideSmartWallet(
|
|
93
107
|
address,
|
|
@@ -95,31 +109,30 @@ export const makeBridgeProvisionTool = (sendInitialPayment, onProvisioned) => {
|
|
|
95
109
|
namesByAddressAdmin,
|
|
96
110
|
);
|
|
97
111
|
if (created) {
|
|
98
|
-
onProvisioned();
|
|
112
|
+
forHandler.onProvisioned();
|
|
99
113
|
}
|
|
100
114
|
trace(created ? 'provisioned' : 're-provisioned', address);
|
|
101
115
|
},
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
};
|
|
116
|
+
},
|
|
117
|
+
);
|
|
105
118
|
|
|
106
119
|
/**
|
|
107
|
-
* @param {import('@agoric/
|
|
120
|
+
* @param {import('@agoric/zone').Zone} zone
|
|
108
121
|
* @param {{
|
|
109
122
|
* makeRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit;
|
|
110
123
|
* params: any;
|
|
111
124
|
* poolBank: import('@endo/far').ERef<Bank>;
|
|
112
125
|
* zcf: ZCF;
|
|
126
|
+
* makeBridgeProvisionTool: ReturnType<typeof prepareBridgeProvisionTool>;
|
|
113
127
|
* }} powers
|
|
114
128
|
*/
|
|
115
129
|
export const prepareProvisionPoolKit = (
|
|
116
|
-
|
|
117
|
-
{ makeRecorderKit, params, poolBank, zcf },
|
|
130
|
+
zone,
|
|
131
|
+
{ makeRecorderKit, params, poolBank, zcf, makeBridgeProvisionTool },
|
|
118
132
|
) => {
|
|
119
133
|
const zoe = zcf.getZoeService();
|
|
120
134
|
|
|
121
|
-
const makeProvisionPoolKitInternal =
|
|
122
|
-
baggage,
|
|
135
|
+
const makeProvisionPoolKitInternal = zone.exoClassKit(
|
|
123
136
|
'ProvisionPoolKit',
|
|
124
137
|
{
|
|
125
138
|
machine: M.interface('ProvisionPoolKit machine', {
|
|
@@ -142,6 +155,7 @@ export const prepareProvisionPoolKit = (
|
|
|
142
155
|
ackWallet: M.call(M.string()).returns(M.boolean()),
|
|
143
156
|
}),
|
|
144
157
|
helper: UnguardedHelperI,
|
|
158
|
+
forHandler: UnguardedHelperI,
|
|
145
159
|
public: M.interface('ProvisionPoolKit public', {
|
|
146
160
|
getPublicTopics: M.call().returns({ metrics: PublicTopicShape }),
|
|
147
161
|
}),
|
|
@@ -208,23 +222,24 @@ export const prepareProvisionPoolKit = (
|
|
|
208
222
|
const refs = await deeplyFulfilledObject(obj);
|
|
209
223
|
Object.assign(this.state, refs);
|
|
210
224
|
},
|
|
225
|
+
/** @returns {import('@agoric/vats').BridgeHandler} */
|
|
211
226
|
makeHandler() {
|
|
212
227
|
const { bankManager, namesByAddressAdmin, walletFactory } =
|
|
213
228
|
this.state;
|
|
214
229
|
if (!bankManager || !namesByAddressAdmin || !walletFactory) {
|
|
215
230
|
throw Fail`must set references before handling requests`;
|
|
216
231
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
() => helper.onProvisioned(),
|
|
222
|
-
);
|
|
223
|
-
return innerMaker({
|
|
232
|
+
|
|
233
|
+
const { forHandler } = this.facets;
|
|
234
|
+
|
|
235
|
+
const provisionHandler = makeBridgeProvisionTool(
|
|
224
236
|
bankManager,
|
|
225
|
-
namesByAddressAdmin,
|
|
226
237
|
walletFactory,
|
|
227
|
-
|
|
238
|
+
namesByAddressAdmin,
|
|
239
|
+
forHandler,
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
return provisionHandler;
|
|
228
243
|
},
|
|
229
244
|
/**
|
|
230
245
|
* @param {Brand} brand
|
|
@@ -302,37 +317,6 @@ export const prepareProvisionPoolKit = (
|
|
|
302
317
|
);
|
|
303
318
|
facets.helper.publishMetrics();
|
|
304
319
|
},
|
|
305
|
-
onProvisioned() {
|
|
306
|
-
const { state, facets } = this;
|
|
307
|
-
state.walletsProvisioned += 1n;
|
|
308
|
-
facets.helper.publishMetrics();
|
|
309
|
-
},
|
|
310
|
-
/** @param {ERef<Bank>} destBank */
|
|
311
|
-
async sendInitialPayment(destBank) {
|
|
312
|
-
const {
|
|
313
|
-
facets: { helper },
|
|
314
|
-
state: { fundPurse, poolBrand },
|
|
315
|
-
} = this;
|
|
316
|
-
const perAccountInitialAmount = /** @type {Amount<'nat'>} */ (
|
|
317
|
-
params.getPerAccountInitialAmount()
|
|
318
|
-
);
|
|
319
|
-
const initialPmt = await E(fundPurse).withdraw(
|
|
320
|
-
perAccountInitialAmount,
|
|
321
|
-
);
|
|
322
|
-
|
|
323
|
-
const destPurse = E(destBank).getPurse(poolBrand);
|
|
324
|
-
return E(destPurse)
|
|
325
|
-
.deposit(initialPmt)
|
|
326
|
-
.then(amt => {
|
|
327
|
-
helper.onSendFunds(perAccountInitialAmount);
|
|
328
|
-
trace('provisionPool sent', amt);
|
|
329
|
-
})
|
|
330
|
-
.catch(reason => {
|
|
331
|
-
console.error(X`initial deposit failed: ${q(reason)}`);
|
|
332
|
-
void E(fundPurse).deposit(initialPmt);
|
|
333
|
-
throw reason;
|
|
334
|
-
});
|
|
335
|
-
},
|
|
336
320
|
/**
|
|
337
321
|
* @param {ERef<Purse>} exchangePurse
|
|
338
322
|
* @param {ERef<Brand>} brand
|
|
@@ -482,6 +466,39 @@ export const prepareProvisionPoolKit = (
|
|
|
482
466
|
return rxd;
|
|
483
467
|
},
|
|
484
468
|
},
|
|
469
|
+
forHandler: {
|
|
470
|
+
onProvisioned() {
|
|
471
|
+
const { state, facets } = this;
|
|
472
|
+
state.walletsProvisioned += 1n;
|
|
473
|
+
facets.helper.publishMetrics();
|
|
474
|
+
},
|
|
475
|
+
/** @param {ERef<Bank>} destBank */
|
|
476
|
+
async sendInitialPayment(destBank) {
|
|
477
|
+
const {
|
|
478
|
+
facets: { helper },
|
|
479
|
+
state: { fundPurse, poolBrand },
|
|
480
|
+
} = this;
|
|
481
|
+
const perAccountInitialAmount = /** @type {Amount<'nat'>} */ (
|
|
482
|
+
params.getPerAccountInitialAmount()
|
|
483
|
+
);
|
|
484
|
+
const initialPmt = await E(fundPurse).withdraw(
|
|
485
|
+
perAccountInitialAmount,
|
|
486
|
+
);
|
|
487
|
+
|
|
488
|
+
const destPurse = E(destBank).getPurse(poolBrand);
|
|
489
|
+
return E(destPurse)
|
|
490
|
+
.deposit(initialPmt)
|
|
491
|
+
.then(amt => {
|
|
492
|
+
helper.onSendFunds(perAccountInitialAmount);
|
|
493
|
+
trace('provisionPool sent', amt);
|
|
494
|
+
})
|
|
495
|
+
.catch(reason => {
|
|
496
|
+
console.error(X`initial deposit failed: ${q(reason)}`);
|
|
497
|
+
void E(fundPurse).deposit(initialPmt);
|
|
498
|
+
throw reason;
|
|
499
|
+
});
|
|
500
|
+
},
|
|
501
|
+
},
|
|
485
502
|
public: {
|
|
486
503
|
getPublicTopics() {
|
|
487
504
|
return {
|
|
@@ -506,6 +523,7 @@ export const prepareProvisionPoolKit = (
|
|
|
506
523
|
* @param {object} opts
|
|
507
524
|
* @param {Brand<'nat'>} opts.poolBrand
|
|
508
525
|
* @param {ERef<StorageNode>} opts.storageNode
|
|
526
|
+
* @returns {Promise<ProvisionPoolKit>}
|
|
509
527
|
*/
|
|
510
528
|
const makeProvisionPoolKit = async ({ poolBrand, storageNode }) => {
|
|
511
529
|
const fundPurse = await E(poolBank).getPurse(poolBrand);
|
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":"AAqCA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AAEH,2BAA2B;AAC3B,mBADW,YAAY,CAkCrB;AAsBK,2BAlBI,GAAG,CACT,eAAe,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,QAAQ,CAAC;CACrB,CAAC,GAAG;IACH,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,eAAe,EAAE,KAAK,CAAC;CACxB,CACF,eACO;IACN,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,UAAU,CAAC;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAsU4F,cAAc;kDAAuE,cAAc;;;;;;;;;;;;GAJhN;;;;;;;;;;uBAzYa,MAAM,CAAC,KAAK,CAAC;;;;;uBAEb,MAAM,CAAC,KAAK,CAAC;;;;;oBAEb,MAAM,CAAC,KAAK,CAAC;;;;;yBAEb,MAAM,CAAC,KAAK,CAAC;;;;;yBAEb,MAAM,CAAC,KAAK,CAAC;;6BAoYb,OAAO,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC;6BA9XpC,kBAAkB"}
|
package/src/psm/psm.js
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
import { StorageNodeShape } from '@agoric/internal';
|
|
15
15
|
import { M, prepareExo, provide } from '@agoric/vat-data';
|
|
16
16
|
import {
|
|
17
|
-
atomicRearrange,
|
|
18
17
|
atomicTransfer,
|
|
19
18
|
ceilMultiplyBy,
|
|
20
19
|
floorDivideBy,
|
|
@@ -273,8 +272,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
273
272
|
const maxAnchor = floorMultiplyBy(afterFee, anchorPerMinted);
|
|
274
273
|
AmountMath.isGTE(maxAnchor, wanted) ||
|
|
275
274
|
Fail`wanted ${wanted} is more than ${given} minus fees ${fee}`;
|
|
276
|
-
atomicRearrange(
|
|
277
|
-
zcf,
|
|
275
|
+
zcf.atomicRearrange(
|
|
278
276
|
harden([
|
|
279
277
|
[seat, stage, { In: afterFee }, { Minted: afterFee }],
|
|
280
278
|
[seat, feePool, { In: fee }, { Minted: fee }],
|
|
@@ -305,8 +303,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
305
303
|
Fail`wanted ${wanted} is more than ${given} minus fees ${fee}`;
|
|
306
304
|
mintMinted(asStable);
|
|
307
305
|
try {
|
|
308
|
-
atomicRearrange(
|
|
309
|
-
zcf,
|
|
306
|
+
zcf.atomicRearrange(
|
|
310
307
|
harden([
|
|
311
308
|
[seat, anchorPool, { In: given }, { Anchor: given }],
|
|
312
309
|
[stage, seat, { Minted: afterFee }, { Out: afterFee }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetReserve.d.ts","sourceRoot":"","sources":["assetReserve.js"],"names":[],"mappings":"AAYA,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAGnC;AAgCK,2BAbI,GAAG,CACT,eAAe,CAAC,EAAE,CAAC,GAAG;IACpB,YAAY,EAAE,CAAC,2BAA2B,CAAC,CAAC;CAC7C,CACF,eACO;IACN,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,UAAU,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;CAChC,WACO,OAAO;
|
|
1
|
+
{"version":3,"file":"assetReserve.d.ts","sourceRoot":"","sources":["assetReserve.js"],"names":[],"mappings":"AAYA,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAGnC;AAgCK,2BAbI,GAAG,CACT,eAAe,CAAC,EAAE,CAAC,GAAG;IACpB,YAAY,EAAE,CAAC,2BAA2B,CAAC,CAAC;CAC7C,CACF,eACO;IACN,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,UAAU,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;CAChC,WACO,OAAO;IAoDd,mEAAmE;kBAAxD,oBAAoB;;;;;;;OAAgC;IAE/D,iEAAiE;iBAAtD,mBAAmB;;;;;OAA+B;GAKhE;sCArFY;IACR,4BAA4B,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,0BAA0B,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;;kCAuFU,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI;gCAC3B,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI;;;eAK3B,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI;oBACrC,MAAM,UAAU;sCAChB,MAAM,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;;sCAG5C,OAAO,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC;;;;uCAEjD,OAAO,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC;6BAjGnC,kBAAkB"}
|
|
@@ -57,22 +57,13 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
57
57
|
privateArgs.marshaller,
|
|
58
58
|
);
|
|
59
59
|
|
|
60
|
-
/** @type {() => Promise<ZCFMint<'nat'>>} */
|
|
61
|
-
const takeFeeMint = async () => {
|
|
62
|
-
if (baggage.has('feeMint')) {
|
|
63
|
-
return baggage.get('feeMint');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const feeMintTemp = await zcf.registerFeeMint(
|
|
67
|
-
'Fee',
|
|
68
|
-
privateArgs.feeMintAccess,
|
|
69
|
-
);
|
|
70
|
-
baggage.init('feeMint', feeMintTemp);
|
|
71
|
-
return feeMintTemp;
|
|
72
|
-
};
|
|
73
|
-
trace('awaiting takeFeeMint');
|
|
74
|
-
const feeMint = await takeFeeMint();
|
|
75
60
|
const storageNode = await privateArgs.storageNode;
|
|
61
|
+
|
|
62
|
+
trace('awaiting feeMint');
|
|
63
|
+
const { feeMint } = await provideAll(baggage, {
|
|
64
|
+
feeMint: () => zcf.registerFeeMint('Fee', privateArgs.feeMintAccess),
|
|
65
|
+
});
|
|
66
|
+
|
|
76
67
|
const makeAssetReserveKit = await prepareAssetReserveKit(baggage, {
|
|
77
68
|
feeMint,
|
|
78
69
|
makeRecorderKit,
|
package/src/reserve/params.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @param {InvitationAmount} poserInvitationAmount
|
|
3
|
+
*/
|
|
4
|
+
export function makeReserveTerms(poserInvitationAmount: InvitationAmount): {
|
|
3
5
|
governedParams: {
|
|
4
6
|
Electorate: {
|
|
5
7
|
type: "invitation";
|
|
6
|
-
value:
|
|
8
|
+
value: import("@agoric/ertp").SetAmount<InvitationDetails>;
|
|
7
9
|
};
|
|
8
10
|
};
|
|
9
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["params.js"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["params.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,wDAFW,gBAAgB;;;;;;;EASzB"}
|
package/src/reserve/params.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @param {InvitationAmount} poserInvitationAmount
|
|
7
|
+
*/
|
|
8
|
+
const makeReserveTerms = poserInvitationAmount => ({
|
|
7
9
|
governedParams: harden({
|
|
8
10
|
[CONTRACT_ELECTORATE]: {
|
|
9
11
|
type: ParamTypes.INVITATION,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function calculateMinimumCollateralization(liquidationMargin: Ratio, liquidationPadding: Ratio): Ratio;
|
|
2
|
-
export function minimumPrice(quoteA: PriceQuote, quoteB?: PriceQuote
|
|
2
|
+
export function minimumPrice(quoteA: PriceQuote, quoteB?: PriceQuote): Ratio;
|
|
3
3
|
export function maxDebtForVault(quoteAmount: PriceQuote, liquidationMargin: Ratio, liquidationPadding: Ratio): Amount<"nat">;
|
|
4
4
|
export function calculateDebtCosts(currentDebt: Amount<"nat">, give: Amount<"nat">, want: Amount<"nat">, debtFee: Ratio): {
|
|
5
5
|
newDebt: import("@agoric/ertp").NatAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["math.js"],"names":[],"mappings":"AA4BO,qEAJI,KAAK,sBACL,KAAK,GACH,KAAK,CAKmC;AAS9C,qCAJI,UAAU,
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["math.js"],"names":[],"mappings":"AA4BO,qEAJI,KAAK,sBACL,KAAK,GACH,KAAK,CAKmC;AAS9C,qCAJI,UAAU,WACV,UAAU,GACR,KAAK,CAajB;AAYM,6CALI,UAAU,qBACV,KAAK,sBACL,KAAK,GACH,MAAM,CAAC,KAAK,CAAC,CAczB;AAaM,gDALI,MAAM,CAAC,KAAK,CAAC,QACb,MAAM,CAAC,KAAK,CAAC,QACb,MAAM,CAAC,KAAK,CAAC,WACb,KAAK;;;;;EASf;gCA7E6F,4BAA4B"}
|