proof-of-take-sdk 5.0.9 → 5.0.11

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.
@@ -33,13 +33,8 @@ async function joinSeason(options) {
33
33
  const program = (0, programHelpers_1.getProgram)(options.connection);
34
34
  const tokenMint = options.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
35
35
  const launchpad = options.launchpad ?? false;
36
- const pdasBase = pdaManager_1.PDAManager.deriveJoinSeasonPdas({
37
- user: options.user,
38
- seasonNumber: options.seasonNumber,
39
- tier: options.tier,
40
- tokenMint,
41
- });
42
- // Auto-generate keypair for launchpad mode when moonpool is being initialized
36
+ // Determine launchpadTokenMint FIRST (before deriving PDAs)
37
+ // For BOTH launchpad and classic mode, Season/SeasonMembership PDAs are scoped to launchpadTokenMint
43
38
  let launchpadTokenMintKeypair;
44
39
  let launchpadTokenMintPubkey;
45
40
  if (launchpad) {
@@ -68,9 +63,20 @@ async function joinSeason(options) {
68
63
  }
69
64
  }
70
65
  else {
71
- // Non-launchpad mode, use PDA
72
- launchpadTokenMintPubkey = pdasBase.launchpadTokenMint;
66
+ // Classic mode: use the launchpad token mint PDA derived from tokenMint
67
+ // The on-chain program expects launchpad_token_mint.key() for Season/SeasonMembership PDAs
68
+ const [launchpadMintPda] = (0, pdas_1.getLaunchpadTokenMintPda)(tokenMint);
69
+ launchpadTokenMintPubkey = launchpadMintPda;
73
70
  }
71
+ // Derive PDAs with launchpadTokenMint for BOTH modes
72
+ // Season/SeasonMembership PDAs are always scoped to launchpadTokenMint
73
+ const pdasBase = pdaManager_1.PDAManager.deriveJoinSeasonPdas({
74
+ user: options.user,
75
+ seasonNumber: options.seasonNumber,
76
+ tier: options.tier,
77
+ tokenMint,
78
+ launchpadTokenMint: launchpadTokenMintPubkey,
79
+ });
74
80
  // Derive Moonpool and Treasury PDAs using the launchpadTokenMint
75
81
  const [moonpoolPda] = (0, pdas_1.getMoonpoolPda)(launchpadTokenMintPubkey);
76
82
  const [moonpoolTreasuryPda] = (0, pdas_1.getMoonpoolTreasuryPda)(launchpadTokenMintPubkey);