@star-factory/sdk-launchpad 0.1.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.
Files changed (86) hide show
  1. package/README.md +343 -0
  2. package/dist/claims/accounts.d.ts +49 -0
  3. package/dist/claims/accounts.d.ts.map +1 -0
  4. package/dist/claims/accounts.js +118 -0
  5. package/dist/claims/accounts.js.map +1 -0
  6. package/dist/claims/eligibility.d.ts +67 -0
  7. package/dist/claims/eligibility.d.ts.map +1 -0
  8. package/dist/claims/eligibility.js +275 -0
  9. package/dist/claims/eligibility.js.map +1 -0
  10. package/dist/claims/index.d.ts +5 -0
  11. package/dist/claims/index.d.ts.map +1 -0
  12. package/dist/claims/index.js +41 -0
  13. package/dist/claims/index.js.map +1 -0
  14. package/dist/claims/pdas.d.ts +24 -0
  15. package/dist/claims/pdas.d.ts.map +1 -0
  16. package/dist/claims/pdas.js +43 -0
  17. package/dist/claims/pdas.js.map +1 -0
  18. package/dist/claims/tx.d.ts +47 -0
  19. package/dist/claims/tx.d.ts.map +1 -0
  20. package/dist/claims/tx.js +126 -0
  21. package/dist/claims/tx.js.map +1 -0
  22. package/dist/index.d.ts +27 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +40 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/instructions/cancel-launch.d.ts +16 -0
  27. package/dist/instructions/cancel-launch.d.ts.map +1 -0
  28. package/dist/instructions/cancel-launch.js +72 -0
  29. package/dist/instructions/cancel-launch.js.map +1 -0
  30. package/dist/instructions/configure-launch.d.ts +16 -0
  31. package/dist/instructions/configure-launch.d.ts.map +1 -0
  32. package/dist/instructions/configure-launch.js +50 -0
  33. package/dist/instructions/configure-launch.js.map +1 -0
  34. package/dist/instructions/constants.d.ts +8 -0
  35. package/dist/instructions/constants.d.ts.map +1 -0
  36. package/dist/instructions/constants.js +14 -0
  37. package/dist/instructions/constants.js.map +1 -0
  38. package/dist/instructions/create-launch-token.d.ts +18 -0
  39. package/dist/instructions/create-launch-token.d.ts.map +1 -0
  40. package/dist/instructions/create-launch-token.js +65 -0
  41. package/dist/instructions/create-launch-token.js.map +1 -0
  42. package/dist/instructions/execute-launch.d.ts +68 -0
  43. package/dist/instructions/execute-launch.d.ts.map +1 -0
  44. package/dist/instructions/execute-launch.js +190 -0
  45. package/dist/instructions/execute-launch.js.map +1 -0
  46. package/dist/instructions/index.d.ts +8 -0
  47. package/dist/instructions/index.d.ts.map +1 -0
  48. package/dist/instructions/index.js +57 -0
  49. package/dist/instructions/index.js.map +1 -0
  50. package/dist/instructions/initialize-launch.d.ts +15 -0
  51. package/dist/instructions/initialize-launch.d.ts.map +1 -0
  52. package/dist/instructions/initialize-launch.js +71 -0
  53. package/dist/instructions/initialize-launch.js.map +1 -0
  54. package/dist/instructions/pdas.d.ts +95 -0
  55. package/dist/instructions/pdas.d.ts.map +1 -0
  56. package/dist/instructions/pdas.js +168 -0
  57. package/dist/instructions/pdas.js.map +1 -0
  58. package/dist/pdas.d.ts +19 -0
  59. package/dist/pdas.d.ts.map +1 -0
  60. package/dist/pdas.js +40 -0
  61. package/dist/pdas.js.map +1 -0
  62. package/dist/sdk.d.ts +274 -0
  63. package/dist/sdk.d.ts.map +1 -0
  64. package/dist/sdk.js +505 -0
  65. package/dist/sdk.js.map +1 -0
  66. package/dist/types.d.ts +578 -0
  67. package/dist/types.d.ts.map +1 -0
  68. package/dist/types.js +8 -0
  69. package/dist/types.js.map +1 -0
  70. package/dist/zc/client.d.ts +69 -0
  71. package/dist/zc/client.d.ts.map +1 -0
  72. package/dist/zc/client.js +121 -0
  73. package/dist/zc/client.js.map +1 -0
  74. package/dist/zc/constants.d.ts +49 -0
  75. package/dist/zc/constants.d.ts.map +1 -0
  76. package/dist/zc/constants.js +64 -0
  77. package/dist/zc/constants.js.map +1 -0
  78. package/dist/zc/index.d.ts +4 -0
  79. package/dist/zc/index.d.ts.map +1 -0
  80. package/dist/zc/index.js +7 -0
  81. package/dist/zc/index.js.map +1 -0
  82. package/dist/zc/types.d.ts +65 -0
  83. package/dist/zc/types.d.ts.map +1 -0
  84. package/dist/zc/types.js +3 -0
  85. package/dist/zc/types.js.map +1 -0
  86. package/package.json +63 -0
@@ -0,0 +1,578 @@
1
+ import { Connection, PublicKey } from '@solana/web3.js';
2
+ import type BN from 'bn.js';
3
+ import type { HealthResponse } from './zc/client';
4
+ import type { PoolType, ReserveAdminParams, ReserveAdminResponse } from './zc/types';
5
+ export type LaunchpadCluster = 'devnet' | 'mainnet-beta' | 'testnet';
6
+ /**
7
+ * Base Launchpad SDK configuration.
8
+ */
9
+ export interface LaunchpadSDKConfig {
10
+ /** Solana RPC connection. */
11
+ connection: Connection;
12
+ /** Cluster used for ZC endpoint selection. Defaults to `devnet`. */
13
+ cluster?: LaunchpadCluster;
14
+ /** Override default DAMM program ID for advanced environments. */
15
+ dammProgramId?: PublicKey;
16
+ }
17
+ /**
18
+ * Launchpad SDK configuration that includes ZC API credentials.
19
+ */
20
+ export interface LaunchpadSDKFullConfig extends LaunchpadSDKConfig {
21
+ /** ZC API key for `POST /dao/reserve-admin`. */
22
+ zcApiKey: string;
23
+ /** Optional override for ZC API endpoint. */
24
+ zcApiEndpoint?: string;
25
+ }
26
+ /**
27
+ * SDK configuration without ZC credentials.
28
+ * Useful when only deterministic derivation helpers are needed.
29
+ */
30
+ export type LaunchpadSDKReadonlyConfig = LaunchpadSDKConfig;
31
+ /**
32
+ * Canonical input for deterministic DAMM pool PDA derivation.
33
+ */
34
+ export interface DerivePoolAddressInput {
35
+ /** Base mint (token being launched). */
36
+ baseMint: PublicKey;
37
+ /** Quote mint (SOL/USDC). */
38
+ quoteMint: PublicKey;
39
+ /** DAMM config PDA. */
40
+ config: PublicKey;
41
+ }
42
+ /**
43
+ * User-friendly pool derivation input where `config` is optional.
44
+ */
45
+ export interface DerivePoolAddressRequest {
46
+ baseMint: PublicKey;
47
+ quoteMint: PublicKey;
48
+ config?: PublicKey;
49
+ }
50
+ /**
51
+ * Output of deterministic pool derivation.
52
+ */
53
+ export interface DerivePoolAddressResult {
54
+ poolAddress: PublicKey;
55
+ tokenA: PublicKey;
56
+ tokenB: PublicKey;
57
+ config: PublicKey;
58
+ }
59
+ /**
60
+ * Input used to build `reserve-admin` request payload.
61
+ */
62
+ export interface BuildReserveAdminParamsInput {
63
+ /** DAO name (<= 32 chars on ZC API). */
64
+ daoName: string;
65
+ /** Launch token mint (base mint). */
66
+ tokenMint: PublicKey;
67
+ /** Quote mint for pool and DAO context. */
68
+ quoteMint: PublicKey;
69
+ /** Treasury cosigner for futarchy setup. */
70
+ treasuryCosigner: PublicKey;
71
+ /** Project owner wallet (used for proposer bootstrap in ZC). */
72
+ ownerWallet: PublicKey;
73
+ /** Optional pool type. Defaults to `damm` in launchpad flow. */
74
+ poolType?: PoolType;
75
+ /**
76
+ * Optional precomputed pool address.
77
+ * If omitted, SDK derives from `tokenMint + quoteMint + poolConfig`.
78
+ */
79
+ poolAddress?: PublicKey;
80
+ /** Optional DAMM config PDA override for derivation. */
81
+ poolConfig?: PublicKey;
82
+ }
83
+ export interface BuildReserveAdminParamsResult {
84
+ reserveAdminParams: ReserveAdminParams;
85
+ poolAddress: PublicKey;
86
+ }
87
+ /**
88
+ * Pre-execution helper input:
89
+ * derive deterministic addresses + reserve admin in one call.
90
+ */
91
+ export interface PrepareLaunchExecutionRequest {
92
+ daoName: string;
93
+ tokenMint: PublicKey;
94
+ quoteMint: PublicKey;
95
+ treasuryCosigner: PublicKey;
96
+ ownerWallet: PublicKey;
97
+ poolType?: PoolType;
98
+ poolAddress?: PublicKey;
99
+ poolConfig?: PublicKey;
100
+ }
101
+ /**
102
+ * On-chain execute args shape, ready to map into Anchor method args.
103
+ * `newDaoAdmin` is passed as an account (not an arg) — it is the
104
+ * ZC-managed wallet that becomes the DAMM pool creator (LP NFT owner)
105
+ * and the futarchy DAO admin.
106
+ */
107
+ export interface ExecuteLaunchInstructionArgs {
108
+ daoName: string;
109
+ treasuryCosigner: PublicKey;
110
+ }
111
+ /**
112
+ * Accounts that the caller must supply alongside the args.
113
+ * `newDaoAdmin` was moved here from args because the DAMM CPI
114
+ * needs it as an account (pool `creator`), not just a pubkey.
115
+ */
116
+ export interface ExecuteLaunchAccounts {
117
+ /** ZC managed admin wallet — DAMM pool creator + futarchy DAO admin */
118
+ newDaoAdmin: PublicKey;
119
+ }
120
+ /**
121
+ * Input to build execute args from reservation output.
122
+ */
123
+ export interface BuildExecuteLaunchArgsInput {
124
+ daoName: string;
125
+ treasuryCosigner: PublicKey;
126
+ reservation: ReserveAdminResponse;
127
+ }
128
+ /**
129
+ * Full output of pre-execution preparation flow.
130
+ */
131
+ export interface PrepareLaunchExecutionResult {
132
+ cluster: LaunchpadCluster;
133
+ poolAddress: PublicKey;
134
+ reserveAdminParams: ReserveAdminParams;
135
+ reservation: ReserveAdminResponse;
136
+ executeLaunchArgs: ExecuteLaunchInstructionArgs;
137
+ executeLaunchAccounts: ExecuteLaunchAccounts;
138
+ }
139
+ /**
140
+ * Typed minimal launch context for logs and UIs.
141
+ */
142
+ export interface LaunchPreparationContext {
143
+ daoName: string;
144
+ tokenMint: PublicKey;
145
+ quoteMint: PublicKey;
146
+ poolAddress: PublicKey;
147
+ treasuryCosigner: PublicKey;
148
+ ownerWallet: PublicKey;
149
+ }
150
+ /**
151
+ * Input used for configure_launch metadata fields.
152
+ */
153
+ export interface ConfigureLaunchMetadataInput {
154
+ /** Token name (launchpad currently expects <= 32 chars). */
155
+ name: string;
156
+ /** Token symbol (launchpad currently expects <= 10 chars). */
157
+ symbol: string;
158
+ /** Metadata URI (launchpad currently expects <= 200 chars). */
159
+ uri: string;
160
+ }
161
+ /**
162
+ * Canonical shape returned by metadata helper before on-chain configure_launch.
163
+ */
164
+ export interface ConfigureLaunchMetadataArgs {
165
+ name: string;
166
+ symbol: string;
167
+ uri: string;
168
+ }
169
+ /**
170
+ * Optional JSON payload helper for off-chain metadata hosting.
171
+ * This is NOT uploaded by the SDK; caller uploads and then uses resulting URI.
172
+ */
173
+ export interface TokenMetadataJson {
174
+ name: string;
175
+ symbol: string;
176
+ description: string;
177
+ image?: string;
178
+ external_url?: string;
179
+ attributes?: Array<{
180
+ trait_type: string;
181
+ value: string | number | boolean;
182
+ }>;
183
+ }
184
+ export interface BuildTokenMetadataJsonInput {
185
+ name: string;
186
+ symbol: string;
187
+ description?: string;
188
+ image?: string;
189
+ externalUrl?: string;
190
+ attributes?: Array<{
191
+ traitType: string;
192
+ value: string | number | boolean;
193
+ }>;
194
+ }
195
+ export interface ValidationIssue {
196
+ code: 'INVALID_DAO_NAME' | 'INVALID_TOKEN_NAME' | 'INVALID_TOKEN_SYMBOL' | 'INVALID_TOKEN_URI';
197
+ message: string;
198
+ }
199
+ export interface ValidationResult {
200
+ ok: boolean;
201
+ issues: ValidationIssue[];
202
+ }
203
+ export type HealthCheckResult = HealthResponse;
204
+ /**
205
+ * LaunchState as returned by Anchor deserialization.
206
+ * Anchor represents enums as `{ variantName: {} }` objects.
207
+ */
208
+ export type LaunchStateJs = {
209
+ fundraiseActive: Record<string, never>;
210
+ } | {
211
+ readyToLaunch: Record<string, never>;
212
+ } | {
213
+ tokenCreated: Record<string, never>;
214
+ } | {
215
+ launched: Record<string, never>;
216
+ } | {
217
+ cancelled: Record<string, never>;
218
+ };
219
+ /** String discriminant for LaunchState. */
220
+ export type LaunchStateKey = 'fundraiseActive' | 'readyToLaunch' | 'tokenCreated' | 'launched' | 'cancelled';
221
+ /** Extract the discriminant key from a `LaunchStateJs` value. */
222
+ export declare function getLaunchStateKey(state: LaunchStateJs): LaunchStateKey;
223
+ /**
224
+ * Deserialized LaunchConfig account.
225
+ *
226
+ * Only includes fields needed for claim operations.
227
+ * Full LaunchConfig has many more fields for the admin flow.
228
+ */
229
+ export interface LaunchConfigAccount {
230
+ /** Creator who initialized the launch. */
231
+ creator: PublicKey;
232
+ /** Unique seed for this launch. */
233
+ seed: BN;
234
+ /** PDA bump. */
235
+ bump: number;
236
+ /** Launchpad signer PDA bump. */
237
+ launchpadSignerBump: number;
238
+ /** The vault program's StarVault account (fundraise state). */
239
+ fundraiseState: PublicKey;
240
+ /** Quote mint (wSOL or USDC). */
241
+ quoteMint: PublicKey;
242
+ totalSupply: BN;
243
+ tokensToParticipants: BN;
244
+ tokensToLiquidity: BN;
245
+ tokensToTeam: BN;
246
+ treasuryShareBps: number;
247
+ liquidityShareBps: number;
248
+ state: LaunchStateJs;
249
+ /** When pool trading + claims unlock (set in execute_launch). */
250
+ poolActivationTime: BN | null;
251
+ /** When execute_launch was called. */
252
+ executedAt: BN | null;
253
+ pool: PublicKey | null;
254
+ dao: PublicKey | null;
255
+ daoTreasury: PublicKey | null;
256
+ /** The vanity base mint (null until configure_launch). */
257
+ baseMint: PublicKey | null;
258
+ /** Token vault: ATA of launchpad_signer for base_mint. */
259
+ tokenVault: PublicKey | null;
260
+ /** Running total of tokens claimed across all users. */
261
+ totalClaimed: BN;
262
+ /** Allow additional fields from the full account. */
263
+ [key: string]: unknown;
264
+ }
265
+ /**
266
+ * Deserialized ClaimRecord account.
267
+ *
268
+ * PDA: `["claim", launch_config, user]`
269
+ */
270
+ export interface ClaimRecordAccount {
271
+ /** The launch this claim belongs to. */
272
+ launch: PublicKey;
273
+ /** The user who owns this claim. */
274
+ user: PublicKey;
275
+ /** Link to vault's DepositorRecord (for tier lookup). */
276
+ userRecord: PublicKey;
277
+ /** User's full token entitlement (cached on first claim). */
278
+ totalTokens: BN;
279
+ /** Running total of tokens the user has claimed. */
280
+ totalClaimed: BN;
281
+ /** Timestamp of the last claim. */
282
+ lastClaimAt: BN;
283
+ /** PDA bump. */
284
+ bump: number;
285
+ }
286
+ /**
287
+ * Minimal DepositorRecord shape (from vault program).
288
+ *
289
+ * We only use the fields needed for claim eligibility.
290
+ * The vault SDK has the full type.
291
+ */
292
+ export interface DepositorRecordRaw {
293
+ /** The depositor's wallet. */
294
+ depositor: PublicKey;
295
+ /** The vault this record belongs to. */
296
+ vault: PublicKey;
297
+ /** Vesting tier (0–6). */
298
+ tier: number;
299
+ /** Amount deposited (net of fees). */
300
+ amount: BN;
301
+ /**
302
+ * Allocated amount after tier-based calculation.
303
+ * Updated to reflect pro-rata allocation after excess refund.
304
+ * NOTE: Before excess refund, this equals `amount` (not the true allocation).
305
+ * Use `computeAllocatedAmount()` with vault tier data for accurate allocation.
306
+ */
307
+ finalAmount: BN;
308
+ /** Whether a full refund has been claimed. */
309
+ refunded: boolean;
310
+ /** Whether an excess refund has been claimed. */
311
+ excessRefunded: boolean;
312
+ bump: number;
313
+ }
314
+ /**
315
+ * Vault allocation data needed for accurate claim eligibility.
316
+ *
317
+ * These fields come from the vault's `StarVault` account and are required
318
+ * to compute the user's true allocated amount (mirroring on-chain
319
+ * `DepositorRecord::allocated_amount(&self, vault)`).
320
+ */
321
+ export interface VaultAllocationData {
322
+ /** Per-tier allocated amounts (from `tier_allocated` on StarVault). */
323
+ tierAllocated: BN[];
324
+ /** Snapshot of tier totals at allocation time (from `tier_totals_at_allocation`). */
325
+ tierTotalsAtAllocation: BN[];
326
+ /** Sum of all tier allocations (from `total_allocated`). */
327
+ totalAllocated: BN;
328
+ /** Whether allocations have been computed. */
329
+ allocationsCalculated: boolean;
330
+ }
331
+ /**
332
+ * All accounts needed for a `claim_tokens` instruction.
333
+ *
334
+ * Fully deterministic from `launchConfig` address + user wallet.
335
+ */
336
+ export interface ClaimAccountsResolved {
337
+ /** The claiming user (signer). */
338
+ user: PublicKey;
339
+ /** The launch config PDA. */
340
+ launchConfig: PublicKey;
341
+ /** The vault program's StarVault account. */
342
+ fundraiseState: PublicKey;
343
+ /** User's DepositorRecord in the vault program. */
344
+ userRecord: PublicKey;
345
+ /** User's ClaimRecord PDA (init_if_needed). */
346
+ claimRecord: PublicKey;
347
+ /** The launched token's mint. */
348
+ baseMint: PublicKey;
349
+ /** Token vault (ATA of launchpadSigner for baseMint). */
350
+ tokenVault: PublicKey;
351
+ /** User's ATA for the launched token. */
352
+ userTokenAta: PublicKey;
353
+ /** Launchpad signer PDA (signs transfers). */
354
+ launchpadSigner: PublicKey;
355
+ }
356
+ /**
357
+ * Options for building a `claim_tokens` transaction.
358
+ */
359
+ export interface ClaimTransactionOptions {
360
+ /** The user claiming tokens (wallet pubkey). */
361
+ user: PublicKey;
362
+ /** The launch config PDA address. */
363
+ launchConfig: PublicKey;
364
+ /** Pre-fetched LaunchConfig account data. */
365
+ launchConfigData: LaunchConfigAccount;
366
+ /** The vault program ID (needed for depositor record PDA). */
367
+ vaultProgramId: PublicKey;
368
+ /**
369
+ * Optional fee payer override (for sponsored/relay transactions).
370
+ *
371
+ * When set, the transaction `feePayer` is set to this pubkey instead
372
+ * of the user. The flow becomes:
373
+ * 1. Build TX with sponsor as feePayer
374
+ * 2. User signs to authorize the claim
375
+ * 3. Send serialized TX to relay service
376
+ * 4. Relay adds sponsor signature and submits
377
+ */
378
+ feePayer?: PublicKey;
379
+ /** Token program ID override (defaults to TOKEN_PROGRAM_ID). */
380
+ tokenProgramId?: PublicKey;
381
+ /** Compute unit limit for the transaction. */
382
+ computeUnits?: number;
383
+ /**
384
+ * Priority fee in micro-lamports per compute unit.
385
+ * Recommended during congestion for faster landing.
386
+ */
387
+ priorityFee?: number;
388
+ }
389
+ /**
390
+ * Comprehensive claim eligibility result.
391
+ *
392
+ * Computed from on-chain state — used by both frontend (for UI) and
393
+ * backend (for API responses). No RPC calls in the computation itself.
394
+ */
395
+ export interface ClaimEligibility {
396
+ /** Whether the user can claim right now. */
397
+ canClaim: boolean;
398
+ /**
399
+ * Human-readable reason when `canClaim` is false.
400
+ *
401
+ * - `launch_not_executed`: State is not `Launched`
402
+ * - `allocations_not_calculated`: Vault allocations not yet computed
403
+ * - `pool_activation_time_not_set`: No activation time on the config
404
+ * - `no_depositor_record`: User never deposited
405
+ * - `no_allocation`: User's allocation is zero
406
+ * - `claims_not_yet_active`: Pool activation time hasn't arrived
407
+ * - `fully_claimed`: All tokens already claimed
408
+ * - `nothing_new_vested`: No new tokens vested since last claim
409
+ */
410
+ reason: ClaimIneligibilityReason | null;
411
+ /** Amount claimable right now (vested - already claimed). */
412
+ claimableNow: BN;
413
+ /** User's total token entitlement. */
414
+ totalTokens: BN;
415
+ /** Total tokens already claimed by this user. */
416
+ totalClaimed: BN;
417
+ /** Total tokens vested as of the current time. */
418
+ totalVested: BN;
419
+ /** User's vesting tier (null if no depositor record). */
420
+ tier: number | null;
421
+ /** Vesting schedule details (null if not applicable). */
422
+ vestingSchedule: VestingSchedule | null;
423
+ }
424
+ export type ClaimIneligibilityReason = 'launch_not_executed' | 'allocations_not_calculated' | 'pool_activation_time_not_set' | 'no_depositor_record' | 'no_allocation' | 'claims_not_yet_active' | 'fully_claimed' | 'nothing_new_vested';
425
+ /**
426
+ * Vesting schedule info for display in UIs.
427
+ */
428
+ export interface VestingSchedule {
429
+ /** Vesting tier (0–6). */
430
+ tier: number;
431
+ /** Total vesting duration in seconds (0 for tier 0). */
432
+ vestingDurationSeconds: number;
433
+ /** Unix timestamp when vesting starts (= pool activation time). */
434
+ vestingStartTimestamp: number;
435
+ /** Unix timestamp when vesting ends (= start + duration). */
436
+ vestingEndTimestamp: number;
437
+ /** Percentage of tokens currently vested (0–100). */
438
+ percentVested: number;
439
+ /** Whether all tokens are fully vested. */
440
+ fullyVested: boolean;
441
+ }
442
+ /** Shared options for compute budget across all instruction TX builders. */
443
+ export interface TxBuildOptions {
444
+ /** Override fee payer (for sponsored/relay transactions). */
445
+ feePayer?: PublicKey;
446
+ /** Compute unit limit. */
447
+ computeUnits?: number;
448
+ /** Priority fee in micro-lamports per CU. */
449
+ priorityFee?: number;
450
+ }
451
+ /**
452
+ * Options for building an `initialize_launch` transaction.
453
+ *
454
+ * Creates a LaunchConfig + underlying vault via CPI to vault::make.
455
+ */
456
+ export interface InitializeLaunchOptions extends TxBuildOptions {
457
+ /** Creator wallet (signer, pays rent). */
458
+ creator: PublicKey;
459
+ /** Unique seed for the launch PDA. */
460
+ seed: BN;
461
+ /** Seed for the vault PDA (passed to vault::make). */
462
+ vaultSeed: BN;
463
+ /** Total token supply to mint. */
464
+ totalSupply: BN;
465
+ /** Tokens allocated to fundraise participants. */
466
+ tokensToParticipants: BN;
467
+ /** Quote mint (wSOL or USDC). */
468
+ quoteMint: PublicKey;
469
+ /** Minimum fundraise target. */
470
+ minRaise: BN;
471
+ /** Target fundraise amount. */
472
+ targetRaise: BN;
473
+ /** Fundraise start time (unix timestamp). */
474
+ startTime: BN;
475
+ /** Fundraise end time (unix timestamp). */
476
+ endTime: BN;
477
+ /** Vault program ID. */
478
+ vaultProgramId: PublicKey;
479
+ }
480
+ /**
481
+ * Options for building a `configure_launch` transaction.
482
+ *
483
+ * Sets vanity mint config + token metadata. Transitions FundraiseActive → ReadyToLaunch.
484
+ */
485
+ export interface ConfigureLaunchOptions extends TxBuildOptions {
486
+ /** Platform admin wallet (signer). */
487
+ admin: PublicKey;
488
+ /** The launch config PDA address. */
489
+ launchConfig: PublicKey;
490
+ /** The vault account (fundraise state). */
491
+ fundraiseState: PublicKey;
492
+ /** Base keypair public key (used for vanity mint derivation). */
493
+ basePubkey: PublicKey;
494
+ /** Seed string for createAccountWithSeed (up to 32 bytes). */
495
+ vanitySeed: string;
496
+ /** The expected derived mint address. */
497
+ expectedMint: PublicKey;
498
+ /** Token name (max 32 chars). */
499
+ name: string;
500
+ /** Token symbol (max 10 chars). */
501
+ symbol: string;
502
+ /** Token metadata URI (max 200 chars). */
503
+ uri: string;
504
+ }
505
+ /**
506
+ * Options for building a `create_launch_token` transaction.
507
+ *
508
+ * Creates the vanity mint, Metaplex metadata, and mints total supply.
509
+ * Transitions ReadyToLaunch → TokenCreated.
510
+ */
511
+ export interface CreateLaunchTokenOptions extends TxBuildOptions {
512
+ /** Platform admin wallet (signer, pays rent). */
513
+ admin: PublicKey;
514
+ /** Base keypair public key (must also sign the TX). */
515
+ baseKeypairPubkey: PublicKey;
516
+ /** The launch config PDA address. */
517
+ launchConfig: PublicKey;
518
+ /** The expected vanity mint address. */
519
+ expectedMint: PublicKey;
520
+ /** Metaplex program ID override. */
521
+ metaplexProgramId?: PublicKey;
522
+ }
523
+ /**
524
+ * Options for building an `execute_launch` transaction.
525
+ *
526
+ * This is the most complex instruction — atomically finalizes the vault,
527
+ * creates DAMM pool, creates DAO, transfers authorities, and routes funds.
528
+ * Transitions TokenCreated → Launched.
529
+ */
530
+ export interface ExecuteLaunchOptions extends TxBuildOptions {
531
+ /** Platform admin wallet (signer, pays rent). */
532
+ admin: PublicKey;
533
+ /** The launch config PDA address. */
534
+ launchConfig: PublicKey;
535
+ /** Pre-fetched LaunchConfig account data. */
536
+ launchConfigData: LaunchConfigAccount;
537
+ /** Pool activation time (unix timestamp). */
538
+ poolActivationTime: BN;
539
+ /** DAO name for futarchy (max 32 chars). */
540
+ daoName: string;
541
+ /** Treasury cosigner pubkey for the DAO. */
542
+ treasuryCosigner: PublicKey;
543
+ /** ZC-managed admin wallet (from reserveAdmin response). */
544
+ newDaoAdmin: PublicKey;
545
+ /** DAMM pool address (pre-derived). */
546
+ dammPool: PublicKey;
547
+ /** Vault program ID. */
548
+ vaultProgramId: PublicKey;
549
+ /** DAMM program ID override. */
550
+ dammProgramId?: PublicKey;
551
+ /** Futarchy program ID override. */
552
+ futarchyProgramId?: PublicKey;
553
+ /** Squads program ID override. */
554
+ squadsProgramId?: PublicKey;
555
+ /** Metaplex program ID override. */
556
+ metaplexProgramId?: PublicKey;
557
+ /** Token program ID override (defaults to TOKEN_PROGRAM_ID). */
558
+ tokenProgramId?: PublicKey;
559
+ }
560
+ /**
561
+ * Options for building a `cancel_launch` transaction.
562
+ *
563
+ * Cancels a launch from any pre-Launched state.
564
+ * Burns tokens if minted, enables refunds on the vault.
565
+ */
566
+ export interface CancelLaunchOptions extends TxBuildOptions {
567
+ /** Platform admin wallet (signer). */
568
+ admin: PublicKey;
569
+ /** The launch config PDA address. */
570
+ launchConfig: PublicKey;
571
+ /** Pre-fetched LaunchConfig account data. */
572
+ launchConfigData: LaunchConfigAccount;
573
+ /** Vault program ID. */
574
+ vaultProgramId: PublicKey;
575
+ /** Token program ID override (defaults to TOKEN_PROGRAM_ID). */
576
+ tokenProgramId?: PublicKey;
577
+ }
578
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAMrF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAC;AAMrE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6BAA6B;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,oEAAoE;IACpE,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,kEAAkE;IAClE,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAM5D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,6BAA6B;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,uBAAuB;IACvB,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EA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D,sCAAsC;IACtC,KAAK,EAAE,SAAS,CAAC;IACjB,qCAAqC;IACrC,YAAY,EAAE,SAAS,CAAC;IACxB,6CAA6C;IAC7C,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,wBAAwB;IACxB,cAAc,EAAE,SAAS,CAAC;IAC1B,gEAAgE;IAChE,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B"}
package/dist/types.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLaunchStateKey = getLaunchStateKey;
4
+ /** Extract the discriminant key from a `LaunchStateJs` value. */
5
+ function getLaunchStateKey(state) {
6
+ return Object.keys(state)[0];
7
+ }
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AAoRA,8CAEC;AAHD,iEAAiE;AACjE,SAAgB,iBAAiB,CAAC,KAAoB;IACpD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAmB,CAAC;AACjD,CAAC"}
@@ -0,0 +1,69 @@
1
+ import { ReserveAdminParams, ReserveAdminResponse, ZCClientConfig } from './types';
2
+ /**
3
+ * zCombinator API Client - Off-Chain Operations
4
+ *
5
+ * Handles the off-chain DAO reservation step via ZC's REST API.
6
+ *
7
+ * @see https://docs.combinator.trade/llms.txt
8
+ * @see https://github.com/zcombinatorio/combinator/blob/main/ui/routes/dao/creation.ts
9
+ */
10
+ export declare class ZCClient {
11
+ readonly apiKey: string;
12
+ readonly cluster: 'devnet' | 'mainnet-beta' | 'testnet';
13
+ readonly apiEndpoint: string;
14
+ constructor(config: ZCClientConfig);
15
+ /**
16
+ * Check API server health status.
17
+ *
18
+ * @see https://docs.combinator.trade/api-reference/health
19
+ * @returns Health status and environment configuration
20
+ */
21
+ health(): Promise<HealthResponse>;
22
+ /**
23
+ * Reserve an admin key for external DAO creation.
24
+ *
25
+ * This is an OFF-CHAIN API call to ZC that:
26
+ * 1. Allocates a managed admin wallet from ZC's key service
27
+ * 2. Creates an optimistic DAO entry in ZC's database
28
+ * 3. Returns the admin wallet to use in transferAdmin IX
29
+ *
30
+ * PREREQUISITES (must be derived BEFORE calling this):
31
+ * - tokenMint: the vanity mint address (from grinding)
32
+ * - poolAddress: derived from (baseMint, quoteMint, DAMM_CONFIG)
33
+ *
34
+ * After calling this, build your atomic transaction with:
35
+ * 1. Token launch instructions
36
+ * 2. Pool launch instructions
37
+ * 3. DAO creation (with launchpad PDA as temp admin)
38
+ * 4. transferAdmin to ZC's managed admin (from this response)
39
+ * 5. LP transfer to ZC's admin
40
+ *
41
+ * @param params - Reservation parameters
42
+ * @returns Response with admin wallet, key index, and DAO ID
43
+ *
44
+ * @see https://github.com/zcombinatorio/combinator/blob/main/ui/routes/dao/creation.ts
45
+ */
46
+ reserveAdmin(params: ReserveAdminParams): Promise<ReserveAdminResponse>;
47
+ }
48
+ /**
49
+ * Health check response
50
+ */
51
+ export interface HealthResponse {
52
+ status: 'healthy';
53
+ timestamp: string;
54
+ environment: {
55
+ hasRPC: boolean;
56
+ hasConfig: boolean;
57
+ hasPinata: boolean;
58
+ hasStorage: boolean;
59
+ };
60
+ }
61
+ /**
62
+ * Error thrown by ZC API calls
63
+ */
64
+ export declare class ZCApiError extends Error {
65
+ readonly statusCode: number;
66
+ readonly apiError: string;
67
+ constructor(message: string, statusCode: number, apiError: string);
68
+ }
69
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/zc/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACjB,MAAM,SAAS,CAAC;AAEjB;;;;;;;GAOG;AACH,qBAAa,QAAQ;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,MAAM,EAAE,cAAc;IAUlC;;;;;OAKG;IACG,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;IAmBvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA8C9E;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE;QACX,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,EAAE,OAAO,CAAC;QACnB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAGjB,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;gBAFhC,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;CAKnC"}