-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathALGO_UTBC.d.ts
46 lines (46 loc) · 1.97 KB
/
ALGO_UTBC.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { BaseHTTPClient, BaseHTTPClientResponse } from 'algosdk';
import type { Query } from 'algosdk/dist/types/src/client/baseHTTPClient';
export interface AlgodTokenHeader {
'X-Algo-API-Token': string;
}
export interface IndexerTokenHeader {
'X-Indexer-API-Token': string;
}
export interface KMDTokenHeader {
'X-KMD-API-Token': string;
}
export interface CustomTokenHeader {
[headerName: string]: string;
}
export type TokenHeader = AlgodTokenHeader | IndexerTokenHeader | KMDTokenHeader | CustomTokenHeader;
/**
* Implementation of BaseHTTPClient that uses a URL and a token
* and make the REST queries using superagent.
* This is the default implementation of BaseHTTPClient.
*/
export declare class URLTokenBaseHTTPClient implements BaseHTTPClient {
private defaultHeaders;
private readonly baseURL;
private readonly tokenHeader;
constructor(tokenHeader: TokenHeader, baseServer: string, port?: string | number, defaultHeaders?: Record<string, any>);
/**
* Compute the URL for a path relative to the instance's address
* @param relativePath - A path string
* @returns A URL string
*/
private addressWithPath;
/**
* Convert a superagent response to a valid BaseHTTPClientResponse
* Modify the superagent response
* @private
*/
private static superagentToHTTPClientResponse;
/**
* Make a superagent error more readable. For more info, see https://github.com/visionmedia/superagent/issues/1074
*/
private static formatSuperagentError;
get(relativePath: string, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
post(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
delete(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
}
//# sourceMappingURL=ALGO_UTBC.d.ts.map