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

[API Request] /blockchain/box/unspent/byAddress Unconfirmed Query Parameter #2093

Open
mgpai22 opened this issue Jan 5, 2024 · 4 comments
Open
Assignees

Comments

@mgpai22
Copy link
Contributor

mgpai22 commented Jan 5, 2024

Currently, this endpoint returns all confirmed unspent boxes residing in an address. A parameter is needed to also include unconfirmed boxes. I think it should include boxes with ergotrees belonging to the respective address queried.

The use case for this would be to generate chained transactions where offchain service does not know prior box(es) used. For example when ergo mobile connects with a dapp to submit a transaction, the dapp uses unspent boxes by address to retrieve input boxes. If a ergo mobile user wants to interact several times with a dapp in a short period of time it will not be possible due to double spend errors. Having the unconfirmed addition will allow for dapps to have quick successive transactions for mobile users.

@ApexTheory
Copy link
Collaborator

I can take this.

@ApexTheory ApexTheory self-assigned this Jan 20, 2024
@mgpai22
Copy link
Contributor Author

mgpai22 commented Jan 20, 2024

@ApexTheory It is already implemented by @jellymlg . However, I also need a flag such that it returns boxes which are not currently spent in the mempool.

For example, let's say Address A has only one box, box A. I send box A to Address B. The outputs are two boxes, one that goes to B, and one that is change, which goes to A. This transaction is now unconfirmed.

Right now, I want to send to Address C. If I use the api to get boxes at Address A, it will return two boxes. The original box which is currently being spent and the change box which is available for use.

The flag required should only return boxes which are not in the process of being spent. In other words, none of the boxes should be in the input of transactions in the mempool.

@kushti not sure if the bounty applies for this.

@kushti
Copy link
Member

kushti commented Feb 10, 2024

@mgpai22 @ApexTheory yet, it applies. Where and what exactly @jellymlg has implemented ?

@mgpai22
Copy link
Contributor Author

mgpai22 commented Feb 10, 2024

@kushti the parameter to include unconfirmed boxes includeUnconfirmed has already been implemented by @jellymlg

Please see here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants