@gearbox-protocol/sdk 18.3.1 → 18.4.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.
- package/dist/cjs/abi/310/iKillSwitchProxy.js +130 -0
- package/dist/cjs/onchain/index.js +18 -0
- package/dist/cjs/onchain/market/adapters/abi/adapters/iTreehouseFastlaneAdapter.js +113 -0
- package/dist/cjs/onchain/market/adapters/abi/adapters/iTreehouseRedemptionGatewayAdapter.js +258 -0
- package/dist/cjs/onchain/market/adapters/abi/adapters/iTreehouseRouterAdapter.js +161 -0
- package/dist/cjs/onchain/market/adapters/abi/adapters/index.js +6 -0
- package/dist/cjs/onchain/market/adapters/abi/index.js +13 -0
- package/dist/cjs/onchain/market/adapters/abi/treehouse/iTreehouseFastlane.js +39 -0
- package/dist/cjs/onchain/market/adapters/abi/treehouse/iTreehouseRedemptionGateway.js +230 -0
- package/dist/cjs/onchain/market/adapters/abi/treehouse/iTreehouseRouter.js +29 -0
- package/dist/cjs/onchain/market/adapters/abi/treehouse/index.js +7 -0
- package/dist/cjs/onchain/market/adapters/contracts/TreehouseFastlaneAdapterContract.js +72 -0
- package/dist/cjs/onchain/market/adapters/contracts/TreehouseRedemptionGatewayAdapterContract.js +117 -0
- package/dist/cjs/onchain/market/adapters/contracts/TreehouseRouterAdapterContract.js +61 -0
- package/dist/cjs/onchain/market/adapters/contracts/index.js +6 -0
- package/dist/cjs/onchain/market/adapters/createAdapter.js +6 -0
- package/dist/cjs/onchain/market/adapters/index.js +18 -0
- package/dist/cjs/onchain/market/index.js +18 -0
- package/dist/cjs/permissionless/api/index.js +31 -0
- package/dist/cjs/permissionless/api/oracles/PermissionlessOracles.js +637 -65
- package/dist/cjs/permissionless/api/oracles/enrich.js +99 -0
- package/dist/cjs/permissionless/api/oracles/index.js +33 -0
- package/dist/cjs/permissionless/api/oracles/onchain-feed.js +25 -0
- package/dist/cjs/permissionless/api/oracles/schemas.js +84 -59
- package/dist/cjs/permissionless/api/oracles/score/formula.js +56 -0
- package/dist/cjs/permissionless/api/oracles/score/index.js +11 -0
- package/dist/cjs/permissionless/api/oracles/score/run.js +252 -0
- package/dist/cjs/permissionless/api/oracles/score/types.js +1 -0
- package/dist/cjs/permissionless/api/oracles/stress/classify.js +258 -0
- package/dist/cjs/permissionless/api/oracles/stress/index.js +24 -0
- package/dist/cjs/permissionless/api/oracles/stress/override.js +125 -0
- package/dist/cjs/permissionless/api/oracles/stress/run.js +485 -0
- package/dist/cjs/permissionless/api/oracles/stress/score.js +98 -0
- package/dist/cjs/permissionless/api/oracles/stress/types.js +1 -0
- package/dist/cjs/permissionless/api/schemas.js +0 -3
- package/dist/cjs/permissionless/api/transactions/InstanceOwnerTransactions.js +14 -3
- package/dist/cjs/permissionless/api/transactions/lp-price-feeds.js +10 -4
- package/dist/cjs/permissionless/bindings/bytecode-repository.js +8 -0
- package/dist/cjs/permissionless/bindings/governance/governor.js +1 -1
- package/dist/cjs/permissionless/bindings/index.js +8 -3
- package/dist/cjs/permissionless/bindings/kill-switch-proxy.js +188 -0
- package/dist/cjs/permissionless/bindings/market-configurator-factory.js +39 -1
- package/dist/cjs/permissionless/bindings/market-configurator.js +142 -0
- package/dist/cjs/permissionless/index.js +42 -3
- package/dist/cjs/permissionless/utils/index.js +3 -0
- package/dist/cjs/permissionless/utils/literals.js +2 -0
- package/dist/cjs/permissionless/utils/price-update/get-prices.js +64 -0
- package/dist/cjs/permissionless/utils/price-update/index.js +2 -0
- package/dist/cjs/testnets/TestnetsAPI.js +179 -0
- package/dist/cjs/testnets/errors/TestnetNotFoundError.js +15 -0
- package/dist/cjs/testnets/errors/TestnetRequestFailedError.js +24 -0
- package/dist/cjs/testnets/errors/TestnetStatusError.js +19 -0
- package/dist/cjs/testnets/errors/TestnetValidationError.js +24 -0
- package/dist/cjs/testnets/errors/TestnetWaitTimeoutError.js +30 -0
- package/dist/cjs/testnets/errors/TestnetsError.js +34 -0
- package/dist/cjs/testnets/errors/index.js +13 -0
- package/dist/cjs/testnets/index.js +32 -0
- package/dist/cjs/testnets/package.json +1 -0
- package/dist/cjs/testnets/schemas.js +242 -0
- package/dist/cjs/testnets/types.js +1 -0
- package/dist/esm/abi/310/iKillSwitchProxy.js +129 -0
- package/dist/esm/onchain/index.js +10 -1
- package/dist/esm/onchain/market/adapters/abi/adapters/iTreehouseFastlaneAdapter.js +112 -0
- package/dist/esm/onchain/market/adapters/abi/adapters/iTreehouseRedemptionGatewayAdapter.js +257 -0
- package/dist/esm/onchain/market/adapters/abi/adapters/iTreehouseRouterAdapter.js +160 -0
- package/dist/esm/onchain/market/adapters/abi/adapters/index.js +4 -1
- package/dist/esm/onchain/market/adapters/abi/index.js +8 -1
- package/dist/esm/onchain/market/adapters/abi/treehouse/iTreehouseFastlane.js +38 -0
- package/dist/esm/onchain/market/adapters/abi/treehouse/iTreehouseRedemptionGateway.js +229 -0
- package/dist/esm/onchain/market/adapters/abi/treehouse/iTreehouseRouter.js +28 -0
- package/dist/esm/onchain/market/adapters/abi/treehouse/index.js +4 -0
- package/dist/esm/onchain/market/adapters/contracts/TreehouseFastlaneAdapterContract.js +71 -0
- package/dist/esm/onchain/market/adapters/contracts/TreehouseRedemptionGatewayAdapterContract.js +116 -0
- package/dist/esm/onchain/market/adapters/contracts/TreehouseRouterAdapterContract.js +60 -0
- package/dist/esm/onchain/market/adapters/contracts/index.js +4 -1
- package/dist/esm/onchain/market/adapters/createAdapter.js +6 -0
- package/dist/esm/onchain/market/adapters/index.js +10 -1
- package/dist/esm/onchain/market/index.js +10 -1
- package/dist/esm/permissionless/api/index.js +7 -1
- package/dist/esm/permissionless/api/oracles/PermissionlessOracles.js +639 -67
- package/dist/esm/permissionless/api/oracles/enrich.js +94 -0
- package/dist/esm/permissionless/api/oracles/index.js +10 -1
- package/dist/esm/permissionless/api/oracles/onchain-feed.js +24 -0
- package/dist/esm/permissionless/api/oracles/schemas.js +80 -58
- package/dist/esm/permissionless/api/oracles/score/formula.js +51 -0
- package/dist/esm/permissionless/api/oracles/score/index.js +4 -0
- package/dist/esm/permissionless/api/oracles/score/run.js +250 -0
- package/dist/esm/permissionless/api/oracles/score/types.js +1 -0
- package/dist/esm/permissionless/api/oracles/stress/classify.js +256 -0
- package/dist/esm/permissionless/api/oracles/stress/index.js +6 -0
- package/dist/esm/permissionless/api/oracles/stress/override.js +119 -0
- package/dist/esm/permissionless/api/oracles/stress/run.js +478 -0
- package/dist/esm/permissionless/api/oracles/stress/score.js +95 -0
- package/dist/esm/permissionless/api/oracles/stress/types.js +1 -0
- package/dist/esm/permissionless/api/schemas.js +2 -4
- package/dist/esm/permissionless/api/transactions/InstanceOwnerTransactions.js +14 -3
- package/dist/esm/permissionless/api/transactions/lp-price-feeds.js +10 -4
- package/dist/esm/permissionless/bindings/bytecode-repository.js +8 -0
- package/dist/esm/permissionless/bindings/governance/governor.js +1 -1
- package/dist/esm/permissionless/bindings/index.js +5 -4
- package/dist/esm/permissionless/bindings/kill-switch-proxy.js +184 -0
- package/dist/esm/permissionless/bindings/market-configurator-factory.js +37 -0
- package/dist/esm/permissionless/bindings/market-configurator.js +143 -1
- package/dist/esm/permissionless/index.js +13 -6
- package/dist/esm/permissionless/utils/index.js +3 -3
- package/dist/esm/permissionless/utils/literals.js +2 -1
- package/dist/esm/permissionless/utils/price-update/get-prices.js +63 -1
- package/dist/esm/permissionless/utils/price-update/index.js +2 -2
- package/dist/esm/testnets/TestnetsAPI.js +178 -0
- package/dist/esm/testnets/errors/TestnetNotFoundError.js +14 -0
- package/dist/esm/testnets/errors/TestnetRequestFailedError.js +23 -0
- package/dist/esm/testnets/errors/TestnetStatusError.js +18 -0
- package/dist/esm/testnets/errors/TestnetValidationError.js +23 -0
- package/dist/esm/testnets/errors/TestnetWaitTimeoutError.js +29 -0
- package/dist/esm/testnets/errors/TestnetsError.js +33 -0
- package/dist/esm/testnets/errors/index.js +7 -0
- package/dist/esm/testnets/index.js +11 -0
- package/dist/esm/testnets/package.json +1 -0
- package/dist/esm/testnets/schemas.js +228 -0
- package/dist/esm/testnets/types.js +1 -0
- package/dist/types/abi/310/iKillSwitchProxy.d.ts +114 -0
- package/dist/types/onchain/index.d.ts +10 -1
- package/dist/types/onchain/market/adapters/abi/adapters/iTreehouseFastlaneAdapter.d.ts +101 -0
- package/dist/types/onchain/market/adapters/abi/adapters/iTreehouseRedemptionGatewayAdapter.d.ts +237 -0
- package/dist/types/onchain/market/adapters/abi/adapters/iTreehouseRouterAdapter.d.ts +146 -0
- package/dist/types/onchain/market/adapters/abi/adapters/index.d.ts +4 -1
- package/dist/types/onchain/market/adapters/abi/index.d.ts +8 -1
- package/dist/types/onchain/market/adapters/abi/treehouse/iTreehouseFastlane.d.ts +33 -0
- package/dist/types/onchain/market/adapters/abi/treehouse/iTreehouseRedemptionGateway.d.ts +207 -0
- package/dist/types/onchain/market/adapters/abi/treehouse/iTreehouseRouter.d.ts +27 -0
- package/dist/types/onchain/market/adapters/abi/treehouse/index.d.ts +4 -0
- package/dist/types/onchain/market/adapters/contracts/TreehouseFastlaneAdapterContract.d.ts +156 -0
- package/dist/types/onchain/market/adapters/contracts/TreehouseRedemptionGatewayAdapterContract.d.ts +481 -0
- package/dist/types/onchain/market/adapters/contracts/TreehouseRouterAdapterContract.d.ts +193 -0
- package/dist/types/onchain/market/adapters/contracts/index.d.ts +4 -1
- package/dist/types/onchain/market/adapters/index.d.ts +10 -1
- package/dist/types/onchain/market/index.d.ts +10 -1
- package/dist/types/permissionless/api/index.d.ts +10 -2
- package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +237 -47
- package/dist/types/permissionless/api/oracles/enrich.d.ts +59 -0
- package/dist/types/permissionless/api/oracles/index.d.ts +12 -2
- package/dist/types/permissionless/api/oracles/onchain-feed.d.ts +15 -0
- package/dist/types/permissionless/api/oracles/schemas.d.ts +147 -41
- package/dist/types/permissionless/api/oracles/score/formula.d.ts +36 -0
- package/dist/types/permissionless/api/oracles/score/index.d.ts +4 -0
- package/dist/types/permissionless/api/oracles/score/run.d.ts +42 -0
- package/dist/types/permissionless/api/oracles/score/types.d.ts +118 -0
- package/dist/types/permissionless/api/oracles/stress/classify.d.ts +57 -0
- package/dist/types/permissionless/api/oracles/stress/index.d.ts +6 -0
- package/dist/types/permissionless/api/oracles/stress/override.d.ts +59 -0
- package/dist/types/permissionless/api/oracles/stress/run.d.ts +100 -0
- package/dist/types/permissionless/api/oracles/stress/score.d.ts +57 -0
- package/dist/types/permissionless/api/oracles/stress/types.d.ts +272 -0
- package/dist/types/permissionless/api/oracles/types.d.ts +320 -125
- package/dist/types/permissionless/api/schemas.d.ts +0 -2
- package/dist/types/permissionless/api/transactions/lp-price-feeds.d.ts +9 -1
- package/dist/types/permissionless/bindings/bytecode-repository.d.ts +10 -1
- package/dist/types/permissionless/bindings/index.d.ts +4 -3
- package/dist/types/permissionless/bindings/kill-switch-proxy.d.ts +205 -0
- package/dist/types/permissionless/bindings/market-configurator-factory.d.ts +30 -0
- package/dist/types/permissionless/bindings/market-configurator.d.ts +30 -1
- package/dist/types/permissionless/bindings/types.d.ts +27 -0
- package/dist/types/permissionless/index.d.ts +15 -6
- package/dist/types/permissionless/utils/index.d.ts +3 -3
- package/dist/types/permissionless/utils/literals.d.ts +1 -0
- package/dist/types/permissionless/utils/price-update/get-prices.d.ts +33 -0
- package/dist/types/permissionless/utils/price-update/index.d.ts +2 -2
- package/dist/types/testnets/TestnetsAPI.d.ts +108 -0
- package/dist/types/testnets/errors/TestnetNotFoundError.d.ts +12 -0
- package/dist/types/testnets/errors/TestnetRequestFailedError.d.ts +11 -0
- package/dist/types/testnets/errors/TestnetStatusError.d.ts +15 -0
- package/dist/types/testnets/errors/TestnetValidationError.d.ts +16 -0
- package/dist/types/testnets/errors/TestnetWaitTimeoutError.d.ts +21 -0
- package/dist/types/testnets/errors/TestnetsError.d.ts +47 -0
- package/dist/types/testnets/errors/index.d.ts +7 -0
- package/dist/types/testnets/index.d.ts +11 -0
- package/dist/types/testnets/schemas.d.ts +554 -0
- package/dist/types/testnets/types.d.ts +717 -0
- package/package.json +6 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { TestnetStatusError } from "./errors/TestnetStatusError.js";
|
|
2
|
+
import { TestnetNotFoundError } from "./errors/TestnetNotFoundError.js";
|
|
3
|
+
import { TestnetRequestFailedError } from "./errors/TestnetRequestFailedError.js";
|
|
4
|
+
import { TestnetValidationError } from "./errors/TestnetValidationError.js";
|
|
5
|
+
import { TestnetWaitTimeoutError } from "./errors/TestnetWaitTimeoutError.js";
|
|
6
|
+
import "./errors/index.js";
|
|
7
|
+
import { testnetSchema, testnetStatusSchema } from "./schemas.js";
|
|
8
|
+
import { z } from "zod/v4";
|
|
9
|
+
//#region src/testnets/TestnetsAPI.ts
|
|
10
|
+
const DEFAULT_BASE_URL = "https://anvil.gearbox.foundation";
|
|
11
|
+
const DEFAULT_TIMEOUT = 3e4;
|
|
12
|
+
const DEFAULT_WAIT_TIMEOUT = 6e5;
|
|
13
|
+
const DEFAULT_WAIT_INTERVAL = 5e3;
|
|
14
|
+
const errorBodySchema = z.object({ error: z.string() });
|
|
15
|
+
/**
|
|
16
|
+
* Client for anvil-manager, which runs the anvil forks Gearbox calls
|
|
17
|
+
* testnets. It manages non-persistent testnets only, addressed by their
|
|
18
|
+
* execution id.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* const testnets = new TestnetsAPI({ apiKey: process.env.ANVIL_MANAGER_API_KEY });
|
|
22
|
+
* const { executionId } = await testnets.create({ network: "Mainnet", timeout: "2h" });
|
|
23
|
+
* const status = await testnets.waitUntilReady(executionId);
|
|
24
|
+
* // ... use status.rpcUrl ...
|
|
25
|
+
* await testnets.kill(executionId);
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* Every method throws a {@link TestnetsError} subclass when it fails, except
|
|
29
|
+
* when a response body is not JSON: then it rejects with the error of
|
|
30
|
+
* `response.json()`.
|
|
31
|
+
**/
|
|
32
|
+
var TestnetsAPI = class {
|
|
33
|
+
logger;
|
|
34
|
+
#baseUrl;
|
|
35
|
+
#apiKey;
|
|
36
|
+
#timeout;
|
|
37
|
+
constructor(options = {}) {
|
|
38
|
+
this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
39
|
+
this.#apiKey = options.apiKey;
|
|
40
|
+
this.#timeout = options.timeout ?? DEFAULT_TIMEOUT;
|
|
41
|
+
this.logger = options.logger?.child?.({ name: "TestnetsAPI" }) ?? options.logger;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Base URL every request of this client is sent to.
|
|
45
|
+
**/
|
|
46
|
+
get baseUrl() {
|
|
47
|
+
return this.#baseUrl;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Every testnet anvil-manager knows of, persistent ones included.
|
|
51
|
+
**/
|
|
52
|
+
async list() {
|
|
53
|
+
const url = this.#url("/api/v1/forks");
|
|
54
|
+
const response = await this.#fetch(url, { method: "GET" });
|
|
55
|
+
return this.#decode(url, response, z.array(testnetSchema));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Status of one testnet.
|
|
59
|
+
*
|
|
60
|
+
* @param id - Execution id of the testnet.
|
|
61
|
+
* @throws {@link TestnetNotFoundError} when there is no such testnet.
|
|
62
|
+
**/
|
|
63
|
+
async get(id) {
|
|
64
|
+
const url = this.#forkUrl(id);
|
|
65
|
+
const response = await this.#fetch(url, { method: "GET" });
|
|
66
|
+
return this.#decode(url, response, testnetStatusSchema);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Starts a testnet. It answers as soon as the testnet is created, long
|
|
70
|
+
* before it is {@link TestnetStatus.ready}.
|
|
71
|
+
*
|
|
72
|
+
* @param files - Saved in the testnet's shared dir, where scripts and tasks
|
|
73
|
+
* can read them.
|
|
74
|
+
**/
|
|
75
|
+
async create(request, files) {
|
|
76
|
+
const url = this.#url("/api/v1/forks");
|
|
77
|
+
const response = await this.#fetch(url, {
|
|
78
|
+
method: "POST",
|
|
79
|
+
...createBody(request, files)
|
|
80
|
+
});
|
|
81
|
+
return this.#decode(url, response, testnetStatusSchema);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Stops a testnet. Stopping one that is already stopped succeeds.
|
|
85
|
+
*
|
|
86
|
+
* @param id - Execution id of the testnet.
|
|
87
|
+
* @throws {@link TestnetNotFoundError} when there is no such testnet.
|
|
88
|
+
* @throws {@link TestnetStatusError} with status 400 when the testnet is
|
|
89
|
+
* persistent.
|
|
90
|
+
**/
|
|
91
|
+
async kill(id) {
|
|
92
|
+
await this.#fetch(this.#forkUrl(id), { method: "DELETE" });
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Polls a testnet's status until it is {@link TestnetStatus.ready}.
|
|
96
|
+
*
|
|
97
|
+
* @param id - Execution id of the testnet.
|
|
98
|
+
* @returns The first status that is ready.
|
|
99
|
+
* @throws {@link TestnetWaitTimeoutError} when the testnet is not ready in
|
|
100
|
+
* time. Any error of a poll is thrown as is, without retrying.
|
|
101
|
+
**/
|
|
102
|
+
async waitUntilReady(id, options = {}) {
|
|
103
|
+
const { timeout = DEFAULT_WAIT_TIMEOUT, interval = DEFAULT_WAIT_INTERVAL } = options;
|
|
104
|
+
const deadline = Date.now() + timeout;
|
|
105
|
+
while (true) {
|
|
106
|
+
const status = await this.get(id);
|
|
107
|
+
if (status.ready) return status;
|
|
108
|
+
const remaining = deadline - Date.now();
|
|
109
|
+
if (remaining <= 0) throw new TestnetWaitTimeoutError(this.#forkUrl(id), id, timeout);
|
|
110
|
+
this.logger?.debug(`testnet ${id} is not ready yet`);
|
|
111
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(interval, remaining)));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
#url(path) {
|
|
115
|
+
return `${this.#baseUrl}${path}`;
|
|
116
|
+
}
|
|
117
|
+
#forkUrl(id) {
|
|
118
|
+
return this.#url(`/api/v1/forks/${encodeURIComponent(id)}`);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Sends one request and returns its response once it is known to be 2xx.
|
|
122
|
+
**/
|
|
123
|
+
async #fetch(url, init) {
|
|
124
|
+
const headers = new Headers(init.headers);
|
|
125
|
+
headers.set("accept", "application/json");
|
|
126
|
+
if (this.#apiKey) headers.set("authorization", `Bearer ${this.#apiKey}`);
|
|
127
|
+
let response;
|
|
128
|
+
try {
|
|
129
|
+
response = await fetch(url, {
|
|
130
|
+
...init,
|
|
131
|
+
headers,
|
|
132
|
+
signal: AbortSignal.timeout(this.#timeout)
|
|
133
|
+
});
|
|
134
|
+
} catch (error) {
|
|
135
|
+
throw new TestnetRequestFailedError(url, error);
|
|
136
|
+
}
|
|
137
|
+
if (!response.ok) {
|
|
138
|
+
const responseBody = await response.text();
|
|
139
|
+
const details = errorBodySchema.safeParse(responseBody).data?.error;
|
|
140
|
+
throw response.status === 404 ? new TestnetNotFoundError(url, details) : new TestnetStatusError(url, response.status, details);
|
|
141
|
+
}
|
|
142
|
+
return response;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Body of a 2xx response, decoded.
|
|
146
|
+
**/
|
|
147
|
+
async #decode(url, response, schema) {
|
|
148
|
+
const payload = await response.json();
|
|
149
|
+
const parsed = schema.safeParse(payload);
|
|
150
|
+
if (!parsed.success) {
|
|
151
|
+
const error = new TestnetValidationError(url, parsed.error);
|
|
152
|
+
this.logger?.error(error, "anvil-manager response does not match the testnet schemas");
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
return parsed.data;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Body and content type of a create request: JSON alone, or a multipart form
|
|
160
|
+
* with the JSON in its `json` field when there are files to upload.
|
|
161
|
+
**/
|
|
162
|
+
function createBody(request, files) {
|
|
163
|
+
const json = JSON.stringify(request);
|
|
164
|
+
if (!files || Object.keys(files).length === 0) return {
|
|
165
|
+
body: json,
|
|
166
|
+
headers: { "content-type": "application/json" }
|
|
167
|
+
};
|
|
168
|
+
const form = new FormData();
|
|
169
|
+
form.append("json", json);
|
|
170
|
+
for (const [name, contents] of Object.entries(files)) form.append("file", toBlob(contents), name);
|
|
171
|
+
return { body: form };
|
|
172
|
+
}
|
|
173
|
+
function toBlob(contents) {
|
|
174
|
+
if (contents instanceof Blob) return contents;
|
|
175
|
+
return new Blob([typeof contents === "string" ? contents : new Uint8Array(contents)]);
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
export { TestnetsAPI };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TestnetStatusError } from "./TestnetStatusError.js";
|
|
2
|
+
//#region src/testnets/errors/TestnetNotFoundError.ts
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when anvil-manager answered 404: there is no testnet with that
|
|
5
|
+
* execution id.
|
|
6
|
+
**/
|
|
7
|
+
var TestnetNotFoundError = class extends TestnetStatusError {
|
|
8
|
+
name = "TestnetNotFoundError";
|
|
9
|
+
constructor(url, details) {
|
|
10
|
+
super(url, 404, details);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { TestnetNotFoundError };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TestnetsError } from "./TestnetsError.js";
|
|
2
|
+
//#region src/testnets/errors/TestnetRequestFailedError.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
|
+
var TestnetRequestFailedError = class extends TestnetsError {
|
|
8
|
+
name = "TestnetRequestFailedError";
|
|
9
|
+
constructor(url, cause) {
|
|
10
|
+
super(timedOut(cause) ? "The request to anvil-manager timed out." : "The request to anvil-manager failed.", {
|
|
11
|
+
url,
|
|
12
|
+
cause
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Whether a caught value is the rejection `AbortSignal.timeout` produces.
|
|
18
|
+
**/
|
|
19
|
+
function timedOut(error) {
|
|
20
|
+
return error instanceof Error && error.name === "TimeoutError";
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TestnetRequestFailedError };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TestnetsError } from "./TestnetsError.js";
|
|
2
|
+
//#region src/testnets/errors/TestnetStatusError.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
|
+
var TestnetStatusError = class extends TestnetsError {
|
|
8
|
+
name = "TestnetStatusError";
|
|
9
|
+
constructor(url, status, details) {
|
|
10
|
+
super(`anvil-manager answered ${status}.`, {
|
|
11
|
+
url,
|
|
12
|
+
status,
|
|
13
|
+
details
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { TestnetStatusError };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TestnetsError } from "./TestnetsError.js";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
//#region src/testnets/errors/TestnetValidationError.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
|
+
var TestnetValidationError = class extends TestnetsError {
|
|
9
|
+
name = "TestnetValidationError";
|
|
10
|
+
/**
|
|
11
|
+
* The zod failure itself, e.g. for `z.treeifyError(error.zodError)`.
|
|
12
|
+
**/
|
|
13
|
+
zodError;
|
|
14
|
+
constructor(url, zodError) {
|
|
15
|
+
super("The anvil-manager response does not match the testnet schemas.", {
|
|
16
|
+
url,
|
|
17
|
+
metaMessages: z.prettifyError(zodError).split("\n")
|
|
18
|
+
});
|
|
19
|
+
this.zodError = zodError;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TestnetValidationError };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TestnetsError } from "./TestnetsError.js";
|
|
2
|
+
//#region src/testnets/errors/TestnetWaitTimeoutError.ts
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when a testnet did not become ready before the wait for it ran out.
|
|
5
|
+
**/
|
|
6
|
+
var TestnetWaitTimeoutError = class extends TestnetsError {
|
|
7
|
+
name = "TestnetWaitTimeoutError";
|
|
8
|
+
/**
|
|
9
|
+
* Execution id of the testnet that was waited for.
|
|
10
|
+
**/
|
|
11
|
+
id;
|
|
12
|
+
/**
|
|
13
|
+
* How long the wait lasted, in milliseconds.
|
|
14
|
+
**/
|
|
15
|
+
timeout;
|
|
16
|
+
/**
|
|
17
|
+
* @param url - Status URL that was polled.
|
|
18
|
+
**/
|
|
19
|
+
constructor(url, id, timeout) {
|
|
20
|
+
super(`Testnet ${id} did not become ready within ${timeout} ms.`, {
|
|
21
|
+
url,
|
|
22
|
+
metaMessages: [`Execution id: ${id}`, `Timeout: ${timeout} ms`]
|
|
23
|
+
});
|
|
24
|
+
this.id = id;
|
|
25
|
+
this.timeout = timeout;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { TestnetWaitTimeoutError };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BaseError } from "viem";
|
|
2
|
+
//#region src/testnets/errors/TestnetsError.ts
|
|
3
|
+
/**
|
|
4
|
+
* Thrown by every testnet API call that fails. Its subclasses say how it
|
|
5
|
+
* failed; catch this one to catch all of them.
|
|
6
|
+
**/
|
|
7
|
+
var TestnetsError = class extends BaseError {
|
|
8
|
+
/**
|
|
9
|
+
* URL that was requested.
|
|
10
|
+
**/
|
|
11
|
+
url;
|
|
12
|
+
/**
|
|
13
|
+
* Status anvil-manager answered with, absent when the request never
|
|
14
|
+
* completed.
|
|
15
|
+
**/
|
|
16
|
+
status;
|
|
17
|
+
constructor(summary, params) {
|
|
18
|
+
const { cause, details } = params;
|
|
19
|
+
super(summary, {
|
|
20
|
+
cause: cause instanceof Error ? cause : void 0,
|
|
21
|
+
details: cause === void 0 || cause instanceof Error ? details : String(cause),
|
|
22
|
+
metaMessages: [
|
|
23
|
+
`URL: ${params.url}`,
|
|
24
|
+
...params.status === void 0 ? [] : [`Status: ${params.status}`],
|
|
25
|
+
...params.metaMessages ?? []
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
this.url = params.url;
|
|
29
|
+
this.status = params.status;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TestnetsError };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TestnetsError } 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 };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TestnetsError } from "./errors/TestnetsError.js";
|
|
2
|
+
import { TestnetStatusError } from "./errors/TestnetStatusError.js";
|
|
3
|
+
import { TestnetNotFoundError } from "./errors/TestnetNotFoundError.js";
|
|
4
|
+
import { TestnetRequestFailedError } from "./errors/TestnetRequestFailedError.js";
|
|
5
|
+
import { TestnetValidationError } from "./errors/TestnetValidationError.js";
|
|
6
|
+
import { TestnetWaitTimeoutError } from "./errors/TestnetWaitTimeoutError.js";
|
|
7
|
+
import "./errors/index.js";
|
|
8
|
+
import { testnetBackendOptionsSchema, testnetBackendStateSchema, testnetBackendStatusSchema, testnetBlockSchema, testnetOptionsSchema, testnetSchema, testnetScriptBlockSchema, testnetScriptOptionsSchema, testnetScriptSchema, testnetStageStatusSchema, testnetStatusSchema, testnetTaskDefinitionSchema, testnetTaskProgressSchema, testnetTaskSchema } from "./schemas.js";
|
|
9
|
+
import { TestnetsAPI } from "./TestnetsAPI.js";
|
|
10
|
+
import "./types.js";
|
|
11
|
+
export { TestnetNotFoundError, TestnetRequestFailedError, TestnetStatusError, TestnetValidationError, TestnetWaitTimeoutError, TestnetsAPI, TestnetsError, testnetBackendOptionsSchema, testnetBackendStateSchema, testnetBackendStatusSchema, testnetBlockSchema, testnetOptionsSchema, testnetSchema, testnetScriptBlockSchema, testnetScriptOptionsSchema, testnetScriptSchema, testnetStageStatusSchema, testnetStatusSchema, testnetTaskDefinitionSchema, testnetTaskProgressSchema, testnetTaskSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "module","sideEffects":false}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { NetworkType } from "../onchain/chain/chains.js";
|
|
2
|
+
import { ZodAddress } from "../onchain/utils/zod.js";
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
|
+
//#region src/testnets/schemas.ts
|
|
5
|
+
/**
|
|
6
|
+
* Go marshals a nil slice as `null`; this reads it as an empty array.
|
|
7
|
+
**/
|
|
8
|
+
function nullableArray(item) {
|
|
9
|
+
return z.array(item).nullable().transform((value) => value ?? []);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Go marshals a nil map as `null`; this reads it as an empty record.
|
|
13
|
+
**/
|
|
14
|
+
function nullableRecord(value) {
|
|
15
|
+
return z.record(z.string(), value).nullable().transform((record) => record ?? {});
|
|
16
|
+
}
|
|
17
|
+
const timestamp = z.iso.datetime({ offset: true });
|
|
18
|
+
/**
|
|
19
|
+
* {@link TestnetStageStatus}
|
|
20
|
+
**/
|
|
21
|
+
const testnetStageStatusSchema = z.enum([
|
|
22
|
+
"queued",
|
|
23
|
+
"started",
|
|
24
|
+
"error",
|
|
25
|
+
"failed",
|
|
26
|
+
"success",
|
|
27
|
+
"terminated"
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* {@link TestnetBackendState}
|
|
31
|
+
**/
|
|
32
|
+
const testnetBackendStateSchema = z.enum([
|
|
33
|
+
"provisioning",
|
|
34
|
+
"starting",
|
|
35
|
+
"active",
|
|
36
|
+
"error"
|
|
37
|
+
]);
|
|
38
|
+
/**
|
|
39
|
+
* {@link Testnet}
|
|
40
|
+
**/
|
|
41
|
+
const testnetSchema = z.object({
|
|
42
|
+
alias: z.string(),
|
|
43
|
+
executionId: z.string(),
|
|
44
|
+
isActive: z.boolean(),
|
|
45
|
+
description: z.string(),
|
|
46
|
+
persistent: z.boolean(),
|
|
47
|
+
paused: z.boolean(),
|
|
48
|
+
network: NetworkType,
|
|
49
|
+
createdAt: timestamp
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* {@link TestnetBackendOptions}
|
|
53
|
+
**/
|
|
54
|
+
const testnetBackendOptionsSchema = z.object({
|
|
55
|
+
version: z.string().optional(),
|
|
56
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
57
|
+
parentBranchId: z.string().optional()
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* {@link TestnetBackendStatus}
|
|
61
|
+
**/
|
|
62
|
+
const testnetBackendStatusSchema = z.object({
|
|
63
|
+
state: testnetBackendStateSchema,
|
|
64
|
+
error: z.string().optional(),
|
|
65
|
+
version: z.string().optional()
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* {@link TestnetBlock}
|
|
69
|
+
**/
|
|
70
|
+
const testnetBlockSchema = z.object({
|
|
71
|
+
number: z.number(),
|
|
72
|
+
time: timestamp
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* {@link TestnetScriptBlock}
|
|
76
|
+
**/
|
|
77
|
+
const testnetScriptBlockSchema = testnetBlockSchema.extend({
|
|
78
|
+
timeDrift: z.number(),
|
|
79
|
+
originDrift: z.string(),
|
|
80
|
+
automine: z.boolean(),
|
|
81
|
+
mineInterval: z.number()
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* {@link TestnetScriptOptions}
|
|
85
|
+
**/
|
|
86
|
+
const testnetScriptOptionsSchema = z.object({
|
|
87
|
+
id: z.string(),
|
|
88
|
+
description: z.string(),
|
|
89
|
+
npx: z.string().optional(),
|
|
90
|
+
docker: z.string().optional(),
|
|
91
|
+
args: nullableArray(z.string()),
|
|
92
|
+
env: nullableRecord(z.string()),
|
|
93
|
+
flags: nullableArray(z.string()),
|
|
94
|
+
timeout: z.string(),
|
|
95
|
+
packageManager: z.string().optional(),
|
|
96
|
+
input: z.unknown().optional()
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* {@link TestnetScript}
|
|
100
|
+
**/
|
|
101
|
+
const testnetScriptSchema = z.object({
|
|
102
|
+
script: testnetScriptOptionsSchema,
|
|
103
|
+
duration: z.string(),
|
|
104
|
+
blockBefore: testnetScriptBlockSchema.optional(),
|
|
105
|
+
blockAfter: testnetScriptBlockSchema.optional(),
|
|
106
|
+
status: testnetStageStatusSchema,
|
|
107
|
+
error: z.string().optional(),
|
|
108
|
+
exitCode: z.number(),
|
|
109
|
+
source: z.string().optional(),
|
|
110
|
+
revision: z.string().optional()
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* {@link TestnetTaskDefinition}
|
|
114
|
+
**/
|
|
115
|
+
const testnetTaskDefinitionSchema = z.object({
|
|
116
|
+
id: z.string().optional(),
|
|
117
|
+
family: z.string().optional(),
|
|
118
|
+
name: z.string().optional(),
|
|
119
|
+
description: z.string().optional(),
|
|
120
|
+
image: z.string(),
|
|
121
|
+
version: z.string().optional(),
|
|
122
|
+
entrypoint: z.array(z.string()).optional(),
|
|
123
|
+
command: z.array(z.string()).optional(),
|
|
124
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
125
|
+
secrets: z.record(z.string(), z.string()).optional(),
|
|
126
|
+
input: z.unknown().optional(),
|
|
127
|
+
timeout: z.number().optional(),
|
|
128
|
+
concurrent: z.boolean(),
|
|
129
|
+
multicontainer: z.boolean(),
|
|
130
|
+
schemaVersion: z.number().optional()
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* {@link TestnetTaskProgress}
|
|
134
|
+
**/
|
|
135
|
+
const testnetTaskProgressSchema = z.object({
|
|
136
|
+
completed: z.number(),
|
|
137
|
+
total: z.number(),
|
|
138
|
+
details: z.unknown().optional()
|
|
139
|
+
});
|
|
140
|
+
/**
|
|
141
|
+
* {@link TestnetTask}
|
|
142
|
+
**/
|
|
143
|
+
const testnetTaskSchema = z.object({
|
|
144
|
+
id: z.string(),
|
|
145
|
+
definitionId: z.string(),
|
|
146
|
+
family: z.string(),
|
|
147
|
+
executionId: z.string(),
|
|
148
|
+
name: z.string().optional(),
|
|
149
|
+
description: z.string().optional(),
|
|
150
|
+
image: z.string(),
|
|
151
|
+
source: z.string().optional(),
|
|
152
|
+
revision: z.string().optional(),
|
|
153
|
+
entrypoint: z.array(z.string()).optional(),
|
|
154
|
+
command: z.array(z.string()).optional(),
|
|
155
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
156
|
+
secrets: z.record(z.string(), z.string()).optional(),
|
|
157
|
+
input: z.unknown().optional(),
|
|
158
|
+
multicontainer: z.boolean(),
|
|
159
|
+
concurrent: z.boolean(),
|
|
160
|
+
outputDir: z.string().optional(),
|
|
161
|
+
status: testnetStageStatusSchema,
|
|
162
|
+
error: z.string().optional(),
|
|
163
|
+
createdAt: timestamp,
|
|
164
|
+
updatedAt: timestamp,
|
|
165
|
+
progress: testnetTaskProgressSchema
|
|
166
|
+
});
|
|
167
|
+
/**
|
|
168
|
+
* {@link TestnetOptions}
|
|
169
|
+
**/
|
|
170
|
+
const testnetOptionsSchema = z.object({
|
|
171
|
+
description: z.string().optional(),
|
|
172
|
+
chainId: z.number().optional(),
|
|
173
|
+
network: NetworkType,
|
|
174
|
+
cid: z.string().optional(),
|
|
175
|
+
anvilFlags: z.array(z.string()).optional(),
|
|
176
|
+
anvilImage: z.string().optional(),
|
|
177
|
+
rpcProvider: z.string().optional(),
|
|
178
|
+
addressProvider: ZodAddress().optional(),
|
|
179
|
+
marketConfigurators: z.array(ZodAddress()).optional(),
|
|
180
|
+
rwaFactories: z.array(ZodAddress()).optional(),
|
|
181
|
+
blockNumber: z.string(),
|
|
182
|
+
owner: z.string(),
|
|
183
|
+
timeout: z.string(),
|
|
184
|
+
synctronLogLevel: z.string().optional(),
|
|
185
|
+
scripts: nullableArray(testnetScriptOptionsSchema),
|
|
186
|
+
disableSync: z.boolean(),
|
|
187
|
+
disableIntervalMining: z.boolean(),
|
|
188
|
+
disableRPCProtection: z.boolean(),
|
|
189
|
+
debug: z.boolean().optional(),
|
|
190
|
+
webhooks: nullableArray(z.string()),
|
|
191
|
+
backend: testnetBackendOptionsSchema.optional(),
|
|
192
|
+
tasks: z.array(testnetTaskDefinitionSchema).optional()
|
|
193
|
+
});
|
|
194
|
+
/**
|
|
195
|
+
* {@link TestnetStatus}
|
|
196
|
+
**/
|
|
197
|
+
const testnetStatusSchema = z.object({
|
|
198
|
+
alias: z.string().optional(),
|
|
199
|
+
network: NetworkType,
|
|
200
|
+
nextRestart: timestamp.optional(),
|
|
201
|
+
isActive: z.boolean(),
|
|
202
|
+
ready: z.boolean(),
|
|
203
|
+
paused: z.boolean(),
|
|
204
|
+
rpcUrl: z.string().optional(),
|
|
205
|
+
url: z.string(),
|
|
206
|
+
logsUrl: z.string(),
|
|
207
|
+
persistent: z.boolean(),
|
|
208
|
+
latestBlock: testnetScriptBlockSchema.optional(),
|
|
209
|
+
tasks: z.array(testnetTaskSchema).optional(),
|
|
210
|
+
backend: testnetBackendStatusSchema.optional(),
|
|
211
|
+
executionId: z.string(),
|
|
212
|
+
options: testnetOptionsSchema,
|
|
213
|
+
forkBlock: testnetBlockSchema,
|
|
214
|
+
syncBlock: z.number(),
|
|
215
|
+
syncError: z.string().optional(),
|
|
216
|
+
originChainId: z.number(),
|
|
217
|
+
anvilChainId: z.number(),
|
|
218
|
+
createdAt: timestamp,
|
|
219
|
+
addressProvider: ZodAddress(),
|
|
220
|
+
marketConfigurators: z.array(ZodAddress()).optional(),
|
|
221
|
+
rwaFactories: z.array(ZodAddress()).optional(),
|
|
222
|
+
onchainExecutionId: ZodAddress(),
|
|
223
|
+
scripts: z.array(testnetScriptSchema).optional(),
|
|
224
|
+
cid: z.string().optional(),
|
|
225
|
+
files: z.array(z.string()).optional()
|
|
226
|
+
});
|
|
227
|
+
//#endregion
|
|
228
|
+
export { testnetBackendOptionsSchema, testnetBackendStateSchema, testnetBackendStatusSchema, testnetBlockSchema, testnetOptionsSchema, testnetSchema, testnetScriptBlockSchema, testnetScriptOptionsSchema, testnetScriptSchema, testnetStageStatusSchema, testnetStatusSchema, testnetTaskDefinitionSchema, testnetTaskProgressSchema, testnetTaskSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//#region src/abi/310/iKillSwitchProxy.d.ts
|
|
2
|
+
export declare const iKillSwitchProxyAbi: readonly [{
|
|
3
|
+
readonly type: "constructor";
|
|
4
|
+
readonly inputs: readonly [{
|
|
5
|
+
readonly name: "_owner";
|
|
6
|
+
readonly internalType: "address";
|
|
7
|
+
readonly type: "address";
|
|
8
|
+
}, {
|
|
9
|
+
readonly name: "_caller";
|
|
10
|
+
readonly internalType: "address";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}];
|
|
13
|
+
readonly stateMutability: "nonpayable";
|
|
14
|
+
}, {
|
|
15
|
+
readonly type: "function";
|
|
16
|
+
readonly inputs: readonly [];
|
|
17
|
+
readonly name: "caller";
|
|
18
|
+
readonly outputs: readonly [{
|
|
19
|
+
readonly name: "";
|
|
20
|
+
readonly internalType: "address";
|
|
21
|
+
readonly type: "address";
|
|
22
|
+
}];
|
|
23
|
+
readonly stateMutability: "view";
|
|
24
|
+
}, {
|
|
25
|
+
readonly type: "function";
|
|
26
|
+
readonly inputs: readonly [];
|
|
27
|
+
readonly name: "contractType";
|
|
28
|
+
readonly outputs: readonly [{
|
|
29
|
+
readonly name: "";
|
|
30
|
+
readonly internalType: "bytes32";
|
|
31
|
+
readonly type: "bytes32";
|
|
32
|
+
}];
|
|
33
|
+
readonly stateMutability: "view";
|
|
34
|
+
}, {
|
|
35
|
+
readonly type: "function";
|
|
36
|
+
readonly inputs: readonly [];
|
|
37
|
+
readonly name: "isKilled";
|
|
38
|
+
readonly outputs: readonly [{
|
|
39
|
+
readonly name: "";
|
|
40
|
+
readonly internalType: "bool";
|
|
41
|
+
readonly type: "bool";
|
|
42
|
+
}];
|
|
43
|
+
readonly stateMutability: "view";
|
|
44
|
+
}, {
|
|
45
|
+
readonly type: "function";
|
|
46
|
+
readonly inputs: readonly [];
|
|
47
|
+
readonly name: "kill";
|
|
48
|
+
readonly outputs: readonly [];
|
|
49
|
+
readonly stateMutability: "nonpayable";
|
|
50
|
+
}, {
|
|
51
|
+
readonly type: "function";
|
|
52
|
+
readonly inputs: readonly [];
|
|
53
|
+
readonly name: "owner";
|
|
54
|
+
readonly outputs: readonly [{
|
|
55
|
+
readonly name: "";
|
|
56
|
+
readonly internalType: "address";
|
|
57
|
+
readonly type: "address";
|
|
58
|
+
}];
|
|
59
|
+
readonly stateMutability: "view";
|
|
60
|
+
}, {
|
|
61
|
+
readonly type: "function";
|
|
62
|
+
readonly inputs: readonly [{
|
|
63
|
+
readonly name: "target";
|
|
64
|
+
readonly internalType: "address";
|
|
65
|
+
readonly type: "address";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "data";
|
|
68
|
+
readonly internalType: "bytes";
|
|
69
|
+
readonly type: "bytes";
|
|
70
|
+
}];
|
|
71
|
+
readonly name: "proxyCall";
|
|
72
|
+
readonly outputs: readonly [{
|
|
73
|
+
readonly name: "result";
|
|
74
|
+
readonly internalType: "bytes";
|
|
75
|
+
readonly type: "bytes";
|
|
76
|
+
}];
|
|
77
|
+
readonly stateMutability: "nonpayable";
|
|
78
|
+
}, {
|
|
79
|
+
readonly type: "function";
|
|
80
|
+
readonly inputs: readonly [];
|
|
81
|
+
readonly name: "version";
|
|
82
|
+
readonly outputs: readonly [{
|
|
83
|
+
readonly name: "";
|
|
84
|
+
readonly internalType: "uint256";
|
|
85
|
+
readonly type: "uint256";
|
|
86
|
+
}];
|
|
87
|
+
readonly stateMutability: "view";
|
|
88
|
+
}, {
|
|
89
|
+
readonly type: "event";
|
|
90
|
+
readonly anonymous: false;
|
|
91
|
+
readonly inputs: readonly [];
|
|
92
|
+
readonly name: "Killed";
|
|
93
|
+
}, {
|
|
94
|
+
readonly type: "error";
|
|
95
|
+
readonly inputs: readonly [{
|
|
96
|
+
readonly name: "caller";
|
|
97
|
+
readonly internalType: "address";
|
|
98
|
+
readonly type: "address";
|
|
99
|
+
}];
|
|
100
|
+
readonly name: "CallerIsNotOwnerException";
|
|
101
|
+
}, {
|
|
102
|
+
readonly type: "error";
|
|
103
|
+
readonly inputs: readonly [];
|
|
104
|
+
readonly name: "KilledException";
|
|
105
|
+
}, {
|
|
106
|
+
readonly type: "error";
|
|
107
|
+
readonly inputs: readonly [];
|
|
108
|
+
readonly name: "OnlyCallerException";
|
|
109
|
+
}, {
|
|
110
|
+
readonly type: "error";
|
|
111
|
+
readonly inputs: readonly [];
|
|
112
|
+
readonly name: "OwnerSameAsCallerException";
|
|
113
|
+
}];
|
|
114
|
+
//#endregion
|