@zemyth/raise-sdk 0.1.1 → 0.1.3
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/README.md +11 -9
- package/dist/accounts/index.cjs +531 -3
- package/dist/accounts/index.cjs.map +1 -1
- package/dist/accounts/index.d.cts +307 -2
- package/dist/accounts/index.d.ts +307 -2
- package/dist/accounts/index.js +503 -4
- package/dist/accounts/index.js.map +1 -1
- package/dist/constants/index.cjs +41 -3
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +38 -3
- package/dist/constants/index.d.ts +38 -3
- package/dist/constants/index.js +40 -4
- package/dist/constants/index.js.map +1 -1
- package/dist/index.cjs +2297 -361
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +566 -7
- package/dist/index.d.ts +566 -7
- package/dist/index.js +2279 -379
- package/dist/index.js.map +1 -1
- package/dist/instructions/index.cjs +783 -40
- package/dist/instructions/index.cjs.map +1 -1
- package/dist/instructions/index.d.cts +492 -6
- package/dist/instructions/index.d.ts +492 -6
- package/dist/instructions/index.js +762 -42
- package/dist/instructions/index.js.map +1 -1
- package/dist/pdas/index.cjs +163 -1
- package/dist/pdas/index.cjs.map +1 -1
- package/dist/pdas/index.d.cts +131 -1
- package/dist/pdas/index.d.ts +131 -1
- package/dist/pdas/index.js +151 -2
- package/dist/pdas/index.js.map +1 -1
- package/dist/types/index.cjs +9 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +586 -3
- package/dist/types/index.d.ts +586 -3
- package/dist/types/index.js +9 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +5 -3
- package/src/__tests__/dynamic-tokenomics.test.ts +358 -0
- package/src/accounts/index.ts +852 -1
- package/src/client.ts +1130 -1
- package/src/constants/index.ts +48 -2
- package/src/index.ts +58 -0
- package/src/instructions/index.ts +1383 -40
- package/src/pdas/index.ts +346 -0
- package/src/types/index.ts +698 -2
- package/src/utils/index.ts +90 -0
package/src/types/index.ts
CHANGED
|
@@ -68,6 +68,7 @@ export interface Tier {
|
|
|
68
68
|
/**
|
|
69
69
|
* Tier configuration input for project initialization
|
|
70
70
|
* Founders pass these when creating a project
|
|
71
|
+
* Note: voteMultiplier is auto-calculated on-chain using logarithmic formula
|
|
71
72
|
*/
|
|
72
73
|
export interface TierConfig {
|
|
73
74
|
/** USDC amount per lot (must be >= 10 USDC = 10_000_000 lamports) */
|
|
@@ -76,8 +77,6 @@ export interface TierConfig {
|
|
|
76
77
|
maxLots: number;
|
|
77
78
|
/** Token allocation per $1 invested (must be >= 1) */
|
|
78
79
|
tokenRatio: BN;
|
|
79
|
-
/** Vote weight multiplier (basis points, must be >= 100 = 1.0x) */
|
|
80
|
-
voteMultiplier: number;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
export interface ProjectAccount {
|
|
@@ -101,6 +100,26 @@ export interface ProjectAccount {
|
|
|
101
100
|
totalTokenAllocation: BN;
|
|
102
101
|
consecutiveFailures: number;
|
|
103
102
|
investorCount: number;
|
|
103
|
+
/** Milestone Price Increases: BPS multipliers per milestone (10000 = 1.0x)
|
|
104
|
+
* NOTE: If priceMultipliers[0] === 0, project uses dynamic mode (ZEMYTH formula)
|
|
105
|
+
* Otherwise uses static mode (legacy pre-configured multipliers) */
|
|
106
|
+
priceMultipliers: number[];
|
|
107
|
+
/** Milestone Price Increases: Number of milestones that have passed */
|
|
108
|
+
milestonesPassed: number;
|
|
109
|
+
/** Dynamic Price Multiplier: Current calculated multiplier in BPS (10000 = 1.0x)
|
|
110
|
+
* Used when priceMultipliers[0] === 0 (dynamic mode) */
|
|
111
|
+
currentPriceMultiplierBps: number;
|
|
112
|
+
// === Linear Progressive Pricing Fields (add-linear-progressive-pricing) ===
|
|
113
|
+
/** Base multiplier at start of current milestone period (BPS) */
|
|
114
|
+
milestoneBaseMultiplierBps: number;
|
|
115
|
+
/** Timestamp when current milestone period started (0 = legacy mode) */
|
|
116
|
+
milestonePeriodStartedAt: BN;
|
|
117
|
+
/** Expected deadline for current milestone period */
|
|
118
|
+
expectedMilestoneDeadlineTs: BN;
|
|
119
|
+
/** Time-based allocation for current period (50% of ZEMYTH increment) */
|
|
120
|
+
timeAllocationBps: number;
|
|
121
|
+
/** Milestone-based allocation (50% of ZEMYTH increment) */
|
|
122
|
+
milestoneAllocationBps: number;
|
|
104
123
|
bump: number;
|
|
105
124
|
}
|
|
106
125
|
|
|
@@ -130,6 +149,12 @@ export interface InvestmentAccount {
|
|
|
130
149
|
tokensClaimed: boolean;
|
|
131
150
|
withdrawnFromPivot: boolean;
|
|
132
151
|
refundClaimed: boolean;
|
|
152
|
+
/** Early Token Release: Whether 5% early tokens have been claimed */
|
|
153
|
+
earlyTokensClaimed: boolean;
|
|
154
|
+
/** Early Token Release: Amount of early tokens claimed (for burn-for-refund tracking) */
|
|
155
|
+
earlyTokensAmount: BN;
|
|
156
|
+
/** Preserve Pivot Vesting Rights: Milestone index at which vesting was frozen (on refund) */
|
|
157
|
+
vestingFrozenAtMilestone: number | null;
|
|
133
158
|
bump: number;
|
|
134
159
|
}
|
|
135
160
|
|
|
@@ -145,6 +170,8 @@ export interface VoteAccount {
|
|
|
145
170
|
export interface AdminConfigAccount {
|
|
146
171
|
admin: PublicKey;
|
|
147
172
|
pendingAdmin: PublicKey | null;
|
|
173
|
+
/** Zemyth treasury wallet for platform token allocations */
|
|
174
|
+
zemythTreasury: PublicKey | null;
|
|
148
175
|
bump: number;
|
|
149
176
|
}
|
|
150
177
|
|
|
@@ -229,6 +256,10 @@ export interface InvestmentMadeEvent {
|
|
|
229
256
|
nftMint: PublicKey;
|
|
230
257
|
tier: number;
|
|
231
258
|
voteWeight: BN;
|
|
259
|
+
/** Milestone Price Increases: Effective tier price with multiplier applied */
|
|
260
|
+
effectivePrice: BN;
|
|
261
|
+
/** Milestone Price Increases: Current price multiplier in BPS (10000 = 1.0x) */
|
|
262
|
+
multiplierBps: number;
|
|
232
263
|
}
|
|
233
264
|
|
|
234
265
|
export interface MilestoneVoteCastEvent {
|
|
@@ -265,3 +296,668 @@ export interface VoteWithKey {
|
|
|
265
296
|
publicKey: PublicKey;
|
|
266
297
|
account: VoteAccount;
|
|
267
298
|
}
|
|
299
|
+
|
|
300
|
+
// =============================================================================
|
|
301
|
+
// Dynamic Tokenomics Types
|
|
302
|
+
// =============================================================================
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Sub-allocation within a project's founder allocation pool
|
|
306
|
+
* Sub-allocations are founder team tokens (advisors, marketing, etc.)
|
|
307
|
+
*/
|
|
308
|
+
export interface SubAllocation {
|
|
309
|
+
/** Unique ID within project (0-9, max 10 sub-allocations) */
|
|
310
|
+
id: number;
|
|
311
|
+
/** Name of the allocation (UTF-8, e.g., "advisors", "marketing") */
|
|
312
|
+
name: string;
|
|
313
|
+
/** Basis points from founder allocation pool (e.g., 500 = 5% of total supply) */
|
|
314
|
+
bps: number;
|
|
315
|
+
/** Token destination wallet */
|
|
316
|
+
recipient: PublicKey;
|
|
317
|
+
/** Vesting duration in months (0 = immediate, >0 = linear vesting) */
|
|
318
|
+
vestingMonths: number;
|
|
319
|
+
/** Cliff period in months before vesting starts */
|
|
320
|
+
cliffMonths: number;
|
|
321
|
+
/** Timestamp when sub-allocation was created */
|
|
322
|
+
createdAt: BN;
|
|
323
|
+
/** True if this was added via governance vote (post-Open state) */
|
|
324
|
+
approvedViaGovernance: boolean;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Allocation proposal for governance voting
|
|
329
|
+
*/
|
|
330
|
+
export interface AllocationProposalAccount {
|
|
331
|
+
/** Parent project */
|
|
332
|
+
project: PublicKey;
|
|
333
|
+
/** Proposer (must be founder) */
|
|
334
|
+
proposer: PublicKey;
|
|
335
|
+
/** The proposed sub-allocation */
|
|
336
|
+
subAllocation: SubAllocation;
|
|
337
|
+
/** Total vote weight in favor */
|
|
338
|
+
votesFor: BN;
|
|
339
|
+
/** Total vote weight against */
|
|
340
|
+
votesAgainst: BN;
|
|
341
|
+
/** Timestamp when voting ends (7 days from creation) */
|
|
342
|
+
votingEndsAt: BN;
|
|
343
|
+
/** Whether the proposal has been executed */
|
|
344
|
+
executed: boolean;
|
|
345
|
+
/** Proposal index (for unique PDA derivation) */
|
|
346
|
+
proposalIndex: number;
|
|
347
|
+
/** PDA bump seed */
|
|
348
|
+
bump: number;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Vote record for an allocation proposal
|
|
353
|
+
*/
|
|
354
|
+
export interface AllocationVoteAccount {
|
|
355
|
+
/** The proposal being voted on */
|
|
356
|
+
proposal: PublicKey;
|
|
357
|
+
/** The investment NFT used to vote */
|
|
358
|
+
nftMint: PublicKey;
|
|
359
|
+
/** Voter's wallet */
|
|
360
|
+
voter: PublicKey;
|
|
361
|
+
/** Vote weight */
|
|
362
|
+
voteWeight: BN;
|
|
363
|
+
/** True = for, False = against */
|
|
364
|
+
voteFor: boolean;
|
|
365
|
+
/** Timestamp of vote */
|
|
366
|
+
votedAt: BN;
|
|
367
|
+
/** PDA bump seed */
|
|
368
|
+
bump: number;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Extended Tokenomics account with dynamic allocation fields
|
|
373
|
+
*/
|
|
374
|
+
export interface TokenomicsAccount {
|
|
375
|
+
/** Parent project */
|
|
376
|
+
project: PublicKey;
|
|
377
|
+
/** Token symbol (2-8 chars uppercase) */
|
|
378
|
+
tokenSymbol: string;
|
|
379
|
+
/** Token decimals (default: 9) */
|
|
380
|
+
tokenDecimals: number;
|
|
381
|
+
/** Total token supply */
|
|
382
|
+
totalSupply: BN;
|
|
383
|
+
/** Investor allocation in basis points */
|
|
384
|
+
investorAllocationBps: number;
|
|
385
|
+
/** LP token allocation in basis points */
|
|
386
|
+
lpTokenAllocationBps: number;
|
|
387
|
+
/** LP USDC allocation in basis points */
|
|
388
|
+
lpUsdcAllocationBps: number;
|
|
389
|
+
/** Founder allocation in basis points (includes sub-allocations for team) */
|
|
390
|
+
founderAllocationBps: number;
|
|
391
|
+
/** Zemyth platform allocation in basis points (minimum 1%, vests per milestone) */
|
|
392
|
+
zemythAllocationBps: number;
|
|
393
|
+
/** Number of active sub-allocations (draw from founder allocation) */
|
|
394
|
+
subAllocationCount: number;
|
|
395
|
+
/** Sub-allocations from founder pool (advisors, marketing, etc.) */
|
|
396
|
+
subAllocations: SubAllocation[];
|
|
397
|
+
/** Number of allocation proposals created */
|
|
398
|
+
proposalCount: number;
|
|
399
|
+
/** Founder wallet for vesting */
|
|
400
|
+
founderWallet: PublicKey | null;
|
|
401
|
+
/** Vesting duration in months */
|
|
402
|
+
vestingDurationMonths: number;
|
|
403
|
+
/** Cliff period in months */
|
|
404
|
+
cliffMonths: number;
|
|
405
|
+
/** Early Token Release: Founder milestone-based vesting BPS (e.g., 4750 = 47.5% of founder allocation) */
|
|
406
|
+
founderMilestoneVestingBps: number;
|
|
407
|
+
/** Early Token Release: Founder time-based vesting BPS (e.g., 4750 = 47.5% of founder allocation) */
|
|
408
|
+
founderTimeVestingBps: number;
|
|
409
|
+
/** Future round allocation in basis points (0 or >= 1000, reserved for second-round fundraising) */
|
|
410
|
+
futureRoundAllocationBps: number;
|
|
411
|
+
/** PDA bump seed */
|
|
412
|
+
bump: number;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// =============================================================================
|
|
416
|
+
// Dynamic Tokenomics Instruction Arguments
|
|
417
|
+
// =============================================================================
|
|
418
|
+
|
|
419
|
+
export interface AddSubAllocationArgs {
|
|
420
|
+
/** Name of the sub-allocation (e.g., "advisors", "marketing") */
|
|
421
|
+
name: string;
|
|
422
|
+
/** Basis points from founder allocation pool */
|
|
423
|
+
bps: number;
|
|
424
|
+
/** Token destination wallet */
|
|
425
|
+
recipient: PublicKey;
|
|
426
|
+
/** Vesting duration in months (0 = immediate) */
|
|
427
|
+
vestingMonths: number;
|
|
428
|
+
/** Cliff period in months */
|
|
429
|
+
cliffMonths: number;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export interface ProposeAllocationChangeArgs {
|
|
433
|
+
/** Name of the sub-allocation */
|
|
434
|
+
name: string;
|
|
435
|
+
/** Basis points from founder allocation pool */
|
|
436
|
+
bps: number;
|
|
437
|
+
/** Token destination wallet */
|
|
438
|
+
recipient: PublicKey;
|
|
439
|
+
/** Vesting duration in months */
|
|
440
|
+
vestingMonths: number;
|
|
441
|
+
/** Cliff period in months */
|
|
442
|
+
cliffMonths: number;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export interface VoteAllocationChangeArgs {
|
|
446
|
+
/** True = vote for, False = vote against */
|
|
447
|
+
voteFor: boolean;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// =============================================================================
|
|
451
|
+
// Dynamic Tokenomics Events
|
|
452
|
+
// =============================================================================
|
|
453
|
+
|
|
454
|
+
export interface SubAllocationAddedEvent {
|
|
455
|
+
projectId: BN;
|
|
456
|
+
projectKey: PublicKey;
|
|
457
|
+
subAllocationId: number;
|
|
458
|
+
name: string;
|
|
459
|
+
bps: number;
|
|
460
|
+
recipient: PublicKey;
|
|
461
|
+
vestingMonths: number;
|
|
462
|
+
cliffMonths: number;
|
|
463
|
+
timestamp: BN;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export interface AllocationProposalCreatedEvent {
|
|
467
|
+
projectId: BN;
|
|
468
|
+
projectKey: PublicKey;
|
|
469
|
+
proposalKey: PublicKey;
|
|
470
|
+
name: string;
|
|
471
|
+
bps: number;
|
|
472
|
+
recipient: PublicKey;
|
|
473
|
+
votingEndsAt: BN;
|
|
474
|
+
timestamp: BN;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export interface AllocationVoteCastEvent {
|
|
478
|
+
projectId: BN;
|
|
479
|
+
projectKey: PublicKey;
|
|
480
|
+
proposalKey: PublicKey;
|
|
481
|
+
voter: PublicKey;
|
|
482
|
+
nftMint: PublicKey;
|
|
483
|
+
voteWeight: BN;
|
|
484
|
+
voteFor: boolean;
|
|
485
|
+
timestamp: BN;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export interface AllocationChangeExecutedEvent {
|
|
489
|
+
projectId: BN;
|
|
490
|
+
projectKey: PublicKey;
|
|
491
|
+
proposalKey: PublicKey;
|
|
492
|
+
subAllocationId: number;
|
|
493
|
+
votesFor: BN;
|
|
494
|
+
votesAgainst: BN;
|
|
495
|
+
timestamp: BN;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// =============================================================================
|
|
499
|
+
// Dynamic Tokenomics Utility Types
|
|
500
|
+
// =============================================================================
|
|
501
|
+
|
|
502
|
+
export interface AllocationProposalWithKey {
|
|
503
|
+
publicKey: PublicKey;
|
|
504
|
+
account: AllocationProposalAccount;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
export interface AllocationVoteWithKey {
|
|
508
|
+
publicKey: PublicKey;
|
|
509
|
+
account: AllocationVoteAccount;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// =============================================================================
|
|
513
|
+
// Sub-Allocation Vesting Types
|
|
514
|
+
// =============================================================================
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Sub-allocation vesting account for tracking vesting schedules
|
|
518
|
+
* Similar to FounderVesting but for sub-allocations (treasury, advisors, etc.)
|
|
519
|
+
*/
|
|
520
|
+
export interface SubAllocationVestingAccount {
|
|
521
|
+
/** Parent project */
|
|
522
|
+
project: PublicKey;
|
|
523
|
+
/** Sub-allocation ID (0-9) */
|
|
524
|
+
subAllocationId: number;
|
|
525
|
+
/** Recipient wallet (only this wallet can claim) */
|
|
526
|
+
recipientWallet: PublicKey;
|
|
527
|
+
/** Total token amount for this sub-allocation */
|
|
528
|
+
totalAmount: BN;
|
|
529
|
+
/** Timestamp when vesting starts (MAE completion) */
|
|
530
|
+
startTimestamp: BN;
|
|
531
|
+
/** Timestamp when cliff ends */
|
|
532
|
+
cliffEnd: BN;
|
|
533
|
+
/** Timestamp when vesting fully ends */
|
|
534
|
+
vestingEnd: BN;
|
|
535
|
+
/** Amount already claimed */
|
|
536
|
+
claimedAmount: BN;
|
|
537
|
+
/** Pending wallet update (for wallet migration) */
|
|
538
|
+
pendingWallet: PublicKey | null;
|
|
539
|
+
/** Timestamp when wallet update was initiated */
|
|
540
|
+
walletUpdateTimestamp: BN | null;
|
|
541
|
+
/** PDA bump seed */
|
|
542
|
+
bump: number;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export interface SubAllocationVestingWithKey {
|
|
546
|
+
publicKey: PublicKey;
|
|
547
|
+
account: SubAllocationVestingAccount;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Arguments for claiming sub-allocation tokens
|
|
552
|
+
*/
|
|
553
|
+
export interface ClaimSubAllocationTokensArgs {
|
|
554
|
+
/** Sub-allocation ID to claim from (0-9) */
|
|
555
|
+
subAllocationId: number;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
// =============================================================================
|
|
559
|
+
// Sub-Allocation Vesting Events
|
|
560
|
+
// =============================================================================
|
|
561
|
+
|
|
562
|
+
export interface SubAllocationVestingInitializedEvent {
|
|
563
|
+
projectId: BN;
|
|
564
|
+
projectKey: PublicKey;
|
|
565
|
+
subAllocationId: number;
|
|
566
|
+
recipientWallet: PublicKey;
|
|
567
|
+
totalAmount: BN;
|
|
568
|
+
cliffMonths: number;
|
|
569
|
+
vestingMonths: number;
|
|
570
|
+
startTimestamp: BN;
|
|
571
|
+
timestamp: BN;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export interface SubAllocationTokensClaimedEvent {
|
|
575
|
+
projectId: BN;
|
|
576
|
+
projectKey: PublicKey;
|
|
577
|
+
subAllocationId: number;
|
|
578
|
+
recipient: PublicKey;
|
|
579
|
+
amountClaimed: BN;
|
|
580
|
+
totalClaimed: BN;
|
|
581
|
+
remaining: BN;
|
|
582
|
+
vestingProgressPercent: number;
|
|
583
|
+
timestamp: BN;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// =============================================================================
|
|
587
|
+
// Early Token Release Types
|
|
588
|
+
// =============================================================================
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Arguments for claim_investor_tokens instruction
|
|
592
|
+
*/
|
|
593
|
+
export interface ClaimInvestorTokensArgs {
|
|
594
|
+
/** Milestone index to claim tokens from */
|
|
595
|
+
milestoneIndex: number;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Arguments for claim_founder_milestone_tokens instruction
|
|
600
|
+
*/
|
|
601
|
+
export interface ClaimFounderMilestoneTokensArgs {
|
|
602
|
+
/** Milestone index to claim tokens from */
|
|
603
|
+
milestoneIndex: number;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// =============================================================================
|
|
607
|
+
// Early Token Release Events
|
|
608
|
+
// =============================================================================
|
|
609
|
+
|
|
610
|
+
export interface EarlyTokensClaimedEvent {
|
|
611
|
+
projectId: BN;
|
|
612
|
+
projectKey: PublicKey;
|
|
613
|
+
investor: PublicKey;
|
|
614
|
+
nftMint: PublicKey;
|
|
615
|
+
amount: BN;
|
|
616
|
+
timestamp: BN;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export interface FounderEarlyTokensClaimedEvent {
|
|
620
|
+
projectId: BN;
|
|
621
|
+
projectKey: PublicKey;
|
|
622
|
+
founder: PublicKey;
|
|
623
|
+
amount: BN;
|
|
624
|
+
timestamp: BN;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export interface FounderMilestoneTokensClaimedEvent {
|
|
628
|
+
projectId: BN;
|
|
629
|
+
projectKey: PublicKey;
|
|
630
|
+
founder: PublicKey;
|
|
631
|
+
milestoneIndex: number;
|
|
632
|
+
amount: BN;
|
|
633
|
+
cumulativeClaimed: BN;
|
|
634
|
+
timestamp: BN;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export interface TokensBurnedForRefundEvent {
|
|
638
|
+
projectId: BN;
|
|
639
|
+
projectKey: PublicKey;
|
|
640
|
+
investor: PublicKey;
|
|
641
|
+
nftMint: PublicKey;
|
|
642
|
+
amountBurned: BN;
|
|
643
|
+
timestamp: BN;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// =============================================================================
|
|
647
|
+
// Milestone Price Increase Events
|
|
648
|
+
// =============================================================================
|
|
649
|
+
|
|
650
|
+
export interface PriceMultiplierActivatedEvent {
|
|
651
|
+
projectId: BN;
|
|
652
|
+
projectKey: PublicKey;
|
|
653
|
+
milestoneIndex: number;
|
|
654
|
+
newMultiplierBps: number;
|
|
655
|
+
timestamp: BN;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// =============================================================================
|
|
659
|
+
// Dynamic Price Multiplier Events (refactor-dynamic-price-multiplier)
|
|
660
|
+
// =============================================================================
|
|
661
|
+
|
|
662
|
+
/** Emitted when claim_milestone_funds dynamically calculates and updates the price multiplier */
|
|
663
|
+
export interface PriceMultiplierUpdatedEvent {
|
|
664
|
+
projectId: BN;
|
|
665
|
+
projectKey: PublicKey;
|
|
666
|
+
/** Index of the milestone just claimed */
|
|
667
|
+
milestoneIndex: number;
|
|
668
|
+
/** Number of milestones remaining after this claim */
|
|
669
|
+
remainingMilestones: number;
|
|
670
|
+
/** Days until the next milestone deadline */
|
|
671
|
+
daysToDeadline: BN;
|
|
672
|
+
/** New price multiplier in BPS (10000 = 1.0x) */
|
|
673
|
+
newMultiplierBps: number;
|
|
674
|
+
/** Previous price multiplier in BPS */
|
|
675
|
+
previousMultiplierBps: number;
|
|
676
|
+
timestamp: BN;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// =============================================================================
|
|
680
|
+
// Zemyth Platform Allocation Types (refactor-sub-allocation-to-founder)
|
|
681
|
+
// =============================================================================
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Zemyth vesting account for platform token allocation
|
|
685
|
+
* Created at project approval, tokens vest proportionally per milestone
|
|
686
|
+
*/
|
|
687
|
+
export interface ZemythVestingAccount {
|
|
688
|
+
/** Parent project */
|
|
689
|
+
project: PublicKey;
|
|
690
|
+
/** Total Zemyth token allocation */
|
|
691
|
+
totalTokens: BN;
|
|
692
|
+
/** Tokens already claimed by Zemyth treasury */
|
|
693
|
+
claimedTokens: BN;
|
|
694
|
+
/** Number of milestones claimed for (0 to milestone_count) */
|
|
695
|
+
milestonesClaimed: number;
|
|
696
|
+
/** Destination treasury wallet for claims */
|
|
697
|
+
treasuryWallet: PublicKey;
|
|
698
|
+
/** Account creation timestamp */
|
|
699
|
+
createdAt: BN;
|
|
700
|
+
/** PDA bump seed */
|
|
701
|
+
bump: number;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
export interface ZemythVestingWithKey {
|
|
705
|
+
publicKey: PublicKey;
|
|
706
|
+
account: ZemythVestingAccount;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
// =============================================================================
|
|
710
|
+
// Zemyth Platform Allocation Events (refactor-sub-allocation-to-founder)
|
|
711
|
+
// =============================================================================
|
|
712
|
+
|
|
713
|
+
/** Emitted when ZemythVesting account is created at project approval */
|
|
714
|
+
export interface ZemythVestingCreatedEvent {
|
|
715
|
+
projectId: BN;
|
|
716
|
+
projectKey: PublicKey;
|
|
717
|
+
totalTokens: BN;
|
|
718
|
+
treasuryWallet: PublicKey;
|
|
719
|
+
timestamp: BN;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/** Emitted when Zemyth claims tokens for passed milestones */
|
|
723
|
+
export interface ZemythTokensClaimedEvent {
|
|
724
|
+
projectId: BN;
|
|
725
|
+
projectKey: PublicKey;
|
|
726
|
+
amountClaimed: BN;
|
|
727
|
+
totalClaimed: BN;
|
|
728
|
+
milestonesClaimed: number;
|
|
729
|
+
treasuryWallet: PublicKey;
|
|
730
|
+
timestamp: BN;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// =============================================================================
|
|
734
|
+
// Future Round Allocation Types (add-future-round-allocation)
|
|
735
|
+
// =============================================================================
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* FutureRoundVault account for tracking reserved tokens for future fundraising
|
|
739
|
+
* Created at project approval if future_round_allocation_bps > 0
|
|
740
|
+
*/
|
|
741
|
+
export interface FutureRoundVaultAccount {
|
|
742
|
+
/** Parent project */
|
|
743
|
+
project: PublicKey;
|
|
744
|
+
/** Token mint for the project */
|
|
745
|
+
tokenMint: PublicKey;
|
|
746
|
+
/** Total tokens reserved for future rounds */
|
|
747
|
+
totalAmount: BN;
|
|
748
|
+
/** Tokens already used in subsequent rounds */
|
|
749
|
+
usedAmount: BN;
|
|
750
|
+
/** PDA bump seed */
|
|
751
|
+
bump: number;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export interface FutureRoundVaultWithKey {
|
|
755
|
+
publicKey: PublicKey;
|
|
756
|
+
account: FutureRoundVaultAccount;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// =============================================================================
|
|
760
|
+
// Multi-Round Fundraising Types (add-second-round-fundraising)
|
|
761
|
+
// =============================================================================
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* FundingRound state enum
|
|
765
|
+
*/
|
|
766
|
+
export enum FundingRoundState {
|
|
767
|
+
Open = 'open',
|
|
768
|
+
Funded = 'funded',
|
|
769
|
+
InProgress = 'inProgress',
|
|
770
|
+
Completed = 'completed',
|
|
771
|
+
Failed = 'failed',
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Milestone configuration input for funding rounds
|
|
776
|
+
*/
|
|
777
|
+
export interface RoundMilestoneConfig {
|
|
778
|
+
/** Percentage of round funds for this milestone */
|
|
779
|
+
percentage: number;
|
|
780
|
+
/** Milestone description */
|
|
781
|
+
description: string;
|
|
782
|
+
/** Instant release percentage in basis points (e.g., 1000 = 10%) */
|
|
783
|
+
instantReleaseBps: number;
|
|
784
|
+
/** Cliff period in months */
|
|
785
|
+
cliffMonths: number;
|
|
786
|
+
/** Vesting duration in months */
|
|
787
|
+
vestingDurationMonths: number;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* FundingRound account for R2, R3, R4... rounds
|
|
792
|
+
*/
|
|
793
|
+
export interface FundingRoundAccount {
|
|
794
|
+
/** Parent project */
|
|
795
|
+
project: PublicKey;
|
|
796
|
+
/** Round number (2, 3, 4...) */
|
|
797
|
+
roundNumber: number;
|
|
798
|
+
/** Funding goal for this round */
|
|
799
|
+
fundingGoal: BN;
|
|
800
|
+
/** Amount raised in this round */
|
|
801
|
+
amountRaised: BN;
|
|
802
|
+
/** Round state */
|
|
803
|
+
state: FundingRoundState;
|
|
804
|
+
/** Number of investors in this round */
|
|
805
|
+
investorCount: number;
|
|
806
|
+
/** Allocation from future round pool (basis points) */
|
|
807
|
+
roundAllocationBps: number;
|
|
808
|
+
/** Number of tiers */
|
|
809
|
+
tierCount: number;
|
|
810
|
+
/** Tier configurations */
|
|
811
|
+
tiers: Tier[];
|
|
812
|
+
/** Number of milestones */
|
|
813
|
+
milestoneCount: number;
|
|
814
|
+
/** Current milestone index */
|
|
815
|
+
currentMilestone: number;
|
|
816
|
+
/** Consecutive milestone failures */
|
|
817
|
+
consecutiveFailures: number;
|
|
818
|
+
/** Round creation timestamp */
|
|
819
|
+
createdAt: BN;
|
|
820
|
+
/** PDA bump seed */
|
|
821
|
+
bump: number;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export interface FundingRoundWithKey {
|
|
825
|
+
publicKey: PublicKey;
|
|
826
|
+
account: FundingRoundAccount;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// =============================================================================
|
|
830
|
+
// Multi-Round Fundraising Instruction Arguments
|
|
831
|
+
// =============================================================================
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Arguments for open_funding_round instruction
|
|
835
|
+
*/
|
|
836
|
+
export interface OpenFundingRoundArgs {
|
|
837
|
+
/** Allocation from future round pool in basis points */
|
|
838
|
+
roundAllocationBps: number;
|
|
839
|
+
/** Funding goal for this round */
|
|
840
|
+
fundingGoal: BN;
|
|
841
|
+
/** Tier configurations (token_ratio must be <= R1's best tier) */
|
|
842
|
+
tiers: TierConfig[];
|
|
843
|
+
/** Milestone configurations for this round */
|
|
844
|
+
milestones: RoundMilestoneConfig[];
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Arguments for invest_in_round instruction
|
|
849
|
+
*/
|
|
850
|
+
export interface InvestInRoundArgs {
|
|
851
|
+
/** Round number to invest in */
|
|
852
|
+
roundNumber: number;
|
|
853
|
+
/** Investment amount in USDC lamports */
|
|
854
|
+
amount: BN;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Arguments for vote_on_round_milestone instruction
|
|
859
|
+
*/
|
|
860
|
+
export interface VoteOnRoundMilestoneArgs {
|
|
861
|
+
/** Round number */
|
|
862
|
+
roundNumber: number;
|
|
863
|
+
/** Milestone index */
|
|
864
|
+
milestoneIndex: number;
|
|
865
|
+
/** Vote choice */
|
|
866
|
+
choice: VoteChoice;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Arguments for claim_round_instant_tokens instruction
|
|
871
|
+
*/
|
|
872
|
+
export interface ClaimRoundInstantTokensArgs {
|
|
873
|
+
/** Milestone index */
|
|
874
|
+
milestoneIndex: number;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Arguments for claim_round_vested_tokens instruction
|
|
879
|
+
*/
|
|
880
|
+
export interface ClaimRoundVestedTokensArgs {
|
|
881
|
+
/** Milestone index */
|
|
882
|
+
milestoneIndex: number;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// =============================================================================
|
|
886
|
+
// Multi-Round Fundraising Events
|
|
887
|
+
// =============================================================================
|
|
888
|
+
|
|
889
|
+
export interface FundingRoundOpenedEvent {
|
|
890
|
+
projectId: BN;
|
|
891
|
+
projectKey: PublicKey;
|
|
892
|
+
roundNumber: number;
|
|
893
|
+
fundingGoal: BN;
|
|
894
|
+
roundAllocationBps: number;
|
|
895
|
+
tierCount: number;
|
|
896
|
+
milestoneCount: number;
|
|
897
|
+
timestamp: BN;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
export interface RoundInvestmentMadeEvent {
|
|
901
|
+
projectId: BN;
|
|
902
|
+
projectKey: PublicKey;
|
|
903
|
+
roundNumber: number;
|
|
904
|
+
investor: PublicKey;
|
|
905
|
+
amount: BN;
|
|
906
|
+
nftMint: PublicKey;
|
|
907
|
+
tier: number;
|
|
908
|
+
tokensAllocated: BN;
|
|
909
|
+
timestamp: BN;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
export interface RoundMilestoneVoteEvent {
|
|
913
|
+
projectId: BN;
|
|
914
|
+
projectKey: PublicKey;
|
|
915
|
+
roundNumber: number;
|
|
916
|
+
milestoneIndex: number;
|
|
917
|
+
voter: PublicKey;
|
|
918
|
+
choice: VoteChoice;
|
|
919
|
+
weight: BN;
|
|
920
|
+
timestamp: BN;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
export interface RoundMilestoneFinalizedEvent {
|
|
924
|
+
projectId: BN;
|
|
925
|
+
projectKey: PublicKey;
|
|
926
|
+
roundNumber: number;
|
|
927
|
+
milestoneIndex: number;
|
|
928
|
+
passed: boolean;
|
|
929
|
+
yesVotes: BN;
|
|
930
|
+
noVotes: BN;
|
|
931
|
+
timestamp: BN;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
export interface RoundEarlyTokensClaimedEvent {
|
|
935
|
+
projectId: BN;
|
|
936
|
+
roundNumber: number;
|
|
937
|
+
investmentKey: PublicKey;
|
|
938
|
+
nftHolder: PublicKey;
|
|
939
|
+
amount: BN;
|
|
940
|
+
timestamp: BN;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
export interface RoundInstantTokensClaimedEvent {
|
|
944
|
+
projectId: BN;
|
|
945
|
+
roundNumber: number;
|
|
946
|
+
milestoneIndex: number;
|
|
947
|
+
investmentKey: PublicKey;
|
|
948
|
+
nftHolder: PublicKey;
|
|
949
|
+
tokensClaimed: BN;
|
|
950
|
+
timestamp: BN;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
export interface RoundVestedTokensClaimedEvent {
|
|
954
|
+
projectId: BN;
|
|
955
|
+
roundNumber: number;
|
|
956
|
+
milestoneIndex: number;
|
|
957
|
+
investmentKey: PublicKey;
|
|
958
|
+
nftHolder: PublicKey;
|
|
959
|
+
tokensClaimed: BN;
|
|
960
|
+
cumulativeClaimed: BN;
|
|
961
|
+
vestingProgressPercent: number;
|
|
962
|
+
timestamp: BN;
|
|
963
|
+
}
|