@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.
- package/dist/accounts/index.cjs +6 -6
- package/dist/accounts/index.cjs.map +1 -1
- package/dist/accounts/index.js +6 -6
- package/dist/accounts/index.js.map +1 -1
- package/dist/constants/index.cjs +48 -9
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +125 -9
- package/dist/constants/index.d.ts +125 -9
- package/dist/constants/index.js +46 -10
- package/dist/constants/index.js.map +1 -1
- package/dist/index.cjs +65 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +64 -23
- package/dist/index.js.map +1 -1
- package/dist/instructions/index.cjs +10 -5
- package/dist/instructions/index.cjs.map +1 -1
- package/dist/instructions/index.d.cts +1 -1
- package/dist/instructions/index.d.ts +1 -1
- package/dist/instructions/index.js +11 -6
- package/dist/instructions/index.js.map +1 -1
- package/dist/pdas/index.cjs.map +1 -1
- package/dist/pdas/index.js.map +1 -1
- package/package.json +1 -1
- package/src/accounts/index.ts +3 -3
- package/src/client.ts +2 -2
- package/src/constants/index.ts +55 -9
- package/src/index.ts +3 -0
- package/src/instructions/index.ts +12 -7
|
@@ -138,7 +138,7 @@ declare function approveProject(program: AnyProgram, args: {
|
|
|
138
138
|
projectId: BN;
|
|
139
139
|
/** USDC mint address (for creating lp_usdc_vault) */
|
|
140
140
|
usdcMint: PublicKey;
|
|
141
|
-
},
|
|
141
|
+
}, admin: PublicKey | Keypair): Promise<string>;
|
|
142
142
|
/**
|
|
143
143
|
* Create a milestone for a project
|
|
144
144
|
*
|
|
@@ -138,7 +138,7 @@ declare function approveProject(program: AnyProgram, args: {
|
|
|
138
138
|
projectId: BN;
|
|
139
139
|
/** USDC mint address (for creating lp_usdc_vault) */
|
|
140
140
|
usdcMint: PublicKey;
|
|
141
|
-
},
|
|
141
|
+
}, admin: PublicKey | Keypair): Promise<string>;
|
|
142
142
|
/**
|
|
143
143
|
* Create a milestone for a project
|
|
144
144
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BN } from '@coral-xyz/anchor';
|
|
2
|
-
import { PublicKey, ComputeBudgetProgram, SystemProgram, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RENT_PUBKEY, SYSVAR_CLOCK_PUBKEY } from '@solana/web3.js';
|
|
2
|
+
import { PublicKey, Keypair, ComputeBudgetProgram, SystemProgram, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RENT_PUBKEY, SYSVAR_CLOCK_PUBKEY } from '@solana/web3.js';
|
|
3
3
|
import { getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
|
4
4
|
|
|
5
5
|
// src/instructions/index.ts
|
|
@@ -445,7 +445,8 @@ async function submitForApproval(program, projectId, founder) {
|
|
|
445
445
|
founder
|
|
446
446
|
}).rpc();
|
|
447
447
|
}
|
|
448
|
-
async function approveProject(program, args,
|
|
448
|
+
async function approveProject(program, args, admin) {
|
|
449
|
+
const adminPubkey = admin instanceof Keypair ? admin.publicKey : admin;
|
|
449
450
|
const projectPda = getProjectPDA(args.projectId, program.programId);
|
|
450
451
|
const tokenomicsPda = getTokenomicsPDA(projectPda, program.programId);
|
|
451
452
|
const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
|
|
@@ -461,7 +462,7 @@ async function approveProject(program, args, adminKeypair) {
|
|
|
461
462
|
const computeBudgetIx = ComputeBudgetProgram.setComputeUnitLimit({
|
|
462
463
|
units: 4e5
|
|
463
464
|
});
|
|
464
|
-
|
|
465
|
+
let builder = getMethods(program).approveProject().accountsPartial({
|
|
465
466
|
project: projectPda,
|
|
466
467
|
tokenomics: tokenomicsPda,
|
|
467
468
|
tokenVault: tokenVaultPda,
|
|
@@ -475,9 +476,13 @@ async function approveProject(program, args, adminKeypair) {
|
|
|
475
476
|
futureRoundTokenVault: futureRoundTokenVaultPda,
|
|
476
477
|
futureRoundVault: futureRoundVaultPda,
|
|
477
478
|
usdcMint: args.usdcMint,
|
|
478
|
-
authority:
|
|
479
|
-
payer:
|
|
480
|
-
}).preInstructions([computeBudgetIx])
|
|
479
|
+
authority: adminPubkey,
|
|
480
|
+
payer: adminPubkey
|
|
481
|
+
}).preInstructions([computeBudgetIx]);
|
|
482
|
+
if (admin instanceof Keypair) {
|
|
483
|
+
builder = builder.signers([admin]);
|
|
484
|
+
}
|
|
485
|
+
return builder.rpc();
|
|
481
486
|
}
|
|
482
487
|
async function createMilestone(program, args, founder) {
|
|
483
488
|
const projectPda = getProjectPDA(args.projectId, program.programId);
|