diff options
author | Dusan Klinec <dusan.klinec@gmail.com> | 2019-05-31 10:41:52 +0200 |
---|---|---|
committer | Dusan Klinec <dusan.klinec@gmail.com> | 2019-06-17 16:49:04 +0200 |
commit | f074b6b5715f90960e5ebf8d440101ba446d94b0 (patch) | |
tree | a25bbf87a3ae70430ebc3e73755a07ee708d2f8e /src/wallet/api/wallet.cpp | |
parent | Merge pull request #5548 (diff) | |
download | monero-f074b6b5715f90960e5ebf8d440101ba446d94b0.tar.xz |
device: show address on device display
- Trezor: support for device address display (subaddress, integrated address)
- Wallet::API support added
- Simplewallet:
- address device [<index>]
- address new <label> // shows address on device also
- integrated_address [device] <payment_id|address> // new optional "device" arg to display also on the device
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-rw-r--r-- | src/wallet/api/wallet.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 1711db482..a85e31474 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -2419,6 +2419,23 @@ uint64_t WalletImpl::coldKeyImageSync(uint64_t &spent, uint64_t &unspent) { return m_wallet->cold_key_image_sync(spent, unspent); } + +void WalletImpl::deviceShowAddress(uint32_t accountIndex, uint32_t addressIndex, const std::string &paymentId) +{ + boost::optional<crypto::hash8> payment_id_param = boost::none; + if (!paymentId.empty()) + { + crypto::hash8 payment_id; + bool res = tools::wallet2::parse_short_payment_id(paymentId, payment_id); + if (!res) + { + throw runtime_error("Invalid payment ID"); + } + payment_id_param = payment_id; + } + + m_wallet->device_show_address(accountIndex, addressIndex, payment_id_param); +} } // namespace namespace Bitmonero = Monero; |