Skip to content

Commit 9211b92

Browse files
authored
Reworking the APIClient (#79)
* Removing api definitions * Testing extending APIClient * Exporting as BaseAPIClient now * Fixing tests * Update package.json
1 parent f63e421 commit 9211b92

File tree

10 files changed

+78
-1885
lines changed

10 files changed

+78
-1885
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,5 @@ The browser test suite for the current version of the library is available at: h
8686
Instructions and notes on debugging typescript in your IDE. Explains how to match the Mocha test configuration found in the Makefile.
8787

8888
[Notes on setting up IDE Debuggers](docs/IDE_Debug.md)
89+
90+
Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@wharfkit/antelope",
33
"description": "Library for working with Antelope powered blockchains.",
4-
"version": "0.8.0",
4+
"version": "0.9.0-rc1",
55
"homepage": "https://github.com/wharfkit/antelope",
66
"license": "BSD-3-Clause-No-Military-License",
77
"main": "lib/antelope.js",

src/api/client.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import {APIProvider, APIResponse, FetchProvider, FetchProviderOptions} from './provider'
22
import {ABISerializableConstructor, ABISerializableType} from '../serializer/serializable'
33
import {abiDecode} from '../serializer/decoder'
4-
import {ChainAPI} from './v1/chain'
5-
import {HistoryAPI} from './v1/history'
64
import {BuiltinTypes} from '../serializer/builtins'
75

8-
export {ChainAPI, HistoryAPI}
9-
106
export interface APIClientOptions extends FetchProviderOptions {
11-
/** URL to the API node to use, only used if the provider option is not set. */
12-
url?: string
137
/** API provider to use, if omitted and the url option is set the default provider will be used. */
148
provider?: APIProvider
9+
/** URL to the API node to use, only used if the provider option is not set. */
10+
url?: string
1511
}
1612

1713
export interface APIErrorDetail {
@@ -92,7 +88,7 @@ export class APIError extends Error {
9288
}
9389
}
9490

95-
export class APIClient {
91+
export class BaseAPIClient {
9692
static __className = 'APIClient'
9793

9894
readonly provider: APIProvider
@@ -107,11 +103,6 @@ export class APIClient {
107103
}
108104
}
109105

110-
v1 = {
111-
chain: new ChainAPI(this),
112-
history: new HistoryAPI(this),
113-
}
114-
115106
async call<T extends ABISerializableConstructor>(args: {
116107
path: string
117108
params?: unknown

src/api/types.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)