@gearbox-protocol/sdk 18.2.0-next.4 → 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.
- package/dist/cjs/permissionless/api/oracles/PermissionlessOracles.js +3 -3
- package/dist/cjs/permissionless/api/oracles/schemas.js +44 -35
- package/dist/cjs/permissionless/api/schemas.js +0 -3
- 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/permissionless/api/oracles/PermissionlessOracles.js +3 -3
- package/dist/esm/permissionless/api/oracles/schemas.js +44 -35
- package/dist/esm/permissionless/api/schemas.js +2 -4
- 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/permissionless/api/index.d.ts +2 -2
- package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +2 -4
- package/dist/types/permissionless/api/oracles/index.d.ts +2 -2
- package/dist/types/permissionless/api/oracles/schemas.d.ts +39 -24
- package/dist/types/permissionless/api/oracles/types.d.ts +47 -54
- package/dist/types/permissionless/api/schemas.d.ts +0 -2
- package/dist/types/permissionless/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,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 {};
|
|
@@ -5,7 +5,7 @@ import { AttachChainsArgs, ChainScope, ChainSummaryArgs, PermissionlessChain, Pe
|
|
|
5
5
|
import { ChainsNamespace } from "./chains/ChainsNamespace.js";
|
|
6
6
|
import { DeployArgs, DeployContractArgs, DeployPriceFeedArgs, PreparedDeployment, PreparedPriceFeedDeployment } from "./deploy/types.js";
|
|
7
7
|
import { DEFAULT_DEPLOY_SALT, PermissionlessDeploy, priceFeedSalt } from "./deploy/PermissionlessDeploy.js";
|
|
8
|
-
import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./oracles/types.js";
|
|
8
|
+
import { AssetArgs, AssetsArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessMarket, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./oracles/types.js";
|
|
9
9
|
import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./oracles/PermissionlessOracles.js";
|
|
10
10
|
import { AddFeedsArgs, ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceTxsArgs, PriceFeedPair } from "./transactions/types.js";
|
|
11
11
|
import { InstanceOwnerTransactions } from "./transactions/InstanceOwnerTransactions.js";
|
|
@@ -17,4 +17,4 @@ import "./deploy/index.js";
|
|
|
17
17
|
import { PermissionlessChainUnreachableError, PermissionlessNotAttachedError, PriceFeedNotInStoreError, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError } from "./errors.js";
|
|
18
18
|
import "./oracles/index.js";
|
|
19
19
|
import "./transactions/index.js";
|
|
20
|
-
export { AddFeedsArgs, AssetArgs, AttachChainsArgs, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployPriceFeedArgs, ForbidFeedsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, InstanceOwnerTransactions, InstanceTxsArgs, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeedArgs, PriceFeedChartPoint, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedPriceChart, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError, deriveEffectiveStalenessPeriod, priceFeedSalt };
|
|
20
|
+
export { AddFeedsArgs, AssetArgs, AssetsArgs, AttachChainsArgs, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployPriceFeedArgs, ForbidFeedsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, InstanceOwnerTransactions, InstanceTxsArgs, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessMarket, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeedArgs, PriceFeedChartPoint, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedPriceChart, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError, deriveEffectiveStalenessPeriod, priceFeedSalt };
|
|
@@ -2,7 +2,7 @@ import { PriceFeedData } from "../../../model/opportunities.js";
|
|
|
2
2
|
import { AbstractOffchainNamespace } from "../../../offchain/AbstractOffchainNamespace.js";
|
|
3
3
|
import { GearboxPermissionlessOptions } from "../types.js";
|
|
4
4
|
import { ChainsNamespace } from "../chains/ChainsNamespace.js";
|
|
5
|
-
import { AssetArgs, GetPricesArgs, PermissionlessAssetDetails, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
|
|
5
|
+
import { AssetArgs, AssetsArgs, GetPricesArgs, PermissionlessAssetDetails, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
|
|
6
6
|
import { Address } from "viem";
|
|
7
7
|
//#region src/permissionless/api/oracles/PermissionlessOracles.d.ts
|
|
8
8
|
export declare const GET_PRICES_GAS_LIMIT_BY_CHAIN_ID: Record<number, bigint>;
|
|
@@ -102,9 +102,7 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
|
|
|
102
102
|
* const everywhere = await permissionless.oracles.assets();
|
|
103
103
|
* ```
|
|
104
104
|
**/
|
|
105
|
-
assets(
|
|
106
|
-
chainId?: number;
|
|
107
|
-
}): Promise<PermissionlessAssetSummary[]>;
|
|
105
|
+
assets({ chainId }?: AssetsArgs): Promise<PermissionlessAssetSummary[]>;
|
|
108
106
|
/**
|
|
109
107
|
* The feeds one feed reads from, recursively.
|
|
110
108
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
|
|
1
|
+
import { AssetArgs, AssetsArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessMarket, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
|
|
2
2
|
import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./PermissionlessOracles.js";
|
|
3
|
-
export { AssetArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs };
|
|
3
|
+
export { AssetArgs, AssetsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessMarket, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs };
|
|
@@ -17,7 +17,18 @@ export declare const priceFeedSchema: z.ZodObject<{
|
|
|
17
17
|
stalenessPeriod: z.ZodNumber;
|
|
18
18
|
name: z.ZodString;
|
|
19
19
|
}, z.core.$loose>;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* {@link PermissionlessPriceFeedAsset}
|
|
22
|
+
*
|
|
23
|
+
* What identifies an asset, which is all a feed's own listing of one says.
|
|
24
|
+
**/
|
|
25
|
+
export declare const priceFeedAssetSchema: z.ZodObject<{
|
|
26
|
+
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
27
|
+
symbol: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
decimals: z.ZodNumber;
|
|
30
|
+
}, z.core.$loose>;
|
|
31
|
+
/** {@link PermissionlessAsset} — identified as above, plus what prices it. */
|
|
21
32
|
export declare const assetSchema: z.ZodObject<{
|
|
22
33
|
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
23
34
|
symbol: z.ZodString;
|
|
@@ -33,7 +44,12 @@ export declare const assetSchema: z.ZodObject<{
|
|
|
33
44
|
name: z.ZodString;
|
|
34
45
|
}, z.core.$loose>>;
|
|
35
46
|
}, z.core.$loose>;
|
|
36
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* {@link PermissionlessPriceFeedStore}
|
|
49
|
+
*
|
|
50
|
+
* A store is a chain's, and is described by the same five fields the chain
|
|
51
|
+
* list answers with, so those are extended rather than restated.
|
|
52
|
+
**/
|
|
37
53
|
export declare const priceFeedStoreSchema: z.ZodObject<{
|
|
38
54
|
chainId: z.ZodNumber;
|
|
39
55
|
name: z.ZodString;
|
|
@@ -70,26 +86,19 @@ export declare const pricesSchema: z.ZodObject<{
|
|
|
70
86
|
marketCaps: z.ZodType<Record<`0x${string}`, Record<`0x${string}`, string | null>>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, Record<`0x${string}`, string | null>>, unknown>>;
|
|
71
87
|
time: z.ZodNumber;
|
|
72
88
|
}, z.core.$loose>;
|
|
73
|
-
/** {@link
|
|
74
|
-
export declare const priceFeedAssetSchema: z.ZodObject<{
|
|
75
|
-
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
76
|
-
symbol: z.ZodString;
|
|
77
|
-
name: z.ZodString;
|
|
78
|
-
decimals: z.ZodNumber;
|
|
79
|
-
}, z.core.$loose>;
|
|
80
|
-
/** {@link PermissionlessPriceFeedMarket} */
|
|
89
|
+
/** {@link PermissionlessPriceFeedMarket} — the market as the feed's slot in it. */
|
|
81
90
|
export declare const priceFeedMarketSchema: z.ZodObject<{
|
|
82
91
|
market: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
83
92
|
marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
84
93
|
curatorName: z.ZodNullable<z.ZodString>;
|
|
85
94
|
marketName: z.ZodNullable<z.ZodString>;
|
|
86
|
-
token: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
87
|
-
tokenSymbol: z.ZodNullable<z.ZodString>;
|
|
88
95
|
underlyingSymbol: z.ZodNullable<z.ZodString>;
|
|
89
|
-
reserve: z.ZodBoolean;
|
|
90
96
|
isUnderlying: z.ZodBoolean;
|
|
91
97
|
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
92
98
|
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
99
|
+
token: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
100
|
+
tokenSymbol: z.ZodNullable<z.ZodString>;
|
|
101
|
+
reserve: z.ZodBoolean;
|
|
93
102
|
marketStalenessPeriod: z.ZodNullable<z.ZodNumber>;
|
|
94
103
|
}, z.core.$loose>;
|
|
95
104
|
/** {@link PermissionlessPriceFeedDetails} */
|
|
@@ -114,13 +123,13 @@ export declare const priceFeedDetailsSchema: z.ZodObject<{
|
|
|
114
123
|
marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
115
124
|
curatorName: z.ZodNullable<z.ZodString>;
|
|
116
125
|
marketName: z.ZodNullable<z.ZodString>;
|
|
117
|
-
token: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
118
|
-
tokenSymbol: z.ZodNullable<z.ZodString>;
|
|
119
126
|
underlyingSymbol: z.ZodNullable<z.ZodString>;
|
|
120
|
-
reserve: z.ZodBoolean;
|
|
121
127
|
isUnderlying: z.ZodBoolean;
|
|
122
128
|
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
123
129
|
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
130
|
+
token: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
131
|
+
tokenSymbol: z.ZodNullable<z.ZodString>;
|
|
132
|
+
reserve: z.ZodBoolean;
|
|
124
133
|
marketStalenessPeriod: z.ZodNullable<z.ZodNumber>;
|
|
125
134
|
}, z.core.$loose>>;
|
|
126
135
|
}, z.core.$loose>;
|
|
@@ -135,15 +144,17 @@ export declare const assetMarketFeedSchema: z.ZodObject<{
|
|
|
135
144
|
name: z.ZodNullable<z.ZodString>;
|
|
136
145
|
inStore: z.ZodBoolean;
|
|
137
146
|
}, z.core.$loose>;
|
|
138
|
-
/** {@link PermissionlessAssetMarket} */
|
|
147
|
+
/** {@link PermissionlessAssetMarket} — the market as what prices the asset in it. */
|
|
139
148
|
export declare const assetMarketSchema: z.ZodObject<{
|
|
140
149
|
market: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
141
150
|
marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
142
151
|
curatorName: z.ZodNullable<z.ZodString>;
|
|
143
152
|
marketName: z.ZodNullable<z.ZodString>;
|
|
144
|
-
underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
145
153
|
underlyingSymbol: z.ZodNullable<z.ZodString>;
|
|
146
154
|
isUnderlying: z.ZodBoolean;
|
|
155
|
+
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
156
|
+
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
157
|
+
underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
147
158
|
isShutdown: z.ZodBoolean;
|
|
148
159
|
mainFeed: z.ZodNullable<z.ZodObject<{
|
|
149
160
|
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
@@ -155,8 +166,6 @@ export declare const assetMarketSchema: z.ZodObject<{
|
|
|
155
166
|
name: z.ZodNullable<z.ZodString>;
|
|
156
167
|
inStore: z.ZodBoolean;
|
|
157
168
|
}, z.core.$loose>>;
|
|
158
|
-
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
159
|
-
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
160
169
|
}, z.core.$loose>;
|
|
161
170
|
/** {@link PermissionlessAssetDetails} */
|
|
162
171
|
export declare const assetDetailsSchema: z.ZodObject<{
|
|
@@ -180,9 +189,11 @@ export declare const assetDetailsSchema: z.ZodObject<{
|
|
|
180
189
|
marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
181
190
|
curatorName: z.ZodNullable<z.ZodString>;
|
|
182
191
|
marketName: z.ZodNullable<z.ZodString>;
|
|
183
|
-
underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
184
192
|
underlyingSymbol: z.ZodNullable<z.ZodString>;
|
|
185
193
|
isUnderlying: z.ZodBoolean;
|
|
194
|
+
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
195
|
+
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
196
|
+
underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
186
197
|
isShutdown: z.ZodBoolean;
|
|
187
198
|
mainFeed: z.ZodNullable<z.ZodObject<{
|
|
188
199
|
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
@@ -194,13 +205,17 @@ export declare const assetDetailsSchema: z.ZodObject<{
|
|
|
194
205
|
name: z.ZodNullable<z.ZodString>;
|
|
195
206
|
inStore: z.ZodBoolean;
|
|
196
207
|
}, z.core.$loose>>;
|
|
197
|
-
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
198
|
-
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
199
208
|
}, z.core.$loose>>;
|
|
200
209
|
quotaLimitUsd: z.ZodNullable<z.ZodNumber>;
|
|
201
210
|
quotaUsedUsd: z.ZodNullable<z.ZodNumber>;
|
|
202
211
|
}, z.core.$loose>;
|
|
203
|
-
/**
|
|
212
|
+
/**
|
|
213
|
+
* {@link PermissionlessAssetPrices}
|
|
214
|
+
*
|
|
215
|
+
* The same shape as {@link priceFeedMarketCapsSchema} plus the prices, but not
|
|
216
|
+
* an extension of it: the caps there are keyed by asset and these are keyed by
|
|
217
|
+
* feed, so what the two have in common is a coincidence of form.
|
|
218
|
+
**/
|
|
204
219
|
export declare const assetPricesSchema: z.ZodObject<{
|
|
205
220
|
prices: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
|
|
206
221
|
marketCaps: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
|