agoric 0.22.0-u21.0.1 → 0.22.0-u22.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agoric",
3
- "version": "0.22.0-u21.0.1",
3
+ "version": "0.22.0-u22.0",
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-u21.0.1",
34
- "@agoric/deploy-script-support": "0.10.4-u21.0.1",
33
+ "@agoric/cosmic-swingset": "0.42.0-u22.0",
34
+ "@agoric/deploy-script-support": "0.11.0-u22.0",
35
35
  "ava": "^5.3.0",
36
36
  "c8": "^10.1.2"
37
37
  },
38
38
  "dependencies": {
39
- "@agoric/access-token": "0.4.22-u21.0.1",
40
- "@agoric/cache": "0.3.3-u21.0.1",
41
- "@agoric/casting": "0.5.0-u21.0.1",
42
- "@agoric/client-utils": "0.2.0-u21.0.1",
43
- "@agoric/cosmic-proto": "0.5.0-u21.0.1",
44
- "@agoric/ertp": "0.16.3-u21.0.1",
45
- "@agoric/governance": "0.10.4-u21.0.1",
46
- "@agoric/inter-protocol": "0.17.0-u21.0.1",
47
- "@agoric/internal": "0.4.0-u21.0.1",
48
- "@agoric/network": "0.2.0-u21.0.1",
49
- "@agoric/smart-wallet": "0.5.4-u21.0.1",
50
- "@agoric/store": "0.9.3-u21.0.1",
51
- "@agoric/swingset-vat": "0.33.0-u21.0.1",
52
- "@agoric/vats": "0.16.0-u21.0.1",
53
- "@agoric/zoe": "0.27.0-u21.0.1",
54
- "@agoric/zone": "0.3.0-u21.0.1",
55
- "@cosmjs/crypto": "^0.33.0",
56
- "@cosmjs/encoding": "^0.33.0",
57
- "@cosmjs/math": "^0.33.0",
58
- "@cosmjs/proto-signing": "^0.33.0",
59
- "@cosmjs/stargate": "^0.33.0",
60
- "@endo/base64": "^1.0.9",
61
- "@endo/bundle-source": "^4.0.0",
62
- "@endo/captp": "^4.4.5",
63
- "@endo/compartment-mapper": "^1.6.0",
64
- "@endo/env-options": "^1.1.8",
65
- "@endo/errors": "^1.2.10",
66
- "@endo/far": "^1.1.11",
67
- "@endo/init": "^1.1.9",
68
- "@endo/marshal": "^1.6.4",
69
- "@endo/nat": "^5.1.0",
70
- "@endo/patterns": "^1.5.0",
71
- "@endo/promise-kit": "^1.1.10",
72
- "@endo/zip": "^1.0.9",
39
+ "@agoric/access-token": "0.4.22-u22.0",
40
+ "@agoric/cache": "0.4.0-u22.0",
41
+ "@agoric/casting": "0.5.0-u22.0",
42
+ "@agoric/client-utils": "0.2.0-u22.0",
43
+ "@agoric/cosmic-proto": "0.5.0-u22.0",
44
+ "@agoric/ertp": "0.17.0-u22.0",
45
+ "@agoric/governance": "0.11.0-u22.0",
46
+ "@agoric/inter-protocol": "0.17.0-u22.0",
47
+ "@agoric/internal": "0.4.0-u22.0",
48
+ "@agoric/network": "0.2.0-u22.0",
49
+ "@agoric/smart-wallet": "0.6.0-u22.0",
50
+ "@agoric/store": "0.10.0-u22.0",
51
+ "@agoric/swingset-vat": "0.33.0-u22.0",
52
+ "@agoric/vats": "0.16.0-u22.0",
53
+ "@agoric/zoe": "0.27.0-u22.0",
54
+ "@agoric/zone": "0.3.0-u22.0",
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.15
102
+ "atLeast": 79.88
103
103
  },
104
- "gitHead": "f5318add2db0f254e5647374088bb7ae350ad3fa"
104
+ "engines": {
105
+ "node": "^20.9 || ^22.11"
106
+ },
107
+ "gitHead": "dbf78c32d14bf4a38bfd7a10d061011a0ff368e6"
105
108
  }
@@ -132,6 +132,7 @@ export function finishCosmosApp({
132
132
 
133
133
  // Optionally enable the rosetta service
134
134
  if (enableRosetta) {
135
+ app.rosetta ||= {};
135
136
  app.rosetta.enable = enableRosetta;
136
137
  app.rosetta.network = chainId;
137
138
  app.rosetta.retries = 30;
@@ -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.power_flag_fees.length === 1,
91
+ params.powerFlagFees.length === 1,
91
92
  'multiple power_flag_fees not supported',
92
93
  );
93
- const { fee: fees } = params.power_flag_fees[0];
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] : '8000';
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 {ParamsSDKType}
137
+ * @returns {Promise<Params>}
137
138
  */
138
- // TODO fetch by HTTP instead of shelling out https://github.com/Agoric/agoric-sdk/issues/9200
139
- export const fetchSwingsetParams = net => {
140
- const { chainName, rpcAddrs } = net;
141
- const cmd = [
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
- SyncInfo: { latest_block_time: time, latest_block_height: height },
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, chainName } = opts;
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 { MsgInstallBundle } from '@agoric/cosmic-proto/swingset/msgs.js';
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 = {
@@ -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",
package/src/start.js CHANGED
@@ -597,7 +597,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
597
597
  'swingset',
598
598
  'egress',
599
599
  soloAddr,
600
- `--chain-id=${CHAIN_ID}`,
601
600
  `--node=tcp://${rpcAddr}`,
602
601
  ]);
603
602
  if (exitStatus) {