@gearbox-protocol/sdk 18.2.0-next.5 → 18.2.0-next.6

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 (36) hide show
  1. package/dist/cjs/testnets/TestnetsAPI.js +179 -0
  2. package/dist/cjs/testnets/errors/TestnetNotFoundError.js +15 -0
  3. package/dist/cjs/testnets/errors/TestnetRequestFailedError.js +24 -0
  4. package/dist/cjs/testnets/errors/TestnetStatusError.js +19 -0
  5. package/dist/cjs/testnets/errors/TestnetValidationError.js +24 -0
  6. package/dist/cjs/testnets/errors/TestnetWaitTimeoutError.js +30 -0
  7. package/dist/cjs/testnets/errors/TestnetsError.js +34 -0
  8. package/dist/cjs/testnets/errors/index.js +13 -0
  9. package/dist/cjs/testnets/index.js +32 -0
  10. package/dist/cjs/testnets/package.json +1 -0
  11. package/dist/cjs/testnets/schemas.js +242 -0
  12. package/dist/cjs/testnets/types.js +1 -0
  13. package/dist/esm/testnets/TestnetsAPI.js +178 -0
  14. package/dist/esm/testnets/errors/TestnetNotFoundError.js +14 -0
  15. package/dist/esm/testnets/errors/TestnetRequestFailedError.js +23 -0
  16. package/dist/esm/testnets/errors/TestnetStatusError.js +18 -0
  17. package/dist/esm/testnets/errors/TestnetValidationError.js +23 -0
  18. package/dist/esm/testnets/errors/TestnetWaitTimeoutError.js +29 -0
  19. package/dist/esm/testnets/errors/TestnetsError.js +33 -0
  20. package/dist/esm/testnets/errors/index.js +7 -0
  21. package/dist/esm/testnets/index.js +11 -0
  22. package/dist/esm/testnets/package.json +1 -0
  23. package/dist/esm/testnets/schemas.js +228 -0
  24. package/dist/esm/testnets/types.js +1 -0
  25. package/dist/types/testnets/TestnetsAPI.d.ts +108 -0
  26. package/dist/types/testnets/errors/TestnetNotFoundError.d.ts +12 -0
  27. package/dist/types/testnets/errors/TestnetRequestFailedError.d.ts +11 -0
  28. package/dist/types/testnets/errors/TestnetStatusError.d.ts +15 -0
  29. package/dist/types/testnets/errors/TestnetValidationError.d.ts +16 -0
  30. package/dist/types/testnets/errors/TestnetWaitTimeoutError.d.ts +21 -0
  31. package/dist/types/testnets/errors/TestnetsError.d.ts +47 -0
  32. package/dist/types/testnets/errors/index.d.ts +7 -0
  33. package/dist/types/testnets/index.d.ts +11 -0
  34. package/dist/types/testnets/schemas.d.ts +554 -0
  35. package/dist/types/testnets/types.d.ts +717 -0
  36. package/package.json +6 -1
@@ -0,0 +1,12 @@
1
+ import { TestnetStatusError } from "./TestnetStatusError.js";
2
+ //#region src/testnets/errors/TestnetNotFoundError.d.ts
3
+ /**
4
+ * Thrown when anvil-manager answered 404: there is no testnet with that
5
+ * execution id.
6
+ **/
7
+ export declare class TestnetNotFoundError extends TestnetStatusError {
8
+ name: string;
9
+ readonly status: 404;
10
+ constructor(url: string, details?: string);
11
+ }
12
+ //#endregion
@@ -0,0 +1,11 @@
1
+ import { TestnetsError } from "./TestnetsError.js";
2
+ //#region src/testnets/errors/TestnetRequestFailedError.d.ts
3
+ /**
4
+ * Thrown when a request to anvil-manager never completed: the network was
5
+ * down, or it took longer than the client's timeout.
6
+ **/
7
+ export declare class TestnetRequestFailedError extends TestnetsError {
8
+ name: string;
9
+ constructor(url: string, cause: unknown);
10
+ }
11
+ //#endregion
@@ -0,0 +1,15 @@
1
+ import { TestnetsError } from "./TestnetsError.js";
2
+ //#region src/testnets/errors/TestnetStatusError.d.ts
3
+ /**
4
+ * Thrown when anvil-manager answered with a status outside the 2xx range. What
5
+ * it said about it, when it said anything, is the `details` of the error.
6
+ **/
7
+ export declare class TestnetStatusError extends TestnetsError {
8
+ name: string;
9
+ /**
10
+ * Status anvil-manager answered with.
11
+ **/
12
+ readonly status: number;
13
+ constructor(url: string, status: number, details?: string);
14
+ }
15
+ //#endregion
@@ -0,0 +1,16 @@
1
+ import { TestnetsError } from "./TestnetsError.js";
2
+ import { z } from "zod/v4";
3
+ //#region src/testnets/errors/TestnetValidationError.d.ts
4
+ /**
5
+ * Thrown when anvil-manager answered, but with a payload the testnet schemas
6
+ * do not describe, i.e. the two are of different versions.
7
+ **/
8
+ export declare class TestnetValidationError extends TestnetsError {
9
+ name: string;
10
+ /**
11
+ * The zod failure itself, e.g. for `z.treeifyError(error.zodError)`.
12
+ **/
13
+ readonly zodError: z.core.$ZodError;
14
+ constructor(url: string, zodError: z.core.$ZodError);
15
+ }
16
+ //#endregion
@@ -0,0 +1,21 @@
1
+ import { TestnetsError } from "./TestnetsError.js";
2
+ //#region src/testnets/errors/TestnetWaitTimeoutError.d.ts
3
+ /**
4
+ * Thrown when a testnet did not become ready before the wait for it ran out.
5
+ **/
6
+ export declare class TestnetWaitTimeoutError extends TestnetsError {
7
+ name: string;
8
+ /**
9
+ * Execution id of the testnet that was waited for.
10
+ **/
11
+ readonly id: string;
12
+ /**
13
+ * How long the wait lasted, in milliseconds.
14
+ **/
15
+ readonly timeout: number;
16
+ /**
17
+ * @param url - Status URL that was polled.
18
+ **/
19
+ constructor(url: string, id: string, timeout: number);
20
+ }
21
+ //#endregion
@@ -0,0 +1,47 @@
1
+ import { BaseError } from "viem";
2
+ //#region src/testnets/errors/TestnetsError.d.ts
3
+ /**
4
+ * What every failure of a testnet API call names, see {@link TestnetsError}.
5
+ **/
6
+ export interface TestnetsErrorParams {
7
+ /**
8
+ * URL that was requested.
9
+ **/
10
+ url: string;
11
+ /**
12
+ * Status anvil-manager answered with, absent when the request never
13
+ * completed.
14
+ **/
15
+ status?: number;
16
+ /**
17
+ * Value that was caught. An `Error` becomes the `cause`, anything else is
18
+ * stringified into the details.
19
+ **/
20
+ cause?: unknown;
21
+ /**
22
+ * What anvil-manager itself said. Used only when there is no {@link cause},
23
+ * whose message viem reports instead.
24
+ **/
25
+ details?: string;
26
+ /**
27
+ * Extra lines reported after the URL and status.
28
+ **/
29
+ metaMessages?: string[];
30
+ }
31
+ /**
32
+ * Thrown by every testnet API call that fails. Its subclasses say how it
33
+ * failed; catch this one to catch all of them.
34
+ **/
35
+ export declare abstract class TestnetsError extends BaseError {
36
+ /**
37
+ * URL that was requested.
38
+ **/
39
+ readonly url: string;
40
+ /**
41
+ * Status anvil-manager answered with, absent when the request never
42
+ * completed.
43
+ **/
44
+ readonly status?: number;
45
+ protected constructor(summary: string, params: TestnetsErrorParams);
46
+ }
47
+ //#endregion
@@ -0,0 +1,7 @@
1
+ import { TestnetsError, TestnetsErrorParams } from "./TestnetsError.js";
2
+ import { TestnetStatusError } from "./TestnetStatusError.js";
3
+ import { TestnetNotFoundError } from "./TestnetNotFoundError.js";
4
+ import { TestnetRequestFailedError } from "./TestnetRequestFailedError.js";
5
+ import { TestnetValidationError } from "./TestnetValidationError.js";
6
+ import { TestnetWaitTimeoutError } from "./TestnetWaitTimeoutError.js";
7
+ export { TestnetNotFoundError, TestnetRequestFailedError, TestnetStatusError, TestnetValidationError, TestnetWaitTimeoutError, TestnetsError, TestnetsErrorParams };
@@ -0,0 +1,11 @@
1
+ import { CreateTestnetRequest, Testnet, TestnetBackendOptions, TestnetBackendState, TestnetBackendStatus, TestnetBlock, TestnetFiles, TestnetOptions, TestnetScript, TestnetScriptBlock, TestnetScriptOptions, TestnetScriptRequest, TestnetStageStatus, TestnetStatus, TestnetTask, TestnetTaskDefinition, TestnetTaskDefinitionRequest, TestnetTaskProgress } from "./types.js";
2
+ import { TestnetsAPI, TestnetsAPIOptions, WaitUntilReadyOptions } from "./TestnetsAPI.js";
3
+ import { TestnetsError, TestnetsErrorParams } from "./errors/TestnetsError.js";
4
+ import { TestnetStatusError } from "./errors/TestnetStatusError.js";
5
+ import { TestnetNotFoundError } from "./errors/TestnetNotFoundError.js";
6
+ import { TestnetRequestFailedError } from "./errors/TestnetRequestFailedError.js";
7
+ import { TestnetValidationError } from "./errors/TestnetValidationError.js";
8
+ import { TestnetWaitTimeoutError } from "./errors/TestnetWaitTimeoutError.js";
9
+ import "./errors/index.js";
10
+ import { testnetBackendOptionsSchema, testnetBackendStateSchema, testnetBackendStatusSchema, testnetBlockSchema, testnetOptionsSchema, testnetSchema, testnetScriptBlockSchema, testnetScriptOptionsSchema, testnetScriptSchema, testnetStageStatusSchema, testnetStatusSchema, testnetTaskDefinitionSchema, testnetTaskProgressSchema, testnetTaskSchema } from "./schemas.js";
11
+ export { CreateTestnetRequest, Testnet, TestnetBackendOptions, TestnetBackendState, TestnetBackendStatus, TestnetBlock, TestnetFiles, TestnetNotFoundError, TestnetOptions, TestnetRequestFailedError, TestnetScript, TestnetScriptBlock, TestnetScriptOptions, TestnetScriptRequest, TestnetStageStatus, TestnetStatus, TestnetStatusError, TestnetTask, TestnetTaskDefinition, TestnetTaskDefinitionRequest, TestnetTaskProgress, TestnetValidationError, TestnetWaitTimeoutError, TestnetsAPI, TestnetsAPIOptions, TestnetsError, TestnetsErrorParams, WaitUntilReadyOptions, testnetBackendOptionsSchema, testnetBackendStateSchema, testnetBackendStatusSchema, testnetBlockSchema, testnetOptionsSchema, testnetSchema, testnetScriptBlockSchema, testnetScriptOptionsSchema, testnetScriptSchema, testnetStageStatusSchema, testnetStatusSchema, testnetTaskDefinitionSchema, testnetTaskProgressSchema, testnetTaskSchema };