@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 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> | undefined;
44
- USERNAME?: string | Resolver<string> | undefined;
45
- PASSWORD?: string | Resolver<string> | undefined;
46
- HEADERS?: Headers | Resolver<Headers> | undefined;
47
- ENCODE_PATH?: ((path: string) => string) | undefined;
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
- address: string;
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
- if (this.#resolve)
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
- if (this.#reject)
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
- if (this.#reject)
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 [token, username, password, additionalHeaders] = await Promise.all([
214
- resolve(options, config.TOKEN),
215
- resolve(options, config.USERNAME),
216
- resolve(options, config.PASSWORD),
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 !== void 0) {
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
- const errorStatus = result.status ?? "unknown";
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
- if (this.#resolve)
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
- if (this.#reject)
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
- if (this.#reject)
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> | undefined;
11
- USERNAME?: string | Resolver<string> | undefined;
12
- PASSWORD?: string | Resolver<string> | undefined;
13
- HEADERS?: Headers | Resolver<Headers> | undefined;
14
- ENCODE_PATH?: ((path: string) => string) | undefined;
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 [token, username, password, additionalHeaders] = await Promise.all([
97
- resolve(options, config.TOKEN),
98
- resolve(options, config.USERNAME),
99
- resolve(options, config.PASSWORD),
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 !== void 0) {
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
- const errorStatus = result.status ?? "unknown";
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 { base64, catchErrorCodes, getFormData, getHeaders, getQueryString, getRequestBody, getResponseBody, getResponseHeader, isBlob, isDefined, isFormData, isString, isStringWithValue, request, resolve, sendRequest };
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
- address: string;
5
+ addresses: Array<any[]>;
6
6
  /**
7
7
  * Array of hexadecimal strings of the event signatures.
8
8
  */
@@ -20,7 +20,7 @@ type ChainInfo = {
20
20
  networkToken: NetworkToken;
21
21
  chainLogoUri?: string;
22
22
  private?: boolean;
23
- enabledFeatures?: Array<'nftIndexing'>;
23
+ enabledFeatures?: Array<'nftIndexing' | 'webhooks'>;
24
24
  };
25
25
 
26
26
  export { ChainInfo };
@@ -20,7 +20,7 @@ type GetChainResponse = {
20
20
  networkToken: NetworkToken;
21
21
  chainLogoUri?: string;
22
22
  private?: boolean;
23
- enabledFeatures?: Array<'nftIndexing'>;
23
+ enabledFeatures?: Array<'nftIndexing' | 'webhooks'>;
24
24
  };
25
25
 
26
26
  export { GetChainResponse };
@@ -1,5 +1,6 @@
1
1
  declare enum GlacierApiFeature {
2
- NFT_INDEXING = "nftIndexing"
2
+ NFT_INDEXING = "nftIndexing",
3
+ WEBHOOKS = "webhooks"
3
4
  }
4
5
 
5
6
  export { GlacierApiFeature };
@@ -1,5 +1,6 @@
1
1
  var GlacierApiFeature = /* @__PURE__ */ ((GlacierApiFeature2) => {
2
2
  GlacierApiFeature2["NFT_INDEXING"] = "nftIndexing";
3
+ GlacierApiFeature2["WEBHOOKS"] = "webhooks";
3
4
  return GlacierApiFeature2;
4
5
  })(GlacierApiFeature || {});
5
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/glacier-sdk",
3
- "version": "2.8.0-canary.5825aa6.0+5825aa6",
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.28.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": "5825aa6baa8d4af08f75851f44f7ac69488fb46a"
32
+ "gitHead": "5b79e819a72eac44b3f948b968fc3275b46436aa"
33
33
  }