@whetstone-research/doppler-sdk 1.0.41 → 1.0.43
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 +21 -101
- package/dist/evm/index.cjs +6546 -11428
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +2753 -4667
- package/dist/evm/index.d.ts +2753 -4667
- package/dist/evm/index.js +6547 -11395
- package/dist/evm/index.js.map +1 -1
- package/dist/solana/index.cjs +9455 -8115
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +2341 -1825
- package/dist/solana/index.d.ts +2341 -1825
- package/dist/solana/index.js +9457 -8118
- package/dist/solana/index.js.map +1 -1
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The Doppler SDK exposes network-specific entrypoints for creating, managing, and
|
|
|
15
15
|
- **Solana Clients and React**: Read clients, PDA helpers, generated codecs, and optional React bindings
|
|
16
16
|
- **Token Management**: Built-in EVM support for DERC20 tokens with vesting
|
|
17
17
|
- **Type Safety**: Full TypeScript support across EVM and Solana entrypoints
|
|
18
|
-
- **Network Support**: EVM deployments on
|
|
18
|
+
- **Network Support**: EVM deployments on Ethereum, BNB Smart Chain (BSC), Monad, Robinhood Chain, Arc, Base, and Arbitrum; Solana/SVM support via explicit Solana program deployments
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
@@ -101,7 +101,9 @@ For runnable Solana flows, configure `examples/.env` and run with `pnpm tsx`, fo
|
|
|
101
101
|
- [examples/solana-cosigner-gated-buy.ts](./examples/solana-cosigner-gated-buy.ts)
|
|
102
102
|
- [examples/solana-usdc-e2e-launch.ts](./examples/solana-usdc-e2e-launch.ts)
|
|
103
103
|
- [examples/solana-usdc-cosigner-gated-buy.ts](./examples/solana-usdc-cosigner-gated-buy.ts)
|
|
104
|
-
- [
|
|
104
|
+
- [Prediction markets guide](./docs/solana-prediction-markets.md): complete lifecycle helpers, six executable scenarios, payout accounting, and [ABI migration](./docs/solana-prediction-migration.md).
|
|
105
|
+
- Concise prediction examples: [create](./examples/solana-prediction-create.ts), [buy](./examples/solana-prediction-buy.ts), [resolve and settle](./examples/solana-prediction-resolve.ts), [claim or refund](./examples/solana-prediction-claim.ts).
|
|
106
|
+
- [Full prediction scenario runner](./test/solana/integration/prediction/run.ts)
|
|
105
107
|
- [examples/solana-swap.ts](./examples/solana-swap.ts)
|
|
106
108
|
- [examples/solana-vesting-launch.ts](./examples/solana-vesting-launch.ts)
|
|
107
109
|
- [examples/solana-vesting-claim.ts](./examples/solana-vesting-claim.ts)
|
|
@@ -324,76 +326,6 @@ console.log('Hook address:', result.hookAddress);
|
|
|
324
326
|
console.log('Token address:', result.tokenAddress);
|
|
325
327
|
```
|
|
326
328
|
|
|
327
|
-
### Opening Auction (Lifecycle + Bid Management)
|
|
328
|
-
|
|
329
|
-
Support includes:
|
|
330
|
-
|
|
331
|
-
- `sdk.buildOpeningAuction()` for `CreateOpeningAuctionParams`
|
|
332
|
-
- `sdk.factory.simulateCreateOpeningAuction(params)` and `sdk.factory.createOpeningAuction(params)`
|
|
333
|
-
- `sdk.getOpeningAuction(hookAddress)` for hook reads + `settleAuction()` / `claimIncentives()`
|
|
334
|
-
- `sdk.factory.simulateCompleteOpeningAuction(...)` and `sdk.factory.completeOpeningAuction(...)` for handoff to Doppler
|
|
335
|
-
- `sdk.getOpeningAuctionLifecycle(initializerAddress?)` for initializer-level state + complete/recover/sweep helpers
|
|
336
|
-
- `sdk.getOpeningAuctionPositionManager(positionManagerAddress?)` for placing/withdrawing opening-auction bids
|
|
337
|
-
- Resolve the address via `await (await sdk.getOpeningAuctionLifecycle(initializerAddress)).getPositionManager()` when chain defaults are not configured
|
|
338
|
-
- Resolve `positionId` for incentives via `opening.getPositionId(...)` or `opening.claimIncentivesByPositionKey(...)` (no log parsing required)
|
|
339
|
-
|
|
340
|
-
> **Base caveat:** on Base mainnet (`chainId = 8453`), `openingAuctionInitializer` and `openingAuctionPositionManager` default to `0x0000000000000000000000000000000000000000` until deployment. Override with `.withOpeningAuctionInitializer('0x...')` / `.withOpeningAuctionPositionManager('0x...')` (or pass explicit addresses) before using opening-auction create/completion/bid flows there.
|
|
341
|
-
|
|
342
|
-
```typescript
|
|
343
|
-
const params = sdk
|
|
344
|
-
.buildOpeningAuction()
|
|
345
|
-
.tokenConfig({
|
|
346
|
-
name: 'My Token',
|
|
347
|
-
symbol: 'MTK',
|
|
348
|
-
tokenURI: 'https://example.com/metadata.json',
|
|
349
|
-
})
|
|
350
|
-
.saleConfig({
|
|
351
|
-
initialSupply: parseEther('1000000'),
|
|
352
|
-
numTokensToSell: parseEther('900000'),
|
|
353
|
-
numeraire: '0x...',
|
|
354
|
-
})
|
|
355
|
-
.openingAuctionConfig({
|
|
356
|
-
auctionDuration: 3600,
|
|
357
|
-
minAcceptableTickToken0: -887220,
|
|
358
|
-
minAcceptableTickToken1: -887220,
|
|
359
|
-
incentiveShareBps: 500,
|
|
360
|
-
tickSpacing: 60,
|
|
361
|
-
fee: 3000,
|
|
362
|
-
minLiquidity: 1n,
|
|
363
|
-
shareToAuctionBps: 8000,
|
|
364
|
-
})
|
|
365
|
-
.dopplerConfig({
|
|
366
|
-
minProceeds: parseEther('10'),
|
|
367
|
-
maxProceeds: parseEther('100'),
|
|
368
|
-
startTick: -69080,
|
|
369
|
-
endTick: -92103,
|
|
370
|
-
})
|
|
371
|
-
.withMigration({ type: 'uniswapV4', fee: 3000, tickSpacing: 60 })
|
|
372
|
-
.withUserAddress('0x...')
|
|
373
|
-
.withOpeningAuctionInitializer('0x...') // required on Base until deployed
|
|
374
|
-
.build();
|
|
375
|
-
|
|
376
|
-
const sim = await sdk.factory.simulateCreateOpeningAuction(params);
|
|
377
|
-
const created = await sim.execute();
|
|
378
|
-
|
|
379
|
-
const opening = await sdk.getOpeningAuction(created.openingAuctionHookAddress);
|
|
380
|
-
await opening.getPhase();
|
|
381
|
-
|
|
382
|
-
const lifecycle = await sdk.getOpeningAuctionLifecycle('0x...');
|
|
383
|
-
await lifecycle.getState(created.tokenAddress);
|
|
384
|
-
|
|
385
|
-
await sdk.factory.completeOpeningAuction({
|
|
386
|
-
asset: created.tokenAddress,
|
|
387
|
-
initializerAddress: '0x...',
|
|
388
|
-
});
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
`completeOpeningAuction` auto-settles and auto-mines `dopplerSalt` when omitted; because completion mining can race with block timestamps/state changes, the SDK may re-mine and retry a few times if needed. `simulateCompleteOpeningAuction` requires the opening auction to already be settled.
|
|
392
|
-
|
|
393
|
-
Position-manager bid wrappers are available, but bid sizing is still “advanced user”: `liquidity` is Uniswap V4 liquidity units. Use `simulatePlaceBid(...)` / `simulateWithdrawBid(...)` to inspect the `BalanceDelta` (token amounts in/out) and iterate. During the active auction, liquidity withdrawals must be full (no partial removals); use `withdrawFullBid(...)` to read the onchain liquidity and withdraw safely.
|
|
394
|
-
|
|
395
|
-
See [examples/opening-auction-lifecycle.ts](./examples/opening-auction-lifecycle.ts) for the full builder/factory/lifecycle flow, and [examples/opening-auction-bidding.ts](./examples/opening-auction-bidding.ts) for the bid-management pattern + positionId resolution.
|
|
396
|
-
|
|
397
329
|
### Multicurve Auction (V4 Multicurve Initializer)
|
|
398
330
|
|
|
399
331
|
Multicurve auctions use `DopplerHookInitializer` by default to seed liquidity across multiple curves in a single Uniswap V4 pool. The typed initializer modes are `dopplerHookInitializer`, `standard`, `scheduled`, `decay`, and `rehype`; use `withV4MulticurveInitializer(address)` when explicitly targeting the legacy standard initializer.
|
|
@@ -1401,12 +1333,9 @@ for (const id of SUPPORTED_CHAIN_IDS) {
|
|
|
1401
1333
|
}
|
|
1402
1334
|
```
|
|
1403
1335
|
|
|
1404
|
-
|
|
1405
|
-
definition included in `SupportedChain`.
|
|
1336
|
+
Available launch features depend on the contracts deployed on the selected network. Use `getAddresses(chainId)` to inspect its deployment configuration. For native V4 numeraires, use `zeroAddress` and the chain's native currency decimals rather than the decimals of an ERC-20 token with the same symbol.
|
|
1406
1337
|
|
|
1407
|
-
|
|
1408
|
-
addresses and support checks for it, but does not export a viem chain definition;
|
|
1409
|
-
use your application's chain/client setup when constructing clients.
|
|
1338
|
+
Arc uses native USDC with 18 decimals. Import the SDK's `arc` chain definition and provide an explicit RPC transport; Multicall3 is configured for fee previews. Arc launches with `numeraire: zeroAddress` must stay on Uniswap V4: all V3 static launches (including `LockableUniswapV3Initializer`) and both `uniswapV2` and `uniswapV2Split` migrations reject native USDC. Use a nonzero ERC-20 numeraire for those V2/V3 paths. For native dynamic auctions on Arc, use `dopplerHookMigrator`; locked native multicurve pools can use `noOp`.
|
|
1410
1339
|
|
|
1411
1340
|
## Advanced Usage
|
|
1412
1341
|
|
|
@@ -1763,49 +1692,40 @@ pnpm dev
|
|
|
1763
1692
|
|
|
1764
1693
|
The SDK includes comprehensive tests covering:
|
|
1765
1694
|
|
|
1766
|
-
- **Airlock Whitelisting**: Verifies that
|
|
1767
|
-
- **
|
|
1695
|
+
- **Airlock Whitelisting**: Verifies that configured modules are whitelisted on the selected networks
|
|
1696
|
+
- **Auction Workflows**: Tests dynamic and multicurve creation, quoting, and executed buy/sell round trips on local Anvil forks
|
|
1768
1697
|
- **Token Address Mining**: Tests for generating optimized token addresses
|
|
1769
1698
|
|
|
1770
|
-
|
|
1699
|
+
Configure Alchemy once, then run the whitelist audit:
|
|
1771
1700
|
|
|
1772
1701
|
```bash
|
|
1773
|
-
|
|
1702
|
+
export ALCHEMY_API_KEY=your_key_here
|
|
1774
1703
|
pnpm test:whitelisting
|
|
1775
1704
|
|
|
1776
|
-
# With Alchemy fallback (faster and more reliable)
|
|
1777
|
-
ALCHEMY_API_KEY=your_key_here pnpm test:whitelisting
|
|
1778
|
-
|
|
1779
1705
|
# Limit to specific whitelist-audit chains when needed
|
|
1780
|
-
TEST_CHAINS=mainnet,base,base-sepolia,arbitrum,bsc,monad-mainnet,robinhood pnpm test:whitelisting
|
|
1706
|
+
TEST_CHAINS=mainnet,base,base-sepolia,arbitrum,bsc,arc,monad-mainnet,robinhood pnpm test:whitelisting
|
|
1781
1707
|
```
|
|
1782
1708
|
|
|
1783
|
-
|
|
1709
|
+
Use `TEST_CHAINS` to select networks by their comma-separated names, or omit it to check all networks configured in the whitelisting suite.
|
|
1784
1710
|
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
1. Chain-specific RPC URL env var (`ETH_MAINNET_RPC_URL`, `ARBITRUM_RPC_URL`, `BSC_RPC_URL`, `BASE_RPC_URL`, `BASE_SEPOLIA_RPC_URL`)
|
|
1788
|
-
2. `ALCHEMY_API_KEY` fallback for supported Alchemy networks, including Monad Mainnet
|
|
1789
|
-
3. Public/default RPC URL
|
|
1711
|
+
The test harness selects the network endpoint from the chain ID; no per-chain RPC URL setup is needed.
|
|
1790
1712
|
|
|
1791
1713
|
To run fork tests (Anvil):
|
|
1792
1714
|
|
|
1793
1715
|
```bash
|
|
1794
1716
|
# all fork tests
|
|
1795
|
-
|
|
1717
|
+
pnpm test:fork
|
|
1796
1718
|
|
|
1797
1719
|
# chain-specific fork tests
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1720
|
+
TEST_CHAIN=base pnpm test:fork
|
|
1721
|
+
TEST_CHAIN=base-sepolia pnpm test:fork
|
|
1722
|
+
TEST_CHAIN=mainnet pnpm test:fork
|
|
1723
|
+
TEST_CHAIN=monad-mainnet pnpm test:fork
|
|
1724
|
+
TEST_CHAIN=robinhood pnpm test:fork
|
|
1725
|
+
TEST_CHAIN=arc pnpm test:fork
|
|
1801
1726
|
```
|
|
1802
1727
|
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
```bash
|
|
1806
|
-
ETH_MAINNET_RPC_URL=https://... TEST_CHAIN=mainnet pnpm test:fork
|
|
1807
|
-
ARBITRUM_RPC_URL=https://... TEST_CHAIN=arbitrum pnpm test:fork
|
|
1808
|
-
```
|
|
1728
|
+
The shared mainnet suite buys and partially sells through each newly created dynamic, Rehype, NoOp, and deployed scheduled pool. Arc uses native USDC; other networks use their configured wrapped native token. Checks verify receipts, acquired and sold tokens, and returned numeraire, with gas costs excluded from native sell proceeds. Fork tests do not broadcast to mainnet.
|
|
1809
1729
|
|
|
1810
1730
|
## Migration from Previous SDKs
|
|
1811
1731
|
|