Monero C++ Library
|
Enumerations | |
enum | monero_network_type : uint8_t { MAINNET = 0 , TESTNET , STAGENET } |
enum | monero_tx_priority : uint8_t { DEFAULT = 0 , UNIMPORTANT , NORMAL , ELEVATED } |
enum | monero_message_signature_type : uint8_t { SIGN_WITH_SPEND_KEY = 0 , SIGN_WITH_VIEW_KEY } |
Functions | |
void | merge_tx (std::vector< std::shared_ptr< monero_tx > > &txs, const std::shared_ptr< monero_tx > &tx) |
std::shared_ptr< monero_tx_query > | decontextualize (std::shared_ptr< monero_tx_query > query) |
bool | is_contextual (const monero_transfer_query &query) |
bool | is_contextual (const monero_output_query &query) |
bool | bool_equals (bool val, const boost::optional< bool > &opt_val) |
void | set_num_confirmations (std::shared_ptr< monero_tx_wallet > &tx, uint64_t blockchain_height) |
void | set_num_suggested_confirmations (std::shared_ptr< monero_incoming_transfer > &incoming_transfer, uint64_t blockchain_height, uint64_t block_reward, uint64_t unlock_time) |
std::shared_ptr< monero_tx_wallet > | build_tx_with_incoming_transfer (tools::wallet2 &m_w2, uint64_t height, const crypto::hash &payment_id, const tools::wallet2::payment_details &pd) |
std::shared_ptr< monero_tx_wallet > | build_tx_with_outgoing_transfer (tools::wallet2 &m_w2, uint64_t height, const crypto::hash &txid, const tools::wallet2::confirmed_transfer_details &pd) |
std::shared_ptr< monero_tx_wallet > | build_tx_with_incoming_transfer_unconfirmed (const tools::wallet2 &m_w2, uint64_t height, const crypto::hash &payment_id, const tools::wallet2::pool_payment_details &ppd) |
std::shared_ptr< monero_tx_wallet > | build_tx_with_outgoing_transfer_unconfirmed (const tools::wallet2 &m_w2, const crypto::hash &txid, const tools::wallet2::unconfirmed_transfer_details &pd) |
std::shared_ptr< monero_tx_wallet > | build_tx_with_vout (tools::wallet2 &m_w2, const tools::wallet2::transfer_details &td) |
void | merge_tx (const std::shared_ptr< monero_tx_wallet > &tx, std::map< std::string, std::shared_ptr< monero_tx_wallet > > &tx_map, std::map< uint64_t, std::shared_ptr< monero_block > > &block_map) |
bool | tx_height_less_than (const std::shared_ptr< monero_tx > &tx1, const std::shared_ptr< monero_tx > &tx2) |
bool | incoming_transfer_before (const std::shared_ptr< monero_incoming_transfer > &transfer1, const std::shared_ptr< monero_incoming_transfer > &transfer2) |
bool | vout_before (const std::shared_ptr< monero_output > &o1, const std::shared_ptr< monero_output > &o2) |
std::string | get_default_ringdb_path (cryptonote::network_type nettype) |
bool | validate_transfer (wallet2 *m_w2, const std::list< wallet_rpc::transfer_destination > &destinations, const std::string &payment_id, std::vector< cryptonote::tx_destination_entry > &dsts, std::vector< uint8_t > &extra, bool at_least_one_destination, epee::json_rpc::error &er) |
template<typename Ts , typename Tu , typename Tk , typename Ta > | |
bool | fill_response (wallet2 *m_w2, std::vector< tools::wallet2::pending_tx > &ptx_vector, bool get_tx_key, Ts &tx_key, Tu &amount, Ta &amounts_by_dest, Tu &fee, Tu &weight, std::string &multisig_txset, std::string &unsigned_txset, bool do_not_relay, Ts &tx_hash, bool get_tx_hex, Ts &tx_blob, bool get_tx_metadata, Ts &tx_metadata, Tk &spent_key_images, epee::json_rpc::error &er) |
void | merge_incoming_transfer (std::vector< std::shared_ptr< monero_incoming_transfer > > &transfers, const std::shared_ptr< monero_incoming_transfer > &transfer) |
std::shared_ptr< monero_block > | node_to_block_query (const boost::property_tree::ptree &node) |
Copyright (c) woodser
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Parts of this file are originally copyright (c) 2014-2019, The Monero Project
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
All rights reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers Public library intereface.
Copyright (c) woodser
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Parts of this file are originally copyright (c) 2014-2019, The Monero Project
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
All rights reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers Public library interface.
Copyright (c) woodser
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Parts of this file are originally copyright (c) 2014-2019, The Monero Project
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
All rights reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers Public interface for libmonero-cpp library.
Public library interface.
Implements a monero_wallet.h by wrapping wallet2.h.
Copyright (c) woodser
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Parts of this file are originally copyright (c) 2014-2019, The Monero Project
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
All rights reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers Implements a monero_wallet.h by wrapping monero-project's wallet2.
enum monero::monero_message_signature_type : uint8_t |
Enumerates message verification results.
enum monero::monero_network_type : uint8_t |
Enumerates Monero network types.
enum monero::monero_tx_priority : uint8_t |
Enumerates Monero network types.
std::shared_ptr< monero_tx_query > monero::decontextualize | ( | std::shared_ptr< monero_tx_query > | query | ) |
Remove query criteria which require looking up other transfers/outputs to fulfill query.
query | the query to decontextualize |
bool monero::incoming_transfer_before | ( | const std::shared_ptr< monero_incoming_transfer > & | transfer1, |
const std::shared_ptr< monero_incoming_transfer > & | transfer2 ) |
Returns true iff transfer1 is ordered before transfer2 by ascending account and subaddress indices.
void monero::merge_tx | ( | const std::shared_ptr< monero_tx_wallet > & | tx, |
std::map< std::string, std::shared_ptr< monero_tx_wallet > > & | tx_map, | ||
std::map< uint64_t, std::shared_ptr< monero_block > > & | block_map ) |
Merges a transaction into a unique set of transactions.
tx | is the transaction to merge into the existing txs |
tx_map | maps tx hashes to txs |
block_map | maps block heights to blocks |
bool monero::tx_height_less_than | ( | const std::shared_ptr< monero_tx > & | tx1, |
const std::shared_ptr< monero_tx > & | tx2 ) |
Returns true iff tx1's height is known to be less than tx2's height for sorting.
bool monero::validate_transfer | ( | wallet2 * | m_w2, |
const std::list< wallet_rpc::transfer_destination > & | destinations, | ||
const std::string & | payment_id, | ||
std::vector< cryptonote::tx_destination_entry > & | dsts, | ||
std::vector< uint8_t > & | extra, | ||
bool | at_least_one_destination, | ||
epee::json_rpc::error & | er ) |
-------------— DUPLICATED WALLET RPC TRANSFER CODE ------------------—
These functions are duplicated from private functions in wallet rpc on_transfer/on_transfer_split, with minor modifications to not be class members.
This code is used to generate and send transactions with equivalent functionality as wallet rpc.
Duplicated code is not ideal. Solutions considered:
(1) Duplicate wallet rpc code as done here. (2) Modify monero-wallet-rpc on_transfer() / on_transfer_split() to be public. (3) Modify monero-wallet-rpc to make this class a friend. (4) Move all logic in monero-wallet-rpc to wallet2 so all users can access.
Options 2-4 require modification of monero-project C++. Of those, (4) is probably ideal. TODO: open patch on monero-project which moves common wallet rpc logic (e.g. on_transfer, on_transfer_split) to m_w2.
Until then, option (1) is used because it allows monero-project binaries to be used without modification, it's easy, and anything other than (4) is temporary.
bool monero::vout_before | ( | const std::shared_ptr< monero_output > & | o1, |
const std::shared_ptr< monero_output > & | o2 ) |
Returns true iff wallet vout1 is ordered before vout2 by ascending account and subaddress indices then index.