@rlajous/sdk-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +96 -0
- package/dist/cjs/client-base.js +155 -0
- package/dist/cjs/client-base.js.map +1 -0
- package/dist/cjs/config.js +30 -0
- package/dist/cjs/config.js.map +1 -0
- package/dist/cjs/errors/authentication.js +35 -0
- package/dist/cjs/errors/authentication.js.map +1 -0
- package/dist/cjs/errors/base.js +76 -0
- package/dist/cjs/errors/base.js.map +1 -0
- package/dist/cjs/errors/index.js +16 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/errors/network.js +45 -0
- package/dist/cjs/errors/network.js.map +1 -0
- package/dist/cjs/errors/not-found.js +38 -0
- package/dist/cjs/errors/not-found.js.map +1 -0
- package/dist/cjs/errors/rate-limit.js +53 -0
- package/dist/cjs/errors/rate-limit.js.map +1 -0
- package/dist/cjs/errors/validation.js +49 -0
- package/dist/cjs/errors/validation.js.map +1 -0
- package/dist/cjs/http/client.js +335 -0
- package/dist/cjs/http/client.js.map +1 -0
- package/dist/cjs/http/index.js +11 -0
- package/dist/cjs/http/index.js.map +1 -0
- package/dist/cjs/http/retry.js +43 -0
- package/dist/cjs/http/retry.js.map +1 -0
- package/dist/cjs/index.js +48 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types/chain.js +114 -0
- package/dist/cjs/types/chain.js.map +1 -0
- package/dist/cjs/types/common.js +49 -0
- package/dist/cjs/types/common.js.map +1 -0
- package/dist/cjs/types/index.js +18 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/modules.js +64 -0
- package/dist/cjs/types/modules.js.map +1 -0
- package/dist/cjs/utils/address-validation.js +124 -0
- package/dist/cjs/utils/address-validation.js.map +1 -0
- package/dist/cjs/utils/index.js +14 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/esm/client-base.js +151 -0
- package/dist/esm/client-base.js.map +1 -0
- package/dist/esm/config.js +26 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/errors/authentication.js +31 -0
- package/dist/esm/errors/authentication.js.map +1 -0
- package/dist/esm/errors/base.js +72 -0
- package/dist/esm/errors/base.js.map +1 -0
- package/dist/esm/errors/index.js +7 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/errors/network.js +41 -0
- package/dist/esm/errors/network.js.map +1 -0
- package/dist/esm/errors/not-found.js +34 -0
- package/dist/esm/errors/not-found.js.map +1 -0
- package/dist/esm/errors/rate-limit.js +49 -0
- package/dist/esm/errors/rate-limit.js.map +1 -0
- package/dist/esm/errors/validation.js +45 -0
- package/dist/esm/errors/validation.js.map +1 -0
- package/dist/esm/http/client.js +331 -0
- package/dist/esm/http/client.js.map +1 -0
- package/dist/esm/http/index.js +3 -0
- package/dist/esm/http/index.js.map +1 -0
- package/dist/esm/http/retry.js +37 -0
- package/dist/esm/http/retry.js.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/types/chain.js +109 -0
- package/dist/esm/types/chain.js.map +1 -0
- package/dist/esm/types/common.js +46 -0
- package/dist/esm/types/common.js.map +1 -0
- package/dist/esm/types/index.js +4 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/modules.js +61 -0
- package/dist/esm/types/modules.js.map +1 -0
- package/dist/esm/utils/address-validation.js +113 -0
- package/dist/esm/utils/address-validation.js.map +1 -0
- package/dist/esm/utils/index.js +2 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/types/client-base.d.ts +94 -0
- package/dist/types/client-base.d.ts.map +1 -0
- package/dist/types/config.d.ts +124 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/errors/authentication.d.ts +24 -0
- package/dist/types/errors/authentication.d.ts.map +1 -0
- package/dist/types/errors/base.d.ts +53 -0
- package/dist/types/errors/base.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +7 -0
- package/dist/types/errors/index.d.ts.map +1 -0
- package/dist/types/errors/network.d.ts +30 -0
- package/dist/types/errors/network.d.ts.map +1 -0
- package/dist/types/errors/not-found.d.ts +27 -0
- package/dist/types/errors/not-found.d.ts.map +1 -0
- package/dist/types/errors/rate-limit.d.ts +37 -0
- package/dist/types/errors/rate-limit.d.ts.map +1 -0
- package/dist/types/errors/validation.d.ts +34 -0
- package/dist/types/errors/validation.d.ts.map +1 -0
- package/dist/types/http/client.d.ts +147 -0
- package/dist/types/http/client.d.ts.map +1 -0
- package/dist/types/http/index.d.ts +3 -0
- package/dist/types/http/index.d.ts.map +1 -0
- package/dist/types/http/retry.d.ts +32 -0
- package/dist/types/http/retry.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/chain.d.ts +60 -0
- package/dist/types/types/chain.d.ts.map +1 -0
- package/dist/types/types/common.d.ts +251 -0
- package/dist/types/types/common.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +5 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/modules.d.ts +51 -0
- package/dist/types/types/modules.d.ts.map +1 -0
- package/dist/types/utils/address-validation.d.ts +50 -0
- package/dist/types/utils/address-validation.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { WebacyError } from './base';
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when rate limit is exceeded
|
|
4
|
+
*
|
|
5
|
+
* The SDK automatically retries rate-limited requests with exponential backoff.
|
|
6
|
+
* If you're seeing this error frequently, consider reducing request frequency
|
|
7
|
+
* or upgrading your API plan.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* try {
|
|
12
|
+
* await client.addresses.analyze(address, { chain: Chain.ETH });
|
|
13
|
+
* } catch (error) {
|
|
14
|
+
* if (error instanceof RateLimitError) {
|
|
15
|
+
* console.error('Rate limited:', error.message);
|
|
16
|
+
* if (error.retryAfter) {
|
|
17
|
+
* console.log(`Retry after ${error.retryAfter} seconds`);
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class RateLimitError extends WebacyError {
|
|
24
|
+
/** When the rate limit resets (Unix timestamp) */
|
|
25
|
+
readonly resetAt?: number;
|
|
26
|
+
/** Number of seconds until reset */
|
|
27
|
+
readonly retryAfter?: number;
|
|
28
|
+
constructor(message?: string, options?: {
|
|
29
|
+
resetAt?: number;
|
|
30
|
+
retryAfter?: number;
|
|
31
|
+
requestId?: string;
|
|
32
|
+
endpoint?: string;
|
|
33
|
+
});
|
|
34
|
+
isRetryable(): boolean;
|
|
35
|
+
getRecoverySuggestion(): string;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=rate-limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../../src/errors/rate-limit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,kDAAkD;IAClD,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjC,oCAAoC;IACpC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAGlC,OAAO,SAAwB,EAC/B,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;IAavF,WAAW,IAAI,OAAO;IAItB,qBAAqB,IAAI,MAAM;CAMzC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { WebacyError } from './base';
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when request validation fails
|
|
4
|
+
*
|
|
5
|
+
* This error occurs when the provided input doesn't meet the API requirements.
|
|
6
|
+
* Common causes include invalid addresses, unsupported chains, or missing parameters.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* try {
|
|
11
|
+
* await client.addresses.analyze(address, { chain: Chain.ETH });
|
|
12
|
+
* } catch (error) {
|
|
13
|
+
* if (error instanceof ValidationError) {
|
|
14
|
+
* console.error('Validation failed:', error.message);
|
|
15
|
+
* if (error.errors) {
|
|
16
|
+
* for (const [field, messages] of Object.entries(error.errors)) {
|
|
17
|
+
* console.error(` ${field}: ${messages.join(', ')}`);
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class ValidationError extends WebacyError {
|
|
25
|
+
/** Field-level validation errors */
|
|
26
|
+
readonly errors?: Record<string, string[]>;
|
|
27
|
+
constructor(message?: string, options?: {
|
|
28
|
+
errors?: Record<string, string[]>;
|
|
29
|
+
requestId?: string;
|
|
30
|
+
endpoint?: string;
|
|
31
|
+
});
|
|
32
|
+
getRecoverySuggestion(): string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/errors/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,oCAAoC;IACpC,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;gBAGhD,OAAO,SAAsB,EAC7B,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;IAYnF,qBAAqB,IAAI,MAAM;CAOzC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { WebacyError } from '../errors';
|
|
2
|
+
import { RetryConfig } from './retry';
|
|
3
|
+
import { DebugMode, Logger } from '../config';
|
|
4
|
+
/**
|
|
5
|
+
* HTTP request configuration
|
|
6
|
+
*/
|
|
7
|
+
export interface HttpRequestConfig {
|
|
8
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
body?: unknown;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* HTTP response wrapper
|
|
16
|
+
*/
|
|
17
|
+
export interface HttpResponse<T = unknown> {
|
|
18
|
+
data: T;
|
|
19
|
+
status: number;
|
|
20
|
+
headers: Headers;
|
|
21
|
+
requestId?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Request interceptor function
|
|
25
|
+
*/
|
|
26
|
+
export type RequestInterceptor = (url: string, config: HttpRequestConfig) => HttpRequestConfig | Promise<HttpRequestConfig>;
|
|
27
|
+
/**
|
|
28
|
+
* Response interceptor function
|
|
29
|
+
*/
|
|
30
|
+
export type ResponseInterceptor<T = unknown> = (response: HttpResponse<T>) => HttpResponse<T> | Promise<HttpResponse<T>>;
|
|
31
|
+
/**
|
|
32
|
+
* Error interceptor function
|
|
33
|
+
*/
|
|
34
|
+
export type ErrorInterceptor = (error: WebacyError) => WebacyError | Promise<WebacyError>;
|
|
35
|
+
/**
|
|
36
|
+
* HTTP client configuration
|
|
37
|
+
*/
|
|
38
|
+
export interface HttpClientConfig {
|
|
39
|
+
/** Base URL for all requests */
|
|
40
|
+
baseUrl: string;
|
|
41
|
+
/** Default headers for all requests */
|
|
42
|
+
headers?: Record<string, string>;
|
|
43
|
+
/** Default timeout in milliseconds */
|
|
44
|
+
timeout?: number;
|
|
45
|
+
/** Retry configuration */
|
|
46
|
+
retry?: Partial<RetryConfig>;
|
|
47
|
+
/** Debug mode for logging */
|
|
48
|
+
debug?: DebugMode;
|
|
49
|
+
/** Custom logger instance */
|
|
50
|
+
logger?: Logger;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* HTTP client with retry support and interceptors
|
|
54
|
+
*/
|
|
55
|
+
export declare class HttpClient {
|
|
56
|
+
private readonly baseUrl;
|
|
57
|
+
private readonly defaultHeaders;
|
|
58
|
+
private readonly defaultTimeout;
|
|
59
|
+
private readonly retryConfig;
|
|
60
|
+
private readonly requestInterceptors;
|
|
61
|
+
private readonly responseInterceptors;
|
|
62
|
+
private readonly errorInterceptors;
|
|
63
|
+
private readonly debug;
|
|
64
|
+
private readonly logger;
|
|
65
|
+
constructor(config: HttpClientConfig);
|
|
66
|
+
/**
|
|
67
|
+
* Check if request logging is enabled
|
|
68
|
+
*/
|
|
69
|
+
private shouldLogRequests;
|
|
70
|
+
/**
|
|
71
|
+
* Check if response logging is enabled
|
|
72
|
+
*/
|
|
73
|
+
private shouldLogResponses;
|
|
74
|
+
/**
|
|
75
|
+
* Check if error logging is enabled
|
|
76
|
+
*/
|
|
77
|
+
private shouldLogErrors;
|
|
78
|
+
/**
|
|
79
|
+
* Log a request
|
|
80
|
+
*/
|
|
81
|
+
private logRequest;
|
|
82
|
+
/**
|
|
83
|
+
* Log a response
|
|
84
|
+
*/
|
|
85
|
+
private logResponse;
|
|
86
|
+
/**
|
|
87
|
+
* Log an error
|
|
88
|
+
*/
|
|
89
|
+
private logError;
|
|
90
|
+
/**
|
|
91
|
+
* Sanitize request body for logging (remove sensitive data)
|
|
92
|
+
*/
|
|
93
|
+
private sanitizeBody;
|
|
94
|
+
/**
|
|
95
|
+
* Add a request interceptor
|
|
96
|
+
*/
|
|
97
|
+
addRequestInterceptor(interceptor: RequestInterceptor): void;
|
|
98
|
+
/**
|
|
99
|
+
* Add a response interceptor
|
|
100
|
+
*/
|
|
101
|
+
addResponseInterceptor(interceptor: ResponseInterceptor): void;
|
|
102
|
+
/**
|
|
103
|
+
* Add an error interceptor
|
|
104
|
+
*/
|
|
105
|
+
addErrorInterceptor(interceptor: ErrorInterceptor): void;
|
|
106
|
+
/**
|
|
107
|
+
* Make a GET request
|
|
108
|
+
*/
|
|
109
|
+
get<T>(path: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
110
|
+
/**
|
|
111
|
+
* Make a POST request
|
|
112
|
+
*/
|
|
113
|
+
post<T>(path: string, body?: unknown, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
114
|
+
/**
|
|
115
|
+
* Make a PUT request
|
|
116
|
+
*/
|
|
117
|
+
put<T>(path: string, body?: unknown, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
118
|
+
/**
|
|
119
|
+
* Make a PATCH request
|
|
120
|
+
*/
|
|
121
|
+
patch<T>(path: string, body?: unknown, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
122
|
+
/**
|
|
123
|
+
* Make a DELETE request
|
|
124
|
+
*/
|
|
125
|
+
delete<T>(path: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
126
|
+
/**
|
|
127
|
+
* Make an HTTP request with retry support
|
|
128
|
+
*/
|
|
129
|
+
private request;
|
|
130
|
+
/**
|
|
131
|
+
* Execute a single HTTP request
|
|
132
|
+
*/
|
|
133
|
+
private executeRequest;
|
|
134
|
+
/**
|
|
135
|
+
* Create an appropriate error from an HTTP response
|
|
136
|
+
*/
|
|
137
|
+
private createErrorFromResponse;
|
|
138
|
+
/**
|
|
139
|
+
* Wrap an unknown error in a WebacyError
|
|
140
|
+
*/
|
|
141
|
+
private wrapError;
|
|
142
|
+
/**
|
|
143
|
+
* Combine multiple abort signals
|
|
144
|
+
*/
|
|
145
|
+
private combineAbortSignals;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/http/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAMZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAiB,MAAM,WAAW,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,KACtB,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,OAAO,IAAI,CAC7C,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,KACtB,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhD;;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Config, type HttpResponse, type RequestInterceptor, type ResponseInterceptor, type ErrorInterceptor, } from './client';
|
|
2
|
+
export { type RetryConfig, DEFAULT_RETRY_CONFIG, calculateRetryDelay, isRetryableStatusCode, sleep, } from './retry';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/http/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,KAAK,WAAW,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,GACN,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry configuration options
|
|
3
|
+
*/
|
|
4
|
+
export interface RetryConfig {
|
|
5
|
+
/** Maximum number of retry attempts */
|
|
6
|
+
maxRetries: number;
|
|
7
|
+
/** Initial delay between retries in milliseconds */
|
|
8
|
+
initialDelay: number;
|
|
9
|
+
/** Maximum delay between retries in milliseconds */
|
|
10
|
+
maxDelay: number;
|
|
11
|
+
/** Multiplier for exponential backoff */
|
|
12
|
+
backoffMultiplier: number;
|
|
13
|
+
/** HTTP status codes that should trigger a retry */
|
|
14
|
+
retryableStatusCodes: number[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Default retry configuration
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_RETRY_CONFIG: RetryConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Calculate delay for a retry attempt using exponential backoff with jitter
|
|
22
|
+
*/
|
|
23
|
+
export declare function calculateRetryDelay(attempt: number, config: RetryConfig, retryAfter?: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* Check if a status code is retryable
|
|
26
|
+
*/
|
|
27
|
+
export declare function isRetryableStatusCode(statusCode: number, config: RetryConfig): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Sleep for a given number of milliseconds
|
|
30
|
+
*/
|
|
31
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/http/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAMlC,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAYR;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAEtF;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { WebacyClientConfig, DEFAULT_CONFIG, buildBaseUrl, type DebugMode, type Logger, defaultLogger, } from './config';
|
|
2
|
+
export { BaseClient } from './client-base';
|
|
3
|
+
export { HttpClient, type HttpClientConfig, type HttpRequestConfig, type HttpResponse, type RequestInterceptor, type ResponseInterceptor, type ErrorInterceptor, type RetryConfig, DEFAULT_RETRY_CONFIG, } from './http';
|
|
4
|
+
export { WebacyError, AuthenticationError, RateLimitError, ValidationError, NotFoundError, NetworkError, } from './errors';
|
|
5
|
+
export { Chain, ChainCompatibility, getChainCompatibility, isEvmChain, CHAIN_IDS, CHAIN_NAMES, RiskModule, RiskScore, RiskLevel, TypeOfAddress, TokenStandard, type RiskTag, type InformationalTag, type RiskCategory, type ConsolidatedRiskResult, type OwnershipDistribution, type TopHolder, type AddressLabelInfo, type LiquidityPoolData, type LpHolder, type TokenMetadata, type TokenLinks, type BuySellTaxes, type RequestOptions, type PaginationOptions, type PaginatedResponse, } from './types';
|
|
6
|
+
export { isValidAddress, isValidEvmAddress, isValidSolanaAddress, isValidBitcoinAddress, isValidTonAddress, isValidSuiAddress, isValidStellarAddress, normalizeAddress, normalizeEvmAddress, } from './utils';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,MAAM,EACX,aAAa,GACd,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,oBAAoB,GACrB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported blockchain networks
|
|
3
|
+
*/
|
|
4
|
+
export declare enum Chain {
|
|
5
|
+
/** Ethereum Mainnet */
|
|
6
|
+
ETH = "eth",
|
|
7
|
+
/** Ethereum Sepolia Testnet */
|
|
8
|
+
SEP = "sep",
|
|
9
|
+
/** Arbitrum One */
|
|
10
|
+
ARB = "arb",
|
|
11
|
+
/** Polygon (MATIC) */
|
|
12
|
+
POL = "pol",
|
|
13
|
+
/** Solana */
|
|
14
|
+
SOL = "sol",
|
|
15
|
+
/** Optimism */
|
|
16
|
+
OPT = "opt",
|
|
17
|
+
/** Base */
|
|
18
|
+
BASE = "base",
|
|
19
|
+
/** BNB Smart Chain */
|
|
20
|
+
BSC = "bsc",
|
|
21
|
+
/** TON (The Open Network) */
|
|
22
|
+
TON = "ton",
|
|
23
|
+
/** Sei */
|
|
24
|
+
SEI = "sei",
|
|
25
|
+
/** Bitcoin */
|
|
26
|
+
BTC = "btc",
|
|
27
|
+
/** Sui */
|
|
28
|
+
SUI = "sui",
|
|
29
|
+
/** Stellar */
|
|
30
|
+
STELLAR = "stellar"
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Chain compatibility groups for feature detection
|
|
34
|
+
*/
|
|
35
|
+
export declare enum ChainCompatibility {
|
|
36
|
+
EVM = "EVM",
|
|
37
|
+
SOLANA = "SOLANA",
|
|
38
|
+
TON = "TON",
|
|
39
|
+
BTC = "BTC",
|
|
40
|
+
SEI = "SEI",
|
|
41
|
+
SUI = "SUI",
|
|
42
|
+
STELLAR = "STELLAR"
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get the compatibility group for a chain
|
|
46
|
+
*/
|
|
47
|
+
export declare function getChainCompatibility(chain: Chain): ChainCompatibility;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a chain is EVM-compatible
|
|
50
|
+
*/
|
|
51
|
+
export declare function isEvmChain(chain: Chain): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Chain ID mapping for EVM chains
|
|
54
|
+
*/
|
|
55
|
+
export declare const CHAIN_IDS: Partial<Record<Chain, number>>;
|
|
56
|
+
/**
|
|
57
|
+
* Human-readable chain names
|
|
58
|
+
*/
|
|
59
|
+
export declare const CHAIN_NAMES: Record<Chain, string>;
|
|
60
|
+
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/types/chain.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,KAAK;IACf,uBAAuB;IACvB,GAAG,QAAQ;IACX,+BAA+B;IAC/B,GAAG,QAAQ;IACX,mBAAmB;IACnB,GAAG,QAAQ;IACX,sBAAsB;IACtB,GAAG,QAAQ;IACX,aAAa;IACb,GAAG,QAAQ;IACX,eAAe;IACf,GAAG,QAAQ;IACX,WAAW;IACX,IAAI,SAAS;IACb,sBAAsB;IACtB,GAAG,QAAQ;IACX,6BAA6B;IAC7B,GAAG,QAAQ;IACX,UAAU;IACV,GAAG,QAAQ;IACX,cAAc;IACd,GAAG,QAAQ;IACX,UAAU;IACV,GAAG,QAAQ;IACX,cAAc;IACd,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC5B,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB,CAuBtE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAEhD;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAQpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAc7C,CAAC"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { Chain } from './chain';
|
|
2
|
+
import { RiskModule } from './modules';
|
|
3
|
+
/**
|
|
4
|
+
* Risk tag describing a specific security concern
|
|
5
|
+
*/
|
|
6
|
+
export interface RiskTag {
|
|
7
|
+
/** Human-readable name */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Unique identifier key */
|
|
10
|
+
key: string;
|
|
11
|
+
/** Category type */
|
|
12
|
+
type: string;
|
|
13
|
+
/** Detailed description */
|
|
14
|
+
description: string;
|
|
15
|
+
/** Severity level (0-100, higher = more severe) */
|
|
16
|
+
severity?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Informational tag (non-risk metadata)
|
|
20
|
+
*/
|
|
21
|
+
export interface InformationalTag {
|
|
22
|
+
name: string;
|
|
23
|
+
key: string;
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
/** Optional count for display (e.g., "2 active ads") */
|
|
27
|
+
count?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Risk category grouping related tags
|
|
31
|
+
*/
|
|
32
|
+
export interface RiskCategory {
|
|
33
|
+
name: string;
|
|
34
|
+
key: string;
|
|
35
|
+
gradedDescription?: {
|
|
36
|
+
high: string;
|
|
37
|
+
medium: string;
|
|
38
|
+
low: string;
|
|
39
|
+
};
|
|
40
|
+
description?: string;
|
|
41
|
+
tags?: Record<string, boolean>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Risk score classification
|
|
45
|
+
*/
|
|
46
|
+
export declare enum RiskScore {
|
|
47
|
+
HIGH = "High Risk",
|
|
48
|
+
MEDIUM = "Medium Risk",
|
|
49
|
+
LOW = "Low Risk",
|
|
50
|
+
TRUSTED = "Trusted",
|
|
51
|
+
UNKNOWN = "Unknown"
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Risk level enum
|
|
55
|
+
*/
|
|
56
|
+
export declare enum RiskLevel {
|
|
57
|
+
Low = "low",
|
|
58
|
+
Medium = "medium",
|
|
59
|
+
High = "high",
|
|
60
|
+
Suspicious = "suspicious"
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Consolidated risk analysis result
|
|
64
|
+
*/
|
|
65
|
+
export interface ConsolidatedRiskResult {
|
|
66
|
+
/** Numeric risk score (0-100) */
|
|
67
|
+
score: number;
|
|
68
|
+
/** List of identified risk tags */
|
|
69
|
+
tags: RiskTag[];
|
|
70
|
+
/** Categorized risk information */
|
|
71
|
+
categories: Record<string, RiskCategory>;
|
|
72
|
+
/** Human-readable risk classification */
|
|
73
|
+
riskScore?: RiskScore;
|
|
74
|
+
/** Additional analysis data */
|
|
75
|
+
analysis?: unknown;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Token ownership distribution data
|
|
79
|
+
*/
|
|
80
|
+
export interface OwnershipDistribution {
|
|
81
|
+
/** Total supply of the token */
|
|
82
|
+
totalSupply?: number | string;
|
|
83
|
+
/** Percentage held by top 10 holders (0-100) */
|
|
84
|
+
percentageHeldByTop10?: number;
|
|
85
|
+
/** Percentage held by top 5 holders (0-100) */
|
|
86
|
+
percentageHeldByTop5?: number;
|
|
87
|
+
/** Percentage held by top 20 holders (0-100) */
|
|
88
|
+
percentageHeldByTop20?: number;
|
|
89
|
+
/** Total number of unique holders */
|
|
90
|
+
totalHoldersCount?: number;
|
|
91
|
+
/** Top holders with balances */
|
|
92
|
+
topHolders?: TopHolder[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Top holder information
|
|
96
|
+
*/
|
|
97
|
+
export interface TopHolder {
|
|
98
|
+
/** Account address */
|
|
99
|
+
accountAddress?: string;
|
|
100
|
+
/** Human-readable alias */
|
|
101
|
+
alias?: string;
|
|
102
|
+
/** Owner address */
|
|
103
|
+
ownerAddress: string;
|
|
104
|
+
/** Token amount held */
|
|
105
|
+
amount: number | string;
|
|
106
|
+
/** Percentage of total supply */
|
|
107
|
+
percentage?: number;
|
|
108
|
+
/** Address label information */
|
|
109
|
+
label_info?: AddressLabelInfo;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Address label information
|
|
113
|
+
*/
|
|
114
|
+
export interface AddressLabelInfo {
|
|
115
|
+
/** Label name */
|
|
116
|
+
name?: string;
|
|
117
|
+
/** Label category */
|
|
118
|
+
category?: string;
|
|
119
|
+
/** Label subcategory */
|
|
120
|
+
subcategory?: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Liquidity pool data
|
|
124
|
+
*/
|
|
125
|
+
export interface LiquidityPoolData {
|
|
126
|
+
/** DEX name */
|
|
127
|
+
dexName?: string;
|
|
128
|
+
/** Pool address */
|
|
129
|
+
address?: string;
|
|
130
|
+
/** LP token mint address */
|
|
131
|
+
lpMint?: string;
|
|
132
|
+
/** Trading pair address */
|
|
133
|
+
pairAddress?: string;
|
|
134
|
+
/** Total liquidity value */
|
|
135
|
+
totalLiquidity?: number;
|
|
136
|
+
/** Type of liquidity */
|
|
137
|
+
liquidityType?: string;
|
|
138
|
+
/** Percentage of locked liquidity */
|
|
139
|
+
lockedLiquidityPercent?: number;
|
|
140
|
+
/** LP token holders */
|
|
141
|
+
lpHolders?: LpHolder[];
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* LP token holder
|
|
145
|
+
*/
|
|
146
|
+
export interface LpHolder {
|
|
147
|
+
address?: string;
|
|
148
|
+
balance?: number;
|
|
149
|
+
percent?: number;
|
|
150
|
+
isLocked?: boolean;
|
|
151
|
+
lockedUntil?: Date;
|
|
152
|
+
isContract?: boolean;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Token metadata
|
|
156
|
+
*/
|
|
157
|
+
export interface TokenMetadata {
|
|
158
|
+
/** Token name */
|
|
159
|
+
name?: string;
|
|
160
|
+
/** Token symbol */
|
|
161
|
+
symbol?: string;
|
|
162
|
+
/** Token logo URL */
|
|
163
|
+
logo?: string;
|
|
164
|
+
/** Token decimals */
|
|
165
|
+
decimals?: number;
|
|
166
|
+
/** Token description */
|
|
167
|
+
description?: string;
|
|
168
|
+
/** Social links */
|
|
169
|
+
links?: TokenLinks;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Token social and website links
|
|
173
|
+
*/
|
|
174
|
+
export interface TokenLinks {
|
|
175
|
+
website?: string;
|
|
176
|
+
twitter?: string;
|
|
177
|
+
telegram?: string;
|
|
178
|
+
discord?: string;
|
|
179
|
+
github?: string;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Buy/sell tax information
|
|
183
|
+
*/
|
|
184
|
+
export interface BuySellTaxes {
|
|
185
|
+
has_buy_tax?: boolean;
|
|
186
|
+
has_sell_tax?: boolean;
|
|
187
|
+
buy_tax_percentage?: number;
|
|
188
|
+
sell_tax_percentage?: number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Address type classification
|
|
192
|
+
*/
|
|
193
|
+
export declare enum TypeOfAddress {
|
|
194
|
+
EOA = "EOA",
|
|
195
|
+
CONTRACT = "CONTRACT",
|
|
196
|
+
TOKEN = "TOKEN",
|
|
197
|
+
CONTRACT_WALLET = "CONTRACT_WALLET",
|
|
198
|
+
MULTISIG = "MULTISIG"
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Token standard
|
|
202
|
+
*/
|
|
203
|
+
export declare enum TokenStandard {
|
|
204
|
+
ERC20 = "ERC20",
|
|
205
|
+
ERC721 = "ERC721",
|
|
206
|
+
ERC1155 = "ERC1155",
|
|
207
|
+
SPL = "SPL",
|
|
208
|
+
JETTON = "JETTON",
|
|
209
|
+
STELLAR_ASSET = "STELLAR_ASSET",
|
|
210
|
+
SUI_COIN = "SUI_COIN"
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Common request options
|
|
214
|
+
*/
|
|
215
|
+
export interface RequestOptions {
|
|
216
|
+
/** Target blockchain */
|
|
217
|
+
chain: Chain;
|
|
218
|
+
/** Specific risk modules to analyze */
|
|
219
|
+
modules?: RiskModule[];
|
|
220
|
+
/** Request timeout in milliseconds */
|
|
221
|
+
timeout?: number;
|
|
222
|
+
/** Abort signal for request cancellation */
|
|
223
|
+
signal?: AbortSignal;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Pagination options
|
|
227
|
+
*/
|
|
228
|
+
export interface PaginationOptions {
|
|
229
|
+
/** Page number (1-indexed) */
|
|
230
|
+
page?: number;
|
|
231
|
+
/** Items per page */
|
|
232
|
+
limit?: number;
|
|
233
|
+
/** Cursor for cursor-based pagination */
|
|
234
|
+
cursor?: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Paginated response wrapper
|
|
238
|
+
*/
|
|
239
|
+
export interface PaginatedResponse<T> {
|
|
240
|
+
/** Data items */
|
|
241
|
+
data: T[];
|
|
242
|
+
/** Pagination metadata */
|
|
243
|
+
pagination: {
|
|
244
|
+
page?: number;
|
|
245
|
+
limit?: number;
|
|
246
|
+
total?: number;
|
|
247
|
+
hasMore?: boolean;
|
|
248
|
+
nextCursor?: string;
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,oBAAY,SAAS;IACnB,IAAI,cAAc;IAClB,MAAM,gBAAgB;IACtB,GAAG,aAAa;IAChB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AA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IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Chain, ChainCompatibility, getChainCompatibility, isEvmChain, CHAIN_IDS, CHAIN_NAMES, } from './chain';
|
|
2
|
+
export { RiskModule } from './modules';
|
|
3
|
+
export type { RiskTag, InformationalTag, RiskCategory, ConsolidatedRiskResult, OwnershipDistribution, TopHolder, AddressLabelInfo, LiquidityPoolData, LpHolder, TokenMetadata, TokenLinks, BuySellTaxes, RequestOptions, PaginationOptions, PaginatedResponse, } from './common';
|
|
4
|
+
export { RiskScore, RiskLevel, TypeOfAddress, TokenStandard } from './common';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACV,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,YAAY,EACV,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|