@zemyth/raise-sdk 0.1.2 → 0.1.4
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 +9 -7
- 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 +2309 -353
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +574 -7
- package/dist/index.d.ts +574 -7
- package/dist/index.js +2284 -377
- 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 +7 -2
- package/src/__tests__/dynamic-tokenomics.test.ts +358 -0
- package/src/accounts/index.ts +852 -1
- package/src/client.ts +1145 -1
- package/src/constants/index.ts +48 -2
- package/src/index.ts +74 -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/constants/index.ts
CHANGED
|
@@ -23,6 +23,12 @@ export const SEEDS = {
|
|
|
23
23
|
ADMIN_CONFIG: 'admin-config',
|
|
24
24
|
NFT_MINT: 'nft_mint',
|
|
25
25
|
AUTHORITY: 'authority',
|
|
26
|
+
FUTURE_ROUND_VAULT: 'future_round_vault',
|
|
27
|
+
FUTURE_ROUND_STATE: 'future_round_state',
|
|
28
|
+
// Multi-Round Fundraising seeds
|
|
29
|
+
FUNDING_ROUND: 'funding_round',
|
|
30
|
+
ROUND_ESCROW: 'round_escrow',
|
|
31
|
+
INVESTOR_MS_VESTING: 'investor_ms_vesting',
|
|
26
32
|
} as const;
|
|
27
33
|
|
|
28
34
|
// =============================================================================
|
|
@@ -92,6 +98,21 @@ export const TIER_CONSTRAINTS = {
|
|
|
92
98
|
MIN_TIER_VOTE_MULTIPLIER: 100,
|
|
93
99
|
} as const;
|
|
94
100
|
|
|
101
|
+
// =============================================================================
|
|
102
|
+
// Progressive Pricing Constants (add-linear-progressive-pricing)
|
|
103
|
+
// =============================================================================
|
|
104
|
+
|
|
105
|
+
export const PROGRESSIVE_PRICING = {
|
|
106
|
+
/** Base price multiplier (10000 BPS = 1.0x) */
|
|
107
|
+
PRICE_MULTIPLIER_BASE: 10000,
|
|
108
|
+
/** Maximum price multiplier (20000 BPS = 2.0x) */
|
|
109
|
+
MAX_MULTIPLIER_BPS: 20000,
|
|
110
|
+
/** Percentage of ZEMYTH increment allocated to time-based component */
|
|
111
|
+
TIME_ALLOCATION_PERCENT: 50,
|
|
112
|
+
/** Percentage of ZEMYTH increment allocated to milestone spike component */
|
|
113
|
+
MILESTONE_ALLOCATION_PERCENT: 50,
|
|
114
|
+
} as const;
|
|
115
|
+
|
|
95
116
|
// =============================================================================
|
|
96
117
|
// Investment Tiers (Legacy - kept for backwards compatibility)
|
|
97
118
|
// =============================================================================
|
|
@@ -184,9 +205,9 @@ export const GOVERNANCE = {
|
|
|
184
205
|
|
|
185
206
|
export const NFT = {
|
|
186
207
|
/** NFT symbol */
|
|
187
|
-
SYMBOL: '
|
|
208
|
+
SYMBOL: 'ZRI',
|
|
188
209
|
/** NFT name prefix */
|
|
189
|
-
NAME_PREFIX: 'Raise Investment #',
|
|
210
|
+
NAME_PREFIX: 'Zemyth Raise Investment #',
|
|
190
211
|
/** Royalty basis points (2%) */
|
|
191
212
|
ROYALTY_BASIS_POINTS: 200,
|
|
192
213
|
} as const;
|
|
@@ -203,3 +224,28 @@ export const USDC = {
|
|
|
203
224
|
/** Convert lamports to USDC */
|
|
204
225
|
fromAmount: (lamports: bigint): number => Number(lamports) / 10 ** 6,
|
|
205
226
|
} as const;
|
|
227
|
+
|
|
228
|
+
// =============================================================================
|
|
229
|
+
// Tokenomics Allocation Constants
|
|
230
|
+
// =============================================================================
|
|
231
|
+
|
|
232
|
+
export const TOKENOMICS = {
|
|
233
|
+
/** Minimum investor allocation (20%) */
|
|
234
|
+
MIN_INVESTOR_ALLOCATION_BPS: 2000,
|
|
235
|
+
/** Minimum founder allocation (5%) if > 0 */
|
|
236
|
+
MIN_FOUNDER_ALLOCATION_BPS: 500,
|
|
237
|
+
/** Minimum LP token allocation (5%) */
|
|
238
|
+
MIN_LP_TOKEN_ALLOCATION_BPS: 500,
|
|
239
|
+
/** Minimum LP USDC allocation (5%) */
|
|
240
|
+
MIN_LP_USDC_BPS: 500,
|
|
241
|
+
/** Minimum Zemyth allocation (1%) */
|
|
242
|
+
MIN_ZEMYTH_ALLOCATION_BPS: 100,
|
|
243
|
+
/** Default Zemyth allocation (1%) */
|
|
244
|
+
DEFAULT_ZEMYTH_ALLOCATION_BPS: 100,
|
|
245
|
+
/** Minimum future round allocation (10%) if > 0 */
|
|
246
|
+
MIN_FUTURE_ROUND_ALLOCATION_BPS: 1000,
|
|
247
|
+
/** Maximum token symbol length */
|
|
248
|
+
MAX_TOKEN_SYMBOL_LEN: 8,
|
|
249
|
+
/** Total allocation must sum to this (100% = 10000 bps) */
|
|
250
|
+
TOTAL_ALLOCATION_BPS: 10000,
|
|
251
|
+
} as const;
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ export {
|
|
|
34
34
|
GOVERNANCE,
|
|
35
35
|
NFT,
|
|
36
36
|
USDC,
|
|
37
|
+
TOKENOMICS,
|
|
37
38
|
} from './constants/index.js';
|
|
38
39
|
|
|
39
40
|
// =============================================================================
|
|
@@ -64,6 +65,16 @@ export {
|
|
|
64
65
|
getTreasuryVaultPDA,
|
|
65
66
|
getLpUsdcVaultPDA,
|
|
66
67
|
getFounderVestingPDA,
|
|
68
|
+
// Future Round Allocation PDAs
|
|
69
|
+
getFutureRoundTokenVaultPDA,
|
|
70
|
+
getFutureRoundVaultPDA,
|
|
71
|
+
// Multi-Round Fundraising PDAs
|
|
72
|
+
getFundingRoundPDA,
|
|
73
|
+
getRoundEscrowPDA,
|
|
74
|
+
getRoundMilestonePDA,
|
|
75
|
+
getRoundNftMintPDA,
|
|
76
|
+
getRoundInvestmentPDA,
|
|
77
|
+
getRoundInvestorMilestoneVestingPDA,
|
|
67
78
|
} from './pdas/index.js';
|
|
68
79
|
|
|
69
80
|
// =============================================================================
|
|
@@ -83,6 +94,24 @@ export {
|
|
|
83
94
|
fetchTgeEscrow,
|
|
84
95
|
fetchAdminConfig,
|
|
85
96
|
accountExists,
|
|
97
|
+
// Early Token Release helpers
|
|
98
|
+
canClaimEarlyTokens,
|
|
99
|
+
canClaimFounderEarlyTokens,
|
|
100
|
+
canClaimFounderMilestoneTokens,
|
|
101
|
+
requiresBurnForRefund,
|
|
102
|
+
calculateEarlyTokenAmount,
|
|
103
|
+
calculateRemainingAllocation,
|
|
104
|
+
EARLY_TOKEN_COOLING_PERIOD_SECONDS,
|
|
105
|
+
EARLY_TOKEN_COOLING_PERIOD_SECONDS_DEV,
|
|
106
|
+
EARLY_TOKEN_RELEASE_BPS,
|
|
107
|
+
// Multi-Round Fundraising Fetchers
|
|
108
|
+
fetchFundingRound,
|
|
109
|
+
fetchAllFundingRounds,
|
|
110
|
+
fetchRoundMilestone,
|
|
111
|
+
fetchRoundInvestment,
|
|
112
|
+
fetchRoundInvestorMilestoneVesting,
|
|
113
|
+
fetchFutureRoundVault,
|
|
114
|
+
canClaimRoundEarlyTokens,
|
|
86
115
|
} from './accounts/index.js';
|
|
87
116
|
|
|
88
117
|
// =============================================================================
|
|
@@ -146,6 +175,33 @@ export {
|
|
|
146
175
|
MIN_DEADLINE_DURATION_SECONDS_PROD,
|
|
147
176
|
MIN_DEADLINE_DURATION_SECONDS_DEV,
|
|
148
177
|
MAX_DEADLINE_DURATION_SECONDS,
|
|
178
|
+
// Multi-Round Fundraising Instructions
|
|
179
|
+
openFundingRound,
|
|
180
|
+
investInRound,
|
|
181
|
+
cancelRoundInvestment,
|
|
182
|
+
submitRoundMilestone,
|
|
183
|
+
voteOnRoundMilestone,
|
|
184
|
+
finalizeRoundVoting,
|
|
185
|
+
claimRoundMilestoneFunds,
|
|
186
|
+
claimRoundInstantTokens,
|
|
187
|
+
claimRoundVestedTokens,
|
|
188
|
+
claimRoundEarlyTokens,
|
|
189
|
+
// Per-Milestone Token Claims (Investor)
|
|
190
|
+
claimEarlyTokens,
|
|
191
|
+
claimMilestoneInstantTokens,
|
|
192
|
+
claimMilestoneVestedTokens,
|
|
193
|
+
// Per-Milestone Token Claims (Founder)
|
|
194
|
+
claimFounderEarlyTokens,
|
|
195
|
+
claimFounderMilestoneTokens,
|
|
196
|
+
claimFounderMsInstantTokens,
|
|
197
|
+
claimFounderMsVestedTokens,
|
|
198
|
+
// Dynamic Tokenomics (Sub-Allocations)
|
|
199
|
+
addSubAllocation,
|
|
200
|
+
proposeAllocationChange,
|
|
201
|
+
voteAllocationChange,
|
|
202
|
+
executeAllocationChange,
|
|
203
|
+
initializeSubAllocationVesting,
|
|
204
|
+
claimSubAllocationTokens,
|
|
149
205
|
} from './instructions/index.js';
|
|
150
206
|
|
|
151
207
|
// =============================================================================
|
|
@@ -158,6 +214,7 @@ export {
|
|
|
158
214
|
MilestoneState,
|
|
159
215
|
VoteChoice,
|
|
160
216
|
PivotState,
|
|
217
|
+
FundingRoundState,
|
|
161
218
|
// Account types
|
|
162
219
|
type Tier,
|
|
163
220
|
type TierConfig,
|
|
@@ -168,6 +225,8 @@ export {
|
|
|
168
225
|
type AdminConfigAccount,
|
|
169
226
|
type PivotProposalAccount,
|
|
170
227
|
type TgeEscrowAccount,
|
|
228
|
+
type FutureRoundVaultAccount,
|
|
229
|
+
type FundingRoundAccount,
|
|
171
230
|
// Instruction args
|
|
172
231
|
type InitializeProjectArgs,
|
|
173
232
|
type CreateMilestoneArgs,
|
|
@@ -176,15 +235,30 @@ export {
|
|
|
176
235
|
type SetTgeDateArgs,
|
|
177
236
|
type DepositTokensArgs,
|
|
178
237
|
type ProposePivotArgs,
|
|
238
|
+
type RoundMilestoneConfig,
|
|
239
|
+
type OpenFundingRoundArgs,
|
|
240
|
+
type InvestInRoundArgs,
|
|
241
|
+
type VoteOnRoundMilestoneArgs,
|
|
242
|
+
type ClaimRoundInstantTokensArgs,
|
|
243
|
+
type ClaimRoundVestedTokensArgs,
|
|
179
244
|
// Events
|
|
180
245
|
type ProjectCreatedEvent,
|
|
181
246
|
type InvestmentMadeEvent,
|
|
182
247
|
type MilestoneVoteCastEvent,
|
|
183
248
|
type MilestoneVoteFinalizedEvent,
|
|
249
|
+
type FundingRoundOpenedEvent,
|
|
250
|
+
type RoundInvestmentMadeEvent,
|
|
251
|
+
type RoundMilestoneVoteEvent,
|
|
252
|
+
type RoundMilestoneFinalizedEvent,
|
|
253
|
+
type RoundEarlyTokensClaimedEvent,
|
|
254
|
+
type RoundInstantTokensClaimedEvent,
|
|
255
|
+
type RoundVestedTokensClaimedEvent,
|
|
184
256
|
// Utility types
|
|
185
257
|
type InvestmentWithKey,
|
|
186
258
|
type MilestoneWithKey,
|
|
187
259
|
type VoteWithKey,
|
|
260
|
+
type FutureRoundVaultWithKey,
|
|
261
|
+
type FundingRoundWithKey,
|
|
188
262
|
} from './types/index.js';
|
|
189
263
|
|
|
190
264
|
// =============================================================================
|