@whetstone-research/doppler-sdk 0.0.1-alpha.2 → 0.0.1-alpha.20

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.
Files changed (196) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +130 -122
  3. package/dist/DopplerSDK.d.mts +19 -8
  4. package/dist/DopplerSDK.d.ts +19 -8
  5. package/dist/DopplerSDK.js +11 -11
  6. package/dist/DopplerSDK.mjs +10 -10
  7. package/dist/abis/bytecodes.d.mts +2 -1
  8. package/dist/abis/bytecodes.d.ts +2 -1
  9. package/dist/abis/bytecodes.js +8 -5
  10. package/dist/abis/bytecodes.mjs +1 -2
  11. package/dist/abis/index.d.mts +274 -6
  12. package/dist/abis/index.d.ts +274 -6
  13. package/dist/abis/index.js +26 -19
  14. package/dist/abis/index.mjs +2 -3
  15. package/dist/addresses.d.mts +2 -1
  16. package/dist/addresses.d.ts +2 -1
  17. package/dist/addresses.js +4 -5
  18. package/dist/addresses.mjs +1 -2
  19. package/dist/builders.d.mts +151 -0
  20. package/dist/builders.d.ts +151 -0
  21. package/dist/builders.js +17 -0
  22. package/dist/builders.js.map +1 -0
  23. package/dist/builders.mjs +4 -0
  24. package/dist/builders.mjs.map +1 -0
  25. package/dist/{chunk-5B7IYSVK.js → chunk-4ES2NJPN.js} +25 -12
  26. package/dist/chunk-4ES2NJPN.js.map +1 -0
  27. package/dist/{chunk-BYK425DD.mjs → chunk-4HLZEUQL.mjs} +135 -43
  28. package/dist/chunk-4HLZEUQL.mjs.map +1 -0
  29. package/dist/{chunk-2LPOXGKT.mjs → chunk-4YUXZRXO.mjs} +16 -15
  30. package/dist/chunk-4YUXZRXO.mjs.map +1 -0
  31. package/dist/{chunk-TOMVBPNZ.js → chunk-75EPC2O4.js} +5 -3
  32. package/dist/chunk-75EPC2O4.js.map +1 -0
  33. package/dist/{chunk-NDWBEGEN.mjs → chunk-7W72MFJO.mjs} +4 -3
  34. package/dist/chunk-7W72MFJO.mjs.map +1 -0
  35. package/dist/{chunk-OMN7RXR4.js → chunk-CIRZKWLL.js} +4 -2
  36. package/dist/chunk-CIRZKWLL.js.map +1 -0
  37. package/dist/{chunk-O55NMSZK.mjs → chunk-CTWOTZE3.mjs} +14 -7
  38. package/dist/chunk-CTWOTZE3.mjs.map +1 -0
  39. package/dist/{chunk-IGLVXIHA.js → chunk-EJDXU66H.js} +407 -326
  40. package/dist/chunk-EJDXU66H.js.map +1 -0
  41. package/dist/chunk-GED6IT3S.mjs +3 -0
  42. package/dist/{chunk-CYDWEPFL.mjs.map → chunk-GED6IT3S.mjs.map} +1 -1
  43. package/dist/{chunk-XJGF77WN.mjs → chunk-IEOMMR3F.mjs} +119 -4
  44. package/dist/chunk-IEOMMR3F.mjs.map +1 -0
  45. package/dist/{chunk-JHKPKTCV.js → chunk-KEAGCODJ.js} +119 -3
  46. package/dist/chunk-KEAGCODJ.js.map +1 -0
  47. package/dist/chunk-KZ72ODWA.js +254 -0
  48. package/dist/chunk-KZ72ODWA.js.map +1 -0
  49. package/dist/chunk-LGTYMP3U.mjs +28 -0
  50. package/dist/chunk-LGTYMP3U.mjs.map +1 -0
  51. package/dist/{chunk-OPKQMN46.mjs → chunk-MF3DE5TA.mjs} +5 -3
  52. package/dist/chunk-MF3DE5TA.mjs.map +1 -0
  53. package/dist/{chunk-R3YCKIM4.js → chunk-NF24E36D.js} +25 -18
  54. package/dist/chunk-NF24E36D.js.map +1 -0
  55. package/dist/chunk-O2GNGHWO.mjs +343 -0
  56. package/dist/chunk-O2GNGHWO.mjs.map +1 -0
  57. package/dist/{chunk-YPNUUFAD.js → chunk-OSE3SNKV.js} +26 -26
  58. package/dist/chunk-OSE3SNKV.js.map +1 -0
  59. package/dist/{chunk-IX32KFK3.js → chunk-PXU5SUOQ.js} +2 -2
  60. package/dist/chunk-PXU5SUOQ.js.map +1 -0
  61. package/dist/chunk-ROUB6IPW.js +346 -0
  62. package/dist/chunk-ROUB6IPW.js.map +1 -0
  63. package/dist/{chunk-BYR4WWCZ.mjs → chunk-T536EW7K.mjs} +19 -6
  64. package/dist/chunk-T536EW7K.mjs.map +1 -0
  65. package/dist/{chunk-6REZA4TU.mjs → chunk-UNVNLHH6.mjs} +8 -7
  66. package/dist/chunk-UNVNLHH6.mjs.map +1 -0
  67. package/dist/{chunk-6H6BP7GZ.mjs → chunk-VTPBUH7V.mjs} +2 -2
  68. package/dist/chunk-VTPBUH7V.mjs.map +1 -0
  69. package/dist/{chunk-K7BWQVAX.js → chunk-W3XY463N.js} +16 -15
  70. package/dist/chunk-W3XY463N.js.map +1 -0
  71. package/dist/{chunk-IPW2I4JJ.mjs → chunk-W6T5VJKW.mjs} +397 -316
  72. package/dist/chunk-W6T5VJKW.mjs.map +1 -0
  73. package/dist/chunk-WDWZPBQO.js +30 -0
  74. package/dist/chunk-WDWZPBQO.js.map +1 -0
  75. package/dist/{chunk-DLL6MEJA.js → chunk-WORNH3RO.js} +32 -31
  76. package/dist/chunk-WORNH3RO.js.map +1 -0
  77. package/dist/{chunk-L4TKYN6R.mjs → chunk-ZBPBUTD3.mjs} +7 -7
  78. package/dist/chunk-ZBPBUTD3.mjs.map +1 -0
  79. package/dist/chunk-ZQ4XMJH7.js +4 -0
  80. package/dist/{chunk-DRBRT57F.js.map → chunk-ZQ4XMJH7.js.map} +1 -1
  81. package/dist/constants.js +0 -1
  82. package/dist/constants.mjs +0 -1
  83. package/dist/entities/DopplerFactory.d.mts +58 -29
  84. package/dist/entities/DopplerFactory.d.ts +58 -29
  85. package/dist/entities/DopplerFactory.js +5 -6
  86. package/dist/entities/DopplerFactory.mjs +4 -5
  87. package/dist/entities/auction/DynamicAuction.d.mts +5 -3
  88. package/dist/entities/auction/DynamicAuction.d.ts +5 -3
  89. package/dist/entities/auction/DynamicAuction.js +5 -6
  90. package/dist/entities/auction/DynamicAuction.mjs +4 -5
  91. package/dist/entities/auction/StaticAuction.d.mts +5 -3
  92. package/dist/entities/auction/StaticAuction.d.ts +5 -3
  93. package/dist/entities/auction/StaticAuction.js +5 -6
  94. package/dist/entities/auction/StaticAuction.mjs +4 -5
  95. package/dist/entities/auction/index.d.mts +2 -0
  96. package/dist/entities/auction/index.d.ts +2 -0
  97. package/dist/entities/auction/index.js +9 -10
  98. package/dist/entities/auction/index.mjs +5 -6
  99. package/dist/entities/quoter/Quoter.d.mts +43 -2
  100. package/dist/entities/quoter/Quoter.d.ts +43 -2
  101. package/dist/entities/quoter/Quoter.js +5 -6
  102. package/dist/entities/quoter/Quoter.mjs +4 -5
  103. package/dist/entities/quoter/index.d.mts +3 -0
  104. package/dist/entities/quoter/index.d.ts +3 -0
  105. package/dist/entities/quoter/index.js +5 -6
  106. package/dist/entities/quoter/index.mjs +4 -5
  107. package/dist/entities/token/derc20/Derc20.d.mts +11 -4
  108. package/dist/entities/token/derc20/Derc20.d.ts +11 -4
  109. package/dist/entities/token/derc20/Derc20.js +4 -5
  110. package/dist/entities/token/derc20/Derc20.mjs +3 -4
  111. package/dist/entities/token/derc20/index.d.mts +3 -0
  112. package/dist/entities/token/derc20/index.d.ts +3 -0
  113. package/dist/entities/token/derc20/index.js +4 -5
  114. package/dist/entities/token/derc20/index.mjs +3 -4
  115. package/dist/entities/token/eth/Eth.d.mts +6 -3
  116. package/dist/entities/token/eth/Eth.d.ts +6 -3
  117. package/dist/entities/token/eth/Eth.js +2 -3
  118. package/dist/entities/token/eth/Eth.mjs +1 -2
  119. package/dist/entities/token/eth/index.d.mts +3 -0
  120. package/dist/entities/token/eth/index.d.ts +3 -0
  121. package/dist/entities/token/eth/index.js +2 -3
  122. package/dist/entities/token/eth/index.mjs +1 -2
  123. package/dist/entities/token/index.d.mts +3 -0
  124. package/dist/entities/token/index.d.ts +3 -0
  125. package/dist/entities/token/index.js +6 -7
  126. package/dist/entities/token/index.mjs +4 -5
  127. package/dist/index.d.mts +7 -4
  128. package/dist/index.d.ts +7 -4
  129. package/dist/index.js +74 -53
  130. package/dist/index.js.map +1 -1
  131. package/dist/index.mjs +16 -15
  132. package/dist/index.mjs.map +1 -1
  133. package/dist/types.d.mts +67 -15
  134. package/dist/types.d.ts +67 -15
  135. package/dist/types.js +3 -3
  136. package/dist/types.mjs +2 -2
  137. package/dist/utils/airlock.d.mts +8 -0
  138. package/dist/utils/airlock.d.ts +8 -0
  139. package/dist/utils/airlock.js +13 -0
  140. package/dist/utils/airlock.js.map +1 -0
  141. package/dist/utils/airlock.mjs +4 -0
  142. package/dist/utils/airlock.mjs.map +1 -0
  143. package/dist/utils/index.d.mts +5 -0
  144. package/dist/utils/index.d.ts +5 -0
  145. package/dist/utils/index.js +7 -2
  146. package/dist/utils/index.mjs +3 -2
  147. package/dist/utils/priceHelpers.js +0 -1
  148. package/dist/utils/priceHelpers.mjs +0 -1
  149. package/dist/utils/tickMath.js +0 -1
  150. package/dist/utils/tickMath.mjs +0 -1
  151. package/package.json +8 -10
  152. package/dist/__tests__/mocks/addresses.d.mts +0 -46
  153. package/dist/__tests__/mocks/addresses.d.ts +0 -46
  154. package/dist/__tests__/mocks/addresses.js +0 -53
  155. package/dist/__tests__/mocks/addresses.js.map +0 -1
  156. package/dist/__tests__/mocks/addresses.mjs +0 -44
  157. package/dist/__tests__/mocks/addresses.mjs.map +0 -1
  158. package/dist/__tests__/mocks/clients.d.mts +0 -22
  159. package/dist/__tests__/mocks/clients.d.ts +0 -22
  160. package/dist/__tests__/mocks/clients.js +0 -17088
  161. package/dist/__tests__/mocks/clients.js.map +0 -1
  162. package/dist/__tests__/mocks/clients.mjs +0 -17084
  163. package/dist/__tests__/mocks/clients.mjs.map +0 -1
  164. package/dist/chunk-2LPOXGKT.mjs.map +0 -1
  165. package/dist/chunk-5B7IYSVK.js.map +0 -1
  166. package/dist/chunk-6H6BP7GZ.mjs.map +0 -1
  167. package/dist/chunk-6REZA4TU.mjs.map +0 -1
  168. package/dist/chunk-BYK425DD.mjs.map +0 -1
  169. package/dist/chunk-BYR4WWCZ.mjs.map +0 -1
  170. package/dist/chunk-CYDWEPFL.mjs +0 -3
  171. package/dist/chunk-DLL6MEJA.js.map +0 -1
  172. package/dist/chunk-DRBRT57F.js +0 -4
  173. package/dist/chunk-IGLVXIHA.js.map +0 -1
  174. package/dist/chunk-IPW2I4JJ.mjs.map +0 -1
  175. package/dist/chunk-IX32KFK3.js.map +0 -1
  176. package/dist/chunk-JHKPKTCV.js.map +0 -1
  177. package/dist/chunk-K7BWQVAX.js.map +0 -1
  178. package/dist/chunk-KEXKKQVW.js +0 -42
  179. package/dist/chunk-KEXKKQVW.js.map +0 -1
  180. package/dist/chunk-L4TKYN6R.mjs.map +0 -1
  181. package/dist/chunk-LOROXNH3.mjs +0 -37
  182. package/dist/chunk-LOROXNH3.mjs.map +0 -1
  183. package/dist/chunk-NDWBEGEN.mjs.map +0 -1
  184. package/dist/chunk-O55NMSZK.mjs.map +0 -1
  185. package/dist/chunk-OMN7RXR4.js.map +0 -1
  186. package/dist/chunk-OPKQMN46.mjs.map +0 -1
  187. package/dist/chunk-R3YCKIM4.js.map +0 -1
  188. package/dist/chunk-SIVXK7WY.js +0 -162
  189. package/dist/chunk-SIVXK7WY.js.map +0 -1
  190. package/dist/chunk-TOMVBPNZ.js.map +0 -1
  191. package/dist/chunk-XJGF77WN.mjs.map +0 -1
  192. package/dist/chunk-YPNUUFAD.js.map +0 -1
  193. package/dist/magic-string.es-NMLAOY5A.js +0 -1298
  194. package/dist/magic-string.es-NMLAOY5A.js.map +0 -1
  195. package/dist/magic-string.es-QCVTE6QG.mjs +0 -1292
  196. package/dist/magic-string.es-QCVTE6QG.mjs.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Whetstone Research
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -59,42 +59,20 @@ const sdk = new DopplerSDK({
59
59
  Static auctions use Uniswap V3 pools with concentrated liquidity in a fixed price range. They're ideal for simple, predictable price discovery.
60
60
 
61
61
  ```typescript
62
- const result = await sdk.factory.createStaticAuction({
63
- token: {
64
- name: 'My Token',
65
- symbol: 'MTK',
66
- tokenURI: 'https://example.com/metadata.json',
67
- totalSupply: parseEther('1000000000'), // 1 billion tokens
68
- },
69
- sale: {
70
- numTokensToSell: parseEther('900000000'), // Sell 900 million
71
- numeraire: '0x...', // WETH address
72
- },
73
- pool: {
74
- startTick: -92103, // ~0.0001 ETH per token
75
- endTick: -69080, // ~0.001 ETH per token
76
- fee: 10000, // 1%
77
- numPositions: 15, // Number of liquidity positions
78
- },
79
- vesting: {
80
- duration: BigInt(365 * 24 * 60 * 60), // 1 year
81
- recipients: [
82
- { address: '0x...', amount: parseEther('50000000') }, // 50M tokens
83
- { address: '0x...', amount: parseEther('50000000') }, // 50M tokens
84
- ],
85
- },
86
- migration: {
87
- type: 'uniswapV2', // Migrate to V2 after auction
88
- },
89
- governance: {
90
- maxShareToBeSold: parseEther('0.35'), // 35% max
91
- yearlyMintRate: parseEther('0.02'), // 2% annual
92
- },
93
- userAddress: '0x...', // Your address
94
- });
95
-
96
- console.log('Pool address:', result.poolAddress);
97
- console.log('Token address:', result.tokenAddress);
62
+ import { StaticAuctionBuilder } from '@whetstone-research/doppler-sdk'
63
+
64
+ const params = new StaticAuctionBuilder()
65
+ .tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
66
+ .saleConfig({ initialSupply: parseEther('1000000000'), numTokensToSell: parseEther('900000000'), numeraire: '0x...' })
67
+ .poolByTicks({ startTick: -92103, endTick: -69080, fee: 10000, numPositions: 15 })
68
+ .withVesting({ duration: BigInt(365 * 24 * 60 * 60) })
69
+ .withMigration({ type: 'uniswapV2' })
70
+ .withUserAddress('0x...')
71
+ .build()
72
+
73
+ const result = await sdk.factory.createStaticAuction(params)
74
+ console.log('Pool address:', result.poolAddress)
75
+ console.log('Token address:', result.tokenAddress)
98
76
  ```
99
77
 
100
78
  ### Dynamic Auction (Dutch Auction)
@@ -102,55 +80,92 @@ console.log('Token address:', result.tokenAddress);
102
80
  Dynamic auctions use Uniswap V4 hooks to implement gradual Dutch auctions where the price moves over time.
103
81
 
104
82
  ```typescript
105
- const result = await sdk.factory.createDynamicAuction({
106
- token: {
107
- name: 'My Token',
108
- symbol: 'MTK',
109
- tokenURI: 'https://example.com/metadata.json',
110
- totalSupply: parseEther('1000000'), // 1M tokens
111
- },
112
- sale: {
113
- numTokensToSell: parseEther('900000'), // Sell 900k
114
- numeraire: '0x...', // WETH address
115
- minProceeds: parseEther('100'), // Min 100 ETH
116
- maxProceeds: parseEther('1000'), // Max 1000 ETH
117
- },
118
- auction: {
119
- duration: 7, // 7 days
120
- epochLength: 3600, // 1 hour epochs
121
- startTick: -92103, // ~0.0001 ETH per token
122
- endTick: -69080, // ~0.01 ETH per token
123
- gamma: parseEther('0.998'), // Price decrease rate
124
- numPdSlugs: 5, // Price discovery slugs
125
- },
126
- pool: {
127
- fee: 3000, // 0.3%
128
- tickSpacing: 60, // Standard for 0.3% pools
129
- },
130
- vesting: {
131
- duration: BigInt(365 * 24 * 60 * 60), // 1 year
132
- recipients: [
133
- { address: '0x...', amount: parseEther('50000') },
134
- { address: '0x...', amount: parseEther('50000') },
135
- ],
136
- },
137
- migration: {
83
+ import { DynamicAuctionBuilder } from '@whetstone-research/doppler-sdk'
84
+
85
+ const params = new DynamicAuctionBuilder()
86
+ .tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
87
+ .saleConfig({ initialSupply: parseEther('1000000'), numTokensToSell: parseEther('900000'), numeraire: '0x...' })
88
+ .poolConfig({ fee: 3000, tickSpacing: 60 })
89
+ .auctionByTicks({
90
+ durationDays: 7,
91
+ epochLength: 3600,
92
+ startTick: -92103,
93
+ endTick: -69080,
94
+ minProceeds: parseEther('100'),
95
+ maxProceeds: parseEther('1000'),
96
+ numPdSlugs: 5,
97
+ })
98
+ .withVesting({ duration: BigInt(365 * 24 * 60 * 60) })
99
+ .withMigration({
138
100
  type: 'uniswapV4',
139
101
  fee: 3000,
140
102
  tickSpacing: 60,
141
103
  streamableFees: {
142
- lockDuration: 365 * 24 * 60 * 60, // 1 year
104
+ lockDuration: 365 * 24 * 60 * 60,
143
105
  beneficiaries: [
144
- { address: '0x...', percentage: 5000 }, // 50%
145
- { address: '0x...', percentage: 5000 }, // 50%
106
+ { address: '0x...', percentage: 5000 },
107
+ { address: '0x...', percentage: 5000 },
146
108
  ],
147
109
  },
148
- },
149
- userAddress: '0x...',
150
- });
110
+ })
111
+ // Optional: override module addresses instead of chain defaults
112
+ .withAirlock('0xAirlock...')
113
+ .withPoolManager('0xPoolMgr...')
114
+ .withDopplerDeployer('0xDeployer...')
115
+ .withTokenFactory('0xFactory...')
116
+ .withV4Initializer('0xInitializer...')
117
+ .withGovernanceFactory('0xGovFactory...') // used for both standard and no‑op governance
118
+ // .withV2Migrator('0xV2Migrator...')
119
+ // .withV3Migrator('0xV3Migrator...')
120
+ // .withV4Migrator('0xV4Migrator...')
121
+ .withUserAddress('0x...')
122
+ .build()
123
+
124
+ const result = await sdk.factory.createDynamicAuction(params)
125
+ console.log('Hook address:', result.hookAddress)
126
+ console.log('Token address:', result.tokenAddress)
127
+ ```
128
+
129
+ #### Transaction gas override
130
+ - You can pass a gas limit to factory create calls via the `gas` field on `CreateStaticAuctionParams`/`CreateDynamicAuctionParams`.
131
+ - If omitted, the SDK uses a default gas limit of 13,500,000 for the `create()` transaction.
132
+
133
+
151
134
 
152
- console.log('Hook address:', result.hookAddress);
153
- console.log('Token address:', result.tokenAddress);
135
+ ### Builder Pattern (Recommended)
136
+
137
+ Prefer using the builders to construct `CreateStaticAuctionParams` and `CreateDynamicAuctionParams` fluently and safely. Builders apply sensible defaults and can compute ticks and gamma for you.
138
+
139
+ ```typescript
140
+ import { StaticAuctionBuilder, DynamicAuctionBuilder } from '@whetstone-research/doppler-sdk'
141
+ import { parseEther } from 'viem'
142
+
143
+ // Dynamic auction via builder
144
+ const dynamicParams = new DynamicAuctionBuilder()
145
+ .tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
146
+ .saleConfig({ initialSupply: parseEther('1000000'), numTokensToSell: parseEther('500000'), numeraire: wethAddress })
147
+ .poolConfig({ fee: 3000, tickSpacing: 60 })
148
+ .auctionByPriceRange({
149
+ priceRange: { startPrice: 0.0001, endPrice: 0.001 },
150
+ minProceeds: parseEther('100'),
151
+ maxProceeds: parseEther('1000'),
152
+ })
153
+ .withMigration({ type: 'uniswapV2' })
154
+ .withUserAddress('0x...')
155
+ .build()
156
+
157
+ const dyn = await sdk.factory.createDynamicAuction(dynamicParams)
158
+
159
+ // Static auction via builder
160
+ const staticParams = new StaticAuctionBuilder()
161
+ .tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
162
+ .saleConfig({ initialSupply: parseEther('1000000000'), numTokensToSell: parseEther('900000000'), numeraire: wethAddress })
163
+ .poolByPriceRange({ priceRange: { startPrice: 0.0001, endPrice: 0.001 }, fee: 3000 })
164
+ .withMigration({ type: 'uniswapV2' })
165
+ .withUserAddress('0x...')
166
+ .build()
167
+
168
+ const stat = await sdk.factory.createStaticAuction(staticParams)
154
169
  ```
155
170
 
156
171
  ### Simplified Creation with Defaults
@@ -158,52 +173,33 @@ console.log('Token address:', result.tokenAddress);
158
173
  The SDK intelligently applies defaults when parameters are omitted. Here are examples with minimal configuration:
159
174
 
160
175
  ```typescript
161
- // Minimal static auction
162
- const result = await sdk.factory.createStaticAuction({
163
- token: {
164
- name: 'My Token',
165
- symbol: 'MTK',
166
- tokenURI: 'https://example.com/metadata.json',
167
- // totalSupply defaults to 1 billion
168
- },
169
- sale: {
170
- // numTokensToSell defaults to 90% of total supply
171
- numeraire: '0x...', // WETH address (required)
172
- },
173
- pool: {
174
- // Defaults: fee=10000 (1%), numPositions=15
175
- // Start/end ticks calculated from reasonable price range
176
- },
177
- migration: {
178
- type: 'uniswapV2', // Required
179
- },
180
- userAddress: '0x...', // Required
181
- });
182
-
183
- // Minimal dynamic auction
184
- const result = await sdk.factory.createDynamicAuction({
185
- token: {
186
- name: 'My Token',
187
- symbol: 'MTK',
188
- tokenURI: 'https://example.com/metadata.json',
189
- },
190
- sale: {
191
- numeraire: '0x...', // WETH address
176
+ // Minimal static auction via builder
177
+ const staticMinimal = new StaticAuctionBuilder()
178
+ .tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
179
+ .saleConfig({ initialSupply: parseEther('1000000000'), numTokensToSell: parseEther('900000000'), numeraire: '0x...' })
180
+ .poolByTicks({ fee: 10000 }) // uses default tick range and numPositions
181
+ .withMigration({ type: 'uniswapV2' })
182
+ .withUserAddress('0x...')
183
+ .build()
184
+
185
+ const staticResult = await sdk.factory.createStaticAuction(staticMinimal)
186
+
187
+ // Minimal dynamic auction via builder
188
+ const dynamicMinimal = new DynamicAuctionBuilder()
189
+ .tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
190
+ .saleConfig({ initialSupply: parseEther('1000000'), numTokensToSell: parseEther('900000'), numeraire: '0x...' })
191
+ .poolConfig({ fee: 3000, tickSpacing: 60 })
192
+ .auctionByTicks({
193
+ startTick: -92103,
194
+ endTick: -69080,
192
195
  minProceeds: parseEther('100'),
193
196
  maxProceeds: parseEther('1000'),
194
- },
195
- auction: {
196
- // Defaults: duration=7 days, epochLength=1 hour
197
- // gamma and numPdSlugs auto-calculated
198
- },
199
- pool: {
200
- // Defaults: fee=3000 (0.3%), tickSpacing=60
201
- },
202
- migration: {
203
- type: 'uniswapV4',
204
- },
205
- userAddress: '0x...',
206
- });
197
+ }) // duration/epoch defaults applied; gamma computed automatically
198
+ .withMigration({ type: 'uniswapV4' })
199
+ .withUserAddress('0x...')
200
+ .build()
201
+
202
+ const dynamicResult = await sdk.factory.createDynamicAuction(dynamicMinimal)
207
203
  ```
208
204
 
209
205
  ## Interacting with Auctions
@@ -298,6 +294,18 @@ console.log('Expected output:', quote.amountOut);
298
294
  console.log('Price after swap:', quote.sqrtPriceX96After);
299
295
  ```
300
296
 
297
+ ## Atomic Create + Pre‑Buy (Bundle)
298
+
299
+ For static auctions, you can create the pool and execute a pre‑buy in a single transaction via the Bundler.
300
+
301
+ High‑level flow:
302
+ - Simulate create to get `CreateParams` and the predicted token address
303
+ - Decide `amountOut` to buy, simulate `amountIn` with `simulateBundleExactOutput(...)`
304
+ - Build Universal Router commands (e.g., via `doppler-router`)
305
+ - Call `factory.bundle(createParams, commands, inputs, { value })`
306
+
307
+ See docs/quotes-and-swaps.md for a full example.
308
+
301
309
  ## Migration Configuration
302
310
 
303
311
  The SDK supports flexible migration paths after auction completion:
@@ -429,4 +437,4 @@ Contributions are welcome! Please see our [Contributing Guide](../../CONTRIBUTIN
429
437
 
430
438
  ## License
431
439
 
432
- MIT License - see [LICENSE](../../LICENSE) for details.
440
+ MIT License - see [LICENSE](../../LICENSE) for details.
@@ -1,21 +1,24 @@
1
- import { Address, PublicClient, WalletClient } from 'viem';
2
- import { DopplerSDKConfig, PoolInfo, HookInfo } from './types.mjs';
1
+ import { Address, WalletClient } from 'viem';
2
+ import { DopplerSDKConfig, PoolInfo, HookInfo, SupportedPublicClient } from './types.mjs';
3
+ import { SupportedChainId } from './addresses.mjs';
3
4
  import { DopplerFactory } from './entities/DopplerFactory.mjs';
4
5
  import { StaticAuction } from './entities/auction/StaticAuction.mjs';
5
6
  import { DynamicAuction } from './entities/auction/DynamicAuction.mjs';
6
7
  import { Quoter } from './entities/quoter/Quoter.mjs';
8
+ import { StaticAuctionBuilder, DynamicAuctionBuilder } from './builders.mjs';
9
+ import 'viem/chains';
7
10
 
8
- declare class DopplerSDK {
11
+ declare class DopplerSDK<C extends SupportedChainId = SupportedChainId> {
9
12
  private publicClient;
10
13
  private walletClient?;
11
- private chainId;
14
+ chainId: C;
12
15
  private _factory?;
13
16
  private _quoter?;
14
- constructor(config: DopplerSDKConfig);
17
+ constructor(config: DopplerSDKConfig<C>);
15
18
  /**
16
19
  * Get the factory instance for creating auctions
17
20
  */
18
- get factory(): DopplerFactory;
21
+ get factory(): DopplerFactory<C>;
19
22
  /**
20
23
  * Get the quoter instance for price queries
21
24
  */
@@ -40,15 +43,23 @@ declare class DopplerSDK {
40
43
  * @param hookAddress The address of the hook
41
44
  */
42
45
  getHookInfo(hookAddress: Address): Promise<HookInfo>;
46
+ /**
47
+ * Create a new static auction builder
48
+ */
49
+ buildStaticAuction(): StaticAuctionBuilder<C>;
50
+ /**
51
+ * Create a new dynamic auction builder
52
+ */
53
+ buildDynamicAuction(): DynamicAuctionBuilder<C>;
43
54
  /**
44
55
  * Get the current chain ID
45
56
  */
46
- getChainId(): number;
57
+ getChainId(): C;
47
58
  /**
48
59
  * Get the underlying clients
49
60
  */
50
61
  getClients(): {
51
- publicClient: PublicClient;
62
+ publicClient: SupportedPublicClient;
52
63
  walletClient?: WalletClient;
53
64
  };
54
65
  }
@@ -1,21 +1,24 @@
1
- import { Address, PublicClient, WalletClient } from 'viem';
2
- import { DopplerSDKConfig, PoolInfo, HookInfo } from './types.js';
1
+ import { Address, WalletClient } from 'viem';
2
+ import { DopplerSDKConfig, PoolInfo, HookInfo, SupportedPublicClient } from './types.js';
3
+ import { SupportedChainId } from './addresses.js';
3
4
  import { DopplerFactory } from './entities/DopplerFactory.js';
4
5
  import { StaticAuction } from './entities/auction/StaticAuction.js';
5
6
  import { DynamicAuction } from './entities/auction/DynamicAuction.js';
6
7
  import { Quoter } from './entities/quoter/Quoter.js';
8
+ import { StaticAuctionBuilder, DynamicAuctionBuilder } from './builders.js';
9
+ import 'viem/chains';
7
10
 
8
- declare class DopplerSDK {
11
+ declare class DopplerSDK<C extends SupportedChainId = SupportedChainId> {
9
12
  private publicClient;
10
13
  private walletClient?;
11
- private chainId;
14
+ chainId: C;
12
15
  private _factory?;
13
16
  private _quoter?;
14
- constructor(config: DopplerSDKConfig);
17
+ constructor(config: DopplerSDKConfig<C>);
15
18
  /**
16
19
  * Get the factory instance for creating auctions
17
20
  */
18
- get factory(): DopplerFactory;
21
+ get factory(): DopplerFactory<C>;
19
22
  /**
20
23
  * Get the quoter instance for price queries
21
24
  */
@@ -40,15 +43,23 @@ declare class DopplerSDK {
40
43
  * @param hookAddress The address of the hook
41
44
  */
42
45
  getHookInfo(hookAddress: Address): Promise<HookInfo>;
46
+ /**
47
+ * Create a new static auction builder
48
+ */
49
+ buildStaticAuction(): StaticAuctionBuilder<C>;
50
+ /**
51
+ * Create a new dynamic auction builder
52
+ */
53
+ buildDynamicAuction(): DynamicAuctionBuilder<C>;
43
54
  /**
44
55
  * Get the current chain ID
45
56
  */
46
- getChainId(): number;
57
+ getChainId(): C;
47
58
  /**
48
59
  * Get the underlying clients
49
60
  */
50
61
  getClients(): {
51
- publicClient: PublicClient;
62
+ publicClient: SupportedPublicClient;
52
63
  walletClient?: WalletClient;
53
64
  };
54
65
  }
@@ -1,23 +1,23 @@
1
1
  'use strict';
2
2
 
3
- var chunk5B7IYSVK_js = require('./chunk-5B7IYSVK.js');
4
- require('./chunk-P7CHGWY7.js');
5
- require('./chunk-SIVXK7WY.js');
3
+ var chunk4ES2NJPN_js = require('./chunk-4ES2NJPN.js');
6
4
  require('./chunk-KRN3ROUE.js');
7
- require('./chunk-DLL6MEJA.js');
8
- require('./chunk-R3YCKIM4.js');
9
- require('./chunk-IGLVXIHA.js');
10
- require('./chunk-K7BWQVAX.js');
5
+ require('./chunk-NF24E36D.js');
6
+ require('./chunk-EJDXU66H.js');
7
+ require('./chunk-P7CHGWY7.js');
8
+ require('./chunk-KZ72ODWA.js');
9
+ require('./chunk-WORNH3RO.js');
10
+ require('./chunk-ROUB6IPW.js');
11
11
  require('./chunk-ER42VG7H.js');
12
- require('./chunk-JHKPKTCV.js');
13
- require('./chunk-OMN7RXR4.js');
14
- require('./chunk-KEXKKQVW.js');
12
+ require('./chunk-W3XY463N.js');
13
+ require('./chunk-KEAGCODJ.js');
14
+ require('./chunk-CIRZKWLL.js');
15
15
 
16
16
 
17
17
 
18
18
  Object.defineProperty(exports, "DopplerSDK", {
19
19
  enumerable: true,
20
- get: function () { return chunk5B7IYSVK_js.DopplerSDK; }
20
+ get: function () { return chunk4ES2NJPN_js.DopplerSDK; }
21
21
  });
22
22
  //# sourceMappingURL=DopplerSDK.js.map
23
23
  //# sourceMappingURL=DopplerSDK.js.map
@@ -1,14 +1,14 @@
1
- export { DopplerSDK } from './chunk-BYR4WWCZ.mjs';
2
- import './chunk-QSQGLWNY.mjs';
3
- import './chunk-BYK425DD.mjs';
1
+ export { DopplerSDK } from './chunk-T536EW7K.mjs';
4
2
  import './chunk-AZLFJNTG.mjs';
5
- import './chunk-6REZA4TU.mjs';
6
- import './chunk-O55NMSZK.mjs';
7
- import './chunk-IPW2I4JJ.mjs';
8
- import './chunk-2LPOXGKT.mjs';
3
+ import './chunk-CTWOTZE3.mjs';
4
+ import './chunk-W6T5VJKW.mjs';
5
+ import './chunk-QSQGLWNY.mjs';
6
+ import './chunk-4HLZEUQL.mjs';
7
+ import './chunk-UNVNLHH6.mjs';
8
+ import './chunk-O2GNGHWO.mjs';
9
9
  import './chunk-T644D54P.mjs';
10
- import './chunk-XJGF77WN.mjs';
11
- import './chunk-NDWBEGEN.mjs';
12
- import './chunk-LOROXNH3.mjs';
10
+ import './chunk-4YUXZRXO.mjs';
11
+ import './chunk-IEOMMR3F.mjs';
12
+ import './chunk-7W72MFJO.mjs';
13
13
  //# sourceMappingURL=DopplerSDK.mjs.map
14
14
  //# sourceMappingURL=DopplerSDK.mjs.map