@avalabs/glacier-sdk 2.8.0-canary.5825aa6.0 → 2.8.0-canary.5b79e81.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/dist/index.d.ts +11 -10
- package/dist/index.js +10 -27
- package/esm/generated/core/CancelablePromise.js +3 -6
- package/esm/generated/core/OpenAPI.d.ts +5 -5
- package/esm/generated/core/request.js +7 -22
- package/esm/generated/models/AddressActivityMetadata.d.ts +2 -2
- package/esm/generated/models/ChainInfo.d.ts +1 -1
- package/esm/generated/models/GetChainResponse.d.ts +1 -1
- package/esm/generated/models/GlacierApiFeature.d.ts +2 -1
- package/esm/generated/models/GlacierApiFeature.js +1 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -40,11 +40,11 @@ type OpenAPIConfig = {
|
|
|
40
40
|
VERSION: string;
|
|
41
41
|
WITH_CREDENTIALS: boolean;
|
|
42
42
|
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
43
|
-
TOKEN?: string | Resolver<string
|
|
44
|
-
USERNAME?: string | Resolver<string
|
|
45
|
-
PASSWORD?: string | Resolver<string
|
|
46
|
-
HEADERS?: Headers | Resolver<Headers
|
|
47
|
-
ENCODE_PATH?: (
|
|
43
|
+
TOKEN?: string | Resolver<string>;
|
|
44
|
+
USERNAME?: string | Resolver<string>;
|
|
45
|
+
PASSWORD?: string | Resolver<string>;
|
|
46
|
+
HEADERS?: Headers | Resolver<Headers>;
|
|
47
|
+
ENCODE_PATH?: (path: string) => string;
|
|
48
48
|
};
|
|
49
49
|
declare const OpenAPI: OpenAPIConfig;
|
|
50
50
|
|
|
@@ -682,11 +682,12 @@ type GetChainResponse = {
|
|
|
682
682
|
networkToken: NetworkToken;
|
|
683
683
|
chainLogoUri?: string;
|
|
684
684
|
private?: boolean;
|
|
685
|
-
enabledFeatures?: Array<'nftIndexing'>;
|
|
685
|
+
enabledFeatures?: Array<'nftIndexing' | 'webhooks'>;
|
|
686
686
|
};
|
|
687
687
|
|
|
688
688
|
declare enum GlacierApiFeature {
|
|
689
|
-
NFT_INDEXING = "nftIndexing"
|
|
689
|
+
NFT_INDEXING = "nftIndexing",
|
|
690
|
+
WEBHOOKS = "webhooks"
|
|
690
691
|
}
|
|
691
692
|
|
|
692
693
|
type ChainInfo = {
|
|
@@ -706,7 +707,7 @@ type ChainInfo = {
|
|
|
706
707
|
networkToken: NetworkToken;
|
|
707
708
|
chainLogoUri?: string;
|
|
708
709
|
private?: boolean;
|
|
709
|
-
enabledFeatures?: Array<'nftIndexing'>;
|
|
710
|
+
enabledFeatures?: Array<'nftIndexing' | 'webhooks'>;
|
|
710
711
|
};
|
|
711
712
|
|
|
712
713
|
type ListChainsResponse = {
|
|
@@ -4323,9 +4324,9 @@ declare class TeleporterService {
|
|
|
4323
4324
|
|
|
4324
4325
|
type AddressActivityMetadata = {
|
|
4325
4326
|
/**
|
|
4326
|
-
* Ethereum address for the address_activity event type
|
|
4327
|
+
* Ethereum address(es) for the address_activity event type
|
|
4327
4328
|
*/
|
|
4328
|
-
|
|
4329
|
+
addresses: Array<any[]>;
|
|
4329
4330
|
/**
|
|
4330
4331
|
* Array of hexadecimal strings of the event signatures.
|
|
4331
4332
|
*/
|
package/dist/index.js
CHANGED
|
@@ -53,16 +53,14 @@ class CancelablePromise {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
this.#isResolved = true;
|
|
56
|
-
|
|
57
|
-
this.#resolve(value);
|
|
56
|
+
this.#resolve?.(value);
|
|
58
57
|
};
|
|
59
58
|
const onReject = (reason) => {
|
|
60
59
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
61
60
|
return;
|
|
62
61
|
}
|
|
63
62
|
this.#isRejected = true;
|
|
64
|
-
|
|
65
|
-
this.#reject(reason);
|
|
63
|
+
this.#reject?.(reason);
|
|
66
64
|
};
|
|
67
65
|
const onCancel = (cancelHandler) => {
|
|
68
66
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
@@ -110,8 +108,7 @@ class CancelablePromise {
|
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
this.#cancelHandlers.length = 0;
|
|
113
|
-
|
|
114
|
-
this.#reject(new CancelError("Request aborted"));
|
|
111
|
+
this.#reject?.(new CancelError("Request aborted"));
|
|
115
112
|
}
|
|
116
113
|
get isCancelled() {
|
|
117
114
|
return this.#isCancelled;
|
|
@@ -210,12 +207,10 @@ const resolve = async (options, resolver) => {
|
|
|
210
207
|
return resolver;
|
|
211
208
|
};
|
|
212
209
|
const getHeaders = async (config, options) => {
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
resolve(options, config.HEADERS)
|
|
218
|
-
]);
|
|
210
|
+
const token = await resolve(options, config.TOKEN);
|
|
211
|
+
const username = await resolve(options, config.USERNAME);
|
|
212
|
+
const password = await resolve(options, config.PASSWORD);
|
|
213
|
+
const additionalHeaders = await resolve(options, config.HEADERS);
|
|
219
214
|
const headers = Object.entries({
|
|
220
215
|
Accept: "application/json",
|
|
221
216
|
...additionalHeaders,
|
|
@@ -231,7 +226,7 @@ const getHeaders = async (config, options) => {
|
|
|
231
226
|
const credentials = base64(`${username}:${password}`);
|
|
232
227
|
headers["Authorization"] = `Basic ${credentials}`;
|
|
233
228
|
}
|
|
234
|
-
if (options.body
|
|
229
|
+
if (options.body) {
|
|
235
230
|
if (options.mediaType) {
|
|
236
231
|
headers["Content-Type"] = options.mediaType;
|
|
237
232
|
} else if (isBlob(options.body)) {
|
|
@@ -314,20 +309,7 @@ const catchErrorCodes = (options, result) => {
|
|
|
314
309
|
throw new ApiError(options, result, error);
|
|
315
310
|
}
|
|
316
311
|
if (!result.ok) {
|
|
317
|
-
|
|
318
|
-
const errorStatusText = result.statusText ?? "unknown";
|
|
319
|
-
const errorBody = (() => {
|
|
320
|
-
try {
|
|
321
|
-
return JSON.stringify(result.body, null, 2);
|
|
322
|
-
} catch (e) {
|
|
323
|
-
return void 0;
|
|
324
|
-
}
|
|
325
|
-
})();
|
|
326
|
-
throw new ApiError(
|
|
327
|
-
options,
|
|
328
|
-
result,
|
|
329
|
-
`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
|
|
330
|
-
);
|
|
312
|
+
throw new ApiError(options, result, "Generic Error");
|
|
331
313
|
}
|
|
332
314
|
};
|
|
333
315
|
const request = (config, options) => {
|
|
@@ -1871,6 +1853,7 @@ var EVMOperationType = /* @__PURE__ */ ((EVMOperationType2) => {
|
|
|
1871
1853
|
|
|
1872
1854
|
var GlacierApiFeature = /* @__PURE__ */ ((GlacierApiFeature2) => {
|
|
1873
1855
|
GlacierApiFeature2["NFT_INDEXING"] = "nftIndexing";
|
|
1856
|
+
GlacierApiFeature2["WEBHOOKS"] = "webhooks";
|
|
1874
1857
|
return GlacierApiFeature2;
|
|
1875
1858
|
})(GlacierApiFeature || {});
|
|
1876
1859
|
|
|
@@ -28,16 +28,14 @@ class CancelablePromise {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
this.#isResolved = true;
|
|
31
|
-
|
|
32
|
-
this.#resolve(value);
|
|
31
|
+
this.#resolve?.(value);
|
|
33
32
|
};
|
|
34
33
|
const onReject = (reason) => {
|
|
35
34
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
37
|
this.#isRejected = true;
|
|
39
|
-
|
|
40
|
-
this.#reject(reason);
|
|
38
|
+
this.#reject?.(reason);
|
|
41
39
|
};
|
|
42
40
|
const onCancel = (cancelHandler) => {
|
|
43
41
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
@@ -85,8 +83,7 @@ class CancelablePromise {
|
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
this.#cancelHandlers.length = 0;
|
|
88
|
-
|
|
89
|
-
this.#reject(new CancelError("Request aborted"));
|
|
86
|
+
this.#reject?.(new CancelError("Request aborted"));
|
|
90
87
|
}
|
|
91
88
|
get isCancelled() {
|
|
92
89
|
return this.#isCancelled;
|
|
@@ -7,11 +7,11 @@ type OpenAPIConfig = {
|
|
|
7
7
|
VERSION: string;
|
|
8
8
|
WITH_CREDENTIALS: boolean;
|
|
9
9
|
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
10
|
-
TOKEN?: string | Resolver<string
|
|
11
|
-
USERNAME?: string | Resolver<string
|
|
12
|
-
PASSWORD?: string | Resolver<string
|
|
13
|
-
HEADERS?: Headers | Resolver<Headers
|
|
14
|
-
ENCODE_PATH?: (
|
|
10
|
+
TOKEN?: string | Resolver<string>;
|
|
11
|
+
USERNAME?: string | Resolver<string>;
|
|
12
|
+
PASSWORD?: string | Resolver<string>;
|
|
13
|
+
HEADERS?: Headers | Resolver<Headers>;
|
|
14
|
+
ENCODE_PATH?: (path: string) => string;
|
|
15
15
|
};
|
|
16
16
|
declare const OpenAPI: OpenAPIConfig;
|
|
17
17
|
|
|
@@ -93,12 +93,10 @@ const resolve = async (options, resolver) => {
|
|
|
93
93
|
return resolver;
|
|
94
94
|
};
|
|
95
95
|
const getHeaders = async (config, options) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
resolve(options, config.HEADERS)
|
|
101
|
-
]);
|
|
96
|
+
const token = await resolve(options, config.TOKEN);
|
|
97
|
+
const username = await resolve(options, config.USERNAME);
|
|
98
|
+
const password = await resolve(options, config.PASSWORD);
|
|
99
|
+
const additionalHeaders = await resolve(options, config.HEADERS);
|
|
102
100
|
const headers = Object.entries({
|
|
103
101
|
Accept: "application/json",
|
|
104
102
|
...additionalHeaders,
|
|
@@ -114,7 +112,7 @@ const getHeaders = async (config, options) => {
|
|
|
114
112
|
const credentials = base64(`${username}:${password}`);
|
|
115
113
|
headers["Authorization"] = `Basic ${credentials}`;
|
|
116
114
|
}
|
|
117
|
-
if (options.body
|
|
115
|
+
if (options.body) {
|
|
118
116
|
if (options.mediaType) {
|
|
119
117
|
headers["Content-Type"] = options.mediaType;
|
|
120
118
|
} else if (isBlob(options.body)) {
|
|
@@ -197,20 +195,7 @@ const catchErrorCodes = (options, result) => {
|
|
|
197
195
|
throw new ApiError(options, result, error);
|
|
198
196
|
}
|
|
199
197
|
if (!result.ok) {
|
|
200
|
-
|
|
201
|
-
const errorStatusText = result.statusText ?? "unknown";
|
|
202
|
-
const errorBody = (() => {
|
|
203
|
-
try {
|
|
204
|
-
return JSON.stringify(result.body, null, 2);
|
|
205
|
-
} catch (e) {
|
|
206
|
-
return void 0;
|
|
207
|
-
}
|
|
208
|
-
})();
|
|
209
|
-
throw new ApiError(
|
|
210
|
-
options,
|
|
211
|
-
result,
|
|
212
|
-
`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
|
|
213
|
-
);
|
|
198
|
+
throw new ApiError(options, result, "Generic Error");
|
|
214
199
|
}
|
|
215
200
|
};
|
|
216
201
|
const request = (config, options) => {
|
|
@@ -240,4 +225,4 @@ const request = (config, options) => {
|
|
|
240
225
|
});
|
|
241
226
|
};
|
|
242
227
|
|
|
243
|
-
export {
|
|
228
|
+
export { request, sendRequest };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
type AddressActivityMetadata = {
|
|
2
2
|
/**
|
|
3
|
-
* Ethereum address for the address_activity event type
|
|
3
|
+
* Ethereum address(es) for the address_activity event type
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
addresses: Array<any[]>;
|
|
6
6
|
/**
|
|
7
7
|
* Array of hexadecimal strings of the event signatures.
|
|
8
8
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/glacier-sdk",
|
|
3
|
-
"version": "2.8.0-canary.
|
|
3
|
+
"version": "2.8.0-canary.5b79e81.0+5b79e81",
|
|
4
4
|
"description": "sdk for interacting with glacier-api",
|
|
5
5
|
"author": "Oliver Wang <oliver.wang@avalabs.org>",
|
|
6
6
|
"homepage": "https://github.com/ava-labs/avalanche-sdks#readme",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"openapi-typescript-codegen": "0.
|
|
17
|
+
"openapi-typescript-codegen": "0.24.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"bugs": {
|
|
30
30
|
"url": "https://github.com/ava-labs/avalanche-sdks/issues"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "5b79e819a72eac44b3f948b968fc3275b46436aa"
|
|
33
33
|
}
|