@zemyth/raise-sdk 0.2.0 → 0.3.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/accounts/index.cjs +2 -14
- package/dist/accounts/index.cjs.map +1 -1
- package/dist/accounts/index.d.cts +2 -1
- package/dist/accounts/index.d.ts +2 -1
- package/dist/accounts/index.js +2 -14
- package/dist/accounts/index.js.map +1 -1
- package/dist/index.cjs +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/instructions/index.cjs +2 -14
- package/dist/instructions/index.cjs.map +1 -1
- package/dist/instructions/index.d.cts +4 -0
- package/dist/instructions/index.d.ts +4 -0
- package/dist/instructions/index.js +2 -14
- package/dist/instructions/index.js.map +1 -1
- package/dist/pdas/index.cjs.map +1 -1
- package/dist/pdas/index.d.cts +3 -0
- package/dist/pdas/index.d.ts +3 -0
- package/dist/pdas/index.js.map +1 -1
- package/package.json +1 -1
- package/src/accounts/index.ts +3 -2
- package/src/client.ts +5 -2
- package/src/instructions/index.ts +6 -3
- package/src/pdas/index.ts +3 -0
|
@@ -634,6 +634,8 @@ declare function claimSubAllocationTokens(program: AnyProgram, args: {
|
|
|
634
634
|
*/
|
|
635
635
|
declare function claimMilestoneInstantTokens(program: AnyProgram, args: {
|
|
636
636
|
projectId: BN;
|
|
637
|
+
/** Round number the investment belongs to */
|
|
638
|
+
roundNumber: number;
|
|
637
639
|
/** Milestone index to claim instant tokens from */
|
|
638
640
|
milestoneIndex: number;
|
|
639
641
|
/** NFT mint that proves investment ownership */
|
|
@@ -659,6 +661,8 @@ declare function claimMilestoneInstantTokens(program: AnyProgram, args: {
|
|
|
659
661
|
*/
|
|
660
662
|
declare function claimMilestoneVestedTokens(program: AnyProgram, args: {
|
|
661
663
|
projectId: BN;
|
|
664
|
+
/** Round number the investment belongs to */
|
|
665
|
+
roundNumber: number;
|
|
662
666
|
/** Milestone index to claim vested tokens from */
|
|
663
667
|
milestoneIndex: number;
|
|
664
668
|
/** NFT mint that proves investment ownership */
|
|
@@ -634,6 +634,8 @@ declare function claimSubAllocationTokens(program: AnyProgram, args: {
|
|
|
634
634
|
*/
|
|
635
635
|
declare function claimMilestoneInstantTokens(program: AnyProgram, args: {
|
|
636
636
|
projectId: BN;
|
|
637
|
+
/** Round number the investment belongs to */
|
|
638
|
+
roundNumber: number;
|
|
637
639
|
/** Milestone index to claim instant tokens from */
|
|
638
640
|
milestoneIndex: number;
|
|
639
641
|
/** NFT mint that proves investment ownership */
|
|
@@ -659,6 +661,8 @@ declare function claimMilestoneInstantTokens(program: AnyProgram, args: {
|
|
|
659
661
|
*/
|
|
660
662
|
declare function claimMilestoneVestedTokens(program: AnyProgram, args: {
|
|
661
663
|
projectId: BN;
|
|
664
|
+
/** Round number the investment belongs to */
|
|
665
|
+
roundNumber: number;
|
|
662
666
|
/** Milestone index to claim vested tokens from */
|
|
663
667
|
milestoneIndex: number;
|
|
664
668
|
/** NFT mint that proves investment ownership */
|
|
@@ -234,18 +234,6 @@ function getSubAllocationVestingPDA(projectPda, subAllocationId, programId) {
|
|
|
234
234
|
);
|
|
235
235
|
return pda;
|
|
236
236
|
}
|
|
237
|
-
function getInvestorMilestoneVestingPDA(projectPda, milestoneIndex, investmentPda, programId) {
|
|
238
|
-
const [pda] = PublicKey.findProgramAddressSync(
|
|
239
|
-
[
|
|
240
|
-
Buffer.from("investor_ms_vesting"),
|
|
241
|
-
projectPda.toBuffer(),
|
|
242
|
-
Buffer.from([milestoneIndex]),
|
|
243
|
-
investmentPda.toBuffer()
|
|
244
|
-
],
|
|
245
|
-
programId
|
|
246
|
-
);
|
|
247
|
-
return pda;
|
|
248
|
-
}
|
|
249
237
|
function getFounderMilestoneVestingPDA(projectPda, milestoneIndex, programId) {
|
|
250
238
|
const [pda] = PublicKey.findProgramAddressSync(
|
|
251
239
|
[
|
|
@@ -1155,7 +1143,7 @@ async function claimMilestoneInstantTokens(program, args, investor) {
|
|
|
1155
1143
|
const milestonePda = getMilestonePDA(projectPda, args.milestoneIndex, program.programId);
|
|
1156
1144
|
const investmentPda = getInvestmentPDA(projectPda, nftMintPubkey, program.programId);
|
|
1157
1145
|
const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
|
|
1158
|
-
const vestingPda =
|
|
1146
|
+
const vestingPda = getRoundInvestorMilestoneVestingPDA(projectPda, args.roundNumber, args.milestoneIndex, investmentPda, program.programId);
|
|
1159
1147
|
const investorVaultPda = getInvestorVaultPDA(projectPda, program.programId);
|
|
1160
1148
|
const vaultAuthorityPda = getVaultAuthorityPDA(projectPda, program.programId);
|
|
1161
1149
|
const investorNftAccount = getAssociatedTokenAddressSync(
|
|
@@ -1186,7 +1174,7 @@ async function claimMilestoneVestedTokens(program, args, investor) {
|
|
|
1186
1174
|
const milestonePda = getMilestonePDA(projectPda, args.milestoneIndex, program.programId);
|
|
1187
1175
|
const investmentPda = getInvestmentPDA(projectPda, nftMintPubkey, program.programId);
|
|
1188
1176
|
const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
|
|
1189
|
-
const vestingPda =
|
|
1177
|
+
const vestingPda = getRoundInvestorMilestoneVestingPDA(projectPda, args.roundNumber, args.milestoneIndex, investmentPda, program.programId);
|
|
1190
1178
|
const investorVaultPda = getInvestorVaultPDA(projectPda, program.programId);
|
|
1191
1179
|
const vaultAuthorityPda = getVaultAuthorityPDA(projectPda, program.programId);
|
|
1192
1180
|
const investorNftAccount = getAssociatedTokenAddressSync(
|