proof-of-take-sdk 5.0.5 → 5.0.7

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.
@@ -311,12 +311,17 @@
311
311
  "name": "referral_penalty_claim",
312
312
  "writable": true
313
313
  },
314
+ {
315
+ "name": "launchpad_token_mint",
316
+ "docs": [
317
+ "Required for PDA derivation. Validated by Moonpool seeds constraint."
318
+ ]
319
+ },
314
320
  {
315
321
  "name": "moonpool",
316
322
  "docs": [
317
- "Global Moonpool PDA (required when `season.is_moonpool()`).",
318
- "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).",
319
- "Shared across all seasons for this token mint."
323
+ "Moonpool PDA - unique per launchpad_token_mint (required when `season.is_moonpool()`).",
324
+ "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens)."
320
325
  ],
321
326
  "writable": true,
322
327
  "optional": true,
@@ -337,7 +342,7 @@
337
342
  },
338
343
  {
339
344
  "kind": "account",
340
- "path": "token_mint"
345
+ "path": "launchpad_token_mint"
341
346
  },
342
347
  {
343
348
  "kind": "const",
@@ -358,7 +363,7 @@
358
363
  {
359
364
  "name": "moonpool_treasury",
360
365
  "docs": [
361
- "Shared across all seasons for this token mint.",
366
+ "Unique per launchpad_token_mint.",
362
367
  "",
363
368
  "Safety:",
364
369
  "- Address is constrained by PDA seeds.",
@@ -393,7 +398,7 @@
393
398
  },
394
399
  {
395
400
  "kind": "account",
396
- "path": "token_mint"
401
+ "path": "launchpad_token_mint"
397
402
  },
398
403
  {
399
404
  "kind": "const",
@@ -664,12 +669,17 @@
664
669
  ]
665
670
  }
666
671
  },
672
+ {
673
+ "name": "launchpad_token_mint",
674
+ "docs": [
675
+ "Required for PDA derivation. Validated by Moonpool seeds constraint."
676
+ ]
677
+ },
667
678
  {
668
679
  "name": "moonpool",
669
680
  "docs": [
670
- "Global Moonpool PDA (required when `season.is_moonpool()`).",
671
- "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).",
672
- "Shared across all seasons for this token mint."
681
+ "Moonpool PDA - unique per launchpad_token_mint (required when `season.is_moonpool()`).",
682
+ "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens)."
673
683
  ],
674
684
  "writable": true,
675
685
  "optional": true,
@@ -690,7 +700,7 @@
690
700
  },
691
701
  {
692
702
  "kind": "account",
693
- "path": "token_mint"
703
+ "path": "launchpad_token_mint"
694
704
  },
695
705
  {
696
706
  "kind": "const",
@@ -711,7 +721,7 @@
711
721
  {
712
722
  "name": "moonpool_treasury",
713
723
  "docs": [
714
- "Shared across all seasons for this token mint.",
724
+ "Unique per launchpad_token_mint.",
715
725
  "",
716
726
  "Safety:",
717
727
  "- Address is constrained by PDA seeds.",
@@ -746,7 +756,7 @@
746
756
  },
747
757
  {
748
758
  "kind": "account",
749
- "path": "token_mint"
759
+ "path": "launchpad_token_mint"
750
760
  },
751
761
  {
752
762
  "kind": "const",
@@ -1093,12 +1103,17 @@
1093
1103
  "name": "season_membership",
1094
1104
  "writable": true
1095
1105
  },
1106
+ {
1107
+ "name": "launchpad_token_mint",
1108
+ "docs": [
1109
+ "Required for PDA derivation. Validated by Moonpool seeds constraint."
1110
+ ]
1111
+ },
1096
1112
  {
1097
1113
  "name": "moonpool",
1098
1114
  "docs": [
1099
- "Global Moonpool PDA (required when `season.is_moonpool()`).",
1100
- "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).",
1101
- "Shared across all seasons for this token mint."
1115
+ "Moonpool PDA - unique per launchpad_token_mint (required when `season.is_moonpool()`).",
1116
+ "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens)."
1102
1117
  ],
1103
1118
  "writable": true,
1104
1119
  "optional": true,
@@ -1119,7 +1134,7 @@
1119
1134
  },
1120
1135
  {
1121
1136
  "kind": "account",
1122
- "path": "token_mint"
1137
+ "path": "launchpad_token_mint"
1123
1138
  },
1124
1139
  {
1125
1140
  "kind": "const",
@@ -1140,7 +1155,7 @@
1140
1155
  {
1141
1156
  "name": "moonpool_treasury",
1142
1157
  "docs": [
1143
- "Shared across all seasons for this token mint.",
1158
+ "Unique per launchpad_token_mint.",
1144
1159
  "",
1145
1160
  "Safety:",
1146
1161
  "- Address is constrained by PDA seeds.",
@@ -1175,7 +1190,7 @@
1175
1190
  },
1176
1191
  {
1177
1192
  "kind": "account",
1178
- "path": "token_mint"
1193
+ "path": "launchpad_token_mint"
1179
1194
  },
1180
1195
  {
1181
1196
  "kind": "const",
@@ -2921,10 +2936,13 @@
2921
2936
  {
2922
2937
  "name": "moonpool",
2923
2938
  "docs": [
2924
- "Global Moonpool PDA (shared across all seasons for this token mint).",
2939
+ "Moonpool PDA - unique per launchpad_token_mint.",
2925
2940
  "The Moonpool is the Moon's seesaw for buying and selling stars (real SPL Token-2022 tokens).",
2926
2941
  "Contains reserve state for the constant-product AMM.",
2927
2942
  "",
2943
+ "Each unique launchpad_token_mint creates a unique Moonpool, allowing multiple \"Stars\"",
2944
+ "to coexist for the same token_mint.",
2945
+ "",
2928
2946
  "SECURITY: This account is MANDATORY (not optional) to prevent bypassing the",
2929
2947
  "launchpad mode check. If a previous season was launchpad mode, subsequent",
2930
2948
  "seasons MUST also be launchpad mode - we enforce this by always checking",
@@ -2948,7 +2966,7 @@
2948
2966
  },
2949
2967
  {
2950
2968
  "kind": "account",
2951
- "path": "token_mint"
2969
+ "path": "launchpad_token_mint"
2952
2970
  },
2953
2971
  {
2954
2972
  "kind": "const",
@@ -2969,7 +2987,7 @@
2969
2987
  {
2970
2988
  "name": "moonpool_treasury",
2971
2989
  "docs": [
2972
- "Shared across all seasons for this token mint.",
2990
+ "Unique per launchpad_token_mint, paired with its corresponding Moonpool.",
2973
2991
  "",
2974
2992
  "SECURITY: This account is MANDATORY alongside the pool to ensure consistent",
2975
2993
  "mode validation across seasons.",
@@ -3006,7 +3024,7 @@
3006
3024
  },
3007
3025
  {
3008
3026
  "kind": "account",
3009
- "path": "token_mint"
3027
+ "path": "launchpad_token_mint"
3010
3028
  },
3011
3029
  {
3012
3030
  "kind": "const",
@@ -3530,6 +3548,10 @@
3530
3548
  {
3531
3549
  "name": "symbol",
3532
3550
  "type": "string"
3551
+ },
3552
+ {
3553
+ "name": "force_new_launchpad_mint",
3554
+ "type": "bool"
3533
3555
  }
3534
3556
  ]
3535
3557
  },
@@ -12,6 +12,11 @@ export interface ClaimReferralPenaltyForWindowOptions {
12
12
  seasonNumber: BN;
13
13
  /** Token mint this season is scoped to (used for PDA derivation). Defaults to MIZD_TOKEN_MINT. */
14
14
  tokenMint?: PublicKey;
15
+ /**
16
+ * SPL Token-2022 mint for the launchpad token (required for launchpad mode).
17
+ * Used for PDA derivation of moonpool and treasury.
18
+ */
19
+ launchpadTokenMint: PublicKey;
15
20
  windowNumber: WindowNumberLike;
16
21
  /** Tier number: 0=copper, 1=silver, 2=gold, 3=platinum, 4=mithril */
17
22
  tier: TierNumber;
@@ -7,6 +7,7 @@ const anchor_1 = require("@coral-xyz/anchor");
7
7
  const web3_js_1 = require("@solana/web3.js");
8
8
  const spl_token_1 = require("@solana/spl-token");
9
9
  const pdaManager_1 = require("../utils/pdaManager");
10
+ const pdas_1 = require("../utils/pdas");
10
11
  const constants_1 = require("../utils/constants");
11
12
  const programHelpers_1 = require("../utils/programHelpers");
12
13
  const signerHelpers_1 = require("../utils/signerHelpers");
@@ -25,14 +26,18 @@ async function claimReferralPenaltyForWindow(options) {
25
26
  tier: options.tier,
26
27
  tokenMint,
27
28
  });
29
+ // Derive Moonpool and Treasury PDAs using the launchpadTokenMint
30
+ const [moonpoolPda] = (0, pdas_1.getMoonpoolPda)(options.launchpadTokenMint);
31
+ const [moonpoolTreasuryPda] = (0, pdas_1.getMoonpoolTreasuryPda)(options.launchpadTokenMint);
28
32
  const accounts = {
29
33
  seasonSettings: pdas.seasonSettings,
30
34
  season: pdas.season,
31
35
  seasonMembership: pdas.seasonMembership,
32
36
  userWindowParticipation: pdas.userWindowParticipation,
33
37
  referralPenaltyClaim: pdas.referralPenaltyClaim,
34
- moonpool: launchpad ? pdas.moonpool : null,
35
- moonpoolTreasury: launchpad ? pdas.moonpoolTreasury : null,
38
+ launchpadTokenMint: options.launchpadTokenMint,
39
+ moonpool: launchpad ? moonpoolPda : null,
40
+ moonpoolTreasury: launchpad ? moonpoolTreasuryPda : null,
36
41
  seasonDepositVault: launchpad ? null : pdas.seasonDepositVault,
37
42
  mizdMint: constants_1.MIZD_TOKEN_MINT,
38
43
  tokenMint,
@@ -18,6 +18,11 @@ export interface ClaimSignupRewardsOptions {
18
18
  seasonNumber: BN;
19
19
  /** Token mint this season is scoped to (used for PDA derivation). Defaults to MIZD_TOKEN_MINT. */
20
20
  tokenMint?: PublicKey;
21
+ /**
22
+ * SPL Token-2022 mint for the launchpad token (required for launchpad mode).
23
+ * Used for PDA derivation of moonpool and treasury.
24
+ */
25
+ launchpadTokenMint: PublicKey;
21
26
  /** Tier number: 0=copper, 1=silver, 2=gold, 3=platinum, 4=mithril */
22
27
  tier: TierNumber;
23
28
  /** If true, claim uses launchpad mode (SOL payout; token accounts can be omitted). */
@@ -7,6 +7,7 @@ const anchor_1 = require("@coral-xyz/anchor");
7
7
  const web3_js_1 = require("@solana/web3.js");
8
8
  const spl_token_1 = require("@solana/spl-token");
9
9
  const pdaManager_1 = require("../utils/pdaManager");
10
+ const pdas_1 = require("../utils/pdas");
10
11
  const constants_1 = require("../utils/constants");
11
12
  const programHelpers_1 = require("../utils/programHelpers");
12
13
  const signerHelpers_1 = require("../utils/signerHelpers");
@@ -34,11 +35,15 @@ async function claimSignupRewards(options) {
34
35
  const userMizdAta = launchpad
35
36
  ? null
36
37
  : (0, spl_token_1.getAssociatedTokenAddressSync)(constants_1.MIZD_TOKEN_MINT, options.user);
38
+ // Derive Moonpool and Treasury PDAs using the launchpadTokenMint
39
+ const [moonpoolPda] = (0, pdas_1.getMoonpoolPda)(options.launchpadTokenMint);
40
+ const [moonpoolTreasuryPda] = (0, pdas_1.getMoonpoolTreasuryPda)(options.launchpadTokenMint);
37
41
  const accounts = {
38
42
  seasonMembership: pdas.seasonMembership,
39
43
  season: pdas.season,
40
- moonpool: launchpad ? pdas.moonpool : null,
41
- moonpoolTreasury: launchpad ? pdas.moonpoolTreasury : null,
44
+ launchpadTokenMint: options.launchpadTokenMint,
45
+ moonpool: launchpad ? moonpoolPda : null,
46
+ moonpoolTreasury: launchpad ? moonpoolTreasuryPda : null,
42
47
  signupRewardsPda: pdas.signupRewardsPda,
43
48
  signupRewardsMizdAta,
44
49
  mizdMint: constants_1.MIZD_TOKEN_MINT,
@@ -29,6 +29,11 @@ export interface ClaimWindowRewardsOptions {
29
29
  seasonNumber: BN;
30
30
  /** Token mint this season is scoped to (used for PDA derivation). Defaults to MIZD_TOKEN_MINT. */
31
31
  tokenMint?: PublicKey;
32
+ /**
33
+ * SPL Token-2022 mint for the launchpad token (required for launchpad mode).
34
+ * Used for PDA derivation of moonpool and treasury.
35
+ */
36
+ launchpadTokenMint: PublicKey;
32
37
  windowNumber: WindowNumberLike;
33
38
  /** Tier number: 0=copper, 1=silver, 2=gold, 3=platinum, 4=mithril */
34
39
  tier: TierNumber;
@@ -7,6 +7,7 @@ const anchor_1 = require("@coral-xyz/anchor");
7
7
  const spl_token_1 = require("@solana/spl-token");
8
8
  const web3_js_1 = require("@solana/web3.js");
9
9
  const pdaManager_1 = require("../utils/pdaManager");
10
+ const pdas_1 = require("../utils/pdas");
10
11
  const constants_1 = require("../utils/constants");
11
12
  const programHelpers_1 = require("../utils/programHelpers");
12
13
  const signerHelpers_1 = require("../utils/signerHelpers");
@@ -34,14 +35,18 @@ async function claimWindowRewards(options) {
34
35
  tier: options.tier,
35
36
  tokenMint,
36
37
  });
38
+ // Derive Moonpool and Treasury PDAs using the launchpadTokenMint
39
+ const [moonpoolPda] = (0, pdas_1.getMoonpoolPda)(options.launchpadTokenMint);
40
+ const [moonpoolTreasuryPda] = (0, pdas_1.getMoonpoolTreasuryPda)(options.launchpadTokenMint);
37
41
  const accounts = {
38
42
  seasonSettings: pdas.seasonSettings,
39
43
  season: pdas.season,
40
44
  rewardWindow: pdas.rewardWindow,
41
45
  userWindowParticipation: pdas.userWindowParticipation,
42
46
  seasonMembership: pdas.seasonMembership,
43
- moonpool: launchpad ? pdas.moonpool : null,
44
- moonpoolTreasury: launchpad ? pdas.moonpoolTreasury : null,
47
+ launchpadTokenMint: options.launchpadTokenMint,
48
+ moonpool: launchpad ? moonpoolPda : null,
49
+ moonpoolTreasury: launchpad ? moonpoolTreasuryPda : null,
45
50
  seasonDepositVault: launchpad ? null : pdas.seasonDepositVault,
46
51
  mizdMint: constants_1.MIZD_TOKEN_MINT,
47
52
  tokenMint,
@@ -42,6 +42,13 @@ export interface JoinSeasonOptions {
42
42
  * Only used when initializing a new pool (first join). Ignored when joining existing season.
43
43
  */
44
44
  symbol?: string;
45
+ /**
46
+ * Force generating a new launchpad token mint keypair, even if a moonpool already exists on-chain.
47
+ * Use this when creating a NEW Moonpool (i.e., the on-chain moonpool account may exist but was
48
+ * never fully initialized, or you want to start fresh with a new token mint).
49
+ * Only applies to launchpad mode.
50
+ */
51
+ forceNewLaunchpadMint?: boolean;
45
52
  /** Optional injected timestamp (seconds) for optimistic state calculation */
46
53
  now?: BN;
47
54
  feePayer?: PublicKey;
@@ -9,6 +9,7 @@ const anchor_1 = require("@coral-xyz/anchor");
9
9
  const web3_js_1 = require("@solana/web3.js");
10
10
  const spl_token_1 = require("@solana/spl-token");
11
11
  const pdaManager_1 = require("../utils/pdaManager");
12
+ const pdas_1 = require("../utils/pdas");
12
13
  const constants_1 = require("../utils/constants");
13
14
  const programHelpers_1 = require("../utils/programHelpers");
14
15
  const signerHelpers_1 = require("../utils/signerHelpers");
@@ -42,37 +43,37 @@ async function joinSeason(options) {
42
43
  let launchpadTokenMintKeypair;
43
44
  let launchpadTokenMintPubkey;
44
45
  if (launchpad) {
45
- // Check if moonpool is already initialized
46
- // First check currentAccounts (for LiteSVM or optimistic updates)
47
- let moonpoolData = options.currentAccounts?.moonpool ?? null;
48
- // If not provided, try to fetch it from the network
49
- if (!moonpoolData) {
50
- try {
51
- moonpoolData = await program.account.moonpool.fetch(pdasBase.moonpool);
52
- console.log("[joinSeason] Moonpool data fetched, launchpadTokenMint:", moonpoolData.launchpadTokenMint.toString());
53
- }
54
- catch (error) {
55
- // Moonpool doesn't exist (first join scenario) or network error - treat as first join
56
- moonpoolData = null;
57
- }
58
- }
59
- if (!moonpoolData || moonpoolData.launchpadTokenMint.equals(web3_js_1.PublicKey.default)) {
60
- // Moonpool doesn't exist yet (first join) - generate a keypair for the mint
61
- // The mint will be created and stored in the moonpool during initialization
46
+ // If forceNewLaunchpadMint is set, skip on-chain checks and always generate a new keypair
47
+ if (options.forceNewLaunchpadMint) {
62
48
  launchpadTokenMintKeypair = web3_js_1.Keypair.generate();
63
49
  launchpadTokenMintPubkey = launchpadTokenMintKeypair.publicKey;
64
- console.log("[joinSeason] First join - generated launchpad mint keypair:", launchpadTokenMintPubkey.toString());
50
+ console.log("[joinSeason] forceNewLaunchpadMint=true - generated new launchpad mint keypair:", launchpadTokenMintPubkey.toString());
65
51
  }
66
52
  else {
67
- // Moonpool is already initialized - use the mint address stored in moonpool
68
- launchpadTokenMintPubkey = moonpoolData.launchpadTokenMint;
69
- console.log("[joinSeason] Moonpool exists - using stored mint address:", launchpadTokenMintPubkey.toString());
53
+ // For non-force mode, we need an existing launchpadTokenMint to find the moonpool
54
+ // Check currentAccounts first (for LiteSVM or optimistic updates)
55
+ let moonpoolData = options.currentAccounts?.moonpool ?? null;
56
+ if (moonpoolData && !moonpoolData.launchpadTokenMint.equals(web3_js_1.PublicKey.default)) {
57
+ // Use the launchpadTokenMint from the provided moonpool data
58
+ launchpadTokenMintPubkey = moonpoolData.launchpadTokenMint;
59
+ console.log("[joinSeason] Using launchpadTokenMint from currentAccounts:", launchpadTokenMintPubkey.toString());
60
+ }
61
+ else {
62
+ // No moonpool data provided - this is a first join scenario
63
+ // Generate a keypair for the mint (the mint will be created on-chain)
64
+ launchpadTokenMintKeypair = web3_js_1.Keypair.generate();
65
+ launchpadTokenMintPubkey = launchpadTokenMintKeypair.publicKey;
66
+ console.log("[joinSeason] First join - generated launchpad mint keypair:", launchpadTokenMintPubkey.toString());
67
+ }
70
68
  }
71
69
  }
72
70
  else {
73
71
  // Non-launchpad mode, use PDA
74
72
  launchpadTokenMintPubkey = pdasBase.launchpadTokenMint;
75
73
  }
74
+ // Derive Moonpool and Treasury PDAs using the launchpadTokenMint
75
+ const [moonpoolPda] = (0, pdas_1.getMoonpoolPda)(launchpadTokenMintPubkey);
76
+ const [moonpoolTreasuryPda] = (0, pdas_1.getMoonpoolTreasuryPda)(launchpadTokenMintPubkey);
76
77
  const rootAdminTokenAccount = launchpad
77
78
  ? null
78
79
  : (0, spl_token_1.getAssociatedTokenAddressSync)(constants_1.MIZD_TOKEN_MINT, constants_1.ADMIN_PUBLIC_KEY);
@@ -85,6 +86,8 @@ async function joinSeason(options) {
85
86
  : (0, spl_token_1.getAssociatedTokenAddressSync)(constants_1.MIZD_TOKEN_MINT, pdasBase.userJoinCredit, true);
86
87
  const pdas = {
87
88
  ...pdasBase,
89
+ moonpool: moonpoolPda,
90
+ moonpoolTreasury: moonpoolTreasuryPda,
88
91
  launchpadTokenMint: launchpadTokenMintPubkey,
89
92
  userJoinCreditVault: userJoinCreditVault ?? web3_js_1.PublicKey.default,
90
93
  };
@@ -95,8 +98,8 @@ async function joinSeason(options) {
95
98
  // SECURITY: Pool accounts are now MANDATORY (non-optional) to prevent bypassing
96
99
  // the mode check. The on-chain program validates pool state to ensure
97
100
  // subsequent seasons use the same mode (launchpad/classic) as the first season.
98
- moonpool: pdas.moonpool,
99
- moonpoolTreasury: pdas.moonpoolTreasury,
101
+ moonpool: moonpoolPda,
102
+ moonpoolTreasury: moonpoolTreasuryPda,
100
103
  launchpadTokenMint: pdas.launchpadTokenMint,
101
104
  sunpool: pdas.sunpool,
102
105
  seasonDepositVault: launchpad ? null : pdas.seasonDepositVault,
@@ -132,7 +135,7 @@ async function joinSeason(options) {
132
135
  const methodBuilder = program.methods
133
136
  // Anchor expects BN for u64 args.
134
137
  // referrerTier defaults to 0 if no referrer (ignored on-chain)
135
- .joinSeason(options.seasonNumber, options.tier, referrer, options.referrerTier ?? 0, options.star ?? false, launchpad, options.maxSolInLamports ?? new anchor_1.BN(0), options.expectedSolInLamports ?? new anchor_1.BN(0), options.maxSlippageBps ?? 0, options.starFlagPrompt ?? "", options.symbol ?? "")
138
+ .joinSeason(options.seasonNumber, options.tier, referrer, options.referrerTier ?? 0, options.star ?? false, launchpad, options.maxSolInLamports ?? new anchor_1.BN(0), options.expectedSolInLamports ?? new anchor_1.BN(0), options.maxSlippageBps ?? 0, options.starFlagPrompt ?? "", options.symbol ?? "", options.forceNewLaunchpadMint ?? false)
136
139
  .accounts(accounts);
137
140
  if (remainingAccounts.length > 0) {
138
141
  methodBuilder.remainingAccounts(remainingAccounts);
@@ -84,6 +84,7 @@ export interface ClaimWindowRewardsAccounts {
84
84
  rewardWindow: PublicKey;
85
85
  userWindowParticipation: PublicKey;
86
86
  seasonMembership: PublicKey;
87
+ launchpadTokenMint: PublicKey;
87
88
  moonpool: PublicKey | null;
88
89
  moonpoolTreasury: PublicKey | null;
89
90
  seasonDepositVault: PublicKey | null;
@@ -101,6 +102,7 @@ export interface ClaimReferralPenaltyForWindowAccounts {
101
102
  seasonMembership: PublicKey;
102
103
  userWindowParticipation: PublicKey;
103
104
  referralPenaltyClaim: PublicKey;
105
+ launchpadTokenMint: PublicKey;
104
106
  moonpool: PublicKey | null;
105
107
  moonpoolTreasury: PublicKey | null;
106
108
  seasonDepositVault: PublicKey | null;
@@ -115,6 +117,7 @@ export interface ClaimReferralPenaltyForWindowAccounts {
115
117
  export interface ClaimSignupRewardsAccounts {
116
118
  seasonMembership: PublicKey;
117
119
  season: PublicKey;
120
+ launchpadTokenMint: PublicKey;
118
121
  moonpool: PublicKey | null;
119
122
  moonpoolTreasury: PublicKey | null;
120
123
  signupRewardsPda: PublicKey;
@@ -317,12 +317,17 @@ export type ProofOfTake = {
317
317
  "name": "referralPenaltyClaim";
318
318
  "writable": true;
319
319
  },
320
+ {
321
+ "name": "launchpadTokenMint";
322
+ "docs": [
323
+ "Required for PDA derivation. Validated by Moonpool seeds constraint."
324
+ ];
325
+ },
320
326
  {
321
327
  "name": "moonpool";
322
328
  "docs": [
323
- "Global Moonpool PDA (required when `season.is_moonpool()`).",
324
- "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).",
325
- "Shared across all seasons for this token mint."
329
+ "Moonpool PDA - unique per launchpad_token_mint (required when `season.is_moonpool()`).",
330
+ "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens)."
326
331
  ];
327
332
  "writable": true;
328
333
  "optional": true;
@@ -343,7 +348,7 @@ export type ProofOfTake = {
343
348
  },
344
349
  {
345
350
  "kind": "account";
346
- "path": "tokenMint";
351
+ "path": "launchpadTokenMint";
347
352
  },
348
353
  {
349
354
  "kind": "const";
@@ -364,7 +369,7 @@ export type ProofOfTake = {
364
369
  {
365
370
  "name": "moonpoolTreasury";
366
371
  "docs": [
367
- "Shared across all seasons for this token mint.",
372
+ "Unique per launchpad_token_mint.",
368
373
  "",
369
374
  "Safety:",
370
375
  "- Address is constrained by PDA seeds.",
@@ -399,7 +404,7 @@ export type ProofOfTake = {
399
404
  },
400
405
  {
401
406
  "kind": "account";
402
- "path": "tokenMint";
407
+ "path": "launchpadTokenMint";
403
408
  },
404
409
  {
405
410
  "kind": "const";
@@ -670,12 +675,17 @@ export type ProofOfTake = {
670
675
  ];
671
676
  };
672
677
  },
678
+ {
679
+ "name": "launchpadTokenMint";
680
+ "docs": [
681
+ "Required for PDA derivation. Validated by Moonpool seeds constraint."
682
+ ];
683
+ },
673
684
  {
674
685
  "name": "moonpool";
675
686
  "docs": [
676
- "Global Moonpool PDA (required when `season.is_moonpool()`).",
677
- "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).",
678
- "Shared across all seasons for this token mint."
687
+ "Moonpool PDA - unique per launchpad_token_mint (required when `season.is_moonpool()`).",
688
+ "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens)."
679
689
  ];
680
690
  "writable": true;
681
691
  "optional": true;
@@ -696,7 +706,7 @@ export type ProofOfTake = {
696
706
  },
697
707
  {
698
708
  "kind": "account";
699
- "path": "tokenMint";
709
+ "path": "launchpadTokenMint";
700
710
  },
701
711
  {
702
712
  "kind": "const";
@@ -717,7 +727,7 @@ export type ProofOfTake = {
717
727
  {
718
728
  "name": "moonpoolTreasury";
719
729
  "docs": [
720
- "Shared across all seasons for this token mint.",
730
+ "Unique per launchpad_token_mint.",
721
731
  "",
722
732
  "Safety:",
723
733
  "- Address is constrained by PDA seeds.",
@@ -752,7 +762,7 @@ export type ProofOfTake = {
752
762
  },
753
763
  {
754
764
  "kind": "account";
755
- "path": "tokenMint";
765
+ "path": "launchpadTokenMint";
756
766
  },
757
767
  {
758
768
  "kind": "const";
@@ -1099,12 +1109,17 @@ export type ProofOfTake = {
1099
1109
  "name": "seasonMembership";
1100
1110
  "writable": true;
1101
1111
  },
1112
+ {
1113
+ "name": "launchpadTokenMint";
1114
+ "docs": [
1115
+ "Required for PDA derivation. Validated by Moonpool seeds constraint."
1116
+ ];
1117
+ },
1102
1118
  {
1103
1119
  "name": "moonpool";
1104
1120
  "docs": [
1105
- "Global Moonpool PDA (required when `season.is_moonpool()`).",
1106
- "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).",
1107
- "Shared across all seasons for this token mint."
1121
+ "Moonpool PDA - unique per launchpad_token_mint (required when `season.is_moonpool()`).",
1122
+ "The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens)."
1108
1123
  ];
1109
1124
  "writable": true;
1110
1125
  "optional": true;
@@ -1125,7 +1140,7 @@ export type ProofOfTake = {
1125
1140
  },
1126
1141
  {
1127
1142
  "kind": "account";
1128
- "path": "tokenMint";
1143
+ "path": "launchpadTokenMint";
1129
1144
  },
1130
1145
  {
1131
1146
  "kind": "const";
@@ -1146,7 +1161,7 @@ export type ProofOfTake = {
1146
1161
  {
1147
1162
  "name": "moonpoolTreasury";
1148
1163
  "docs": [
1149
- "Shared across all seasons for this token mint.",
1164
+ "Unique per launchpad_token_mint.",
1150
1165
  "",
1151
1166
  "Safety:",
1152
1167
  "- Address is constrained by PDA seeds.",
@@ -1181,7 +1196,7 @@ export type ProofOfTake = {
1181
1196
  },
1182
1197
  {
1183
1198
  "kind": "account";
1184
- "path": "tokenMint";
1199
+ "path": "launchpadTokenMint";
1185
1200
  },
1186
1201
  {
1187
1202
  "kind": "const";
@@ -2927,10 +2942,13 @@ export type ProofOfTake = {
2927
2942
  {
2928
2943
  "name": "moonpool";
2929
2944
  "docs": [
2930
- "Global Moonpool PDA (shared across all seasons for this token mint).",
2945
+ "Moonpool PDA - unique per launchpad_token_mint.",
2931
2946
  "The Moonpool is the Moon's seesaw for buying and selling stars (real SPL Token-2022 tokens).",
2932
2947
  "Contains reserve state for the constant-product AMM.",
2933
2948
  "",
2949
+ "Each unique launchpad_token_mint creates a unique Moonpool, allowing multiple \"Stars\"",
2950
+ "to coexist for the same token_mint.",
2951
+ "",
2934
2952
  "SECURITY: This account is MANDATORY (not optional) to prevent bypassing the",
2935
2953
  "launchpad mode check. If a previous season was launchpad mode, subsequent",
2936
2954
  "seasons MUST also be launchpad mode - we enforce this by always checking",
@@ -2954,7 +2972,7 @@ export type ProofOfTake = {
2954
2972
  },
2955
2973
  {
2956
2974
  "kind": "account";
2957
- "path": "tokenMint";
2975
+ "path": "launchpadTokenMint";
2958
2976
  },
2959
2977
  {
2960
2978
  "kind": "const";
@@ -2975,7 +2993,7 @@ export type ProofOfTake = {
2975
2993
  {
2976
2994
  "name": "moonpoolTreasury";
2977
2995
  "docs": [
2978
- "Shared across all seasons for this token mint.",
2996
+ "Unique per launchpad_token_mint, paired with its corresponding Moonpool.",
2979
2997
  "",
2980
2998
  "SECURITY: This account is MANDATORY alongside the pool to ensure consistent",
2981
2999
  "mode validation across seasons.",
@@ -3012,7 +3030,7 @@ export type ProofOfTake = {
3012
3030
  },
3013
3031
  {
3014
3032
  "kind": "account";
3015
- "path": "tokenMint";
3033
+ "path": "launchpadTokenMint";
3016
3034
  },
3017
3035
  {
3018
3036
  "kind": "const";
@@ -3536,6 +3554,10 @@ export type ProofOfTake = {
3536
3554
  {
3537
3555
  "name": "symbol";
3538
3556
  "type": "string";
3557
+ },
3558
+ {
3559
+ "name": "forceNewLaunchpadMint";
3560
+ "type": "bool";
3539
3561
  }
3540
3562
  ];
3541
3563
  },
@@ -62,16 +62,16 @@ export declare function getUserWindowParticipationPda(seasonNumber: SeasonNumber
62
62
  */
63
63
  export declare function getSeasonDepositVaultPda(seasonNumber: SeasonNumberLike, tokenMint?: PublicKey): [PublicKey, number];
64
64
  /**
65
- * Derive the global Moonpool PDA (real SOL + real SPL Token-2022 reserves).
65
+ * Derive the Moonpool PDA (real SOL + real SPL Token-2022 reserves).
66
66
  * The Moonpool is the Moon's seesaw for buying and selling stars (real SPL Token-2022 tokens).
67
- * Shared across all seasons for a given token mint.
67
+ * Each unique launchpadTokenMint creates a unique Moonpool, allowing multiple "Stars" to coexist.
68
68
  */
69
- export declare function getMoonpoolPda(tokenMint?: PublicKey): [PublicKey, number];
69
+ export declare function getMoonpoolPda(launchpadTokenMint: PublicKey): [PublicKey, number];
70
70
  /**
71
- * Derive the global MoonpoolTreasury PDA (system account holding real SOL).
72
- * Shared across all seasons for a given token mint.
71
+ * Derive the MoonpoolTreasury PDA (system account holding real SOL).
72
+ * Unique per launchpadTokenMint, paired with its corresponding Moonpool.
73
73
  */
74
- export declare function getMoonpoolTreasuryPda(tokenMint?: PublicKey): [PublicKey, number];
74
+ export declare function getMoonpoolTreasuryPda(launchpadTokenMint: PublicKey): [PublicKey, number];
75
75
  /**
76
76
  * Derive the Launchpad Token Mint PDA (SPL Token-2022 mint).
77
77
  * The mint authority is the Moonpool PDA itself.
@@ -144,25 +144,25 @@ function getSeasonDepositVaultPda(seasonNumber, tokenMint = constants_1.MIZD_TOK
144
144
  ], constants_1.PROGRAM_ID);
145
145
  }
146
146
  /**
147
- * Derive the global Moonpool PDA (real SOL + real SPL Token-2022 reserves).
147
+ * Derive the Moonpool PDA (real SOL + real SPL Token-2022 reserves).
148
148
  * The Moonpool is the Moon's seesaw for buying and selling stars (real SPL Token-2022 tokens).
149
- * Shared across all seasons for a given token mint.
149
+ * Each unique launchpadTokenMint creates a unique Moonpool, allowing multiple "Stars" to coexist.
150
150
  */
151
- function getMoonpoolPda(tokenMint = constants_1.MIZD_TOKEN_MINT) {
151
+ function getMoonpoolPda(launchpadTokenMint) {
152
152
  return web3_js_1.PublicKey.findProgramAddressSync([
153
153
  Buffer.from(constants_1.MOONPOOL_SEED),
154
- tokenMint.toBuffer(),
154
+ launchpadTokenMint.toBuffer(),
155
155
  constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
156
156
  ], constants_1.PROGRAM_ID);
157
157
  }
158
158
  /**
159
- * Derive the global MoonpoolTreasury PDA (system account holding real SOL).
160
- * Shared across all seasons for a given token mint.
159
+ * Derive the MoonpoolTreasury PDA (system account holding real SOL).
160
+ * Unique per launchpadTokenMint, paired with its corresponding Moonpool.
161
161
  */
162
- function getMoonpoolTreasuryPda(tokenMint = constants_1.MIZD_TOKEN_MINT) {
162
+ function getMoonpoolTreasuryPda(launchpadTokenMint) {
163
163
  return web3_js_1.PublicKey.findProgramAddressSync([
164
164
  Buffer.from(constants_1.MOONPOOL_TREASURY_SEED),
165
- tokenMint.toBuffer(),
165
+ launchpadTokenMint.toBuffer(),
166
166
  constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
167
167
  ], constants_1.PROGRAM_ID);
168
168
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proof-of-take-sdk",
3
- "version": "5.0.5",
3
+ "version": "5.0.7",
4
4
  "description": "TypeScript SDK for Proof of Take Solana program",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",