@gearbox-protocol/sdk 18.2.0-next.1 → 18.2.0-next.10

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 (81) hide show
  1. package/dist/cjs/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.js +179 -0
  2. package/dist/cjs/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.js +534 -0
  3. package/dist/cjs/abi/router/treehouseWorker.js +885 -0
  4. package/dist/cjs/onchain/market/adapters/abi/actionAbi.js +1 -0
  5. package/dist/cjs/onchain/market/adapters/abi/conctructorAbi.js +3 -0
  6. package/dist/cjs/onchain/market/adapters/types.js +3 -0
  7. package/dist/cjs/permissionless/api/oracles/PermissionlessOracles.js +397 -50
  8. package/dist/cjs/permissionless/api/oracles/enrich.js +99 -0
  9. package/dist/cjs/permissionless/api/oracles/schemas.js +85 -35
  10. package/dist/cjs/permissionless/api/schemas.js +0 -3
  11. package/dist/cjs/permissionless/bindings/index.js +1 -1
  12. package/dist/cjs/permissionless/index.js +2 -1
  13. package/dist/cjs/permissionless/utils/index.js +1 -0
  14. package/dist/cjs/permissionless/utils/price-update/get-prices.js +25 -0
  15. package/dist/cjs/permissionless/utils/price-update/index.js +1 -0
  16. package/dist/cjs/testnets/TestnetsAPI.js +179 -0
  17. package/dist/cjs/testnets/errors/TestnetNotFoundError.js +15 -0
  18. package/dist/cjs/testnets/errors/TestnetRequestFailedError.js +24 -0
  19. package/dist/cjs/testnets/errors/TestnetStatusError.js +19 -0
  20. package/dist/cjs/testnets/errors/TestnetValidationError.js +24 -0
  21. package/dist/cjs/testnets/errors/TestnetWaitTimeoutError.js +30 -0
  22. package/dist/cjs/testnets/errors/TestnetsError.js +34 -0
  23. package/dist/cjs/testnets/errors/index.js +13 -0
  24. package/dist/cjs/testnets/index.js +32 -0
  25. package/dist/cjs/testnets/package.json +1 -0
  26. package/dist/cjs/testnets/schemas.js +242 -0
  27. package/dist/cjs/testnets/types.js +1 -0
  28. package/dist/esm/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.js +178 -0
  29. package/dist/esm/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.js +533 -0
  30. package/dist/esm/abi/router/treehouseWorker.js +884 -0
  31. package/dist/esm/onchain/market/adapters/abi/actionAbi.js +1 -0
  32. package/dist/esm/onchain/market/adapters/abi/conctructorAbi.js +3 -0
  33. package/dist/esm/onchain/market/adapters/types.js +3 -0
  34. package/dist/esm/permissionless/api/oracles/PermissionlessOracles.js +399 -52
  35. package/dist/esm/permissionless/api/oracles/enrich.js +94 -0
  36. package/dist/esm/permissionless/api/oracles/schemas.js +80 -35
  37. package/dist/esm/permissionless/api/schemas.js +2 -4
  38. package/dist/esm/permissionless/bindings/index.js +1 -1
  39. package/dist/esm/permissionless/index.js +3 -3
  40. package/dist/esm/permissionless/utils/index.js +2 -2
  41. package/dist/esm/permissionless/utils/price-update/get-prices.js +25 -1
  42. package/dist/esm/permissionless/utils/price-update/index.js +2 -2
  43. package/dist/esm/testnets/TestnetsAPI.js +178 -0
  44. package/dist/esm/testnets/errors/TestnetNotFoundError.js +14 -0
  45. package/dist/esm/testnets/errors/TestnetRequestFailedError.js +23 -0
  46. package/dist/esm/testnets/errors/TestnetStatusError.js +18 -0
  47. package/dist/esm/testnets/errors/TestnetValidationError.js +23 -0
  48. package/dist/esm/testnets/errors/TestnetWaitTimeoutError.js +29 -0
  49. package/dist/esm/testnets/errors/TestnetsError.js +33 -0
  50. package/dist/esm/testnets/errors/index.js +7 -0
  51. package/dist/esm/testnets/index.js +11 -0
  52. package/dist/esm/testnets/package.json +1 -0
  53. package/dist/esm/testnets/schemas.js +228 -0
  54. package/dist/esm/testnets/types.js +1 -0
  55. package/dist/types/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.d.ts +148 -0
  56. package/dist/types/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.d.ts +440 -0
  57. package/dist/types/abi/router/treehouseWorker.d.ts +728 -0
  58. package/dist/types/onchain/market/adapters/types.d.ts +4 -1
  59. package/dist/types/permissionless/api/index.d.ts +2 -2
  60. package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +120 -37
  61. package/dist/types/permissionless/api/oracles/enrich.d.ts +59 -0
  62. package/dist/types/permissionless/api/oracles/index.d.ts +2 -2
  63. package/dist/types/permissionless/api/oracles/schemas.d.ts +164 -24
  64. package/dist/types/permissionless/api/oracles/types.d.ts +350 -63
  65. package/dist/types/permissionless/api/schemas.d.ts +0 -2
  66. package/dist/types/permissionless/index.d.ts +3 -3
  67. package/dist/types/permissionless/utils/index.d.ts +2 -2
  68. package/dist/types/permissionless/utils/price-update/get-prices.d.ts +17 -0
  69. package/dist/types/permissionless/utils/price-update/index.d.ts +2 -2
  70. package/dist/types/testnets/TestnetsAPI.d.ts +108 -0
  71. package/dist/types/testnets/errors/TestnetNotFoundError.d.ts +12 -0
  72. package/dist/types/testnets/errors/TestnetRequestFailedError.d.ts +11 -0
  73. package/dist/types/testnets/errors/TestnetStatusError.d.ts +15 -0
  74. package/dist/types/testnets/errors/TestnetValidationError.d.ts +16 -0
  75. package/dist/types/testnets/errors/TestnetWaitTimeoutError.d.ts +21 -0
  76. package/dist/types/testnets/errors/TestnetsError.d.ts +47 -0
  77. package/dist/types/testnets/errors/index.d.ts +7 -0
  78. package/dist/types/testnets/index.d.ts +11 -0
  79. package/dist/types/testnets/schemas.d.ts +554 -0
  80. package/dist/types/testnets/types.d.ts +717 -0
  81. package/package.json +9 -3
@@ -0,0 +1,717 @@
1
+ import { NetworkType } from "../onchain/chain/chains.js";
2
+ import { Address } from "viem";
3
+ //#region src/testnets/types.d.ts
4
+ /**
5
+ * Status of a script or task run.
6
+ *
7
+ * Mirrors Go `core.StageStatus` (anvil-manager `backend/manager/core/stages.go`).
8
+ * `error` is a failure of the executor, `failed` a failure inside the stage,
9
+ * `terminated` a stage killed by the task executor or one that died with it.
10
+ **/
11
+ export type TestnetStageStatus = "queued" | "started" | "error" | "failed" | "success" | "terminated";
12
+ /**
13
+ * State of a testnet's backend sidecar.
14
+ *
15
+ * Mirrors the Go `backendState*` constants (anvil-manager
16
+ * `backend/manager/backend.go`).
17
+ **/
18
+ export type TestnetBackendState = "provisioning" | "starting" | "active" | "error";
19
+ /**
20
+ * A testnet as the list endpoint returns it.
21
+ *
22
+ * Mirrors Go `core.ListedFork` (anvil-manager `backend/manager/core/responses.go`).
23
+ **/
24
+ export interface Testnet {
25
+ /**
26
+ * Alias of a persistent testnet, empty string for a non-persistent one.
27
+ **/
28
+ alias: string;
29
+ /**
30
+ * Execution id, empty string for a persistent testnet that has no running
31
+ * execution (paused or dead).
32
+ **/
33
+ executionId: string;
34
+ isActive: boolean;
35
+ description: string;
36
+ persistent: boolean;
37
+ paused: boolean;
38
+ network: NetworkType;
39
+ /**
40
+ * ISO timestamp. Go's zero time (`0001-01-01T00:00:00Z`) for a persistent
41
+ * testnet that has no running execution.
42
+ **/
43
+ createdAt: string;
44
+ }
45
+ /**
46
+ * Optional backend sidecar of a testnet, which provisions a temporary Neon
47
+ * database and exposes its API via proxy.
48
+ *
49
+ * Mirrors Go `core.BackendOptions` (anvil-manager `backend/manager/core/pipeline.go`).
50
+ **/
51
+ export interface TestnetBackendOptions {
52
+ /**
53
+ * Backend image version/tag override.
54
+ **/
55
+ version?: string;
56
+ /**
57
+ * Extra env passed to the backend container, interpolated like
58
+ * {@link TestnetScriptOptions.env}.
59
+ **/
60
+ env?: Record<string, string>;
61
+ /**
62
+ * Neon branch id or name to use as parent for the provisioned database
63
+ * branch, falls back to the server's default branch.
64
+ **/
65
+ parentBranchId?: string;
66
+ }
67
+ /**
68
+ * Runtime state of a testnet's backend sidecar.
69
+ *
70
+ * Mirrors Go `core.BackendStatus` (anvil-manager `backend/manager/core/pipeline.go`).
71
+ **/
72
+ export interface TestnetBackendStatus {
73
+ state: TestnetBackendState;
74
+ error?: string;
75
+ /**
76
+ * OCI image version label of the image the sidecar was started from. Absent
77
+ * when the label is missing or the image could not be obtained.
78
+ **/
79
+ version?: string;
80
+ }
81
+ /**
82
+ * A block of a testnet.
83
+ *
84
+ * Mirrors Go `core.ForkBlock` (anvil-manager `backend/manager/core/pipeline.go`).
85
+ **/
86
+ export interface TestnetBlock {
87
+ number: number;
88
+ /**
89
+ * ISO timestamp of the block.
90
+ **/
91
+ time: string;
92
+ }
93
+ /**
94
+ * Snapshot of a testnet block, taken around scripts and for the latest block.
95
+ *
96
+ * Mirrors Go `core.ScriptBlock` (anvil-manager `backend/manager/core/scripts.go`).
97
+ **/
98
+ export interface TestnetScriptBlock extends TestnetBlock {
99
+ /**
100
+ * Time delta in seconds from block timestamp to realtime. Positive means
101
+ * that the fork ran into the future, which can break price updates.
102
+ **/
103
+ timeDrift: number;
104
+ /**
105
+ * Delta from the block with the same number on the origin RPC, or `"ahead"`
106
+ * when the fork is ahead of it.
107
+ **/
108
+ originDrift: string;
109
+ automine: boolean;
110
+ mineInterval: number;
111
+ }
112
+ /**
113
+ * A script to run on a testnet, as {@link CreateTestnetRequest.scripts} sends
114
+ * it.
115
+ *
116
+ * Mirrors Go `core.ScriptOpts` (anvil-manager `backend/manager/core/scripts.go`)
117
+ * on input. The backend defaults `timeout` to 10 minutes, and `npx` to
118
+ * `@gearbox-protocol/deploy-v3` when neither `npx` nor `docker` is set.
119
+ **/
120
+ export interface TestnetScriptRequest {
121
+ /**
122
+ * Script id, must be unique for the testnet and match `^[a-zA-Z0-9_]+$`.
123
+ **/
124
+ id: string;
125
+ /**
126
+ * Script description for meatbags.
127
+ **/
128
+ description?: string;
129
+ /**
130
+ * NPM package to execute using npx.
131
+ **/
132
+ npx?: string;
133
+ /**
134
+ * Docker image to execute as script.
135
+ **/
136
+ docker?: string;
137
+ /**
138
+ * Args to pass to script. Supports interpolation. If package.json has a
139
+ * named binary, the first arg should be the command name, otherwise the
140
+ * package name part without scope.
141
+ **/
142
+ args?: string[];
143
+ /**
144
+ * Configurable env to pass to script. Supports interpolation.
145
+ **/
146
+ env?: Record<string, string>;
147
+ /**
148
+ * Flags to pass to script executor.
149
+ **/
150
+ flags?: string[];
151
+ /**
152
+ * Script execution timeout as a Go duration string, e.g. `"10m0s"`.
153
+ **/
154
+ timeout?: string;
155
+ /**
156
+ * Package manager to install npm dependencies.
157
+ **/
158
+ packageManager?: string;
159
+ /**
160
+ * JSON content that will be serialized as input.json file and made
161
+ * available to script.
162
+ **/
163
+ input?: unknown;
164
+ }
165
+ /**
166
+ * A script of a testnet, as the backend returns it.
167
+ *
168
+ * Mirrors Go `core.ScriptOpts` (anvil-manager `backend/manager/core/scripts.go`)
169
+ * on output. Go sends nil `args`, `env` and `flags` as `null`; they are
170
+ * normalised to `[]` and `{}`.
171
+ **/
172
+ export interface TestnetScriptOptions extends TestnetScriptRequest {
173
+ description: string;
174
+ args: string[];
175
+ env: Record<string, string>;
176
+ flags: string[];
177
+ timeout: string;
178
+ }
179
+ /**
180
+ * A script that a testnet ran.
181
+ *
182
+ * Mirrors Go `core.ExecutedScript` (anvil-manager `backend/manager/core/scripts.go`).
183
+ **/
184
+ export interface TestnetScript {
185
+ /**
186
+ * Script options.
187
+ **/
188
+ script: TestnetScriptOptions;
189
+ /**
190
+ * Duration of the script execution, as a Go duration string.
191
+ **/
192
+ duration: string;
193
+ /**
194
+ * Block snapshot taken before the script ran.
195
+ **/
196
+ blockBefore?: TestnetScriptBlock;
197
+ /**
198
+ * Block snapshot taken after the script ran.
199
+ **/
200
+ blockAfter?: TestnetScriptBlock;
201
+ /**
202
+ * Status of the script execution.
203
+ **/
204
+ status: TestnetStageStatus;
205
+ /**
206
+ * Script error when `status` is `failed`, executor error when it is `error`.
207
+ **/
208
+ error?: string;
209
+ /**
210
+ * `-1` if the script didn't even start.
211
+ **/
212
+ exitCode: number;
213
+ /**
214
+ * Source repo of the docker image, from the
215
+ * `org.opencontainers.image.source` label.
216
+ **/
217
+ source?: string;
218
+ /**
219
+ * Commit in the source repo, from the `org.opencontainers.image.revision`
220
+ * label.
221
+ **/
222
+ revision?: string;
223
+ }
224
+ /**
225
+ * A task to run on a testnet, as {@link CreateTestnetRequest.tasks} sends it.
226
+ *
227
+ * Mirrors Go `core.TaskDefinition` (anvil-manager
228
+ * `backend/manager/core/task_definition.go`) on input.
229
+ **/
230
+ export interface TestnetTaskDefinitionRequest {
231
+ /**
232
+ * Unique task definition id, do not confuse with task id. Can be empty for
233
+ * ad-hoc task definitions.
234
+ **/
235
+ id?: string;
236
+ /**
237
+ * Identifies a group of tasks that are displayed the same way but configured
238
+ * slightly differently, e.g. beta and production configurations of
239
+ * optimist. Used by the frontend to choose the result renderer.
240
+ **/
241
+ family?: string;
242
+ /**
243
+ * Task name for humans, used as tab name in UI.
244
+ **/
245
+ name?: string;
246
+ /**
247
+ * Task description for humans.
248
+ **/
249
+ description?: string;
250
+ /**
251
+ * Docker image name in the `@gearbox-protocol` org, e.g. `deploy-v3`.
252
+ **/
253
+ image: string;
254
+ /**
255
+ * Docker image version, can be prefixed with `ssm://` to get the version
256
+ * from AWS SSM, otherwise defaults to latest.
257
+ **/
258
+ version?: string;
259
+ /**
260
+ * Docker entrypoint.
261
+ **/
262
+ entrypoint?: string[];
263
+ /**
264
+ * Docker command.
265
+ **/
266
+ command?: string[];
267
+ /**
268
+ * Environment variables to pass to container.
269
+ **/
270
+ env?: Record<string, string>;
271
+ /**
272
+ * Secrets to load from AWS Secrets Manager and pass as env variables to the
273
+ * container: env variable name to `(!)AWS_SECRET_NAME.(optional json
274
+ * field)`, where `!` means that the secret should be refetched.
275
+ **/
276
+ secrets?: Record<string, string>;
277
+ /**
278
+ * Will be saved as file and mounted to container.
279
+ **/
280
+ input?: unknown;
281
+ /**
282
+ * Timeout for the task in minutes.
283
+ **/
284
+ timeout?: number;
285
+ /**
286
+ * If true, task can be started concurrently with other tasks.
287
+ **/
288
+ concurrent?: boolean;
289
+ /**
290
+ * Task can start other containers.
291
+ **/
292
+ multicontainer?: boolean;
293
+ /**
294
+ * Schema version, to facilitate breaking changes in schema.
295
+ **/
296
+ schemaVersion?: number;
297
+ }
298
+ /**
299
+ * A task definition of a testnet, as the backend returns it.
300
+ *
301
+ * Mirrors Go `core.TaskDefinition` (anvil-manager
302
+ * `backend/manager/core/task_definition.go`) on output.
303
+ **/
304
+ export interface TestnetTaskDefinition extends TestnetTaskDefinitionRequest {
305
+ concurrent: boolean;
306
+ multicontainer: boolean;
307
+ }
308
+ /**
309
+ * Progress of a testnet task.
310
+ *
311
+ * Mirrors Go `core.TaskProgress` (anvil-manager `backend/manager/core/task.go`).
312
+ **/
313
+ export interface TestnetTaskProgress {
314
+ completed: number;
315
+ total: number;
316
+ /**
317
+ * Additional details about task progress. Depending on task definition
318
+ * family, this can have a special renderer.
319
+ **/
320
+ details?: unknown;
321
+ }
322
+ /**
323
+ * A task run on a testnet.
324
+ *
325
+ * Mirrors Go `core.Task` and the embedded `core.TaskExecutionData`
326
+ * (anvil-manager `backend/manager/core/task.go`).
327
+ **/
328
+ export interface TestnetTask {
329
+ /**
330
+ * Unique task id, do not confuse with task definition id.
331
+ **/
332
+ id: string;
333
+ definitionId: string;
334
+ family: string;
335
+ /**
336
+ * Execution id of the testnet the task runs on.
337
+ **/
338
+ executionId: string;
339
+ /**
340
+ * Task name for humans, used as tab name in UI.
341
+ **/
342
+ name?: string;
343
+ /**
344
+ * Task description for humans.
345
+ **/
346
+ description?: string;
347
+ /**
348
+ * Full docker image, can include docker registry (e.g. ghcr.io).
349
+ **/
350
+ image: string;
351
+ /**
352
+ * Source repo of the docker image, from the
353
+ * `org.opencontainers.image.source` label.
354
+ **/
355
+ source?: string;
356
+ /**
357
+ * Commit in the source repo, from the `org.opencontainers.image.revision`
358
+ * label.
359
+ **/
360
+ revision?: string;
361
+ /**
362
+ * Docker entrypoint.
363
+ **/
364
+ entrypoint?: string[];
365
+ /**
366
+ * Docker command.
367
+ **/
368
+ command?: string[];
369
+ /**
370
+ * Environment variables to pass to container.
371
+ **/
372
+ env?: Record<string, string>;
373
+ /**
374
+ * Secrets passed to container as env variables, censored.
375
+ **/
376
+ secrets?: Record<string, string>;
377
+ /**
378
+ * Will be saved as file and mounted to container.
379
+ **/
380
+ input?: unknown;
381
+ /**
382
+ * Task can start other containers.
383
+ **/
384
+ multicontainer: boolean;
385
+ /**
386
+ * If true, task can be started concurrently with other tasks.
387
+ **/
388
+ concurrent: boolean;
389
+ /**
390
+ * Output dir of the task inside the execution dir.
391
+ **/
392
+ outputDir?: string;
393
+ status: TestnetStageStatus;
394
+ /**
395
+ * Error in case the task manager failed to start the task.
396
+ **/
397
+ error?: string;
398
+ /**
399
+ * ISO timestamp.
400
+ **/
401
+ createdAt: string;
402
+ /**
403
+ * ISO timestamp.
404
+ **/
405
+ updatedAt: string;
406
+ progress: TestnetTaskProgress;
407
+ }
408
+ /**
409
+ * Options a testnet was created with, as the backend returns them.
410
+ *
411
+ * Mirrors Go `core.PipelineOptions` (anvil-manager
412
+ * `backend/manager/core/pipeline.go`) on output. Go sends nil `scripts` and
413
+ * `webhooks` as `null`; they are normalised to `[]`.
414
+ **/
415
+ export interface TestnetOptions {
416
+ /**
417
+ * Description for meatbags.
418
+ **/
419
+ description?: string;
420
+ /**
421
+ * Override chain ID that the anvil fork uses.
422
+ **/
423
+ chainId?: number;
424
+ /**
425
+ * Network whose default providers are used.
426
+ **/
427
+ network: NetworkType;
428
+ /**
429
+ * CID of the fork input (for permissionless forks).
430
+ **/
431
+ cid?: string;
432
+ /**
433
+ * Extra flags to pass to anvil.
434
+ **/
435
+ anvilFlags?: string[];
436
+ /**
437
+ * Override anvil image, can be a foundry image tag or a full image name.
438
+ **/
439
+ anvilImage?: string;
440
+ /**
441
+ * RPC provider override for the fork.
442
+ **/
443
+ rpcProvider?: string;
444
+ /**
445
+ * Gearbox address provider, defaults to the v3.1 address provider (same on
446
+ * all chains).
447
+ **/
448
+ addressProvider?: Address;
449
+ /**
450
+ * Override market configurators.
451
+ **/
452
+ marketConfigurators?: Address[];
453
+ /**
454
+ * Override RWA factories.
455
+ **/
456
+ rwaFactories?: Address[];
457
+ /**
458
+ * Block to start the fork from, an expression that follows the rules of the
459
+ * backend's `BlockByExpression`. Empty string for the latest block.
460
+ **/
461
+ blockNumber: string;
462
+ /**
463
+ * User who owns this testnet.
464
+ **/
465
+ owner: string;
466
+ /**
467
+ * Testnet TTL as a Go duration string, e.g. `"1h"`.
468
+ **/
469
+ timeout: string;
470
+ /**
471
+ * Log level for synctron.
472
+ **/
473
+ synctronLogLevel?: string;
474
+ /**
475
+ * Deploy scripts run before the testnet is ready.
476
+ **/
477
+ scripts: TestnetScriptOptions[];
478
+ /**
479
+ * If set, price feeds aren't synced and update epoch isn't called.
480
+ **/
481
+ disableSync: boolean;
482
+ /**
483
+ * If set, interval mining isn't enabled at the end of the deploy scripts.
484
+ **/
485
+ disableIntervalMining: boolean;
486
+ /**
487
+ * Allows to use `anvil_` RPC methods remotely.
488
+ **/
489
+ disableRPCProtection: boolean;
490
+ /**
491
+ * Run in debug mode: retain containers, verbose anvil logs, dump logs on
492
+ * failure.
493
+ **/
494
+ debug?: boolean;
495
+ /**
496
+ * Webhook URLs called when the testnet starts.
497
+ **/
498
+ webhooks: string[];
499
+ /**
500
+ * Backend sidecar of the testnet, if one was requested.
501
+ **/
502
+ backend?: TestnetBackendOptions;
503
+ /**
504
+ * Tasks to run.
505
+ **/
506
+ tasks?: TestnetTaskDefinition[];
507
+ }
508
+ /**
509
+ * Body of a testnet creation request.
510
+ *
511
+ * Mirrors Go `core.PipelineOptions` (anvil-manager
512
+ * `backend/manager/core/pipeline.go`) on input. The backend fills defaults for
513
+ * omitted fields: `network: "Mainnet"`, `timeout: "1h"`. There is no `alias`:
514
+ * creating with one pins the testnet as persistent, which this client does not
515
+ * manage.
516
+ **/
517
+ export interface CreateTestnetRequest {
518
+ /**
519
+ * Description for meatbags.
520
+ **/
521
+ description?: string;
522
+ /**
523
+ * Override chain ID that the anvil fork will use.
524
+ **/
525
+ chainId?: number;
526
+ /**
527
+ * Network whose default providers will be used.
528
+ *
529
+ * @defaultValue `"Mainnet"`
530
+ **/
531
+ network?: NetworkType;
532
+ /**
533
+ * CID of the fork input (for permissionless forks).
534
+ **/
535
+ cid?: string;
536
+ /**
537
+ * Extra flags to pass to anvil.
538
+ **/
539
+ anvilFlags?: string[];
540
+ /**
541
+ * Override anvil image, can be a foundry image tag or a full image name.
542
+ **/
543
+ anvilImage?: string;
544
+ /**
545
+ * RPC provider override for the fork.
546
+ **/
547
+ rpcProvider?: string;
548
+ /**
549
+ * Gearbox address provider, defaults to the v3.1 address provider (same on
550
+ * all chains).
551
+ **/
552
+ addressProvider?: Address;
553
+ /**
554
+ * Override market configurators.
555
+ **/
556
+ marketConfigurators?: Address[];
557
+ /**
558
+ * Override RWA factories.
559
+ **/
560
+ rwaFactories?: Address[];
561
+ /**
562
+ * Block to start the fork from, an expression that follows the rules of the
563
+ * backend's `BlockByExpression`.
564
+ **/
565
+ blockNumber?: string;
566
+ /**
567
+ * User who owns this testnet.
568
+ **/
569
+ owner?: string;
570
+ /**
571
+ * Testnet TTL as a Go duration string.
572
+ *
573
+ * @defaultValue `"1h"`
574
+ **/
575
+ timeout?: string;
576
+ /**
577
+ * Log level for synctron.
578
+ **/
579
+ synctronLogLevel?: string;
580
+ /**
581
+ * Deploy scripts to run before the testnet is ready.
582
+ **/
583
+ scripts?: TestnetScriptRequest[];
584
+ /**
585
+ * If set, price feeds won't be synced and update epoch won't be called.
586
+ **/
587
+ disableSync?: boolean;
588
+ /**
589
+ * If set, interval mining isn't enabled at the end of the deploy scripts.
590
+ **/
591
+ disableIntervalMining?: boolean;
592
+ /**
593
+ * Allows to use `anvil_` RPC methods remotely.
594
+ **/
595
+ disableRPCProtection?: boolean;
596
+ /**
597
+ * Run in debug mode: retain containers, verbose anvil logs, dump logs on
598
+ * failure.
599
+ **/
600
+ debug?: boolean;
601
+ /**
602
+ * Webhook URLs to call when the testnet starts.
603
+ **/
604
+ webhooks?: string[];
605
+ /**
606
+ * If set, run a backend sidecar for this testnet.
607
+ **/
608
+ backend?: TestnetBackendOptions;
609
+ /**
610
+ * Tasks to run.
611
+ **/
612
+ tasks?: TestnetTaskDefinitionRequest[];
613
+ }
614
+ /**
615
+ * Files uploaded with a testnet creation request, saved in the testnet's
616
+ * shared dir: file name to contents.
617
+ **/
618
+ export type TestnetFiles = Record<string, string | Uint8Array | Blob>;
619
+ /**
620
+ * Stored and runtime state of a testnet.
621
+ *
622
+ * Mirrors Go `core.PipelineStatus` and the embedded `core.PipelineData`
623
+ * (anvil-manager `backend/manager/core/pipeline.go`).
624
+ **/
625
+ export interface TestnetStatus {
626
+ /**
627
+ * Alias of a persistent testnet, absent for a non-persistent one.
628
+ **/
629
+ alias?: string;
630
+ network: NetworkType;
631
+ /**
632
+ * ISO timestamp of the next restart of a persistent testnet.
633
+ **/
634
+ nextRestart?: string;
635
+ isActive: boolean;
636
+ /**
637
+ * Anvil active, scripts done, first price sync done (unless disabled),
638
+ * backend sidecar active (if configured).
639
+ **/
640
+ ready: boolean;
641
+ paused: boolean;
642
+ /**
643
+ * JSON-RPC URL of the testnet, absent when it is not running.
644
+ **/
645
+ rpcUrl?: string;
646
+ /**
647
+ * Page of the testnet in the anvil-manager web app.
648
+ **/
649
+ url: string;
650
+ logsUrl: string;
651
+ persistent: boolean;
652
+ latestBlock?: TestnetScriptBlock;
653
+ tasks?: TestnetTask[];
654
+ backend?: TestnetBackendStatus;
655
+ /**
656
+ * Unique identifier of the execution.
657
+ **/
658
+ executionId: string;
659
+ /**
660
+ * Options the testnet was created with.
661
+ **/
662
+ options: TestnetOptions;
663
+ /**
664
+ * Block the testnet was forked at.
665
+ **/
666
+ forkBlock: TestnetBlock;
667
+ /**
668
+ * Block when the initial chainlink price feed sync was completed, `0` until
669
+ * then.
670
+ **/
671
+ syncBlock: number;
672
+ /**
673
+ * Latest price feed sync failure, cleared after the next successful sync.
674
+ **/
675
+ syncError?: string;
676
+ /**
677
+ * Chain ID of the origin network.
678
+ **/
679
+ originChainId: number;
680
+ /**
681
+ * Chain ID of the anvil fork.
682
+ **/
683
+ anvilChainId: number;
684
+ /**
685
+ * ISO timestamp of when the testnet was created.
686
+ **/
687
+ createdAt: string;
688
+ /**
689
+ * Gearbox address provider.
690
+ **/
691
+ addressProvider: Address;
692
+ /**
693
+ * Market configurators.
694
+ **/
695
+ marketConfigurators?: Address[];
696
+ /**
697
+ * RWA factories.
698
+ **/
699
+ rwaFactories?: Address[];
700
+ /**
701
+ * Address of the contract that holds the execution id onchain.
702
+ **/
703
+ onchainExecutionId: Address;
704
+ /**
705
+ * Scripts and their execution info.
706
+ **/
707
+ scripts?: TestnetScript[];
708
+ /**
709
+ * IPFS CID of the fork input.
710
+ **/
711
+ cid?: string;
712
+ /**
713
+ * Files uploaded during testnet creation.
714
+ **/
715
+ files?: string[];
716
+ }
717
+ //#endregion