agoric 0.21.2-dev-763bc10.0.763bc10 → 0.21.2-dev-bcbee89.0.bcbee89

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.21.2-dev-763bc10.0.763bc10",
3
+ "version": "0.21.2-dev-bcbee89.0.bcbee89",
4
4
  "description": "Manage the Agoric Javascript smart contract platform",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
@@ -30,28 +30,28 @@
30
30
  "lint:eslint": "yarn run -T eslint ."
31
31
  },
32
32
  "devDependencies": {
33
- "@agoric/cosmic-swingset": "0.41.4-dev-763bc10.0.763bc10",
34
- "@agoric/deploy-script-support": "0.10.4-dev-763bc10.0.763bc10",
33
+ "@agoric/cosmic-swingset": "0.41.4-dev-bcbee89.0.bcbee89",
34
+ "@agoric/deploy-script-support": "0.10.4-dev-bcbee89.0.bcbee89",
35
35
  "ava": "^5.3.0",
36
36
  "c8": "^10.1.2"
37
37
  },
38
38
  "dependencies": {
39
- "@agoric/access-token": "0.4.22-dev-763bc10.0.763bc10",
40
- "@agoric/cache": "0.3.3-dev-763bc10.0.763bc10",
41
- "@agoric/casting": "0.4.3-dev-763bc10.0.763bc10",
42
- "@agoric/client-utils": "0.1.1-dev-763bc10.0.763bc10",
43
- "@agoric/cosmic-proto": "0.4.1-dev-763bc10.0.763bc10",
44
- "@agoric/ertp": "0.16.3-dev-763bc10.0.763bc10",
45
- "@agoric/governance": "0.10.4-dev-763bc10.0.763bc10",
46
- "@agoric/inter-protocol": "0.16.2-dev-763bc10.0.763bc10",
47
- "@agoric/internal": "0.3.3-dev-763bc10.0.763bc10",
48
- "@agoric/network": "0.1.1-dev-763bc10.0.763bc10",
49
- "@agoric/smart-wallet": "0.5.4-dev-763bc10.0.763bc10",
50
- "@agoric/store": "0.9.3-dev-763bc10.0.763bc10",
51
- "@agoric/swingset-vat": "0.32.3-dev-763bc10.0.763bc10",
52
- "@agoric/vats": "0.15.2-dev-763bc10.0.763bc10",
53
- "@agoric/zoe": "0.26.3-dev-763bc10.0.763bc10",
54
- "@agoric/zone": "0.2.3-dev-763bc10.0.763bc10",
39
+ "@agoric/access-token": "0.4.22-dev-bcbee89.0.bcbee89",
40
+ "@agoric/cache": "0.3.3-dev-bcbee89.0.bcbee89",
41
+ "@agoric/casting": "0.4.3-dev-bcbee89.0.bcbee89",
42
+ "@agoric/client-utils": "0.1.1-dev-bcbee89.0.bcbee89",
43
+ "@agoric/cosmic-proto": "0.4.1-dev-bcbee89.0.bcbee89",
44
+ "@agoric/ertp": "0.16.3-dev-bcbee89.0.bcbee89",
45
+ "@agoric/governance": "0.10.4-dev-bcbee89.0.bcbee89",
46
+ "@agoric/inter-protocol": "0.16.2-dev-bcbee89.0.bcbee89",
47
+ "@agoric/internal": "0.3.3-dev-bcbee89.0.bcbee89",
48
+ "@agoric/network": "0.1.1-dev-bcbee89.0.bcbee89",
49
+ "@agoric/smart-wallet": "0.5.4-dev-bcbee89.0.bcbee89",
50
+ "@agoric/store": "0.9.3-dev-bcbee89.0.bcbee89",
51
+ "@agoric/swingset-vat": "0.32.3-dev-bcbee89.0.bcbee89",
52
+ "@agoric/vats": "0.15.2-dev-bcbee89.0.bcbee89",
53
+ "@agoric/zoe": "0.26.3-dev-bcbee89.0.bcbee89",
54
+ "@agoric/zone": "0.2.3-dev-bcbee89.0.bcbee89",
55
55
  "@cosmjs/crypto": "^0.36.0",
56
56
  "@cosmjs/encoding": "^0.36.0",
57
57
  "@cosmjs/math": "^0.36.0",
@@ -101,5 +101,5 @@
101
101
  "typeCoverage": {
102
102
  "atLeast": 79.88
103
103
  },
104
- "gitHead": "763bc10a6a843acfcee39f347957e56be7b58134"
104
+ "gitHead": "bcbee89fe2847f2d51784fb3e645fe8da8035a49"
105
105
  }
@@ -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/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