Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Client URL cannot be modified #122

Open
tcharding opened this issue May 29, 2024 · 3 comments
Open

Client URL cannot be modified #122

tcharding opened this issue May 29, 2024 · 3 comments

Comments

@tcharding
Copy link
Collaborator

bitcoind adds the wallet to the URL for a bunch of API calls (eg getnewaddress) for example:

http://localhost:1234/wallet/<wallet-name>

However it is not possible to modify a Client's url (inside Transport), it would be sweet if when implementing an RPC client usingjsonrpc one could do something like

let client = Client::new();
let wallet = client.create_wallet()?;
let wallet_client = client.use_wallet(&wallet);
let address = wallet_client.get_new_address()?;
// Original client still usable
let another_wallet = client.some_other_non_wallet_api_call()?;
@tcharding tcharding changed the title Client url cannot be modified Client URL cannot be modified May 29, 2024
@apoelstra
Copy link
Owner

@apoelstra
Copy link
Owner

We could add the same method to the minreq transport. But we can't add it generically because not every transport has a "URL".

@tcharding
Copy link
Collaborator Author

Oh cool, I missed that one (obviously). Yeah it would be nice to have that guy inherently on all the transports.

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

No branches or pull requests

2 participants