-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
migrate RPC Tool page #2270
migrate RPC Tool page #2270
Conversation
We call this an RPC tool but it is using websocket requests ... |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
I think a lot of times using JSON-RPC directly from a webpage hits CORS limitations, whereas WebSocket isn't subject to CORS (strange choice if you ask me, but that's what the browser vendors and/or W3C chose) so that's why it's WS and not JSON-RPC. It's accurate if you view the WebSocket API as a "remote procedure call" API—it's certainly not a RESTful API—and JSON-RPC as a specific, different implementation of the XRPL's "RPC" APIs. But yeah, kind of confusing. |
Good point @mDuo13 - given that, I think it's fine to call it RPC since we are doing RPC over WebSocket. The "JSON-RPC" implementation is over HTTP, so I think it's more clear to refer to that as the HTTP API. |
content/dev-tools/rpc-tool.page.tsx
Outdated
} | ||
}, []); | ||
|
||
const getInfo = async (): Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit please use functional syntax instead of const function syntax
async function getInfo(...)...
content/sidebars.yaml
Outdated
@@ -660,7 +660,7 @@ | |||
- group: Dev Tools | |||
expanded: false | |||
items: | |||
- label: RPC Tool | |||
- page: /dev-tools/rpc-tool.page.tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The label should be the same as before :)
- page: /dev-tools/rpc-tool.page.tsx | |
- label: RPC Tool | |
page: /dev-tools/rpc-tool.page.tsx |
content/dev-tools/rpc-tool.page.tsx
Outdated
setAccountInfoResponse(null); | ||
setAccountLinesResponse(null); | ||
setAccountTxResponse(null); | ||
setAccountObjectsResponse(null); | ||
setTxResponse(null); | ||
setLedgerResponse(null); | ||
setErrorText(null); | ||
setShowResult(true); | ||
setProgressBarWidth("0%"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you group these variables with comments explaining the groupings? (Some of these seem like they should be broken out into sub-components, and some seem like separate parts of the page)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you make sub-components, please add them to a sub-folder :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has been done with my refactor.
9998c28
to
7f51ab4
Compare
Differences between original: - react18-json-view used for responses - cleaned up markup for expand and collapse Original work on this was done by @khancode Co-authored-by: Omar Khan <khancodegt@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved (with a minor fix to the page width to compensate for the fact that Redocly's sidebar doesn't count as part of the 12 Bootstrap columns and another fix to add it to the sidebar)
Migrate RPC Tool page to Redocly. XRPL requests have been implemented but styles are a WIP.