@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/index.d.cts CHANGED
@@ -102,6 +102,7 @@ declare class RaiseClient {
102
102
  getAllocationVotePDA(proposalPda: PublicKey, nftMint: PublicKey): PublicKey;
103
103
  getSubAllocationVestingPDA(projectPda: PublicKey, subAllocationId: number): PublicKey;
104
104
  getTokenomicsPDA(projectPda: PublicKey): PublicKey;
105
+ /** @deprecated Use {@link getRoundInvestorMilestoneVestingPDA} instead */
105
106
  getInvestorMilestoneVestingPDA(projectPda: PublicKey, milestoneIndex: number, investmentPda: PublicKey): PublicKey;
106
107
  getFounderMilestoneVestingPDA(projectPda: PublicKey, milestoneIndex: number): PublicKey;
107
108
  fetchProject(projectId: BN): Promise<any>;
@@ -120,7 +121,7 @@ declare class RaiseClient {
120
121
  fetchAllAllocationProposals(projectId: BN): Promise<AllocationProposalWithKey[]>;
121
122
  fetchAllocationVote(projectId: BN, proposalIndex: number, nftMint: PublicKey): Promise<any>;
122
123
  fetchSubAllocationVesting(projectId: BN, subAllocationId: number): Promise<any>;
123
- fetchInvestorMilestoneVesting(projectId: BN, milestoneIndex: number, nftMint: PublicKey): Promise<any>;
124
+ fetchInvestorMilestoneVesting(projectId: BN, roundNumber: number, milestoneIndex: number, nftMint: PublicKey): Promise<any>;
124
125
  fetchFounderMilestoneVesting(projectId: BN, milestoneIndex: number): Promise<any>;
125
126
  initializeAdmin(admin: PublicKey): Promise<string>;
126
127
  transferAdmin(newAdmin: PublicKey, adminKeypair: Keypair): Promise<string>;
@@ -415,6 +416,7 @@ declare class RaiseClient {
415
416
  */
416
417
  claimMilestoneInstantTokens(args: {
417
418
  projectId: BN;
419
+ roundNumber: number;
418
420
  milestoneIndex: number;
419
421
  nftMint: PublicKey;
420
422
  investorTokenAccount: PublicKey;
@@ -432,6 +434,7 @@ declare class RaiseClient {
432
434
  */
433
435
  claimMilestoneVestedTokens(args: {
434
436
  projectId: BN;
437
+ roundNumber: number;
435
438
  milestoneIndex: number;
436
439
  nftMint: PublicKey;
437
440
  investorTokenAccount: PublicKey;
package/dist/index.d.ts CHANGED
@@ -102,6 +102,7 @@ declare class RaiseClient {
102
102
  getAllocationVotePDA(proposalPda: PublicKey, nftMint: PublicKey): PublicKey;
103
103
  getSubAllocationVestingPDA(projectPda: PublicKey, subAllocationId: number): PublicKey;
104
104
  getTokenomicsPDA(projectPda: PublicKey): PublicKey;
105
+ /** @deprecated Use {@link getRoundInvestorMilestoneVestingPDA} instead */
105
106
  getInvestorMilestoneVestingPDA(projectPda: PublicKey, milestoneIndex: number, investmentPda: PublicKey): PublicKey;
106
107
  getFounderMilestoneVestingPDA(projectPda: PublicKey, milestoneIndex: number): PublicKey;
107
108
  fetchProject(projectId: BN): Promise<any>;
@@ -120,7 +121,7 @@ declare class RaiseClient {
120
121
  fetchAllAllocationProposals(projectId: BN): Promise<AllocationProposalWithKey[]>;
121
122
  fetchAllocationVote(projectId: BN, proposalIndex: number, nftMint: PublicKey): Promise<any>;
122
123
  fetchSubAllocationVesting(projectId: BN, subAllocationId: number): Promise<any>;
123
- fetchInvestorMilestoneVesting(projectId: BN, milestoneIndex: number, nftMint: PublicKey): Promise<any>;
124
+ fetchInvestorMilestoneVesting(projectId: BN, roundNumber: number, milestoneIndex: number, nftMint: PublicKey): Promise<any>;
124
125
  fetchFounderMilestoneVesting(projectId: BN, milestoneIndex: number): Promise<any>;
125
126
  initializeAdmin(admin: PublicKey): Promise<string>;
126
127
  transferAdmin(newAdmin: PublicKey, adminKeypair: Keypair): Promise<string>;
@@ -415,6 +416,7 @@ declare class RaiseClient {
415
416
  */
416
417
  claimMilestoneInstantTokens(args: {
417
418
  projectId: BN;
419
+ roundNumber: number;
418
420
  milestoneIndex: number;
419
421
  nftMint: PublicKey;
420
422
  investorTokenAccount: PublicKey;
@@ -432,6 +434,7 @@ declare class RaiseClient {
432
434
  */
433
435
  claimMilestoneVestedTokens(args: {
434
436
  projectId: BN;
437
+ roundNumber: number;
435
438
  milestoneIndex: number;
436
439
  nftMint: PublicKey;
437
440
  investorTokenAccount: PublicKey;
package/dist/index.js CHANGED
@@ -796,11 +796,11 @@ async function fetchSubAllocationVesting(program, projectId, subAllocationId) {
796
796
  throw error;
797
797
  }
798
798
  }
799
- async function fetchInvestorMilestoneVesting(program, projectId, milestoneIndex, nftMint) {
799
+ async function fetchInvestorMilestoneVesting(program, projectId, roundNumber, milestoneIndex, nftMint) {
800
800
  try {
801
801
  const projectPda = getProjectPDA(projectId, program.programId);
802
802
  const investmentPda = getInvestmentPDA(projectPda, nftMint, program.programId);
803
- const vestingPda = getInvestorMilestoneVestingPDA(projectPda, milestoneIndex, investmentPda, program.programId);
803
+ const vestingPda = getRoundInvestorMilestoneVestingPDA(projectPda, roundNumber, milestoneIndex, investmentPda, program.programId);
804
804
  return await getAccountNamespace(program).investorMilestoneVesting.fetch(vestingPda);
805
805
  } catch (error) {
806
806
  if (error instanceof Error && error.message?.includes("Account does not exist")) {
@@ -1899,7 +1899,7 @@ async function claimMilestoneInstantTokens(program, args, investor) {
1899
1899
  const milestonePda = getMilestonePDA(projectPda, args.milestoneIndex, program.programId);
1900
1900
  const investmentPda = getInvestmentPDA(projectPda, nftMintPubkey, program.programId);
1901
1901
  const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
1902
- const vestingPda = getInvestorMilestoneVestingPDA(projectPda, args.milestoneIndex, investmentPda, program.programId);
1902
+ const vestingPda = getRoundInvestorMilestoneVestingPDA(projectPda, args.roundNumber, args.milestoneIndex, investmentPda, program.programId);
1903
1903
  const investorVaultPda = getInvestorVaultPDA(projectPda, program.programId);
1904
1904
  const vaultAuthorityPda = getVaultAuthorityPDA(projectPda, program.programId);
1905
1905
  const investorNftAccount = getAssociatedTokenAddressSync(
@@ -1930,7 +1930,7 @@ async function claimMilestoneVestedTokens(program, args, investor) {
1930
1930
  const milestonePda = getMilestonePDA(projectPda, args.milestoneIndex, program.programId);
1931
1931
  const investmentPda = getInvestmentPDA(projectPda, nftMintPubkey, program.programId);
1932
1932
  const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
1933
- const vestingPda = getInvestorMilestoneVestingPDA(projectPda, args.milestoneIndex, investmentPda, program.programId);
1933
+ const vestingPda = getRoundInvestorMilestoneVestingPDA(projectPda, args.roundNumber, args.milestoneIndex, investmentPda, program.programId);
1934
1934
  const investorVaultPda = getInvestorVaultPDA(projectPda, program.programId);
1935
1935
  const vaultAuthorityPda = getVaultAuthorityPDA(projectPda, program.programId);
1936
1936
  const investorNftAccount = getAssociatedTokenAddressSync(
@@ -2395,6 +2395,7 @@ var RaiseClient = class _RaiseClient {
2395
2395
  return getTokenomicsPDA(projectPda, this.programId);
2396
2396
  }
2397
2397
  // Per-Milestone Vesting PDAs
2398
+ /** @deprecated Use {@link getRoundInvestorMilestoneVestingPDA} instead */
2398
2399
  getInvestorMilestoneVestingPDA(projectPda, milestoneIndex, investmentPda) {
2399
2400
  return getInvestorMilestoneVestingPDA(projectPda, milestoneIndex, investmentPda, this.programId);
2400
2401
  }
@@ -2452,8 +2453,8 @@ var RaiseClient = class _RaiseClient {
2452
2453
  async fetchSubAllocationVesting(projectId, subAllocationId) {
2453
2454
  return fetchSubAllocationVesting(this.program, projectId, subAllocationId);
2454
2455
  }
2455
- async fetchInvestorMilestoneVesting(projectId, milestoneIndex, nftMint) {
2456
- return fetchInvestorMilestoneVesting(this.program, projectId, milestoneIndex, nftMint);
2456
+ async fetchInvestorMilestoneVesting(projectId, roundNumber, milestoneIndex, nftMint) {
2457
+ return fetchInvestorMilestoneVesting(this.program, projectId, roundNumber, milestoneIndex, nftMint);
2457
2458
  }
2458
2459
  async fetchFounderMilestoneVesting(projectId, milestoneIndex) {
2459
2460
  return fetchFounderMilestoneVesting(this.program, projectId, milestoneIndex);