@whetstone-research/doppler-sdk 1.0.35 → 1.0.37

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,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 Base, Unichain, Ink, and other supported chains; Solana/SVM support via explicit Solana program deployments
18
+ - **Network Support**: EVM deployments on Base, Arbitrum One, Unichain, Ink, and other supported chains; Solana/SVM support via explicit Solana program deployments
19
19
 
20
20
  ## Installation
21
21
 
@@ -103,6 +103,8 @@ For runnable Solana flows, configure `examples/.env` and run with `pnpm tsx`, fo
103
103
  - [examples/solana-usdc-cosigner-gated-buy.ts](./examples/solana-usdc-cosigner-gated-buy.ts)
104
104
  - [examples/solana-prediction-market.ts](./examples/solana-prediction-market.ts)
105
105
  - [examples/solana-swap.ts](./examples/solana-swap.ts)
106
+ - [examples/solana-vesting-launch.ts](./examples/solana-vesting-launch.ts)
107
+ - [examples/solana-vesting-claim.ts](./examples/solana-vesting-claim.ts)
106
108
 
107
109
  To implement an independently deployed callback program, see
108
110
  [Building a custom Solana hook](./docs/solana-custom-hooks.md) and the
@@ -1178,53 +1180,43 @@ console.log('Expected output:', quote.amountOut);
1178
1180
  console.log('Price after swap:', quote.sqrtPriceX96After);
1179
1181
  ```
1180
1182
 
1181
- ## Atomic Create + Pre‑Buy (Bundle)
1183
+ ## Atomic Multicurve Dev Buy
1182
1184
 
1183
- For static auctions, you can create the pool and execute a pre‑buy in a single transaction via the Bundler.
1185
+ Multicurve dev buys create the market and execute one exact-input purchase through Bundler in the same transaction. They support DopplerHookInitializer and Rehype initializer families; standard, scheduled, and decay initializers reject them. Production use is intended for compatible Rehype launches with no-op governance and no-op migration.
1184
1186
 
1185
- High‑level flow:
1186
-
1187
- - Simulate create to get `CreateParams` and the predicted token address
1188
- - Decide `amountOut` to buy, simulate `amountIn` with `simulateBundleExactOutput(...)`
1189
- - Build Universal Router commands (e.g., via `doppler-router`)
1190
- - Call `factory.bundle(createParams, commands, inputs, { value })`
1187
+ ```ts
1188
+ const params = sdk
1189
+ .buildMulticurveAuction()
1190
+ // Configure token, sale, curves, and Rehype initializer as usual.
1191
+ .withGovernance({ type: 'noOp' })
1192
+ .withMigration({ type: 'noOp' })
1193
+ .withDevBuy({
1194
+ exactAmountIn: parseEther('0.01'),
1195
+ recipient: user,
1196
+ vesting: {
1197
+ vestingDuration: 7n * 24n * 60n * 60n,
1198
+ cliffDuration: 24n * 60n * 60n,
1199
+ permissionlessClaim: false,
1200
+ },
1201
+ })
1202
+ .build();
1191
1203
 
1192
- See docs/quotes-and-swaps.md for a full example.
1204
+ const simulated = await sdk.factory.simulateCreateMulticurve(params);
1205
+ const result = await simulated.execute();
1193
1206
 
1194
- ### Multicurve Bundler Helpers
1207
+ console.log('Simulated output:', simulated.devBuy?.simulatedAmountOut);
1208
+ console.log('Actual output:', result.devBuy?.amountOut);
1209
+ ```
1195
1210
 
1196
- Multicurve auctions expose similar helpers that work with the Doppler Bundler once it has been upgraded
1197
- with multicurve support (selector check added in `0.0.1-alpha.47`). The SDK now verifies the bundler bytecode
1198
- before attempting these flows; if you see
1199
- `Bundler at <address> does not support multicurve bundling`, deploy or point at the latest bundler release.
1211
+ Omit `vesting` to deliver the purchased tokens directly to `recipient`. When vesting is configured, Bundler holds the output and releases it under the specified schedule; this is independent from `.withVesting(...)`, which configures token allocation vesting. `cliffDuration` defaults to zero and `permissionlessClaim` defaults to `false`.
1200
1212
 
1201
- ```ts
1202
- // Prepare multicurve CreateParams up front
1203
- const createParams = sdk.factory.encodeCreateMulticurveParams(multicurveConfig);
1204
-
1205
- // Quote an exact-out bundle
1206
- const exactOutQuote = await sdk.factory.simulateMulticurveBundleExactOut(
1207
- createParams,
1208
- {
1209
- exactAmountOut: parseEther('100'),
1210
- },
1211
- );
1213
+ Native numeraire sends exactly `exactAmountIn` with the Bundler transaction. ERC-20 numeraire may require a separate exact approval transaction before the atomic create-and-buy transaction; the wallet must already hold the input token. Permit2 and Universal Router commands are not part of this flow.
1212
1214
 
1213
- // Quote an exact-in bundle
1214
- const exactInQuote = await sdk.factory.simulateMulticurveBundleExactIn(
1215
- createParams,
1216
- {
1217
- exactAmountIn: parseEther('25'),
1218
- },
1219
- );
1215
+ Use `.withBundler(address)` for a compatible custom deployment. Read custody with `sdk.getBundler(address).getVesting(asset)` and `getClaimable(asset)`, then submit a vested claim with `claim(asset)`. Claims always pay the recorded recipient, including when `permissionlessClaim` allows another account to trigger them.
1220
1216
 
1221
- console.log('Predicted asset:', exactOutQuote.asset);
1222
- console.log('PoolKey:', exactOutQuote.poolKey);
1223
- console.log('Input required:', exactOutQuote.amountIn);
1224
- ```
1217
+ Bundler is exact-input only and provides no minimum output, deadline, or slippage guard. `simulateCreateMulticurve` returns the informational `simulatedAmountOut`; execution returns the amount verified from the Bundler receipt.
1225
1218
 
1226
- The multicurve helpers automatically normalise the returned PoolKey to maintain canonical token ordering and
1227
- hash the result when collecting fees, so consumers no longer need to manually assemble the PoolId.
1219
+ See [docs/quotes-and-swaps.md](./docs/quotes-and-swaps.md) and [examples/multicurve-dev-buy-weth.ts](./examples/multicurve-dev-buy-weth.ts) for complete flows.
1228
1220
 
1229
1221
  ## Migration Configuration
1230
1222
 
@@ -1496,6 +1488,9 @@ for (const id of SUPPORTED_CHAIN_IDS) {
1496
1488
  }
1497
1489
  ```
1498
1490
 
1491
+ Arbitrum One is available as `CHAIN_IDS.ARBITRUM` (`42161`) with a viem chain
1492
+ definition included in `SupportedChain`.
1493
+
1499
1494
  Robinhood Chain is available as `CHAIN_IDS.ROBINHOOD` (`4663`). The SDK exposes
1500
1495
  addresses and support checks for it, but does not export a viem chain definition;
1501
1496
  use your application's chain/client setup when constructing clients.
@@ -1855,7 +1850,7 @@ pnpm dev
1855
1850
 
1856
1851
  The SDK includes comprehensive tests covering:
1857
1852
 
1858
- - **Airlock Whitelisting**: Verifies that all modules are properly whitelisted on Ethereum Mainnet, Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain
1853
+ - **Airlock Whitelisting**: Verifies that all modules are properly whitelisted on Ethereum Mainnet, Arbitrum One, Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain
1859
1854
  - **Multicurve Functionality**: Tests multicurve auction creation and quoting
1860
1855
  - **Token Address Mining**: Tests for generating optimized token addresses
1861
1856
 
@@ -1869,14 +1864,14 @@ pnpm test:whitelisting
1869
1864
  ALCHEMY_API_KEY=your_key_here pnpm test:whitelisting
1870
1865
 
1871
1866
  # Limit to specific whitelist-audit chains when needed
1872
- TEST_CHAINS=mainnet,base,base-sepolia,monad-mainnet,robinhood pnpm test:whitelisting
1867
+ TEST_CHAINS=mainnet,base,base-sepolia,arbitrum,monad-mainnet,robinhood pnpm test:whitelisting
1873
1868
  ```
1874
1869
 
1875
- The whitelisting suite is scoped to the release-audit chains: Ethereum Mainnet, Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain.
1870
+ The whitelisting suite is scoped to the release-audit chains: Ethereum Mainnet, Arbitrum One, Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain.
1876
1871
 
1877
1872
  Whitelisting test RPC priority is:
1878
1873
 
1879
- 1. Chain-specific RPC URL env var (`ETH_MAINNET_RPC_URL`, `BASE_RPC_URL`, `BASE_SEPOLIA_RPC_URL`, `MONAD_MAINNET_RPC_URL`)
1874
+ 1. Chain-specific RPC URL env var (`ETH_MAINNET_RPC_URL`, `ARBITRUM_RPC_URL`, `BASE_RPC_URL`, `BASE_SEPOLIA_RPC_URL`)
1880
1875
  2. `ALCHEMY_API_KEY` fallback for supported Alchemy networks, including Monad Mainnet
1881
1876
  3. Public/default RPC URL
1882
1877
 
@@ -1897,6 +1892,7 @@ You can also provide chain-specific RPC URLs directly:
1897
1892
 
1898
1893
  ```bash
1899
1894
  ETH_MAINNET_RPC_URL=https://... TEST_CHAIN=mainnet pnpm test:fork
1895
+ ARBITRUM_RPC_URL=https://... TEST_CHAIN=arbitrum pnpm test:fork
1900
1896
  ETH_SEPOLIA_RPC_URL=https://... TEST_CHAIN=eth-sepolia pnpm test:fork
1901
1897
  ```
1902
1898