agoric 0.21.2-dev-4c9a859.0 → 0.21.2-dev-e468caa.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 +20 -20
- package/src/commands/wallet.js +5 -6
- package/src/lib/chain.js +14 -10
- package/src/publish.js +11 -3
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-e468caa.0+e468caa",
|
|
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-e468caa.0+e468caa",
|
|
33
|
+
"@agoric/deploy-script-support": "0.10.4-dev-e468caa.0+e468caa",
|
|
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/assert": "0.6.1-dev-
|
|
41
|
-
"@agoric/cache": "0.3.3-dev-
|
|
42
|
-
"@agoric/casting": "0.4.3-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-e468caa.0+e468caa",
|
|
40
|
+
"@agoric/assert": "0.6.1-dev-e468caa.0+e468caa",
|
|
41
|
+
"@agoric/cache": "0.3.3-dev-e468caa.0+e468caa",
|
|
42
|
+
"@agoric/casting": "0.4.3-dev-e468caa.0+e468caa",
|
|
43
|
+
"@agoric/cosmic-proto": "0.4.1-dev-e468caa.0+e468caa",
|
|
44
|
+
"@agoric/ertp": "0.16.3-dev-e468caa.0+e468caa",
|
|
45
|
+
"@agoric/governance": "0.10.4-dev-e468caa.0+e468caa",
|
|
46
|
+
"@agoric/inter-protocol": "0.16.2-dev-e468caa.0+e468caa",
|
|
47
|
+
"@agoric/internal": "0.3.3-dev-e468caa.0+e468caa",
|
|
48
|
+
"@agoric/network": "0.1.1-dev-e468caa.0+e468caa",
|
|
49
|
+
"@agoric/smart-wallet": "0.5.4-dev-e468caa.0+e468caa",
|
|
50
|
+
"@agoric/store": "0.9.3-dev-e468caa.0+e468caa",
|
|
51
|
+
"@agoric/swingset-vat": "0.32.3-dev-e468caa.0+e468caa",
|
|
52
|
+
"@agoric/vats": "0.15.2-dev-e468caa.0+e468caa",
|
|
53
|
+
"@agoric/zoe": "0.26.3-dev-e468caa.0+e468caa",
|
|
54
|
+
"@agoric/zone": "0.2.3-dev-e468caa.0+e468caa",
|
|
55
55
|
"@confio/relayer": "^0.11.3",
|
|
56
56
|
"@cosmjs/crypto": "^0.32.3",
|
|
57
57
|
"@cosmjs/encoding": "^0.32.3",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"typeCoverage": {
|
|
101
101
|
"atLeast": 77.12
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "e468caafe7b1bb0a4b105d2acadb30874c5c30d5"
|
|
104
104
|
}
|
package/src/commands/wallet.js
CHANGED
|
@@ -50,11 +50,10 @@ export const makeWalletCommand = async command => {
|
|
|
50
50
|
)
|
|
51
51
|
.option('--spend', 'confirm you want to spend')
|
|
52
52
|
.option('--nickname <string>', 'nickname to use', 'my-wallet')
|
|
53
|
-
.action(
|
|
53
|
+
.action(function (opts) {
|
|
54
54
|
const { account, nickname, spend } = opts;
|
|
55
55
|
const { home, keyringBackend: backend } = wallet.opts();
|
|
56
56
|
const tx = ['provision-one', nickname, account, 'SMART_WALLET'];
|
|
57
|
-
await null;
|
|
58
57
|
if (spend) {
|
|
59
58
|
execSwingsetTransaction(tx, {
|
|
60
59
|
from: account,
|
|
@@ -62,12 +61,12 @@ export const makeWalletCommand = async command => {
|
|
|
62
61
|
...networkConfig,
|
|
63
62
|
});
|
|
64
63
|
} else {
|
|
65
|
-
const params =
|
|
64
|
+
const params = fetchSwingsetParams(networkConfig);
|
|
66
65
|
assert(
|
|
67
|
-
params.
|
|
68
|
-
'multiple
|
|
66
|
+
params.power_flag_fees.length === 1,
|
|
67
|
+
'multiple power_flag_fees not supported',
|
|
69
68
|
);
|
|
70
|
-
const { fee: fees } = params.
|
|
69
|
+
const { fee: fees } = params.power_flag_fees[0];
|
|
71
70
|
const nf = new Intl.NumberFormat('en-US');
|
|
72
71
|
const costs = fees
|
|
73
72
|
.map(f => `${nf.format(Number(f.amount))} ${f.denom}`)
|
package/src/lib/chain.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
/* global process */
|
|
3
|
-
import { agoric } from '@agoric/cosmic-proto';
|
|
4
3
|
import { normalizeBech32 } from '@cosmjs/encoding';
|
|
5
4
|
import { execFileSync as execFileSyncAmbient } from 'child_process';
|
|
6
5
|
|
|
@@ -96,16 +95,21 @@ harden(execSwingsetTransaction);
|
|
|
96
95
|
/**
|
|
97
96
|
*
|
|
98
97
|
* @param {import('./rpc.js').MinimalNetworkConfig} net
|
|
99
|
-
* @returns {Promise<import('@agoric/cosmic-proto/swingset/swingset.js').Params>}
|
|
100
98
|
*/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
// TODO fetch by HTTP instead of shelling out https://github.com/Agoric/agoric-sdk/issues/9200
|
|
100
|
+
export const fetchSwingsetParams = net => {
|
|
101
|
+
const { chainName, rpcAddrs } = net;
|
|
102
|
+
const cmd = [
|
|
103
|
+
`--node=${rpcAddrs[0]}`,
|
|
104
|
+
`--chain-id=${chainName}`,
|
|
105
|
+
'query',
|
|
106
|
+
'swingset',
|
|
107
|
+
'params',
|
|
108
|
+
'--output',
|
|
109
|
+
'json',
|
|
110
|
+
];
|
|
111
|
+
const buffer = execFileSyncAmbient(agdBinary, cmd);
|
|
112
|
+
return JSON.parse(buffer.toString());
|
|
109
113
|
};
|
|
110
114
|
harden(fetchSwingsetParams);
|
|
111
115
|
|
package/src/publish.js
CHANGED
|
@@ -9,12 +9,14 @@ import {
|
|
|
9
9
|
makeLeaderFromRpcAddresses,
|
|
10
10
|
makeCastingSpec,
|
|
11
11
|
} from '@agoric/casting';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { DirectSecp256k1HdWallet, Registry } from '@cosmjs/proto-signing';
|
|
13
|
+
import { defaultRegistryTypes } from '@cosmjs/stargate';
|
|
14
14
|
import { stringToPath } from '@cosmjs/crypto';
|
|
15
15
|
import { Decimal } from '@cosmjs/math';
|
|
16
16
|
import { fromBech32 } from '@cosmjs/encoding';
|
|
17
17
|
|
|
18
|
+
import { MsgInstallBundle } from '@agoric/cosmic-proto/swingset/msgs.js';
|
|
19
|
+
|
|
18
20
|
// https://github.com/Agoric/agoric-sdk/blob/master/golang/cosmos/daemon/main.go
|
|
19
21
|
const Agoric = {
|
|
20
22
|
Bech32MainPrefix: 'agoric',
|
|
@@ -36,6 +38,12 @@ const Agoric = {
|
|
|
36
38
|
const hdPath = (coinType = 118, account = 0) =>
|
|
37
39
|
stringToPath(`m/44'/${coinType}'/${account}'/0/0`);
|
|
38
40
|
|
|
41
|
+
// @ts-expect-error difference in private property _push
|
|
42
|
+
const registry = new Registry([
|
|
43
|
+
...defaultRegistryTypes,
|
|
44
|
+
[Agoric.proto.swingset.InstallBundle.typeUrl, MsgInstallBundle],
|
|
45
|
+
]);
|
|
46
|
+
|
|
39
47
|
/**
|
|
40
48
|
* @typedef {object} JsonHttpRequest
|
|
41
49
|
* @property {string} hostname
|
|
@@ -281,8 +289,8 @@ export const makeCosmosBundlePublisher = ({
|
|
|
281
289
|
|
|
282
290
|
// AWAIT
|
|
283
291
|
const stargateClient = await connectWithSigner(endpoint, wallet, {
|
|
284
|
-
...getSigningAgoricClientOptions(),
|
|
285
292
|
gasPrice: Agoric.gasPrice,
|
|
293
|
+
registry,
|
|
286
294
|
});
|
|
287
295
|
|
|
288
296
|
// AWAIT
|