@star-factory/sdk-launchpad 0.1.0 → 0.1.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/README.md CHANGED
@@ -17,13 +17,19 @@ Peer dependency: `typescript@^5`.
17
17
  ## Quick Start
18
18
 
19
19
  ```typescript
20
- import { LaunchpadSDK } from '@star-factory/sdk-launchpad';
20
+ import {
21
+ getLaunchpadProgram,
22
+ LAUNCHPAD_PROGRAM_ID,
23
+ LaunchpadSDK,
24
+ } from '@star-factory/sdk-launchpad';
21
25
 
22
26
  const sdk = new LaunchpadSDK({
23
27
  connection,
24
28
  cluster: 'devnet',
25
29
  zcApiKey: process.env.ZC_API_KEY!,
26
30
  });
31
+
32
+ const launchpadProgram = getLaunchpadProgram(connection, LAUNCHPAD_PROGRAM_ID);
27
33
  ```
28
34
 
29
35
  ---
@@ -44,13 +50,18 @@ const tx = await sdk.buildInitializeLaunchTx(launchpadProgram, {
44
50
  quoteMint: NATIVE_MINT,
45
51
  minRaise: new BN('100000000'),
46
52
  targetRaise: new BN('100000000'),
47
- startTime: new BN(now - 5),
48
- endTime: new BN(now + 300),
53
+ // IMPORTANT: unix seconds (not milliseconds)
54
+ startTime: new BN(nowSec + 60), // starts in 1 minute
55
+ endTime: new BN(nowSec + 4 * 24 * 60 * 60), // 4-day raise window
49
56
  vaultProgramId: VAULT_PROGRAM_ID,
50
57
  });
51
58
  await sendTx(tx, [creator]);
52
59
  ```
53
60
 
61
+ ```typescript
62
+ const nowSec = Math.floor(Date.now() / 1000);
63
+ ```
64
+
54
65
  ### 2. Configure Launch
55
66
 
56
67
  Sets vanity mint configuration and token metadata. Transitions `FundraiseActive → ReadyToLaunch`.
@@ -242,6 +253,7 @@ Every building block is exported individually:
242
253
  ```typescript
243
254
  import {
244
255
  // Instruction TX builders
256
+ getLaunchpadProgram,
245
257
  buildInitializeLaunchTx,
246
258
  buildConfigureLaunchTx,
247
259
  buildCreateLaunchTokenTx,
@@ -292,6 +304,8 @@ import {
292
304
  computeVestedAmount,
293
305
 
294
306
  // Constants
307
+ LAUNCHPAD_PROGRAM_ID,
308
+ LAUNCHPAD_IDL,
295
309
  NUM_TIERS,
296
310
  TIER_VESTING_SECONDS,
297
311
  TIER_VESTING_WEEKS,
@@ -312,8 +326,11 @@ import {
312
326
  ```
313
327
  sdk-launchpad/src/
314
328
  ├── index.ts Barrel exports
329
+ ├── program.ts getLaunchpadProgram() helper + typed program client
315
330
  ├── sdk.ts LaunchpadSDK class (high-level API)
316
331
  ├── types.ts All TypeScript interfaces and types
332
+ ├── idl/
333
+ │ └── launchpad.json Bundled launchpad IDL (copied to dist on build)
317
334
  ├── pdas.ts DAMM pool PDA derivation
318
335
  ├── instructions/
319
336
  │ ├── pdas.ts External program PDAs (DAMM, Squads, Futarchy, Metaplex, Vault)
@@ -0,0 +1,2 @@
1
+ export declare const LAUNCHPAD_IDL: any;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/idl/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,KAA8B,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LAUNCHPAD_IDL = void 0;
4
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
5
+ exports.LAUNCHPAD_IDL = require('./launchpad.json');
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/idl/index.ts"],"names":[],"mappings":";;;AAAA,8DAA8D;AACjD,QAAA,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC"}