@gearbox-protocol/cli-utils 6.16.1 → 9.0.0-beta.11
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/index.d.ts +436 -19
- package/dist/index.js +1402 -19
- package/dist/index.js.map +1 -0
- package/package.json +27 -13
- package/dist/CensoredString.d.ts +0 -8
- package/dist/CensoredString.js +0 -31
- package/dist/CensoredURL.d.ts +0 -11
- package/dist/CensoredURL.js +0 -53
- package/dist/SSMManager.d.ts +0 -5
- package/dist/SSMManager.js +0 -30
- package/dist/SecretsManager.d.ts +0 -6
- package/dist/SecretsManager.js +0 -52
- package/dist/Whitelist.d.ts +0 -30
- package/dist/Whitelist.js +0 -84
- package/dist/Zommand.d.ts +0 -25
- package/dist/Zommand.js +0 -98
- package/dist/compressedConfig.d.ts +0 -10
- package/dist/compressedConfig.js +0 -22
- package/dist/createPinoCensor.d.ts +0 -5
- package/dist/createPinoCensor.js +0 -53
- package/dist/fetchRetry.d.ts +0 -7
- package/dist/fetchRetry.js +0 -26
- package/dist/getFirstHttpTransportOptions.d.ts +0 -7
- package/dist/getFirstHttpTransportOptions.js +0 -13
- package/dist/getPromisePath.d.ts +0 -7
- package/dist/getPromisePath.js +0 -18
- package/dist/getProviders.d.ts +0 -4
- package/dist/getProviders.js +0 -104
- package/dist/notifications/NotificationsService.d.ts +0 -19
- package/dist/notifications/NotificationsService.js +0 -76
- package/dist/notifications/SignlNotifier.d.ts +0 -13
- package/dist/notifications/SignlNotifier.js +0 -58
- package/dist/notifications/SlackNotifier.d.ts +0 -8
- package/dist/notifications/SlackNotifier.js +0 -38
- package/dist/notifications/TelegramNotifier.d.ts +0 -14
- package/dist/notifications/TelegramNotifier.js +0 -119
- package/dist/notifications/ThrottleManager.d.ts +0 -18
- package/dist/notifications/ThrottleManager.js +0 -40
- package/dist/notifications/createNotifier.d.ts +0 -4
- package/dist/notifications/createNotifier.js +0 -18
- package/dist/notifications/index.d.ts +0 -4
- package/dist/notifications/index.js +0 -4
- package/dist/notifications/schema.d.ts +0 -33
- package/dist/notifications/schema.js +0 -46
- package/dist/notifications/types.d.ts +0 -91
- package/dist/notifications/types.js +0 -1
- package/dist/providers-schema.d.ts +0 -49
- package/dist/providers-schema.js +0 -122
- package/dist/providers.d.ts +0 -6
- package/dist/providers.js +0 -103
- package/dist/resolveYamlFiles.d.ts +0 -40
- package/dist/resolveYamlFiles.js +0 -170
- package/dist/schema-primitives.d.ts +0 -10
- package/dist/schema-primitives.js +0 -30
- package/dist/sleep.d.ts +0 -1
- package/dist/sleep.js +0 -6
- package/dist/uncensorMap.d.ts +0 -4
- package/dist/uncensorMap.js +0 -3
- package/dist/whitelist-schema.d.ts +0 -54
- package/dist/whitelist-schema.js +0 -21
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,436 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { HttpTransportConfig, Address } from 'viem';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
import { ILogger, NetworkType } from '@gearbox-protocol/sdk';
|
|
4
|
+
import { ProviderConfig } from '@gearbox-protocol/sdk/dev';
|
|
5
|
+
import { Markdown } from '@vlad-yakovlev/telegram-md';
|
|
6
|
+
import YAML from 'yaml';
|
|
7
|
+
import { Command } from '@commander-js/extra-typings';
|
|
8
|
+
import * as z4 from 'zod/v4/core';
|
|
9
|
+
|
|
10
|
+
declare class CensoredString<V extends string = string> {
|
|
11
|
+
#private;
|
|
12
|
+
static transform<T extends string>(value: T | CensoredString<T>): CensoredString<T>;
|
|
13
|
+
constructor(value: V);
|
|
14
|
+
get value(): V;
|
|
15
|
+
toString(): string;
|
|
16
|
+
toJSON(): string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Assumes that host is always visible, and the secret part is in path or query
|
|
21
|
+
*/
|
|
22
|
+
declare class CensoredURL {
|
|
23
|
+
#private;
|
|
24
|
+
static transform(value: string | CensoredURL): CensoredURL;
|
|
25
|
+
constructor(url: string);
|
|
26
|
+
get value(): string;
|
|
27
|
+
toString(): string;
|
|
28
|
+
toJSON(): string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Compress a plain JS object into a base64url string
|
|
33
|
+
* suitable for env vars.
|
|
34
|
+
*/
|
|
35
|
+
declare function compressObject(obj: unknown): string;
|
|
36
|
+
/**
|
|
37
|
+
* Decompress a base64url string back into a JS object
|
|
38
|
+
* Allows to pass template data to resolve promises/env
|
|
39
|
+
*/
|
|
40
|
+
declare function decompressObject<T = unknown>(value: string, templateData?: Record<string, unknown>): Promise<T>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Gathers known secrets from a config and returns a function that replaces each raw secret with its masked representation.
|
|
44
|
+
* Intended for pino's `hooks.streamWrite`
|
|
45
|
+
*/
|
|
46
|
+
declare function createPinoCensor(config: unknown): (s: string) => string;
|
|
47
|
+
|
|
48
|
+
interface RetrySettings {
|
|
49
|
+
retries?: number;
|
|
50
|
+
retryInterval?: number;
|
|
51
|
+
validateResponse?: (response: Response) => void;
|
|
52
|
+
}
|
|
53
|
+
declare function fetchRetry(input: string | URL, init?: RequestInit & RetrySettings): Promise<Response>;
|
|
54
|
+
|
|
55
|
+
declare const RpcProvider: z.ZodEnum<{
|
|
56
|
+
custom: "custom";
|
|
57
|
+
alchemy: "alchemy";
|
|
58
|
+
drpc: "drpc";
|
|
59
|
+
ankr: "ankr";
|
|
60
|
+
thirdweb: "thirdweb";
|
|
61
|
+
erpc: "erpc";
|
|
62
|
+
}>;
|
|
63
|
+
type RpcProvider = z.infer<typeof RpcProvider>;
|
|
64
|
+
declare const ProvidersSchema: z.ZodObject<{
|
|
65
|
+
network: z.ZodEnum<{
|
|
66
|
+
Mainnet: "Mainnet";
|
|
67
|
+
Arbitrum: "Arbitrum";
|
|
68
|
+
Optimism: "Optimism";
|
|
69
|
+
Base: "Base";
|
|
70
|
+
Sonic: "Sonic";
|
|
71
|
+
MegaETH: "MegaETH";
|
|
72
|
+
Monad: "Monad";
|
|
73
|
+
Berachain: "Berachain";
|
|
74
|
+
Avalanche: "Avalanche";
|
|
75
|
+
BNB: "BNB";
|
|
76
|
+
WorldChain: "WorldChain";
|
|
77
|
+
Etherlink: "Etherlink";
|
|
78
|
+
Hemi: "Hemi";
|
|
79
|
+
Lisk: "Lisk";
|
|
80
|
+
Plasma: "Plasma";
|
|
81
|
+
Somnia: "Somnia";
|
|
82
|
+
}>;
|
|
83
|
+
jsonRpcProviders: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>, z.ZodArray<z.ZodPipe<z.ZodURL, z.ZodTransform<CensoredURL, string>>>>, z.ZodTransform<CensoredURL[] | undefined, CensoredURL[]>>>;
|
|
84
|
+
enabledProviders: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>, z.ZodArray<z.ZodEnum<{
|
|
85
|
+
custom: "custom";
|
|
86
|
+
alchemy: "alchemy";
|
|
87
|
+
drpc: "drpc";
|
|
88
|
+
ankr: "ankr";
|
|
89
|
+
thirdweb: "thirdweb";
|
|
90
|
+
erpc: "erpc";
|
|
91
|
+
}>>>>;
|
|
92
|
+
alchemyKeys: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<CensoredString<string>, string>>>>, z.ZodTransform<CensoredString<string>[] | undefined, CensoredString<string>[]>>>;
|
|
93
|
+
drpcKeys: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<CensoredString<string>, string>>>>, z.ZodTransform<CensoredString<string>[] | undefined, CensoredString<string>[]>>>;
|
|
94
|
+
ankrKeys: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<CensoredString<string>, string>>>>, z.ZodTransform<CensoredString<string>[] | undefined, CensoredString<string>[]>>>;
|
|
95
|
+
thirdwebKeys: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<CensoredString<string>, string>>>>, z.ZodTransform<CensoredString<string>[] | undefined, CensoredString<string>[]>>>;
|
|
96
|
+
erpcProjectId: z.ZodOptional<z.ZodString>;
|
|
97
|
+
erpcUrl: z.ZodDefault<z.ZodURL>;
|
|
98
|
+
jsonRpcTimeout: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
type ProvidersSchema = z.infer<typeof ProvidersSchema>;
|
|
101
|
+
|
|
102
|
+
interface HttpTransportOptions {
|
|
103
|
+
url?: string | undefined;
|
|
104
|
+
config: HttpTransportConfig;
|
|
105
|
+
}
|
|
106
|
+
declare function getFirstHttpTransportOptions(config: ProvidersSchema): HttpTransportOptions;
|
|
107
|
+
|
|
108
|
+
declare function getProviders(config: ProvidersSchema, logger?: ILogger): ProviderConfig[];
|
|
109
|
+
|
|
110
|
+
declare const TelegramConfig: z.ZodObject<{
|
|
111
|
+
type: z.ZodLiteral<"telegram">;
|
|
112
|
+
token: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>;
|
|
113
|
+
alertsChannel: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>;
|
|
114
|
+
notificationsChannel: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>>;
|
|
115
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
type TelegramConfig = z.infer<typeof TelegramConfig>;
|
|
118
|
+
declare const SlackConfig: z.ZodObject<{
|
|
119
|
+
type: z.ZodLiteral<"slack">;
|
|
120
|
+
webhookUrl: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>;
|
|
121
|
+
alertsOnly: z.ZodOptional<z.ZodPipe<z.ZodAny, z.ZodTransform<boolean, any>>>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
type SlackConfig = z.infer<typeof SlackConfig>;
|
|
124
|
+
declare const NotificationConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
125
|
+
type: z.ZodLiteral<"telegram">;
|
|
126
|
+
token: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>;
|
|
127
|
+
alertsChannel: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>;
|
|
128
|
+
notificationsChannel: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>>;
|
|
129
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"slack">;
|
|
132
|
+
webhookUrl: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>;
|
|
133
|
+
alertsOnly: z.ZodOptional<z.ZodPipe<z.ZodAny, z.ZodTransform<boolean, any>>>;
|
|
134
|
+
}, z.core.$strip>], "type">;
|
|
135
|
+
type NotificationConfig = z.infer<typeof NotificationConfig>;
|
|
136
|
+
declare const SignlConfig: z.ZodObject<{
|
|
137
|
+
apiKey: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>;
|
|
138
|
+
teamId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<CensoredString<string>, CensoredString<string>>]>, z.ZodTransform<CensoredString<string>, string | CensoredString<string>>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
type SignlConfig = z.infer<typeof SignlConfig>;
|
|
141
|
+
|
|
142
|
+
type NotificationSeverity = "alert" | "notification";
|
|
143
|
+
/**
|
|
144
|
+
* Notification that can be deduplicated
|
|
145
|
+
*/
|
|
146
|
+
interface IDedupableNotification {
|
|
147
|
+
/**
|
|
148
|
+
* Messages with the same dedupe key will be throttled to avoid spam
|
|
149
|
+
* If not provided, the message will not be throttled
|
|
150
|
+
*/
|
|
151
|
+
dedupeKey?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Function to calculate the wait time between deduped messages
|
|
154
|
+
* If not provided, the default backoff will be used
|
|
155
|
+
*/
|
|
156
|
+
throttleFn?: ThrottleFn;
|
|
157
|
+
/**
|
|
158
|
+
* Plaintext notification message
|
|
159
|
+
*/
|
|
160
|
+
plain: string;
|
|
161
|
+
/**
|
|
162
|
+
* Optional markdown verison of notification message
|
|
163
|
+
*/
|
|
164
|
+
md?: Markdown;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Function to calculate the wait time between deduped messages
|
|
168
|
+
* @param prevWaitMs The wait time of the previous message, 0 for the first message
|
|
169
|
+
* @returns The wait time for the next message in milliseconds
|
|
170
|
+
*/
|
|
171
|
+
type ThrottleFn = (prevWaitMs: number) => number;
|
|
172
|
+
/**
|
|
173
|
+
* Implement this interface for your notification classes
|
|
174
|
+
*/
|
|
175
|
+
interface INotification {
|
|
176
|
+
/**
|
|
177
|
+
* Function to generate the message for a recipient. Undefined means global message (gearbox notifications)
|
|
178
|
+
* This allows us to put the logic to fan out message to different recipients inside the class that implements INotificationMessage,
|
|
179
|
+
* and not to put this logic into the service that sends the notifications (you can still put it there, though)
|
|
180
|
+
*
|
|
181
|
+
* @param recipient The recipient to generate the message for, or undefined for the default/global recipient (gearbox notifications)
|
|
182
|
+
* @returns The message for the recipient, or undefined for no message
|
|
183
|
+
*/
|
|
184
|
+
messageFor: (recipient?: Address) => string | IDedupableNotification | undefined;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* A notification message, dumb strings and markdowns are treated as global notifications
|
|
188
|
+
*/
|
|
189
|
+
type NotificationLike = string | IDedupableNotification | INotification;
|
|
190
|
+
/**
|
|
191
|
+
* Notification service with deduplication and fan out logic
|
|
192
|
+
*/
|
|
193
|
+
interface INotificationService {
|
|
194
|
+
/**
|
|
195
|
+
* Send an alert to Signl
|
|
196
|
+
* @param message
|
|
197
|
+
* @param dedupeKey
|
|
198
|
+
* Messages with the same dedupe key will be throttled to avoid spam
|
|
199
|
+
* If not provided, the message will not be throttled
|
|
200
|
+
* @returns
|
|
201
|
+
*/
|
|
202
|
+
signl: (message: string, dedupeKey?: string) => void;
|
|
203
|
+
/**
|
|
204
|
+
* Sends high priority notification
|
|
205
|
+
* @param message
|
|
206
|
+
* @returns
|
|
207
|
+
*/
|
|
208
|
+
alert: (message: NotificationLike) => void;
|
|
209
|
+
/**
|
|
210
|
+
* Sends low priority notification
|
|
211
|
+
* @param message
|
|
212
|
+
* @returns
|
|
213
|
+
*/
|
|
214
|
+
notify: (message: NotificationLike) => void;
|
|
215
|
+
/**
|
|
216
|
+
* Register a recipient for notifications
|
|
217
|
+
* @param address The address of the recipient
|
|
218
|
+
* @param options The options for the recipient
|
|
219
|
+
*/
|
|
220
|
+
registerRecipient: (address: Address, options: NotificationConfig) => void;
|
|
221
|
+
}
|
|
222
|
+
interface INotifier {
|
|
223
|
+
/**
|
|
224
|
+
* Sends notification
|
|
225
|
+
* @param message
|
|
226
|
+
* @returns
|
|
227
|
+
*/
|
|
228
|
+
notify: (message: IDedupableNotification, severity: NotificationSeverity) => void;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
declare function createNotifier(config: NotificationConfig, logger?: ILogger): INotifier | undefined;
|
|
232
|
+
|
|
233
|
+
type SignlServiceOptions = SignlConfig & {
|
|
234
|
+
retryInterval?: number;
|
|
235
|
+
retryCount?: number;
|
|
236
|
+
throttleFn?: ThrottleFn;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
interface NotificationsServiceOptions {
|
|
240
|
+
notifications: Array<NotificationConfig & {
|
|
241
|
+
recipient?: Address;
|
|
242
|
+
}>;
|
|
243
|
+
signl?: SignlServiceOptions;
|
|
244
|
+
}
|
|
245
|
+
declare class NotificationsService implements INotificationService {
|
|
246
|
+
#private;
|
|
247
|
+
constructor(options: NotificationsServiceOptions, logger?: ILogger);
|
|
248
|
+
registerRecipient(address: Address, options: NotificationConfig): void;
|
|
249
|
+
signl(message: string, dedupeKey?: string): void;
|
|
250
|
+
alert(msg: NotificationLike): void;
|
|
251
|
+
notify(msg: NotificationLike): void;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare function getAlchemyUrl(network: NetworkType, apiKey: string, protocol?: "http" | "ws"): string | undefined;
|
|
255
|
+
declare function getDrpcUrl(network: NetworkType, apiKey: string, protocol?: "http" | "ws"): string | undefined;
|
|
256
|
+
declare function getAnkrUrl(network: NetworkType, apiKey: string, protocol?: "http" | "ws"): string | undefined;
|
|
257
|
+
declare function getThirdWebUrl(network: NetworkType, apiKey: string, protocol?: "http" | "ws"): string | undefined;
|
|
258
|
+
declare function getErpcKey(network: NetworkType, projectId?: string, urlBase?: string): string | undefined;
|
|
259
|
+
|
|
260
|
+
type TemplateData = Record<string, unknown>;
|
|
261
|
+
/**
|
|
262
|
+
* Merges yaml files, respecting .extends references.
|
|
263
|
+
* Performs env variable substitution on the config.
|
|
264
|
+
* Respects YAML anchors and aliases, and merge keys - so that they can be shared across two files
|
|
265
|
+
*
|
|
266
|
+
* x-* anchors are removed from resulting document (a-la docker compose yaml)
|
|
267
|
+
*
|
|
268
|
+
* @param file
|
|
269
|
+
* @param templateData
|
|
270
|
+
* @returns
|
|
271
|
+
*/
|
|
272
|
+
declare function resolveYamlFiles(file: string, templateData?: TemplateData): Promise<object>;
|
|
273
|
+
/**
|
|
274
|
+
* Merges yaml documents, respecting .extends references.
|
|
275
|
+
* Optionally, performs env-style variable substitution on the config.
|
|
276
|
+
* Respects YAML anchors and aliases, and merge keys - so that they can be shared across two files
|
|
277
|
+
* Supports s3 links for file
|
|
278
|
+
*
|
|
279
|
+
* @param file
|
|
280
|
+
* @param templateData
|
|
281
|
+
* @returns
|
|
282
|
+
*/
|
|
283
|
+
declare function resolveYamlDoc(file: string, templateData?: TemplateData): Promise<YAML.Document>;
|
|
284
|
+
/**
|
|
285
|
+
* Helper function that gets object with templated values
|
|
286
|
+
* Just because async ast already exists in yaml, but not in json reviver
|
|
287
|
+
* @param json
|
|
288
|
+
* @param templateData
|
|
289
|
+
* @returns
|
|
290
|
+
*/
|
|
291
|
+
declare function resolveFromObject(json: object, templateData?: TemplateData): Promise<object>;
|
|
292
|
+
/**
|
|
293
|
+
* Given file and a relative file path, returns full path of the relative file
|
|
294
|
+
* Supports s3 links for base file
|
|
295
|
+
* @param file
|
|
296
|
+
* @param relativeFile
|
|
297
|
+
*/
|
|
298
|
+
declare function getRelativePath(baseFile: string, relativeFile: string): string;
|
|
299
|
+
|
|
300
|
+
declare class SecretsManager {
|
|
301
|
+
#private;
|
|
302
|
+
secret(key: string): Promise<string>;
|
|
303
|
+
secretRaw(key: string): Promise<unknown>;
|
|
304
|
+
}
|
|
305
|
+
declare const secretsManagerProxy: (mgr?: SecretsManager) => Record<string, Promise<unknown>>;
|
|
306
|
+
|
|
307
|
+
declare class SSMManager {
|
|
308
|
+
#private;
|
|
309
|
+
parameter(name: string): Promise<string>;
|
|
310
|
+
}
|
|
311
|
+
declare const ssmManagerProxy: (mgr?: SSMManager) => Record<string, Promise<unknown>>;
|
|
312
|
+
|
|
313
|
+
declare const boolLike: () => z.ZodPipe<z.ZodAny, z.ZodTransform<boolean, any>>;
|
|
314
|
+
declare const stringArrayLike: () => z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>;
|
|
315
|
+
declare const optionalStringArrayLike: () => z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
316
|
+
/**
|
|
317
|
+
* Like Address from abitype/zod, but converts an address into an address that is checksum encoded.
|
|
318
|
+
*/
|
|
319
|
+
declare const addressLike: () => z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
320
|
+
declare const addressArrayLike: () => z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
321
|
+
declare const optionalAddressArrayLike: () => z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>>, z.ZodTransform<`0x${string}`[] | undefined, `0x${string}`[] | undefined>>;
|
|
322
|
+
|
|
323
|
+
declare function sleep(ms: number): Promise<unknown>;
|
|
324
|
+
|
|
325
|
+
interface IValue<V extends string = string> {
|
|
326
|
+
value: V;
|
|
327
|
+
}
|
|
328
|
+
declare function uncensorMap<V extends string = string>(map: Record<string, IValue<V>>): Record<string, V>;
|
|
329
|
+
|
|
330
|
+
declare const WhitelistItemsSchema: z.ZodObject<{
|
|
331
|
+
network: z.ZodEnum<{
|
|
332
|
+
Mainnet: "Mainnet";
|
|
333
|
+
Arbitrum: "Arbitrum";
|
|
334
|
+
Optimism: "Optimism";
|
|
335
|
+
Base: "Base";
|
|
336
|
+
Sonic: "Sonic";
|
|
337
|
+
MegaETH: "MegaETH";
|
|
338
|
+
Monad: "Monad";
|
|
339
|
+
Berachain: "Berachain";
|
|
340
|
+
Avalanche: "Avalanche";
|
|
341
|
+
BNB: "BNB";
|
|
342
|
+
WorldChain: "WorldChain";
|
|
343
|
+
Etherlink: "Etherlink";
|
|
344
|
+
Hemi: "Hemi";
|
|
345
|
+
Lisk: "Lisk";
|
|
346
|
+
Plasma: "Plasma";
|
|
347
|
+
Somnia: "Somnia";
|
|
348
|
+
}>;
|
|
349
|
+
addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
350
|
+
reason: z.ZodDefault<z.ZodString>;
|
|
351
|
+
issue: z.ZodOptional<z.ZodString>;
|
|
352
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
type WhitelistItemsSchema = z.infer<typeof WhitelistItemsSchema>;
|
|
355
|
+
declare const WhitelistItemSchema: z.ZodObject<{
|
|
356
|
+
network: z.ZodEnum<{
|
|
357
|
+
Mainnet: "Mainnet";
|
|
358
|
+
Arbitrum: "Arbitrum";
|
|
359
|
+
Optimism: "Optimism";
|
|
360
|
+
Base: "Base";
|
|
361
|
+
Sonic: "Sonic";
|
|
362
|
+
MegaETH: "MegaETH";
|
|
363
|
+
Monad: "Monad";
|
|
364
|
+
Berachain: "Berachain";
|
|
365
|
+
Avalanche: "Avalanche";
|
|
366
|
+
BNB: "BNB";
|
|
367
|
+
WorldChain: "WorldChain";
|
|
368
|
+
Etherlink: "Etherlink";
|
|
369
|
+
Hemi: "Hemi";
|
|
370
|
+
Lisk: "Lisk";
|
|
371
|
+
Plasma: "Plasma";
|
|
372
|
+
Somnia: "Somnia";
|
|
373
|
+
}>;
|
|
374
|
+
category: z.ZodString;
|
|
375
|
+
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
376
|
+
reason: z.ZodDefault<z.ZodString>;
|
|
377
|
+
issue: z.ZodOptional<z.ZodString>;
|
|
378
|
+
contractType: z.ZodOptional<z.ZodString>;
|
|
379
|
+
createdAt: z.ZodNumber;
|
|
380
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
type WhitelistItemSchema = z.infer<typeof WhitelistItemSchema>;
|
|
383
|
+
|
|
384
|
+
interface WhitelistOptions {
|
|
385
|
+
url: string;
|
|
386
|
+
network: NetworkType;
|
|
387
|
+
logger?: ILogger;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Fetches a network-scoped whitelist from the deploy-tools backend and keeps
|
|
391
|
+
* it in memory with a 10-minute refresh interval.
|
|
392
|
+
*
|
|
393
|
+
* On fetch failure the previous in-memory copy is retained; if no successful
|
|
394
|
+
* fetch has occurred yet the whitelist is considered empty.
|
|
395
|
+
*/
|
|
396
|
+
declare class Whitelist {
|
|
397
|
+
#private;
|
|
398
|
+
constructor({ url, network, logger }: WhitelistOptions);
|
|
399
|
+
/**
|
|
400
|
+
* Performs the initial fetch and starts the periodic refresh timer.
|
|
401
|
+
* Failure of the initial fetch is non-fatal: the whitelist stays empty.
|
|
402
|
+
*/
|
|
403
|
+
start(): Promise<void>;
|
|
404
|
+
/** Stops the refresh timer. */
|
|
405
|
+
stop(): void;
|
|
406
|
+
/**
|
|
407
|
+
* Returns the matching whitelist entry for the given address, or
|
|
408
|
+
* `undefined` if absent or expired.
|
|
409
|
+
*/
|
|
410
|
+
has(address: string): WhitelistItemSchema | undefined;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
declare const zommandRegistry: z4.$ZodRegistry<{
|
|
414
|
+
flags: string;
|
|
415
|
+
env?: string;
|
|
416
|
+
description?: string;
|
|
417
|
+
}, z4.$ZodType<unknown, unknown, z4.$ZodTypeInternals<unknown, unknown>>>;
|
|
418
|
+
interface ZommandOptions<T extends z4.$ZodTypes> {
|
|
419
|
+
schema: T;
|
|
420
|
+
templateData?: TemplateData;
|
|
421
|
+
/**
|
|
422
|
+
* If value is string, it's used as default value for config file
|
|
423
|
+
*/
|
|
424
|
+
configFile?: boolean | string;
|
|
425
|
+
/**
|
|
426
|
+
* If true, allows to pass config zlib compressed config as --inline-config=... or INLINE_CONFIG env var
|
|
427
|
+
*/
|
|
428
|
+
inlineConfig?: boolean;
|
|
429
|
+
}
|
|
430
|
+
declare class Zommand<T extends z4.$ZodTypes, Args extends any[] = []> extends Command<Args, z4.output<T>> {
|
|
431
|
+
#private;
|
|
432
|
+
constructor(name: string, opts: ZommandOptions<T>);
|
|
433
|
+
action(fn: (this: this, ...args: [...Args, z4.output<T>, this]) => void | Promise<void>): this;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export { CensoredString, CensoredURL, type HttpTransportOptions, type IDedupableNotification, type INotification, type INotificationService, type INotifier, type IValue, NotificationConfig, type NotificationLike, type NotificationSeverity, NotificationsService, type NotificationsServiceOptions, ProvidersSchema, RpcProvider, SSMManager, SecretsManager, SignlConfig, SlackConfig, TelegramConfig, type TemplateData, type ThrottleFn, Whitelist, WhitelistItemSchema, WhitelistItemsSchema, type WhitelistOptions, Zommand, type ZommandOptions, addressArrayLike, addressLike, boolLike, compressObject, createNotifier, createPinoCensor, decompressObject, fetchRetry, getAlchemyUrl, getAnkrUrl, getDrpcUrl, getErpcKey, getFirstHttpTransportOptions, getProviders, getRelativePath, getThirdWebUrl, optionalAddressArrayLike, optionalStringArrayLike, resolveFromObject, resolveYamlDoc, resolveYamlFiles, secretsManagerProxy, sleep, ssmManagerProxy, stringArrayLike, uncensorMap, zommandRegistry };
|