42 struct tx_scan_info_t;
43 struct exported_transfer_details;
44 struct transfer_details;
45 typedef std::vector<transfer_details> transfer_container;
53 explicit Account(
const std::array<unsigned char, 32>& key,
const Network network);
60 explicit Account(
const crypto::secret_key& key,
const Network network);
74 explicit Account(
const cryptonote::account_base& account,
const Network network);
97 Address address(
const cryptonote::subaddress_index index)
const noexcept;
170 size_t importOutputs(
const std::tuple<uint64_t, uint64_t, std::vector<exported_transfer_details>> &outputs);
179 size_t importOutputs(
const std::tuple<uint64_t, uint64_t, std::vector<transfer_details>> &outputs);
187 std::string
signData(
const std::string& data)
const;
196 std::string
signData(
const std::string& data,
const std::pair<uint32_t, uint32_t>& index)
const;
209 const std::string& data,
247 bool static verifyData(
const std::string& data,
const std::string&
address,
const std::string& signature);
269 bool static verifyDataLegacy(
const std::string& data,
const std::string&
address,
const std::string& signature);
280 static crypto::hash hashData(
const std::string& data,
const crypto::public_key& spendKey,
const crypto::public_key& viewKey);
289 std::string decrypt_with_view_secret_key(
const std::string& ciphertext,
bool authenticated =
true)
const;
298 void authenticate_with_public_view_view_key(
const std::string& data,
const crypto::signature& signature)
const;
304 crypto::public_key get_tx_pub_key_from_received_outs(
const transfer_details &td)
const;
306 void check_acc_out_precomp(
const cryptonote::tx_out &o,
const crypto::key_derivation &derivation,
const std::vector<crypto::key_derivation> &additional_derivations,
size_t i, tx_scan_info_t &tx_scan_info)
const;
307 void check_acc_out_precomp(
const cryptonote::tx_out &o,
const crypto::key_derivation &derivation,
const std::vector<crypto::key_derivation> &additional_derivations,
size_t i,
const is_out_data *is_out_data, tx_scan_info_t &tx_scan_info)
const;
309 cryptonote::account_base m_account;
312 mutable std::unordered_map<std::string, std::pair<uint32_t, uint32_t>> m_addressCache;
315 mutable std::map<std::pair<uint32_t, uint32_t>, std::string> m_indexToAddressCache;
321 mutable std::set<std::pair<uint32_t, uint32_t>> m_addressIndexCache;
329 std::pair<uint32_t, uint32_t> cachedAddressIndex(
const Address&
address)
const;
338 void cacheAddress(
const Address&
address, uint32_t account, uint32_t index)
const noexcept;
348 void cacheAddress(
const Address&
address, cryptonote::subaddress_index index)
const noexcept;
357 void cacheAddress(cryptonote::subaddress_index index)
const noexcept;
373 bool addressIndexInCache(
const std::pair<uint32_t, uint32_t>& index)
const noexcept;
383 bool addressIndexInCache(
const uint32_t account,
const uint32_t index)
const noexcept;
393 bool addressIndexInCache(
const cryptonote::subaddress_index& index)
const noexcept;
404 Address cachedAddress(
const uint32_t account,
const uint32_t index)
const;
416 Address cachedAddress(
const cryptonote::subaddress_index index)
const;
426 BEGIN_SERIALIZE_OBJECT()
432 crypto::public_key m_signer;
433 std::vector<
LR> m_LR;
434 std::vector<crypto::key_image> m_partial_key_images;
436 BEGIN_SERIALIZE_OBJECT()
439 FIELD(m_partial_key_images)
443 struct transfer_details
445 uint64_t m_block_height;
446 cryptonote::transaction_prefix m_tx;
448 uint64_t m_internal_output_index;
449 uint64_t m_global_output_index;
452 uint64_t m_spent_height;
453 crypto::key_image m_key_image;
457 bool m_key_image_known;
458 bool m_key_image_request;
460 cryptonote::subaddress_index m_subaddr_index;
461 bool m_key_image_partial;
462 std::vector<rct::key> m_multisig_k;
463 std::vector<multisig_info> m_multisig_info;
464 std::vector<std::pair<uint64_t, crypto::hash>> m_uses;
466 bool is_rct()
const {
return m_rct; }
467 uint64_t amount()
const {
return m_amount; }
468 const crypto::public_key get_public_key()
const {
469 crypto::public_key output_public_key;
470 if(m_tx.vout.size() <= m_internal_output_index)
472 if(!get_output_public_key(m_tx.vout[m_internal_output_index], output_public_key))
474 return output_public_key;
477 BEGIN_SERIALIZE_OBJECT()
478 FIELD(m_block_height)
481 FIELD(m_internal_output_index)
482 FIELD(m_global_output_index)
485 FIELD(m_spent_height)
490 FIELD(m_key_image_known)
491 FIELD(m_key_image_request)
493 FIELD(m_subaddr_index)
494 FIELD(m_key_image_partial)
496 FIELD(m_multisig_info)
501 struct exported_transfer_details
503 crypto::public_key m_pubkey;
504 uint64_t m_internal_output_index;
505 uint64_t m_global_output_index;
506 crypto::public_key m_tx_pubkey;
514 uint8_t m_key_image_known: 1;
515 uint8_t m_key_image_request: 1;
516 uint8_t m_key_image_partial: 1;
521 std::vector<crypto::public_key> m_additional_tx_keys;
522 uint32_t m_subaddr_index_major;
523 uint32_t m_subaddr_index_minor;
525 BEGIN_SERIALIZE_OBJECT()
530 VARINT_FIELD(m_internal_output_index)
531 VARINT_FIELD(m_global_output_index)
534 VARINT_FIELD(m_amount)
535 FIELD(m_additional_tx_keys)
536 VARINT_FIELD(m_subaddr_index_major)
537 VARINT_FIELD(m_subaddr_index_minor)
541 struct tx_scan_info_t
543 cryptonote::keypair in_ephemeral;
544 crypto::key_image ki;
547 uint64_t money_transfered;
549 boost::optional<cryptonote::subaddress_receive_info> received;
551 tx_scan_info_t(): amount(0), money_transfered(0), error(true) {}
556 crypto::public_key pkey;
557 crypto::key_derivation derivation;
558 std::vector<boost::optional<cryptonote::subaddress_receive_info>> received;
561 transfer_container m_transfers;
562 std::unordered_map<crypto::key_image, size_t> m_key_images;
563 std::unordered_map<crypto::public_key, size_t> m_pub_keys;
564 std::unordered_map<crypto::public_key, cryptonote::subaddress_index> m_subaddresses;
565 std::vector<std::vector<std::string>> m_subaddress_labels;
566 size_t m_subaddress_lookahead_major, m_subaddress_lookahead_minor;