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

Current maker offer/counterparty via RPC API #1326

Closed
theborakompanioni opened this issue Aug 1, 2022 · 8 comments
Closed

Current maker offer/counterparty via RPC API #1326

theborakompanioni opened this issue Aug 1, 2022 · 8 comments

Comments

@theborakompanioni
Copy link
Contributor

It would be nice to have a way to display the current options given to the yield generator/maker service via RPC API. See joinmarket-webui/jam#399.

As far as I am aware, there is no way to show this info as of yet.
From Jams perspective, it might only show this information once with the values given to /maker/start. Afterwards, if a user reloads the page this information is lost. Also, saving to local storage is not a solution, as switching devices/browsers will lead to the same problem (also, it is private information that should be stored only temporarily, if at all).

I do not know what a good solution looks like, adding the current settings to /session (if authenticated) comes to mind.
e.g.

GET http://localhost:3000/api/v1/session

{
  "session": true, 
  "maker_running": true, 
  "coinjoin_in_process": false, 
  "wallet_name": "funded.jmdat"
  "offerlist": [{'oid': 0, 'ordertype': 'sw0reloffer', 'minsize': 13, 'maxsize': 14999972700, 'txfee': 0, 'cjfee': 0.00011}]
}

Also, in addition, is this a good time to think about if and how to retrieve ones own counterparty id (joinmarket-webui/jam#413)? As a user, I want to find my own offer in the orderbook - and it would be great to be able to highlight it programmatically with this information.

Maybe counterparty id updates can be streamed via websockets, but it'd be great to have it via api as well.

Please let me know what you think. Is something like this possible in an easy and straightforward way - or is it even possible at all?

@AdamISZ
Copy link
Member

AdamISZ commented Aug 2, 2022

These suggestions make a lot of sense to me. I could look into doing it shortly (unless someone else wants to do it).

@kristapsk
Copy link
Member

kristapsk commented Aug 2, 2022

Should be enough to know your nickname, that way you can find it in orderbook that way.

@AdamISZ
Copy link
Member

AdamISZ commented Aug 2, 2022

Should be enough to know your nickname, that way you can find it in orderbook that way.

Good point, though wouldn't hurt to directly report offer. Might depend on details when we try to implement it.

@theborakompanioni
Copy link
Contributor Author

These suggestions make a lot of sense to me. I could look into doing it shortly (unless someone else wants to do it).

Nice. I can assist with reviewing and testing, but I am afraid I certainly can't be of any help with the implementation.

Should be enough to know your nickname, that way you can find it in orderbook that way.

Nickname would already be a great detail to have. I believe JoininBox is parsing it from the log file, so chances are other downstream projects will benefit from it as well. Seems this might not always be the most reliable thing to do (?), and in API based consumers, it is not possible at all.

Thinking about it again, having some kind of remote access to the logs would greatly improve user feedback (maybe not the best UX, but a major improvement towards user feedback for projects not running on the same host). Just thinking out loud here.

Good point, though wouldn't hurt to directly report offer. Might depend on details when we try to implement it.

That'd be great. But also, do what is best for the project in the long run. I am happy with anything that makes life easier for the user.

AdamISZ added a commit that referenced this issue Aug 8, 2022
This partially addresses #1326. If the maker service is running,
we return the offerlist in the /session API call, as suggested there.
@AdamISZ
Copy link
Member

AdamISZ commented Aug 8, 2022

So as per the commit comment, #1328 addresses the first part but not the second (I did basic tests using curl and seems to function correctly).

I'll take a look at the nick separately. It might be possible to simply use jm_single().nickname.

@AdamISZ
Copy link
Member

AdamISZ commented Aug 8, 2022

Nick return is now added. Tests out OK for me. As before, the nick is only reported if maker is running, and /session is auth-ed. Don't see a need otherwise.

@AdamISZ
Copy link
Member

AdamISZ commented Aug 24, 2022

Is this close-able @theborakompanioni ?

@theborakompanioni
Copy link
Contributor Author

Is this close-able @theborakompanioni ?

Yes, of course! Works like a charm. 🙏

kristapsk pushed a commit to kristapsk/joinmarket-clientserver that referenced this issue Jan 5, 2024
This partially addresses JoinMarket-Org#1326. If the maker service is running,
we return the offerlist in the /session API call, as suggested there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants