agoric 0.21.2-dev-e7af58f.0 → 0.21.2-dev-3b799b8.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/package.json +21 -21
- package/src/commands/auction.js +2 -6
- package/src/commands/gov.js +12 -15
- package/src/commands/inter.js +9 -11
- package/src/commands/oracle.js +2 -2
- package/src/commands/vaults.js +6 -9
- package/src/commands/wallet.js +2 -2
- package/src/lib/wallet.js +7 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agoric",
|
|
3
|
-
"version": "0.21.2-dev-
|
|
3
|
+
"version": "0.21.2-dev-3b799b8.0+3b799b8",
|
|
4
4
|
"description": "Manage the Agoric Javascript smart contract platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
@@ -29,29 +29,29 @@
|
|
|
29
29
|
"lint:eslint": "eslint ."
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@agoric/cosmic-swingset": "0.41.4-dev-
|
|
33
|
-
"@agoric/deploy-script-support": "0.10.4-dev-
|
|
32
|
+
"@agoric/cosmic-swingset": "0.41.4-dev-3b799b8.0+3b799b8",
|
|
33
|
+
"@agoric/deploy-script-support": "0.10.4-dev-3b799b8.0+3b799b8",
|
|
34
34
|
"ava": "^5.3.0",
|
|
35
35
|
"c8": "^9.1.0",
|
|
36
36
|
"dd-trace": "^4.11.1"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@agoric/access-token": "0.4.22-dev-
|
|
40
|
-
"@agoric/cache": "0.3.3-dev-
|
|
41
|
-
"@agoric/casting": "0.4.3-dev-
|
|
42
|
-
"@agoric/client-utils": "0.1.1-dev-
|
|
43
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
44
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
45
|
-
"@agoric/governance": "0.10.4-dev-
|
|
46
|
-
"@agoric/inter-protocol": "0.16.2-dev-
|
|
47
|
-
"@agoric/internal": "0.3.3-dev-
|
|
48
|
-
"@agoric/network": "0.1.1-dev-
|
|
49
|
-
"@agoric/smart-wallet": "0.5.4-dev-
|
|
50
|
-
"@agoric/store": "0.9.3-dev-
|
|
51
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
52
|
-
"@agoric/vats": "0.15.2-dev-
|
|
53
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
54
|
-
"@agoric/zone": "0.2.3-dev-
|
|
39
|
+
"@agoric/access-token": "0.4.22-dev-3b799b8.0+3b799b8",
|
|
40
|
+
"@agoric/cache": "0.3.3-dev-3b799b8.0+3b799b8",
|
|
41
|
+
"@agoric/casting": "0.4.3-dev-3b799b8.0+3b799b8",
|
|
42
|
+
"@agoric/client-utils": "0.1.1-dev-3b799b8.0+3b799b8",
|
|
43
|
+
"@agoric/cosmic-proto": "0.4.1-dev-3b799b8.0+3b799b8",
|
|
44
|
+
"@agoric/ertp": "0.16.3-dev-3b799b8.0+3b799b8",
|
|
45
|
+
"@agoric/governance": "0.10.4-dev-3b799b8.0+3b799b8",
|
|
46
|
+
"@agoric/inter-protocol": "0.16.2-dev-3b799b8.0+3b799b8",
|
|
47
|
+
"@agoric/internal": "0.3.3-dev-3b799b8.0+3b799b8",
|
|
48
|
+
"@agoric/network": "0.1.1-dev-3b799b8.0+3b799b8",
|
|
49
|
+
"@agoric/smart-wallet": "0.5.4-dev-3b799b8.0+3b799b8",
|
|
50
|
+
"@agoric/store": "0.9.3-dev-3b799b8.0+3b799b8",
|
|
51
|
+
"@agoric/swingset-vat": "0.32.3-dev-3b799b8.0+3b799b8",
|
|
52
|
+
"@agoric/vats": "0.15.2-dev-3b799b8.0+3b799b8",
|
|
53
|
+
"@agoric/zoe": "0.26.3-dev-3b799b8.0+3b799b8",
|
|
54
|
+
"@agoric/zone": "0.2.3-dev-3b799b8.0+3b799b8",
|
|
55
55
|
"@confio/relayer": "^0.11.3",
|
|
56
56
|
"@cosmjs/crypto": "^0.32.3",
|
|
57
57
|
"@cosmjs/encoding": "^0.32.3",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"workerThreads": false
|
|
101
101
|
},
|
|
102
102
|
"typeCoverage": {
|
|
103
|
-
"atLeast": 77.
|
|
103
|
+
"atLeast": 77.54
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "3b799b8302ba75327a825515c82d954a1f78103c"
|
|
106
106
|
}
|
package/src/commands/auction.js
CHANGED
|
@@ -89,16 +89,12 @@ export const makeAuctionCommand = (
|
|
|
89
89
|
* }} opts
|
|
90
90
|
*/
|
|
91
91
|
async opts => {
|
|
92
|
-
const { agoricNames,
|
|
92
|
+
const { agoricNames, readPublished } = await makeVstorageKit(
|
|
93
93
|
{ fetch },
|
|
94
94
|
networkConfig,
|
|
95
95
|
);
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
// @ts-expect-error XXX should runtime check?
|
|
99
|
-
const { current } = await readLatestHead(
|
|
100
|
-
`published.auction.governance`,
|
|
101
|
-
);
|
|
97
|
+
const { current } = await readPublished(`auction.governance`);
|
|
102
98
|
|
|
103
99
|
const {
|
|
104
100
|
AuctionStartDelay: {
|
package/src/commands/gov.js
CHANGED
|
@@ -98,13 +98,13 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
98
98
|
optUtils,
|
|
99
99
|
) {
|
|
100
100
|
const utils = await (optUtils || makeVstorageKit({ fetch }, networkConfig));
|
|
101
|
-
const { agoricNames,
|
|
101
|
+
const { agoricNames, readPublished } = utils;
|
|
102
102
|
|
|
103
103
|
assert(keyringBackend, 'missing keyring-backend option');
|
|
104
104
|
|
|
105
105
|
let current;
|
|
106
106
|
if (sendFrom) {
|
|
107
|
-
current = await getCurrent(sendFrom, {
|
|
107
|
+
current = await getCurrent(sendFrom, { readPublished });
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
const offer = toOffer(agoricNames, current);
|
|
@@ -134,9 +134,9 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
134
134
|
show({ timestamp, height, offerId: offer.id, txhash });
|
|
135
135
|
const checkInWallet = async blockInfo => {
|
|
136
136
|
const [state, update] = await Promise.all([
|
|
137
|
-
getCurrent(sendFrom, {
|
|
138
|
-
getLastUpdate(sendFrom, {
|
|
139
|
-
|
|
137
|
+
getCurrent(sendFrom, { readPublished }),
|
|
138
|
+
getLastUpdate(sendFrom, { readPublished }),
|
|
139
|
+
readPublished(`wallet.${sendFrom}`),
|
|
140
140
|
]);
|
|
141
141
|
if (update.updated === 'offerStatus' && update.status.id === offer.id) {
|
|
142
142
|
return blockInfo;
|
|
@@ -265,11 +265,11 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
265
265
|
)
|
|
266
266
|
.requiredOption('--for <string>', 'description of the invitation')
|
|
267
267
|
.action(async opts => {
|
|
268
|
-
const { agoricNames,
|
|
268
|
+
const { agoricNames, readPublished } = await makeVstorageKit(
|
|
269
269
|
{ fetch },
|
|
270
270
|
networkConfig,
|
|
271
271
|
);
|
|
272
|
-
const current = await getCurrent(opts.from, {
|
|
272
|
+
const current = await getCurrent(opts.from, { readPublished });
|
|
273
273
|
|
|
274
274
|
const known = findContinuingIds(current, agoricNames);
|
|
275
275
|
if (!known) {
|
|
@@ -294,11 +294,11 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
294
294
|
normalizeAddress,
|
|
295
295
|
)
|
|
296
296
|
.action(async opts => {
|
|
297
|
-
const { agoricNames,
|
|
297
|
+
const { agoricNames, readPublished } = await makeVstorageKit(
|
|
298
298
|
{ fetch },
|
|
299
299
|
networkConfig,
|
|
300
300
|
);
|
|
301
|
-
const current = await getCurrent(opts.from, {
|
|
301
|
+
const current = await getCurrent(opts.from, { readPublished });
|
|
302
302
|
|
|
303
303
|
const found = findContinuingIds(current, agoricNames);
|
|
304
304
|
for (const it of found) {
|
|
@@ -334,19 +334,16 @@ export const makeGovCommand = (_logger, io = {}) => {
|
|
|
334
334
|
)
|
|
335
335
|
.action(async function (opts, options) {
|
|
336
336
|
const utils = await makeVstorageKit({ fetch }, networkConfig);
|
|
337
|
-
const {
|
|
337
|
+
const { readPublished } = utils;
|
|
338
338
|
|
|
339
|
-
const
|
|
340
|
-
`
|
|
339
|
+
const questionDesc = await readPublished(
|
|
340
|
+
`committees.${opts.pathname}.latestQuestion`,
|
|
341
341
|
).catch(err => {
|
|
342
342
|
// CommanderError is a class constructor, and so
|
|
343
343
|
// must be invoked with `new`.
|
|
344
344
|
throw new CommanderError(1, 'VSTORAGE_FAILURE', err.message);
|
|
345
345
|
});
|
|
346
346
|
|
|
347
|
-
// XXX runtime shape-check
|
|
348
|
-
const questionDesc = /** @type {QuestionDetails} */ (info);
|
|
349
|
-
|
|
350
347
|
// TODO support multiple position arguments
|
|
351
348
|
const chosenPositions = [questionDesc.positions[opts.forPosition]];
|
|
352
349
|
assert(chosenPositions, `undefined position index ${opts.forPosition}`);
|
package/src/commands/inter.js
CHANGED
|
@@ -281,14 +281,12 @@ inter auction status
|
|
|
281
281
|
* }}
|
|
282
282
|
*/ opts,
|
|
283
283
|
) => {
|
|
284
|
-
const { agoricNames,
|
|
284
|
+
const { agoricNames, readPublished } = await tryMakeUtils();
|
|
285
285
|
|
|
286
|
-
/** @type { [ScheduleNotification, BookDataNotification, *] } */
|
|
287
|
-
// @ts-expect-error dynamic cast
|
|
288
286
|
const [schedule, book, { current: params }] = await Promise.all([
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
287
|
+
readPublished('auction.schedule'),
|
|
288
|
+
readPublished(`auction.book${opts.book}`),
|
|
289
|
+
readPublished('auction.governance'),
|
|
292
290
|
]);
|
|
293
291
|
|
|
294
292
|
const fmt = makeFormatters(Object.values(agoricNames.vbankAsset));
|
|
@@ -493,9 +491,9 @@ inter auction status
|
|
|
493
491
|
return;
|
|
494
492
|
}
|
|
495
493
|
|
|
496
|
-
const { networkConfig,
|
|
494
|
+
const { networkConfig, readPublished } = await tryMakeUtils();
|
|
497
495
|
|
|
498
|
-
const current = await getCurrent(from, {
|
|
496
|
+
const current = await getCurrent(from, { readPublished });
|
|
499
497
|
const liveIds = current.liveOffers.map(([i, _s]) => i);
|
|
500
498
|
if (!liveIds.includes(id)) {
|
|
501
499
|
// InvalidArgumentError is a class constructor, and so
|
|
@@ -520,7 +518,7 @@ inter auction status
|
|
|
520
518
|
show({ timestamp, height, offerId: id, txhash });
|
|
521
519
|
|
|
522
520
|
const checkGone = async blockInfo => {
|
|
523
|
-
const pollResult = await getCurrent(from, {
|
|
521
|
+
const pollResult = await getCurrent(from, { readPublished });
|
|
524
522
|
const found = pollResult.liveOffers.find(([i, _]) => i === id);
|
|
525
523
|
if (found) throw Error('retry');
|
|
526
524
|
return blockInfo;
|
|
@@ -562,11 +560,11 @@ $ inter bid list --from my-acct
|
|
|
562
560
|
* }} opts
|
|
563
561
|
*/
|
|
564
562
|
async opts => {
|
|
565
|
-
const { agoricNames,
|
|
563
|
+
const { agoricNames, readPublished, storedWalletState } =
|
|
566
564
|
await tryMakeUtils();
|
|
567
565
|
|
|
568
566
|
const [current, state] = await Promise.all([
|
|
569
|
-
getCurrent(opts.from, {
|
|
567
|
+
getCurrent(opts.from, { readPublished }),
|
|
570
568
|
storedWalletState(opts.from),
|
|
571
569
|
]);
|
|
572
570
|
const entries = opts.all
|
package/src/commands/oracle.js
CHANGED
|
@@ -175,8 +175,8 @@ export const makeOracleCommand = (logger, io = {}) => {
|
|
|
175
175
|
console.warn(sendHint);
|
|
176
176
|
});
|
|
177
177
|
|
|
178
|
-
const findOracleCap = async (instance, from,
|
|
179
|
-
const current = await getCurrent(from, {
|
|
178
|
+
const findOracleCap = async (instance, from, readPublished) => {
|
|
179
|
+
const current = await getCurrent(from, { readPublished });
|
|
180
180
|
|
|
181
181
|
const { offerToUsedInvitation: entries } = /** @type {any} */ (current);
|
|
182
182
|
Array.isArray(entries) || Fail`entries must be an array: ${entries}`;
|
package/src/commands/vaults.js
CHANGED
|
@@ -39,13 +39,10 @@ export const makeVaultsCommand = logger => {
|
|
|
39
39
|
normalizeAddress,
|
|
40
40
|
)
|
|
41
41
|
.action(async function (opts) {
|
|
42
|
-
const {
|
|
43
|
-
{ fetch },
|
|
44
|
-
networkConfig,
|
|
45
|
-
);
|
|
42
|
+
const { readPublished } = await makeVstorageKit({ fetch }, networkConfig);
|
|
46
43
|
|
|
47
44
|
const current = await getCurrent(opts.from, {
|
|
48
|
-
|
|
45
|
+
readPublished,
|
|
49
46
|
});
|
|
50
47
|
|
|
51
48
|
const vaultStoragePaths = current.offerToPublicSubscriberPaths.map(
|
|
@@ -102,14 +99,14 @@ export const makeVaultsCommand = logger => {
|
|
|
102
99
|
.requiredOption('--vaultId <string>', 'Key of vault (e.g. vault1)')
|
|
103
100
|
.action(async function (opts) {
|
|
104
101
|
logger.warn('running with options', opts);
|
|
105
|
-
const { agoricNames,
|
|
102
|
+
const { agoricNames, readPublished } = await makeVstorageKit(
|
|
106
103
|
{ fetch },
|
|
107
104
|
networkConfig,
|
|
108
105
|
);
|
|
109
106
|
|
|
110
107
|
const previousOfferId = await lookupOfferIdForVault(
|
|
111
108
|
opts.vaultId,
|
|
112
|
-
getCurrent(opts.from, {
|
|
109
|
+
getCurrent(opts.from, { readPublished }),
|
|
113
110
|
);
|
|
114
111
|
|
|
115
112
|
const offer = Offers.vaults.AdjustBalances(
|
|
@@ -146,14 +143,14 @@ export const makeVaultsCommand = logger => {
|
|
|
146
143
|
)
|
|
147
144
|
.action(async function (opts) {
|
|
148
145
|
logger.warn('running with options', opts);
|
|
149
|
-
const { agoricNames,
|
|
146
|
+
const { agoricNames, readPublished } = await makeVstorageKit(
|
|
150
147
|
{ fetch },
|
|
151
148
|
networkConfig,
|
|
152
149
|
);
|
|
153
150
|
|
|
154
151
|
const previousOfferId = await lookupOfferIdForVault(
|
|
155
152
|
opts.vaultId,
|
|
156
|
-
getCurrent(opts.from, {
|
|
153
|
+
getCurrent(opts.from, { readPublished }),
|
|
157
154
|
);
|
|
158
155
|
|
|
159
156
|
const offer = Offers.vaults.CloseVault(
|
package/src/commands/wallet.js
CHANGED
|
@@ -172,7 +172,7 @@ export const makeWalletCommand = async command => {
|
|
|
172
172
|
normalizeAddress,
|
|
173
173
|
)
|
|
174
174
|
.action(async function (opts) {
|
|
175
|
-
const { agoricNames, unserializer,
|
|
175
|
+
const { agoricNames, unserializer, readPublished } =
|
|
176
176
|
await makeVstorageKit(
|
|
177
177
|
{
|
|
178
178
|
fetch,
|
|
@@ -191,7 +191,7 @@ export const makeWalletCommand = async command => {
|
|
|
191
191
|
|
|
192
192
|
const coalesced = await coalesceWalletState(follower);
|
|
193
193
|
|
|
194
|
-
const current = await getCurrent(opts.from, {
|
|
194
|
+
const current = await getCurrent(opts.from, { readPublished });
|
|
195
195
|
|
|
196
196
|
console.warn(
|
|
197
197
|
'got coalesced',
|
package/src/lib/wallet.js
CHANGED
|
@@ -10,7 +10,7 @@ import { execSwingsetTransaction, pollTx } from './chain.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js';
|
|
12
12
|
* @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js';
|
|
13
|
-
* @import {MinimalNetworkConfig,
|
|
13
|
+
* @import {MinimalNetworkConfig, VstorageKit} from '@agoric/client-utils';
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const marshaller = boardSlottingMarshaller();
|
|
@@ -25,15 +25,15 @@ const emptyCurrentRecord = {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* @param {string} addr
|
|
28
|
-
* @param {Pick<
|
|
28
|
+
* @param {Pick<VstorageKit, 'readPublished'>} io
|
|
29
29
|
* @returns {Promise<import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord>}
|
|
30
30
|
*/
|
|
31
|
-
export const getCurrent = async (addr, {
|
|
31
|
+
export const getCurrent = async (addr, { readPublished }) => {
|
|
32
32
|
// Partial because older writes may not have had all properties
|
|
33
33
|
// NB: assumes changes are only additions
|
|
34
34
|
let current =
|
|
35
35
|
/** @type {Partial<import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord> | undefined} */ (
|
|
36
|
-
await
|
|
36
|
+
await readPublished(`wallet.${addr}.current`)
|
|
37
37
|
);
|
|
38
38
|
if (current === undefined) {
|
|
39
39
|
throw Error(`undefined current node for ${addr}`);
|
|
@@ -60,12 +60,11 @@ export const getCurrent = async (addr, { readLatestHead }) => {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* @param {string} addr
|
|
63
|
-
* @param {Pick<
|
|
63
|
+
* @param {Pick<VstorageKit, 'readPublished'>} io
|
|
64
64
|
* @returns {Promise<import('@agoric/smart-wallet/src/smartWallet.js').UpdateRecord>}
|
|
65
65
|
*/
|
|
66
|
-
export const getLastUpdate = (addr, {
|
|
67
|
-
|
|
68
|
-
return readLatestHead(`published.wallet.${addr}`);
|
|
66
|
+
export const getLastUpdate = (addr, { readPublished }) => {
|
|
67
|
+
return readPublished(`wallet.${addr}`);
|
|
69
68
|
};
|
|
70
69
|
|
|
71
70
|
/**
|