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

APIClient rework #80

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ The browser test suite for the current version of the library is available at: h
Instructions and notes on debugging typescript in your IDE. Explains how to match the Mocha test configuration found in the Makefile.

[Notes on setting up IDE Debuggers](docs/IDE_Debug.md)

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@wharfkit/antelope",
"description": "Library for working with Antelope powered blockchains.",
"version": "0.9.1",
"version": "0.10.0-beta1",
"homepage": "https://github.com/wharfkit/antelope",
"license": "BSD-3-Clause-No-Military-License",
"main": "lib/antelope.js",
Expand Down
15 changes: 3 additions & 12 deletions src/api/client.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import {APIProvider, APIResponse, FetchProvider, FetchProviderOptions} from './provider'
import {ABISerializableConstructor, ABISerializableType} from '../serializer/serializable'
import {abiDecode} from '../serializer/decoder'
import {ChainAPI} from './v1/chain'
import {HistoryAPI} from './v1/history'
import {BuiltinTypes} from '../serializer/builtins'

export {ChainAPI, HistoryAPI}

export interface APIClientOptions extends FetchProviderOptions {
/** URL to the API node to use, only used if the provider option is not set. */
url?: string
/** API provider to use, if omitted and the url option is set the default provider will be used. */
provider?: APIProvider
/** URL to the API node to use, only used if the provider option is not set. */
url?: string
}

export interface APIErrorDetail {
Expand Down Expand Up @@ -92,7 +88,7 @@ export class APIError extends Error {
}
}

export class APIClient {
export class BaseAPIClient {
static __className = 'APIClient'

readonly provider: APIProvider
Expand All @@ -107,11 +103,6 @@ export class APIClient {
}
}

v1 = {
chain: new ChainAPI(this),
history: new HistoryAPI(this),
}

async call<T extends ABISerializableConstructor>(args: {
path: string
params?: unknown
Expand Down
1 change: 0 additions & 1 deletion src/api/types.ts

This file was deleted.

Loading