levr-sdk 0.1.0 → 0.1.2

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 CHANGED
@@ -15,14 +15,14 @@ TypeScript SDK for interacting with Levr protocol - a decentralized governance,
15
15
  ## Features
16
16
 
17
17
  - 🎯 **Type-Safe** - Full TypeScript support with comprehensive types
18
- - 🔄 **Centralized Refetch** - 100% coverage with smart cross-domain awareness
19
- - ⚡ **Zero Duplication** - Optimized query management via React Context
18
+ - 🔄 **Zero Duplication** - Single multicalls per data group (37-53% fewer RPC calls)
19
+ - ⚡ **Centralized Provider** - All queries in one place with smart refetch management
20
20
  - 🪝 **React Hooks** - Easy integration with React applications
21
21
  - 🔌 **Server & Client** - Works in both server and client environments
22
22
  - 📦 **Tree-Shakeable** - Import only what you need
23
23
  - 💰 **USD Pricing** - Integrated USD price calculations for tokens, balances, and APR
24
24
  - 📊 **Price Impact** - Real-time price impact calculation for swaps
25
- - ⚙️ **Hook Fees** - Automatic extraction of Clanker hook fees (static and dynamic)
25
+ - ⚙️ **Manual Accrual** - Explicit reward accrual system for security and predictability
26
26
 
27
27
  ## Installation
28
28
 
@@ -60,12 +60,10 @@ export function App() {
60
60
  import { useSetClankerToken, useProject } from 'levr-sdk/client'
61
61
 
62
62
  export function ProjectPage({ clankerToken }: { clankerToken: `0x${string}` }) {
63
- const setClankerToken = useSetClankerToken()
64
63
  const { data: project, isLoading } = useProject()
65
64
 
66
- useEffect(() => {
67
- setClankerToken(clankerToken) // Updates global context
68
- }, [clankerToken, setClankerToken])
65
+ // Automatically sets and updates when clankerToken prop changes
66
+ useSetClankerToken(clankerToken)
69
67
 
70
68
  if (isLoading) return <div>Loading...</div>
71
69
  if (!project) return <div>Project not found</div>
@@ -73,6 +71,7 @@ export function ProjectPage({ clankerToken }: { clankerToken: `0x${string}` }) {
73
71
  return (
74
72
  <div>
75
73
  <h1>{project.token.name}</h1>
74
+ <p>Treasury: {project.treasuryStats?.balance.formatted}</p>
76
75
  <StakeComponent />
77
76
  <SwapComponent />
78
77
  <GovernanceComponent />
@@ -81,15 +80,11 @@ export function ProjectPage({ clankerToken }: { clankerToken: `0x${string}` }) {
81
80
  }
82
81
 
83
82
  // 3. Use hooks in child components - they automatically share queries!
84
- import { useStake, useBalance } from 'levr-sdk/client'
83
+ import { useStake, useUser } from 'levr-sdk/client'
85
84
 
86
85
  function StakeComponent() {
87
- const { data: balances } = useBalance()
88
- const {
89
- stake,
90
- stakedBalance,
91
- needsApproval,
92
- } = useStake({
86
+ const { data: user } = useUser()
87
+ const { stake, needsApproval } = useStake({
93
88
  onStakeSuccess: () => {
94
89
  toast.success('Staked successfully!')
95
90
  // All related data automatically refetches
@@ -98,8 +93,8 @@ function StakeComponent() {
98
93
 
99
94
  return (
100
95
  <div>
101
- <p>Balance: {balances?.token?.formatted}</p>
102
- <p>Staked: {stakedBalance?.formatted}</p>
96
+ <p>Balance: {user?.balances.token.formatted}</p>
97
+ <p>Staked: {user?.staking.stakedBalance.formatted}</p>
103
98
  <button onClick={() => stake.mutate(amount)}>
104
99
  Stake
105
100
  </button>
@@ -113,9 +108,10 @@ function StakeComponent() {
113
108
  For server-side operations or scripts:
114
109
 
115
110
  ```typescript
116
- import { project, balance, Stake, Governance } from 'levr-sdk'
111
+ import { getProject, getUser, Stake, Governance } from 'levr-sdk'
117
112
  import { createPublicClient, createWalletClient, http } from 'viem'
118
113
  import { base } from 'viem/chains'
114
+ import { privateKeyToAccount } from 'viem/accounts'
119
115
 
120
116
  // Initialize clients
121
117
  const publicClient = createPublicClient({
@@ -130,44 +126,37 @@ const walletClient = createWalletClient({
130
126
  })
131
127
 
132
128
  // Get project data
133
- const projectData = await project({
129
+ const projectData = await getProject({
134
130
  publicClient,
135
- factoryAddress: '0x...',
136
- chainId: base.id,
137
131
  clankerToken: '0x...',
138
132
  })
139
133
 
140
- // Get balances
141
- const balances = await balance({
134
+ // Get user data (includes balances, staking, voting power)
135
+ const userData = await getUser({
142
136
  publicClient,
143
- address: '0x...',
144
- tokens: [
145
- { address: projectData.token.address, decimals: 18, key: 'token' },
146
- { address: '0x...', decimals: 18, key: 'weth' },
147
- ],
137
+ userAddress: '0x...',
138
+ project: projectData,
148
139
  })
149
140
 
141
+ console.log('Balance:', userData.balances.token.formatted)
142
+ console.log('Staked:', userData.staking.stakedBalance.formatted)
143
+
150
144
  // Stake tokens
151
145
  const stake = new Stake({
152
146
  wallet: walletClient,
153
147
  publicClient,
154
- stakingAddress: projectData.staking,
155
- tokenAddress: projectData.token.address,
156
- tokenDecimals: 18,
157
- trustedForwarder: projectData.forwarder,
148
+ project: projectData,
158
149
  })
159
150
 
160
151
  // Approve and stake
161
- await stake.approve(1000)
162
- const receipt = await stake.stake(1000)
152
+ await stake.approve(1000) // Or '1000' or 1000n
153
+ await stake.stake(1000)
163
154
 
164
155
  // Governance operations
165
156
  const governance = new Governance({
166
157
  wallet: walletClient,
167
158
  publicClient,
168
- governorAddress: projectData.governor,
169
- tokenDecimals: 18,
170
- clankerToken: projectData.token.address,
159
+ project: projectData,
171
160
  })
172
161
 
173
162
  // Propose a transfer
@@ -180,20 +169,22 @@ const { receipt, proposalId } = await governance.proposeTransfer(
180
169
 
181
170
  ## Available Hooks (Client)
182
171
 
183
- ### Simple Query Hooks
172
+ ### Query Hooks
184
173
 
185
174
  Direct context accessors for read-only data:
186
175
 
187
176
  ```typescript
188
177
  import {
189
- useProject, // Project data (token, contracts, pool info)
190
- useBalance, // Token balances (token, WETH, ETH)
191
- useProposals, // Proposals list
178
+ useProject, // Project data (token, contracts, treasury, staking stats, governance stats)
179
+ useUser, // User data (balances, staking, voting power)
180
+ usePool, // Pool state (liquidity, price, fees)
181
+ useProposals, // Proposals with vote receipts
192
182
  useClankerToken, // Token metadata (admin, image, etc.)
193
183
  } from 'levr-sdk/client'
194
184
 
195
185
  const { data: project } = useProject()
196
- const { data: balances } = useBalance()
186
+ const { data: user } = useUser()
187
+ const { data: pool } = usePool()
197
188
  const { data: proposals } = useProposals()
198
189
  const { data: tokenData } = useClankerToken()
199
190
  ```
@@ -223,50 +214,50 @@ const {
223
214
  accrueRewards,
224
215
  accrueAllRewards,
225
216
 
226
- // Queries
227
- allowance,
228
- poolData,
229
- userData,
230
- balances,
231
- wethRewardRate,
232
- aprBpsWeth,
233
-
234
- // Convenience accessors
235
- stakedBalance,
236
- totalStaked,
237
- tokenBalance,
217
+ // Helper
238
218
  needsApproval,
239
219
 
240
220
  // Loading states
241
- isLoadingPoolData,
242
- isLoadingUserData,
221
+ isApproving,
222
+ isStaking,
223
+ isUnstaking,
224
+ isClaiming,
243
225
  } = useStake({
244
226
  onStakeSuccess: (receipt) => console.log('Staked!', receipt),
245
227
  onUnstakeSuccess: (receipt) => console.log('Unstaked!', receipt),
246
228
  onClaimSuccess: (receipt) => console.log('Claimed!', receipt),
247
229
  })
248
230
 
249
- // Use mutations
250
- stake.mutate(1000) // Automatically refetches balances, staking data, project
231
+ // Get data from context
232
+ const { data: user } = useUser()
233
+ const { data: project } = useProject()
234
+
235
+ // Access staking data
236
+ user?.balances.token // Token balance
237
+ user?.staking.stakedBalance // User's staked amount
238
+ user?.staking.claimableRewards // User's claimable rewards
239
+ project?.stakingStats?.totalStaked // Total staked by all users
240
+ project?.stakingStats?.apr // APR percentages
241
+
242
+ // Use mutations - automatically refetches related data
243
+ stake.mutate(1000) // Or '1000' or 1000n
251
244
  ```
252
245
 
253
246
  #### `useSwap()`
254
247
 
255
248
  ```typescript
256
249
  const {
257
- // Mutations
250
+ // Mutation
258
251
  swap,
259
252
 
260
- // Queries
253
+ // Quote query
261
254
  quote,
262
- balances,
263
- poolKey,
264
- pricing, // USD pricing data
265
255
 
266
- // Convenience
267
- tokenBalance,
268
- wethBalance,
256
+ // Helper
269
257
  buildSwapConfig,
258
+
259
+ // Loading
260
+ isSwapping,
270
261
  } = useSwap({
271
262
  quoteParams: {
272
263
  zeroForOne: true, // true = token -> WETH, false = WETH -> token
@@ -277,17 +268,27 @@ const {
277
268
  onSwapSuccess: (receipt) => console.log('Swapped!', receipt),
278
269
  })
279
270
 
280
- // Access quote with price impact
271
+ // Get data from context
272
+ const { data: user } = useUser()
273
+ const { data: project } = useProject()
274
+
275
+ // Access balances and pool
276
+ user?.balances.token // Token balance
277
+ user?.balances.weth // WETH balance
278
+ project?.pool?.poolKey // Pool key for swaps
279
+
280
+ // Access quote with price impact and hook fees
281
281
  console.log(quote.data?.priceImpactBps) // 0.5 (0.5% impact)
282
282
  console.log(quote.data?.hookFees) // { type: 'static', clankerFee: 500, ... }
283
283
 
284
- // Build swap config (poolKey from context)
284
+ // Build and execute swap
285
285
  const config = buildSwapConfig({
286
286
  zeroForOne: true,
287
- amountIn: 100,
287
+ amountIn: 100, // Accepts number, string, or bigint
288
288
  amountInDecimals: 18,
289
- minAmountOut: '95',
289
+ minAmountOut: ((quote.data.amountOut * 99n) / 100n).toString(), // 1% slippage
290
290
  })
291
+ swap.mutate(config)
291
292
  ```
292
293
 
293
294
  #### `useGovernance()`
@@ -301,41 +302,56 @@ const {
301
302
  executeProposal,
302
303
  claimAirdrop,
303
304
 
304
- // Queries
305
- currentCycleId,
306
- addresses,
307
- airdropStatus,
308
- proposal,
309
-
310
- // Convenience accessors
311
- treasuryAddress,
312
- isAirdropAvailable,
305
+ // Helpers
306
+ buildProposeTransferConfig,
307
+ buildProposeBoostConfig,
313
308
 
314
309
  // Loading states
315
310
  isProposing,
316
311
  isVoting,
317
312
  isExecuting,
313
+ isClaiming,
318
314
  } = useGovernance({
319
- governorAddress: project.governor,
320
- clankerToken: project.token.address,
321
315
  onVoteSuccess: (receipt) => console.log('Voted!', receipt),
322
316
  onExecuteProposalSuccess: (receipt) => console.log('Executed!', receipt),
323
317
  })
318
+
319
+ // Get data from context
320
+ const { data: user } = useUser()
321
+ const { data: project } = useProject()
322
+ const { data: proposals } = useProposals()
323
+
324
+ // Access governance data
325
+ project?.governanceStats?.currentCycleId // Current cycle
326
+ project?.treasury // Treasury address
327
+ project?.governor // Governor address
328
+ project?.airdrop // Airdrop status
329
+ user?.votingPower // User's voting power
330
+ proposals?.proposals // List of proposals with vote receipts
331
+
332
+ // Use mutations
333
+ const config = buildProposeTransferConfig({
334
+ recipient: '0x...',
335
+ amount: '1000',
336
+ description: 'Fund development',
337
+ })
338
+ proposeTransfer.mutate(config)
324
339
  ```
325
340
 
326
341
  #### `useFeeReceivers()`
327
342
 
328
343
  ```typescript
329
- const {
330
- query, // Fee receivers data
331
- mutate, // Update mutation
332
- } = useFeeReceivers({
344
+ const { mutate } = useFeeReceivers({
333
345
  onSuccess: (hash) => console.log('Updated fee receiver', hash),
334
346
  })
335
347
 
336
- // Use mutation
348
+ // Get fee receiver data from project context
349
+ const { data: project } = useProject()
350
+ const feeReceivers = project?.feeReceivers
351
+
352
+ // Update a fee receiver
337
353
  mutate.mutate({
338
- clankerToken: '0x...',
354
+ clankerToken: project.token.address,
339
355
  rewardIndex: 0,
340
356
  newRecipient: '0x...',
341
357
  })
@@ -350,15 +366,16 @@ import {
350
366
  useClanker, // Clanker SDK instance
351
367
  } from 'levr-sdk/client'
352
368
 
353
- // Update active token
354
- const setClankerToken = useSetClankerToken()
355
- setClankerToken('0x...')
369
+ // Automatically update active token (in page/route components)
370
+ useSetClankerToken('0x...')
356
371
 
357
372
  // Manual refetch control
358
373
  const refetch = useLevrRefetch()
359
374
  await refetch.all() // Refetch everything
360
- await refetch.staking() // Refetch staking data
361
- await refetch.afterStake() // Smart cross-domain refetch after stake
375
+ await refetch.user() // Refetch user data
376
+ await refetch.project() // Refetch project data
377
+ await refetch.afterStake() // Smart refetch after stake
378
+ await refetch.afterTrade() // Smart refetch after swap
362
379
 
363
380
  // Get Clanker SDK instance
364
381
  const clanker = useClanker()
@@ -368,12 +385,17 @@ const clanker = useClanker()
368
385
 
369
386
  The SDK provides **100% refetch coverage** with smart cross-domain awareness:
370
387
 
371
- | Action | Auto-Refetches |
372
- | ------------------------ | ----------------------------------------------------------------- |
373
- | **Stake/Unstake/Claim** | Balances, All Staking Data, Project (treasury), WETH Rewards |
374
- | **Swap** | Balances, Project (pool data) |
375
- | **Propose/Vote/Execute** | Governance, Proposals, Project (treasury), Staking (voting power) |
376
- | **Wallet/Chain Change** | All Queries |
388
+ | Action | Auto-Refetches |
389
+ | ----------------------- | ------------------------------------------------- |
390
+ | **Trade (Swap)** | User (balances), Pool (state) |
391
+ | **Stake/Unstake** | User (balances, staking, voting), Project (stats) |
392
+ | **Claim** | User only (balances, claimable rewards) |
393
+ | **Accrue** | Project only (outstanding rewards) |
394
+ | **Vote** | User, Proposals (vote receipts) |
395
+ | **Propose** | Proposals, Project (active count) |
396
+ | **Execute** | Project, Proposals, User (all may change) |
397
+ | **Airdrop** | Project (treasury, airdrop status) |
398
+ | **Wallet/Chain Change** | All Queries |
377
399
 
378
400
  All mutations automatically trigger appropriate refetches - no manual coordination needed!
379
401
 
@@ -381,163 +403,170 @@ All mutations automatically trigger appropriate refetches - no manual coordinati
381
403
 
382
404
  ### Server-Side APIs
383
405
 
384
- #### `project()`
406
+ #### `getProject()`
385
407
 
386
- Get project data including token, contracts, pool information, and optional USD pricing:
408
+ Get complete project data including token, contracts, pool, treasury, staking stats, governance stats, and optional USD pricing:
387
409
 
388
410
  ```typescript
389
- import { project } from 'levr-sdk'
411
+ import { getProject } from 'levr-sdk'
390
412
 
391
- const projectData = await project({
413
+ const projectData = await getProject({
392
414
  publicClient,
393
- factoryAddress: '0x...',
394
415
  clankerToken: '0x...',
395
416
  // Optional: Provide oracle client for USD pricing
396
417
  oraclePublicClient: mainnetClient, // For WETH/USD and token/USD prices
418
+ userAddress: '0x...', // Optional: for areYouAnAdmin in fee receivers
397
419
  })
398
420
 
399
- // Access USD-denominated values
400
- console.log(projectData.pricing) // { wethUsd: "2543.21", tokenUsd: "0.05" }
401
- console.log(projectData.treasuryStats.balance.usd) // "50000.00"
402
- console.log(projectData.treasuryStats.totalAllocated.usd) // "150000.00"
403
- ```
421
+ // Access project data
422
+ console.log(projectData.token.name) // "MyToken"
423
+ console.log(projectData.treasuryStats?.balance.formatted) // "50000.00"
424
+ console.log(projectData.stakingStats?.apr.token.percentage) // 15.5
425
+ console.log(projectData.governanceStats?.currentCycleId) // 5n
404
426
 
405
- **Note**: `chainId` parameter is no longer required - it's automatically derived from `publicClient.chain.id`.
427
+ // Access USD pricing (if oracle provided)
428
+ console.log(projectData.pricing?.tokenUsd) // "0.05"
429
+ console.log(projectData.treasuryStats?.balance.usd) // "$2500.00"
430
+ ```
406
431
 
407
- #### `balance()`
432
+ #### `getUser()`
408
433
 
409
- Get token balances for multiple tokens:
434
+ Get user-specific data including balances, staking, and voting power:
410
435
 
411
436
  ```typescript
412
- import { balance } from 'levr-sdk'
437
+ import { getUser, getProject } from 'levr-sdk'
438
+
439
+ // First get project data (user query needs it)
440
+ const projectData = await getProject({
441
+ publicClient,
442
+ clankerToken: '0x...',
443
+ })
413
444
 
414
- const balances = await balance({
445
+ // Then get user data
446
+ const userData = await getUser({
415
447
  publicClient,
416
- address: '0x...',
417
- tokens: [
418
- { address: '0x...', decimals: 18, key: 'token' },
419
- { address: '0x...', decimals: 18, key: 'weth' },
420
- { address: zeroAddress, decimals: 18, key: 'eth' }, // Native ETH
421
- ],
448
+ userAddress: '0x...',
449
+ project: projectData,
422
450
  })
423
451
 
424
- console.log(balances.token?.formatted) // "1000.0"
425
- console.log(balances.weth?.formatted) // "5.5"
426
- console.log(balances.eth?.formatted) // "0.1"
452
+ // Access user data
453
+ console.log(userData.balances.token.formatted) // "1000.0"
454
+ console.log(userData.balances.weth.formatted) // "5.5"
455
+ console.log(userData.staking.stakedBalance.formatted) // "500.0"
456
+ console.log(userData.staking.claimableRewards.staking.formatted) // "10.5"
457
+ console.log(userData.votingPower.formatted) // "15000.0"
427
458
  ```
428
459
 
429
460
  #### `Stake` Class
430
461
 
431
- Manage staking operations with optional USD pricing:
462
+ Manage staking operations:
432
463
 
433
464
  ```typescript
434
- import { Stake } from 'levr-sdk'
465
+ import { Stake, getProject } from 'levr-sdk'
466
+
467
+ // Get project data first
468
+ const projectData = await getProject({
469
+ publicClient,
470
+ clankerToken: '0x...',
471
+ })
435
472
 
473
+ // Create stake instance with project data
436
474
  const stake = new Stake({
437
475
  wallet: walletClient,
438
476
  publicClient,
439
- stakingAddress: '0x...',
440
- tokenAddress: '0x...',
441
- tokenDecimals: 18,
442
- trustedForwarder: '0x...',
477
+ project: projectData, // All fields from project
443
478
  })
444
479
 
445
- // Get staking data
446
- const poolData = await stake.getPoolData()
447
- const userData = await stake.getUserData()
448
- const allowance = await stake.getAllowance()
480
+ // Perform operations
481
+ await stake.approve(1000) // Accepts number, string, or bigint
482
+ await stake.stake(1000)
449
483
 
450
- // Get APR with USD pricing
451
- const aprData = await stake.getWethRewardRate({
452
- totalStaked: poolData.totalStaked,
453
- pricing: { wethUsd: '2543.21', tokenUsd: '0.05' }, // Optional USD prices
484
+ // Unstake (returns new voting power)
485
+ const { receipt, newVotingPower } = await stake.unstake({
486
+ amount: 500, // Accepts number, string, or bigint
487
+ to: '0x...', // Optional
454
488
  })
455
- console.log(aprData.aprBps) // 1500 (15% APR)
456
489
 
457
- // Perform operations
458
- await stake.approve(amount)
459
- await stake.stake(amount)
460
- await stake.unstake({ amount, to: '0x...' })
490
+ // Accrue rewards before claiming
491
+ await stake.accrueAllRewards([
492
+ projectData.token.address,
493
+ wethAddress, // Optional: if WETH rewards exist
494
+ ])
495
+
496
+ // Claim rewards
461
497
  await stake.claimRewards()
462
- await stake.accrueRewards(tokenAddress)
463
498
  ```
464
499
 
465
500
  #### `Governance` Class
466
501
 
467
- Manage governance operations with optional USD pricing:
502
+ Manage governance operations:
468
503
 
469
504
  ```typescript
470
- import { Governance } from 'levr-sdk'
505
+ import { Governance, getProject } from 'levr-sdk'
471
506
 
472
- const governance = new Governance({
473
- wallet: walletClient,
507
+ // Get project data first
508
+ const projectData = await getProject({
474
509
  publicClient,
475
- governorAddress: '0x...',
476
- tokenDecimals: 18,
477
510
  clankerToken: '0x...',
478
511
  })
479
512
 
480
- // Get governance data
481
- const cycleId = await governance.getCurrentCycleId()
482
- const treasury = await governance.getTreasury()
483
-
484
- // Get addresses with USD values
485
- const addresses = await governance.getAddresses({
486
- pricing: { wethUsd: '2543.21', tokenUsd: '0.05' },
513
+ // Create governance instance with project data
514
+ const governance = new Governance({
515
+ wallet: walletClient,
516
+ publicClient,
517
+ project: projectData, // All fields from project
487
518
  })
488
- console.log(addresses.treasury.balance.usd) // "50000.00"
489
-
490
- // Get airdrop status
491
- const airdropStatus = await governance.getAirdropStatus()
492
519
 
493
520
  // Propose actions
494
521
  const { receipt, proposalId } = await governance.proposeTransfer(
495
522
  '0x...', // recipient
496
- parseUnits('1000', 18), // amount
523
+ 1000, // amount (accepts number, string, or bigint)
497
524
  'Fund development' // description
498
525
  )
499
526
 
527
+ // Or with parseUnits for precise amounts
528
+ await governance.proposeTransfer('0x...', parseUnits('1000', 18), 'Fund development')
529
+
530
+ // Propose boost
531
+ await governance.proposeBoost(500) // Accepts number, string, or bigint
532
+
500
533
  // Vote on proposals
501
- await governance.vote(proposalId, true) // true = support
534
+ await governance.vote(proposalId, true) // true = yes, false = no
502
535
 
503
536
  // Execute proposals
504
537
  await governance.executeProposal(proposalId)
538
+
539
+ // Claim airdrop (if available)
540
+ await governance.claimAirdrop()
541
+
542
+ // Get vote receipt
543
+ const receipt = await governance.getVoteReceipt(proposalId, '0x...')
544
+ console.log(receipt.hasVoted) // true/false
505
545
  ```
506
546
 
507
- #### `quoteV3()`
547
+ #### `quote` API
508
548
 
509
- Quote swaps on Uniswap V3:
549
+ Unified quote API for V3 and V4 swaps:
510
550
 
511
551
  ```typescript
512
- import { quoteV3, UNISWAP_V3_QUOTER_V2, WETH, GET_USDC_ADDRESS } from 'levr-sdk'
552
+ import { quote, UNISWAP_V3_QUOTER_V2, WETH } from 'levr-sdk'
513
553
 
514
- const chainId = 8453 // Base
554
+ const chainId = publicClient.chain.id
515
555
  const quoterAddress = UNISWAP_V3_QUOTER_V2(chainId)
516
556
  const wethData = WETH(chainId)
517
- const usdcAddress = GET_USDC_ADDRESS(chainId)
518
557
 
519
- // Get V3 quote
520
- const quote = await quoteV3({
558
+ // V3 quote
559
+ const v3Quote = await quote.v3.read({
521
560
  publicClient,
522
561
  quoterAddress,
523
562
  tokenIn: wethData.address,
524
- tokenOut: usdcAddress,
563
+ tokenOut: '0x...', // USDC
525
564
  amountIn: parseUnits('1', 18),
526
565
  fee: 3000, // 0.3%
527
566
  })
528
567
 
529
- console.log(formatUnits(quote.amountOut, 6)) // "2543.21"
530
- ```
531
-
532
- #### `quoteV4()`
533
-
534
- Get swap quotes on Uniswap V4 with price impact and hook fees:
535
-
536
- ```typescript
537
- import { quoteV4 } from 'levr-sdk'
538
-
539
- // Get V4 quote with price impact
540
- const quote = await quoteV4({
568
+ // V4 quote with price impact and hook fees
569
+ const v4Quote = await quote.v4.read({
541
570
  publicClient,
542
571
  poolKey: {
543
572
  currency0: '0x...',
@@ -547,25 +576,18 @@ const quote = await quoteV4({
547
576
  hooks: '0x...',
548
577
  },
549
578
  zeroForOne: true,
550
- amountIn: parseUnits('100', 18),
551
- // Optional: Provide pricing data for price impact calculation
552
- pricing: {
553
- wethUsd: '2543.21',
554
- tokenUsd: '0.05',
555
- },
556
- tokenAddress: '0x...', // Project token address
579
+ amountIn: parseUnits('100', 18), // Or use bigint directly
580
+ // Optional: Provide pricing for price impact calculation
581
+ pricing: { wethUsd: '2543.21', tokenUsd: '0.05' },
582
+ tokenAddress: '0x...',
557
583
  currency0Decimals: 18,
558
584
  currency1Decimals: 18,
559
585
  })
560
586
 
561
- console.log(formatUnits(quote.amountOut, 18)) // "95.5"
562
- console.log(quote.priceImpactBps) // 0.5 (0.5% price impact)
563
- console.log(quote.hookFees) // { type: 'static', clankerFee: 500, pairedFee: 100 }
564
- console.log(quote.gasEstimate) // 150000n
587
+ console.log(v4Quote.priceImpactBps) // 0.5 (0.5% impact)
588
+ console.log(v4Quote.hookFees) // { type: 'static', clankerFee: 500 }
565
589
  ```
566
590
 
567
- **Note**: `chainId` parameter is no longer required - it's automatically derived from `publicClient.chain.id`.
568
-
569
591
  #### `swapV4()`
570
592
 
571
593
  Execute swaps on Uniswap V4:
@@ -573,13 +595,12 @@ Execute swaps on Uniswap V4:
573
595
  ```typescript
574
596
  import { swapV4 } from 'levr-sdk'
575
597
 
576
- // Execute swap
577
598
  const receipt = await swapV4({
578
599
  publicClient,
579
600
  wallet: walletClient,
580
601
  poolKey,
581
602
  zeroForOne: true,
582
- amountIn: parseUnits('100', 18),
603
+ amountIn: parseUnits('100', 18), // Or use number/string
583
604
  amountOutMinimum: parseUnits('95', 18),
584
605
  })
585
606
  ```
@@ -613,34 +634,42 @@ The SDK uses a centralized provider pattern that eliminates query duplication an
613
634
  │ │
614
635
  │ ┌───────────────────────────────────────────┐ │
615
636
  │ │ Centralized Queries (created once) │ │
616
- │ │ • Project data │ │
617
- │ │ Token balances (token + WETH + ETH) │ │
618
- │ │ • Staking (all queries) │ │
619
- │ │ • Governance (global queries) │ │
620
- │ │ • Proposals │ │
621
- │ │ • Fee receivers │ │
637
+ │ │ • Project (token, contracts, treasury, │ │
638
+ │ │ staking stats, governance stats) │ │
639
+ │ │ • User (balances, staking, voting power) │ │
640
+ │ │ • Pool (real-time state) │ │
641
+ │ │ • Proposals (with vote receipts) │ │
642
+ │ │ • Token Data (metadata) │ │
622
643
  │ └───────────────────────────────────────────┘ │
623
644
  │ │
624
645
  │ ┌───────────────────────────────────────────┐ │
625
646
  │ │ Smart Refetch Methods │ │
626
- │ │ • afterStake() Balances, Staking, etc. │ │
627
- │ │ • afterSwap() → Balances, Project │ │
628
- │ │ • afterGovernance() Gov, Proposals, etc.│
647
+ │ │ • afterTrade() User + Pool │ │
648
+ │ │ • afterStake() → User + Project │ │
649
+ │ │ • afterClaim() User only │
650
+ │ │ • afterAccrue() → Project only │ │
651
+ │ │ • afterVote() → User + Proposals │ │
652
+ │ │ • afterProposal() → Proposals + Project │ │
653
+ │ │ • afterExecute() → Project + Proposals + │ │
654
+ │ │ User │ │
629
655
  │ └───────────────────────────────────────────┘ │
630
656
  └─────────────────────────────────────────────────┘
631
657
  ↓ Context shared via hooks
632
658
  ┌─────────────────────────────────────────────────┐
633
659
  │ Components consume without duplication │
634
660
  │ • useProject() → Shared query │
635
- │ • useBalance() → Shared query │
636
- │ • useStake() → Shared queries + mutations
661
+ │ • useUser() → Shared query │
662
+ │ • usePool() → Shared query
663
+ │ • useProposals() → Shared query │
664
+ │ • useStake() → Mutations only │
637
665
  └─────────────────────────────────────────────────┘
638
666
  ```
639
667
 
640
668
  ### Benefits
641
669
 
642
670
  ✅ **Zero Duplication** - Each query created once, shared across all components
643
- ✅ **100% Refetch Coverage** - Smart cross-domain refetches after mutations
671
+ ✅ **37-53% Fewer RPC Calls** - Single multicalls per data group
672
+ ✅ **100% Refetch Coverage** - Smart action-based refetches after mutations
644
673
  ✅ **Better Performance** - Fewer network requests, better caching
645
674
  ✅ **Type Safety** - Full TypeScript throughout
646
675
  ✅ **Easy to Use** - Simple hook API, automatic coordination
@@ -679,9 +708,18 @@ function RefreshButton() {
679
708
 
680
709
  return (
681
710
  <div>
711
+ {/* Core refetches */}
682
712
  <button onClick={() => refetch.all()}>Refresh All</button>
683
- <button onClick={() => refetch.staking()}>Refresh Staking</button>
684
- <button onClick={() => refetch.governance()}>Refresh Governance</button>
713
+ <button onClick={() => refetch.user()}>Refresh User</button>
714
+ <button onClick={() => refetch.project()}>Refresh Project</button>
715
+ <button onClick={() => refetch.pool()}>Refresh Pool</button>
716
+ <button onClick={() => refetch.proposals()}>Refresh Proposals</button>
717
+
718
+ {/* Action-based smart refetches */}
719
+ <button onClick={() => refetch.afterStake()}>After Stake</button>
720
+ <button onClick={() => refetch.afterTrade()}>After Trade</button>
721
+ <button onClick={() => refetch.afterClaim()}>After Claim</button>
722
+ <button onClick={() => refetch.afterVote()}>After Vote</button>
685
723
  </div>
686
724
  )
687
725
  }
@@ -758,33 +796,16 @@ bun test
758
796
  bun run build
759
797
  ```
760
798
 
761
- ## Architecture
799
+ ## Documentation
762
800
 
763
- ```
764
- levr-sdk/
765
- ├── src/
766
- │ ├── index.ts # Server-safe exports
767
- │ ├── project.ts # Project queries
768
- │ ├── balance.ts # Balance queries
769
- │ ├── stake.ts # Stake class
770
- │ ├── governance.ts # Governance class
771
- │ ├── swap-v4.ts # V4 swap functions
772
- │ ├── quote-v3.ts # V3 quote functions
773
- │ ├── quote-v4.ts # V4 quote functions with price impact
774
- │ ├── usd-price.ts # USD pricing utilities
775
- │ └── client/
776
- │ ├── index.ts # Client-only exports
777
- │ ├── levr-provider.tsx # Centralized provider
778
- │ ├── query-keys.ts # Query key registry
779
- │ └── hook/
780
- │ ├── index.ts # Public hook exports
781
- │ ├── use-project.ts
782
- │ ├── use-balance.ts
783
- │ ├── use-stake.ts
784
- │ ├── use-swap.ts
785
- │ ├── use-governance.ts
786
- │ └── ... (other hooks)
787
- ```
801
+ For comprehensive documentation:
802
+
803
+ - **[Getting Started](./docs/getting-started.md)** - Installation and setup
804
+ - **[Quick Reference](./docs/QUICK-REFERENCE.md)** - Fast lookup for common patterns
805
+ - **[Architecture](./docs/architecture.md)** - Understanding the design
806
+ - **[Client Hooks](./docs/client-hooks/)** - Complete React hooks reference
807
+ - **[Server API](./docs/server-api/)** - Server-side API reference
808
+ - **[Migration Guide](./docs/MIGRATION-GUIDE.md)** - Upgrade guide
788
809
 
789
810
  ## License
790
811
 
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { STAKING_REWARDS, STATIC_FEE_TIERS, TREASURY_AIRDROP_AMOUNTS } from "../constants.js";
3
- import { EthereumAddress } from "./base.schema.js";
3
+ import { EthereumAddress, NonEmptyString } from "./base.schema.js";
4
4
  import { ClankerDeploymentSchema } from "./clanker.schema.js";
5
5
  const LevrMetadata = Schema.Struct({
6
6
  description: Schema.optional(Schema.String).annotations({
@@ -82,7 +82,10 @@ const MAX_TOTAL_ALLOCATION = 90000000000; // 90B tokens
82
82
  */
83
83
  const MAX_TOTAL_REWARDS = 10000; // 100% of rewards are distributed to the staking contract
84
84
  export const LevrClankerDeploymentSchema = Schema.Struct({
85
- ...ClankerDeploymentSchema.pick("name", "symbol", "image").fields,
85
+ ...ClankerDeploymentSchema.pick("name", "symbol").fields,
86
+ image: NonEmptyString("Image is required").annotations({
87
+ description: "Token image URL (IPFS or HTTP)",
88
+ }),
86
89
  metadata: Schema.optional(LevrMetadata),
87
90
  devBuy: Schema.optional(LevrDevBuy),
88
91
  airdrop: Schema.optional(LevrAirdrop),
@@ -1 +1 @@
1
- {"version":3,"file":"levr.schema.js","sourceRoot":"","sources":["../../../src/schema/levr.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC;QACtD,WAAW,EAAE,2BAA2B;KACzC,CAAC;IACF,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC;QACvD,WAAW,EAAE,+BAA+B;KAC7C,CAAC;IACF,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC;QACtD,WAAW,EAAE,8BAA8B;KAC5C,CAAC;IACF,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC;QAChD,WAAW,EAAE,wBAAwB;KACtC,CAAC;IACF,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM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,YAAY,GAAG,gBAAgB,GAAG,qBAAqB,CAAA;IAE7D,OAAO,YAAY,IAAI,iBAAiB,CAAA;AAC1C,CAAC,EACD;IACE,OAAO,EAAE,GAAG,EAAE,CACZ,0EAA0E,iBAAiB,CAAC,cAAc,EAAE,gBAAgB;CAC/H,CACF,CACF,CAAA"}
@@ -27,7 +27,7 @@ export declare function useDeploy({ onSuccess, onError }: UseDeployParams): impo
27
27
  readonly xLink?: string | undefined;
28
28
  readonly farcasterLink?: string | undefined;
29
29
  } | undefined;
30
- readonly image?: string | undefined;
30
+ readonly image: string;
31
31
  readonly airdrop?: readonly {
32
32
  readonly account: `0x${string}`;
33
33
  readonly amount: number;
@@ -1,5 +1,6 @@
1
1
  import { Schema } from 'effect';
2
2
  export declare const LevrClankerDeploymentSchema: Schema.filter<Schema.filter<Schema.Struct<{
3
+ image: Schema.refine<string, typeof Schema.String>;
3
4
  metadata: Schema.optional<Schema.Struct<{
4
5
  description: Schema.optional<typeof Schema.String>;
5
6
  telegramLink: Schema.optional<typeof Schema.String>;
@@ -28,7 +29,6 @@ export declare const LevrClankerDeploymentSchema: Schema.filter<Schema.filter<Sc
28
29
  }>>>;
29
30
  symbol: Schema.refine<string, typeof Schema.String>;
30
31
  name: Schema.refine<string, typeof Schema.String>;
31
- image: Schema.optional<typeof Schema.String>;
32
32
  }>>>;
33
33
  export type LevrClankerDeploymentSchemaType = typeof LevrClankerDeploymentSchema.Type;
34
34
  //# sourceMappingURL=levr.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"levr.schema.d.ts","sourceRoot":"","sources":["../../../src/schema/levr.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA2G/B,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+CvC,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,OAAO,2BAA2B,CAAC,IAAI,CAAA"}
1
+ {"version":3,"file":"levr.schema.d.ts","sourceRoot":"","sources":["../../../src/schema/levr.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA2G/B,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkDvC,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,OAAO,2BAA2B,CAAC,IAAI,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "levr-sdk",
3
3
  "description": "Leverage your Clanker launch with DAO capabilities",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
7
7
  "exports": {