@zemyth/raise-sdk 0.1.7 → 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/constants/index.cjs +1 -0
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/index.cjs +26 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +26 -8
- package/dist/index.js.map +1 -1
- package/dist/instructions/index.cjs +17 -15
- 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 +17 -15
- package/dist/instructions/index.js.map +1 -1
- package/dist/pdas/index.cjs +9 -0
- package/dist/pdas/index.cjs.map +1 -1
- package/dist/pdas/index.d.cts +15 -1
- package/dist/pdas/index.d.ts +15 -1
- package/dist/pdas/index.js +9 -1
- package/dist/pdas/index.js.map +1 -1
- package/package.json +1 -1
- package/src/accounts/index.ts +3 -2
- package/src/client.ts +9 -2
- package/src/constants/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/instructions/index.ts +17 -6
- package/src/pdas/index.ts +21 -0
package/dist/index.d.cts
CHANGED
|
@@ -8,7 +8,7 @@ export { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
|
8
8
|
import { TokenomicsInput } from './instructions/index.cjs';
|
|
9
9
|
export { MAX_DEADLINE_DURATION_SECONDS, MIN_DEADLINE_DURATION_SECONDS_DEV, MIN_DEADLINE_DURATION_SECONDS_PROD, acceptAdmin, addSubAllocation, approvePivot, approveProject, calculateDeadline, cancelInvestment, cancelRoundInvestment, checkAbandonment, claimEarlyTokens, claimExitWindowRefund, claimFounderEarlyTokens, claimFounderMilestoneTokens, claimFounderMsInstantTokens, claimFounderMsVestedTokens, claimInvestorTokens, claimMilestoneFunds, claimMilestoneInstantTokens, claimMilestoneVestedTokens, claimMissedUnlock, claimRefund, claimRoundEarlyTokens, claimRoundInstantTokens, claimRoundMilestoneFunds, claimRoundVestedTokens, claimSubAllocationTokens, claimTokens, claimVestedTokens, completeDistribution, createMilestone, depositTokens, distributeTokens, executeAllocationChange, extendMilestoneDeadline, finalizePivot, finalizeRoundVoting, finalizeVoting, forceCompleteDistribution, initializeAdmin, initializeFounderVesting, initializeProject, initializeSubAllocationVesting, invest, investInRound, minDeadline, openFundingRound, proposeAllocationChange, proposePivot, releaseHoldback, reportScam, resubmitMilestone, setMilestoneDeadline, setTgeDate, submitForApproval, submitMilestone, submitRoundMilestone, symbolToBytes, transferAdmin, validateDeadline, voteAllocationChange, voteOnMilestone, voteOnRoundMilestone, withdrawFromPivot } from './instructions/index.cjs';
|
|
10
10
|
export { GOVERNANCE, InvestmentTier, NFT, SEEDS, TIER_CONSTRAINTS, TIER_MINIMUMS, TIER_TOKEN_MULTIPLIERS, TIER_VOTE_MULTIPLIERS, TIMING, TIMING_DEV, TIMING_PRODUCTION, TOKENOMICS, USDC, VALIDATION, findTierIndex, getTierFromAmount, getTimingConstants, getTokenMultiplier, getVoteMultiplier } from './constants/index.cjs';
|
|
11
|
-
export { getAdminConfigPDA, getEscrowPDA, getFounderVaultPDA, getFounderVestingPDA, getFundingRoundPDA, getFutureRoundTokenVaultPDA, getFutureRoundVaultPDA, getInvestmentPDA, getInvestorVaultPDA, getLpTokenVaultPDA, getLpUsdcVaultPDA, getMilestonePDA, getNftMintPDA, getPivotProposalPDA, getProgramAuthorityPDA, getProjectPDA, getProjectPDAs, getRoundEscrowPDA, getRoundInvestmentPDA, getRoundInvestorMilestoneVestingPDA, getRoundMilestonePDA, getRoundNftMintPDA, getScamReportPDA, getTgeEscrowPDA, getTokenMintPDA, getTokenVaultPDA, getTokenomicsPDA, getTreasuryVaultPDA, getVaultAuthorityPDA, getVotePDA } from './pdas/index.cjs';
|
|
11
|
+
export { getAdminConfigPDA, getEscrowPDA, getEscrowTokenAccountPDA, getFounderVaultPDA, getFounderVestingPDA, getFundingRoundPDA, getFutureRoundTokenVaultPDA, getFutureRoundVaultPDA, getInvestmentPDA, getInvestorVaultPDA, getLpTokenVaultPDA, getLpUsdcVaultPDA, getMilestonePDA, getNftMintPDA, getPivotProposalPDA, getProgramAuthorityPDA, getProjectPDA, getProjectPDAs, getRoundEscrowPDA, getRoundInvestmentPDA, getRoundInvestorMilestoneVestingPDA, getRoundMilestonePDA, getRoundNftMintPDA, getScamReportPDA, getTgeEscrowPDA, getTokenMintPDA, getTokenVaultPDA, getTokenomicsPDA, getTreasuryVaultPDA, getVaultAuthorityPDA, getVotePDA } from './pdas/index.cjs';
|
|
12
12
|
export { EARLY_TOKEN_COOLING_PERIOD_SECONDS, EARLY_TOKEN_COOLING_PERIOD_SECONDS_DEV, EARLY_TOKEN_RELEASE_BPS, accountExists, calculateEarlyTokenAmount, calculateRemainingAllocation, canClaimEarlyTokens, canClaimFounderEarlyTokens, canClaimFounderMilestoneTokens, canClaimRoundEarlyTokens, fetchAdminConfig, fetchAllFundingRounds, fetchAllInvestments, fetchAllMilestones, fetchAllVotes, fetchFundingRound, fetchFutureRoundVault, fetchInvestment, fetchMilestone, fetchPivotProposal, fetchProject, fetchProjectByPda, fetchRoundInvestment, fetchRoundInvestorMilestoneVesting, fetchRoundMilestone, fetchTgeEscrow, fetchVote, requiresBurnForRefund } from './accounts/index.cjs';
|
|
13
13
|
export { ERROR_CODES, ERROR_MESSAGES, RaiseError, getErrorMessage, isRaiseError, parseError } from './errors/index.cjs';
|
|
14
14
|
|
|
@@ -90,6 +90,7 @@ declare class RaiseClient {
|
|
|
90
90
|
get walletPublicKey(): PublicKey;
|
|
91
91
|
getProjectPDA(projectId: BN): PublicKey;
|
|
92
92
|
getEscrowPDA(projectId: BN): PublicKey;
|
|
93
|
+
getEscrowTokenAccountPDA(projectPda: PublicKey): PublicKey;
|
|
93
94
|
getMilestonePDA(projectPda: PublicKey, milestoneIndex: number): PublicKey;
|
|
94
95
|
getInvestmentPDA(projectPda: PublicKey, nftMint: PublicKey): PublicKey;
|
|
95
96
|
getVotePDA(milestonePda: PublicKey, voterKey: PublicKey, votingRound: number): PublicKey;
|
|
@@ -101,6 +102,7 @@ declare class RaiseClient {
|
|
|
101
102
|
getAllocationVotePDA(proposalPda: PublicKey, nftMint: PublicKey): PublicKey;
|
|
102
103
|
getSubAllocationVestingPDA(projectPda: PublicKey, subAllocationId: number): PublicKey;
|
|
103
104
|
getTokenomicsPDA(projectPda: PublicKey): PublicKey;
|
|
105
|
+
/** @deprecated Use {@link getRoundInvestorMilestoneVestingPDA} instead */
|
|
104
106
|
getInvestorMilestoneVestingPDA(projectPda: PublicKey, milestoneIndex: number, investmentPda: PublicKey): PublicKey;
|
|
105
107
|
getFounderMilestoneVestingPDA(projectPda: PublicKey, milestoneIndex: number): PublicKey;
|
|
106
108
|
fetchProject(projectId: BN): Promise<any>;
|
|
@@ -119,7 +121,7 @@ declare class RaiseClient {
|
|
|
119
121
|
fetchAllAllocationProposals(projectId: BN): Promise<AllocationProposalWithKey[]>;
|
|
120
122
|
fetchAllocationVote(projectId: BN, proposalIndex: number, nftMint: PublicKey): Promise<any>;
|
|
121
123
|
fetchSubAllocationVesting(projectId: BN, subAllocationId: number): Promise<any>;
|
|
122
|
-
fetchInvestorMilestoneVesting(projectId: BN, milestoneIndex: number, nftMint: PublicKey): Promise<any>;
|
|
124
|
+
fetchInvestorMilestoneVesting(projectId: BN, roundNumber: number, milestoneIndex: number, nftMint: PublicKey): Promise<any>;
|
|
123
125
|
fetchFounderMilestoneVesting(projectId: BN, milestoneIndex: number): Promise<any>;
|
|
124
126
|
initializeAdmin(admin: PublicKey): Promise<string>;
|
|
125
127
|
transferAdmin(newAdmin: PublicKey, adminKeypair: Keypair): Promise<string>;
|
|
@@ -414,6 +416,7 @@ declare class RaiseClient {
|
|
|
414
416
|
*/
|
|
415
417
|
claimMilestoneInstantTokens(args: {
|
|
416
418
|
projectId: BN;
|
|
419
|
+
roundNumber: number;
|
|
417
420
|
milestoneIndex: number;
|
|
418
421
|
nftMint: PublicKey;
|
|
419
422
|
investorTokenAccount: PublicKey;
|
|
@@ -431,6 +434,7 @@ declare class RaiseClient {
|
|
|
431
434
|
*/
|
|
432
435
|
claimMilestoneVestedTokens(args: {
|
|
433
436
|
projectId: BN;
|
|
437
|
+
roundNumber: number;
|
|
434
438
|
milestoneIndex: number;
|
|
435
439
|
nftMint: PublicKey;
|
|
436
440
|
investorTokenAccount: PublicKey;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
|
8
8
|
import { TokenomicsInput } from './instructions/index.js';
|
|
9
9
|
export { MAX_DEADLINE_DURATION_SECONDS, MIN_DEADLINE_DURATION_SECONDS_DEV, MIN_DEADLINE_DURATION_SECONDS_PROD, acceptAdmin, addSubAllocation, approvePivot, approveProject, calculateDeadline, cancelInvestment, cancelRoundInvestment, checkAbandonment, claimEarlyTokens, claimExitWindowRefund, claimFounderEarlyTokens, claimFounderMilestoneTokens, claimFounderMsInstantTokens, claimFounderMsVestedTokens, claimInvestorTokens, claimMilestoneFunds, claimMilestoneInstantTokens, claimMilestoneVestedTokens, claimMissedUnlock, claimRefund, claimRoundEarlyTokens, claimRoundInstantTokens, claimRoundMilestoneFunds, claimRoundVestedTokens, claimSubAllocationTokens, claimTokens, claimVestedTokens, completeDistribution, createMilestone, depositTokens, distributeTokens, executeAllocationChange, extendMilestoneDeadline, finalizePivot, finalizeRoundVoting, finalizeVoting, forceCompleteDistribution, initializeAdmin, initializeFounderVesting, initializeProject, initializeSubAllocationVesting, invest, investInRound, minDeadline, openFundingRound, proposeAllocationChange, proposePivot, releaseHoldback, reportScam, resubmitMilestone, setMilestoneDeadline, setTgeDate, submitForApproval, submitMilestone, submitRoundMilestone, symbolToBytes, transferAdmin, validateDeadline, voteAllocationChange, voteOnMilestone, voteOnRoundMilestone, withdrawFromPivot } from './instructions/index.js';
|
|
10
10
|
export { GOVERNANCE, InvestmentTier, NFT, SEEDS, TIER_CONSTRAINTS, TIER_MINIMUMS, TIER_TOKEN_MULTIPLIERS, TIER_VOTE_MULTIPLIERS, TIMING, TIMING_DEV, TIMING_PRODUCTION, TOKENOMICS, USDC, VALIDATION, findTierIndex, getTierFromAmount, getTimingConstants, getTokenMultiplier, getVoteMultiplier } from './constants/index.js';
|
|
11
|
-
export { getAdminConfigPDA, getEscrowPDA, getFounderVaultPDA, getFounderVestingPDA, getFundingRoundPDA, getFutureRoundTokenVaultPDA, getFutureRoundVaultPDA, getInvestmentPDA, getInvestorVaultPDA, getLpTokenVaultPDA, getLpUsdcVaultPDA, getMilestonePDA, getNftMintPDA, getPivotProposalPDA, getProgramAuthorityPDA, getProjectPDA, getProjectPDAs, getRoundEscrowPDA, getRoundInvestmentPDA, getRoundInvestorMilestoneVestingPDA, getRoundMilestonePDA, getRoundNftMintPDA, getScamReportPDA, getTgeEscrowPDA, getTokenMintPDA, getTokenVaultPDA, getTokenomicsPDA, getTreasuryVaultPDA, getVaultAuthorityPDA, getVotePDA } from './pdas/index.js';
|
|
11
|
+
export { getAdminConfigPDA, getEscrowPDA, getEscrowTokenAccountPDA, getFounderVaultPDA, getFounderVestingPDA, getFundingRoundPDA, getFutureRoundTokenVaultPDA, getFutureRoundVaultPDA, getInvestmentPDA, getInvestorVaultPDA, getLpTokenVaultPDA, getLpUsdcVaultPDA, getMilestonePDA, getNftMintPDA, getPivotProposalPDA, getProgramAuthorityPDA, getProjectPDA, getProjectPDAs, getRoundEscrowPDA, getRoundInvestmentPDA, getRoundInvestorMilestoneVestingPDA, getRoundMilestonePDA, getRoundNftMintPDA, getScamReportPDA, getTgeEscrowPDA, getTokenMintPDA, getTokenVaultPDA, getTokenomicsPDA, getTreasuryVaultPDA, getVaultAuthorityPDA, getVotePDA } from './pdas/index.js';
|
|
12
12
|
export { EARLY_TOKEN_COOLING_PERIOD_SECONDS, EARLY_TOKEN_COOLING_PERIOD_SECONDS_DEV, EARLY_TOKEN_RELEASE_BPS, accountExists, calculateEarlyTokenAmount, calculateRemainingAllocation, canClaimEarlyTokens, canClaimFounderEarlyTokens, canClaimFounderMilestoneTokens, canClaimRoundEarlyTokens, fetchAdminConfig, fetchAllFundingRounds, fetchAllInvestments, fetchAllMilestones, fetchAllVotes, fetchFundingRound, fetchFutureRoundVault, fetchInvestment, fetchMilestone, fetchPivotProposal, fetchProject, fetchProjectByPda, fetchRoundInvestment, fetchRoundInvestorMilestoneVesting, fetchRoundMilestone, fetchTgeEscrow, fetchVote, requiresBurnForRefund } from './accounts/index.js';
|
|
13
13
|
export { ERROR_CODES, ERROR_MESSAGES, RaiseError, getErrorMessage, isRaiseError, parseError } from './errors/index.js';
|
|
14
14
|
|
|
@@ -90,6 +90,7 @@ declare class RaiseClient {
|
|
|
90
90
|
get walletPublicKey(): PublicKey;
|
|
91
91
|
getProjectPDA(projectId: BN): PublicKey;
|
|
92
92
|
getEscrowPDA(projectId: BN): PublicKey;
|
|
93
|
+
getEscrowTokenAccountPDA(projectPda: PublicKey): PublicKey;
|
|
93
94
|
getMilestonePDA(projectPda: PublicKey, milestoneIndex: number): PublicKey;
|
|
94
95
|
getInvestmentPDA(projectPda: PublicKey, nftMint: PublicKey): PublicKey;
|
|
95
96
|
getVotePDA(milestonePda: PublicKey, voterKey: PublicKey, votingRound: number): PublicKey;
|
|
@@ -101,6 +102,7 @@ declare class RaiseClient {
|
|
|
101
102
|
getAllocationVotePDA(proposalPda: PublicKey, nftMint: PublicKey): PublicKey;
|
|
102
103
|
getSubAllocationVestingPDA(projectPda: PublicKey, subAllocationId: number): PublicKey;
|
|
103
104
|
getTokenomicsPDA(projectPda: PublicKey): PublicKey;
|
|
105
|
+
/** @deprecated Use {@link getRoundInvestorMilestoneVestingPDA} instead */
|
|
104
106
|
getInvestorMilestoneVestingPDA(projectPda: PublicKey, milestoneIndex: number, investmentPda: PublicKey): PublicKey;
|
|
105
107
|
getFounderMilestoneVestingPDA(projectPda: PublicKey, milestoneIndex: number): PublicKey;
|
|
106
108
|
fetchProject(projectId: BN): Promise<any>;
|
|
@@ -119,7 +121,7 @@ declare class RaiseClient {
|
|
|
119
121
|
fetchAllAllocationProposals(projectId: BN): Promise<AllocationProposalWithKey[]>;
|
|
120
122
|
fetchAllocationVote(projectId: BN, proposalIndex: number, nftMint: PublicKey): Promise<any>;
|
|
121
123
|
fetchSubAllocationVesting(projectId: BN, subAllocationId: number): Promise<any>;
|
|
122
|
-
fetchInvestorMilestoneVesting(projectId: BN, milestoneIndex: number, nftMint: PublicKey): Promise<any>;
|
|
124
|
+
fetchInvestorMilestoneVesting(projectId: BN, roundNumber: number, milestoneIndex: number, nftMint: PublicKey): Promise<any>;
|
|
123
125
|
fetchFounderMilestoneVesting(projectId: BN, milestoneIndex: number): Promise<any>;
|
|
124
126
|
initializeAdmin(admin: PublicKey): Promise<string>;
|
|
125
127
|
transferAdmin(newAdmin: PublicKey, adminKeypair: Keypair): Promise<string>;
|
|
@@ -414,6 +416,7 @@ declare class RaiseClient {
|
|
|
414
416
|
*/
|
|
415
417
|
claimMilestoneInstantTokens(args: {
|
|
416
418
|
projectId: BN;
|
|
419
|
+
roundNumber: number;
|
|
417
420
|
milestoneIndex: number;
|
|
418
421
|
nftMint: PublicKey;
|
|
419
422
|
investorTokenAccount: PublicKey;
|
|
@@ -431,6 +434,7 @@ declare class RaiseClient {
|
|
|
431
434
|
*/
|
|
432
435
|
claimMilestoneVestedTokens(args: {
|
|
433
436
|
projectId: BN;
|
|
437
|
+
roundNumber: number;
|
|
434
438
|
milestoneIndex: number;
|
|
435
439
|
nftMint: PublicKey;
|
|
436
440
|
investorTokenAccount: PublicKey;
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var SEEDS = {
|
|
|
13
13
|
INVESTMENT: "investment",
|
|
14
14
|
VOTE: "vote",
|
|
15
15
|
ESCROW: "escrow",
|
|
16
|
+
ESCROW_TOKEN: "escrow_token",
|
|
16
17
|
PIVOT: "pivot",
|
|
17
18
|
PIVOT_PROPOSAL: "pivot_proposal",
|
|
18
19
|
TGE_ESCROW: "tge_escrow",
|
|
@@ -246,6 +247,13 @@ function getEscrowPDA(projectId, programId) {
|
|
|
246
247
|
);
|
|
247
248
|
return pda;
|
|
248
249
|
}
|
|
250
|
+
function getEscrowTokenAccountPDA(projectPda, programId) {
|
|
251
|
+
const [pda] = PublicKey.findProgramAddressSync(
|
|
252
|
+
[Buffer.from(SEEDS.ESCROW_TOKEN), projectPda.toBuffer()],
|
|
253
|
+
programId
|
|
254
|
+
);
|
|
255
|
+
return pda;
|
|
256
|
+
}
|
|
249
257
|
function getMilestonePDA(projectPda, milestoneIndex, programId) {
|
|
250
258
|
const [pda] = PublicKey.findProgramAddressSync(
|
|
251
259
|
[
|
|
@@ -788,11 +796,11 @@ async function fetchSubAllocationVesting(program, projectId, subAllocationId) {
|
|
|
788
796
|
throw error;
|
|
789
797
|
}
|
|
790
798
|
}
|
|
791
|
-
async function fetchInvestorMilestoneVesting(program, projectId, milestoneIndex, nftMint) {
|
|
799
|
+
async function fetchInvestorMilestoneVesting(program, projectId, roundNumber, milestoneIndex, nftMint) {
|
|
792
800
|
try {
|
|
793
801
|
const projectPda = getProjectPDA(projectId, program.programId);
|
|
794
802
|
const investmentPda = getInvestmentPDA(projectPda, nftMint, program.programId);
|
|
795
|
-
const vestingPda =
|
|
803
|
+
const vestingPda = getRoundInvestorMilestoneVestingPDA(projectPda, roundNumber, milestoneIndex, investmentPda, program.programId);
|
|
796
804
|
return await getAccountNamespace(program).investorMilestoneVesting.fetch(vestingPda);
|
|
797
805
|
} catch (error) {
|
|
798
806
|
if (error instanceof Error && error.message?.includes("Account does not exist")) {
|
|
@@ -1203,6 +1211,8 @@ async function approveProject(program, args, admin) {
|
|
|
1203
1211
|
const lpUsdcVaultPda = getLpUsdcVaultPDA(projectPda, program.programId);
|
|
1204
1212
|
const futureRoundTokenVaultPda = getFutureRoundTokenVaultPDA(projectPda, program.programId);
|
|
1205
1213
|
const futureRoundVaultPda = getFutureRoundVaultPDA(projectPda, program.programId);
|
|
1214
|
+
const escrowPda = getEscrowPDA(args.projectId, program.programId);
|
|
1215
|
+
const escrowTokenAccountPda = getEscrowTokenAccountPDA(projectPda, program.programId);
|
|
1206
1216
|
const computeBudgetIx = ComputeBudgetProgram.setComputeUnitLimit({
|
|
1207
1217
|
units: 4e5
|
|
1208
1218
|
});
|
|
@@ -1220,6 +1230,8 @@ async function approveProject(program, args, admin) {
|
|
|
1220
1230
|
futureRoundTokenVault: futureRoundTokenVaultPda,
|
|
1221
1231
|
futureRoundVault: futureRoundVaultPda,
|
|
1222
1232
|
usdcMint: args.usdcMint,
|
|
1233
|
+
escrowPda,
|
|
1234
|
+
escrowTokenAccount: escrowTokenAccountPda,
|
|
1223
1235
|
authority: adminPubkey,
|
|
1224
1236
|
payer: adminPubkey
|
|
1225
1237
|
}).preInstructions([computeBudgetIx]);
|
|
@@ -1293,7 +1305,8 @@ async function claimMilestoneFunds(program, args, founder) {
|
|
|
1293
1305
|
const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
|
|
1294
1306
|
const tokenomicsPda = getTokenomicsPDA(projectPda, program.programId);
|
|
1295
1307
|
const lpUsdcVaultPda = getLpUsdcVaultPDA(projectPda, program.programId);
|
|
1296
|
-
const
|
|
1308
|
+
const isFinal = args.nextMilestoneDeadline.eq(new BN(0));
|
|
1309
|
+
const nextMilestonePda = args.nextMilestonePda ?? (!isFinal ? getMilestonePDA(projectPda, args.milestoneIndex + 1, program.programId) : null);
|
|
1297
1310
|
return getMethods(program).claimMilestoneFunds({ nextMilestoneDeadline: args.nextMilestoneDeadline }).accountsPartial({
|
|
1298
1311
|
milestone: milestonePda,
|
|
1299
1312
|
project: projectPda,
|
|
@@ -1305,6 +1318,7 @@ async function claimMilestoneFunds(program, args, founder) {
|
|
|
1305
1318
|
tokenomics: tokenomicsPda,
|
|
1306
1319
|
lpUsdcVault: lpUsdcVaultPda,
|
|
1307
1320
|
nextMilestone: nextMilestonePda,
|
|
1321
|
+
// null for final → Anchor uses programId sentinel
|
|
1308
1322
|
systemProgram: SystemProgram.programId,
|
|
1309
1323
|
tokenProgram: TOKEN_PROGRAM_ID
|
|
1310
1324
|
}).rpc();
|
|
@@ -1885,7 +1899,7 @@ async function claimMilestoneInstantTokens(program, args, investor) {
|
|
|
1885
1899
|
const milestonePda = getMilestonePDA(projectPda, args.milestoneIndex, program.programId);
|
|
1886
1900
|
const investmentPda = getInvestmentPDA(projectPda, nftMintPubkey, program.programId);
|
|
1887
1901
|
const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
|
|
1888
|
-
const vestingPda =
|
|
1902
|
+
const vestingPda = getRoundInvestorMilestoneVestingPDA(projectPda, args.roundNumber, args.milestoneIndex, investmentPda, program.programId);
|
|
1889
1903
|
const investorVaultPda = getInvestorVaultPDA(projectPda, program.programId);
|
|
1890
1904
|
const vaultAuthorityPda = getVaultAuthorityPDA(projectPda, program.programId);
|
|
1891
1905
|
const investorNftAccount = getAssociatedTokenAddressSync(
|
|
@@ -1916,7 +1930,7 @@ async function claimMilestoneVestedTokens(program, args, investor) {
|
|
|
1916
1930
|
const milestonePda = getMilestonePDA(projectPda, args.milestoneIndex, program.programId);
|
|
1917
1931
|
const investmentPda = getInvestmentPDA(projectPda, nftMintPubkey, program.programId);
|
|
1918
1932
|
const tokenVaultPda = getTokenVaultPDA(projectPda, program.programId);
|
|
1919
|
-
const vestingPda =
|
|
1933
|
+
const vestingPda = getRoundInvestorMilestoneVestingPDA(projectPda, args.roundNumber, args.milestoneIndex, investmentPda, program.programId);
|
|
1920
1934
|
const investorVaultPda = getInvestorVaultPDA(projectPda, program.programId);
|
|
1921
1935
|
const vaultAuthorityPda = getVaultAuthorityPDA(projectPda, program.programId);
|
|
1922
1936
|
const investorNftAccount = getAssociatedTokenAddressSync(
|
|
@@ -2344,6 +2358,9 @@ var RaiseClient = class _RaiseClient {
|
|
|
2344
2358
|
getEscrowPDA(projectId) {
|
|
2345
2359
|
return getEscrowPDA(projectId, this.programId);
|
|
2346
2360
|
}
|
|
2361
|
+
getEscrowTokenAccountPDA(projectPda) {
|
|
2362
|
+
return getEscrowTokenAccountPDA(projectPda, this.programId);
|
|
2363
|
+
}
|
|
2347
2364
|
getMilestonePDA(projectPda, milestoneIndex) {
|
|
2348
2365
|
return getMilestonePDA(projectPda, milestoneIndex, this.programId);
|
|
2349
2366
|
}
|
|
@@ -2378,6 +2395,7 @@ var RaiseClient = class _RaiseClient {
|
|
|
2378
2395
|
return getTokenomicsPDA(projectPda, this.programId);
|
|
2379
2396
|
}
|
|
2380
2397
|
// Per-Milestone Vesting PDAs
|
|
2398
|
+
/** @deprecated Use {@link getRoundInvestorMilestoneVestingPDA} instead */
|
|
2381
2399
|
getInvestorMilestoneVestingPDA(projectPda, milestoneIndex, investmentPda) {
|
|
2382
2400
|
return getInvestorMilestoneVestingPDA(projectPda, milestoneIndex, investmentPda, this.programId);
|
|
2383
2401
|
}
|
|
@@ -2435,8 +2453,8 @@ var RaiseClient = class _RaiseClient {
|
|
|
2435
2453
|
async fetchSubAllocationVesting(projectId, subAllocationId) {
|
|
2436
2454
|
return fetchSubAllocationVesting(this.program, projectId, subAllocationId);
|
|
2437
2455
|
}
|
|
2438
|
-
async fetchInvestorMilestoneVesting(projectId, milestoneIndex, nftMint) {
|
|
2439
|
-
return fetchInvestorMilestoneVesting(this.program, projectId, milestoneIndex, nftMint);
|
|
2456
|
+
async fetchInvestorMilestoneVesting(projectId, roundNumber, milestoneIndex, nftMint) {
|
|
2457
|
+
return fetchInvestorMilestoneVesting(this.program, projectId, roundNumber, milestoneIndex, nftMint);
|
|
2440
2458
|
}
|
|
2441
2459
|
async fetchFounderMilestoneVesting(projectId, milestoneIndex) {
|
|
2442
2460
|
return fetchFounderMilestoneVesting(this.program, projectId, milestoneIndex);
|
|
@@ -3869,6 +3887,6 @@ function shortenPublicKey(pubkey, chars = 4) {
|
|
|
3869
3887
|
return `${str.slice(0, chars)}...${str.slice(-chars)}`;
|
|
3870
3888
|
}
|
|
3871
3889
|
|
|
3872
|
-
export { EARLY_TOKEN_COOLING_PERIOD_SECONDS, EARLY_TOKEN_COOLING_PERIOD_SECONDS_DEV, EARLY_TOKEN_RELEASE_BPS, ERROR_CODES, ERROR_MESSAGES, EVENT_NAMES, FundingRoundState, GOVERNANCE, InvestmentTier, MAX_DEADLINE_DURATION_SECONDS, MIN_DEADLINE_DURATION_SECONDS_DEV, MIN_DEADLINE_DURATION_SECONDS_PROD, MilestoneState, NFT, PivotState, ProjectState, RaiseClient, RaiseError, SEEDS, TIER_CONSTRAINTS, TIER_MINIMUMS, TIER_TOKEN_MULTIPLIERS, TIER_VOTE_MULTIPLIERS, TIMING, TIMING_DEV, TIMING_PRODUCTION, TOKENOMICS, USDC, VALIDATION, VoteChoice, acceptAdmin, accountExists, addSubAllocation, approvePivot, approveProject, bigIntToBN, bnToBigInt, bnToNumber, bpsToPercent, calculateDeadline, calculateEarlyTokenAmount, calculateRemainingAllocation, canClaimEarlyTokens, canClaimFounderEarlyTokens, canClaimFounderMilestoneTokens, canClaimRoundEarlyTokens, cancelInvestment, cancelRoundInvestment, checkAbandonment, claimEarlyTokens, claimExitWindowRefund, claimFounderEarlyTokens, claimFounderMilestoneTokens, claimFounderMsInstantTokens, claimFounderMsVestedTokens, claimInvestorTokens, claimMilestoneFunds, claimMilestoneInstantTokens, claimMilestoneVestedTokens, claimMissedUnlock, claimRefund, claimRoundEarlyTokens, claimRoundInstantTokens, claimRoundMilestoneFunds, claimRoundVestedTokens, claimSubAllocationTokens, claimTokens, claimVestedTokens, completeDistribution, confirmTransaction, createMilestone, depositTokens, distributeTokens, executeAllocationChange, extendMilestoneDeadline, fetchAdminConfig, fetchAllFundingRounds, fetchAllInvestments, fetchAllMilestones, fetchAllVotes, fetchFundingRound, fetchFutureRoundVault, fetchInvestment, fetchMilestone, fetchPivotProposal, fetchProject, fetchProjectByPda, fetchRoundInvestment, fetchRoundInvestorMilestoneVesting, fetchRoundMilestone, fetchTgeEscrow, fetchVote, filterEventsByName, finalizePivot, finalizeRoundVoting, finalizeVoting, findEvent, findTierIndex, forceCompleteDistribution, formatDuration, getAdminConfigPDA, getCurrentTimestamp, getErrorMessage, getEscrowPDA, getFounderVaultPDA, getFounderVestingPDA, getFundingRoundPDA, getFutureRoundTokenVaultPDA, getFutureRoundVaultPDA, getInvestmentPDA, getInvestorVaultPDA, getLpTokenVaultPDA, getLpUsdcVaultPDA, getMilestonePDA, getNftMintPDA, getPivotProposalPDA, getProgramAuthorityPDA, getProjectPDA, getProjectPDAs, getRoundEscrowPDA, getRoundInvestmentPDA, getRoundInvestorMilestoneVestingPDA, getRoundMilestonePDA, getRoundNftMintPDA, getScamReportPDA, getTgeEscrowPDA, getTierFromAmount, getTimingConstants, getTokenMintPDA, getTokenMultiplier, getTokenVaultPDA, getTokenomicsPDA, getTransactionWithRetry, getTreasuryVaultPDA, getVaultAuthorityPDA, getVoteMultiplier, getVotePDA, hasTimestampPassed, initializeAdmin, initializeFounderVesting, initializeProject, initializeSubAllocationVesting, invest, investInRound, isRaiseError, isValidPublicKey, minDeadline, openFundingRound, parseError, percentToBps, percentageOf, proposeAllocationChange, proposePivot, releaseHoldback, reportScam, requiresBurnForRefund, resubmitMilestone, setMilestoneDeadline, setTgeDate, shortenPublicKey, submitForApproval, submitMilestone, submitRoundMilestone, symbolToBytes, timeRemaining, timestampToDate, transferAdmin, validateDeadline, validateMetadataUri, validateMilestonePercentages, voteAllocationChange, voteOnMilestone, voteOnRoundMilestone, withdrawFromPivot };
|
|
3890
|
+
export { EARLY_TOKEN_COOLING_PERIOD_SECONDS, EARLY_TOKEN_COOLING_PERIOD_SECONDS_DEV, EARLY_TOKEN_RELEASE_BPS, ERROR_CODES, ERROR_MESSAGES, EVENT_NAMES, FundingRoundState, GOVERNANCE, InvestmentTier, MAX_DEADLINE_DURATION_SECONDS, MIN_DEADLINE_DURATION_SECONDS_DEV, MIN_DEADLINE_DURATION_SECONDS_PROD, MilestoneState, NFT, PivotState, ProjectState, RaiseClient, RaiseError, SEEDS, TIER_CONSTRAINTS, TIER_MINIMUMS, TIER_TOKEN_MULTIPLIERS, TIER_VOTE_MULTIPLIERS, TIMING, TIMING_DEV, TIMING_PRODUCTION, TOKENOMICS, USDC, VALIDATION, VoteChoice, acceptAdmin, accountExists, addSubAllocation, approvePivot, approveProject, bigIntToBN, bnToBigInt, bnToNumber, bpsToPercent, calculateDeadline, calculateEarlyTokenAmount, calculateRemainingAllocation, canClaimEarlyTokens, canClaimFounderEarlyTokens, canClaimFounderMilestoneTokens, canClaimRoundEarlyTokens, cancelInvestment, cancelRoundInvestment, checkAbandonment, claimEarlyTokens, claimExitWindowRefund, claimFounderEarlyTokens, claimFounderMilestoneTokens, claimFounderMsInstantTokens, claimFounderMsVestedTokens, claimInvestorTokens, claimMilestoneFunds, claimMilestoneInstantTokens, claimMilestoneVestedTokens, claimMissedUnlock, claimRefund, claimRoundEarlyTokens, claimRoundInstantTokens, claimRoundMilestoneFunds, claimRoundVestedTokens, claimSubAllocationTokens, claimTokens, claimVestedTokens, completeDistribution, confirmTransaction, createMilestone, depositTokens, distributeTokens, executeAllocationChange, extendMilestoneDeadline, fetchAdminConfig, fetchAllFundingRounds, fetchAllInvestments, fetchAllMilestones, fetchAllVotes, fetchFundingRound, fetchFutureRoundVault, fetchInvestment, fetchMilestone, fetchPivotProposal, fetchProject, fetchProjectByPda, fetchRoundInvestment, fetchRoundInvestorMilestoneVesting, fetchRoundMilestone, fetchTgeEscrow, fetchVote, filterEventsByName, finalizePivot, finalizeRoundVoting, finalizeVoting, findEvent, findTierIndex, forceCompleteDistribution, formatDuration, getAdminConfigPDA, getCurrentTimestamp, getErrorMessage, getEscrowPDA, getEscrowTokenAccountPDA, getFounderVaultPDA, getFounderVestingPDA, getFundingRoundPDA, getFutureRoundTokenVaultPDA, getFutureRoundVaultPDA, getInvestmentPDA, getInvestorVaultPDA, getLpTokenVaultPDA, getLpUsdcVaultPDA, getMilestonePDA, getNftMintPDA, getPivotProposalPDA, getProgramAuthorityPDA, getProjectPDA, getProjectPDAs, getRoundEscrowPDA, getRoundInvestmentPDA, getRoundInvestorMilestoneVestingPDA, getRoundMilestonePDA, getRoundNftMintPDA, getScamReportPDA, getTgeEscrowPDA, getTierFromAmount, getTimingConstants, getTokenMintPDA, getTokenMultiplier, getTokenVaultPDA, getTokenomicsPDA, getTransactionWithRetry, getTreasuryVaultPDA, getVaultAuthorityPDA, getVoteMultiplier, getVotePDA, hasTimestampPassed, initializeAdmin, initializeFounderVesting, initializeProject, initializeSubAllocationVesting, invest, investInRound, isRaiseError, isValidPublicKey, minDeadline, openFundingRound, parseError, percentToBps, percentageOf, proposeAllocationChange, proposePivot, releaseHoldback, reportScam, requiresBurnForRefund, resubmitMilestone, setMilestoneDeadline, setTgeDate, shortenPublicKey, submitForApproval, submitMilestone, submitRoundMilestone, symbolToBytes, timeRemaining, timestampToDate, transferAdmin, validateDeadline, validateMetadataUri, validateMilestonePercentages, voteAllocationChange, voteOnMilestone, voteOnRoundMilestone, withdrawFromPivot };
|
|
3873
3891
|
//# sourceMappingURL=index.js.map
|
|
3874
3892
|
//# sourceMappingURL=index.js.map
|