Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- added: `getPrivateViewKey` method to retrieve the private view key for a wallet.

## 0.2.0 (2025-05-26)

- changed: `transfer` now accepts an array of destinations.
Expand Down
10 changes: 10 additions & 0 deletions src/CppBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,16 @@ export class CppBridge {
return JSON.parse(response)
}

/**
* Get the private view key for a wallet.
* This key allows viewing incoming transactions without spending ability.
* WARNING: This is sensitive information - handle with care!
*/
async getPrivateViewKey(walletId: number): Promise<string> {
const walletInfo = await this.getWalletInfo(walletId)
return walletInfo.wi_extended.view_private_key
}
Comment on lines +245 to +253
Copy link
Contributor

@swansontec swansontec Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we even need this PR at all, since getWalletInfo already exists, and is accessible from the JS world. Couldn't the PoS app do these two lines just as well?

This seems like a documentation problem, not a code problem. If we had type definitions for the getWalletInfo return value, we could just put a /** Private view key */comment in the right place, and call it good.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this method to EdgeCurrencyTools in accountbased.


async resetWalletPassword(
walletId: number,
password: string
Expand Down