@forgedevv/shared 0.0.0-stage → 0.2.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/api.d.ts +464 -0
- package/dist/api.js +307 -0
- package/dist/constants.d.ts +53 -0
- package/dist/constants.js +42 -0
- package/dist/db.d.ts +189 -0
- package/dist/db.js +75 -0
- package/dist/env.d.ts +21 -0
- package/dist/env.js +92 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/jobs.d.ts +44 -0
- package/dist/jobs.js +76 -0
- package/dist/site-config.d.ts +66 -0
- package/dist/site-config.js +48 -0
- package/dist/spec.d.ts +66 -0
- package/dist/spec.js +121 -0
- package/dist/web-client.d.ts +210 -0
- package/dist/web-client.js +52 -0
- package/package.json +38 -3
- package/README.md +0 -3
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Lamports serialized as a decimal string (bigint). 1 SOL = 1_000_000_000 lamports. */
|
|
3
|
+
export declare const Lamports: z.ZodString;
|
|
4
|
+
export type Lamports = z.infer<typeof Lamports>;
|
|
5
|
+
/** Raw token amount (smallest units) serialized as a decimal string. */
|
|
6
|
+
export declare const RawTokenAmount: z.ZodString;
|
|
7
|
+
/** Base58 ed25519 signature (transaction signature or signed message). */
|
|
8
|
+
export declare const Base58Signature: z.ZodString;
|
|
9
|
+
/** Serialized transaction, base64 encoded. */
|
|
10
|
+
export declare const Base64Transaction: z.ZodBase64;
|
|
11
|
+
export declare const Uuid: z.ZodUUID;
|
|
12
|
+
/** ISO 8601 date-time (UTC `Z` or with an offset). */
|
|
13
|
+
export declare const IsoDateTime: z.ZodISODateTime;
|
|
14
|
+
/** Path params of routes with `:id`. */
|
|
15
|
+
export declare const RouteIdParams: z.ZodObject<{
|
|
16
|
+
id: z.ZodUUID;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
export type RouteIdParams = z.infer<typeof RouteIdParams>;
|
|
19
|
+
export declare const WEB_API_ROUTES: {
|
|
20
|
+
readonly authNonce: {
|
|
21
|
+
readonly method: "POST";
|
|
22
|
+
readonly path: "/api/auth/nonce";
|
|
23
|
+
};
|
|
24
|
+
readonly authVerify: {
|
|
25
|
+
readonly method: "POST";
|
|
26
|
+
readonly path: "/api/auth/verify";
|
|
27
|
+
};
|
|
28
|
+
readonly authSession: {
|
|
29
|
+
readonly method: "GET";
|
|
30
|
+
readonly path: "/api/auth/session";
|
|
31
|
+
};
|
|
32
|
+
readonly authLogout: {
|
|
33
|
+
readonly method: "POST";
|
|
34
|
+
readonly path: "/api/auth/logout";
|
|
35
|
+
};
|
|
36
|
+
readonly authSupabaseToken: {
|
|
37
|
+
readonly method: "GET";
|
|
38
|
+
readonly path: "/api/auth/supabase-token";
|
|
39
|
+
};
|
|
40
|
+
readonly gating: {
|
|
41
|
+
readonly method: "GET";
|
|
42
|
+
readonly path: "/api/gating";
|
|
43
|
+
};
|
|
44
|
+
readonly flags: {
|
|
45
|
+
readonly method: "GET";
|
|
46
|
+
readonly path: "/api/flags";
|
|
47
|
+
};
|
|
48
|
+
readonly chat: {
|
|
49
|
+
readonly method: "POST";
|
|
50
|
+
readonly path: "/api/chat";
|
|
51
|
+
};
|
|
52
|
+
readonly specConfirm: {
|
|
53
|
+
readonly method: "POST";
|
|
54
|
+
readonly path: "/api/spec/confirm";
|
|
55
|
+
};
|
|
56
|
+
readonly launchpadModifications: {
|
|
57
|
+
readonly method: "POST";
|
|
58
|
+
readonly path: "/api/launchpads/:id/modifications";
|
|
59
|
+
};
|
|
60
|
+
readonly paymentsQuote: {
|
|
61
|
+
readonly method: "POST";
|
|
62
|
+
readonly path: "/api/payments/quote";
|
|
63
|
+
};
|
|
64
|
+
readonly paymentsConfirm: {
|
|
65
|
+
readonly method: "POST";
|
|
66
|
+
readonly path: "/api/payments/confirm";
|
|
67
|
+
};
|
|
68
|
+
readonly jobApprove: {
|
|
69
|
+
readonly method: "POST";
|
|
70
|
+
readonly path: "/api/jobs/:id/approve";
|
|
71
|
+
};
|
|
72
|
+
readonly ownerTransactionGet: {
|
|
73
|
+
readonly method: "GET";
|
|
74
|
+
readonly path: "/api/jobs/:id/owner-transaction";
|
|
75
|
+
};
|
|
76
|
+
readonly ownerTransactionSubmit: {
|
|
77
|
+
readonly method: "POST";
|
|
78
|
+
readonly path: "/api/jobs/:id/owner-transaction";
|
|
79
|
+
};
|
|
80
|
+
readonly jobGet: {
|
|
81
|
+
readonly method: "GET";
|
|
82
|
+
readonly path: "/api/jobs/:id";
|
|
83
|
+
};
|
|
84
|
+
readonly launchpadsList: {
|
|
85
|
+
readonly method: "GET";
|
|
86
|
+
readonly path: "/api/launchpads";
|
|
87
|
+
};
|
|
88
|
+
readonly launchpadGet: {
|
|
89
|
+
readonly method: "GET";
|
|
90
|
+
readonly path: "/api/launchpads/:id";
|
|
91
|
+
};
|
|
92
|
+
readonly claimTransaction: {
|
|
93
|
+
readonly method: "GET";
|
|
94
|
+
readonly path: "/api/launchpads/:id/claim-transaction";
|
|
95
|
+
};
|
|
96
|
+
readonly launchpadReactivate: {
|
|
97
|
+
readonly method: "POST";
|
|
98
|
+
readonly path: "/api/launchpads/:id/reactivate";
|
|
99
|
+
};
|
|
100
|
+
readonly launchpadRetry: {
|
|
101
|
+
readonly method: "POST";
|
|
102
|
+
readonly path: "/api/launchpads/:id/retry";
|
|
103
|
+
};
|
|
104
|
+
readonly rpc: {
|
|
105
|
+
readonly method: "POST";
|
|
106
|
+
readonly path: "/api/rpc";
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export declare const AuthNonceRequest: z.ZodObject<{
|
|
110
|
+
wallet: z.ZodString;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
export type AuthNonceRequest = z.infer<typeof AuthNonceRequest>;
|
|
113
|
+
/**
|
|
114
|
+
* `nonce` is an opaque server-signed token (stateless). `message` is the exact text the wallet
|
|
115
|
+
* must sign; the client never builds it. The token is also set as an HttpOnly cookie.
|
|
116
|
+
*/
|
|
117
|
+
export declare const AuthNonceResponse: z.ZodObject<{
|
|
118
|
+
nonce: z.ZodString;
|
|
119
|
+
message: z.ZodString;
|
|
120
|
+
expiresAt: z.ZodString;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
export type AuthNonceResponse = z.infer<typeof AuthNonceResponse>;
|
|
123
|
+
export declare const AuthVerifyRequest: z.ZodObject<{
|
|
124
|
+
wallet: z.ZodString;
|
|
125
|
+
signature: z.ZodString;
|
|
126
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, z.core.$strict>;
|
|
128
|
+
export type AuthVerifyRequest = z.infer<typeof AuthVerifyRequest>;
|
|
129
|
+
/** The session. */
|
|
130
|
+
export declare const AuthVerifyResponse: z.ZodObject<{
|
|
131
|
+
wallet: z.ZodString;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
export type AuthVerifyResponse = z.infer<typeof AuthVerifyResponse>;
|
|
134
|
+
export declare const AuthLogoutResponse: z.ZodObject<{
|
|
135
|
+
ok: z.ZodLiteral<true>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
export type AuthLogoutResponse = z.infer<typeof AuthLogoutResponse>;
|
|
138
|
+
export declare const SupabaseTokenResponse: z.ZodObject<{
|
|
139
|
+
accessToken: z.ZodString;
|
|
140
|
+
expiresAt: z.ZodString;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
export type SupabaseTokenResponse = z.infer<typeof SupabaseTokenResponse>;
|
|
143
|
+
export declare const Session: z.ZodObject<{
|
|
144
|
+
wallet: z.ZodString;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
export type Session = AuthVerifyResponse;
|
|
147
|
+
export declare const GatingResponse: z.ZodObject<{
|
|
148
|
+
ok: z.ZodBoolean;
|
|
149
|
+
required: z.ZodString;
|
|
150
|
+
balance: z.ZodString;
|
|
151
|
+
enabled: z.ZodBoolean;
|
|
152
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
export type GatingResponse = z.infer<typeof GatingResponse>;
|
|
155
|
+
export declare const FlagsResponse: z.ZodObject<{
|
|
156
|
+
signupsPaused: z.ZodBoolean;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
export type FlagsResponse = z.infer<typeof FlagsResponse>;
|
|
159
|
+
export declare const ChatRequest: z.ZodObject<{
|
|
160
|
+
conversationId: z.ZodOptional<z.ZodUUID>;
|
|
161
|
+
launchpadId: z.ZodOptional<z.ZodUUID>;
|
|
162
|
+
message: z.ZodString;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
export type ChatRequest = z.infer<typeof ChatRequest>;
|
|
165
|
+
/** Payload of the first stream event. */
|
|
166
|
+
export declare const ChatResponse: z.ZodObject<{
|
|
167
|
+
conversationId: z.ZodUUID;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
export type ChatResponse = z.infer<typeof ChatResponse>;
|
|
170
|
+
export declare const SpecConfirmRequest: z.ZodObject<{
|
|
171
|
+
conversationId: z.ZodUUID;
|
|
172
|
+
spec: z.ZodObject<{
|
|
173
|
+
version: z.ZodLiteral<1>;
|
|
174
|
+
ownerWallet: z.ZodString;
|
|
175
|
+
name: z.ZodString;
|
|
176
|
+
slug: z.ZodString;
|
|
177
|
+
quote: z.ZodLiteral<"SOL">;
|
|
178
|
+
tradingFeeBps: z.ZodNumber;
|
|
179
|
+
coinCreatorSharePct: z.ZodDefault<z.ZodNumber>;
|
|
180
|
+
poolCreationFeeSol: z.ZodNumber;
|
|
181
|
+
antiSniper: z.ZodDefault<z.ZodBoolean>;
|
|
182
|
+
theme: z.ZodObject<{
|
|
183
|
+
primaryColor: z.ZodString;
|
|
184
|
+
accentColor: z.ZodString;
|
|
185
|
+
darkMode: z.ZodBoolean;
|
|
186
|
+
tagline: z.ZodString;
|
|
187
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
188
|
+
designNotes: z.ZodString;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
launchpadCoin: z.ZodObject<{
|
|
191
|
+
name: z.ZodString;
|
|
192
|
+
symbol: z.ZodString;
|
|
193
|
+
description: z.ZodString;
|
|
194
|
+
imageUrl: z.ZodURL;
|
|
195
|
+
firstBuySol: z.ZodNumber;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
export type SpecConfirmRequest = z.input<typeof SpecConfirmRequest>;
|
|
200
|
+
export declare const SpecConfirmResponse: z.ZodObject<{
|
|
201
|
+
launchpadId: z.ZodUUID;
|
|
202
|
+
jobId: z.ZodUUID;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
export type SpecConfirmResponse = z.infer<typeof SpecConfirmResponse>;
|
|
205
|
+
export declare const LaunchpadModificationRequest: z.ZodObject<{
|
|
206
|
+
conversationId: z.ZodUUID;
|
|
207
|
+
request: z.ZodString;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
export type LaunchpadModificationRequest = z.infer<typeof LaunchpadModificationRequest>;
|
|
210
|
+
export declare const LaunchpadModificationResponse: z.ZodObject<{
|
|
211
|
+
jobId: z.ZodUUID;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
export type LaunchpadModificationResponse = z.infer<typeof LaunchpadModificationResponse>;
|
|
214
|
+
export declare const LaunchpadRetryResponse: z.ZodObject<{
|
|
215
|
+
jobId: z.ZodUUID;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
export type LaunchpadRetryResponse = z.infer<typeof LaunchpadRetryResponse>;
|
|
218
|
+
export declare const PaymentsQuoteRequest: z.ZodObject<{
|
|
219
|
+
jobId: z.ZodUUID;
|
|
220
|
+
kind: z.ZodEnum<{
|
|
221
|
+
creation: "creation";
|
|
222
|
+
modification: "modification";
|
|
223
|
+
}>;
|
|
224
|
+
}, z.core.$strict>;
|
|
225
|
+
export type PaymentsQuoteRequest = z.infer<typeof PaymentsQuoteRequest>;
|
|
226
|
+
/** Quote as seen by the UI (docs/frontend/CONTRACT.md). */
|
|
227
|
+
export declare const Quote: z.ZodObject<{
|
|
228
|
+
paymentId: z.ZodUUID;
|
|
229
|
+
kind: z.ZodEnum<{
|
|
230
|
+
creation: "creation";
|
|
231
|
+
modification: "modification";
|
|
232
|
+
}>;
|
|
233
|
+
lamports: z.ZodString;
|
|
234
|
+
usdAmount: z.ZodNumber;
|
|
235
|
+
expiresAt: z.ZodISODateTime;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
export type Quote = z.infer<typeof Quote>;
|
|
238
|
+
/**
|
|
239
|
+
* `transaction` is the unsigned payment transaction (base64). It is null when lamports = "0"
|
|
240
|
+
* (an included modification remains and the job goes straight to `paid`).
|
|
241
|
+
*/
|
|
242
|
+
export declare const PaymentsQuoteResponse: z.ZodObject<{
|
|
243
|
+
paymentId: z.ZodUUID;
|
|
244
|
+
kind: z.ZodEnum<{
|
|
245
|
+
creation: "creation";
|
|
246
|
+
modification: "modification";
|
|
247
|
+
}>;
|
|
248
|
+
lamports: z.ZodString;
|
|
249
|
+
usdAmount: z.ZodNumber;
|
|
250
|
+
expiresAt: z.ZodISODateTime;
|
|
251
|
+
transaction: z.ZodNullable<z.ZodBase64>;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
export type PaymentsQuoteResponse = z.infer<typeof PaymentsQuoteResponse>;
|
|
254
|
+
export declare const PaymentsConfirmRequest: z.ZodObject<{
|
|
255
|
+
paymentId: z.ZodUUID;
|
|
256
|
+
signature: z.ZodString;
|
|
257
|
+
}, z.core.$strict>;
|
|
258
|
+
export type PaymentsConfirmRequest = z.infer<typeof PaymentsConfirmRequest>;
|
|
259
|
+
export declare const PaymentsConfirmResponse: z.ZodObject<{
|
|
260
|
+
status: z.ZodEnum<{
|
|
261
|
+
refunded: "refunded";
|
|
262
|
+
quoted: "quoted";
|
|
263
|
+
confirmed: "confirmed";
|
|
264
|
+
expired: "expired";
|
|
265
|
+
}>;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
export type PaymentsConfirmResponse = z.infer<typeof PaymentsConfirmResponse>;
|
|
268
|
+
export declare const JobApproveResponse: z.ZodObject<{
|
|
269
|
+
status: z.ZodEnum<{
|
|
270
|
+
spec_ready: "spec_ready";
|
|
271
|
+
paid: "paid";
|
|
272
|
+
building: "building";
|
|
273
|
+
preview_ready: "preview_ready";
|
|
274
|
+
approved: "approved";
|
|
275
|
+
onchain_setup: "onchain_setup";
|
|
276
|
+
awaiting_owner_signature: "awaiting_owner_signature";
|
|
277
|
+
owner_signed: "owner_signed";
|
|
278
|
+
deploying: "deploying";
|
|
279
|
+
live: "live";
|
|
280
|
+
failed: "failed";
|
|
281
|
+
refunded: "refunded";
|
|
282
|
+
}>;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
export type JobApproveResponse = z.infer<typeof JobApproveResponse>;
|
|
285
|
+
/** Summary shown before the client signs the launch transaction. */
|
|
286
|
+
export declare const OwnerTransactionSummary: z.ZodObject<{
|
|
287
|
+
coinName: z.ZodString;
|
|
288
|
+
coinSymbol: z.ZodString;
|
|
289
|
+
firstBuyLamports: z.ZodString;
|
|
290
|
+
estimatedNetworkFeeLamports: z.ZodString;
|
|
291
|
+
ownerWallet: z.ZodString;
|
|
292
|
+
ownerRequiredBalanceLamports: z.ZodOptional<z.ZodString>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
export type OwnerTransactionSummary = z.infer<typeof OwnerTransactionSummary>;
|
|
295
|
+
/** Absolute https URL (the launchpad coin metadata URI). Kept exactly as sent (no normalization). */
|
|
296
|
+
export declare const HttpsUrl: z.ZodURL;
|
|
297
|
+
/**
|
|
298
|
+
* The accounts of the launch transaction, pinned by the browser (`verifyLaunchCoinTransaction` of
|
|
299
|
+
* @forge/core) before the owner signs: the launchpad coin config and mint (launchpad row), the
|
|
300
|
+
* FORGE creator wallet that creates the pool and holds the durable nonce, the durable nonce
|
|
301
|
+
* account, and the coin metadata URI written by the pool creation.
|
|
302
|
+
*/
|
|
303
|
+
export declare const OwnerTransactionLaunch: z.ZodObject<{
|
|
304
|
+
config: z.ZodString;
|
|
305
|
+
mint: z.ZodString;
|
|
306
|
+
creator: z.ZodString;
|
|
307
|
+
nonceAccount: z.ZodString;
|
|
308
|
+
metadataUri: z.ZodURL;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
export type OwnerTransactionLaunch = z.infer<typeof OwnerTransactionLaunch>;
|
|
311
|
+
export declare const OwnerTransactionGetResponse: z.ZodObject<{
|
|
312
|
+
transaction: z.ZodBase64;
|
|
313
|
+
summary: z.ZodObject<{
|
|
314
|
+
coinName: z.ZodString;
|
|
315
|
+
coinSymbol: z.ZodString;
|
|
316
|
+
firstBuyLamports: z.ZodString;
|
|
317
|
+
estimatedNetworkFeeLamports: z.ZodString;
|
|
318
|
+
ownerWallet: z.ZodString;
|
|
319
|
+
ownerRequiredBalanceLamports: z.ZodOptional<z.ZodString>;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
simulation: z.ZodOptional<z.ZodEnum<{
|
|
322
|
+
failed: "failed";
|
|
323
|
+
ok: "ok";
|
|
324
|
+
unavailable: "unavailable";
|
|
325
|
+
}>>;
|
|
326
|
+
launch: z.ZodOptional<z.ZodObject<{
|
|
327
|
+
config: z.ZodString;
|
|
328
|
+
mint: z.ZodString;
|
|
329
|
+
creator: z.ZodString;
|
|
330
|
+
nonceAccount: z.ZodString;
|
|
331
|
+
metadataUri: z.ZodURL;
|
|
332
|
+
}, z.core.$strip>>;
|
|
333
|
+
}, z.core.$strip>;
|
|
334
|
+
export type OwnerTransactionGetResponse = z.infer<typeof OwnerTransactionGetResponse>;
|
|
335
|
+
export declare const OwnerTransactionSubmitRequest: z.ZodObject<{
|
|
336
|
+
signedTransaction: z.ZodBase64;
|
|
337
|
+
}, z.core.$strict>;
|
|
338
|
+
export type OwnerTransactionSubmitRequest = z.infer<typeof OwnerTransactionSubmitRequest>;
|
|
339
|
+
export declare const OwnerTransactionSubmitResponse: z.ZodObject<{
|
|
340
|
+
signature: z.ZodString;
|
|
341
|
+
}, z.core.$strip>;
|
|
342
|
+
export type OwnerTransactionSubmitResponse = z.infer<typeof OwnerTransactionSubmitResponse>;
|
|
343
|
+
export declare const ClaimTransactionSummary: z.ZodObject<{
|
|
344
|
+
pool: z.ZodString;
|
|
345
|
+
tradingFeesLamports: z.ZodString;
|
|
346
|
+
poolCreationFeeLamports: z.ZodString;
|
|
347
|
+
ownerCostLamports: z.ZodString;
|
|
348
|
+
remainingPools: z.ZodNumber;
|
|
349
|
+
}, z.core.$strip>;
|
|
350
|
+
export type ClaimTransactionSummary = z.infer<typeof ClaimTransactionSummary>;
|
|
351
|
+
export declare const ClaimTransactionResponse: z.ZodObject<{
|
|
352
|
+
transaction: z.ZodBase64;
|
|
353
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
354
|
+
pool: z.ZodString;
|
|
355
|
+
tradingFeesLamports: z.ZodString;
|
|
356
|
+
poolCreationFeeLamports: z.ZodString;
|
|
357
|
+
ownerCostLamports: z.ZodString;
|
|
358
|
+
remainingPools: z.ZodNumber;
|
|
359
|
+
}, z.core.$strip>>;
|
|
360
|
+
}, z.core.$strip>;
|
|
361
|
+
export type ClaimTransactionResponse = z.infer<typeof ClaimTransactionResponse>;
|
|
362
|
+
export declare const RpcRequest: z.ZodObject<{
|
|
363
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
364
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
|
|
365
|
+
method: z.ZodString;
|
|
366
|
+
params: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
367
|
+
}, z.core.$strict>;
|
|
368
|
+
export type RpcRequest = z.infer<typeof RpcRequest>;
|
|
369
|
+
export declare const RpcResponse: z.ZodObject<{
|
|
370
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
371
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
|
|
372
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
373
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
374
|
+
code: z.ZodNumber;
|
|
375
|
+
message: z.ZodString;
|
|
376
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
377
|
+
}, z.core.$strip>>;
|
|
378
|
+
}, z.core.$strip>;
|
|
379
|
+
export type RpcResponse = z.infer<typeof RpcResponse>;
|
|
380
|
+
/** Lowercase hex HMAC-SHA256 computed with SIGNER_HMAC_SECRET over `signerSignedPayload(...)`. */
|
|
381
|
+
export declare const SIGNER_SIGNATURE_HEADER = "X-Forge-Signature";
|
|
382
|
+
/** Unix time in seconds, as a decimal string. */
|
|
383
|
+
export declare const SIGNER_TIMESTAMP_HEADER = "X-Forge-Timestamp";
|
|
384
|
+
/**
|
|
385
|
+
* 16 random bytes as 32 lowercase hex characters, fresh for every request (and every retry). The
|
|
386
|
+
* signer accepts a nonce once within the clock-skew window.
|
|
387
|
+
*/
|
|
388
|
+
export declare const SIGNER_NONCE_HEADER = "X-Forge-Nonce";
|
|
389
|
+
/** Requests whose timestamp differs from the signer clock by more than this are rejected. */
|
|
390
|
+
export declare const SIGNER_MAX_CLOCK_SKEW_SECONDS = 60;
|
|
391
|
+
/** First line of the signed string. Any change to its layout gets a new tag. */
|
|
392
|
+
export declare const SIGNER_SIGNATURE_VERSION = "forge-signer-v2";
|
|
393
|
+
/** The request fields covered by the signer HMAC. */
|
|
394
|
+
export interface SignerSignedFields {
|
|
395
|
+
/** HTTP method, uppercase (`POST`). */
|
|
396
|
+
method: string;
|
|
397
|
+
/** Request target exactly as sent: the path plus the query string (`/v1/configs?a=1`). */
|
|
398
|
+
path: string;
|
|
399
|
+
/** Same value as the timestamp header. */
|
|
400
|
+
timestamp: string;
|
|
401
|
+
/** Same value as the nonce header. */
|
|
402
|
+
nonce: string;
|
|
403
|
+
/** Lowercase hex SHA-256 of the raw body bytes (an empty body hashes zero bytes). */
|
|
404
|
+
bodySha256: string;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Exact string fed to HMAC-SHA256, one field per line, in this order:
|
|
408
|
+
*
|
|
409
|
+
* forge-signer-v2\n<METHOD>\n<path?query>\n<timestamp>\n<nonce>\n<body sha256>
|
|
410
|
+
*
|
|
411
|
+
* Every field has a strict format that excludes the line feed, and the field count is fixed, so
|
|
412
|
+
* the string decodes to exactly one tuple: a signature made for one method, route, query, time,
|
|
413
|
+
* nonce or body is worth nothing for any other. Throws on a field outside its format, so neither
|
|
414
|
+
* side can sign or check an ambiguous string.
|
|
415
|
+
*/
|
|
416
|
+
export declare function signerSignedPayload(fields: SignerSignedFields): string;
|
|
417
|
+
export declare const SIGNER_ROUTES: {
|
|
418
|
+
readonly configs: {
|
|
419
|
+
readonly method: "POST";
|
|
420
|
+
readonly path: "/v1/configs";
|
|
421
|
+
};
|
|
422
|
+
readonly launchCoinPrepare: {
|
|
423
|
+
readonly method: "POST";
|
|
424
|
+
readonly path: "/v1/launch-coin/prepare";
|
|
425
|
+
};
|
|
426
|
+
readonly health: {
|
|
427
|
+
readonly method: "GET";
|
|
428
|
+
readonly path: "/v1/health";
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
export declare const SignerConfigsRequest: z.ZodObject<{
|
|
432
|
+
jobId: z.ZodUUID;
|
|
433
|
+
}, z.core.$strict>;
|
|
434
|
+
export type SignerConfigsRequest = z.infer<typeof SignerConfigsRequest>;
|
|
435
|
+
export declare const SignerConfigsResponse: z.ZodObject<{
|
|
436
|
+
launchpadConfig: z.ZodString;
|
|
437
|
+
launchpadCoinConfig: z.ZodString;
|
|
438
|
+
}, z.core.$strip>;
|
|
439
|
+
export type SignerConfigsResponse = z.infer<typeof SignerConfigsResponse>;
|
|
440
|
+
export declare const SignerLaunchPrepareRequest: z.ZodObject<{
|
|
441
|
+
jobId: z.ZodUUID;
|
|
442
|
+
}, z.core.$strict>;
|
|
443
|
+
export type SignerLaunchPrepareRequest = z.infer<typeof SignerLaunchPrepareRequest>;
|
|
444
|
+
export declare const SignerLaunchPrepareResponse: z.ZodObject<{
|
|
445
|
+
partiallySignedTx: z.ZodBase64;
|
|
446
|
+
mint: z.ZodString;
|
|
447
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
448
|
+
coinName: z.ZodString;
|
|
449
|
+
coinSymbol: z.ZodString;
|
|
450
|
+
firstBuyLamports: z.ZodString;
|
|
451
|
+
estimatedNetworkFeeLamports: z.ZodString;
|
|
452
|
+
ownerWallet: z.ZodString;
|
|
453
|
+
ownerRequiredBalanceLamports: z.ZodOptional<z.ZodString>;
|
|
454
|
+
}, z.core.$strip>>;
|
|
455
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
456
|
+
}, z.core.$strip>;
|
|
457
|
+
export type SignerLaunchPrepareResponse = z.infer<typeof SignerLaunchPrepareResponse>;
|
|
458
|
+
export declare const SignerHealthResponse: z.ZodObject<{
|
|
459
|
+
ok: z.ZodBoolean;
|
|
460
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
461
|
+
uptimeSeconds: z.ZodOptional<z.ZodNumber>;
|
|
462
|
+
jobs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
463
|
+
}, z.core.$strip>;
|
|
464
|
+
export type SignerHealthResponse = z.infer<typeof SignerHealthResponse>;
|