proof-of-take-sdk 3.1.2 → 4.0.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 (57) hide show
  1. package/dist/getters/getSeasonLaunchpadPool.d.ts +31 -0
  2. package/dist/getters/getSeasonLaunchpadPool.js +49 -0
  3. package/dist/getters/index.d.ts +1 -0
  4. package/dist/getters/index.js +1 -0
  5. package/dist/idl/proof_of_take.json +4490 -1674
  6. package/dist/index.d.ts +14 -7
  7. package/dist/index.js +20 -3
  8. package/dist/instructions/buyMizd.d.ts +19 -0
  9. package/dist/instructions/buyMizd.js +41 -0
  10. package/dist/instructions/claimReferralPenaltyForWindow.d.ts +53 -2
  11. package/dist/instructions/claimReferralPenaltyForWindow.js +45 -3
  12. package/dist/instructions/claimSignupRewards.d.ts +30 -0
  13. package/dist/instructions/claimSignupRewards.js +37 -3
  14. package/dist/instructions/claimWindowRewards.d.ts +42 -1
  15. package/dist/instructions/claimWindowRewards.js +47 -3
  16. package/dist/instructions/confirmedPostOnX.d.ts +2 -0
  17. package/dist/instructions/confirmedPostOnX.js +10 -0
  18. package/dist/instructions/createMiztake.d.ts +3 -2
  19. package/dist/instructions/createMiztake.js +5 -2
  20. package/dist/instructions/initializeBondingCurve.d.ts +24 -0
  21. package/dist/instructions/initializeBondingCurve.js +37 -0
  22. package/dist/instructions/initializeRewardWindow.d.ts +2 -0
  23. package/dist/instructions/initializeRewardWindow.js +5 -2
  24. package/dist/instructions/initializeSeasonVault.d.ts +1 -1
  25. package/dist/instructions/initializeSeasonVault.js +3 -2
  26. package/dist/instructions/joinSeason.d.ts +92 -3
  27. package/dist/instructions/joinSeason.js +117 -40
  28. package/dist/instructions/sellMizd.d.ts +19 -0
  29. package/dist/instructions/sellMizd.js +41 -0
  30. package/dist/instructions/viewSeasonMembershipStatus.d.ts +1 -1
  31. package/dist/instructions/viewSeasonMembershipStatus.js +13 -8
  32. package/dist/instructions/withdrawSeasonDeposit.d.ts +2 -0
  33. package/dist/instructions/withdrawSeasonDeposit.js +6 -1
  34. package/dist/optimistic/index.d.ts +1 -0
  35. package/dist/optimistic/index.js +5 -1
  36. package/dist/optimistic/joinSeasonOptimistic.d.ts +31 -0
  37. package/dist/optimistic/joinSeasonOptimistic.js +55 -0
  38. package/dist/types/accountTypes.d.ts +72 -18
  39. package/dist/types/anchorAccounts.d.ts +2 -0
  40. package/dist/types/proof_of_take.d.ts +4471 -1655
  41. package/dist/types.d.ts +10 -2
  42. package/dist/utils/accountConverters.js +7 -1
  43. package/dist/utils/accountUpdates.d.ts +38 -8
  44. package/dist/utils/accountUpdates.js +109 -19
  45. package/dist/utils/constants.d.ts +11 -0
  46. package/dist/utils/constants.js +14 -1
  47. package/dist/utils/pdaManager.d.ts +42 -2
  48. package/dist/utils/pdaManager.js +70 -28
  49. package/dist/utils/pdas.d.ts +46 -8
  50. package/dist/utils/pdas.js +111 -11
  51. package/dist/utils/remainingAccounts.d.ts +1 -0
  52. package/dist/utils/remainingAccounts.js +3 -2
  53. package/dist/utils/seedRegistry.d.ts +10 -0
  54. package/dist/utils/seedRegistry.js +10 -0
  55. package/package.json +1 -1
  56. package/dist/instructions/initializeEscrowVault.d.ts +0 -12
  57. package/dist/instructions/initializeEscrowVault.js +0 -37
@@ -0,0 +1,31 @@
1
+ import { BN } from "@coral-xyz/anchor";
2
+ import { Connection, PublicKey } from "@solana/web3.js";
3
+ /**
4
+ * View for Moonpool state (kept as LaunchpadPoolView for API compatibility).
5
+ * The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).
6
+ */
7
+ export type LaunchpadPoolView = {
8
+ seasonNumber: BN;
9
+ tokenMint: PublicKey;
10
+ solReserveLamports: BN;
11
+ tokenReserveUnits: BN;
12
+ virtualSolReserveLamports: BN;
13
+ virtualTokenReserveUnits: BN;
14
+ feeBps: number;
15
+ lastK: BN;
16
+ spotPriceLamportsPerToken: BN;
17
+ timestamp: BN;
18
+ };
19
+ /**
20
+ * View the global Moonpool status (spot price, reserves, k).
21
+ * The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).
22
+ * Shared across all seasons for this token mint.
23
+ * @deprecated Use getMoonpool instead
24
+ */
25
+ export declare function getSeasonLaunchpadPool(connection: Connection, seasonNumber: BN, tokenMint?: PublicKey): Promise<LaunchpadPoolView>;
26
+ /**
27
+ * View the global Moonpool status (spot price, reserves, k).
28
+ * The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).
29
+ * Shared across all seasons for this token mint.
30
+ */
31
+ export declare function getMoonpool(connection: Connection, seasonNumber: BN, tokenMint?: PublicKey): Promise<LaunchpadPoolView>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSeasonLaunchpadPool = getSeasonLaunchpadPool;
4
+ exports.getMoonpool = getMoonpool;
5
+ const anchor_1 = require("@coral-xyz/anchor");
6
+ const web3_js_1 = require("@solana/web3.js");
7
+ const programHelpers_1 = require("../utils/programHelpers");
8
+ const constants_1 = require("../utils/constants");
9
+ const pdas_1 = require("../utils/pdas");
10
+ /**
11
+ * View the global Moonpool status (spot price, reserves, k).
12
+ * The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).
13
+ * Shared across all seasons for this token mint.
14
+ * @deprecated Use getMoonpool instead
15
+ */
16
+ async function getSeasonLaunchpadPool(connection, seasonNumber, tokenMint = constants_1.MIZD_TOKEN_MINT) {
17
+ return getMoonpool(connection, seasonNumber, tokenMint);
18
+ }
19
+ /**
20
+ * View the global Moonpool status (spot price, reserves, k).
21
+ * The Moonpool is the Moon's seesaw for buying and selling stars (virtual tokens).
22
+ * Shared across all seasons for this token mint.
23
+ */
24
+ async function getMoonpool(connection, seasonNumber, tokenMint = constants_1.MIZD_TOKEN_MINT) {
25
+ const program = (0, programHelpers_1.getProgram)(connection);
26
+ const [season] = (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint);
27
+ // Global PDAs (no seasonNumber in derivation)
28
+ const [moonpool] = (0, pdas_1.getMoonpoolPda)(tokenMint);
29
+ const [moonpoolTreasury] = (0, pdas_1.getMoonpoolTreasuryPda)(tokenMint);
30
+ const view = await program.methods
31
+ .viewLaunchpadPool(seasonNumber)
32
+ // Anchor's generated `.accounts` typing for `.view()` is sometimes overly strict;
33
+ // provide the correct accounts and cast to avoid leaking this complexity to callers.
34
+ .accounts({ season, moonpool, moonpoolTreasury, tokenMint })
35
+ .view();
36
+ // Anchor returns u128 as BN (and u64/i64 as BN).
37
+ return {
38
+ seasonNumber: new anchor_1.BN(view.seasonNumber),
39
+ tokenMint: new web3_js_1.PublicKey(view.tokenMint),
40
+ solReserveLamports: new anchor_1.BN(view.solReserveLamports),
41
+ tokenReserveUnits: new anchor_1.BN(view.tokenReserveUnits),
42
+ virtualSolReserveLamports: new anchor_1.BN(view.virtualSolReserveLamports),
43
+ virtualTokenReserveUnits: new anchor_1.BN(view.virtualTokenReserveUnits),
44
+ feeBps: view.feeBps,
45
+ lastK: new anchor_1.BN(view.lastK),
46
+ spotPriceLamportsPerToken: new anchor_1.BN(view.spotPriceLamportsPerToken),
47
+ timestamp: new anchor_1.BN(view.timestamp),
48
+ };
49
+ }
@@ -10,3 +10,4 @@ export * from "./getSeasonMembership";
10
10
  export * from "./getRewardWindow";
11
11
  export * from "./getUserWindowParticipation";
12
12
  export * from "./getReferralPenaltyClaim";
13
+ export * from "./getSeasonLaunchpadPool";
@@ -26,3 +26,4 @@ __exportStar(require("./getSeasonMembership"), exports);
26
26
  __exportStar(require("./getRewardWindow"), exports);
27
27
  __exportStar(require("./getUserWindowParticipation"), exports);
28
28
  __exportStar(require("./getReferralPenaltyClaim"), exports);
29
+ __exportStar(require("./getSeasonLaunchpadPool"), exports);