Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API functions to get wallet transfers and withdraw funds [$400] #141

Closed
woodser opened this issue Oct 27, 2021 · 10 comments
Closed

Add API functions to get wallet transfers and withdraw funds [$400] #141

woodser opened this issue Oct 27, 2021 · 10 comments
Assignees
Labels
a:api Related to the gRPC API 💰bounty There is a bounty on this issue is:feature Request for a new feature P3 normal priority

Comments

@woodser
Copy link
Contributor

woodser commented Oct 27, 2021

This issue requests adding new API functions to get transfers and withdraw funds.

These API calls will feed the UI wallet functionality:

image

The following functions are requested as additions to HavenoDaemon.ts. Feedback is welcome.

API Function Return Description
havenod.getXmrTxs() XmrTx[] Get all transactions with transfers from or to Haveno's Monero wallet.
havenod.createXmrTx(destinations: XmrDestination) XmrTx Create but do not relay a transaction to send funds from Haveno's Monero wallet.
havenod.relayXmrTx(txMetadata: string) string Relay a previously created transaction.
XmrTx
hash: string
timestamp: timestamp
transfers: XmrTransfer[]
metadata: string // used to later relay the transaction
XmrTransfer
address: string
amount: BigInt // as string in gRPC
isIncoming: boolean
destinations: XmrDestination[] // only present on outgoing transfers from local wallet data
XmrDestination
address: string
amount: BigInt // as string in gRPC

Note these wallet functions are already implemented:

API Function Return Description
havenod.getNewDepositSubaddress() string Get a new subaddress in the Haveno wallet to receive deposits.
havenod.getBalances() XmrBalanceInfo Get the user's Monero balances.

How to implement

A test should be added to HavenoDaemon.test.ts to test all Haveno wallet functions including sending and receiving funds and testing wallet balances and transactions.

Follow these instructions to add and test new API functions end-to-end.

@erciccione erciccione added a:api Related to the gRPC API is:feature Request for a new feature P2 high priority labels Oct 27, 2021
@erciccione erciccione added this to To do in Build Haveno's API Oct 27, 2021
@woodser woodser added the help wanted Extra attention is needed label Oct 27, 2021
@erciccione erciccione changed the title Add API functions to get wallet transfers and withdraw funds Add API functions to get wallet transfers and withdraw funds [$400] Oct 29, 2021
@erciccione erciccione added 💰bounty There is a bounty on this issue and removed help wanted Extra attention is needed labels Oct 29, 2021
@erciccione erciccione added this to Open in Bounty program via automation Oct 29, 2021
@github-actions
Copy link

There is a bounty on this issue, the amount is in the title. The bounty will be awarded to the first person(s) who resolves this issue. Read the full conditions in the 'bounties.md' file. If you are starting to work on this issue, please write a comment here, so that we can assign the issue to you and avoid duplicated work.

@l0nelyc0w
Copy link
Contributor

I can begin working on this issue.

@erciccione erciccione added P3 normal priority and removed P2 high priority labels Nov 9, 2021
@woodser
Copy link
Contributor Author

woodser commented Dec 3, 2021

@l0nelyc0w Checking in. How's it going?

@l0nelyc0w
Copy link
Contributor

@woodser I managed to get getXmrTxs working with the tests after the problem I had with null values, I followed ProcessModel.java and it helped to get the reply back. I have a question regarding createXmrTx(destinations) though, destinations isn't the only parameter for createXmrTx() right? It should also have the desired amount and the rest of fields that are mandatory to create a tx (as transfer in Monero RPC doc). And relayXmrTx() should take as it's only parameter the tx_metadata created by createXmrTx() (as relayTx in Monero RPC doc).

I think I will have a PR ready within the next 7 days.

@woodser
Copy link
Contributor Author

woodser commented Dec 23, 2021

@l0nelyc0w The amounts are part of the destinations. The only other required field is the account index which is always 0 for Haveno's wallet, so it doesn't need to be provided.

Yes, relayTxXmr() should take the tx metadata as an argument (I fixed the documentation).

@l0nelyc0w
Copy link
Contributor

l0nelyc0w commented Dec 23, 2021

@woodser

The only other required field is the account index which is always 0 for Haveno's wallet, so it doesn't need to be provided.

OK account index was the actual field of interest thank you for clarifying.

@erciccione
Copy link
Contributor

PR: #199

@erciccione erciccione moved this from Open to Patch proposed in Bounty program Dec 26, 2021
@erciccione erciccione moved this from To do to In progress in Build Haveno's API Dec 26, 2021
@erciccione erciccione moved this from In progress to Done in Build Haveno's API Jan 1, 2022
@erciccione erciccione moved this from Patch proposed to Patch accepted in Bounty program Jan 1, 2022
@erciccione
Copy link
Contributor

Reward sent. @l0nelyc0w please confirm you received it :)

@erciccione erciccione moved this from Patch accepted to Reward sent (resolved) in Bounty program Jan 4, 2022
@erciccione
Copy link
Contributor

Closing this as resolved.

@l0nelyc0w
Copy link
Contributor

l0nelyc0w commented Jan 10, 2022

I confirm I got the reward @erciccione thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:api Related to the gRPC API 💰bounty There is a bounty on this issue is:feature Request for a new feature P3 normal priority
Projects
Bounty program
Reward sent (resolved)
Development

No branches or pull requests

3 participants