@gearbox-protocol/cli-utils 9.2.1 → 9.2.2

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