@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/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,17 @@ 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,
|
|
149
189
|
} from './instructions/index.js';
|
|
150
190
|
|
|
151
191
|
// =============================================================================
|
|
@@ -158,6 +198,7 @@ export {
|
|
|
158
198
|
MilestoneState,
|
|
159
199
|
VoteChoice,
|
|
160
200
|
PivotState,
|
|
201
|
+
FundingRoundState,
|
|
161
202
|
// Account types
|
|
162
203
|
type Tier,
|
|
163
204
|
type TierConfig,
|
|
@@ -168,6 +209,8 @@ export {
|
|
|
168
209
|
type AdminConfigAccount,
|
|
169
210
|
type PivotProposalAccount,
|
|
170
211
|
type TgeEscrowAccount,
|
|
212
|
+
type FutureRoundVaultAccount,
|
|
213
|
+
type FundingRoundAccount,
|
|
171
214
|
// Instruction args
|
|
172
215
|
type InitializeProjectArgs,
|
|
173
216
|
type CreateMilestoneArgs,
|
|
@@ -176,15 +219,30 @@ export {
|
|
|
176
219
|
type SetTgeDateArgs,
|
|
177
220
|
type DepositTokensArgs,
|
|
178
221
|
type ProposePivotArgs,
|
|
222
|
+
type RoundMilestoneConfig,
|
|
223
|
+
type OpenFundingRoundArgs,
|
|
224
|
+
type InvestInRoundArgs,
|
|
225
|
+
type VoteOnRoundMilestoneArgs,
|
|
226
|
+
type ClaimRoundInstantTokensArgs,
|
|
227
|
+
type ClaimRoundVestedTokensArgs,
|
|
179
228
|
// Events
|
|
180
229
|
type ProjectCreatedEvent,
|
|
181
230
|
type InvestmentMadeEvent,
|
|
182
231
|
type MilestoneVoteCastEvent,
|
|
183
232
|
type MilestoneVoteFinalizedEvent,
|
|
233
|
+
type FundingRoundOpenedEvent,
|
|
234
|
+
type RoundInvestmentMadeEvent,
|
|
235
|
+
type RoundMilestoneVoteEvent,
|
|
236
|
+
type RoundMilestoneFinalizedEvent,
|
|
237
|
+
type RoundEarlyTokensClaimedEvent,
|
|
238
|
+
type RoundInstantTokensClaimedEvent,
|
|
239
|
+
type RoundVestedTokensClaimedEvent,
|
|
184
240
|
// Utility types
|
|
185
241
|
type InvestmentWithKey,
|
|
186
242
|
type MilestoneWithKey,
|
|
187
243
|
type VoteWithKey,
|
|
244
|
+
type FutureRoundVaultWithKey,
|
|
245
|
+
type FundingRoundWithKey,
|
|
188
246
|
} from './types/index.js';
|
|
189
247
|
|
|
190
248
|
// =============================================================================
|