Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to:
Looking at the commits, it's basically just deleting the API calls, types, and tests.
This code has moved to a generic APIClient implementation for leap named
@wharfkit/apiclient-leap
.https://github.com/wharfkit/apiclient-leap/tree/master/src
It can be used exactly the same as how it functioned in
@wharfkit/antelope
, developers exclusively using the antelope library will now just need to include this new dependency and update their imports.Some new syntax is also available as part of this change, where you can import specific named APIs:
As mentioned before, the point of this is to offer chain specific implementations, which you'll now be able to do with packages that extend the leap package. I created one for WAX and called it
@wharfkit/apiclient-wax
.https://github.com/wharfkit/apiclient-wax/tree/master/src
It again can be used exactly in the same way, just required using the specific import and package.
What this new wax specific package does is overrides the
get_account
call:https://github.com/wharfkit/apiclient-wax/blob/master/src/chain.ts
In order to return new types:
https://github.com/wharfkit/apiclient-wax/blob/master/src/types.ts
Otherwise anything not defined falls back to
@wharfkit/apiclient-leap
.This pattern that I'm establishing is what I want to use for things like a "Robo" API client, or a "Hyperion" or "AtomicAssets" client - where we can define additional calls that returned typed data.
I'm not entirely happy with how this turned out. I'm considering rewriting the entire
APIClient
class to make it aware of what chain its accessing and also allowing "plugins" of some sort that'll override the response types for specific chains.Definitely need some input here.