11import { APIProvider , APIResponse , FetchProvider , FetchProviderOptions } from './provider'
22import { ABISerializableConstructor , ABISerializableType } from '../serializer/serializable'
33import { abiDecode } from '../serializer/decoder'
4- import { ChainAPI } from './v1/chain'
5- import { HistoryAPI } from './v1/history'
64import { BuiltinTypes } from '../serializer/builtins'
75
8- export { ChainAPI , HistoryAPI }
9-
106export 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
1713export 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
0 commit comments