@whetstone-research/doppler-sdk 1.0.2 → 1.0.5
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 +25 -19
- package/dist/chunk-BXATWUGJ.cjs +1111 -0
- package/dist/chunk-BXATWUGJ.cjs.map +1 -0
- package/dist/chunk-DPKVNI6Q.cjs +351 -0
- package/dist/chunk-DPKVNI6Q.cjs.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +11 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/evm/index.cjs +15760 -0
- package/dist/evm/index.cjs.map +1 -0
- package/dist/evm/index.d.cts +9164 -0
- package/dist/evm/index.d.ts +639 -8
- package/dist/evm/index.js +682 -334
- package/dist/evm/index.js.map +1 -1
- package/dist/oracle-CU-nZnja.d.cts +826 -0
- package/dist/pda-ZZMBZSFU.cjs +53 -0
- package/dist/pda-ZZMBZSFU.cjs.map +1 -0
- package/dist/solana/index.cjs +4981 -0
- package/dist/solana/index.cjs.map +1 -0
- package/dist/solana/index.d.cts +4584 -0
- package/dist/solana/react/index.cjs +1465 -0
- package/dist/solana/react/index.cjs.map +1 -0
- package/dist/solana/react/index.d.cts +1046 -0
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -26,10 +26,14 @@ yarn add @whetstone-research/doppler-sdk viem
|
|
|
26
26
|
pnpm add @whetstone-research/doppler-sdk viem
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
Import EVM APIs from `@whetstone-research/doppler-sdk/evm`. Solana APIs live under
|
|
30
|
+
`@whetstone-research/doppler-sdk/solana` and React bindings under
|
|
31
|
+
`@whetstone-research/doppler-sdk/solana/react`.
|
|
32
|
+
|
|
29
33
|
## Quick Start
|
|
30
34
|
|
|
31
35
|
```typescript
|
|
32
|
-
import { DopplerSDK } from '@whetstone-research/doppler-sdk';
|
|
36
|
+
import { DopplerSDK } from '@whetstone-research/doppler-sdk/evm';
|
|
33
37
|
import { createPublicClient, createWalletClient, http } from 'viem';
|
|
34
38
|
import { base } from 'viem/chains';
|
|
35
39
|
|
|
@@ -60,7 +64,7 @@ const sdk = new DopplerSDK({
|
|
|
60
64
|
Static auctions use Uniswap V3 pools with concentrated liquidity in a fixed price range. They're ideal for simple, predictable price discovery.
|
|
61
65
|
|
|
62
66
|
```typescript
|
|
63
|
-
import { StaticAuctionBuilder } from '@whetstone-research/doppler-sdk';
|
|
67
|
+
import { StaticAuctionBuilder } from '@whetstone-research/doppler-sdk/evm';
|
|
64
68
|
|
|
65
69
|
const params = new StaticAuctionBuilder()
|
|
66
70
|
.tokenConfig({
|
|
@@ -94,6 +98,8 @@ console.log('Pool address:', result.poolAddress);
|
|
|
94
98
|
console.log('Token address:', result.tokenAddress);
|
|
95
99
|
```
|
|
96
100
|
|
|
101
|
+
If you set `cliffDuration > 0`, the SDK now automatically uses the DERC20 V2 factory and exposes schedule-aware token reads via `sdk.getDerc20V2(tokenAddress)`.
|
|
102
|
+
|
|
97
103
|
> **Tick spacing reminder:** When you provide ticks manually via `poolByTicks`, make sure both `startTick` and `endTick` are exact multiples of the fee tier's tick spacing (100→1, 500→10, 3000→60, 10000→200). The SDK now validates this locally and will fail fast if the ticks are misaligned.
|
|
98
104
|
|
|
99
105
|
### Static Auction with Lockable Beneficiaries (V3)
|
|
@@ -105,7 +111,7 @@ import {
|
|
|
105
111
|
StaticAuctionBuilder,
|
|
106
112
|
WAD,
|
|
107
113
|
getAirlockOwner,
|
|
108
|
-
} from '@whetstone-research/doppler-sdk';
|
|
114
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
109
115
|
import { parseEther } from 'viem';
|
|
110
116
|
|
|
111
117
|
// Get the protocol owner (required beneficiary with min 5%)
|
|
@@ -164,7 +170,7 @@ Dynamic auctions use Uniswap V4 hooks to implement gradual Dutch auctions where
|
|
|
164
170
|
import {
|
|
165
171
|
DynamicAuctionBuilder,
|
|
166
172
|
DAY_SECONDS,
|
|
167
|
-
} from '@whetstone-research/doppler-sdk';
|
|
173
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
168
174
|
|
|
169
175
|
const params = new DynamicAuctionBuilder()
|
|
170
176
|
.tokenConfig({
|
|
@@ -299,7 +305,7 @@ Multicurve auctions use a Uniswap V4-style initializer that seeds liquidity acro
|
|
|
299
305
|
**Standard Multicurve with Migration:**
|
|
300
306
|
|
|
301
307
|
```typescript
|
|
302
|
-
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk';
|
|
308
|
+
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk/evm';
|
|
303
309
|
import { parseEther } from 'viem';
|
|
304
310
|
import { base } from 'viem/chains';
|
|
305
311
|
|
|
@@ -346,7 +352,7 @@ console.log('Token address:', result.tokenAddress);
|
|
|
346
352
|
**Market Cap Presets (Low / Medium / High):**
|
|
347
353
|
|
|
348
354
|
```typescript
|
|
349
|
-
import { MulticurveBuilder, FEE_TIERS } from '@whetstone-research/doppler-sdk';
|
|
355
|
+
import { MulticurveBuilder, FEE_TIERS } from '@whetstone-research/doppler-sdk/evm';
|
|
350
356
|
import { parseEther } from 'viem';
|
|
351
357
|
import { base } from 'viem/chains';
|
|
352
358
|
|
|
@@ -387,7 +393,7 @@ Pass `presets` to pick a subset (e.g. `['medium', 'high']`) or provide `override
|
|
|
387
393
|
**Scheduled Multicurve Launch:**
|
|
388
394
|
|
|
389
395
|
```typescript
|
|
390
|
-
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk';
|
|
396
|
+
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk/evm';
|
|
391
397
|
import { parseEther } from 'viem';
|
|
392
398
|
import { base } from 'viem/chains';
|
|
393
399
|
|
|
@@ -438,7 +444,7 @@ Ensure the target chain has the scheduled multicurve initializer whitelisted. If
|
|
|
438
444
|
**Decay Multicurve Launch (Dynamic Fee):**
|
|
439
445
|
|
|
440
446
|
```typescript
|
|
441
|
-
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk';
|
|
447
|
+
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk/evm';
|
|
442
448
|
import { parseEther } from 'viem';
|
|
443
449
|
import { baseSepolia } from 'viem/chains';
|
|
444
450
|
|
|
@@ -495,7 +501,7 @@ For decay pools, `pool.fee` is always the terminal fee (`endFee`) of the schedul
|
|
|
495
501
|
When you want fee revenue to flow to specific addresses without migrating liquidity after the auction, use lockable beneficiaries with NoOp migration:
|
|
496
502
|
|
|
497
503
|
```typescript
|
|
498
|
-
import { WAD } from '@whetstone-research/doppler-sdk';
|
|
504
|
+
import { WAD } from '@whetstone-research/doppler-sdk/evm';
|
|
499
505
|
|
|
500
506
|
// Define beneficiaries with shares that sum to WAD (1e18 = 100%)
|
|
501
507
|
// IMPORTANT: Protocol owner must be included with at least 5% shares
|
|
@@ -575,7 +581,7 @@ Prefer using the builders to construct `CreateStaticAuctionParams` and `CreateDy
|
|
|
575
581
|
import {
|
|
576
582
|
StaticAuctionBuilder,
|
|
577
583
|
DynamicAuctionBuilder,
|
|
578
|
-
} from '@whetstone-research/doppler-sdk';
|
|
584
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
579
585
|
import { parseEther } from 'viem';
|
|
580
586
|
|
|
581
587
|
// Dynamic auction via builder
|
|
@@ -807,7 +813,7 @@ await token.release();
|
|
|
807
813
|
Alternatively, you can instantiate directly if needed:
|
|
808
814
|
|
|
809
815
|
```typescript
|
|
810
|
-
import { Derc20 } from '@whetstone-research/doppler-sdk';
|
|
816
|
+
import { Derc20 } from '@whetstone-research/doppler-sdk/evm';
|
|
811
817
|
const tokenDirect = new Derc20(publicClient, walletClient, tokenAddress);
|
|
812
818
|
```
|
|
813
819
|
|
|
@@ -818,7 +824,7 @@ DERC20 extends OpenZeppelin's ERC20Votes. Voting power is tracked via checkpoint
|
|
|
818
824
|
Basics:
|
|
819
825
|
|
|
820
826
|
```ts
|
|
821
|
-
import { Derc20 } from '@whetstone-research/doppler-sdk';
|
|
827
|
+
import { Derc20 } from '@whetstone-research/doppler-sdk/evm';
|
|
822
828
|
|
|
823
829
|
const token = sdk.getDerc20(tokenAddress);
|
|
824
830
|
|
|
@@ -924,7 +930,7 @@ Notes
|
|
|
924
930
|
The SDK also provides an ETH wrapper with ERC20-like interface:
|
|
925
931
|
|
|
926
932
|
```typescript
|
|
927
|
-
import { Eth } from '@whetstone-research/doppler-sdk';
|
|
933
|
+
import { Eth } from '@whetstone-research/doppler-sdk/evm';
|
|
928
934
|
|
|
929
935
|
const eth = new Eth(publicClient, walletClient);
|
|
930
936
|
const balance = await eth.getBalanceOf(address);
|
|
@@ -1138,7 +1144,7 @@ import {
|
|
|
1138
1144
|
DopplerSDK,
|
|
1139
1145
|
createAirlockBeneficiary,
|
|
1140
1146
|
getAirlockOwner,
|
|
1141
|
-
} from '@whetstone-research/doppler-sdk';
|
|
1147
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
1142
1148
|
import { parseEther } from 'viem';
|
|
1143
1149
|
|
|
1144
1150
|
const sdk = new DopplerSDK({ publicClient, chainId });
|
|
@@ -1177,7 +1183,7 @@ import {
|
|
|
1177
1183
|
isSupportedChainId,
|
|
1178
1184
|
type SupportedChainId,
|
|
1179
1185
|
type ChainAddresses,
|
|
1180
|
-
} from '@whetstone-research/doppler-sdk';
|
|
1186
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
1181
1187
|
|
|
1182
1188
|
// Validate and narrow a chain ID
|
|
1183
1189
|
function ensureSupported(id: number): SupportedChainId {
|
|
@@ -1228,7 +1234,7 @@ import {
|
|
|
1228
1234
|
StaticAuctionBuilder,
|
|
1229
1235
|
mineTokenAddress,
|
|
1230
1236
|
getAddresses,
|
|
1231
|
-
} from '@whetstone-research/doppler-sdk';
|
|
1237
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
1232
1238
|
import { parseEther } from 'viem';
|
|
1233
1239
|
import { base } from 'viem/chains';
|
|
1234
1240
|
|
|
@@ -1296,7 +1302,7 @@ import {
|
|
|
1296
1302
|
getAddresses,
|
|
1297
1303
|
DopplerBytecode,
|
|
1298
1304
|
DAY_SECONDS,
|
|
1299
|
-
} from '@whetstone-research/doppler-sdk';
|
|
1305
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
1300
1306
|
import { parseEther, keccak256, encodePacked, encodeAbiParameters } from 'viem';
|
|
1301
1307
|
import { base } from 'viem/chains';
|
|
1302
1308
|
|
|
@@ -1391,7 +1397,7 @@ import {
|
|
|
1391
1397
|
MulticurveBuilder,
|
|
1392
1398
|
mineTokenAddress,
|
|
1393
1399
|
getAddresses,
|
|
1394
|
-
} from '@whetstone-research/doppler-sdk';
|
|
1400
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
1395
1401
|
import { parseEther } from 'viem';
|
|
1396
1402
|
import { base } from 'viem/chains';
|
|
1397
1403
|
|
|
@@ -1521,7 +1527,7 @@ import type {
|
|
|
1521
1527
|
PoolInfo,
|
|
1522
1528
|
HookInfo,
|
|
1523
1529
|
VestingConfig,
|
|
1524
|
-
} from '@whetstone-research/doppler-sdk';
|
|
1530
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
1525
1531
|
```
|
|
1526
1532
|
|
|
1527
1533
|
## Development
|