@v3finance/monitoring-sdk 0.0.0-stage → 0.2.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.
Files changed (149) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSE +21 -0
  3. package/README.md +322 -2
  4. package/dist/cjs/client.d.ts +46 -0
  5. package/dist/cjs/client.d.ts.map +1 -0
  6. package/dist/cjs/client.js +80 -0
  7. package/dist/cjs/client.js.map +1 -0
  8. package/dist/cjs/core/errors.d.ts +64 -0
  9. package/dist/cjs/core/errors.d.ts.map +1 -0
  10. package/dist/cjs/core/errors.js +95 -0
  11. package/dist/cjs/core/errors.js.map +1 -0
  12. package/dist/cjs/core/http.d.ts +58 -0
  13. package/dist/cjs/core/http.d.ts.map +1 -0
  14. package/dist/cjs/core/http.js +143 -0
  15. package/dist/cjs/core/http.js.map +1 -0
  16. package/dist/cjs/core/pagination.d.ts +12 -0
  17. package/dist/cjs/core/pagination.d.ts.map +1 -0
  18. package/dist/cjs/core/pagination.js +15 -0
  19. package/dist/cjs/core/pagination.js.map +1 -0
  20. package/dist/cjs/core/scope.d.ts +8 -0
  21. package/dist/cjs/core/scope.d.ts.map +1 -0
  22. package/dist/cjs/core/scope.js +3 -0
  23. package/dist/cjs/core/scope.js.map +1 -0
  24. package/dist/cjs/generated/types.d.ts +336 -0
  25. package/dist/cjs/generated/types.d.ts.map +1 -0
  26. package/dist/cjs/generated/types.js +5 -0
  27. package/dist/cjs/generated/types.js.map +1 -0
  28. package/dist/cjs/index.d.ts +23 -0
  29. package/dist/cjs/index.d.ts.map +1 -0
  30. package/dist/cjs/index.js +47 -0
  31. package/dist/cjs/index.js.map +1 -0
  32. package/dist/cjs/package.json +1 -0
  33. package/dist/cjs/resources/account.d.ts +22 -0
  34. package/dist/cjs/resources/account.d.ts.map +1 -0
  35. package/dist/cjs/resources/account.js +31 -0
  36. package/dist/cjs/resources/account.js.map +1 -0
  37. package/dist/cjs/resources/addresses.d.ts +93 -0
  38. package/dist/cjs/resources/addresses.d.ts.map +1 -0
  39. package/dist/cjs/resources/addresses.js +128 -0
  40. package/dist/cjs/resources/addresses.js.map +1 -0
  41. package/dist/cjs/resources/catalog.d.ts +37 -0
  42. package/dist/cjs/resources/catalog.d.ts.map +1 -0
  43. package/dist/cjs/resources/catalog.js +52 -0
  44. package/dist/cjs/resources/catalog.js.map +1 -0
  45. package/dist/cjs/resources/deliveries.d.ts +61 -0
  46. package/dist/cjs/resources/deliveries.d.ts.map +1 -0
  47. package/dist/cjs/resources/deliveries.js +53 -0
  48. package/dist/cjs/resources/deliveries.js.map +1 -0
  49. package/dist/cjs/resources/transactions.d.ts +28 -0
  50. package/dist/cjs/resources/transactions.d.ts.map +1 -0
  51. package/dist/cjs/resources/transactions.js +34 -0
  52. package/dist/cjs/resources/transactions.js.map +1 -0
  53. package/dist/cjs/resources/webhooks.d.ts +22 -0
  54. package/dist/cjs/resources/webhooks.d.ts.map +1 -0
  55. package/dist/cjs/resources/webhooks.js +35 -0
  56. package/dist/cjs/resources/webhooks.js.map +1 -0
  57. package/dist/cjs/units.d.ts +29 -0
  58. package/dist/cjs/units.d.ts.map +1 -0
  59. package/dist/cjs/units.js +62 -0
  60. package/dist/cjs/units.js.map +1 -0
  61. package/dist/cjs/version.d.ts +5 -0
  62. package/dist/cjs/version.d.ts.map +1 -0
  63. package/dist/cjs/version.js +8 -0
  64. package/dist/cjs/version.js.map +1 -0
  65. package/dist/cjs/webhooks.d.ts +82 -0
  66. package/dist/cjs/webhooks.d.ts.map +1 -0
  67. package/dist/cjs/webhooks.js +133 -0
  68. package/dist/cjs/webhooks.js.map +1 -0
  69. package/dist/esm/client.d.ts +46 -0
  70. package/dist/esm/client.d.ts.map +1 -0
  71. package/dist/esm/client.js +76 -0
  72. package/dist/esm/client.js.map +1 -0
  73. package/dist/esm/core/errors.d.ts +64 -0
  74. package/dist/esm/core/errors.d.ts.map +1 -0
  75. package/dist/esm/core/errors.js +86 -0
  76. package/dist/esm/core/errors.js.map +1 -0
  77. package/dist/esm/core/http.d.ts +58 -0
  78. package/dist/esm/core/http.d.ts.map +1 -0
  79. package/dist/esm/core/http.js +138 -0
  80. package/dist/esm/core/http.js.map +1 -0
  81. package/dist/esm/core/pagination.d.ts +12 -0
  82. package/dist/esm/core/pagination.d.ts.map +1 -0
  83. package/dist/esm/core/pagination.js +12 -0
  84. package/dist/esm/core/pagination.js.map +1 -0
  85. package/dist/esm/core/scope.d.ts +8 -0
  86. package/dist/esm/core/scope.d.ts.map +1 -0
  87. package/dist/esm/core/scope.js +2 -0
  88. package/dist/esm/core/scope.js.map +1 -0
  89. package/dist/esm/generated/types.d.ts +336 -0
  90. package/dist/esm/generated/types.d.ts.map +1 -0
  91. package/dist/esm/generated/types.js +4 -0
  92. package/dist/esm/generated/types.js.map +1 -0
  93. package/dist/esm/index.d.ts +23 -0
  94. package/dist/esm/index.d.ts.map +1 -0
  95. package/dist/esm/index.js +20 -0
  96. package/dist/esm/index.js.map +1 -0
  97. package/dist/esm/resources/account.d.ts +22 -0
  98. package/dist/esm/resources/account.d.ts.map +1 -0
  99. package/dist/esm/resources/account.js +27 -0
  100. package/dist/esm/resources/account.js.map +1 -0
  101. package/dist/esm/resources/addresses.d.ts +93 -0
  102. package/dist/esm/resources/addresses.d.ts.map +1 -0
  103. package/dist/esm/resources/addresses.js +124 -0
  104. package/dist/esm/resources/addresses.js.map +1 -0
  105. package/dist/esm/resources/catalog.d.ts +37 -0
  106. package/dist/esm/resources/catalog.d.ts.map +1 -0
  107. package/dist/esm/resources/catalog.js +47 -0
  108. package/dist/esm/resources/catalog.js.map +1 -0
  109. package/dist/esm/resources/deliveries.d.ts +61 -0
  110. package/dist/esm/resources/deliveries.d.ts.map +1 -0
  111. package/dist/esm/resources/deliveries.js +49 -0
  112. package/dist/esm/resources/deliveries.js.map +1 -0
  113. package/dist/esm/resources/transactions.d.ts +28 -0
  114. package/dist/esm/resources/transactions.d.ts.map +1 -0
  115. package/dist/esm/resources/transactions.js +30 -0
  116. package/dist/esm/resources/transactions.js.map +1 -0
  117. package/dist/esm/resources/webhooks.d.ts +22 -0
  118. package/dist/esm/resources/webhooks.d.ts.map +1 -0
  119. package/dist/esm/resources/webhooks.js +31 -0
  120. package/dist/esm/resources/webhooks.js.map +1 -0
  121. package/dist/esm/units.d.ts +29 -0
  122. package/dist/esm/units.d.ts.map +1 -0
  123. package/dist/esm/units.js +58 -0
  124. package/dist/esm/units.js.map +1 -0
  125. package/dist/esm/version.d.ts +5 -0
  126. package/dist/esm/version.d.ts.map +1 -0
  127. package/dist/esm/version.js +5 -0
  128. package/dist/esm/version.js.map +1 -0
  129. package/dist/esm/webhooks.d.ts +82 -0
  130. package/dist/esm/webhooks.d.ts.map +1 -0
  131. package/dist/esm/webhooks.js +125 -0
  132. package/dist/esm/webhooks.js.map +1 -0
  133. package/package.json +69 -4
  134. package/src/client.ts +83 -0
  135. package/src/core/errors.ts +99 -0
  136. package/src/core/http.ts +183 -0
  137. package/src/core/pagination.ts +20 -0
  138. package/src/core/scope.ts +8 -0
  139. package/src/generated/types.ts +369 -0
  140. package/src/index.ts +43 -0
  141. package/src/resources/account.ts +33 -0
  142. package/src/resources/addresses.ts +165 -0
  143. package/src/resources/catalog.ts +56 -0
  144. package/src/resources/deliveries.ts +82 -0
  145. package/src/resources/transactions.ts +34 -0
  146. package/src/resources/webhooks.ts +36 -0
  147. package/src/units.ts +56 -0
  148. package/src/version.ts +5 -0
  149. package/src/webhooks.ts +138 -0
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Official TypeScript SDK for the V3 Finance Monitoring API: monitor addresses on TRON and EVM networks and receive
3
+ * signed webhooks for every incoming and outgoing transfer.
4
+ *
5
+ * API reference: https://monitoring.v3.finance/docs
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ export { MonitoringClient } from './client.js';
10
+ export type { ClientOptions, RequestOptions } from './core/http.js';
11
+ export type { Page } from './core/pagination.js';
12
+ export { MonitoringApiError, MonitoringConnectionError, MonitoringError, MonitoringTimeoutError, WebhookSignatureError, type ErrorDetail, } from './core/errors.js';
13
+ export { AccountResource } from './resources/account.js';
14
+ export { ADDRESS_BATCH_SIZE, AddressesResource, type ListAddressesParams, type SubscriptionDefaults } from './resources/addresses.js';
15
+ export { AssetsResource, NetworksResource } from './resources/catalog.js';
16
+ export { DeliveriesResource, type DeliveryFilter, type ListDeliveriesParams } from './resources/deliveries.js';
17
+ export { TransactionsResource } from './resources/transactions.js';
18
+ export { WebhooksResource } from './resources/webhooks.js';
19
+ export { isTestWebhook, parseWebhook, signWebhookBody, verifyWebhookSignature, WEBHOOK_HEADERS, webhookIdempotencyKey, type SignatureSource, type WebhookBody, } from './webhooks.js';
20
+ export { formatUnits, parseUnits } from './units.js';
21
+ export { DEFAULT_BASE_URL, SDK_VERSION } from './version.js';
22
+ export type * from './generated/types.js';
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACnE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACrI,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAC9G,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG5D,mBAAmB,sBAAsB,CAAA"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Official TypeScript SDK for the V3 Finance Monitoring API: monitor addresses on TRON and EVM networks and receive
4
+ * signed webhooks for every incoming and outgoing transfer.
5
+ *
6
+ * API reference: https://monitoring.v3.finance/docs
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.SDK_VERSION = exports.DEFAULT_BASE_URL = exports.parseUnits = exports.formatUnits = exports.webhookIdempotencyKey = exports.WEBHOOK_HEADERS = exports.verifyWebhookSignature = exports.signWebhookBody = exports.parseWebhook = exports.isTestWebhook = exports.WebhooksResource = exports.TransactionsResource = exports.DeliveriesResource = exports.NetworksResource = exports.AssetsResource = exports.AddressesResource = exports.ADDRESS_BATCH_SIZE = exports.AccountResource = exports.WebhookSignatureError = exports.MonitoringTimeoutError = exports.MonitoringError = exports.MonitoringConnectionError = exports.MonitoringApiError = exports.MonitoringClient = void 0;
12
+ var client_js_1 = require("./client.js");
13
+ Object.defineProperty(exports, "MonitoringClient", { enumerable: true, get: function () { return client_js_1.MonitoringClient; } });
14
+ var errors_js_1 = require("./core/errors.js");
15
+ Object.defineProperty(exports, "MonitoringApiError", { enumerable: true, get: function () { return errors_js_1.MonitoringApiError; } });
16
+ Object.defineProperty(exports, "MonitoringConnectionError", { enumerable: true, get: function () { return errors_js_1.MonitoringConnectionError; } });
17
+ Object.defineProperty(exports, "MonitoringError", { enumerable: true, get: function () { return errors_js_1.MonitoringError; } });
18
+ Object.defineProperty(exports, "MonitoringTimeoutError", { enumerable: true, get: function () { return errors_js_1.MonitoringTimeoutError; } });
19
+ Object.defineProperty(exports, "WebhookSignatureError", { enumerable: true, get: function () { return errors_js_1.WebhookSignatureError; } });
20
+ var account_js_1 = require("./resources/account.js");
21
+ Object.defineProperty(exports, "AccountResource", { enumerable: true, get: function () { return account_js_1.AccountResource; } });
22
+ var addresses_js_1 = require("./resources/addresses.js");
23
+ Object.defineProperty(exports, "ADDRESS_BATCH_SIZE", { enumerable: true, get: function () { return addresses_js_1.ADDRESS_BATCH_SIZE; } });
24
+ Object.defineProperty(exports, "AddressesResource", { enumerable: true, get: function () { return addresses_js_1.AddressesResource; } });
25
+ var catalog_js_1 = require("./resources/catalog.js");
26
+ Object.defineProperty(exports, "AssetsResource", { enumerable: true, get: function () { return catalog_js_1.AssetsResource; } });
27
+ Object.defineProperty(exports, "NetworksResource", { enumerable: true, get: function () { return catalog_js_1.NetworksResource; } });
28
+ var deliveries_js_1 = require("./resources/deliveries.js");
29
+ Object.defineProperty(exports, "DeliveriesResource", { enumerable: true, get: function () { return deliveries_js_1.DeliveriesResource; } });
30
+ var transactions_js_1 = require("./resources/transactions.js");
31
+ Object.defineProperty(exports, "TransactionsResource", { enumerable: true, get: function () { return transactions_js_1.TransactionsResource; } });
32
+ var webhooks_js_1 = require("./resources/webhooks.js");
33
+ Object.defineProperty(exports, "WebhooksResource", { enumerable: true, get: function () { return webhooks_js_1.WebhooksResource; } });
34
+ var webhooks_js_2 = require("./webhooks.js");
35
+ Object.defineProperty(exports, "isTestWebhook", { enumerable: true, get: function () { return webhooks_js_2.isTestWebhook; } });
36
+ Object.defineProperty(exports, "parseWebhook", { enumerable: true, get: function () { return webhooks_js_2.parseWebhook; } });
37
+ Object.defineProperty(exports, "signWebhookBody", { enumerable: true, get: function () { return webhooks_js_2.signWebhookBody; } });
38
+ Object.defineProperty(exports, "verifyWebhookSignature", { enumerable: true, get: function () { return webhooks_js_2.verifyWebhookSignature; } });
39
+ Object.defineProperty(exports, "WEBHOOK_HEADERS", { enumerable: true, get: function () { return webhooks_js_2.WEBHOOK_HEADERS; } });
40
+ Object.defineProperty(exports, "webhookIdempotencyKey", { enumerable: true, get: function () { return webhooks_js_2.webhookIdempotencyKey; } });
41
+ var units_js_1 = require("./units.js");
42
+ Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return units_js_1.formatUnits; } });
43
+ Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return units_js_1.parseUnits; } });
44
+ var version_js_1 = require("./version.js");
45
+ Object.defineProperty(exports, "DEFAULT_BASE_URL", { enumerable: true, get: function () { return version_js_1.DEFAULT_BASE_URL; } });
46
+ Object.defineProperty(exports, "SDK_VERSION", { enumerable: true, get: function () { return version_js_1.SDK_VERSION; } });
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,yCAA8C;AAArC,6GAAA,gBAAgB,OAAA;AAGzB,8CAOyB;AANvB,+GAAA,kBAAkB,OAAA;AAClB,sHAAA,yBAAyB,OAAA;AACzB,4GAAA,eAAe,OAAA;AACf,mHAAA,sBAAsB,OAAA;AACtB,kHAAA,qBAAqB,OAAA;AAIvB,qDAAwD;AAA/C,6GAAA,eAAe,OAAA;AACxB,yDAAqI;AAA5H,kHAAA,kBAAkB,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAC9C,qDAAyE;AAAhE,4GAAA,cAAc,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACzC,2DAA8G;AAArG,mHAAA,kBAAkB,OAAA;AAC3B,+DAAkE;AAAzD,uHAAA,oBAAoB,OAAA;AAC7B,uDAA0D;AAAjD,+GAAA,gBAAgB,OAAA;AAEzB,6CASsB;AARpB,4GAAA,aAAa,OAAA;AACb,2GAAA,YAAY,OAAA;AACZ,8GAAA,eAAe,OAAA;AACf,qHAAA,sBAAsB,OAAA;AACtB,8GAAA,eAAe,OAAA;AACf,oHAAA,qBAAqB,OAAA;AAIvB,uCAAoD;AAA3C,uGAAA,WAAW,OAAA;AAAE,sGAAA,UAAU,OAAA;AAChC,2CAA4D;AAAnD,8GAAA,gBAAgB,OAAA;AAAE,yGAAA,WAAW,OAAA"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,22 @@
1
+ import type { RequestOptions } from '../core/http.js';
2
+ import type { Scope } from '../core/scope.js';
3
+ import type { Client } from '../generated/types.js';
4
+ /** Your client: the account your API key belongs to. */
5
+ export declare class AccountResource {
6
+ #private;
7
+ /** @internal */
8
+ constructor(scope: Scope, resolveId: () => Promise<string>);
9
+ /**
10
+ * Retrieves your client, including its webhook URL and status.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const account = await monitoring.account.get()
15
+ * console.log(account.webhookUrl, account.status)
16
+ * ```
17
+ */
18
+ get(options?: RequestOptions): Promise<Client>;
19
+ /** Returns your client ID — the value of the `x-client-id` header on every webhook. */
20
+ id(): Promise<string>;
21
+ }
22
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/resources/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD,wDAAwD;AACxD,qBAAa,eAAe;;IAI1B,gBAAgB;IAChB,YAAY,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EAGzD;IAED;;;;;;;;OAQG;IACG,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnD;IAED,uFAAuF;IACvF,EAAE,IAAI,OAAO,CAAC,MAAM,CAAC,CAEpB;CACF"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountResource = void 0;
4
+ /** Your client: the account your API key belongs to. */
5
+ class AccountResource {
6
+ #scope;
7
+ #resolveId;
8
+ /** @internal */
9
+ constructor(scope, resolveId) {
10
+ this.#scope = scope;
11
+ this.#resolveId = resolveId;
12
+ }
13
+ /**
14
+ * Retrieves your client, including its webhook URL and status.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const account = await monitoring.account.get()
19
+ * console.log(account.webhookUrl, account.status)
20
+ * ```
21
+ */
22
+ async get(options) {
23
+ return this.#scope.http.request({ method: 'GET', path: await this.#scope.clientPath(), idempotent: true, options });
24
+ }
25
+ /** Returns your client ID — the value of the `x-client-id` header on every webhook. */
26
+ id() {
27
+ return this.#resolveId();
28
+ }
29
+ }
30
+ exports.AccountResource = AccountResource;
31
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/resources/account.ts"],"names":[],"mappings":";;;AAIA,wDAAwD;AACxD;IACW,MAAM,CAAO;IACb,UAAU,CAAuB;IAE1C,gBAAgB;IAChB,YAAY,KAAY,EAAE,SAAgC;QACxD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;IAC7B,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,GAAG,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IACrH,CAAC;IAED,uFAAuF;IACvF,EAAE;QACA,OAAO,IAAI,CAAC,UAAU,EAAE,CAAA;IAC1B,CAAC;CACF"}
@@ -0,0 +1,93 @@
1
+ import type { RequestOptions } from '../core/http.js';
2
+ import type { Scope } from '../core/scope.js';
3
+ import type { AddAddressesResult, Address, AddressInput, AddressPage, AddressRef, AddressUpdate, AssetSelection, Direction, RemoveAddressesResult, UpdateAddressesResult } from '../generated/types.js';
4
+ /** Maximum number of addresses the API accepts per request. Larger lists are split into batches automatically. */
5
+ export declare const ADDRESS_BATCH_SIZE = 1000;
6
+ /**
7
+ * Default subscription for every address in a request that does not set its own. Without it, an address is notified
8
+ * about all assets of its network in both directions.
9
+ */
10
+ export interface SubscriptionDefaults {
11
+ /** Asset symbols (`USDT`) or contract addresses. `null` — all assets of the network, including ones added later. */
12
+ assets?: AssetSelection;
13
+ /** `in` — incoming only, `out` — outgoing only, `both` — either. */
14
+ direction?: Direction;
15
+ }
16
+ /** Parameters of {@link AddressesResource.list}. */
17
+ export interface ListAddressesParams {
18
+ /** Only addresses on this network. */
19
+ network?: string;
20
+ /** Page size, up to 5000. Defaults to 500. */
21
+ limit?: number;
22
+ /** Cursor: `next` of the previous page. */
23
+ after?: number;
24
+ }
25
+ /** Addresses you monitor and their subscriptions: which assets and which direction you are notified about. */
26
+ export declare class AddressesResource {
27
+ #private;
28
+ /** @internal */
29
+ constructor(scope: Scope);
30
+ /**
31
+ * Lists monitored addresses, one page at a time.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const { items, next } = await monitoring.addresses.list({ network: 'tron' })
36
+ * ```
37
+ */
38
+ list(params?: ListAddressesParams, options?: RequestOptions): Promise<AddressPage>;
39
+ /**
40
+ * Iterates over all monitored addresses, fetching pages as needed.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * for await (const address of monitoring.addresses.iterate({ network: 'tron' })) {
45
+ * console.log(address.address, address.assets ?? 'all assets', address.direction)
46
+ * }
47
+ * ```
48
+ */
49
+ iterate(params?: Omit<ListAddressesParams, 'after'>, options?: RequestOptions): AsyncGenerator<Address, void, undefined>;
50
+ /**
51
+ * Starts monitoring addresses. New addresses are picked up within seconds. Addresses that are already monitored are
52
+ * left unchanged — use {@link AddressesResource.update} to change their subscription.
53
+ *
54
+ * Each batch of up to {@link ADDRESS_BATCH_SIZE} addresses is validated as a whole: if any item is invalid, the
55
+ * batch is not applied. Larger lists are sent in batches, in order; if a batch fails, the previous batches have
56
+ * already been applied, and the indexes in `error.details` refer to your original list. Retrying is safe.
57
+ *
58
+ * @param addresses - Addresses to monitor. An EVM address is monitored per network: add it once per network.
59
+ * @param defaults - Subscription for addresses that do not set their own.
60
+ * @throws {@link MonitoringApiError} `400` with `details` when an address is invalid for its network or an asset
61
+ * is unknown.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * // deposit addresses: incoming USDT only
66
+ * await monitoring.addresses.add([{ network: 'tron', address: 'TA8Hg…', label: 'user-42' }], {
67
+ * assets: ['USDT'],
68
+ * direction: 'in',
69
+ * })
70
+ * ```
71
+ */
72
+ add(addresses: AddressInput[], defaults?: SubscriptionDefaults, options?: RequestOptions): Promise<AddAddressesResult>;
73
+ /**
74
+ * Changes the subscription of monitored addresses. Only the fields you pass are changed: omit `assets` to keep the
75
+ * current assets, or pass `null` to subscribe to all assets of the network.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * await monitoring.addresses.update([{ network: 'tron', address: 'TA8Hg…' }], { direction: 'both' })
80
+ * ```
81
+ */
82
+ update(addresses: AddressUpdate[], defaults?: SubscriptionDefaults, options?: RequestOptions): Promise<UpdateAddressesResult>;
83
+ /**
84
+ * Stops monitoring addresses.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * await monitoring.addresses.remove([{ network: 'tron', address: 'TA8Hg…' }])
89
+ * ```
90
+ */
91
+ remove(addresses: AddressRef[], options?: RequestOptions): Promise<RemoveAddressesResult>;
92
+ }
93
+ //# sourceMappingURL=addresses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/resources/addresses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EACV,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAE9B,kHAAkH;AAClH,eAAO,MAAM,kBAAkB,OAAO,CAAA;AAEtC;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,oHAAoH;IACpH,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,oEAAoE;IACpE,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,oDAAoD;AACpD,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,8GAA8G;AAC9G,qBAAa,iBAAiB;;IAG5B,gBAAgB;IAChB,YAAY,KAAK,EAAE,KAAK,EAEvB;IAED;;;;;;;OAOG;IACG,IAAI,CAAC,MAAM,GAAE,mBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAE3F;IAED;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,GAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAE3H;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,GAAG,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,QAAQ,GAAE,oBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAQ/H;IAED;;;;;;;;OAQG;IACG,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,QAAQ,GAAE,oBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAQtI;IAED;;;;;;;OAOG;IACG,MAAM,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAQ9F;CAqBF"}
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressesResource = exports.ADDRESS_BATCH_SIZE = void 0;
4
+ const errors_js_1 = require("../core/errors.js");
5
+ const pagination_js_1 = require("../core/pagination.js");
6
+ /** Maximum number of addresses the API accepts per request. Larger lists are split into batches automatically. */
7
+ exports.ADDRESS_BATCH_SIZE = 1000;
8
+ /** Addresses you monitor and their subscriptions: which assets and which direction you are notified about. */
9
+ class AddressesResource {
10
+ #scope;
11
+ /** @internal */
12
+ constructor(scope) {
13
+ this.#scope = scope;
14
+ }
15
+ /**
16
+ * Lists monitored addresses, one page at a time.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const { items, next } = await monitoring.addresses.list({ network: 'tron' })
21
+ * ```
22
+ */
23
+ async list(params = {}, options) {
24
+ return this.#scope.http.request({ method: 'GET', path: `${await this.#scope.clientPath()}/addresses`, query: { ...params }, idempotent: true, options });
25
+ }
26
+ /**
27
+ * Iterates over all monitored addresses, fetching pages as needed.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * for await (const address of monitoring.addresses.iterate({ network: 'tron' })) {
32
+ * console.log(address.address, address.assets ?? 'all assets', address.direction)
33
+ * }
34
+ * ```
35
+ */
36
+ iterate(params = {}, options) {
37
+ return (0, pagination_js_1.paginate)((after) => this.list({ ...params, after }, options));
38
+ }
39
+ /**
40
+ * Starts monitoring addresses. New addresses are picked up within seconds. Addresses that are already monitored are
41
+ * left unchanged — use {@link AddressesResource.update} to change their subscription.
42
+ *
43
+ * Each batch of up to {@link ADDRESS_BATCH_SIZE} addresses is validated as a whole: if any item is invalid, the
44
+ * batch is not applied. Larger lists are sent in batches, in order; if a batch fails, the previous batches have
45
+ * already been applied, and the indexes in `error.details` refer to your original list. Retrying is safe.
46
+ *
47
+ * @param addresses - Addresses to monitor. An EVM address is monitored per network: add it once per network.
48
+ * @param defaults - Subscription for addresses that do not set their own.
49
+ * @throws {@link MonitoringApiError} `400` with `details` when an address is invalid for its network or an asset
50
+ * is unknown.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * // deposit addresses: incoming USDT only
55
+ * await monitoring.addresses.add([{ network: 'tron', address: 'TA8Hg…', label: 'user-42' }], {
56
+ * assets: ['USDT'],
57
+ * direction: 'in',
58
+ * })
59
+ * ```
60
+ */
61
+ async add(addresses, defaults = {}, options) {
62
+ const total = { added: 0, alreadyWatched: 0 };
63
+ await this.#batches(addresses, async (batch, path) => {
64
+ const r = await this.#scope.http.request({ method: 'POST', path: `${path}/addresses`, body: { ...defaults, addresses: batch }, idempotent: true, options });
65
+ total.added += r.added;
66
+ total.alreadyWatched += r.alreadyWatched;
67
+ });
68
+ return total;
69
+ }
70
+ /**
71
+ * Changes the subscription of monitored addresses. Only the fields you pass are changed: omit `assets` to keep the
72
+ * current assets, or pass `null` to subscribe to all assets of the network.
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * await monitoring.addresses.update([{ network: 'tron', address: 'TA8Hg…' }], { direction: 'both' })
77
+ * ```
78
+ */
79
+ async update(addresses, defaults = {}, options) {
80
+ const total = { updated: 0, notWatched: 0 };
81
+ await this.#batches(addresses, async (batch, path) => {
82
+ const r = await this.#scope.http.request({ method: 'POST', path: `${path}/addresses/update`, body: { ...defaults, addresses: batch }, idempotent: true, options });
83
+ total.updated += r.updated;
84
+ total.notWatched += r.notWatched;
85
+ });
86
+ return total;
87
+ }
88
+ /**
89
+ * Stops monitoring addresses.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * await monitoring.addresses.remove([{ network: 'tron', address: 'TA8Hg…' }])
94
+ * ```
95
+ */
96
+ async remove(addresses, options) {
97
+ const total = { removed: 0, notWatched: 0 };
98
+ await this.#batches(addresses, async (batch, path) => {
99
+ const r = await this.#scope.http.request({ method: 'POST', path: `${path}/addresses/remove`, body: { addresses: batch }, idempotent: true, options });
100
+ total.removed += r.removed;
101
+ total.notWatched += r.notWatched;
102
+ });
103
+ return total;
104
+ }
105
+ /** Sends items in batches, in order; maps per-item error indexes back to the original list. */
106
+ async #batches(items, send) {
107
+ const path = await this.#scope.clientPath();
108
+ for (let offset = 0; offset < items.length; offset += exports.ADDRESS_BATCH_SIZE) {
109
+ try {
110
+ await send(items.slice(offset, offset + exports.ADDRESS_BATCH_SIZE), path);
111
+ }
112
+ catch (error) {
113
+ if (!(error instanceof errors_js_1.MonitoringApiError) || offset === 0)
114
+ throw error;
115
+ throw new errors_js_1.MonitoringApiError({
116
+ status: error.status,
117
+ code: error.code,
118
+ message: `${error.message.replace(/ \(HTTP \d+, [\w-]+\)$/, '')}; addresses before index ${offset} were already applied`,
119
+ details: error.details.map((d) => ({ ...d, index: d.index + offset })),
120
+ requestId: error.requestId,
121
+ body: error.body,
122
+ });
123
+ }
124
+ }
125
+ }
126
+ }
127
+ exports.AddressesResource = AddressesResource;
128
+ //# sourceMappingURL=addresses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../src/resources/addresses.ts"],"names":[],"mappings":";;;AAAA,iDAAsD;AAEtD,yDAAgD;AAehD,kHAAkH;AACrG,QAAA,kBAAkB,GAAG,IAAI,CAAA;AAuBtC,8GAA8G;AAC9G;IACW,MAAM,CAAO;IAEtB,gBAAgB;IAChB,YAAY,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AI,EAAE,KAAK,CAAC,IAAI;iBACjB,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,37 @@
1
+ import { type RequestOptions } from '../core/http.js';
2
+ import type { Scope } from '../core/scope.js';
3
+ import type { Asset, Network } from '../generated/types.js';
4
+ /** Supported networks. */
5
+ export declare class NetworksResource {
6
+ #private;
7
+ /** @internal */
8
+ constructor(scope: Scope);
9
+ /** Lists all networks. Transfers are monitored on networks with `enabled: true`. */
10
+ list(options?: RequestOptions): Promise<Network[]>;
11
+ /**
12
+ * Retrieves a network.
13
+ *
14
+ * @param network - Network slug (`tron`, `ethereum`) or CAIP-2 ID (`eip155:1`).
15
+ */
16
+ get(network: string, options?: RequestOptions): Promise<Network>;
17
+ }
18
+ /** Native coins and tokens. You are notified about transfers of enabled assets of at least `minAmount`. */
19
+ export declare class AssetsResource {
20
+ #private;
21
+ /** @internal */
22
+ constructor(scope: Scope);
23
+ /**
24
+ * Lists assets, optionally of one network.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const usdt = (await monitoring.assets.list({ network: 'tron' })).find((asset) => asset.symbol === 'USDT')
29
+ * ```
30
+ */
31
+ list(params?: {
32
+ network?: string;
33
+ }, options?: RequestOptions): Promise<Asset[]>;
34
+ /** Retrieves an asset by ID. */
35
+ get(assetId: number, options?: RequestOptions): Promise<Asset>;
36
+ }
37
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/resources/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAa,OAAO,EAAe,MAAM,uBAAuB,CAAA;AAEnF,0BAA0B;AAC1B,qBAAa,gBAAgB;;IAG3B,gBAAgB;IAChB,YAAY,KAAK,EAAE,KAAK,EAEvB;IAED,oFAAoF;IAC9E,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAGvD;IAED;;;;OAIG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/D;CACF;AAED,2GAA2G;AAC3G,qBAAa,cAAc;;IAGzB,gBAAgB;IAChB,YAAY,KAAK,EAAE,KAAK,EAEvB;IAED;;;;;;;OAOG;IACG,IAAI,CAAC,MAAM,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAGxF;IAED,gCAAgC;IAChC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,CAE7D;CACF"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssetsResource = exports.NetworksResource = void 0;
4
+ const http_js_1 = require("../core/http.js");
5
+ /** Supported networks. */
6
+ class NetworksResource {
7
+ #scope;
8
+ /** @internal */
9
+ constructor(scope) {
10
+ this.#scope = scope;
11
+ }
12
+ /** Lists all networks. Transfers are monitored on networks with `enabled: true`. */
13
+ async list(options) {
14
+ const r = await this.#scope.http.request({ method: 'GET', path: '/v1/networks', idempotent: true, options });
15
+ return r.items;
16
+ }
17
+ /**
18
+ * Retrieves a network.
19
+ *
20
+ * @param network - Network slug (`tron`, `ethereum`) or CAIP-2 ID (`eip155:1`).
21
+ */
22
+ get(network, options) {
23
+ return this.#scope.http.request({ method: 'GET', path: `/v1/networks/${(0, http_js_1.seg)(network)}`, idempotent: true, options });
24
+ }
25
+ }
26
+ exports.NetworksResource = NetworksResource;
27
+ /** Native coins and tokens. You are notified about transfers of enabled assets of at least `minAmount`. */
28
+ class AssetsResource {
29
+ #scope;
30
+ /** @internal */
31
+ constructor(scope) {
32
+ this.#scope = scope;
33
+ }
34
+ /**
35
+ * Lists assets, optionally of one network.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const usdt = (await monitoring.assets.list({ network: 'tron' })).find((asset) => asset.symbol === 'USDT')
40
+ * ```
41
+ */
42
+ async list(params = {}, options) {
43
+ const r = await this.#scope.http.request({ method: 'GET', path: '/v1/assets', query: params, idempotent: true, options });
44
+ return r.items;
45
+ }
46
+ /** Retrieves an asset by ID. */
47
+ get(assetId, options) {
48
+ return this.#scope.http.request({ method: 'GET', path: `/v1/assets/${(0, http_js_1.seg)(assetId)}`, idempotent: true, options });
49
+ }
50
+ }
51
+ exports.AssetsResource = AssetsResource;
52
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/resources/catalog.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAI1D,0BAA0B;AAC1B;IACW,MAAM,CAAO;IAEtB,gBAAgB;IAChB,YAAY,KAAY;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,oFAAoF;IACpF,KAAK,CAAC,IAAI,CAAC,OAAwB;QACjC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAc,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;QACzH,OAAO,CAAC,CAAC,KAAK,CAAA;IAChB,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,OAAe,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IACrH,CAAC;CACF;;AAED,2GAA2G;AAC3G;IACW,MAAM,CAAO;IAEtB,gBAAgB;IAChB,YAAY,KAAY;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CAAC,MAAM,GAAyB,EAAE,EAAE,OAAwB;QACpE,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAY,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;QACpI,OAAO,CAAC,CAAC,KAAK,CAAA;IAChB,CAAC;IAED,gCAAgC;IAChC,GAAG,CAAC,OAAe,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IACnH,CAAC;CACF"}
@@ -0,0 +1,61 @@
1
+ import { type RequestOptions } from '../core/http.js';
2
+ import type { Scope } from '../core/scope.js';
3
+ import type { Delivery, DeliveryDetail, DeliveryPage, DeliveryStatus } from '../generated/types.js';
4
+ /** Filters for webhook deliveries. All are optional and can be combined. */
5
+ export interface DeliveryFilter {
6
+ /** `delivered`, `retrying` or `failed`. */
7
+ status?: DeliveryStatus;
8
+ /** Network slug or CAIP-2 ID. */
9
+ network?: string;
10
+ /** Asset symbol. */
11
+ asset?: string;
12
+ /** Transaction hash. */
13
+ tx?: string;
14
+ /** Sender or recipient address. */
15
+ address?: string;
16
+ /** First attempt at or after this time. */
17
+ since?: Date | string;
18
+ /** First attempt before this time. */
19
+ until?: Date | string;
20
+ }
21
+ /** Parameters of {@link DeliveriesResource.list}. */
22
+ export interface ListDeliveriesParams extends DeliveryFilter {
23
+ /** Page size, up to 500. Defaults to 100. */
24
+ limit?: number;
25
+ /** Cursor: `next` of the previous page. */
26
+ before?: number;
27
+ }
28
+ /**
29
+ * Every webhook sent to you: status, attempts and your endpoint's response. Retries of the same webhook are one
30
+ * delivery with an attempt count. Deliveries are kept for 90 days.
31
+ */
32
+ export declare class DeliveriesResource {
33
+ #private;
34
+ /** @internal */
35
+ constructor(scope: Scope);
36
+ /**
37
+ * Lists deliveries, newest first, one page at a time.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const { items } = await monitoring.deliveries.list({ status: 'failed', since: new Date(Date.now() - 86_400_000) })
42
+ * ```
43
+ */
44
+ list(params?: ListDeliveriesParams, options?: RequestOptions): Promise<DeliveryPage>;
45
+ /**
46
+ * Iterates over all deliveries matching the filter, newest first.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * for await (const delivery of monitoring.deliveries.iterate({ status: 'failed' })) {
51
+ * console.log(delivery.txId, delivery.attempts, delivery.lastHttpStatus ?? delivery.lastError)
52
+ * }
53
+ * ```
54
+ */
55
+ iterate(filter?: DeliveryFilter & {
56
+ limit?: number;
57
+ }, options?: RequestOptions): AsyncGenerator<Delivery, void, undefined>;
58
+ /** Retrieves a delivery with the URL of the last attempt and the exact request body. */
59
+ get(deliveryId: number, options?: RequestOptions): Promise<DeliveryDetail>;
60
+ }
61
+ //# sourceMappingURL=deliveries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliveries.d.ts","sourceRoot":"","sources":["../../../src/resources/deliveries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAE1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,c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ource = void 0;
4
+ const http_js_1 = require("../core/http.js");
5
+ const pagination_js_1 = require("../core/pagination.js");
6
+ const iso = (value) => (value instanceof Date ? value.toISOString() : value);
7
+ /**
8
+ * Every webhook sent to you: status, attempts and your endpoint's response. Retries of the same webhook are one
9
+ * delivery with an attempt count. Deliveries are kept for 90 days.
10
+ */
11
+ class DeliveriesResource {
12
+ #scope;
13
+ /** @internal */
14
+ constructor(scope) {
15
+ this.#scope = scope;
16
+ }
17
+ /**
18
+ * Lists deliveries, newest first, one page at a time.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const { items } = await monitoring.deliveries.list({ status: 'failed', since: new Date(Date.now() - 86_400_000) })
23
+ * ```
24
+ */
25
+ async list(params = {}, options) {
26
+ return this.#scope.http.request({
27
+ method: 'GET',
28
+ path: `${await this.#scope.clientPath()}/deliveries`,
29
+ query: { ...params, since: iso(params.since), until: iso(params.until) },
30
+ idempotent: true,
31
+ options,
32
+ });
33
+ }
34
+ /**
35
+ * Iterates over all deliveries matching the filter, newest first.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * for await (const delivery of monitoring.deliveries.iterate({ status: 'failed' })) {
40
+ * console.log(delivery.txId, delivery.attempts, delivery.lastHttpStatus ?? delivery.lastError)
41
+ * }
42
+ * ```
43
+ */
44
+ iterate(filter = {}, options) {
45
+ return (0, pagination_js_1.paginate)((before) => this.list({ ...filter, before }, options));
46
+ }
47
+ /** Retrieves a delivery with the URL of the last attempt and the exact request body. */
48
+ async get(deliveryId, options) {
49
+ return this.#scope.http.request({ method: 'GET', path: `${await this.#scope.clientPath()}/deliveries/${(0, http_js_1.seg)(deliveryId)}`, idempotent: true, options });
50
+ }
51
+ }
52
+ exports.DeliveriesResource = DeliveriesResource;
53
+ //# sourceMappingURL=deliveries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliveries.js","sourceRoot":"","sources":["../../../src/resources/deliveries.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAC1D,yDAAgD;AA8B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,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IACxJ,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import { type RequestOptions } from '../core/http.js';
2
+ import type { Scope } from '../core/scope.js';
3
+ import type { Transaction } from '../generated/types.js';
4
+ /** Any transaction on a supported network, by hash. */
5
+ export declare class TransactionsResource {
6
+ #private;
7
+ /** @internal */
8
+ constructor(scope: Scope);
9
+ /**
10
+ * Retrieves a transaction — not only the ones you were notified about: status, confirmations, finality, fee and
11
+ * every transfer inside it, plus your monitored addresses and the webhooks sent to you for it.
12
+ *
13
+ * `final: true` means the transaction can no longer be reverted: on TRON the block is solidified (about 1 minute),
14
+ * on EVM networks it is finalized (about 13 minutes on Ethereum). Credit large amounts once the transaction is final.
15
+ *
16
+ * @param network - Network slug (`tron`, `ethereum`) or CAIP-2 ID.
17
+ * @param hash - EVM: `0x` followed by 64 hex characters. TRON: 64 hex characters.
18
+ * @throws {@link MonitoringApiError} `404` when the transaction does not exist on the network.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const tx = await monitoring.transactions.get('tron', event.tx.id)
23
+ * if (tx.status === 'success' && tx.final) await credit(event.tx)
24
+ * ```
25
+ */
26
+ get(network: string, hash: string, options?: RequestOptions): Promise<Transaction>;
27
+ }
28
+ //# sourceMappingURL=transactions.d.ts.map