@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 +249 -229
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1061 -1298
- package/dist/index.js.map +1 -1
- package/dist/schema.d.ts +58 -56
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +61 -22
- package/dist/schema.js.map +1 -1
- package/package.json +14 -14
- package/dist/chunk-GGX3YGGH.js +0 -63
- package/dist/chunk-GGX3YGGH.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { ILogger, NetworkType } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
106
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
140
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
253
|
+
notifications: Array<NotificationConfig & {
|
|
254
|
+
recipient?: Address;
|
|
255
|
+
}>;
|
|
256
|
+
signl?: SignlServiceOptions;
|
|
246
257
|
}
|
|
247
258
|
declare class NotificationsService implements INotificationService {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
|
|
311
|
-
|
|
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
|
-
|
|
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
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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
|
-
|
|
371
|
-
|
|
372
|
-
|
|
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
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
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
|
-
|
|
388
|
-
|
|
389
|
-
|
|
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,
|
|
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"],"mappings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