@gearbox-protocol/sdk 18.5.0-next.3 → 18.5.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/onchain/abi/index.js +0 -2
- package/dist/cjs/onchain/abi/oracles.js +0 -617
- package/dist/cjs/onchain/index.js +0 -4
- package/dist/cjs/onchain/market/index.js +0 -4
- package/dist/cjs/onchain/market/pricefeeds/PriceFeedRegistry.js +0 -4
- package/dist/cjs/onchain/market/pricefeeds/feeds/index.js +0 -4
- package/dist/cjs/onchain/market/pricefeeds/index.js +0 -4
- package/dist/cjs/permissionless/bindings/price-feed-store.js +0 -1
- package/dist/cjs/permissionless/bindings/pricefeeds/index.js +3 -7
- package/dist/cjs/sdk/execute/ExecuteApi.js +41 -0
- package/dist/cjs/testnets/TestnetsAPI.js +178 -0
- package/dist/cjs/testnets/errors/TestnetNotFoundError.js +14 -0
- package/dist/cjs/testnets/errors/TestnetRequestFailedError.js +23 -0
- package/dist/cjs/testnets/errors/TestnetStatusError.js +18 -0
- package/dist/cjs/testnets/errors/TestnetValidationError.js +23 -0
- package/dist/cjs/testnets/errors/TestnetWaitTimeoutError.js +29 -0
- package/dist/cjs/testnets/errors/TestnetsError.js +33 -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 +241 -0
- package/dist/cjs/testnets/types.js +1 -0
- package/dist/esm/onchain/abi/index.js +1 -1
- package/dist/esm/onchain/abi/oracles.js +1 -616
- package/dist/esm/onchain/index.js +1 -3
- package/dist/esm/onchain/market/index.js +1 -3
- package/dist/esm/onchain/market/pricefeeds/PriceFeedRegistry.js +0 -4
- package/dist/esm/onchain/market/pricefeeds/feeds/index.js +1 -3
- package/dist/esm/onchain/market/pricefeeds/index.js +1 -3
- package/dist/esm/permissionless/bindings/price-feed-store.js +0 -1
- package/dist/esm/permissionless/bindings/pricefeeds/index.js +3 -7
- package/dist/esm/sdk/execute/ExecuteApi.js +41 -0
- package/dist/esm/testnets/TestnetsAPI.js +177 -0
- package/dist/esm/testnets/errors/TestnetNotFoundError.js +13 -0
- package/dist/esm/testnets/errors/TestnetRequestFailedError.js +22 -0
- package/dist/esm/testnets/errors/TestnetStatusError.js +17 -0
- package/dist/esm/testnets/errors/TestnetValidationError.js +22 -0
- package/dist/esm/testnets/errors/TestnetWaitTimeoutError.js +28 -0
- package/dist/esm/testnets/errors/TestnetsError.js +32 -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 +227 -0
- package/dist/esm/testnets/types.js +1 -0
- package/dist/types/onchain/abi/index.d.ts +2 -2
- package/dist/types/onchain/abi/oracles.d.ts +0 -536
- package/dist/types/onchain/index.d.ts +1 -3
- package/dist/types/onchain/market/index.d.ts +1 -3
- package/dist/types/onchain/market/pricefeeds/feeds/index.d.ts +1 -3
- package/dist/types/onchain/market/pricefeeds/index.d.ts +1 -3
- package/dist/types/onchain/market/pricefeeds/types.d.ts +1 -1
- package/dist/types/permissionless/core/pricefeed-builder.d.ts +0 -2
- package/dist/types/sdk/execute/ExecuteApi.d.ts +8 -0
- package/dist/types/sdk/execute/types.d.ts +14 -0
- package/dist/types/testnets/TestnetsAPI.d.ts +106 -0
- package/dist/types/testnets/errors/TestnetNotFoundError.d.ts +10 -0
- package/dist/types/testnets/errors/TestnetRequestFailedError.d.ts +9 -0
- package/dist/types/testnets/errors/TestnetStatusError.d.ts +13 -0
- package/dist/types/testnets/errors/TestnetValidationError.d.ts +14 -0
- package/dist/types/testnets/errors/TestnetWaitTimeoutError.d.ts +19 -0
- package/dist/types/testnets/errors/TestnetsError.d.ts +45 -0
- package/dist/types/testnets/errors/index.d.ts +7 -0
- package/dist/types/testnets/index.d.ts +17 -0
- package/dist/types/testnets/schemas.d.ts +552 -0
- package/dist/types/testnets/types.d.ts +715 -0
- package/package.json +6 -1
- package/dist/cjs/onchain/market/pricefeeds/feeds/FixedRateWindowPriceFeed.js +0 -15
- package/dist/cjs/onchain/market/pricefeeds/feeds/MedianPriceFeed.js +0 -15
- package/dist/cjs/permissionless/bindings/pricefeeds/fix-rate-window.js +0 -53
- package/dist/cjs/permissionless/bindings/pricefeeds/median.js +0 -22
- package/dist/esm/onchain/market/pricefeeds/feeds/FixedRateWindowPriceFeed.js +0 -14
- package/dist/esm/onchain/market/pricefeeds/feeds/MedianPriceFeed.js +0 -14
- package/dist/esm/permissionless/bindings/pricefeeds/fix-rate-window.js +0 -52
- package/dist/esm/permissionless/bindings/pricefeeds/median.js +0 -21
- package/dist/types/onchain/market/pricefeeds/feeds/FixedRateWindowPriceFeed.d.ts +0 -9
- package/dist/types/onchain/market/pricefeeds/feeds/MedianPriceFeed.d.ts +0 -9
- package/dist/types/permissionless/bindings/pricefeeds/fix-rate-window.d.ts +0 -3
- package/dist/types/permissionless/bindings/pricefeeds/median.d.ts +0 -3
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_onchain_chain_chains = require("../onchain/chain/chains.js");
|
|
3
|
+
const require_onchain_utils_zod = require("../onchain/utils/zod.js");
|
|
4
|
+
let zod_v4 = require("zod/v4");
|
|
5
|
+
// src/testnets/schemas.ts
|
|
6
|
+
/**
|
|
7
|
+
* Go marshals a nil slice as `null`; this reads it as an empty array.
|
|
8
|
+
**/
|
|
9
|
+
function nullableArray(item) {
|
|
10
|
+
return zod_v4.z.array(item).nullable().transform((value) => value ?? []);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Go marshals a nil map as `null`; this reads it as an empty record.
|
|
14
|
+
**/
|
|
15
|
+
function nullableRecord(value) {
|
|
16
|
+
return zod_v4.z.record(zod_v4.z.string(), value).nullable().transform((record) => record ?? {});
|
|
17
|
+
}
|
|
18
|
+
const timestamp = zod_v4.z.iso.datetime({ offset: true });
|
|
19
|
+
/**
|
|
20
|
+
* {@link TestnetStageStatus}
|
|
21
|
+
**/
|
|
22
|
+
const testnetStageStatusSchema = zod_v4.z.enum([
|
|
23
|
+
"queued",
|
|
24
|
+
"started",
|
|
25
|
+
"error",
|
|
26
|
+
"failed",
|
|
27
|
+
"success",
|
|
28
|
+
"terminated"
|
|
29
|
+
]);
|
|
30
|
+
/**
|
|
31
|
+
* {@link TestnetBackendState}
|
|
32
|
+
**/
|
|
33
|
+
const testnetBackendStateSchema = zod_v4.z.enum([
|
|
34
|
+
"provisioning",
|
|
35
|
+
"starting",
|
|
36
|
+
"active",
|
|
37
|
+
"error"
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* {@link Testnet}
|
|
41
|
+
**/
|
|
42
|
+
const testnetSchema = zod_v4.z.object({
|
|
43
|
+
alias: zod_v4.z.string(),
|
|
44
|
+
executionId: zod_v4.z.string(),
|
|
45
|
+
isActive: zod_v4.z.boolean(),
|
|
46
|
+
description: zod_v4.z.string(),
|
|
47
|
+
persistent: zod_v4.z.boolean(),
|
|
48
|
+
paused: zod_v4.z.boolean(),
|
|
49
|
+
network: require_onchain_chain_chains.NetworkType,
|
|
50
|
+
createdAt: timestamp
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* {@link TestnetBackendOptions}
|
|
54
|
+
**/
|
|
55
|
+
const testnetBackendOptionsSchema = zod_v4.z.object({
|
|
56
|
+
version: zod_v4.z.string().optional(),
|
|
57
|
+
env: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.string()).optional(),
|
|
58
|
+
parentBranchId: zod_v4.z.string().optional()
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* {@link TestnetBackendStatus}
|
|
62
|
+
**/
|
|
63
|
+
const testnetBackendStatusSchema = zod_v4.z.object({
|
|
64
|
+
state: testnetBackendStateSchema,
|
|
65
|
+
error: zod_v4.z.string().optional(),
|
|
66
|
+
version: zod_v4.z.string().optional()
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* {@link TestnetBlock}
|
|
70
|
+
**/
|
|
71
|
+
const testnetBlockSchema = zod_v4.z.object({
|
|
72
|
+
number: zod_v4.z.number(),
|
|
73
|
+
time: timestamp
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* {@link TestnetScriptBlock}
|
|
77
|
+
**/
|
|
78
|
+
const testnetScriptBlockSchema = testnetBlockSchema.extend({
|
|
79
|
+
timeDrift: zod_v4.z.number(),
|
|
80
|
+
originDrift: zod_v4.z.string(),
|
|
81
|
+
automine: zod_v4.z.boolean(),
|
|
82
|
+
mineInterval: zod_v4.z.number()
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* {@link TestnetScriptOptions}
|
|
86
|
+
**/
|
|
87
|
+
const testnetScriptOptionsSchema = zod_v4.z.object({
|
|
88
|
+
id: zod_v4.z.string(),
|
|
89
|
+
description: zod_v4.z.string(),
|
|
90
|
+
npx: zod_v4.z.string().optional(),
|
|
91
|
+
docker: zod_v4.z.string().optional(),
|
|
92
|
+
args: nullableArray(zod_v4.z.string()),
|
|
93
|
+
env: nullableRecord(zod_v4.z.string()),
|
|
94
|
+
flags: nullableArray(zod_v4.z.string()),
|
|
95
|
+
timeout: zod_v4.z.string(),
|
|
96
|
+
packageManager: zod_v4.z.string().optional(),
|
|
97
|
+
input: zod_v4.z.unknown().optional()
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* {@link TestnetScript}
|
|
101
|
+
**/
|
|
102
|
+
const testnetScriptSchema = zod_v4.z.object({
|
|
103
|
+
script: testnetScriptOptionsSchema,
|
|
104
|
+
duration: zod_v4.z.string(),
|
|
105
|
+
blockBefore: testnetScriptBlockSchema.optional(),
|
|
106
|
+
blockAfter: testnetScriptBlockSchema.optional(),
|
|
107
|
+
status: testnetStageStatusSchema,
|
|
108
|
+
error: zod_v4.z.string().optional(),
|
|
109
|
+
exitCode: zod_v4.z.number(),
|
|
110
|
+
source: zod_v4.z.string().optional(),
|
|
111
|
+
revision: zod_v4.z.string().optional()
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* {@link TestnetTaskDefinition}
|
|
115
|
+
**/
|
|
116
|
+
const testnetTaskDefinitionSchema = zod_v4.z.object({
|
|
117
|
+
id: zod_v4.z.string().optional(),
|
|
118
|
+
family: zod_v4.z.string().optional(),
|
|
119
|
+
name: zod_v4.z.string().optional(),
|
|
120
|
+
description: zod_v4.z.string().optional(),
|
|
121
|
+
image: zod_v4.z.string(),
|
|
122
|
+
version: zod_v4.z.string().optional(),
|
|
123
|
+
entrypoint: zod_v4.z.array(zod_v4.z.string()).optional(),
|
|
124
|
+
command: zod_v4.z.array(zod_v4.z.string()).optional(),
|
|
125
|
+
env: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.string()).optional(),
|
|
126
|
+
secrets: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.string()).optional(),
|
|
127
|
+
input: zod_v4.z.unknown().optional(),
|
|
128
|
+
timeout: zod_v4.z.number().optional(),
|
|
129
|
+
concurrent: zod_v4.z.boolean(),
|
|
130
|
+
multicontainer: zod_v4.z.boolean(),
|
|
131
|
+
schemaVersion: zod_v4.z.number().optional()
|
|
132
|
+
});
|
|
133
|
+
/**
|
|
134
|
+
* {@link TestnetTaskProgress}
|
|
135
|
+
**/
|
|
136
|
+
const testnetTaskProgressSchema = zod_v4.z.object({
|
|
137
|
+
completed: zod_v4.z.number(),
|
|
138
|
+
total: zod_v4.z.number(),
|
|
139
|
+
details: zod_v4.z.unknown().optional()
|
|
140
|
+
});
|
|
141
|
+
/**
|
|
142
|
+
* {@link TestnetTask}
|
|
143
|
+
**/
|
|
144
|
+
const testnetTaskSchema = zod_v4.z.object({
|
|
145
|
+
id: zod_v4.z.string(),
|
|
146
|
+
definitionId: zod_v4.z.string(),
|
|
147
|
+
family: zod_v4.z.string(),
|
|
148
|
+
executionId: zod_v4.z.string(),
|
|
149
|
+
name: zod_v4.z.string().optional(),
|
|
150
|
+
description: zod_v4.z.string().optional(),
|
|
151
|
+
image: zod_v4.z.string(),
|
|
152
|
+
source: zod_v4.z.string().optional(),
|
|
153
|
+
revision: zod_v4.z.string().optional(),
|
|
154
|
+
entrypoint: zod_v4.z.array(zod_v4.z.string()).optional(),
|
|
155
|
+
command: zod_v4.z.array(zod_v4.z.string()).optional(),
|
|
156
|
+
env: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.string()).optional(),
|
|
157
|
+
secrets: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.string()).optional(),
|
|
158
|
+
input: zod_v4.z.unknown().optional(),
|
|
159
|
+
multicontainer: zod_v4.z.boolean(),
|
|
160
|
+
concurrent: zod_v4.z.boolean(),
|
|
161
|
+
outputDir: zod_v4.z.string().optional(),
|
|
162
|
+
status: testnetStageStatusSchema,
|
|
163
|
+
error: zod_v4.z.string().optional(),
|
|
164
|
+
createdAt: timestamp,
|
|
165
|
+
updatedAt: timestamp,
|
|
166
|
+
progress: testnetTaskProgressSchema
|
|
167
|
+
});
|
|
168
|
+
/**
|
|
169
|
+
* {@link TestnetOptions}
|
|
170
|
+
**/
|
|
171
|
+
const testnetOptionsSchema = zod_v4.z.object({
|
|
172
|
+
description: zod_v4.z.string().optional(),
|
|
173
|
+
chainId: zod_v4.z.number().optional(),
|
|
174
|
+
network: require_onchain_chain_chains.NetworkType,
|
|
175
|
+
cid: zod_v4.z.string().optional(),
|
|
176
|
+
anvilFlags: zod_v4.z.array(zod_v4.z.string()).optional(),
|
|
177
|
+
anvilImage: zod_v4.z.string().optional(),
|
|
178
|
+
rpcProvider: zod_v4.z.string().optional(),
|
|
179
|
+
addressProvider: require_onchain_utils_zod.ZodAddress().optional(),
|
|
180
|
+
marketConfigurators: zod_v4.z.array(require_onchain_utils_zod.ZodAddress()).optional(),
|
|
181
|
+
rwaFactories: zod_v4.z.array(require_onchain_utils_zod.ZodAddress()).optional(),
|
|
182
|
+
blockNumber: zod_v4.z.string(),
|
|
183
|
+
owner: zod_v4.z.string(),
|
|
184
|
+
timeout: zod_v4.z.string(),
|
|
185
|
+
synctronLogLevel: zod_v4.z.string().optional(),
|
|
186
|
+
scripts: nullableArray(testnetScriptOptionsSchema),
|
|
187
|
+
disableSync: zod_v4.z.boolean(),
|
|
188
|
+
disableIntervalMining: zod_v4.z.boolean(),
|
|
189
|
+
disableRPCProtection: zod_v4.z.boolean(),
|
|
190
|
+
debug: zod_v4.z.boolean().optional(),
|
|
191
|
+
webhooks: nullableArray(zod_v4.z.string()),
|
|
192
|
+
backend: testnetBackendOptionsSchema.optional(),
|
|
193
|
+
tasks: zod_v4.z.array(testnetTaskDefinitionSchema).optional()
|
|
194
|
+
});
|
|
195
|
+
/**
|
|
196
|
+
* {@link TestnetStatus}
|
|
197
|
+
**/
|
|
198
|
+
const testnetStatusSchema = zod_v4.z.object({
|
|
199
|
+
alias: zod_v4.z.string().optional(),
|
|
200
|
+
network: require_onchain_chain_chains.NetworkType,
|
|
201
|
+
nextRestart: timestamp.optional(),
|
|
202
|
+
isActive: zod_v4.z.boolean(),
|
|
203
|
+
ready: zod_v4.z.boolean(),
|
|
204
|
+
paused: zod_v4.z.boolean(),
|
|
205
|
+
rpcUrl: zod_v4.z.string().optional(),
|
|
206
|
+
url: zod_v4.z.string(),
|
|
207
|
+
logsUrl: zod_v4.z.string(),
|
|
208
|
+
persistent: zod_v4.z.boolean(),
|
|
209
|
+
latestBlock: testnetScriptBlockSchema.optional(),
|
|
210
|
+
tasks: zod_v4.z.array(testnetTaskSchema).optional(),
|
|
211
|
+
backend: testnetBackendStatusSchema.optional(),
|
|
212
|
+
executionId: zod_v4.z.string(),
|
|
213
|
+
options: testnetOptionsSchema,
|
|
214
|
+
forkBlock: testnetBlockSchema,
|
|
215
|
+
syncBlock: zod_v4.z.number(),
|
|
216
|
+
syncError: zod_v4.z.string().optional(),
|
|
217
|
+
originChainId: zod_v4.z.number(),
|
|
218
|
+
anvilChainId: zod_v4.z.number(),
|
|
219
|
+
createdAt: timestamp,
|
|
220
|
+
addressProvider: require_onchain_utils_zod.ZodAddress(),
|
|
221
|
+
marketConfigurators: zod_v4.z.array(require_onchain_utils_zod.ZodAddress()).optional(),
|
|
222
|
+
rwaFactories: zod_v4.z.array(require_onchain_utils_zod.ZodAddress()).optional(),
|
|
223
|
+
onchainExecutionId: require_onchain_utils_zod.ZodAddress(),
|
|
224
|
+
scripts: zod_v4.z.array(testnetScriptSchema).optional(),
|
|
225
|
+
cid: zod_v4.z.string().optional(),
|
|
226
|
+
files: zod_v4.z.array(zod_v4.z.string()).optional()
|
|
227
|
+
});
|
|
228
|
+
exports.testnetBackendOptionsSchema = testnetBackendOptionsSchema;
|
|
229
|
+
exports.testnetBackendStateSchema = testnetBackendStateSchema;
|
|
230
|
+
exports.testnetBackendStatusSchema = testnetBackendStatusSchema;
|
|
231
|
+
exports.testnetBlockSchema = testnetBlockSchema;
|
|
232
|
+
exports.testnetOptionsSchema = testnetOptionsSchema;
|
|
233
|
+
exports.testnetSchema = testnetSchema;
|
|
234
|
+
exports.testnetScriptBlockSchema = testnetScriptBlockSchema;
|
|
235
|
+
exports.testnetScriptOptionsSchema = testnetScriptOptionsSchema;
|
|
236
|
+
exports.testnetScriptSchema = testnetScriptSchema;
|
|
237
|
+
exports.testnetStageStatusSchema = testnetStageStatusSchema;
|
|
238
|
+
exports.testnetStatusSchema = testnetStatusSchema;
|
|
239
|
+
exports.testnetTaskDefinitionSchema = testnetTaskDefinitionSchema;
|
|
240
|
+
exports.testnetTaskProgressSchema = testnetTaskProgressSchema;
|
|
241
|
+
exports.testnetTaskSchema = testnetTaskSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { boundedPriceFeedAbi, bptStablePriceFeedAbi, bptWeightedPriceFeedAbi, chainlinkReadableAggregatorAbi, compositePriceFeedAbi, constantPriceFeedAbi, curveCryptoLpPriceFeedAbi, curveStableLpPriceFeedAbi, curveUsdPriceFeedAbi, erc4626PriceFeedAbi,
|
|
1
|
+
export { boundedPriceFeedAbi, bptStablePriceFeedAbi, bptWeightedPriceFeedAbi, chainlinkReadableAggregatorAbi, compositePriceFeedAbi, constantPriceFeedAbi, curveCryptoLpPriceFeedAbi, curveStableLpPriceFeedAbi, curveUsdPriceFeedAbi, erc4626PriceFeedAbi, iBalancerStablePoolAbi, iBalancerWeightedPoolAbi, iCurvePoolAbi, iMellowVaultAbi, iRedstonePriceFeedEventsAbi, ilpPriceFeedAbi, ilpPriceFeedEventsAbi, iwstEthAbi, iyVaultAbi, mellowLrtPriceFeedAbi, pendleTWAPPTPriceFeedAbi, pythPriceFeedAbi, redstonePriceFeedAbi, wstEthPriceFeedAbi, yearnPriceFeedAbi, zeroPriceFeedAbi } from "./oracles.js";
|