Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions yarn-project/cli-wallet/src/cmds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: DebugL
.requiredOption('-a, --address <string>', 'The Aztec address of the note owner.', address =>
aliasedAddressParser('accounts', address, db),
)
.addOption(
createSecretKeyOption("The sender's secret key", !db, sk => aliasedSecretKeyParser(sk, db)),
)
.requiredOption('-h, --hash <string>', 'The tx hash of the tx containing the note.', txHash =>
aliasedTxHashParser(txHash, db),
)
Expand All @@ -372,10 +375,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: DebugL
.action(async (noteName, storageFieldName, _options, command) => {
const { addNote } = await import('./add_note.js');
const options = command.optsWithGlobals();
const { contractArtifact: artifactPathPromise, contractAddress, address, rpcUrl, fields, hash } = options;
const { contractArtifact: artifactPathPromise, contractAddress, address, secretKey, rpcUrl, fields, hash } = options;
const artifactPath = await artifactPathFromPromiseOrAlias(artifactPathPromise, contractAddress, db);
const client = await createCompatibleClient(rpcUrl, debugLogger);
const account = await createOrRetrieveAccount(client, address, db);
const account = await createOrRetrieveAccount(client, address, db, undefined, secretKey);
const wallet = await account.getWallet();

await addNote(wallet, address, contractAddress, noteName, storageFieldName, artifactPath, hash, fields, log);
Expand Down