levr-sdk 0.0.1 → 0.1.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/README.md +109 -13
- package/dist/esm/abis/LevrFactory_v1.js +63 -0
- package/dist/esm/abis/LevrGovernor_v1.js +15 -24
- package/dist/esm/abis/LevrStaking_v1.js +7 -1
- package/dist/esm/abis/StateView.js +149 -0
- package/dist/esm/abis/V3QuoterV2.js +26 -0
- package/dist/esm/abis/index.js +4 -0
- package/dist/esm/balance.js +48 -4
- package/dist/esm/balance.js.map +1 -1
- package/dist/esm/client/hook/index.js +14 -3
- package/dist/esm/client/hook/index.js.map +1 -1
- package/dist/esm/client/hook/use-fee-receivers.js +11 -30
- package/dist/esm/client/hook/use-fee-receivers.js.map +1 -1
- package/dist/esm/client/hook/use-governance.js +20 -274
- package/dist/esm/client/hook/use-governance.js.map +1 -1
- package/dist/esm/client/hook/use-pool.js +26 -0
- package/dist/esm/client/hook/use-pool.js.map +1 -0
- package/dist/esm/client/hook/use-prepare.js +6 -3
- package/dist/esm/client/hook/use-prepare.js.map +1 -1
- package/dist/esm/client/hook/use-project.js +28 -16
- package/dist/esm/client/hook/use-project.js.map +1 -1
- package/dist/esm/client/hook/use-proposal.js +48 -0
- package/dist/esm/client/hook/use-proposal.js.map +1 -0
- package/dist/esm/client/hook/use-stake.js +29 -215
- package/dist/esm/client/hook/use-stake.js.map +1 -1
- package/dist/esm/client/hook/use-swap.js +23 -19
- package/dist/esm/client/hook/use-swap.js.map +1 -1
- package/dist/esm/client/hook/use-user.js +25 -0
- package/dist/esm/client/hook/use-user.js.map +1 -0
- package/dist/esm/client/levr-provider.js +73 -108
- package/dist/esm/client/levr-provider.js.map +1 -1
- package/dist/esm/client/query-keys.js +10 -22
- package/dist/esm/client/query-keys.js.map +1 -1
- package/dist/esm/constants.js +42 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/fee-receivers.js +28 -13
- package/dist/esm/fee-receivers.js.map +1 -1
- package/dist/esm/governance.js +35 -399
- package/dist/esm/governance.js.map +1 -1
- package/dist/esm/index.js +7 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pool-key.js +152 -0
- package/dist/esm/pool-key.js.map +1 -0
- package/dist/esm/pool.js +70 -0
- package/dist/esm/pool.js.map +1 -0
- package/dist/esm/project.js +415 -118
- package/dist/esm/project.js.map +1 -1
- package/dist/esm/proposal.js +156 -0
- package/dist/esm/proposal.js.map +1 -0
- package/dist/esm/quote/index.js +98 -0
- package/dist/esm/quote/index.js.map +1 -0
- package/dist/esm/quote/v3.js +62 -0
- package/dist/esm/quote/v3.js.map +1 -0
- package/dist/esm/quote/v4.js +228 -0
- package/dist/esm/quote/v4.js.map +1 -0
- package/dist/esm/stake.js +34 -237
- package/dist/esm/stake.js.map +1 -1
- package/dist/esm/treasury.js +162 -0
- package/dist/esm/treasury.js.map +1 -0
- package/dist/esm/usd-price.js +149 -0
- package/dist/esm/usd-price.js.map +1 -0
- package/dist/esm/user.js +153 -0
- package/dist/esm/user.js.map +1 -0
- package/dist/esm/util.js +45 -1
- package/dist/esm/util.js.map +1 -1
- package/dist/types/abis/LevrFactory_v1.d.ts +48 -0
- package/dist/types/abis/LevrGovernor_v1.d.ts +12 -18
- package/dist/types/abis/LevrStaking_v1.d.ts +5 -1
- package/dist/types/abis/StateView.d.ts +278 -0
- package/dist/types/abis/V3QuoterV2.d.ts +39 -0
- package/dist/types/abis/index.d.ts +2 -0
- package/dist/types/balance.d.ts +19 -6
- package/dist/types/balance.d.ts.map +1 -1
- package/dist/types/client/hook/index.d.ts +12 -4
- package/dist/types/client/hook/index.d.ts.map +1 -1
- package/dist/types/client/hook/use-fee-receivers.d.ts +6 -16
- package/dist/types/client/hook/use-fee-receivers.d.ts.map +1 -1
- package/dist/types/client/hook/use-governance.d.ts +4 -93
- package/dist/types/client/hook/use-governance.d.ts.map +1 -1
- package/dist/types/client/hook/use-pool.d.ts +12 -0
- package/dist/types/client/hook/use-pool.d.ts.map +1 -0
- package/dist/types/client/hook/use-prepare.d.ts +1 -2
- package/dist/types/client/hook/use-prepare.d.ts.map +1 -1
- package/dist/types/client/hook/use-project.d.ts +8 -1
- package/dist/types/client/hook/use-project.d.ts.map +1 -1
- package/dist/types/client/hook/use-proposal.d.ts +18 -0
- package/dist/types/client/hook/use-proposal.d.ts.map +1 -0
- package/dist/types/client/hook/use-stake.d.ts +14 -168
- package/dist/types/client/hook/use-stake.d.ts.map +1 -1
- package/dist/types/client/hook/use-swap.d.ts +5 -9
- package/dist/types/client/hook/use-swap.d.ts.map +1 -1
- package/dist/types/client/hook/use-user.d.ts +13 -0
- package/dist/types/client/hook/use-user.d.ts.map +1 -0
- package/dist/types/client/levr-provider.d.ts +41 -68
- package/dist/types/client/levr-provider.d.ts.map +1 -1
- package/dist/types/client/query-keys.d.ts +14 -26
- package/dist/types/client/query-keys.d.ts.map +1 -1
- package/dist/types/constants.d.ts +18 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/fee-receivers.d.ts +29 -2
- package/dist/types/fee-receivers.d.ts.map +1 -1
- package/dist/types/governance.d.ts +8 -108
- package/dist/types/governance.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/pool-key.d.ts +121 -0
- package/dist/types/pool-key.d.ts.map +1 -0
- package/dist/types/pool.d.ts +590 -0
- package/dist/types/pool.d.ts.map +1 -0
- package/dist/types/project.d.ts +61 -11
- package/dist/types/project.d.ts.map +1 -1
- package/dist/types/proposal.d.ts +1161 -0
- package/dist/types/proposal.d.ts.map +1 -0
- package/dist/types/quote/index.d.ts +97 -0
- package/dist/types/quote/index.d.ts.map +1 -0
- package/dist/types/quote/v3.d.ts +78 -0
- package/dist/types/quote/v3.d.ts.map +1 -0
- package/dist/types/quote/v4.d.ts +95 -0
- package/dist/types/quote/v4.d.ts.map +1 -0
- package/dist/types/stake.d.ts +41 -87
- package/dist/types/stake.d.ts.map +1 -1
- package/dist/types/treasury.d.ts +16 -0
- package/dist/types/treasury.d.ts.map +1 -0
- package/dist/types/types.d.ts +15 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/usd-price.d.ts +141 -0
- package/dist/types/usd-price.d.ts.map +1 -0
- package/dist/types/user.d.ts +188 -0
- package/dist/types/user.d.ts.map +1 -0
- package/dist/types/util.d.ts +17 -0
- package/dist/types/util.d.ts.map +1 -1
- package/package.json +5 -2
- package/dist/esm/client/hook/use-balance.js +0 -56
- package/dist/esm/client/hook/use-balance.js.map +0 -1
- package/dist/esm/client/hook/use-projects.js +0 -22
- package/dist/esm/client/hook/use-projects.js.map +0 -1
- package/dist/esm/client/hook/use-proposals.js +0 -31
- package/dist/esm/client/hook/use-proposals.js.map +0 -1
- package/dist/esm/projects.js +0 -212
- package/dist/esm/projects.js.map +0 -1
- package/dist/esm/proposals.js +0 -98
- package/dist/esm/proposals.js.map +0 -1
- package/dist/esm/quote-v4.js +0 -169
- package/dist/esm/quote-v4.js.map +0 -1
- package/dist/types/client/hook/use-balance.d.ts +0 -18
- package/dist/types/client/hook/use-balance.d.ts.map +0 -1
- package/dist/types/client/hook/use-projects.d.ts +0 -6
- package/dist/types/client/hook/use-projects.d.ts.map +0 -1
- package/dist/types/client/hook/use-proposals.d.ts +0 -16
- package/dist/types/client/hook/use-proposals.d.ts.map +0 -1
- package/dist/types/projects.d.ts +0 -20
- package/dist/types/projects.d.ts.map +0 -1
- package/dist/types/proposals.d.ts +0 -20
- package/dist/types/proposals.d.ts.map +0 -1
- package/dist/types/quote-v4.d.ts +0 -54
- package/dist/types/quote-v4.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -20,6 +20,9 @@ TypeScript SDK for interacting with Levr protocol - a decentralized governance,
|
|
|
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
|
+
- 💰 **USD Pricing** - Integrated USD price calculations for tokens, balances, and APR
|
|
24
|
+
- 📊 **Price Impact** - Real-time price impact calculation for swaps
|
|
25
|
+
- ⚙️ **Hook Fees** - Automatic extraction of Clanker hook fees (static and dynamic)
|
|
23
26
|
|
|
24
27
|
## Installation
|
|
25
28
|
|
|
@@ -258,6 +261,7 @@ const {
|
|
|
258
261
|
quote,
|
|
259
262
|
balances,
|
|
260
263
|
poolKey,
|
|
264
|
+
pricing, // USD pricing data
|
|
261
265
|
|
|
262
266
|
// Convenience
|
|
263
267
|
tokenBalance,
|
|
@@ -273,6 +277,10 @@ const {
|
|
|
273
277
|
onSwapSuccess: (receipt) => console.log('Swapped!', receipt),
|
|
274
278
|
})
|
|
275
279
|
|
|
280
|
+
// Access quote with price impact
|
|
281
|
+
console.log(quote.data?.priceImpactBps) // 0.5 (0.5% impact)
|
|
282
|
+
console.log(quote.data?.hookFees) // { type: 'static', clankerFee: 500, ... }
|
|
283
|
+
|
|
276
284
|
// Build swap config (poolKey from context)
|
|
277
285
|
const config = buildSwapConfig({
|
|
278
286
|
zeroForOne: true,
|
|
@@ -375,7 +383,7 @@ All mutations automatically trigger appropriate refetches - no manual coordinati
|
|
|
375
383
|
|
|
376
384
|
#### `project()`
|
|
377
385
|
|
|
378
|
-
Get project data including token, contracts, and
|
|
386
|
+
Get project data including token, contracts, pool information, and optional USD pricing:
|
|
379
387
|
|
|
380
388
|
```typescript
|
|
381
389
|
import { project } from 'levr-sdk'
|
|
@@ -383,11 +391,19 @@ import { project } from 'levr-sdk'
|
|
|
383
391
|
const projectData = await project({
|
|
384
392
|
publicClient,
|
|
385
393
|
factoryAddress: '0x...',
|
|
386
|
-
chainId: 8453, // Base
|
|
387
394
|
clankerToken: '0x...',
|
|
395
|
+
// Optional: Provide oracle client for USD pricing
|
|
396
|
+
oraclePublicClient: mainnetClient, // For WETH/USD and token/USD prices
|
|
388
397
|
})
|
|
398
|
+
|
|
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"
|
|
389
403
|
```
|
|
390
404
|
|
|
405
|
+
**Note**: `chainId` parameter is no longer required - it's automatically derived from `publicClient.chain.id`.
|
|
406
|
+
|
|
391
407
|
#### `balance()`
|
|
392
408
|
|
|
393
409
|
Get token balances for multiple tokens:
|
|
@@ -412,7 +428,7 @@ console.log(balances.eth?.formatted) // "0.1"
|
|
|
412
428
|
|
|
413
429
|
#### `Stake` Class
|
|
414
430
|
|
|
415
|
-
Manage staking operations:
|
|
431
|
+
Manage staking operations with optional USD pricing:
|
|
416
432
|
|
|
417
433
|
```typescript
|
|
418
434
|
import { Stake } from 'levr-sdk'
|
|
@@ -431,6 +447,13 @@ const poolData = await stake.getPoolData()
|
|
|
431
447
|
const userData = await stake.getUserData()
|
|
432
448
|
const allowance = await stake.getAllowance()
|
|
433
449
|
|
|
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
|
|
454
|
+
})
|
|
455
|
+
console.log(aprData.aprBps) // 1500 (15% APR)
|
|
456
|
+
|
|
434
457
|
// Perform operations
|
|
435
458
|
await stake.approve(amount)
|
|
436
459
|
await stake.stake(amount)
|
|
@@ -441,7 +464,7 @@ await stake.accrueRewards(tokenAddress)
|
|
|
441
464
|
|
|
442
465
|
#### `Governance` Class
|
|
443
466
|
|
|
444
|
-
Manage governance operations:
|
|
467
|
+
Manage governance operations with optional USD pricing:
|
|
445
468
|
|
|
446
469
|
```typescript
|
|
447
470
|
import { Governance } from 'levr-sdk'
|
|
@@ -457,6 +480,14 @@ const governance = new Governance({
|
|
|
457
480
|
// Get governance data
|
|
458
481
|
const cycleId = await governance.getCurrentCycleId()
|
|
459
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' },
|
|
487
|
+
})
|
|
488
|
+
console.log(addresses.treasury.balance.usd) // "50000.00"
|
|
489
|
+
|
|
490
|
+
// Get airdrop status
|
|
460
491
|
const airdropStatus = await governance.getAirdropStatus()
|
|
461
492
|
|
|
462
493
|
// Propose actions
|
|
@@ -473,17 +504,41 @@ await governance.vote(proposalId, true) // true = support
|
|
|
473
504
|
await governance.executeProposal(proposalId)
|
|
474
505
|
```
|
|
475
506
|
|
|
476
|
-
#### `
|
|
507
|
+
#### `quoteV3()`
|
|
508
|
+
|
|
509
|
+
Quote swaps on Uniswap V3:
|
|
510
|
+
|
|
511
|
+
```typescript
|
|
512
|
+
import { quoteV3, UNISWAP_V3_QUOTER_V2, WETH, GET_USDC_ADDRESS } from 'levr-sdk'
|
|
513
|
+
|
|
514
|
+
const chainId = 8453 // Base
|
|
515
|
+
const quoterAddress = UNISWAP_V3_QUOTER_V2(chainId)
|
|
516
|
+
const wethData = WETH(chainId)
|
|
517
|
+
const usdcAddress = GET_USDC_ADDRESS(chainId)
|
|
518
|
+
|
|
519
|
+
// Get V3 quote
|
|
520
|
+
const quote = await quoteV3({
|
|
521
|
+
publicClient,
|
|
522
|
+
quoterAddress,
|
|
523
|
+
tokenIn: wethData.address,
|
|
524
|
+
tokenOut: usdcAddress,
|
|
525
|
+
amountIn: parseUnits('1', 18),
|
|
526
|
+
fee: 3000, // 0.3%
|
|
527
|
+
})
|
|
528
|
+
|
|
529
|
+
console.log(formatUnits(quote.amountOut, 6)) // "2543.21"
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
#### `quoteV4()`
|
|
477
533
|
|
|
478
|
-
Uniswap
|
|
534
|
+
Get swap quotes on Uniswap V4 with price impact and hook fees:
|
|
479
535
|
|
|
480
536
|
```typescript
|
|
481
|
-
import {
|
|
537
|
+
import { quoteV4 } from 'levr-sdk'
|
|
482
538
|
|
|
483
|
-
// Get
|
|
539
|
+
// Get V4 quote with price impact
|
|
484
540
|
const quote = await quoteV4({
|
|
485
541
|
publicClient,
|
|
486
|
-
chainId: 8453,
|
|
487
542
|
poolKey: {
|
|
488
543
|
currency0: '0x...',
|
|
489
544
|
currency1: '0x...',
|
|
@@ -493,15 +548,35 @@ const quote = await quoteV4({
|
|
|
493
548
|
},
|
|
494
549
|
zeroForOne: true,
|
|
495
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
|
|
557
|
+
currency0Decimals: 18,
|
|
558
|
+
currency1Decimals: 18,
|
|
496
559
|
})
|
|
497
560
|
|
|
498
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
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
**Note**: `chainId` parameter is no longer required - it's automatically derived from `publicClient.chain.id`.
|
|
568
|
+
|
|
569
|
+
#### `swapV4()`
|
|
570
|
+
|
|
571
|
+
Execute swaps on Uniswap V4:
|
|
572
|
+
|
|
573
|
+
```typescript
|
|
574
|
+
import { swapV4 } from 'levr-sdk'
|
|
499
575
|
|
|
500
576
|
// Execute swap
|
|
501
577
|
const receipt = await swapV4({
|
|
502
578
|
publicClient,
|
|
503
579
|
wallet: walletClient,
|
|
504
|
-
chainId: 8453,
|
|
505
580
|
poolKey,
|
|
506
581
|
zeroForOne: true,
|
|
507
582
|
amountIn: parseUnits('100', 18),
|
|
@@ -509,6 +584,25 @@ const receipt = await swapV4({
|
|
|
509
584
|
})
|
|
510
585
|
```
|
|
511
586
|
|
|
587
|
+
#### `getUsdPrice()`
|
|
588
|
+
|
|
589
|
+
Get USD price for any token paired with WETH:
|
|
590
|
+
|
|
591
|
+
```typescript
|
|
592
|
+
import { getUsdPrice } from 'levr-sdk'
|
|
593
|
+
|
|
594
|
+
// Get token price in USD
|
|
595
|
+
// Uses mainnet for accurate WETH/USDC oracle, testnet for token quote
|
|
596
|
+
const { priceUsd, tokenPerWeth, wethPerUsdc } = await getUsdPrice({
|
|
597
|
+
oraclePublicClient: mainnetClient, // For WETH/USDC price (auto-discovers best V3 pool)
|
|
598
|
+
quotePublicClient: testnetClient, // For token/WETH price (your chain)
|
|
599
|
+
tokenAddress: '0x...', // Token to price
|
|
600
|
+
quoteFee: 3000, // Optional: Pool fee tier (default: 3000 = 0.3%)
|
|
601
|
+
})
|
|
602
|
+
|
|
603
|
+
console.log(`Token price: $${priceUsd}`) // "0.05"
|
|
604
|
+
```
|
|
605
|
+
|
|
512
606
|
## Architecture: Centralized Provider Pattern
|
|
513
607
|
|
|
514
608
|
The SDK uses a centralized provider pattern that eliminates query duplication and provides 100% refetch coverage:
|
|
@@ -628,7 +722,7 @@ import { queryKeys } from 'levr-sdk/client'
|
|
|
628
722
|
|
|
629
723
|
// Use in custom queries or invalidations
|
|
630
724
|
queryClient.invalidateQueries({
|
|
631
|
-
queryKey: queryKeys.project(
|
|
725
|
+
queryKey: queryKeys.project(clankerToken, chainId),
|
|
632
726
|
})
|
|
633
727
|
```
|
|
634
728
|
|
|
@@ -674,8 +768,10 @@ levr-sdk/
|
|
|
674
768
|
│ ├── balance.ts # Balance queries
|
|
675
769
|
│ ├── stake.ts # Stake class
|
|
676
770
|
│ ├── governance.ts # Governance class
|
|
677
|
-
│ ├── swap-v4.ts #
|
|
678
|
-
│ ├── quote-
|
|
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
|
|
679
775
|
│ └── client/
|
|
680
776
|
│ ├── index.ts # Client-only exports
|
|
681
777
|
│ ├── levr-provider.tsx # Centralized provider
|
|
@@ -185,6 +185,69 @@ export default [
|
|
|
185
185
|
],
|
|
186
186
|
stateMutability: 'view',
|
|
187
187
|
},
|
|
188
|
+
{
|
|
189
|
+
type: 'function',
|
|
190
|
+
name: 'getProjects',
|
|
191
|
+
inputs: [
|
|
192
|
+
{
|
|
193
|
+
name: 'offset',
|
|
194
|
+
type: 'uint256',
|
|
195
|
+
internalType: 'uint256',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'limit',
|
|
199
|
+
type: 'uint256',
|
|
200
|
+
internalType: 'uint256',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
outputs: [
|
|
204
|
+
{
|
|
205
|
+
name: 'projects',
|
|
206
|
+
type: 'tuple[]',
|
|
207
|
+
internalType: 'struct ILevrFactory_v1.ProjectInfo[]',
|
|
208
|
+
components: [
|
|
209
|
+
{
|
|
210
|
+
name: 'clankerToken',
|
|
211
|
+
type: 'address',
|
|
212
|
+
internalType: 'address',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'project',
|
|
216
|
+
type: 'tuple',
|
|
217
|
+
internalType: 'struct ILevrFactory_v1.Project',
|
|
218
|
+
components: [
|
|
219
|
+
{
|
|
220
|
+
name: 'treasury',
|
|
221
|
+
type: 'address',
|
|
222
|
+
internalType: 'address',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'governor',
|
|
226
|
+
type: 'address',
|
|
227
|
+
internalType: 'address',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: 'staking',
|
|
231
|
+
type: 'address',
|
|
232
|
+
internalType: 'address',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: 'stakedToken',
|
|
236
|
+
type: 'address',
|
|
237
|
+
internalType: 'address',
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'total',
|
|
245
|
+
type: 'uint256',
|
|
246
|
+
internalType: 'uint256',
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
stateMutability: 'view',
|
|
250
|
+
},
|
|
188
251
|
{
|
|
189
252
|
type: 'function',
|
|
190
253
|
name: 'isTrustedForwarder',
|
|
@@ -179,6 +179,21 @@ export default [
|
|
|
179
179
|
type: 'uint256',
|
|
180
180
|
internalType: 'uint256',
|
|
181
181
|
},
|
|
182
|
+
{
|
|
183
|
+
name: 'state',
|
|
184
|
+
type: 'uint8',
|
|
185
|
+
internalType: 'enum ILevrGovernor_v1.ProposalState',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'meetsQuorum',
|
|
189
|
+
type: 'bool',
|
|
190
|
+
internalType: 'bool',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'meetsApproval',
|
|
194
|
+
type: 'bool',
|
|
195
|
+
internalType: 'bool',
|
|
196
|
+
},
|
|
182
197
|
],
|
|
183
198
|
},
|
|
184
199
|
],
|
|
@@ -244,30 +259,6 @@ export default [
|
|
|
244
259
|
],
|
|
245
260
|
stateMutability: 'view',
|
|
246
261
|
},
|
|
247
|
-
{
|
|
248
|
-
type: 'function',
|
|
249
|
-
name: 'getVotingPowerSnapshot',
|
|
250
|
-
inputs: [
|
|
251
|
-
{
|
|
252
|
-
name: 'proposalId',
|
|
253
|
-
type: 'uint256',
|
|
254
|
-
internalType: 'uint256',
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
name: 'user',
|
|
258
|
-
type: 'address',
|
|
259
|
-
internalType: 'address',
|
|
260
|
-
},
|
|
261
|
-
],
|
|
262
|
-
outputs: [
|
|
263
|
-
{
|
|
264
|
-
name: '',
|
|
265
|
-
type: 'uint256',
|
|
266
|
-
internalType: 'uint256',
|
|
267
|
-
},
|
|
268
|
-
],
|
|
269
|
-
stateMutability: 'view',
|
|
270
|
-
},
|
|
271
262
|
{
|
|
272
263
|
type: 'function',
|
|
273
264
|
name: 'getWinner',
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
inputs: [{ internalType: 'contract IPoolManager', name: '_poolManager', type: 'address' }],
|
|
4
|
+
stateMutability: 'nonpayable',
|
|
5
|
+
type: 'constructor',
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
inputs: [{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' }],
|
|
9
|
+
name: 'getFeeGrowthGlobals',
|
|
10
|
+
outputs: [
|
|
11
|
+
{ internalType: 'uint256', name: 'feeGrowthGlobal0', type: 'uint256' },
|
|
12
|
+
{ internalType: 'uint256', name: 'feeGrowthGlobal1', type: 'uint256' },
|
|
13
|
+
],
|
|
14
|
+
stateMutability: 'view',
|
|
15
|
+
type: 'function',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
inputs: [
|
|
19
|
+
{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' },
|
|
20
|
+
{ internalType: 'int24', name: 'tickLower', type: 'int24' },
|
|
21
|
+
{ internalType: 'int24', name: 'tickUpper', type: 'int24' },
|
|
22
|
+
],
|
|
23
|
+
name: 'getFeeGrowthInside',
|
|
24
|
+
outputs: [
|
|
25
|
+
{ internalType: 'uint256', name: 'feeGrowthInside0X128', type: 'uint256' },
|
|
26
|
+
{ internalType: 'uint256', name: 'feeGrowthInside1X128', type: 'uint256' },
|
|
27
|
+
],
|
|
28
|
+
stateMutability: 'view',
|
|
29
|
+
type: 'function',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
inputs: [{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' }],
|
|
33
|
+
name: 'getLiquidity',
|
|
34
|
+
outputs: [{ internalType: 'uint128', name: 'liquidity', type: 'uint128' }],
|
|
35
|
+
stateMutability: 'view',
|
|
36
|
+
type: 'function',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
inputs: [
|
|
40
|
+
{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' },
|
|
41
|
+
{ internalType: 'bytes32', name: 'positionId', type: 'bytes32' },
|
|
42
|
+
],
|
|
43
|
+
name: 'getPositionInfo',
|
|
44
|
+
outputs: [
|
|
45
|
+
{ internalType: 'uint128', name: 'liquidity', type: 'uint128' },
|
|
46
|
+
{ internalType: 'uint256', name: 'feeGrowthInside0LastX128', type: 'uint256' },
|
|
47
|
+
{ internalType: 'uint256', name: 'feeGrowthInside1LastX128', type: 'uint256' },
|
|
48
|
+
],
|
|
49
|
+
stateMutability: 'view',
|
|
50
|
+
type: 'function',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
inputs: [
|
|
54
|
+
{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' },
|
|
55
|
+
{ internalType: 'address', name: 'owner', type: 'address' },
|
|
56
|
+
{ internalType: 'int24', name: 'tickLower', type: 'int24' },
|
|
57
|
+
{ internalType: 'int24', name: 'tickUpper', type: 'int24' },
|
|
58
|
+
{ internalType: 'bytes32', name: 'salt', type: 'bytes32' },
|
|
59
|
+
],
|
|
60
|
+
name: 'getPositionInfo',
|
|
61
|
+
outputs: [
|
|
62
|
+
{ internalType: 'uint128', name: 'liquidity', type: 'uint128' },
|
|
63
|
+
{ internalType: 'uint256', name: 'feeGrowthInside0LastX128', type: 'uint256' },
|
|
64
|
+
{ internalType: 'uint256', name: 'feeGrowthInside1LastX128', type: 'uint256' },
|
|
65
|
+
],
|
|
66
|
+
stateMutability: 'view',
|
|
67
|
+
type: 'function',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
inputs: [
|
|
71
|
+
{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' },
|
|
72
|
+
{ internalType: 'bytes32', name: 'positionId', type: 'bytes32' },
|
|
73
|
+
],
|
|
74
|
+
name: 'getPositionLiquidity',
|
|
75
|
+
outputs: [{ internalType: 'uint128', name: 'liquidity', type: 'uint128' }],
|
|
76
|
+
stateMutability: 'view',
|
|
77
|
+
type: 'function',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
inputs: [{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' }],
|
|
81
|
+
name: 'getSlot0',
|
|
82
|
+
outputs: [
|
|
83
|
+
{ internalType: 'uint160', name: 'sqrtPriceX96', type: 'uint160' },
|
|
84
|
+
{ internalType: 'int24', name: 'tick', type: 'int24' },
|
|
85
|
+
{ internalType: 'uint24', name: 'protocolFee', type: 'uint24' },
|
|
86
|
+
{ internalType: 'uint24', name: 'lpFee', type: 'uint24' },
|
|
87
|
+
],
|
|
88
|
+
stateMutability: 'view',
|
|
89
|
+
type: 'function',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
inputs: [
|
|
93
|
+
{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' },
|
|
94
|
+
{ internalType: 'int16', name: 'tick', type: 'int16' },
|
|
95
|
+
],
|
|
96
|
+
name: 'getTickBitmap',
|
|
97
|
+
outputs: [{ internalType: 'uint256', name: 'tickBitmap', type: 'uint256' }],
|
|
98
|
+
stateMutability: 'view',
|
|
99
|
+
type: 'function',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
inputs: [
|
|
103
|
+
{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' },
|
|
104
|
+
{ internalType: 'int24', name: 'tick', type: 'int24' },
|
|
105
|
+
],
|
|
106
|
+
name: 'getTickFeeGrowthOutside',
|
|
107
|
+
outputs: [
|
|
108
|
+
{ internalType: 'uint256', name: 'feeGrowthOutside0X128', type: 'uint256' },
|
|
109
|
+
{ internalType: 'uint256', name: 'feeGrowthOutside1X128', type: 'uint256' },
|
|
110
|
+
],
|
|
111
|
+
stateMutability: 'view',
|
|
112
|
+
type: 'function',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
inputs: [
|
|
116
|
+
{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' },
|
|
117
|
+
{ internalType: 'int24', name: 'tick', type: 'int24' },
|
|
118
|
+
],
|
|
119
|
+
name: 'getTickInfo',
|
|
120
|
+
outputs: [
|
|
121
|
+
{ internalType: 'uint128', name: 'liquidityGross', type: 'uint128' },
|
|
122
|
+
{ internalType: 'int128', name: 'liquidityNet', type: 'int128' },
|
|
123
|
+
{ internalType: 'uint256', name: 'feeGrowthOutside0X128', type: 'uint256' },
|
|
124
|
+
{ internalType: 'uint256', name: 'feeGrowthOutside1X128', type: 'uint256' },
|
|
125
|
+
],
|
|
126
|
+
stateMutability: 'view',
|
|
127
|
+
type: 'function',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
inputs: [
|
|
131
|
+
{ internalType: 'PoolId', name: 'poolId', type: 'bytes32' },
|
|
132
|
+
{ internalType: 'int24', name: 'tick', type: 'int24' },
|
|
133
|
+
],
|
|
134
|
+
name: 'getTickLiquidity',
|
|
135
|
+
outputs: [
|
|
136
|
+
{ internalType: 'uint128', name: 'liquidityGross', type: 'uint128' },
|
|
137
|
+
{ internalType: 'int128', name: 'liquidityNet', type: 'int128' },
|
|
138
|
+
],
|
|
139
|
+
stateMutability: 'view',
|
|
140
|
+
type: 'function',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
inputs: [],
|
|
144
|
+
name: 'poolManager',
|
|
145
|
+
outputs: [{ internalType: 'contract IPoolManager', name: '', type: 'address' }],
|
|
146
|
+
stateMutability: 'view',
|
|
147
|
+
type: 'function',
|
|
148
|
+
},
|
|
149
|
+
];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
type: 'function',
|
|
4
|
+
name: 'quoteExactInputSingle',
|
|
5
|
+
inputs: [
|
|
6
|
+
{
|
|
7
|
+
name: 'params',
|
|
8
|
+
type: 'tuple',
|
|
9
|
+
components: [
|
|
10
|
+
{ name: 'tokenIn', type: 'address' },
|
|
11
|
+
{ name: 'tokenOut', type: 'address' },
|
|
12
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
13
|
+
{ name: 'fee', type: 'uint24' },
|
|
14
|
+
{ name: 'sqrtPriceLimitX96', type: 'uint160' },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
outputs: [
|
|
19
|
+
{ name: 'amountOut', type: 'uint256' },
|
|
20
|
+
{ name: 'sqrtPriceX96After', type: 'uint160' },
|
|
21
|
+
{ name: 'initializedTicksCrossed', type: 'uint32' },
|
|
22
|
+
{ name: 'gasEstimate', type: 'uint256' },
|
|
23
|
+
],
|
|
24
|
+
stateMutability: 'nonpayable',
|
|
25
|
+
},
|
|
26
|
+
];
|
package/dist/esm/abis/index.js
CHANGED
|
@@ -7,8 +7,12 @@ export { default as LevrStakedToken_v1 } from "./LevrStakedToken_v1.js";
|
|
|
7
7
|
export { default as LevrStaking_v1 } from "./LevrStaking_v1.js";
|
|
8
8
|
export { default as LevrTreasury_v1 } from "./LevrTreasury_v1.js";
|
|
9
9
|
// -----------------------------
|
|
10
|
+
// Uniswap V3
|
|
11
|
+
export { default as V3QuoterV2 } from "./V3QuoterV2.js";
|
|
12
|
+
// -----------------------------
|
|
10
13
|
// Uniswap V4
|
|
11
14
|
export { default as Permit2 } from "./Permit2.js";
|
|
15
|
+
export { default as StateView } from "./StateView.js";
|
|
12
16
|
export { default as V4Quoter } from "./V4Quoter.js";
|
|
13
17
|
// -----------------------------
|
|
14
18
|
// Clanker
|
package/dist/esm/balance.js
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
import { erc20Abi, formatUnits, zeroAddress } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Calculate USD value for a balance
|
|
4
|
+
* @param formatted - Formatted token amount as string
|
|
5
|
+
* @param usdPrice - USD price as string
|
|
6
|
+
* @returns USD value as string
|
|
7
|
+
*/
|
|
8
|
+
export const calculateUsd = (formatted, usdPrice) => {
|
|
9
|
+
const amount = parseFloat(formatted);
|
|
10
|
+
const price = parseFloat(usdPrice);
|
|
11
|
+
return (amount * price).toString();
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Format a balance with optional USD value
|
|
15
|
+
* @param amount - Raw balance amount
|
|
16
|
+
* @param decimals - Token decimals
|
|
17
|
+
* @param usdPrice - Optional USD price (null if not available)
|
|
18
|
+
* @returns BalanceResult with raw, formatted, and optional USD value
|
|
19
|
+
*/
|
|
20
|
+
export const formatBalanceWithUsd = (amount, decimals, usdPrice) => {
|
|
21
|
+
const formatted = formatUnits(amount, decimals);
|
|
22
|
+
return {
|
|
23
|
+
raw: amount,
|
|
24
|
+
formatted,
|
|
25
|
+
usd: usdPrice ? (parseFloat(formatted) * usdPrice).toString() : undefined,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
2
28
|
/**
|
|
3
29
|
* Get balances for multiple tokens including native currency
|
|
4
30
|
* @param publicClient - The public client to use for queries
|
|
5
31
|
* @param address - The address to check balances for
|
|
6
32
|
* @param tokens - Array of token configurations (use zeroAddress for native currency)
|
|
33
|
+
* @param pricing - Optional pricing data for USD values
|
|
7
34
|
* @returns Object with balances keyed by token address or custom key
|
|
8
35
|
*/
|
|
9
|
-
export async function balance({ publicClient, address, tokens, }) {
|
|
36
|
+
export async function balance({ publicClient, address, tokens, pricing, }) {
|
|
10
37
|
if (!address || tokens.length === 0)
|
|
11
38
|
return {};
|
|
12
39
|
const balances = {};
|
|
@@ -19,9 +46,11 @@ export async function balance({ publicClient, address, tokens, }) {
|
|
|
19
46
|
const nativeBalance = await publicClient.getBalance({ address });
|
|
20
47
|
nativeTokens.forEach((token) => {
|
|
21
48
|
const key = token.key || token.address;
|
|
49
|
+
const formatted = formatUnits(nativeBalance, token.decimals);
|
|
22
50
|
balances[key] = {
|
|
23
51
|
raw: nativeBalance,
|
|
24
|
-
formatted
|
|
52
|
+
formatted,
|
|
53
|
+
usd: pricing && key === 'eth' ? calculateUsd(formatted, pricing.wethUsd) : undefined,
|
|
25
54
|
};
|
|
26
55
|
});
|
|
27
56
|
}
|
|
@@ -32,6 +61,7 @@ export async function balance({ publicClient, address, tokens, }) {
|
|
|
32
61
|
balances[key] = {
|
|
33
62
|
raw: 0n,
|
|
34
63
|
formatted: '0',
|
|
64
|
+
usd: pricing ? '0.00' : undefined,
|
|
35
65
|
};
|
|
36
66
|
});
|
|
37
67
|
}
|
|
@@ -50,9 +80,22 @@ export async function balance({ publicClient, address, tokens, }) {
|
|
|
50
80
|
erc20Tokens.forEach((token, index) => {
|
|
51
81
|
const result = results[index].result;
|
|
52
82
|
const key = token.key || token.address;
|
|
83
|
+
const raw = result || 0n;
|
|
84
|
+
const formatted = formatUnits(raw, token.decimals);
|
|
85
|
+
// Calculate USD value based on token type
|
|
86
|
+
let usd;
|
|
87
|
+
if (pricing) {
|
|
88
|
+
if (key === 'token') {
|
|
89
|
+
usd = calculateUsd(formatted, pricing.tokenUsd);
|
|
90
|
+
}
|
|
91
|
+
else if (key === 'weth') {
|
|
92
|
+
usd = calculateUsd(formatted, pricing.wethUsd);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
53
95
|
balances[key] = {
|
|
54
|
-
raw
|
|
55
|
-
formatted
|
|
96
|
+
raw,
|
|
97
|
+
formatted,
|
|
98
|
+
usd,
|
|
56
99
|
};
|
|
57
100
|
});
|
|
58
101
|
}
|
|
@@ -63,6 +106,7 @@ export async function balance({ publicClient, address, tokens, }) {
|
|
|
63
106
|
balances[key] = {
|
|
64
107
|
raw: 0n,
|
|
65
108
|
formatted: '0',
|
|
109
|
+
usd: pricing ? '0.00' : undefined,
|
|
66
110
|
};
|
|
67
111
|
});
|
|
68
112
|
}
|
package/dist/esm/balance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../src/balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QA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