@zemyth/raise-sdk 0.1.4 → 0.1.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.
@@ -447,7 +447,8 @@ async function submitForApproval(program, projectId, founder) {
447
447
  founder
448
448
  }).rpc();
449
449
  }
450
- async function approveProject(program, args, adminKeypair) {
450
+ async function approveProject(program, args, admin) {
451
+ const adminPubkey = admin instanceof web3_js.Keypair ? admin.publicKey : admin;
451
452
  const projectPda = getProjectPDA(args.projectId, program.programId);
452
453
  const tokenomicsPda = getTokenomicsPDA(projectPda, program.programId);
453
454
  const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
@@ -463,7 +464,7 @@ async function approveProject(program, args, adminKeypair) {
463
464
  const computeBudgetIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({
464
465
  units: 4e5
465
466
  });
466
- return getMethods(program).approveProject().accountsPartial({
467
+ let builder = getMethods(program).approveProject().accountsPartial({
467
468
  project: projectPda,
468
469
  tokenomics: tokenomicsPda,
469
470
  tokenVault: tokenVaultPda,
@@ -477,9 +478,13 @@ async function approveProject(program, args, adminKeypair) {
477
478
  futureRoundTokenVault: futureRoundTokenVaultPda,
478
479
  futureRoundVault: futureRoundVaultPda,
479
480
  usdcMint: args.usdcMint,
480
- authority: adminKeypair.publicKey,
481
- payer: adminKeypair.publicKey
482
- }).preInstructions([computeBudgetIx]).signers([adminKeypair]).rpc();
481
+ authority: adminPubkey,
482
+ payer: adminPubkey
483
+ }).preInstructions([computeBudgetIx]);
484
+ if (admin instanceof web3_js.Keypair) {
485
+ builder = builder.signers([admin]);
486
+ }
487
+ return builder.rpc();
483
488
  }
484
489
  async function createMilestone(program, args, founder) {
485
490
  const projectPda = getProjectPDA(args.projectId, program.programId);