add functions to Wallet API [release]#9918
Open
SNeedlewoods wants to merge 1 commit intomonero-project:release-v0.18from
Open
add functions to Wallet API [release]#9918SNeedlewoods wants to merge 1 commit intomonero-project:release-v0.18from
SNeedlewoods wants to merge 1 commit intomonero-project:release-v0.18from
Conversation
d9d208d to
81a042e
Compare
81a042e to
5f714f1
Compare
|
Any ETA on when this is going to be merged? We are building a FFI Rust library on top of this branch: https://github.com/UnstoppableSwap/core/tree/bbcc20eb58a98e1dd06980c7fac342e9e7064781/monero-sys |
Contributor
Author
|
Unfortunately I can't give you an ETA, because #9464 needs more reviews/approvals from others, but for my part I'll try my best to resolve review comments ASAP. I'm glad to hear you're using this, but keep in mind that things may change. |
|
Support for #8861 would be very useful in wallet2_api as well! Minimal patch: diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 96393eaaa..f2f8e7fbb 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -1777,7 +1777,7 @@ PendingTransaction* WalletImpl::restoreMultisigTransaction(const string& signDat
// - unconfirmed_transfer_details;
// - confirmed_transfer_details)
-PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<string> &dst_addr, const string &payment_id, optional<std::vector<uint64_t>> amount, uint32_t mixin_count, PendingTransaction::Priority priority, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices)
+PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<string> &dst_addr, const string &payment_id, optional<std::vector<uint64_t>> amount, uint32_t mixin_count, PendingTransaction::Priority priority, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, std::set<uint32_t> subtract_fee_from_outputs)
{
clearStatus();
@@ -1862,7 +1862,7 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri
if (amount) {
transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, fake_outs_count,
adjusted_priority,
- extra, subaddr_account, subaddr_indices);
+ extra, subaddr_account, subaddr_indices, subtract_fee_from_outputs);
} else {
transaction->m_pending_tx = m_wallet->create_transactions_all(0, info.address, info.is_subaddress, 1, fake_outs_count,
adjusted_priority,
@@ -1949,7 +1949,7 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
PendingTransaction::Priority priority, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices)
{
- return createTransactionMultDest(std::vector<string> {dst_addr}, payment_id, amount ? (std::vector<uint64_t> {*amount}) : (optional<std::vector<uint64_t>>()), mixin_count, priority, subaddr_account, subaddr_indices);
+ return createTransactionMultDest(std::vector<string> {dst_addr}, payment_id, amount ? (std::vector<uint64_t> {*amount}) : (optional<std::vector<uint64_t>>()), mixin_count, priority, subaddr_account, subaddr_indices, {});
}
PendingTransaction *WalletImpl::createSweepUnmixableTransaction()
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
index b7f77a186..f81f13ac2 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -157,7 +157,8 @@ public:
optional<std::vector<uint64_t>> amount, uint32_t mixin_count,
PendingTransaction::Priority priority = PendingTransaction::Priority_Low,
uint32_t subaddr_account = 0,
- std::set<uint32_t> subaddr_indices = {}) override;
+ std::set<uint32_t> subaddr_indices = {},
+ std::set<uint32_t> subtract_fee_from_outputs = {}) override;
PendingTransaction * createTransaction(const std::string &dst_addr, const std::string &payment_id,
optional<uint64_t> amount, uint32_t mixin_count,
PendingTransaction::Priority priority = PendingTransaction::Priority_Low,
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
index ca807ac87..f5f0a8f39 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
@@ -936,7 +936,8 @@ struct Wallet
optional<std::vector<uint64_t>> amount, uint32_t mixin_count,
PendingTransaction::Priority = PendingTransaction::Priority_Low,
uint32_t subaddr_account = 0,
- std::set<uint32_t> subaddr_indices = {}) = 0;
+ std::set<uint32_t> subaddr_indices = {},
+ std::set<uint32_t> subtract_fee_from_outputs = {}) = 0;
/*!
* \brief createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored |
Contributor
Author
|
I agree, will add it. Thank you. |
|
A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#9464