proof-of-take-sdk 3.1.3 → 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.
- package/dist/getters/getSeasonLaunchpadPool.d.ts +31 -0
- package/dist/getters/getSeasonLaunchpadPool.js +49 -0
- package/dist/getters/index.d.ts +1 -0
- package/dist/getters/index.js +1 -0
- package/dist/idl/proof_of_take.json +4490 -1674
- package/dist/index.d.ts +14 -7
- package/dist/index.js +20 -3
- package/dist/instructions/buyMizd.d.ts +19 -0
- package/dist/instructions/buyMizd.js +41 -0
- package/dist/instructions/claimReferralPenaltyForWindow.d.ts +53 -2
- package/dist/instructions/claimReferralPenaltyForWindow.js +45 -3
- package/dist/instructions/claimSignupRewards.d.ts +30 -0
- package/dist/instructions/claimSignupRewards.js +37 -3
- package/dist/instructions/claimWindowRewards.d.ts +42 -1
- package/dist/instructions/claimWindowRewards.js +47 -3
- package/dist/instructions/confirmedPostOnX.d.ts +2 -0
- package/dist/instructions/confirmedPostOnX.js +4 -0
- package/dist/instructions/createMiztake.d.ts +2 -0
- package/dist/instructions/createMiztake.js +4 -0
- package/dist/instructions/initializeBondingCurve.d.ts +24 -0
- package/dist/instructions/initializeBondingCurve.js +37 -0
- package/dist/instructions/initializeRewardWindow.d.ts +2 -0
- package/dist/instructions/initializeRewardWindow.js +5 -2
- package/dist/instructions/initializeSeasonVault.d.ts +1 -1
- package/dist/instructions/initializeSeasonVault.js +3 -2
- package/dist/instructions/joinSeason.d.ts +92 -3
- package/dist/instructions/joinSeason.js +117 -40
- package/dist/instructions/sellMizd.d.ts +19 -0
- package/dist/instructions/sellMizd.js +41 -0
- package/dist/instructions/viewSeasonMembershipStatus.d.ts +1 -1
- package/dist/instructions/viewSeasonMembershipStatus.js +13 -8
- package/dist/instructions/withdrawSeasonDeposit.d.ts +2 -0
- package/dist/instructions/withdrawSeasonDeposit.js +6 -1
- package/dist/optimistic/index.d.ts +1 -0
- package/dist/optimistic/index.js +5 -1
- package/dist/optimistic/joinSeasonOptimistic.d.ts +31 -0
- package/dist/optimistic/joinSeasonOptimistic.js +55 -0
- package/dist/types/accountTypes.d.ts +72 -18
- package/dist/types/anchorAccounts.d.ts +2 -0
- package/dist/types/proof_of_take.d.ts +4471 -1655
- package/dist/types.d.ts +10 -2
- package/dist/utils/accountConverters.js +7 -1
- package/dist/utils/accountUpdates.d.ts +38 -8
- package/dist/utils/accountUpdates.js +109 -19
- package/dist/utils/constants.d.ts +11 -0
- package/dist/utils/constants.js +14 -1
- package/dist/utils/pdaManager.d.ts +42 -2
- package/dist/utils/pdaManager.js +70 -28
- package/dist/utils/pdas.d.ts +46 -8
- package/dist/utils/pdas.js +111 -11
- package/dist/utils/remainingAccounts.d.ts +1 -0
- package/dist/utils/remainingAccounts.js +3 -2
- package/dist/utils/seedRegistry.d.ts +10 -0
- package/dist/utils/seedRegistry.js +10 -0
- package/package.json +1 -1
- package/dist/instructions/initializeEscrowVault.d.ts +0 -12
- package/dist/instructions/initializeEscrowVault.js +0 -37
package/dist/utils/pdaManager.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PDAManager = void 0;
|
|
4
4
|
const conversions_1 = require("./conversions");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
5
6
|
const pdas_1 = require("./pdas");
|
|
6
7
|
/**
|
|
7
8
|
* PDA Manager for deriving related PDAs together
|
|
@@ -13,15 +14,16 @@ class PDAManager {
|
|
|
13
14
|
*/
|
|
14
15
|
static deriveMiztakePdas(params) {
|
|
15
16
|
const seasonNumber = (0, conversions_1.toSeasonNumberBn)(params.seasonNumber);
|
|
17
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
16
18
|
return {
|
|
17
19
|
miztake: (0, pdas_1.getMiztakePda)(params.shaHash)[0],
|
|
18
20
|
userStats: (0, pdas_1.getUserStatsPda)(params.telegramId)[0],
|
|
19
21
|
miztakeStatistics: (0, pdas_1.getMiztakeStatisticsPda)()[0],
|
|
20
22
|
seasonSettings: (0, pdas_1.getSeasonSettingsPda)()[0],
|
|
21
|
-
season: (0, pdas_1.getSeasonPda)(seasonNumber)[0],
|
|
22
|
-
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier)[0],
|
|
23
|
-
rewardWindow: (0, pdas_1.getRewardWindowPda)(seasonNumber, params.windowNumber)[0],
|
|
24
|
-
userWindowParticipation: (0, pdas_1.getUserWindowParticipationPda)(seasonNumber, params.user, params.tier, params.windowNumber)[0],
|
|
23
|
+
season: (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint)[0],
|
|
24
|
+
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier, tokenMint)[0],
|
|
25
|
+
rewardWindow: (0, pdas_1.getRewardWindowPda)(seasonNumber, params.windowNumber, tokenMint)[0],
|
|
26
|
+
userWindowParticipation: (0, pdas_1.getUserWindowParticipationPda)(seasonNumber, params.user, params.tier, params.windowNumber, tokenMint)[0],
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
@@ -29,12 +31,17 @@ class PDAManager {
|
|
|
29
31
|
*/
|
|
30
32
|
static deriveJoinSeasonPdas(params) {
|
|
31
33
|
const seasonNumber = (0, conversions_1.toSeasonNumberBn)(params.seasonNumber);
|
|
34
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
32
35
|
return {
|
|
33
36
|
seasonSettings: (0, pdas_1.getSeasonSettingsPda)()[0],
|
|
34
|
-
season: (0, pdas_1.getSeasonPda)(seasonNumber)[0],
|
|
35
|
-
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier)[0],
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
season: (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint)[0],
|
|
38
|
+
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier, tokenMint)[0],
|
|
39
|
+
moonpool: (0, pdas_1.getMoonpoolPda)(tokenMint)[0],
|
|
40
|
+
moonpoolTreasury: (0, pdas_1.getMoonpoolTreasuryPda)(tokenMint)[0],
|
|
41
|
+
launchpadTokenMint: (0, pdas_1.getLaunchpadTokenMintPda)(tokenMint)[0],
|
|
42
|
+
sunpool: (0, pdas_1.getSunpoolPda)(tokenMint)[0],
|
|
43
|
+
seasonDepositVault: (0, pdas_1.getSeasonDepositVaultPda)(seasonNumber, tokenMint)[0],
|
|
44
|
+
userJoinCredit: (0, pdas_1.getUserJoinCreditPda)(params.user)[0],
|
|
38
45
|
};
|
|
39
46
|
}
|
|
40
47
|
/**
|
|
@@ -42,12 +49,13 @@ class PDAManager {
|
|
|
42
49
|
*/
|
|
43
50
|
static deriveConfirmedPostPdas(params) {
|
|
44
51
|
const seasonNumber = (0, conversions_1.toSeasonNumberBn)(params.seasonNumber);
|
|
52
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
45
53
|
return {
|
|
46
54
|
seasonSettings: (0, pdas_1.getSeasonSettingsPda)()[0],
|
|
47
|
-
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier)[0],
|
|
48
|
-
season: (0, pdas_1.getSeasonPda)(seasonNumber)[0],
|
|
49
|
-
rewardWindow: (0, pdas_1.getRewardWindowPda)(seasonNumber, params.windowNumber)[0],
|
|
50
|
-
userWindowParticipation: (0, pdas_1.getUserWindowParticipationPda)(seasonNumber, params.user, params.tier, params.windowNumber)[0],
|
|
55
|
+
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier, tokenMint)[0],
|
|
56
|
+
season: (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint)[0],
|
|
57
|
+
rewardWindow: (0, pdas_1.getRewardWindowPda)(seasonNumber, params.windowNumber, tokenMint)[0],
|
|
58
|
+
userWindowParticipation: (0, pdas_1.getUserWindowParticipationPda)(seasonNumber, params.user, params.tier, params.windowNumber, tokenMint)[0],
|
|
51
59
|
miztake: (0, pdas_1.getMiztakePda)(params.miztakeShaHash)[0],
|
|
52
60
|
};
|
|
53
61
|
}
|
|
@@ -56,13 +64,17 @@ class PDAManager {
|
|
|
56
64
|
*/
|
|
57
65
|
static deriveClaimWindowRewardsPdas(params) {
|
|
58
66
|
const seasonNumber = (0, conversions_1.toSeasonNumberBn)(params.seasonNumber);
|
|
67
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
59
68
|
return {
|
|
60
69
|
seasonSettings: (0, pdas_1.getSeasonSettingsPda)()[0],
|
|
61
|
-
season: (0, pdas_1.getSeasonPda)(seasonNumber)[0],
|
|
62
|
-
rewardWindow: (0, pdas_1.getRewardWindowPda)(seasonNumber, params.windowNumber)[0],
|
|
63
|
-
userWindowParticipation: (0, pdas_1.getUserWindowParticipationPda)(seasonNumber, params.user, params.tier, params.windowNumber)[0],
|
|
64
|
-
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier)[0],
|
|
65
|
-
|
|
70
|
+
season: (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint)[0],
|
|
71
|
+
rewardWindow: (0, pdas_1.getRewardWindowPda)(seasonNumber, params.windowNumber, tokenMint)[0],
|
|
72
|
+
userWindowParticipation: (0, pdas_1.getUserWindowParticipationPda)(seasonNumber, params.user, params.tier, params.windowNumber, tokenMint)[0],
|
|
73
|
+
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier, tokenMint)[0],
|
|
74
|
+
moonpool: (0, pdas_1.getMoonpoolPda)(tokenMint)[0],
|
|
75
|
+
moonpoolTreasury: (0, pdas_1.getMoonpoolTreasuryPda)(tokenMint)[0],
|
|
76
|
+
launchpadTokenMint: (0, pdas_1.getLaunchpadTokenMintPda)(tokenMint)[0],
|
|
77
|
+
seasonDepositVault: (0, pdas_1.getSeasonDepositVaultPda)(seasonNumber, tokenMint)[0],
|
|
66
78
|
};
|
|
67
79
|
}
|
|
68
80
|
/**
|
|
@@ -70,12 +82,24 @@ class PDAManager {
|
|
|
70
82
|
*/
|
|
71
83
|
static deriveWithdrawDepositPdas(params) {
|
|
72
84
|
const seasonNumber = (0, conversions_1.toSeasonNumberBn)(params.seasonNumber);
|
|
85
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
73
86
|
return {
|
|
74
87
|
seasonSettings: (0, pdas_1.getSeasonSettingsPda)()[0],
|
|
75
|
-
season: (0, pdas_1.getSeasonPda)(seasonNumber)[0],
|
|
76
|
-
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier)[0],
|
|
77
|
-
seasonDepositVault: (0, pdas_1.getSeasonDepositVaultPda)(seasonNumber)[0],
|
|
78
|
-
|
|
88
|
+
season: (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint)[0],
|
|
89
|
+
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier, tokenMint)[0],
|
|
90
|
+
seasonDepositVault: (0, pdas_1.getSeasonDepositVaultPda)(seasonNumber, tokenMint)[0],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Derive PDAs for view_season_membership_status instruction (read-only).
|
|
95
|
+
*/
|
|
96
|
+
static deriveViewSeasonMembershipStatusPdas(params) {
|
|
97
|
+
const seasonNumber = (0, conversions_1.toSeasonNumberBn)(params.seasonNumber);
|
|
98
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
99
|
+
return {
|
|
100
|
+
seasonSettings: (0, pdas_1.getSeasonSettingsPda)()[0],
|
|
101
|
+
season: (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint)[0],
|
|
102
|
+
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier, tokenMint)[0],
|
|
79
103
|
};
|
|
80
104
|
}
|
|
81
105
|
/**
|
|
@@ -83,13 +107,17 @@ class PDAManager {
|
|
|
83
107
|
*/
|
|
84
108
|
static deriveClaimReferralPenaltyForWindowPdas(params) {
|
|
85
109
|
const seasonNumber = (0, conversions_1.toSeasonNumberBn)(params.seasonNumber);
|
|
110
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
86
111
|
return {
|
|
87
112
|
seasonSettings: (0, pdas_1.getSeasonSettingsPda)()[0],
|
|
88
|
-
season: (0, pdas_1.getSeasonPda)(seasonNumber)[0],
|
|
89
|
-
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.referredUser, params.tier)[0],
|
|
90
|
-
userWindowParticipation: (0, pdas_1.getUserWindowParticipationPda)(seasonNumber, params.referredUser, params.tier, params.windowNumber)[0],
|
|
91
|
-
referralPenaltyClaim: (0, pdas_1.getReferralPenaltyClaimPda)(seasonNumber, params.referredUser, params.tier, params.windowNumber)[0],
|
|
92
|
-
|
|
113
|
+
season: (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint)[0],
|
|
114
|
+
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.referredUser, params.tier, tokenMint)[0],
|
|
115
|
+
userWindowParticipation: (0, pdas_1.getUserWindowParticipationPda)(seasonNumber, params.referredUser, params.tier, params.windowNumber, tokenMint)[0],
|
|
116
|
+
referralPenaltyClaim: (0, pdas_1.getReferralPenaltyClaimPda)(seasonNumber, params.referredUser, params.tier, params.windowNumber, tokenMint)[0],
|
|
117
|
+
moonpool: (0, pdas_1.getMoonpoolPda)(tokenMint)[0],
|
|
118
|
+
moonpoolTreasury: (0, pdas_1.getMoonpoolTreasuryPda)(tokenMint)[0],
|
|
119
|
+
launchpadTokenMint: (0, pdas_1.getLaunchpadTokenMintPda)(tokenMint)[0],
|
|
120
|
+
seasonDepositVault: (0, pdas_1.getSeasonDepositVaultPda)(seasonNumber, tokenMint)[0],
|
|
93
121
|
};
|
|
94
122
|
}
|
|
95
123
|
/**
|
|
@@ -97,9 +125,23 @@ class PDAManager {
|
|
|
97
125
|
*/
|
|
98
126
|
static deriveClaimSignupRewardsPdas(params) {
|
|
99
127
|
const seasonNumber = (0, conversions_1.toSeasonNumberBn)(params.seasonNumber);
|
|
128
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
129
|
+
return {
|
|
130
|
+
seasonMembership: (0, pdas_1.getSeasonMembershipPda)(seasonNumber, params.user, params.tier, tokenMint)[0],
|
|
131
|
+
season: (0, pdas_1.getSeasonPda)(seasonNumber, tokenMint)[0],
|
|
132
|
+
moonpool: (0, pdas_1.getMoonpoolPda)(tokenMint)[0],
|
|
133
|
+
moonpoolTreasury: (0, pdas_1.getMoonpoolTreasuryPda)(tokenMint)[0],
|
|
134
|
+
launchpadTokenMint: (0, pdas_1.getLaunchpadTokenMintPda)(tokenMint)[0],
|
|
135
|
+
signupRewardsPda: (0, pdas_1.getSignupRewardsPda)(seasonNumber, params.user, tokenMint)[0],
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Derive PDAs for the SOL↔MIZD bonding curve instructions (global).
|
|
140
|
+
*/
|
|
141
|
+
static deriveBondingCurvePdas() {
|
|
100
142
|
return {
|
|
101
|
-
|
|
102
|
-
|
|
143
|
+
bondingCurve: (0, pdas_1.getBondingCurvePda)()[0],
|
|
144
|
+
mizdVault: (0, pdas_1.getBondingCurveMizdVaultPda)()[0],
|
|
103
145
|
};
|
|
104
146
|
}
|
|
105
147
|
}
|
package/dist/utils/pdas.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare function getSeasonSettingsPda(): [PublicKey, number];
|
|
|
26
26
|
* Derive the Season PDA for a given season number
|
|
27
27
|
* @param seasonNumber - The season number
|
|
28
28
|
*/
|
|
29
|
-
export declare function getSeasonPda(seasonNumber: SeasonNumberLike): [PublicKey, number];
|
|
29
|
+
export declare function getSeasonPda(seasonNumber: SeasonNumberLike, tokenMint?: PublicKey): [PublicKey, number];
|
|
30
30
|
/**
|
|
31
31
|
* Derive the SeasonMembership PDA
|
|
32
32
|
* PDA model:
|
|
@@ -39,13 +39,13 @@ export declare function getSeasonPda(seasonNumber: SeasonNumberLike): [PublicKey
|
|
|
39
39
|
* @param user - The user's public key
|
|
40
40
|
* @param tier - Tier number (0..=4)
|
|
41
41
|
*/
|
|
42
|
-
export declare function getSeasonMembershipPda(seasonNumber: SeasonNumberLike, user: PublicKey, tier: TierNumber): [PublicKey, number];
|
|
42
|
+
export declare function getSeasonMembershipPda(seasonNumber: SeasonNumberLike, user: PublicKey, tier: TierNumber, tokenMint?: PublicKey): [PublicKey, number];
|
|
43
43
|
/**
|
|
44
44
|
* Derive the RewardWindow PDA
|
|
45
45
|
* @param seasonNumber - The season number
|
|
46
46
|
* @param windowNumber - The window number
|
|
47
47
|
*/
|
|
48
|
-
export declare function getRewardWindowPda(seasonNumber: SeasonNumberLike, windowNumber: BN): [PublicKey, number];
|
|
48
|
+
export declare function getRewardWindowPda(seasonNumber: SeasonNumberLike, windowNumber: BN, tokenMint?: PublicKey): [PublicKey, number];
|
|
49
49
|
/**
|
|
50
50
|
* Derive the UserWindowParticipation PDA
|
|
51
51
|
* PDA model:
|
|
@@ -56,15 +56,45 @@ export declare function getRewardWindowPda(seasonNumber: SeasonNumberLike, windo
|
|
|
56
56
|
* @param tier - Tier number (0..=4)
|
|
57
57
|
* @param windowNumber - The window number
|
|
58
58
|
*/
|
|
59
|
-
export declare function getUserWindowParticipationPda(seasonNumber: SeasonNumberLike, user: PublicKey, tier: TierNumber, windowNumber: BN): [PublicKey, number];
|
|
59
|
+
export declare function getUserWindowParticipationPda(seasonNumber: SeasonNumberLike, user: PublicKey, tier: TierNumber, windowNumber: BN, tokenMint?: PublicKey): [PublicKey, number];
|
|
60
60
|
/**
|
|
61
61
|
* Derive the Season Deposit Vault PDA
|
|
62
62
|
*/
|
|
63
|
-
export declare function getSeasonDepositVaultPda(seasonNumber: SeasonNumberLike): [PublicKey, number];
|
|
63
|
+
export declare function getSeasonDepositVaultPda(seasonNumber: SeasonNumberLike, tokenMint?: PublicKey): [PublicKey, number];
|
|
64
|
+
/**
|
|
65
|
+
* Derive the global Moonpool PDA (real SOL + real SPL Token-2022 reserves).
|
|
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.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getMoonpoolPda(tokenMint?: PublicKey): [PublicKey, number];
|
|
70
|
+
/**
|
|
71
|
+
* Derive the global MoonpoolTreasury PDA (system account holding real SOL).
|
|
72
|
+
* Shared across all seasons for a given token mint.
|
|
73
|
+
*/
|
|
74
|
+
export declare function getMoonpoolTreasuryPda(tokenMint?: PublicKey): [PublicKey, number];
|
|
75
|
+
/**
|
|
76
|
+
* Derive the Launchpad Token Mint PDA (SPL Token-2022 mint).
|
|
77
|
+
* The mint authority is the Moonpool PDA itself.
|
|
78
|
+
* Shared across all seasons for a given token mint.
|
|
79
|
+
*/
|
|
80
|
+
export declare function getLaunchpadTokenMintPda(tokenMint?: PublicKey): [PublicKey, number];
|
|
81
|
+
/**
|
|
82
|
+
* Derive the global Sunpool PDA (classic/non-launchpad mode marker).
|
|
83
|
+
* The Sunpool is the Sun's flag shop for fixed-price deposits.
|
|
84
|
+
* Shared across all seasons for a given token mint.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getSunpoolPda(tokenMint?: PublicKey): [PublicKey, number];
|
|
64
87
|
/**
|
|
65
88
|
* Derive the Season Escrow Vault PDA
|
|
66
89
|
*/
|
|
67
|
-
export declare function getSeasonEscrowVaultPda(seasonNumber: SeasonNumberLike): [PublicKey, number];
|
|
90
|
+
export declare function getSeasonEscrowVaultPda(seasonNumber: SeasonNumberLike, tokenMint?: PublicKey): [PublicKey, number];
|
|
91
|
+
/**
|
|
92
|
+
* Derive the per-user JoinCredit PDA.
|
|
93
|
+
*
|
|
94
|
+
* PDA model:
|
|
95
|
+
* seeds = ["user_join_credit", user_pubkey_bytes]
|
|
96
|
+
*/
|
|
97
|
+
export declare function getUserJoinCreditPda(user: PublicKey): [PublicKey, number];
|
|
68
98
|
/**
|
|
69
99
|
* Derive the ReferralPenaltyClaim PDA
|
|
70
100
|
* PDA model:
|
|
@@ -75,11 +105,19 @@ export declare function getSeasonEscrowVaultPda(seasonNumber: SeasonNumberLike):
|
|
|
75
105
|
* @param tier - Tier number (0..=4)
|
|
76
106
|
* @param windowNumber - The window number
|
|
77
107
|
*/
|
|
78
|
-
export declare function getReferralPenaltyClaimPda(seasonNumber: SeasonNumberLike, referredUser: PublicKey, tier: TierNumber, windowNumber: BN): [PublicKey, number];
|
|
108
|
+
export declare function getReferralPenaltyClaimPda(seasonNumber: SeasonNumberLike, referredUser: PublicKey, tier: TierNumber, windowNumber: BN, tokenMint?: PublicKey): [PublicKey, number];
|
|
79
109
|
/**
|
|
80
110
|
* Derive the SignupRewards PDA for a given (season, referrer).
|
|
81
111
|
*
|
|
82
112
|
* PDA model:
|
|
83
113
|
* seeds = ["signup_rewards", season_number_le_u64, referrer_pubkey_bytes]
|
|
84
114
|
*/
|
|
85
|
-
export declare function getSignupRewardsPda(seasonNumber: SeasonNumberLike, referrer: PublicKey): [PublicKey, number];
|
|
115
|
+
export declare function getSignupRewardsPda(seasonNumber: SeasonNumberLike, referrer: PublicKey, tokenMint?: PublicKey): [PublicKey, number];
|
|
116
|
+
/**
|
|
117
|
+
* Derive the BondingCurve PDA (global).
|
|
118
|
+
*/
|
|
119
|
+
export declare function getBondingCurvePda(): [PublicKey, number];
|
|
120
|
+
/**
|
|
121
|
+
* Derive the BondingCurve MIZD vault PDA (global).
|
|
122
|
+
*/
|
|
123
|
+
export declare function getBondingCurveMizdVaultPda(): [PublicKey, number];
|
package/dist/utils/pdas.js
CHANGED
|
@@ -9,9 +9,16 @@ exports.getSeasonMembershipPda = getSeasonMembershipPda;
|
|
|
9
9
|
exports.getRewardWindowPda = getRewardWindowPda;
|
|
10
10
|
exports.getUserWindowParticipationPda = getUserWindowParticipationPda;
|
|
11
11
|
exports.getSeasonDepositVaultPda = getSeasonDepositVaultPda;
|
|
12
|
+
exports.getMoonpoolPda = getMoonpoolPda;
|
|
13
|
+
exports.getMoonpoolTreasuryPda = getMoonpoolTreasuryPda;
|
|
14
|
+
exports.getLaunchpadTokenMintPda = getLaunchpadTokenMintPda;
|
|
15
|
+
exports.getSunpoolPda = getSunpoolPda;
|
|
12
16
|
exports.getSeasonEscrowVaultPda = getSeasonEscrowVaultPda;
|
|
17
|
+
exports.getUserJoinCreditPda = getUserJoinCreditPda;
|
|
13
18
|
exports.getReferralPenaltyClaimPda = getReferralPenaltyClaimPda;
|
|
14
19
|
exports.getSignupRewardsPda = getSignupRewardsPda;
|
|
20
|
+
exports.getBondingCurvePda = getBondingCurvePda;
|
|
21
|
+
exports.getBondingCurveMizdVaultPda = getBondingCurveMizdVaultPda;
|
|
15
22
|
const web3_js_1 = require("@solana/web3.js");
|
|
16
23
|
const constants_1 = require("./constants");
|
|
17
24
|
const conversions_1 = require("./conversions");
|
|
@@ -53,9 +60,14 @@ function getSeasonSettingsPda() {
|
|
|
53
60
|
* Derive the Season PDA for a given season number
|
|
54
61
|
* @param seasonNumber - The season number
|
|
55
62
|
*/
|
|
56
|
-
function getSeasonPda(seasonNumber) {
|
|
63
|
+
function getSeasonPda(seasonNumber, tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
57
64
|
const seasonBn = (0, conversions_2.toSeasonNumberBn)(seasonNumber);
|
|
58
|
-
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
65
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
66
|
+
Buffer.from("season"),
|
|
67
|
+
tokenMint.toBuffer(),
|
|
68
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
69
|
+
seasonBn.toArrayLike(Buffer, "le", 8),
|
|
70
|
+
], constants_1.PROGRAM_ID);
|
|
59
71
|
}
|
|
60
72
|
/**
|
|
61
73
|
* Derive the SeasonMembership PDA
|
|
@@ -69,11 +81,13 @@ function getSeasonPda(seasonNumber) {
|
|
|
69
81
|
* @param user - The user's public key
|
|
70
82
|
* @param tier - Tier number (0..=4)
|
|
71
83
|
*/
|
|
72
|
-
function getSeasonMembershipPda(seasonNumber, user, tier) {
|
|
84
|
+
function getSeasonMembershipPda(seasonNumber, user, tier, tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
73
85
|
const t = (0, tierPenalty_1.assertValidTierNumber)(tier);
|
|
74
86
|
const seasonBn = (0, conversions_2.toSeasonNumberBn)(seasonNumber);
|
|
75
87
|
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
76
88
|
Buffer.from("season_membership"),
|
|
89
|
+
tokenMint.toBuffer(),
|
|
90
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
77
91
|
seasonBn.toArrayLike(Buffer, "le", 8),
|
|
78
92
|
user.toBuffer(),
|
|
79
93
|
Buffer.from([(0, tierSeeds_1.toTierSeedByte)(t)]),
|
|
@@ -84,10 +98,12 @@ function getSeasonMembershipPda(seasonNumber, user, tier) {
|
|
|
84
98
|
* @param seasonNumber - The season number
|
|
85
99
|
* @param windowNumber - The window number
|
|
86
100
|
*/
|
|
87
|
-
function getRewardWindowPda(seasonNumber, windowNumber) {
|
|
101
|
+
function getRewardWindowPda(seasonNumber, windowNumber, tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
88
102
|
const seasonBn = (0, conversions_2.toSeasonNumberBn)(seasonNumber);
|
|
89
103
|
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
90
104
|
Buffer.from("reward_window"),
|
|
105
|
+
tokenMint.toBuffer(),
|
|
106
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
91
107
|
seasonBn.toArrayLike(Buffer, "le", 8),
|
|
92
108
|
windowNumber.toArrayLike(Buffer, "le", 8),
|
|
93
109
|
], constants_1.PROGRAM_ID);
|
|
@@ -102,11 +118,13 @@ function getRewardWindowPda(seasonNumber, windowNumber) {
|
|
|
102
118
|
* @param tier - Tier number (0..=4)
|
|
103
119
|
* @param windowNumber - The window number
|
|
104
120
|
*/
|
|
105
|
-
function getUserWindowParticipationPda(seasonNumber, user, tier, windowNumber) {
|
|
121
|
+
function getUserWindowParticipationPda(seasonNumber, user, tier, windowNumber, tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
106
122
|
const t = (0, tierPenalty_1.assertValidTierNumber)(tier);
|
|
107
123
|
const seasonBn = (0, conversions_2.toSeasonNumberBn)(seasonNumber);
|
|
108
124
|
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
109
125
|
Buffer.from("user_window"),
|
|
126
|
+
tokenMint.toBuffer(),
|
|
127
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
110
128
|
seasonBn.toArrayLike(Buffer, "le", 8),
|
|
111
129
|
user.toBuffer(),
|
|
112
130
|
Buffer.from([(0, tierSeeds_1.toTierSeedByte)(t)]),
|
|
@@ -116,16 +134,82 @@ function getUserWindowParticipationPda(seasonNumber, user, tier, windowNumber) {
|
|
|
116
134
|
/**
|
|
117
135
|
* Derive the Season Deposit Vault PDA
|
|
118
136
|
*/
|
|
119
|
-
function getSeasonDepositVaultPda(seasonNumber) {
|
|
137
|
+
function getSeasonDepositVaultPda(seasonNumber, tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
120
138
|
const seasonBn = (0, conversions_2.toSeasonNumberBn)(seasonNumber);
|
|
121
|
-
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
139
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
140
|
+
Buffer.from("season_deposit_vault"),
|
|
141
|
+
tokenMint.toBuffer(),
|
|
142
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
143
|
+
seasonBn.toArrayLike(Buffer, "le", 8),
|
|
144
|
+
], constants_1.PROGRAM_ID);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Derive the global Moonpool PDA (real SOL + real SPL Token-2022 reserves).
|
|
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.
|
|
150
|
+
*/
|
|
151
|
+
function getMoonpoolPda(tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
152
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
153
|
+
Buffer.from(constants_1.MOONPOOL_SEED),
|
|
154
|
+
tokenMint.toBuffer(),
|
|
155
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
156
|
+
], constants_1.PROGRAM_ID);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Derive the global MoonpoolTreasury PDA (system account holding real SOL).
|
|
160
|
+
* Shared across all seasons for a given token mint.
|
|
161
|
+
*/
|
|
162
|
+
function getMoonpoolTreasuryPda(tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
163
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
164
|
+
Buffer.from(constants_1.MOONPOOL_TREASURY_SEED),
|
|
165
|
+
tokenMint.toBuffer(),
|
|
166
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
167
|
+
], constants_1.PROGRAM_ID);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Derive the Launchpad Token Mint PDA (SPL Token-2022 mint).
|
|
171
|
+
* The mint authority is the Moonpool PDA itself.
|
|
172
|
+
* Shared across all seasons for a given token mint.
|
|
173
|
+
*/
|
|
174
|
+
function getLaunchpadTokenMintPda(tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
175
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
176
|
+
Buffer.from(constants_1.LAUNCHPAD_TOKEN_MINT_SEED),
|
|
177
|
+
tokenMint.toBuffer(),
|
|
178
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
179
|
+
], constants_1.PROGRAM_ID);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Derive the global Sunpool PDA (classic/non-launchpad mode marker).
|
|
183
|
+
* The Sunpool is the Sun's flag shop for fixed-price deposits.
|
|
184
|
+
* Shared across all seasons for a given token mint.
|
|
185
|
+
*/
|
|
186
|
+
function getSunpoolPda(tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
187
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
188
|
+
Buffer.from(constants_1.SUNPOOL_SEED),
|
|
189
|
+
tokenMint.toBuffer(),
|
|
190
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
191
|
+
], constants_1.PROGRAM_ID);
|
|
122
192
|
}
|
|
123
193
|
/**
|
|
124
194
|
* Derive the Season Escrow Vault PDA
|
|
125
195
|
*/
|
|
126
|
-
function getSeasonEscrowVaultPda(seasonNumber) {
|
|
196
|
+
function getSeasonEscrowVaultPda(seasonNumber, tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
127
197
|
const seasonBn = (0, conversions_2.toSeasonNumberBn)(seasonNumber);
|
|
128
|
-
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
198
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
199
|
+
Buffer.from("season_escrow_vault"),
|
|
200
|
+
tokenMint.toBuffer(),
|
|
201
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
202
|
+
seasonBn.toArrayLike(Buffer, "le", 8),
|
|
203
|
+
], constants_1.PROGRAM_ID);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Derive the per-user JoinCredit PDA.
|
|
207
|
+
*
|
|
208
|
+
* PDA model:
|
|
209
|
+
* seeds = ["user_join_credit", user_pubkey_bytes]
|
|
210
|
+
*/
|
|
211
|
+
function getUserJoinCreditPda(user) {
|
|
212
|
+
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from(constants_1.USER_JOIN_CREDIT_SEED), user.toBuffer()], constants_1.PROGRAM_ID);
|
|
129
213
|
}
|
|
130
214
|
/**
|
|
131
215
|
* Derive the ReferralPenaltyClaim PDA
|
|
@@ -137,11 +221,13 @@ function getSeasonEscrowVaultPda(seasonNumber) {
|
|
|
137
221
|
* @param tier - Tier number (0..=4)
|
|
138
222
|
* @param windowNumber - The window number
|
|
139
223
|
*/
|
|
140
|
-
function getReferralPenaltyClaimPda(seasonNumber, referredUser, tier, windowNumber) {
|
|
224
|
+
function getReferralPenaltyClaimPda(seasonNumber, referredUser, tier, windowNumber, tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
141
225
|
const t = (0, tierPenalty_1.assertValidTierNumber)(tier);
|
|
142
226
|
const seasonBn = (0, conversions_2.toSeasonNumberBn)(seasonNumber);
|
|
143
227
|
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
144
228
|
Buffer.from(constants_1.REFERRAL_PENALTY_CLAIM_SEED),
|
|
229
|
+
tokenMint.toBuffer(),
|
|
230
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
145
231
|
seasonBn.toArrayLike(Buffer, "le", 8),
|
|
146
232
|
referredUser.toBuffer(),
|
|
147
233
|
Buffer.from([(0, tierSeeds_1.toTierSeedByte)(t)]),
|
|
@@ -154,11 +240,25 @@ function getReferralPenaltyClaimPda(seasonNumber, referredUser, tier, windowNumb
|
|
|
154
240
|
* PDA model:
|
|
155
241
|
* seeds = ["signup_rewards", season_number_le_u64, referrer_pubkey_bytes]
|
|
156
242
|
*/
|
|
157
|
-
function getSignupRewardsPda(seasonNumber, referrer) {
|
|
243
|
+
function getSignupRewardsPda(seasonNumber, referrer, tokenMint = constants_1.MIZD_TOKEN_MINT) {
|
|
158
244
|
const seasonBn = (0, conversions_2.toSeasonNumberBn)(seasonNumber);
|
|
159
245
|
return web3_js_1.PublicKey.findProgramAddressSync([
|
|
160
246
|
Buffer.from(constants_1.SIGNUP_REWARDS_SEED),
|
|
247
|
+
tokenMint.toBuffer(),
|
|
248
|
+
constants_1.SEASON_INSTANCE_ID.toArrayLike(Buffer, "le", 8),
|
|
161
249
|
seasonBn.toArrayLike(Buffer, "le", 8),
|
|
162
250
|
referrer.toBuffer(),
|
|
163
251
|
], constants_1.PROGRAM_ID);
|
|
164
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Derive the BondingCurve PDA (global).
|
|
255
|
+
*/
|
|
256
|
+
function getBondingCurvePda() {
|
|
257
|
+
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from(constants_1.BONDING_CURVE_SEED)], constants_1.PROGRAM_ID);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Derive the BondingCurve MIZD vault PDA (global).
|
|
261
|
+
*/
|
|
262
|
+
function getBondingCurveMizdVaultPda() {
|
|
263
|
+
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from(constants_1.BONDING_CURVE_MIZD_VAULT_SEED)], constants_1.PROGRAM_ID);
|
|
264
|
+
}
|
|
@@ -17,8 +17,9 @@ const constants_1 = require("./constants");
|
|
|
17
17
|
function getJoinSeasonRemainingAccounts(params) {
|
|
18
18
|
if (params.referrer.equals(web3_js_1.PublicKey.default))
|
|
19
19
|
return [];
|
|
20
|
-
const
|
|
21
|
-
const [
|
|
20
|
+
const tokenMint = params.tokenMint ?? constants_1.MIZD_TOKEN_MINT;
|
|
21
|
+
const [referrerSeasonMembership] = (0, pdas_1.getSeasonMembershipPda)(params.seasonNumber, params.referrer, params.referrerTier, tokenMint);
|
|
22
|
+
const [signupRewardsPda] = (0, pdas_1.getSignupRewardsPda)(params.seasonNumber, params.referrer, tokenMint);
|
|
22
23
|
// IMPORTANT: PDA owners are off-curve; allowOwnerOffCurve must be true.
|
|
23
24
|
const signupRewardsMizdAta = (0, spl_token_1.getAssociatedTokenAddressSync)(constants_1.MIZD_TOKEN_MINT, signupRewardsPda, true);
|
|
24
25
|
return [
|
|
@@ -9,4 +9,14 @@ export declare const SEEDS: {
|
|
|
9
9
|
readonly MIZTAKE: "miztake";
|
|
10
10
|
readonly REFERRAL_PENALTY_CLAIM: "referral_penalty_claim";
|
|
11
11
|
readonly SIGNUP_REWARDS: "signup_rewards";
|
|
12
|
+
readonly USER_JOIN_CREDIT: "user_join_credit";
|
|
13
|
+
/** The Moonpool is the Moon's seesaw for buying and selling stars (real SPL Token-2022 tokens). Mint authority for launchpad tokens. */
|
|
14
|
+
readonly MOONPOOL: "moonpool";
|
|
15
|
+
readonly MOONPOOL_TREASURY: "moonpool_treasury";
|
|
16
|
+
/** SPL Token-2022 mint for launchpad tokens. Mint authority is the Moonpool PDA. */
|
|
17
|
+
readonly LAUNCHPAD_TOKEN_MINT: "launchpad_token_mint";
|
|
18
|
+
/** The Sunpool is the Sun's flag shop for classic (non-launchpad) mode. */
|
|
19
|
+
readonly SUNPOOL: "sunpool";
|
|
20
|
+
readonly BONDING_CURVE: "bonding_curve";
|
|
21
|
+
readonly BONDING_CURVE_MIZD_VAULT: "bonding_curve_mizd_vault";
|
|
12
22
|
};
|
|
@@ -12,4 +12,14 @@ exports.SEEDS = {
|
|
|
12
12
|
MIZTAKE: "miztake",
|
|
13
13
|
REFERRAL_PENALTY_CLAIM: "referral_penalty_claim",
|
|
14
14
|
SIGNUP_REWARDS: "signup_rewards",
|
|
15
|
+
USER_JOIN_CREDIT: "user_join_credit",
|
|
16
|
+
/** The Moonpool is the Moon's seesaw for buying and selling stars (real SPL Token-2022 tokens). Mint authority for launchpad tokens. */
|
|
17
|
+
MOONPOOL: "moonpool",
|
|
18
|
+
MOONPOOL_TREASURY: "moonpool_treasury",
|
|
19
|
+
/** SPL Token-2022 mint for launchpad tokens. Mint authority is the Moonpool PDA. */
|
|
20
|
+
LAUNCHPAD_TOKEN_MINT: "launchpad_token_mint",
|
|
21
|
+
/** The Sunpool is the Sun's flag shop for classic (non-launchpad) mode. */
|
|
22
|
+
SUNPOOL: "sunpool",
|
|
23
|
+
BONDING_CURVE: "bonding_curve",
|
|
24
|
+
BONDING_CURVE_MIZD_VAULT: "bonding_curve_mizd_vault",
|
|
15
25
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Connection, PublicKey } from "@solana/web3.js";
|
|
2
|
-
import { BN } from "@coral-xyz/anchor";
|
|
3
|
-
import { StandardInstructionResultWithPdas } from "../types/instructionResults";
|
|
4
|
-
/**
|
|
5
|
-
* Initialize season escrow vault
|
|
6
|
-
*
|
|
7
|
-
* Single signer: admin (pays for account creation)
|
|
8
|
-
* This initializes the token vault for escrowed (protected) deposits.
|
|
9
|
-
*/
|
|
10
|
-
export declare function initializeEscrowVault(connection: Connection, admin: PublicKey, seasonNumber: BN, feePayer?: PublicKey): Promise<StandardInstructionResultWithPdas<{
|
|
11
|
-
vault: PublicKey;
|
|
12
|
-
}>>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initializeEscrowVault = initializeEscrowVault;
|
|
4
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
-
const spl_token_1 = require("@solana/spl-token");
|
|
6
|
-
const pdas_1 = require("../utils/pdas");
|
|
7
|
-
const constants_1 = require("../utils/constants");
|
|
8
|
-
const programHelpers_1 = require("../utils/programHelpers");
|
|
9
|
-
const signerHelpers_1 = require("../utils/signerHelpers");
|
|
10
|
-
const instructionResultHelpers_1 = require("../utils/instructionResultHelpers");
|
|
11
|
-
/**
|
|
12
|
-
* Initialize season escrow vault
|
|
13
|
-
*
|
|
14
|
-
* Single signer: admin (pays for account creation)
|
|
15
|
-
* This initializes the token vault for escrowed (protected) deposits.
|
|
16
|
-
*/
|
|
17
|
-
async function initializeEscrowVault(connection, admin, seasonNumber, feePayer) {
|
|
18
|
-
const program = (0, programHelpers_1.getProgram)(connection);
|
|
19
|
-
const [vaultPda] = (0, pdas_1.getSeasonEscrowVaultPda)(seasonNumber);
|
|
20
|
-
const accounts = {
|
|
21
|
-
seasonEscrowVault: vaultPda,
|
|
22
|
-
mizdMint: constants_1.MIZD_TOKEN_MINT,
|
|
23
|
-
admin,
|
|
24
|
-
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
25
|
-
systemProgram: web3_js_1.SystemProgram.programId,
|
|
26
|
-
};
|
|
27
|
-
const instruction = await program.methods
|
|
28
|
-
.initializeEscrowVault(seasonNumber)
|
|
29
|
-
.accounts(accounts)
|
|
30
|
-
.instruction();
|
|
31
|
-
const actualFeePayer = (0, signerHelpers_1.resolveFeePayer)({ feePayer, admin });
|
|
32
|
-
const signers = (0, signerHelpers_1.buildSigners)([(0, signerHelpers_1.asAdminSigner)(admin)], actualFeePayer);
|
|
33
|
-
return (0, instructionResultHelpers_1.singleInstruction)(instruction, {
|
|
34
|
-
signers,
|
|
35
|
-
pdas: { vault: vaultPda },
|
|
36
|
-
});
|
|
37
|
-
}
|