Skip to content

Commit

Permalink
feat(cli): wallet provision
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Sep 15, 2022
1 parent 77cf5da commit 3d906f3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
16 changes: 16 additions & 0 deletions packages/agoric-cli/src/commands/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ const SLEEP_SECONDS = 3;
export const makeWalletCommand = async () => {
const wallet = new Command('wallet').description('wallet commands');

wallet
.command('provision')
.description('provision a Smart Wallet')
.requiredOption(
'--account [address]',
'address literal or name',
normalizeAddress,
)
.option('--dry-run', 'spit out the command instead of running it')
.option('--nickname [string]', 'nickname to use', 'my-wallet')
.action(function () {
const { account, dryRun, nickname } = this.opts();
const tx = `provision-one ${nickname} ${account} SMART_WALLET`;
execSwingsetTransaction(tx, networkConfig, account, dryRun);
});

wallet
.command('send')
.description('send a prepared offer')
Expand Down
6 changes: 2 additions & 4 deletions packages/agoric-cli/test/agops-governance-smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ make scenario2-setup scenario2-run-chain-psm
cd packages/cosmic-swingset
# Fund the pool
make fund-provision-pool
# Copy the agoric address from your keplr wallet or 'agd keys list', starts with 'agoric1'
KEY=<yoursBech32>
# Provision your wallet
make ACCT_ADDR=$KEY AGORIC_POWERS=SMART_WALLET fund-acct provision-acct
agoric wallet provision --account <key-name>
# verify
agoric wallet list
agoric wallet show --from \$KEY
agoric wallet show --from <key-name>
"
exit 1
fi
Expand Down
12 changes: 5 additions & 7 deletions packages/agoric-cli/test/agops-perf-smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ cd packages/cosmic-swingset
make scenario2-setup scenario2-run-chain-psm
# (new tab)
# Fund the pool (addr is a magic string)
make SOLO_COINS=1234000000ibc/usdc1234 ACCT_ADDR=agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346 fund-acct
# Provision your wallet
cd packages/cosmic-swingset
# Copy the agoric address from your keplr wallet or 'agd keys list', starts with 'agoric1'
WALLET_ADDR=<yours>
make ACCT_ADDR=$WALLET_ADDR AGORIC_POWERS=SMART_WALLET fund-acct provision-acct
# Fund the pool
make fund-provision-pool
# Provision your wallet
agoric wallet provision --account <key-name>
# verify
agoric wallet list
agoric wallet show --from $WALLET_ADDR
agoric wallet show --from <key-name>
"
exit 1
fi
Expand Down

0 comments on commit 3d906f3

Please sign in to comment.