agoric 0.22.0-u21.0.1 → 0.22.0-u22.1
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 +43 -40
- package/src/chain-config.js +1 -0
- package/src/commands/wallet.js +5 -4
- package/src/deploy.js +7 -1
- package/src/entrypoint.js +1 -0
- package/src/lib/chain.js +11 -28
- package/src/publish.js +4 -1
- package/src/sdk-package-names.js +4 -0
- package/src/start.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agoric",
|
|
3
|
-
"version": "0.22.0-
|
|
3
|
+
"version": "0.22.0-u22.1",
|
|
4
4
|
"description": "Manage the Agoric Javascript smart contract platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "node ./scripts/get-sdk-package-names.js > src/sdk-package-names.js",
|
|
23
23
|
"test": "ava",
|
|
24
|
-
"test:c8": "c8 --all $C8_OPTIONS ava",
|
|
24
|
+
"test:c8": "c8 --all ${C8_OPTIONS:-} ava",
|
|
25
25
|
"test:xs": "exit 0",
|
|
26
26
|
"integration-test": "ava --config .ava-integration-test.config.js",
|
|
27
27
|
"lint-fix": "yarn lint:eslint --fix",
|
|
@@ -30,46 +30,46 @@
|
|
|
30
30
|
"lint:eslint": "yarn run -T eslint ."
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@agoric/cosmic-swingset": "0.42.0-
|
|
34
|
-
"@agoric/deploy-script-support": "0.
|
|
33
|
+
"@agoric/cosmic-swingset": "0.42.0-u22.1",
|
|
34
|
+
"@agoric/deploy-script-support": "0.11.0-u22.1",
|
|
35
35
|
"ava": "^5.3.0",
|
|
36
36
|
"c8": "^10.1.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@agoric/access-token": "0.4.22-
|
|
40
|
-
"@agoric/cache": "0.
|
|
41
|
-
"@agoric/casting": "0.5.0-
|
|
42
|
-
"@agoric/client-utils": "0.2.0-
|
|
43
|
-
"@agoric/cosmic-proto": "0.5.0-
|
|
44
|
-
"@agoric/ertp": "0.
|
|
45
|
-
"@agoric/governance": "0.
|
|
46
|
-
"@agoric/inter-protocol": "0.17.0-
|
|
47
|
-
"@agoric/internal": "0.4.0-
|
|
48
|
-
"@agoric/network": "0.2.0-
|
|
49
|
-
"@agoric/smart-wallet": "0.
|
|
50
|
-
"@agoric/store": "0.
|
|
51
|
-
"@agoric/swingset-vat": "0.33.0-
|
|
52
|
-
"@agoric/vats": "0.16.0-
|
|
53
|
-
"@agoric/zoe": "0.27.0-
|
|
54
|
-
"@agoric/zone": "0.3.0-
|
|
55
|
-
"@cosmjs/crypto": "^0.
|
|
56
|
-
"@cosmjs/encoding": "^0.
|
|
57
|
-
"@cosmjs/math": "^0.
|
|
58
|
-
"@cosmjs/proto-signing": "^0.
|
|
59
|
-
"@cosmjs/stargate": "^0.
|
|
60
|
-
"@endo/base64": "^1.0.
|
|
61
|
-
"@endo/bundle-source": "^4.
|
|
62
|
-
"@endo/captp": "^4.4.
|
|
63
|
-
"@endo/compartment-mapper": "^1.6.
|
|
64
|
-
"@endo/env-options": "^1.1.
|
|
65
|
-
"@endo/errors": "^1.2.
|
|
66
|
-
"@endo/far": "^1.1.
|
|
67
|
-
"@endo/init": "^1.1.
|
|
68
|
-
"@endo/marshal": "^1.
|
|
69
|
-
"@endo/nat": "^5.1.
|
|
70
|
-
"@endo/patterns": "^1.
|
|
71
|
-
"@endo/promise-kit": "^1.1.
|
|
72
|
-
"@endo/zip": "^1.0.
|
|
39
|
+
"@agoric/access-token": "0.4.22-u22.1",
|
|
40
|
+
"@agoric/cache": "0.4.0-u22.1",
|
|
41
|
+
"@agoric/casting": "0.5.0-u22.1",
|
|
42
|
+
"@agoric/client-utils": "0.2.0-u22.1",
|
|
43
|
+
"@agoric/cosmic-proto": "0.5.0-u22.1",
|
|
44
|
+
"@agoric/ertp": "0.17.0-u22.1",
|
|
45
|
+
"@agoric/governance": "0.11.0-u22.1",
|
|
46
|
+
"@agoric/inter-protocol": "0.17.0-u22.1",
|
|
47
|
+
"@agoric/internal": "0.4.0-u22.1",
|
|
48
|
+
"@agoric/network": "0.2.0-u22.1",
|
|
49
|
+
"@agoric/smart-wallet": "0.6.0-u22.1",
|
|
50
|
+
"@agoric/store": "0.10.0-u22.1",
|
|
51
|
+
"@agoric/swingset-vat": "0.33.0-u22.1",
|
|
52
|
+
"@agoric/vats": "0.16.0-u22.1",
|
|
53
|
+
"@agoric/zoe": "0.27.0-u22.1",
|
|
54
|
+
"@agoric/zone": "0.3.0-u22.1",
|
|
55
|
+
"@cosmjs/crypto": "^0.36.0",
|
|
56
|
+
"@cosmjs/encoding": "^0.36.0",
|
|
57
|
+
"@cosmjs/math": "^0.36.0",
|
|
58
|
+
"@cosmjs/proto-signing": "^0.36.0",
|
|
59
|
+
"@cosmjs/stargate": "^0.36.0",
|
|
60
|
+
"@endo/base64": "^1.0.12",
|
|
61
|
+
"@endo/bundle-source": "^4.1.2",
|
|
62
|
+
"@endo/captp": "^4.4.8",
|
|
63
|
+
"@endo/compartment-mapper": "^1.6.3",
|
|
64
|
+
"@endo/env-options": "^1.1.11",
|
|
65
|
+
"@endo/errors": "^1.2.13",
|
|
66
|
+
"@endo/far": "^1.1.14",
|
|
67
|
+
"@endo/init": "^1.1.12",
|
|
68
|
+
"@endo/marshal": "^1.8.0",
|
|
69
|
+
"@endo/nat": "^5.1.3",
|
|
70
|
+
"@endo/patterns": "^1.7.0",
|
|
71
|
+
"@endo/promise-kit": "^1.1.13",
|
|
72
|
+
"@endo/zip": "^1.0.11",
|
|
73
73
|
"@iarna/toml": "^2.2.3",
|
|
74
74
|
"anylogger": "^0.21.0",
|
|
75
75
|
"chalk": "^5.2.0",
|
|
@@ -99,7 +99,10 @@
|
|
|
99
99
|
"workerThreads": false
|
|
100
100
|
},
|
|
101
101
|
"typeCoverage": {
|
|
102
|
-
"atLeast": 79.
|
|
102
|
+
"atLeast": 79.88
|
|
103
103
|
},
|
|
104
|
-
"
|
|
104
|
+
"engines": {
|
|
105
|
+
"node": "^20.9 || ^22.11"
|
|
106
|
+
},
|
|
107
|
+
"gitHead": "83a42d0f343b01448a918631dce159b5bdb69b7e"
|
|
105
108
|
}
|
package/src/chain-config.js
CHANGED
package/src/commands/wallet.js
CHANGED
|
@@ -68,7 +68,8 @@ export const makeWalletCommand = async command => {
|
|
|
68
68
|
)
|
|
69
69
|
.option('--spend', 'confirm you want to spend')
|
|
70
70
|
.option('--nickname <string>', 'nickname to use', 'my-wallet')
|
|
71
|
-
.action(function (opts) {
|
|
71
|
+
.action(async function (opts) {
|
|
72
|
+
await null;
|
|
72
73
|
/** @typedef {{account: string, spend?: boolean, nickname: 'my-wallet' | string }} Opts */
|
|
73
74
|
const {
|
|
74
75
|
account,
|
|
@@ -85,12 +86,12 @@ export const makeWalletCommand = async command => {
|
|
|
85
86
|
...networkConfig,
|
|
86
87
|
});
|
|
87
88
|
} else {
|
|
88
|
-
const params = fetchSwingsetParams(networkConfig);
|
|
89
|
+
const params = await fetchSwingsetParams(networkConfig);
|
|
89
90
|
assert(
|
|
90
|
-
params.
|
|
91
|
+
params.powerFlagFees.length === 1,
|
|
91
92
|
'multiple power_flag_fees not supported',
|
|
92
93
|
);
|
|
93
|
-
const { fee: fees } = params.
|
|
94
|
+
const { fee: fees } = params.powerFlagFees[0];
|
|
94
95
|
const nf = new Intl.NumberFormat('en-US');
|
|
95
96
|
const costs = fees
|
|
96
97
|
.map(f => `${nf.format(Number(f.amount))} ${f.denom}`)
|
package/src/deploy.js
CHANGED
|
@@ -190,6 +190,12 @@ const connectAndRun = async (
|
|
|
190
190
|
return retryWebsocket().then(() => exit.promise);
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
+
/**
|
|
194
|
+
* @param {string} progname
|
|
195
|
+
* @param {string[]} rawArgs
|
|
196
|
+
* @param {{ makeWebSocket?: (...args: ConstructorParameters<typeof WebSocket>) => WebSocket; anylogger: (name: string) => Console; now?: () => number; fs?: any; }} powers
|
|
197
|
+
* @param {{ allowUnsafePlugins: any; provide: string; sdk: any; need: string; hostport: string; target: string | number | undefined; scriptArgs: any; }} opts
|
|
198
|
+
*/
|
|
193
199
|
export default async function deployMain(progname, rawArgs, powers, opts) {
|
|
194
200
|
const { anylogger, now, fs } = powers;
|
|
195
201
|
const console = anylogger('agoric:deploy');
|
|
@@ -238,7 +244,7 @@ export default async function deployMain(progname, rawArgs, powers, opts) {
|
|
|
238
244
|
|
|
239
245
|
const match = opts.hostport.match(/^(.*):(\d+)$/);
|
|
240
246
|
const host = match ? match[1] : 'localhost';
|
|
241
|
-
const port = match ? match[2] :
|
|
247
|
+
const port = match ? +match[2] : 8000;
|
|
242
248
|
|
|
243
249
|
const wsurl = opts.hostport.includes('//')
|
|
244
250
|
? new URL(opts.hostport, 'ws://localhost:8000')
|
package/src/entrypoint.js
CHANGED
|
@@ -21,6 +21,7 @@ const log = anylogger('agoric');
|
|
|
21
21
|
const progname = path.basename(process.argv[1]);
|
|
22
22
|
|
|
23
23
|
const stdout = str => process.stdout.write(str);
|
|
24
|
+
/** @type {(...args: ConstructorParameters<typeof WebSocket>) => WebSocket} */
|
|
24
25
|
const makeWebSocket = (...args) => new WebSocket(...args);
|
|
25
26
|
|
|
26
27
|
const rawArgs = process.argv.slice(2);
|
package/src/lib/chain.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
/* eslint-env node */
|
|
3
3
|
import { normalizeBech32 } from '@cosmjs/encoding';
|
|
4
4
|
import { execFileSync as execFileSyncAmbient } from 'child_process';
|
|
5
|
+
import { makeAgoricQueryClient } from '@agoric/client-utils';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @import {MinimalNetworkConfig} from '@agoric/client-utils';
|
|
8
|
-
* @import {ParamsSDKType} from '@agoric/cosmic-proto/agoric/swingset/swingset.js';
|
|
9
|
+
* @import {Params, ParamsSDKType} from '@agoric/cosmic-proto/agoric/swingset/swingset.js';
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
const agdBinary = 'agd';
|
|
@@ -133,22 +134,12 @@ harden(execSwingsetTransaction);
|
|
|
133
134
|
/**
|
|
134
135
|
*
|
|
135
136
|
* @param {MinimalNetworkConfig} net
|
|
136
|
-
* @returns {
|
|
137
|
+
* @returns {Promise<Params>}
|
|
137
138
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const {
|
|
141
|
-
|
|
142
|
-
`--node=${rpcAddrs[0]}`,
|
|
143
|
-
`--chain-id=${chainName}`,
|
|
144
|
-
'query',
|
|
145
|
-
'swingset',
|
|
146
|
-
'params',
|
|
147
|
-
'--output',
|
|
148
|
-
'json',
|
|
149
|
-
];
|
|
150
|
-
const buffer = execFileSyncAmbient(agdBinary, cmd);
|
|
151
|
-
return JSON.parse(buffer.toString());
|
|
139
|
+
export const fetchSwingsetParams = async net => {
|
|
140
|
+
const client = await makeAgoricQueryClient(net);
|
|
141
|
+
const { params } = await client.agoric.swingset.params();
|
|
142
|
+
return params;
|
|
152
143
|
};
|
|
153
144
|
harden(fetchSwingsetParams);
|
|
154
145
|
|
|
@@ -172,9 +163,8 @@ export const pollBlocks = opts => async lookup => {
|
|
|
172
163
|
for (;;) {
|
|
173
164
|
const sTxt = execFileSync(agdBinary, ['status', ...nodeArgs]);
|
|
174
165
|
const status = JSON.parse(sTxt.toString());
|
|
175
|
-
const {
|
|
176
|
-
|
|
177
|
-
} = status;
|
|
166
|
+
const { latest_block_time: time, latest_block_height: height } =
|
|
167
|
+
status.sync_info || status.SyncInfo;
|
|
178
168
|
try {
|
|
179
169
|
// see await null above
|
|
180
170
|
const result = await lookup({ time, height });
|
|
@@ -200,7 +190,7 @@ export const pollBlocks = opts => async lookup => {
|
|
|
200
190
|
* }} opts
|
|
201
191
|
*/
|
|
202
192
|
export const pollTx = async (txhash, opts) => {
|
|
203
|
-
const { execFileSync, rpcAddrs
|
|
193
|
+
const { execFileSync, rpcAddrs } = opts;
|
|
204
194
|
|
|
205
195
|
const nodeArgs = [`--node=${rpcAddrs[0]}`];
|
|
206
196
|
const outJson = ['--output', 'json'];
|
|
@@ -208,14 +198,7 @@ export const pollTx = async (txhash, opts) => {
|
|
|
208
198
|
const lookup = async () => {
|
|
209
199
|
const out = execFileSync(
|
|
210
200
|
agdBinary,
|
|
211
|
-
[
|
|
212
|
-
'query',
|
|
213
|
-
'tx',
|
|
214
|
-
txhash,
|
|
215
|
-
`--chain-id=${chainName}`,
|
|
216
|
-
...nodeArgs,
|
|
217
|
-
...outJson,
|
|
218
|
-
],
|
|
201
|
+
['query', 'tx', txhash, ...nodeArgs, ...outJson],
|
|
219
202
|
{ stdio: ['ignore', 'pipe', 'pipe'] },
|
|
220
203
|
);
|
|
221
204
|
// XXX this type is defined in a .proto file somewhere
|
package/src/publish.js
CHANGED
|
@@ -15,7 +15,10 @@ import { defaultRegistryTypes } from '@cosmjs/stargate';
|
|
|
15
15
|
import { stringToPath } from '@cosmjs/crypto';
|
|
16
16
|
import { Decimal } from '@cosmjs/math';
|
|
17
17
|
import { fromBech32 } from '@cosmjs/encoding';
|
|
18
|
-
import {
|
|
18
|
+
import { CodecHelper } from '@agoric/cosmic-proto';
|
|
19
|
+
import { MsgInstallBundle as MsgInstallBundleType } from '@agoric/cosmic-proto/swingset/msgs.js';
|
|
20
|
+
|
|
21
|
+
const MsgInstallBundle = CodecHelper(MsgInstallBundleType);
|
|
19
22
|
|
|
20
23
|
// https://github.com/Agoric/agoric-sdk/blob/master/golang/cosmos/daemon/main.go
|
|
21
24
|
const Agoric = {
|
package/src/sdk-package-names.js
CHANGED
|
@@ -7,7 +7,9 @@ export default [
|
|
|
7
7
|
"@aglocal/fast-usdc-contract",
|
|
8
8
|
"@aglocal/fast-usdc-deploy",
|
|
9
9
|
"@aglocal/portfolio-contract",
|
|
10
|
+
"@aglocal/portfolio-deploy",
|
|
10
11
|
"@aglocal/swingset-runner",
|
|
12
|
+
"@aglocal/ymax-planner",
|
|
11
13
|
"@agoric/access-token",
|
|
12
14
|
"@agoric/async-flow",
|
|
13
15
|
"@agoric/base-zone",
|
|
@@ -32,6 +34,8 @@ export default [
|
|
|
32
34
|
"@agoric/notifier",
|
|
33
35
|
"@agoric/orchestration",
|
|
34
36
|
"@agoric/pegasus",
|
|
37
|
+
"@agoric/pola-io",
|
|
38
|
+
"@agoric/portfolio-api",
|
|
35
39
|
"@agoric/smart-wallet",
|
|
36
40
|
"@agoric/solo",
|
|
37
41
|
"@agoric/sparse-ints",
|