@avalabs/glacier-sdk 2.8.0-alpha.174 → 2.8.0-alpha.176

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.js CHANGED
@@ -33,71 +33,73 @@ class CancelError extends Error {
33
33
  }
34
34
  }
35
35
  class CancelablePromise {
36
- [Symbol.toStringTag];
37
- _isResolved;
38
- _isRejected;
39
- _isCancelled;
40
- _cancelHandlers;
41
- _promise;
42
- _resolve;
43
- _reject;
36
+ #isResolved;
37
+ #isRejected;
38
+ #isCancelled;
39
+ #cancelHandlers;
40
+ #promise;
41
+ #resolve;
42
+ #reject;
44
43
  constructor(executor) {
45
- this._isResolved = false;
46
- this._isRejected = false;
47
- this._isCancelled = false;
48
- this._cancelHandlers = [];
49
- this._promise = new Promise((resolve, reject) => {
50
- this._resolve = resolve;
51
- this._reject = reject;
44
+ this.#isResolved = false;
45
+ this.#isRejected = false;
46
+ this.#isCancelled = false;
47
+ this.#cancelHandlers = [];
48
+ this.#promise = new Promise((resolve, reject) => {
49
+ this.#resolve = resolve;
50
+ this.#reject = reject;
52
51
  const onResolve = (value) => {
53
- if (this._isResolved || this._isRejected || this._isCancelled) {
52
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
54
53
  return;
55
54
  }
56
- this._isResolved = true;
57
- this._resolve?.(value);
55
+ this.#isResolved = true;
56
+ this.#resolve?.(value);
58
57
  };
59
58
  const onReject = (reason) => {
60
- if (this._isResolved || this._isRejected || this._isCancelled) {
59
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
61
60
  return;
62
61
  }
63
- this._isRejected = true;
64
- this._reject?.(reason);
62
+ this.#isRejected = true;
63
+ this.#reject?.(reason);
65
64
  };
66
65
  const onCancel = (cancelHandler) => {
67
- if (this._isResolved || this._isRejected || this._isCancelled) {
66
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
68
67
  return;
69
68
  }
70
- this._cancelHandlers.push(cancelHandler);
69
+ this.#cancelHandlers.push(cancelHandler);
71
70
  };
72
71
  Object.defineProperty(onCancel, "isResolved", {
73
- get: () => this._isResolved
72
+ get: () => this.#isResolved
74
73
  });
75
74
  Object.defineProperty(onCancel, "isRejected", {
76
- get: () => this._isRejected
75
+ get: () => this.#isRejected
77
76
  });
78
77
  Object.defineProperty(onCancel, "isCancelled", {
79
- get: () => this._isCancelled
78
+ get: () => this.#isCancelled
80
79
  });
81
80
  return executor(onResolve, onReject, onCancel);
82
81
  });
83
82
  }
83
+ get [Symbol.toStringTag]() {
84
+ return "Cancellable Promise";
85
+ }
84
86
  then(onFulfilled, onRejected) {
85
- return this._promise.then(onFulfilled, onRejected);
87
+ return this.#promise.then(onFulfilled, onRejected);
86
88
  }
87
89
  catch(onRejected) {
88
- return this._promise.catch(onRejected);
90
+ return this.#promise.catch(onRejected);
89
91
  }
90
92
  finally(onFinally) {
91
- return this._promise.finally(onFinally);
93
+ return this.#promise.finally(onFinally);
92
94
  }
93
95
  cancel() {
94
- if (this._isResolved || this._isRejected || this._isCancelled) {
96
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
95
97
  return;
96
98
  }
97
- this._isCancelled = true;
98
- if (this._cancelHandlers.length) {
99
+ this.#isCancelled = true;
100
+ if (this.#cancelHandlers.length) {
99
101
  try {
100
- for (const cancelHandler of this._cancelHandlers) {
102
+ for (const cancelHandler of this.#cancelHandlers) {
101
103
  cancelHandler();
102
104
  }
103
105
  } catch (error) {
@@ -105,11 +107,11 @@ class CancelablePromise {
105
107
  return;
106
108
  }
107
109
  }
108
- this._cancelHandlers.length = 0;
109
- this._reject?.(new CancelError("Request aborted"));
110
+ this.#cancelHandlers.length = 0;
111
+ this.#reject?.(new CancelError("Request aborted"));
110
112
  }
111
113
  get isCancelled() {
112
- return this._isCancelled;
114
+ return this.#isCancelled;
113
115
  }
114
116
  }
115
117
 
@@ -238,7 +240,7 @@ const getHeaders = async (config, options) => {
238
240
  return new Headers(headers);
239
241
  };
240
242
  const getRequestBody = (options) => {
241
- if (options.body) {
243
+ if (options.body !== void 0) {
242
244
  if (options.mediaType?.includes("/json")) {
243
245
  return JSON.stringify(options.body);
244
246
  } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
@@ -277,7 +279,8 @@ const getResponseBody = async (response) => {
277
279
  try {
278
280
  const contentType = response.headers.get("Content-Type");
279
281
  if (contentType) {
280
- const isJSON = contentType.toLowerCase().startsWith("application/json");
282
+ const jsonTypes = ["application/json", "application/problem+json"];
283
+ const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type));
281
284
  if (isJSON) {
282
285
  return await response.json();
283
286
  } else {
@@ -355,79 +358,6 @@ class DefaultService {
355
358
  url: "/v1/media/uploadImage"
356
359
  });
357
360
  }
358
- registerWebhook({
359
- requestBody
360
- }) {
361
- return this.httpRequest.request({
362
- method: "POST",
363
- url: "/v1/webhooks",
364
- body: requestBody,
365
- mediaType: "application/json"
366
- });
367
- }
368
- listWebhooks({
369
- pageToken,
370
- pageSize = 10,
371
- status
372
- }) {
373
- return this.httpRequest.request({
374
- method: "GET",
375
- url: "/v1/webhooks",
376
- query: {
377
- "pageToken": pageToken,
378
- "pageSize": pageSize,
379
- "status": status
380
- }
381
- });
382
- }
383
- getWebhook({
384
- id
385
- }) {
386
- return this.httpRequest.request({
387
- method: "GET",
388
- url: "/v1/webhooks/{id}",
389
- path: {
390
- "id": id
391
- }
392
- });
393
- }
394
- deactivateWebhook({
395
- id
396
- }) {
397
- return this.httpRequest.request({
398
- method: "DELETE",
399
- url: "/v1/webhooks/{id}",
400
- path: {
401
- "id": id
402
- }
403
- });
404
- }
405
- updateWebhook({
406
- id,
407
- requestBody
408
- }) {
409
- return this.httpRequest.request({
410
- method: "PATCH",
411
- url: "/v1/webhooks/{id}",
412
- path: {
413
- "id": id
414
- },
415
- body: requestBody,
416
- mediaType: "application/json"
417
- });
418
- }
419
- generateSharedSecret() {
420
- return this.httpRequest.request({
421
- method: "POST",
422
- url: "/v1/webhooks:generateOrRotateSharedSecret"
423
- });
424
- }
425
- getSharedSecret() {
426
- return this.httpRequest.request({
427
- method: "GET",
428
- url: "/v1/webhooks:getSharedSecret"
429
- });
430
- }
431
361
  }
432
362
 
433
363
  class EvmBalancesService {
@@ -1505,6 +1435,29 @@ class PrimaryNetworkVerticesService {
1505
1435
  }
1506
1436
  }
1507
1437
 
1438
+ class RpcService {
1439
+ constructor(httpRequest) {
1440
+ this.httpRequest = httpRequest;
1441
+ }
1442
+ rpc({
1443
+ chainId,
1444
+ requestBody
1445
+ }) {
1446
+ return this.httpRequest.request({
1447
+ method: "POST",
1448
+ url: "/v1/ext/bc/{chainId}/rpc",
1449
+ path: {
1450
+ "chainId": chainId
1451
+ },
1452
+ body: requestBody,
1453
+ mediaType: "application/json",
1454
+ errors: {
1455
+ 504: `Request timed out`
1456
+ }
1457
+ });
1458
+ }
1459
+ }
1460
+
1508
1461
  class TeleporterService {
1509
1462
  constructor(httpRequest) {
1510
1463
  this.httpRequest = httpRequest;
@@ -1543,6 +1496,85 @@ class TeleporterService {
1543
1496
  }
1544
1497
  }
1545
1498
 
1499
+ class WebhooksService {
1500
+ constructor(httpRequest) {
1501
+ this.httpRequest = httpRequest;
1502
+ }
1503
+ registerWebhook({
1504
+ requestBody
1505
+ }) {
1506
+ return this.httpRequest.request({
1507
+ method: "POST",
1508
+ url: "/v1/webhooks",
1509
+ body: requestBody,
1510
+ mediaType: "application/json"
1511
+ });
1512
+ }
1513
+ listWebhooks({
1514
+ pageToken,
1515
+ pageSize = 10,
1516
+ status
1517
+ }) {
1518
+ return this.httpRequest.request({
1519
+ method: "GET",
1520
+ url: "/v1/webhooks",
1521
+ query: {
1522
+ "pageToken": pageToken,
1523
+ "pageSize": pageSize,
1524
+ "status": status
1525
+ }
1526
+ });
1527
+ }
1528
+ getWebhook({
1529
+ id
1530
+ }) {
1531
+ return this.httpRequest.request({
1532
+ method: "GET",
1533
+ url: "/v1/webhooks/{id}",
1534
+ path: {
1535
+ "id": id
1536
+ }
1537
+ });
1538
+ }
1539
+ deactivateWebhook({
1540
+ id
1541
+ }) {
1542
+ return this.httpRequest.request({
1543
+ method: "DELETE",
1544
+ url: "/v1/webhooks/{id}",
1545
+ path: {
1546
+ "id": id
1547
+ }
1548
+ });
1549
+ }
1550
+ updateWebhook({
1551
+ id,
1552
+ requestBody
1553
+ }) {
1554
+ return this.httpRequest.request({
1555
+ method: "PATCH",
1556
+ url: "/v1/webhooks/{id}",
1557
+ path: {
1558
+ "id": id
1559
+ },
1560
+ body: requestBody,
1561
+ mediaType: "application/json"
1562
+ });
1563
+ }
1564
+ generateSharedSecret() {
1565
+ return this.httpRequest.request({
1566
+ method: "POST",
1567
+ url: "/v1/webhooks:generateOrRotateSharedSecret"
1568
+ });
1569
+ }
1570
+ getSharedSecret() {
1571
+ return this.httpRequest.request({
1572
+ method: "GET",
1573
+ url: "/v1/webhooks:getSharedSecret"
1574
+ });
1575
+ }
1576
+ }
1577
+
1546
1578
  class Glacier {
1547
1579
  default;
1548
1580
  evmBalances;
@@ -1560,7 +1592,9 @@ class Glacier {
1560
1592
  primaryNetworkTransactions;
1561
1593
  primaryNetworkUtxOs;
1562
1594
  primaryNetworkVertices;
1595
+ rpc;
1563
1596
  teleporter;
1597
+ webhooks;
1564
1598
  request;
1565
1599
  constructor(config, HttpRequest = FetchHttpRequest) {
1566
1600
  this.request = new HttpRequest({
@@ -1590,7 +1624,9 @@ class Glacier {
1590
1624
  this.primaryNetworkTransactions = new PrimaryNetworkTransactionsService(this.request);
1591
1625
  this.primaryNetworkUtxOs = new PrimaryNetworkUtxOsService(this.request);
1592
1626
  this.primaryNetworkVertices = new PrimaryNetworkVerticesService(this.request);
1627
+ this.rpc = new RpcService(this.request);
1593
1628
  this.teleporter = new TeleporterService(this.request);
1629
+ this.webhooks = new WebhooksService(this.request);
1594
1630
  }
1595
1631
  }
1596
1632
 
@@ -2164,6 +2200,7 @@ exports.PrimaryNetworkUtxOsService = PrimaryNetworkUtxOsService;
2164
2200
  exports.PrimaryNetworkVerticesService = PrimaryNetworkVerticesService;
2165
2201
  exports.ResourceLinkType = ResourceLinkType;
2166
2202
  exports.RewardType = RewardType;
2203
+ exports.RpcService = RpcService;
2167
2204
  exports.SortOrder = SortOrder;
2168
2205
  exports.TeleporterService = TeleporterService;
2169
2206
  exports.TransactionMethodType = TransactionMethodType;
@@ -2173,5 +2210,6 @@ exports.ValidationStatusType = ValidationStatusType;
2173
2210
  exports.VmName = VmName;
2174
2211
  exports.WebhookStatus = WebhookStatus;
2175
2212
  exports.WebhookStatusType = WebhookStatusType;
2213
+ exports.WebhooksService = WebhooksService;
2176
2214
  exports.XChainId = XChainId;
2177
2215
  exports.XChainTransactionType = XChainTransactionType;
@@ -16,7 +16,9 @@ import { PrimaryNetworkRewardsService } from './services/PrimaryNetworkRewardsSe
16
16
  import { PrimaryNetworkTransactionsService } from './services/PrimaryNetworkTransactionsService.js';
17
17
  import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsService.js';
18
18
  import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
19
+ import { RpcService } from './services/RpcService.js';
19
20
  import { TeleporterService } from './services/TeleporterService.js';
21
+ import { WebhooksService } from './services/WebhooksService.js';
20
22
 
21
23
  type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
22
24
  declare class Glacier {
@@ -36,7 +38,9 @@ declare class Glacier {
36
38
  readonly primaryNetworkTransactions: PrimaryNetworkTransactionsService;
37
39
  readonly primaryNetworkUtxOs: PrimaryNetworkUtxOsService;
38
40
  readonly primaryNetworkVertices: PrimaryNetworkVerticesService;
41
+ readonly rpc: RpcService;
39
42
  readonly teleporter: TeleporterService;
43
+ readonly webhooks: WebhooksService;
40
44
  readonly request: BaseHttpRequest;
41
45
  constructor(config?: Partial<OpenAPIConfig>, HttpRequest?: HttpRequestConstructor);
42
46
  }
@@ -15,7 +15,9 @@ import { PrimaryNetworkRewardsService } from './services/PrimaryNetworkRewardsSe
15
15
  import { PrimaryNetworkTransactionsService } from './services/PrimaryNetworkTransactionsService.js';
16
16
  import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsService.js';
17
17
  import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
18
+ import { RpcService } from './services/RpcService.js';
18
19
  import { TeleporterService } from './services/TeleporterService.js';
20
+ import { WebhooksService } from './services/WebhooksService.js';
19
21
 
20
22
  class Glacier {
21
23
  default;
@@ -34,7 +36,9 @@ class Glacier {
34
36
  primaryNetworkTransactions;
35
37
  primaryNetworkUtxOs;
36
38
  primaryNetworkVertices;
39
+ rpc;
37
40
  teleporter;
41
+ webhooks;
38
42
  request;
39
43
  constructor(config, HttpRequest = FetchHttpRequest) {
40
44
  this.request = new HttpRequest({
@@ -64,7 +68,9 @@ class Glacier {
64
68
  this.primaryNetworkTransactions = new PrimaryNetworkTransactionsService(this.request);
65
69
  this.primaryNetworkUtxOs = new PrimaryNetworkUtxOsService(this.request);
66
70
  this.primaryNetworkVertices = new PrimaryNetworkVerticesService(this.request);
71
+ this.rpc = new RpcService(this.request);
67
72
  this.teleporter = new TeleporterService(this.request);
73
+ this.webhooks = new WebhooksService(this.request);
68
74
  }
69
75
  }
70
76
 
@@ -9,15 +9,9 @@ interface OnCancel {
9
9
  (cancelHandler: () => void): void;
10
10
  }
11
11
  declare class CancelablePromise<T> implements Promise<T> {
12
- readonly [Symbol.toStringTag]: string;
13
- private _isResolved;
14
- private _isRejected;
15
- private _isCancelled;
16
- private readonly _cancelHandlers;
17
- private readonly _promise;
18
- private _resolve?;
19
- private _reject?;
12
+ #private;
20
13
  constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
14
+ get [Symbol.toStringTag](): string;
21
15
  then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
22
16
  catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
23
17
  finally(onFinally?: (() => void) | null): Promise<T>;
@@ -8,71 +8,73 @@ class CancelError extends Error {
8
8
  }
9
9
  }
10
10
  class CancelablePromise {
11
- [Symbol.toStringTag];
12
- _isResolved;
13
- _isRejected;
14
- _isCancelled;
15
- _cancelHandlers;
16
- _promise;
17
- _resolve;
18
- _reject;
11
+ #isResolved;
12
+ #isRejected;
13
+ #isCancelled;
14
+ #cancelHandlers;
15
+ #promise;
16
+ #resolve;
17
+ #reject;
19
18
  constructor(executor) {
20
- this._isResolved = false;
21
- this._isRejected = false;
22
- this._isCancelled = false;
23
- this._cancelHandlers = [];
24
- this._promise = new Promise((resolve, reject) => {
25
- this._resolve = resolve;
26
- this._reject = reject;
19
+ this.#isResolved = false;
20
+ this.#isRejected = false;
21
+ this.#isCancelled = false;
22
+ this.#cancelHandlers = [];
23
+ this.#promise = new Promise((resolve, reject) => {
24
+ this.#resolve = resolve;
25
+ this.#reject = reject;
27
26
  const onResolve = (value) => {
28
- if (this._isResolved || this._isRejected || this._isCancelled) {
27
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
29
28
  return;
30
29
  }
31
- this._isResolved = true;
32
- this._resolve?.(value);
30
+ this.#isResolved = true;
31
+ this.#resolve?.(value);
33
32
  };
34
33
  const onReject = (reason) => {
35
- if (this._isResolved || this._isRejected || this._isCancelled) {
34
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
36
35
  return;
37
36
  }
38
- this._isRejected = true;
39
- this._reject?.(reason);
37
+ this.#isRejected = true;
38
+ this.#reject?.(reason);
40
39
  };
41
40
  const onCancel = (cancelHandler) => {
42
- if (this._isResolved || this._isRejected || this._isCancelled) {
41
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
43
42
  return;
44
43
  }
45
- this._cancelHandlers.push(cancelHandler);
44
+ this.#cancelHandlers.push(cancelHandler);
46
45
  };
47
46
  Object.defineProperty(onCancel, "isResolved", {
48
- get: () => this._isResolved
47
+ get: () => this.#isResolved
49
48
  });
50
49
  Object.defineProperty(onCancel, "isRejected", {
51
- get: () => this._isRejected
50
+ get: () => this.#isRejected
52
51
  });
53
52
  Object.defineProperty(onCancel, "isCancelled", {
54
- get: () => this._isCancelled
53
+ get: () => this.#isCancelled
55
54
  });
56
55
  return executor(onResolve, onReject, onCancel);
57
56
  });
58
57
  }
58
+ get [Symbol.toStringTag]() {
59
+ return "Cancellable Promise";
60
+ }
59
61
  then(onFulfilled, onRejected) {
60
- return this._promise.then(onFulfilled, onRejected);
62
+ return this.#promise.then(onFulfilled, onRejected);
61
63
  }
62
64
  catch(onRejected) {
63
- return this._promise.catch(onRejected);
65
+ return this.#promise.catch(onRejected);
64
66
  }
65
67
  finally(onFinally) {
66
- return this._promise.finally(onFinally);
68
+ return this.#promise.finally(onFinally);
67
69
  }
68
70
  cancel() {
69
- if (this._isResolved || this._isRejected || this._isCancelled) {
71
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
70
72
  return;
71
73
  }
72
- this._isCancelled = true;
73
- if (this._cancelHandlers.length) {
74
+ this.#isCancelled = true;
75
+ if (this.#cancelHandlers.length) {
74
76
  try {
75
- for (const cancelHandler of this._cancelHandlers) {
77
+ for (const cancelHandler of this.#cancelHandlers) {
76
78
  cancelHandler();
77
79
  }
78
80
  } catch (error) {
@@ -80,11 +82,11 @@ class CancelablePromise {
80
82
  return;
81
83
  }
82
84
  }
83
- this._cancelHandlers.length = 0;
84
- this._reject?.(new CancelError("Request aborted"));
85
+ this.#cancelHandlers.length = 0;
86
+ this.#reject?.(new CancelError("Request aborted"));
85
87
  }
86
88
  get isCancelled() {
87
- return this._isCancelled;
89
+ return this.#isCancelled;
88
90
  }
89
91
  }
90
92
 
@@ -126,7 +126,7 @@ const getHeaders = async (config, options) => {
126
126
  return new Headers(headers);
127
127
  };
128
128
  const getRequestBody = (options) => {
129
- if (options.body) {
129
+ if (options.body !== void 0) {
130
130
  if (options.mediaType?.includes("/json")) {
131
131
  return JSON.stringify(options.body);
132
132
  } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
@@ -165,7 +165,8 @@ const getResponseBody = async (response) => {
165
165
  try {
166
166
  const contentType = response.headers.get("Content-Type");
167
167
  if (contentType) {
168
- const isJSON = contentType.toLowerCase().startsWith("application/json");
168
+ const jsonTypes = ["application/json", "application/problem+json"];
169
+ const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type));
169
170
  if (isJSON) {
170
171
  return await response.json();
171
172
  } else {
@@ -7,14 +7,6 @@ type AddressActivityMetadata = {
7
7
  * Array of hexadecimal strings of the event signatures.
8
8
  */
9
9
  eventSignatures?: Array<string>;
10
- /**
11
- * Whether to include traces in the webhook payload.
12
- */
13
- includeTraces?: boolean;
14
- /**
15
- * Whether to include logs in the webhook payload.
16
- */
17
- includeLogs?: boolean;
18
10
  };
19
11
 
20
12
  export { AddressActivityMetadata };
@@ -1,5 +1,5 @@
1
1
  type PrimaryNetworkOptions = {
2
- addresses: Array<string>;
2
+ addresses?: Array<string>;
3
3
  cChainEvmAddresses?: Array<string>;
4
4
  includeChains: Array<'11111111111111111111111111111111LpoYY' | '2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM' | '2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm' | '2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5' | 'yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp' | 'p-chain' | 'x-chain' | 'c-chain'>;
5
5
  };
@@ -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;