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

Allows specifying api_version as default instead of specifying api_version for each request #755

Closed
tequdev opened this issue Oct 1, 2024 · 2 comments

Comments

@tequdev
Copy link

tequdev commented Oct 1, 2024

The following processes that are possible in xrpl.js should also be possible in xrpl-py.

import { Client } from 'xrpl'
const client = new Client('custom-api-v1-server')
client.apiVersion = 1

await client.connect() // api_version = 1

await client.getServerInfo()  // api_version = 1
await client.request({ comand: "server_info" }) // api_version = 1
@ckeshava
Copy link
Collaborator

ckeshava commented Oct 2, 2024

Hello,
In the Python codebase, api_version is set inside the Request class, it is not a part of the Client class.

These Request(-child) instances do not persist between RPC invocations, so the above idea cannot be achieved in xrpl-py.

rippled structures all the RPC requests with individual api_version fields. I mirrored that level of granularity in the Python SDK. Is this a pressing issue?

Let me think of a solution that doesn't change the architecture substantially :)

@ckeshava
Copy link
Collaborator

Hello, I acknowledge that there is no "default setting" for the api_version value in xrpl-py's Client class. This is also true for clients communicating with rippled directly via JSON-RPC or WebSocket connections.

If you have any use-cases which are hindered by this design, please let me know.

I'm happy to review any code-suggestions pertaining to this issue, however I cannot take this up at the moment.

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
@ckeshava @tequdev and others