@avalabs/glacier-sdk 2.8.0-canary.f2340be.0 → 2.8.0-canary.f3e3bdc.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.
@@ -6,6 +6,14 @@ type RegisterWebhookRequest = {
6
6
  chainId: string;
7
7
  eventType: EventType;
8
8
  metadata: AddressActivityMetadata;
9
+ /**
10
+ * Whether to include traces in the webhook payload.
11
+ */
12
+ includeInternalTxs?: boolean;
13
+ /**
14
+ * Whether to include logs in the webhook payload.
15
+ */
16
+ includeLogs?: boolean;
9
17
  };
10
18
 
11
19
  export { RegisterWebhookRequest };
@@ -0,0 +1,7 @@
1
+ type RpcErrorDto = {
2
+ code: number;
3
+ message: string;
4
+ data?: Record<string, any>;
5
+ };
6
+
7
+ export { RpcErrorDto };
@@ -0,0 +1,9 @@
1
+ import { RpcErrorDto } from './RpcErrorDto.js';
2
+
3
+ type RpcErrorResponseDto = {
4
+ jsonrpc: string;
5
+ id?: (string | number);
6
+ error: RpcErrorDto;
7
+ };
8
+
9
+ export { RpcErrorResponseDto };
@@ -0,0 +1,8 @@
1
+ type RpcRequestBodyDto = {
2
+ method: string;
3
+ params?: Record<string, any>;
4
+ id?: (string | number);
5
+ jsonrpc?: string;
6
+ };
7
+
8
+ export { RpcRequestBodyDto };
@@ -0,0 +1,7 @@
1
+ type RpcSuccessResponseDto = {
2
+ jsonrpc: string;
3
+ id?: (string | number);
4
+ result: Record<string, any>;
5
+ };
6
+
7
+ export { RpcSuccessResponseDto };
@@ -5,7 +5,7 @@ type UpdateWebhookRequest = {
5
5
  description?: string;
6
6
  url?: string;
7
7
  status?: WebhookStatusType;
8
- includeTraces?: boolean;
8
+ includeInternalTxs?: boolean;
9
9
  includeLogs?: boolean;
10
10
  };
11
11
 
@@ -6,6 +6,14 @@ type WebhookResponse = {
6
6
  id: string;
7
7
  eventType: EventType;
8
8
  metadata: AddressActivityMetadata;
9
+ /**
10
+ * Whether to include traces in the webhook payload.
11
+ */
12
+ includeInternalTxs?: boolean;
13
+ /**
14
+ * Whether to include logs in the webhook payload.
15
+ */
16
+ includeLogs?: boolean;
9
17
  url: string;
10
18
  chainId: string;
11
19
  status: WebhookStatusType;
@@ -1,9 +1,6 @@
1
- import { ListWebhooksResponse } from '../models/ListWebhooksResponse.js';
2
- import { RegisterWebhookRequest } from '../models/RegisterWebhookRequest.js';
3
- import { SharedSecretsResponse } from '../models/SharedSecretsResponse.js';
4
- import { UpdateWebhookRequest } from '../models/UpdateWebhookRequest.js';
5
- import { WebhookResponse } from '../models/WebhookResponse.js';
6
- import { WebhookStatus } from '../models/WebhookStatus.js';
1
+ import { RpcErrorResponseDto } from '../models/RpcErrorResponseDto.js';
2
+ import { RpcRequestBodyDto } from '../models/RpcRequestBodyDto.js';
3
+ import { RpcSuccessResponseDto } from '../models/RpcSuccessResponseDto.js';
7
4
  import { CancelablePromise } from '../core/CancelablePromise.js';
8
5
  import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
9
6
 
@@ -16,85 +13,18 @@ declare class DefaultService {
16
13
  */
17
14
  mediaControllerUploadImage(): CancelablePromise<any>;
18
15
  /**
19
- * Register a webhook
20
- * Registers a new webhook.
21
- * @returns WebhookResponse
22
- * @throws ApiError
23
- */
24
- registerWebhook({ requestBody, }: {
25
- requestBody: RegisterWebhookRequest;
26
- }): CancelablePromise<WebhookResponse>;
27
- /**
28
- * List webhooks
29
- * Lists webhooks for the user.
30
- * @returns ListWebhooksResponse
31
- * @throws ApiError
32
- */
33
- listWebhooks({ pageToken, pageSize, status, }: {
34
- /**
35
- * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
36
- */
37
- pageToken?: string;
38
- /**
39
- * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
40
- */
41
- pageSize?: number;
42
- /**
43
- * Status of the webhook. Use "active" to return only active webhooks, "inactive" to return only inactive webhooks. Else if no status is provided, all configured webhooks will be returned.
44
- */
45
- status?: WebhookStatus;
46
- }): CancelablePromise<ListWebhooksResponse>;
47
- /**
48
- * Get a webhook by ID
49
- * Retrieves a webhook by ID.
50
- * @returns WebhookResponse
51
- * @throws ApiError
52
- */
53
- getWebhook({ id, }: {
54
- /**
55
- * The webhook identifier.
56
- */
57
- id: string;
58
- }): CancelablePromise<WebhookResponse>;
59
- /**
60
- * Deactivate a webhook
61
- * Deactivates a webhook by ID.
62
- * @returns WebhookResponse
63
- * @throws ApiError
64
- */
65
- deactivateWebhook({ id, }: {
66
- /**
67
- * The webhook identifier.
68
- */
69
- id: string;
70
- }): CancelablePromise<WebhookResponse>;
71
- /**
72
- * Update a webhook
73
- * Updates an existing webhook.
74
- * @returns WebhookResponse
16
+ * Calls JSON-RPC method
17
+ * Calls JSON-RPC method.
18
+ * @returns any
75
19
  * @throws ApiError
76
20
  */
77
- updateWebhook({ id, requestBody, }: {
21
+ rpc({ chainId, requestBody, }: {
78
22
  /**
79
- * The webhook identifier.
23
+ * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids.
80
24
  */
81
- id: string;
82
- requestBody: UpdateWebhookRequest;
83
- }): CancelablePromise<WebhookResponse>;
84
- /**
85
- * Generate a shared secret
86
- * Generates a new shared secret.
87
- * @returns SharedSecretsResponse
88
- * @throws ApiError
89
- */
90
- generateSharedSecret(): CancelablePromise<SharedSecretsResponse>;
91
- /**
92
- * Get a shared secret
93
- * Get a previously generated shared secret.
94
- * @returns SharedSecretsResponse
95
- * @throws ApiError
96
- */
97
- getSharedSecret(): CancelablePromise<SharedSecretsResponse>;
25
+ chainId: string;
26
+ requestBody: (RpcRequestBodyDto | Array<RpcRequestBodyDto>);
27
+ }): CancelablePromise<(RpcSuccessResponseDto | RpcErrorResponseDto)>;
98
28
  }
99
29
 
100
30
  export { DefaultService };
@@ -8,77 +8,21 @@ class DefaultService {
8
8
  url: "/v1/media/uploadImage"
9
9
  });
10
10
  }
11
- registerWebhook({
11
+ rpc({
12
+ chainId,
12
13
  requestBody
13
14
  }) {
14
15
  return this.httpRequest.request({
15
16
  method: "POST",
16
- url: "/v1/webhooks",
17
- body: requestBody,
18
- mediaType: "application/json"
19
- });
20
- }
21
- listWebhooks({
22
- pageToken,
23
- pageSize = 10,
24
- status
25
- }) {
26
- return this.httpRequest.request({
27
- method: "GET",
28
- url: "/v1/webhooks",
29
- query: {
30
- "pageToken": pageToken,
31
- "pageSize": pageSize,
32
- "status": status
33
- }
34
- });
35
- }
36
- getWebhook({
37
- id
38
- }) {
39
- return this.httpRequest.request({
40
- method: "GET",
41
- url: "/v1/webhooks/{id}",
42
- path: {
43
- "id": id
44
- }
45
- });
46
- }
47
- deactivateWebhook({
48
- id
49
- }) {
50
- return this.httpRequest.request({
51
- method: "DELETE",
52
- url: "/v1/webhooks/{id}",
17
+ url: "/v1/ext/bc/{chainId}/rpc",
53
18
  path: {
54
- "id": id
55
- }
56
- });
57
- }
58
- updateWebhook({
59
- id,
60
- requestBody
61
- }) {
62
- return this.httpRequest.request({
63
- method: "PATCH",
64
- url: "/v1/webhooks/{id}",
65
- path: {
66
- "id": id
19
+ "chainId": chainId
67
20
  },
68
21
  body: requestBody,
69
- mediaType: "application/json"
70
- });
71
- }
72
- generateSharedSecret() {
73
- return this.httpRequest.request({
74
- method: "POST",
75
- url: "/v1/webhooks:generateOrRotateSharedSecret"
76
- });
77
- }
78
- getSharedSecret() {
79
- return this.httpRequest.request({
80
- method: "GET",
81
- url: "/v1/webhooks:getSharedSecret"
22
+ mediaType: "application/json",
23
+ errors: {
24
+ 504: `Request timed out`
25
+ }
82
26
  });
83
27
  }
84
28
  }
@@ -170,7 +170,7 @@ declare class PrimaryNetworkService {
170
170
  /**
171
171
  * The subnet ID to filter by. If not provided, then all subnets will be returned.
172
172
  */
173
- subnetId?: string;
173
+ subnetId?: any;
174
174
  }): CancelablePromise<ListValidatorDetailsResponse>;
175
175
  /**
176
176
  * Get single validator details
@@ -0,0 +1,95 @@
1
+ import { ListWebhooksResponse } from '../models/ListWebhooksResponse.js';
2
+ import { RegisterWebhookRequest } from '../models/RegisterWebhookRequest.js';
3
+ import { SharedSecretsResponse } from '../models/SharedSecretsResponse.js';
4
+ import { UpdateWebhookRequest } from '../models/UpdateWebhookRequest.js';
5
+ import { WebhookResponse } from '../models/WebhookResponse.js';
6
+ import { WebhookStatus } from '../models/WebhookStatus.js';
7
+ import { CancelablePromise } from '../core/CancelablePromise.js';
8
+ import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
9
+
10
+ declare class WebhooksService {
11
+ readonly httpRequest: BaseHttpRequest;
12
+ constructor(httpRequest: BaseHttpRequest);
13
+ /**
14
+ * Register a webhook
15
+ * Registers a new webhook.
16
+ * @returns WebhookResponse
17
+ * @throws ApiError
18
+ */
19
+ registerWebhook({ requestBody, }: {
20
+ requestBody: RegisterWebhookRequest;
21
+ }): CancelablePromise<WebhookResponse>;
22
+ /**
23
+ * List webhooks
24
+ * Lists webhooks for the user.
25
+ * @returns ListWebhooksResponse
26
+ * @throws ApiError
27
+ */
28
+ listWebhooks({ pageToken, pageSize, status, }: {
29
+ /**
30
+ * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
31
+ */
32
+ pageToken?: string;
33
+ /**
34
+ * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
35
+ */
36
+ pageSize?: number;
37
+ /**
38
+ * Status of the webhook. Use "active" to return only active webhooks, "inactive" to return only inactive webhooks. Else if no status is provided, all configured webhooks will be returned.
39
+ */
40
+ status?: WebhookStatus;
41
+ }): CancelablePromise<ListWebhooksResponse>;
42
+ /**
43
+ * Get a webhook by ID
44
+ * Retrieves a webhook by ID.
45
+ * @returns WebhookResponse
46
+ * @throws ApiError
47
+ */
48
+ getWebhook({ id, }: {
49
+ /**
50
+ * The webhook identifier.
51
+ */
52
+ id: string;
53
+ }): CancelablePromise<WebhookResponse>;
54
+ /**
55
+ * Deactivate a webhook
56
+ * Deactivates a webhook by ID.
57
+ * @returns WebhookResponse
58
+ * @throws ApiError
59
+ */
60
+ deactivateWebhook({ id, }: {
61
+ /**
62
+ * The webhook identifier.
63
+ */
64
+ id: string;
65
+ }): CancelablePromise<WebhookResponse>;
66
+ /**
67
+ * Update a webhook
68
+ * Updates an existing webhook.
69
+ * @returns WebhookResponse
70
+ * @throws ApiError
71
+ */
72
+ updateWebhook({ id, requestBody, }: {
73
+ /**
74
+ * The webhook identifier.
75
+ */
76
+ id: string;
77
+ requestBody: UpdateWebhookRequest;
78
+ }): CancelablePromise<WebhookResponse>;
79
+ /**
80
+ * Generate a shared secret
81
+ * Generates a new shared secret.
82
+ * @returns SharedSecretsResponse
83
+ * @throws ApiError
84
+ */
85
+ generateSharedSecret(): CancelablePromise<SharedSecretsResponse>;
86
+ /**
87
+ * Get a shared secret
88
+ * Get a previously generated shared secret.
89
+ * @returns SharedSecretsResponse
90
+ * @throws ApiError
91
+ */
92
+ getSharedSecret(): CancelablePromise<SharedSecretsResponse>;
93
+ }
94
+
95
+ export { WebhooksService };
@@ -0,0 +1,80 @@
1
+ class WebhooksService {
2
+ constructor(httpRequest) {
3
+ this.httpRequest = httpRequest;
4
+ }
5
+ registerWebhook({
6
+ requestBody
7
+ }) {
8
+ return this.httpRequest.request({
9
+ method: "POST",
10
+ url: "/v1/webhooks",
11
+ body: requestBody,
12
+ mediaType: "application/json"
13
+ });
14
+ }
15
+ listWebhooks({
16
+ pageToken,
17
+ pageSize = 10,
18
+ status
19
+ }) {
20
+ return this.httpRequest.request({
21
+ method: "GET",
22
+ url: "/v1/webhooks",
23
+ query: {
24
+ "pageToken": pageToken,
25
+ "pageSize": pageSize,
26
+ "status": status
27
+ }
28
+ });
29
+ }
30
+ getWebhook({
31
+ id
32
+ }) {
33
+ return this.httpRequest.request({
34
+ method: "GET",
35
+ url: "/v1/webhooks/{id}",
36
+ path: {
37
+ "id": id
38
+ }
39
+ });
40
+ }
41
+ deactivateWebhook({
42
+ id
43
+ }) {
44
+ return this.httpRequest.request({
45
+ method: "DELETE",
46
+ url: "/v1/webhooks/{id}",
47
+ path: {
48
+ "id": id
49
+ }
50
+ });
51
+ }
52
+ updateWebhook({
53
+ id,
54
+ requestBody
55
+ }) {
56
+ return this.httpRequest.request({
57
+ method: "PATCH",
58
+ url: "/v1/webhooks/{id}",
59
+ path: {
60
+ "id": id
61
+ },
62
+ body: requestBody,
63
+ mediaType: "application/json"
64
+ });
65
+ }
66
+ generateSharedSecret() {
67
+ return this.httpRequest.request({
68
+ method: "POST",
69
+ url: "/v1/webhooks:generateOrRotateSharedSecret"
70
+ });
71
+ }
72
+ getSharedSecret() {
73
+ return this.httpRequest.request({
74
+ method: "GET",
75
+ url: "/v1/webhooks:getSharedSecret"
76
+ });
77
+ }
78
+ }
79
+
80
+ export { WebhooksService };
package/esm/index.d.ts CHANGED
@@ -146,6 +146,10 @@ export { ResourceLinkType } from './generated/models/ResourceLinkType.js';
146
146
  export { Rewards } from './generated/models/Rewards.js';
147
147
  export { RewardType } from './generated/models/RewardType.js';
148
148
  export { RichAddress } from './generated/models/RichAddress.js';
149
+ export { RpcErrorDto } from './generated/models/RpcErrorDto.js';
150
+ export { RpcErrorResponseDto } from './generated/models/RpcErrorResponseDto.js';
151
+ export { RpcRequestBodyDto } from './generated/models/RpcRequestBodyDto.js';
152
+ export { RpcSuccessResponseDto } from './generated/models/RpcSuccessResponseDto.js';
149
153
  export { SharedSecretsResponse } from './generated/models/SharedSecretsResponse.js';
150
154
  export { SortOrder } from './generated/models/SortOrder.js';
151
155
  export { StakingDistribution } from './generated/models/StakingDistribution.js';
@@ -199,3 +203,4 @@ export { PrimaryNetworkTransactionsService } from './generated/services/PrimaryN
199
203
  export { PrimaryNetworkUtxOsService } from './generated/services/PrimaryNetworkUtxOsService.js';
200
204
  export { PrimaryNetworkVerticesService } from './generated/services/PrimaryNetworkVerticesService.js';
201
205
  export { TeleporterService } from './generated/services/TeleporterService.js';
206
+ export { WebhooksService } from './generated/services/WebhooksService.js';
package/esm/index.js CHANGED
@@ -84,3 +84,4 @@ export { PrimaryNetworkTransactionsService } from './generated/services/PrimaryN
84
84
  export { PrimaryNetworkUtxOsService } from './generated/services/PrimaryNetworkUtxOsService.js';
85
85
  export { PrimaryNetworkVerticesService } from './generated/services/PrimaryNetworkVerticesService.js';
86
86
  export { TeleporterService } from './generated/services/TeleporterService.js';
87
+ export { WebhooksService } from './generated/services/WebhooksService.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/glacier-sdk",
3
- "version": "2.8.0-canary.f2340be.0+f2340be",
3
+ "version": "2.8.0-canary.f3e3bdc.0+f3e3bdc",
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.23.0"
17
+ "openapi-typescript-codegen": "0.28.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": "f2340bee966c6dae4e139f5a94a44506f64523e5"
32
+ "gitHead": "f3e3bdcefe59928f3efd0249c63ef8821e2621cc"
33
33
  }