Comparing version
{ | ||
"name": "agoric", | ||
"version": "0.21.2-dev-e596a01.0+e596a01", | ||
"version": "0.21.2-dev-e5a1afd.0+e5a1afd", | ||
"description": "Manage the Agoric Javascript smart contract platform", | ||
@@ -33,42 +33,40 @@ "type": "module", | ||
"devDependencies": { | ||
"@agoric/cosmic-swingset": "0.41.4-dev-e596a01.0+e596a01", | ||
"@agoric/deploy-script-support": "0.10.4-dev-e596a01.0+e596a01", | ||
"@agoric/cosmic-swingset": "0.41.4-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/deploy-script-support": "0.10.4-dev-e5a1afd.0+e5a1afd", | ||
"ava": "^5.3.0", | ||
"c8": "^10.1.2", | ||
"dd-trace": "^4.11.1" | ||
"c8": "^10.1.2" | ||
}, | ||
"dependencies": { | ||
"@agoric/access-token": "0.4.22-dev-e596a01.0+e596a01", | ||
"@agoric/cache": "0.3.3-dev-e596a01.0+e596a01", | ||
"@agoric/casting": "0.4.3-dev-e596a01.0+e596a01", | ||
"@agoric/client-utils": "0.1.1-dev-e596a01.0+e596a01", | ||
"@agoric/cosmic-proto": "0.4.1-dev-e596a01.0+e596a01", | ||
"@agoric/ertp": "0.16.3-dev-e596a01.0+e596a01", | ||
"@agoric/governance": "0.10.4-dev-e596a01.0+e596a01", | ||
"@agoric/inter-protocol": "0.16.2-dev-e596a01.0+e596a01", | ||
"@agoric/internal": "0.3.3-dev-e596a01.0+e596a01", | ||
"@agoric/network": "0.1.1-dev-e596a01.0+e596a01", | ||
"@agoric/smart-wallet": "0.5.4-dev-e596a01.0+e596a01", | ||
"@agoric/store": "0.9.3-dev-e596a01.0+e596a01", | ||
"@agoric/swingset-vat": "0.32.3-dev-e596a01.0+e596a01", | ||
"@agoric/vats": "0.15.2-dev-e596a01.0+e596a01", | ||
"@agoric/zoe": "0.26.3-dev-e596a01.0+e596a01", | ||
"@agoric/zone": "0.2.3-dev-e596a01.0+e596a01", | ||
"@confio/relayer": "^0.11.3", | ||
"@cosmjs/crypto": "^0.32.3", | ||
"@cosmjs/encoding": "^0.32.3", | ||
"@cosmjs/math": "^0.32.3", | ||
"@cosmjs/proto-signing": "^0.32.3", | ||
"@cosmjs/stargate": "^0.32.3", | ||
"@endo/bundle-source": "^3.5.0", | ||
"@endo/captp": "^4.4.3", | ||
"@endo/compartment-mapper": "^1.4.0", | ||
"@agoric/access-token": "0.4.22-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/cache": "0.3.3-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/casting": "0.4.3-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/client-utils": "0.1.1-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/cosmic-proto": "0.4.1-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/ertp": "0.16.3-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/governance": "0.10.4-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/inter-protocol": "0.16.2-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/internal": "0.3.3-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/network": "0.1.1-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/smart-wallet": "0.5.4-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/store": "0.9.3-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/swingset-vat": "0.32.3-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/vats": "0.15.2-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/zoe": "0.26.3-dev-e5a1afd.0+e5a1afd", | ||
"@agoric/zone": "0.2.3-dev-e5a1afd.0+e5a1afd", | ||
"@cosmjs/crypto": "^0.33.0", | ||
"@cosmjs/encoding": "^0.33.0", | ||
"@cosmjs/math": "^0.33.0", | ||
"@cosmjs/proto-signing": "^0.33.0", | ||
"@cosmjs/stargate": "^0.33.0", | ||
"@endo/bundle-source": "^3.5.1", | ||
"@endo/captp": "^4.4.4", | ||
"@endo/compartment-mapper": "^1.5.0", | ||
"@endo/env-options": "^1.1.8", | ||
"@endo/errors": "^1.2.8", | ||
"@endo/far": "^1.1.9", | ||
"@endo/init": "^1.1.7", | ||
"@endo/marshal": "^1.6.2", | ||
"@endo/nat": "^5.0.13", | ||
"@endo/patterns": "^1.4.7", | ||
"@endo/promise-kit": "^1.1.8", | ||
"@endo/errors": "^1.2.9", | ||
"@endo/far": "^1.1.10", | ||
"@endo/init": "^1.1.8", | ||
"@endo/marshal": "^1.6.3", | ||
"@endo/nat": "^5.0.14", | ||
"@endo/patterns": "^1.4.8", | ||
"@endo/promise-kit": "^1.1.9", | ||
"@endo/zip": "^1.0.9", | ||
@@ -105,5 +103,5 @@ "@iarna/toml": "^2.2.3", | ||
"typeCoverage": { | ||
"atLeast": 77.54 | ||
"atLeast": 78.96 | ||
}, | ||
"gitHead": "e596a010f6b0885db9f8a8aa1cc4cb2f232e8f91" | ||
"gitHead": "e5a1afd8f59d7ba56e618657059caee05096f220" | ||
} |
@@ -5,75 +5,2 @@ # Agoric CLI | ||
## Relaying via IBC | ||
The CLI integrates support for the [Confio | ||
ts-relayer](https://github.com/confio/ts-relayer#quick-start) via the | ||
`agoric ibc-setup` and `agoric ibc-relayer` commands. | ||
Run `agoric start --reset -v local-chain` in a project directory. In the | ||
meantime, you can configure the relayer (note that `--registry-from .` means to use `./registry.yaml`): | ||
```console | ||
$ agoric ibc-setup init --registry-from . --src local --dest ollinet | ||
... | ||
$ agoric ibc-setup keys list | ||
ollinet: agoric1fwk40de0xu7gtlk8z858q2f5lfcqv33ml8qdg4 | ||
local: agoric1rvyry6jqmcrrm4ay9tu23rer7que8kdj4206zk | ||
$ | ||
``` | ||
Once your chain has booted, send some `uist` tokens to your `local` relayer | ||
account printed above: | ||
```console | ||
$ agd --home=_agstate/keys tx --keyring-backend=test bank send provision agoric1rvyry6jqmcrrm4ay9tu23rer7que8kdj4206zk 20000000uist --from=provision --chain-id=agoriclocal --yes | ||
... | ||
$ | ||
``` | ||
Go to https://ollinet.faucet.agoric.net and fund your `ollinet` relayer account | ||
printed above with BLD/IBC toy tokens. | ||
Check your relayer balances. Both `local` and `ollinet` relayer accounts should | ||
show `ubld` and `uist`: | ||
```console | ||
$ agoric ibc-setup balances | ||
CHAIN AMOUNT | ||
ollinet 74972124ubld | ||
local 20000000uist | ||
$ | ||
``` | ||
Create an ICS-20 fungible token transfer channel: | ||
```console | ||
$ agoric ibc-setup ics20 -v | ||
... | ||
Created channel: | ||
agoriclocal: transfer/channel-0 (connection-0) | ||
agoricollinet-55: transfer/channel-33 (connection-12) | ||
$ | ||
``` | ||
Now that the channel exists, you can relay packets along it just by using: | ||
```console | ||
$ agoric ibc-relayer start -v --poll 15 | ||
``` | ||
Leave this running in the background, and use the above `transfer/channel-0` or | ||
`transfer/channel-33` to send tokens back and forth. The following | ||
example uses the `tx ibc-transfer transfer` command, and then | ||
`transfer channel-0` to indicate the `transfer/channel-0` portID/channelID. It really wants you to know this is about token *transfer*. | ||
```console | ||
$ agd --home=_agstate/keys tx ibc-transfer transfer --keyring-backend=test \ | ||
transfer channel-0 \ | ||
agoric1fwk40de0xu7gtlk8z858q2f5lfcqv33ml8qdg4 200uist \ | ||
--from=provision --chain-id=agoriclocal --yes | ||
... | ||
# Watch the ibc-relayer send a packet and its acknowledgement, then... | ||
$ agd query bank balances agoric1rvyry6jqmcrrm4ay9tu23rer7que8kdj4206zk | ||
``` | ||
## Developing Agoric CLI | ||
@@ -80,0 +7,0 @@ |
@@ -33,3 +33,2 @@ #!/usr/bin/env node | ||
program.addCommand(makeOracleCommand(logger)); | ||
program.addCommand(makeGovCommand(logger)); | ||
@@ -73,2 +72,3 @@ program.addCommand(makePerfCommand(logger)); | ||
program.addCommand(makeOracleCommand(procIO, logger)); | ||
program.addCommand(makeReserveCommand(logger, procIO)); | ||
@@ -75,0 +75,0 @@ program.addCommand(makeAuctionCommand(logger, { ...procIO, fetch })); |
// @ts-check | ||
/* eslint-env node */ | ||
import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils'; | ||
import { | ||
fetchEnvNetworkConfig, | ||
makeAgoricNames, | ||
makeVstorageKit, | ||
} from '@agoric/client-utils'; | ||
import { Fail } from '@endo/errors'; | ||
@@ -91,6 +95,7 @@ import { InvalidArgumentError } from 'commander'; | ||
async opts => { | ||
const { agoricNames, readPublished } = await makeVstorageKit( | ||
const { readPublished, ...vsk } = makeVstorageKit( | ||
{ fetch }, | ||
networkConfig, | ||
); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
@@ -97,0 +102,0 @@ const { current } = await readPublished(`auction.governance`); |
// @ts-check | ||
/* eslint-disable func-names */ | ||
/* eslint-env node */ | ||
import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils'; | ||
import { | ||
fetchEnvNetworkConfig, | ||
makeAgoricNames, | ||
makeVstorageKit, | ||
} from '@agoric/client-utils'; | ||
import { execFileSync as execFileSyncAmbient } from 'child_process'; | ||
@@ -17,4 +21,6 @@ import { Command, CommanderError } from 'commander'; | ||
/** | ||
* @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js' | ||
* @import {QuestionDetails} from '@agoric/governance/src/types.js' | ||
* @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js'; | ||
* @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js'; | ||
* @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js'; | ||
* @import {VstorageKit} from '@agoric/client-utils'; | ||
*/ | ||
@@ -89,3 +95,3 @@ | ||
* @param {{ | ||
* toOffer: (agoricNames: *, current: import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord | undefined) => OfferSpec, | ||
* toOffer: (agoricNames: AgoricNamesRemotes, current: CurrentWalletRecord | undefined) => OfferSpec, | ||
* sendFrom?: string | undefined, | ||
@@ -95,10 +101,12 @@ * keyringBackend: string, | ||
* }} detail | ||
* @param {Awaited<ReturnType<makeVstorageKit>>} [optUtils] | ||
* @param {VstorageKit} [vsk] | ||
*/ | ||
const processOffer = async function ( | ||
{ toOffer, sendFrom, keyringBackend }, | ||
optUtils, | ||
vsk, | ||
) { | ||
const utils = await (optUtils || makeVstorageKit({ fetch }, networkConfig)); | ||
const { agoricNames, readPublished } = utils; | ||
await null; | ||
vsk ||= makeVstorageKit({ fetch }, networkConfig); | ||
const { readPublished } = vsk; | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
@@ -270,6 +278,7 @@ assert(keyringBackend, 'missing keyring-backend option'); | ||
.action(async opts => { | ||
const { agoricNames, readPublished } = await makeVstorageKit( | ||
const { readPublished, ...vsk } = makeVstorageKit( | ||
{ fetch }, | ||
networkConfig, | ||
); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
const current = await getCurrent(opts.from, { readPublished }); | ||
@@ -300,6 +309,7 @@ | ||
.action(async opts => { | ||
const { agoricNames, readPublished } = await makeVstorageKit( | ||
const { readPublished, ...vsk } = makeVstorageKit( | ||
{ fetch }, | ||
networkConfig, | ||
); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
const current = await getCurrent(opts.from, { readPublished }); | ||
@@ -340,4 +350,4 @@ | ||
.action(async function (opts, options) { | ||
const utils = await makeVstorageKit({ fetch }, networkConfig); | ||
const { readPublished } = utils; | ||
const vsk = makeVstorageKit({ fetch }, networkConfig); | ||
const { readPublished } = vsk; | ||
@@ -392,3 +402,3 @@ const questionDesc = await readPublished( | ||
}, | ||
utils, | ||
vsk, | ||
); | ||
@@ -395,0 +405,0 @@ }); |
@@ -6,2 +6,3 @@ // @ts-check | ||
fetchEnvNetworkConfig, | ||
makeAgoricNames, | ||
makeVstorageKit, | ||
@@ -15,3 +16,2 @@ makeWalletUtils, | ||
import { Nat } from '@endo/nat'; | ||
import * as cp from 'child_process'; | ||
import { Command } from 'commander'; | ||
@@ -32,3 +32,4 @@ import { inspect } from 'util'; | ||
const COSMOS_UNIT = 1_000_000n; | ||
const scaleDecimals = num => BigInt(num * Number(COSMOS_UNIT)); | ||
/** @param {number} num */ | ||
const scaleDecimals = num => BigInt(Math.round(num * Number(COSMOS_UNIT))); | ||
@@ -38,17 +39,23 @@ /** | ||
* | ||
* @param {import('anylogger').Logger} logger | ||
* @param {{ | ||
* delay?: (ms: number) => Promise<void>, | ||
* execFileSync?: typeof import('child_process').execFileSync, | ||
* env?: Record<string, string | undefined>, | ||
* stdout?: Pick<import('stream').Writable,'write'>, | ||
* }} [io] | ||
* createCommand: typeof import('commander').createCommand, | ||
* env: Partial<Record<string, string>>, | ||
* execFileSync: typeof import('child_process').execFileSync, | ||
* now: () => number, | ||
* setTimeout: typeof setTimeout, | ||
* stderr: Pick<import('stream').Writable,'write'>, | ||
* stdout: Pick<import('stream').Writable,'write'>, | ||
* }} process | ||
* @param {import('anylogger').Logger} [logger] | ||
*/ | ||
export const makeOracleCommand = (logger, io = {}) => { | ||
const { | ||
delay = ms => new Promise(resolve => setTimeout(resolve, ms)), | ||
execFileSync = cp.execFileSync, | ||
env = process.env, | ||
stdout = process.stdout, | ||
} = io; | ||
export const makeOracleCommand = ( | ||
{ env, execFileSync, setTimeout, stderr, stdout }, | ||
logger, | ||
) => { | ||
/** | ||
* @param {number} ms | ||
* @returns {Promise<void>} | ||
*/ | ||
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | ||
const oracle = new Command('oracle') | ||
@@ -97,9 +104,10 @@ .description('Oracle commands') | ||
}); | ||
const utils = await makeVstorageKit({ fetch }, networkConfig); | ||
const vsk = makeVstorageKit({ fetch }, networkConfig); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
const lookupPriceAggregatorInstance = ([brandIn, brandOut]) => { | ||
const name = oracleBrandFeedName(brandIn, brandOut); | ||
const instance = utils.agoricNames.instance[name]; | ||
const instance = agoricNames.instance[name]; | ||
if (!instance) { | ||
logger.debug('known instances:', utils.agoricNames.instance); | ||
logger && logger.debug('known instances:', agoricNames.instance); | ||
throw Error(`Unknown instance ${name}`); | ||
@@ -110,3 +118,3 @@ } | ||
return { ...utils, networkConfig, lookupPriceAggregatorInstance }; | ||
return { ...vsk, networkConfig, lookupPriceAggregatorInstance }; | ||
}; | ||
@@ -144,8 +152,11 @@ | ||
outputAction({ | ||
method: 'executeOffer', | ||
offer, | ||
}); | ||
outputAction( | ||
{ | ||
method: 'executeOffer', | ||
offer, | ||
}, | ||
stdout, | ||
); | ||
console.warn(sendHint); | ||
stderr.write(sendHint); | ||
}); | ||
@@ -180,8 +191,11 @@ | ||
outputAction({ | ||
method: 'executeOffer', | ||
offer, | ||
}); | ||
outputAction( | ||
{ | ||
method: 'executeOffer', | ||
offer, | ||
}, | ||
stdout, | ||
); | ||
console.warn(sendHint); | ||
stderr.write(sendHint); | ||
}); | ||
@@ -297,3 +311,3 @@ | ||
const viewer = `https://vstorage.agoric.net/#${networkConfig.rpcAddrs[0]}|published,published.priceFeed|${feedPath}`; | ||
console.warn(`no existing price data; see ${viewer}`); | ||
stderr.write(`no existing price data; see ${viewer}`); | ||
return undefined; | ||
@@ -343,3 +357,3 @@ }) | ||
]).catch(err => { | ||
console.warn(err); | ||
stderr.write(err); | ||
}); | ||
@@ -346,0 +360,0 @@ } |
@@ -6,2 +6,3 @@ // @ts-check | ||
fetchEnvNetworkConfig, | ||
makeAgoricNames, | ||
makeVstorageKit, | ||
@@ -70,9 +71,10 @@ storageHelper, | ||
const rpcTools = async () => { | ||
const utils = await makeVstorageKit({ fetch }, networkConfig); | ||
const vsk = await makeVstorageKit({ fetch }, networkConfig); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
const lookupPsmInstance = ([minted, anchor]) => { | ||
const name = `psm-${minted}-${anchor}`; | ||
const instance = utils.agoricNames.instance[name]; | ||
const instance = agoricNames.instance[name]; | ||
if (!instance) { | ||
logger.debug('known instances:', utils.agoricNames.instance); | ||
logger.debug('known instances:', agoricNames.instance); | ||
throw Error(`Unknown instance ${name}`); | ||
@@ -88,3 +90,3 @@ } | ||
const getGovernanceState = async ([Minted, Anchor]) => { | ||
const govContent = await utils.vstorage.readLatest( | ||
const govContent = await vsk.vstorage.readLatest( | ||
`published.psm.${Minted}.${Anchor}.governance`, | ||
@@ -94,6 +96,5 @@ ); | ||
const { current: governance } = last( | ||
storageHelper.unserializeTxt(govContent, utils.fromBoard), | ||
storageHelper.unserializeTxt(govContent, vsk.fromBoard), | ||
); | ||
const { [`psm.${Minted}.${Anchor}`]: instance } = | ||
utils.agoricNames.instance; | ||
const { [`psm.${Minted}.${Anchor}`]: instance } = agoricNames.instance; | ||
@@ -103,3 +104,3 @@ return { instance, governance }; | ||
return { ...utils, lookupPsmInstance, getGovernanceState }; | ||
return { ...vsk, agoricNames, lookupPsmInstance, getGovernanceState }; | ||
}; | ||
@@ -106,0 +107,0 @@ |
// @ts-check | ||
/* eslint-disable func-names */ | ||
/* eslint-env node */ | ||
import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils'; | ||
import { | ||
fetchEnvNetworkConfig, | ||
makeAgoricNames, | ||
makeVstorageKit, | ||
} from '@agoric/client-utils'; | ||
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js'; | ||
@@ -34,3 +38,4 @@ import { Command } from 'commander'; | ||
async ({ collateralBrand, ...opts }) => { | ||
const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig); | ||
const vsk = makeVstorageKit({ fetch }, networkConfig); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
@@ -69,3 +74,4 @@ const offer = Offers.reserve.AddCollateral(agoricNames, { | ||
.action(async function (opts) { | ||
const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig); | ||
const vsk = makeVstorageKit({ fetch }, networkConfig); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
@@ -72,0 +78,0 @@ const reserveInstance = agoricNames.instance.reserve; |
// @ts-check | ||
/* eslint-disable func-names */ | ||
/* eslint-env node */ | ||
import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils'; | ||
import { | ||
fetchEnvNetworkConfig, | ||
makeAgoricNames, | ||
makeVstorageKit, | ||
} from '@agoric/client-utils'; | ||
import { | ||
lookupOfferIdForVault, | ||
@@ -66,3 +70,4 @@ Offers, | ||
logger.warn('running with options', opts); | ||
const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig); | ||
const vsk = makeVstorageKit({ fetch }, networkConfig); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
@@ -102,6 +107,7 @@ const offer = Offers.vaults.OpenVault(agoricNames, { | ||
logger.warn('running with options', opts); | ||
const { agoricNames, readPublished } = await makeVstorageKit( | ||
const { readPublished, ...vsk } = makeVstorageKit( | ||
{ fetch }, | ||
networkConfig, | ||
); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
@@ -147,6 +153,7 @@ const previousOfferId = await lookupOfferIdForVault( | ||
logger.warn('running with options', opts); | ||
const { agoricNames, readPublished } = await makeVstorageKit( | ||
const { readPublished, ...vsk } = makeVstorageKit( | ||
{ fetch }, | ||
networkConfig, | ||
); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
@@ -153,0 +160,0 @@ const previousOfferId = await lookupOfferIdForVault( |
@@ -11,3 +11,7 @@ // @ts-check | ||
} from '@agoric/casting'; | ||
import { makeVstorageKit, fetchEnvNetworkConfig } from '@agoric/client-utils'; | ||
import { | ||
makeVstorageKit, | ||
fetchEnvNetworkConfig, | ||
makeAgoricNames, | ||
} from '@agoric/client-utils'; | ||
import { execFileSync } from 'child_process'; | ||
@@ -55,2 +59,3 @@ import fs from 'fs'; | ||
/** @param {string} literalOrName */ | ||
const normalizeAddress = literalOrName => | ||
@@ -113,5 +118,5 @@ normalizeAddressWithOptions(literalOrName, wallet.opts()); | ||
const { unserializer } = await makeVstorageKit({ fetch }, networkConfig); | ||
const { marshaller } = makeVstorageKit({ fetch }, networkConfig); | ||
const offerObj = unserializer.fromCapData(JSON.parse(offerStr)); | ||
const offerObj = marshaller.fromCapData(JSON.parse(offerStr)); | ||
console.log(offerObj); | ||
@@ -129,5 +134,5 @@ }); | ||
const { unserializer } = await makeVstorageKit({ fetch }, networkConfig); | ||
const { marshaller } = makeVstorageKit({ fetch }, networkConfig); | ||
const offerObj = unserializer.fromCapData(JSON.parse(offerStr)); | ||
const offerObj = marshaller.fromCapData(JSON.parse(offerStr)); | ||
console.log(offerObj.offer.id); | ||
@@ -207,3 +212,3 @@ }); | ||
.action(async function () { | ||
const { vstorage } = await makeVstorageKit({ fetch }, networkConfig); | ||
const { vstorage } = makeVstorageKit({ fetch }, networkConfig); | ||
const wallets = await vstorage.keys('published.wallet'); | ||
@@ -222,9 +227,8 @@ process.stdout.write(wallets.join('\n')); | ||
.action(async function (opts) { | ||
const { agoricNames, unserializer, readPublished } = | ||
await makeVstorageKit( | ||
{ | ||
fetch, | ||
}, | ||
networkConfig, | ||
); | ||
const { | ||
readPublished, | ||
marshaller: unserializer, | ||
...vsk | ||
} = makeVstorageKit({ fetch }, networkConfig); | ||
const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage); | ||
@@ -236,2 +240,3 @@ const leader = makeLeader(networkConfig.rpcAddrs[0]); | ||
{ | ||
// @ts-expect-error xxx follower/marshaller types | ||
unserializer, | ||
@@ -238,0 +243,0 @@ }, |
/* eslint-env node */ | ||
import path from 'path'; | ||
import chalk from 'chalk'; | ||
import { execFileSync } from 'child_process'; | ||
import { makePspawn } from './helpers.js'; | ||
import DEFAULT_SDK_PACKAGE_NAMES from './sdk-package-names.js'; | ||
import { listWorkspaces } from './lib/packageManager.js'; | ||
@@ -33,13 +35,3 @@ const REQUIRED_AGORIC_START_PACKAGES = [ | ||
async function getWorktreePackagePaths(cwd = '.', map = new Map()) { | ||
// run `yarn workspaces info` to get the list of directories to | ||
// use, instead of a hard-coded list | ||
const p = pspawn('yarn', ['workspaces', '--silent', 'info'], { | ||
cwd, | ||
stdio: ['inherit', 'pipe', 'inherit'], | ||
}); | ||
const stdout = []; | ||
p.childProcess.stdout?.on('data', out => stdout.push(out)); | ||
await p; | ||
const d = JSON.parse(Buffer.concat(stdout).toString('utf-8')); | ||
for (const [name, { location }] of Object.entries(d)) { | ||
for (const { name, location } of listWorkspaces({ execFileSync }, cwd)) { | ||
map.set(name, path.resolve(cwd, location)); | ||
@@ -46,0 +38,0 @@ } |
@@ -8,2 +8,3 @@ // @ts-check | ||
* @import {MinimalNetworkConfig} from '@agoric/client-utils'; | ||
* @import {ParamsSDKType} from '@agoric/cosmic-proto/agoric/swingset/swingset.js'; | ||
*/ | ||
@@ -136,2 +137,3 @@ | ||
* @param {MinimalNetworkConfig} net | ||
* @returns {ParamsSDKType} | ||
*/ | ||
@@ -138,0 +140,0 @@ // TODO fetch by HTTP instead of shelling out https://github.com/Agoric/agoric-sdk/issues/9200 |
@@ -152,3 +152,3 @@ // @ts-check | ||
* keyring?: {home?: string, backend: string}, | ||
* stdout: Pick<import('stream').Writable, 'write'>, | ||
* stdout?: Pick<import('stream').Writable, 'write'>, | ||
* execFileSync: typeof import('child_process').execFileSync, | ||
@@ -155,0 +155,0 @@ * delay: (ms: number) => Promise<void>, |
@@ -90,15 +90,2 @@ /* eslint-env node */ | ||
const ibcSetup = path.join( | ||
dirname, | ||
'..', | ||
'node_modules', | ||
'.bin', | ||
'ibc-setup', | ||
); | ||
program.command( | ||
'ibc-setup <command...>', | ||
'set up Inter Blockchain Communication', | ||
{ executableFile: ibcSetup }, | ||
); | ||
baseCmd('open') | ||
@@ -188,17 +175,2 @@ .description('launch the Agoric UI') | ||
const ibcRelayer = path.join( | ||
dirname, | ||
'..', | ||
'node_modules', | ||
'.bin', | ||
'ibc-relayer', | ||
); | ||
program.command( | ||
'ibc-relayer', | ||
'run an Inter Blockchain Communications relayer', | ||
{ | ||
executableFile: ibcRelayer, | ||
}, | ||
); | ||
baseCmd('install [force-sdk-version]') | ||
@@ -215,13 +187,9 @@ .description('install Dapp dependencies') | ||
.option( | ||
'--proof <strict | optimistic | none>', | ||
'set proof mode', | ||
'--proof <none>', | ||
`set proof mode (currently only 'none' is supported)`, | ||
value => { | ||
assert( | ||
['strict', 'optimistic', 'none'].includes(value), | ||
X`--proof must be one of 'strict', 'optimistic', or 'none'`, | ||
TypeError, | ||
); | ||
assert.equal(value, 'none', X`--proof can only be 'none'`, TypeError); | ||
return value; | ||
}, | ||
'optimistic', | ||
'none', | ||
) | ||
@@ -228,0 +196,0 @@ .option( |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
43
-2.27%4
-20%46
2.22%6907
0.48%37
-2.63%244360
-0.5%23
-76.04%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated