@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.
- package/LICENSE +21 -0
- package/README.md +130 -122
- package/dist/DopplerSDK.d.mts +19 -8
- package/dist/DopplerSDK.d.ts +19 -8
- package/dist/DopplerSDK.js +11 -11
- package/dist/DopplerSDK.mjs +10 -10
- package/dist/abis/bytecodes.d.mts +2 -1
- package/dist/abis/bytecodes.d.ts +2 -1
- package/dist/abis/bytecodes.js +8 -5
- package/dist/abis/bytecodes.mjs +1 -2
- package/dist/abis/index.d.mts +274 -6
- package/dist/abis/index.d.ts +274 -6
- package/dist/abis/index.js +26 -19
- package/dist/abis/index.mjs +2 -3
- package/dist/addresses.d.mts +2 -1
- package/dist/addresses.d.ts +2 -1
- package/dist/addresses.js +4 -5
- package/dist/addresses.mjs +1 -2
- package/dist/builders.d.mts +151 -0
- package/dist/builders.d.ts +151 -0
- package/dist/builders.js +17 -0
- package/dist/builders.js.map +1 -0
- package/dist/builders.mjs +4 -0
- package/dist/builders.mjs.map +1 -0
- package/dist/{chunk-5B7IYSVK.js → chunk-4ES2NJPN.js} +25 -12
- package/dist/chunk-4ES2NJPN.js.map +1 -0
- package/dist/{chunk-BYK425DD.mjs → chunk-4HLZEUQL.mjs} +135 -43
- package/dist/chunk-4HLZEUQL.mjs.map +1 -0
- package/dist/{chunk-2LPOXGKT.mjs → chunk-4YUXZRXO.mjs} +16 -15
- package/dist/chunk-4YUXZRXO.mjs.map +1 -0
- package/dist/{chunk-TOMVBPNZ.js → chunk-75EPC2O4.js} +5 -3
- package/dist/chunk-75EPC2O4.js.map +1 -0
- package/dist/{chunk-NDWBEGEN.mjs → chunk-7W72MFJO.mjs} +4 -3
- package/dist/chunk-7W72MFJO.mjs.map +1 -0
- package/dist/{chunk-OMN7RXR4.js → chunk-CIRZKWLL.js} +4 -2
- package/dist/chunk-CIRZKWLL.js.map +1 -0
- package/dist/{chunk-O55NMSZK.mjs → chunk-CTWOTZE3.mjs} +14 -7
- package/dist/chunk-CTWOTZE3.mjs.map +1 -0
- package/dist/{chunk-IGLVXIHA.js → chunk-EJDXU66H.js} +407 -326
- package/dist/chunk-EJDXU66H.js.map +1 -0
- package/dist/chunk-GED6IT3S.mjs +3 -0
- package/dist/{chunk-CYDWEPFL.mjs.map → chunk-GED6IT3S.mjs.map} +1 -1
- package/dist/{chunk-XJGF77WN.mjs → chunk-IEOMMR3F.mjs} +119 -4
- package/dist/chunk-IEOMMR3F.mjs.map +1 -0
- package/dist/{chunk-JHKPKTCV.js → chunk-KEAGCODJ.js} +119 -3
- package/dist/chunk-KEAGCODJ.js.map +1 -0
- package/dist/chunk-KZ72ODWA.js +254 -0
- package/dist/chunk-KZ72ODWA.js.map +1 -0
- package/dist/chunk-LGTYMP3U.mjs +28 -0
- package/dist/chunk-LGTYMP3U.mjs.map +1 -0
- package/dist/{chunk-OPKQMN46.mjs → chunk-MF3DE5TA.mjs} +5 -3
- package/dist/chunk-MF3DE5TA.mjs.map +1 -0
- package/dist/{chunk-R3YCKIM4.js → chunk-NF24E36D.js} +25 -18
- package/dist/chunk-NF24E36D.js.map +1 -0
- package/dist/chunk-O2GNGHWO.mjs +343 -0
- package/dist/chunk-O2GNGHWO.mjs.map +1 -0
- package/dist/{chunk-YPNUUFAD.js → chunk-OSE3SNKV.js} +26 -26
- package/dist/chunk-OSE3SNKV.js.map +1 -0
- package/dist/{chunk-IX32KFK3.js → chunk-PXU5SUOQ.js} +2 -2
- package/dist/chunk-PXU5SUOQ.js.map +1 -0
- package/dist/chunk-ROUB6IPW.js +346 -0
- package/dist/chunk-ROUB6IPW.js.map +1 -0
- package/dist/{chunk-BYR4WWCZ.mjs → chunk-T536EW7K.mjs} +19 -6
- package/dist/chunk-T536EW7K.mjs.map +1 -0
- package/dist/{chunk-6REZA4TU.mjs → chunk-UNVNLHH6.mjs} +8 -7
- package/dist/chunk-UNVNLHH6.mjs.map +1 -0
- package/dist/{chunk-6H6BP7GZ.mjs → chunk-VTPBUH7V.mjs} +2 -2
- package/dist/chunk-VTPBUH7V.mjs.map +1 -0
- package/dist/{chunk-K7BWQVAX.js → chunk-W3XY463N.js} +16 -15
- package/dist/chunk-W3XY463N.js.map +1 -0
- package/dist/{chunk-IPW2I4JJ.mjs → chunk-W6T5VJKW.mjs} +397 -316
- package/dist/chunk-W6T5VJKW.mjs.map +1 -0
- package/dist/chunk-WDWZPBQO.js +30 -0
- package/dist/chunk-WDWZPBQO.js.map +1 -0
- package/dist/{chunk-DLL6MEJA.js → chunk-WORNH3RO.js} +32 -31
- package/dist/chunk-WORNH3RO.js.map +1 -0
- package/dist/{chunk-L4TKYN6R.mjs → chunk-ZBPBUTD3.mjs} +7 -7
- package/dist/chunk-ZBPBUTD3.mjs.map +1 -0
- package/dist/chunk-ZQ4XMJH7.js +4 -0
- package/dist/{chunk-DRBRT57F.js.map → chunk-ZQ4XMJH7.js.map} +1 -1
- package/dist/constants.js +0 -1
- package/dist/constants.mjs +0 -1
- package/dist/entities/DopplerFactory.d.mts +58 -29
- package/dist/entities/DopplerFactory.d.ts +58 -29
- package/dist/entities/DopplerFactory.js +5 -6
- package/dist/entities/DopplerFactory.mjs +4 -5
- package/dist/entities/auction/DynamicAuction.d.mts +5 -3
- package/dist/entities/auction/DynamicAuction.d.ts +5 -3
- package/dist/entities/auction/DynamicAuction.js +5 -6
- package/dist/entities/auction/DynamicAuction.mjs +4 -5
- package/dist/entities/auction/StaticAuction.d.mts +5 -3
- package/dist/entities/auction/StaticAuction.d.ts +5 -3
- package/dist/entities/auction/StaticAuction.js +5 -6
- package/dist/entities/auction/StaticAuction.mjs +4 -5
- package/dist/entities/auction/index.d.mts +2 -0
- package/dist/entities/auction/index.d.ts +2 -0
- package/dist/entities/auction/index.js +9 -10
- package/dist/entities/auction/index.mjs +5 -6
- package/dist/entities/quoter/Quoter.d.mts +43 -2
- package/dist/entities/quoter/Quoter.d.ts +43 -2
- package/dist/entities/quoter/Quoter.js +5 -6
- package/dist/entities/quoter/Quoter.mjs +4 -5
- package/dist/entities/quoter/index.d.mts +3 -0
- package/dist/entities/quoter/index.d.ts +3 -0
- package/dist/entities/quoter/index.js +5 -6
- package/dist/entities/quoter/index.mjs +4 -5
- package/dist/entities/token/derc20/Derc20.d.mts +11 -4
- package/dist/entities/token/derc20/Derc20.d.ts +11 -4
- package/dist/entities/token/derc20/Derc20.js +4 -5
- package/dist/entities/token/derc20/Derc20.mjs +3 -4
- package/dist/entities/token/derc20/index.d.mts +3 -0
- package/dist/entities/token/derc20/index.d.ts +3 -0
- package/dist/entities/token/derc20/index.js +4 -5
- package/dist/entities/token/derc20/index.mjs +3 -4
- package/dist/entities/token/eth/Eth.d.mts +6 -3
- package/dist/entities/token/eth/Eth.d.ts +6 -3
- package/dist/entities/token/eth/Eth.js +2 -3
- package/dist/entities/token/eth/Eth.mjs +1 -2
- package/dist/entities/token/eth/index.d.mts +3 -0
- package/dist/entities/token/eth/index.d.ts +3 -0
- package/dist/entities/token/eth/index.js +2 -3
- package/dist/entities/token/eth/index.mjs +1 -2
- package/dist/entities/token/index.d.mts +3 -0
- package/dist/entities/token/index.d.ts +3 -0
- package/dist/entities/token/index.js +6 -7
- package/dist/entities/token/index.mjs +4 -5
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +74 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -15
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +67 -15
- package/dist/types.d.ts +67 -15
- package/dist/types.js +3 -3
- package/dist/types.mjs +2 -2
- package/dist/utils/airlock.d.mts +8 -0
- package/dist/utils/airlock.d.ts +8 -0
- package/dist/utils/airlock.js +13 -0
- package/dist/utils/airlock.js.map +1 -0
- package/dist/utils/airlock.mjs +4 -0
- package/dist/utils/airlock.mjs.map +1 -0
- package/dist/utils/index.d.mts +5 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +7 -2
- package/dist/utils/index.mjs +3 -2
- package/dist/utils/priceHelpers.js +0 -1
- package/dist/utils/priceHelpers.mjs +0 -1
- package/dist/utils/tickMath.js +0 -1
- package/dist/utils/tickMath.mjs +0 -1
- package/package.json +8 -10
- package/dist/__tests__/mocks/addresses.d.mts +0 -46
- package/dist/__tests__/mocks/addresses.d.ts +0 -46
- package/dist/__tests__/mocks/addresses.js +0 -53
- package/dist/__tests__/mocks/addresses.js.map +0 -1
- package/dist/__tests__/mocks/addresses.mjs +0 -44
- package/dist/__tests__/mocks/addresses.mjs.map +0 -1
- package/dist/__tests__/mocks/clients.d.mts +0 -22
- package/dist/__tests__/mocks/clients.d.ts +0 -22
- package/dist/__tests__/mocks/clients.js +0 -17088
- package/dist/__tests__/mocks/clients.js.map +0 -1
- package/dist/__tests__/mocks/clients.mjs +0 -17084
- package/dist/__tests__/mocks/clients.mjs.map +0 -1
- package/dist/chunk-2LPOXGKT.mjs.map +0 -1
- package/dist/chunk-5B7IYSVK.js.map +0 -1
- package/dist/chunk-6H6BP7GZ.mjs.map +0 -1
- package/dist/chunk-6REZA4TU.mjs.map +0 -1
- package/dist/chunk-BYK425DD.mjs.map +0 -1
- package/dist/chunk-BYR4WWCZ.mjs.map +0 -1
- package/dist/chunk-CYDWEPFL.mjs +0 -3
- package/dist/chunk-DLL6MEJA.js.map +0 -1
- package/dist/chunk-DRBRT57F.js +0 -4
- package/dist/chunk-IGLVXIHA.js.map +0 -1
- package/dist/chunk-IPW2I4JJ.mjs.map +0 -1
- package/dist/chunk-IX32KFK3.js.map +0 -1
- package/dist/chunk-JHKPKTCV.js.map +0 -1
- package/dist/chunk-K7BWQVAX.js.map +0 -1
- package/dist/chunk-KEXKKQVW.js +0 -42
- package/dist/chunk-KEXKKQVW.js.map +0 -1
- package/dist/chunk-L4TKYN6R.mjs.map +0 -1
- package/dist/chunk-LOROXNH3.mjs +0 -37
- package/dist/chunk-LOROXNH3.mjs.map +0 -1
- package/dist/chunk-NDWBEGEN.mjs.map +0 -1
- package/dist/chunk-O55NMSZK.mjs.map +0 -1
- package/dist/chunk-OMN7RXR4.js.map +0 -1
- package/dist/chunk-OPKQMN46.mjs.map +0 -1
- package/dist/chunk-R3YCKIM4.js.map +0 -1
- package/dist/chunk-SIVXK7WY.js +0 -162
- package/dist/chunk-SIVXK7WY.js.map +0 -1
- package/dist/chunk-TOMVBPNZ.js.map +0 -1
- package/dist/chunk-XJGF77WN.mjs.map +0 -1
- package/dist/chunk-YPNUUFAD.js.map +0 -1
- package/dist/magic-string.es-NMLAOY5A.js +0 -1298
- package/dist/magic-string.es-NMLAOY5A.js.map +0 -1
- package/dist/magic-string.es-QCVTE6QG.mjs +0 -1292
- 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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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,
|
|
104
|
+
lockDuration: 365 * 24 * 60 * 60,
|
|
143
105
|
beneficiaries: [
|
|
144
|
-
{ address: '0x...', percentage: 5000 },
|
|
145
|
-
{ address: '0x...', percentage: 5000 },
|
|
106
|
+
{ address: '0x...', percentage: 5000 },
|
|
107
|
+
{ address: '0x...', percentage: 5000 },
|
|
146
108
|
],
|
|
147
109
|
},
|
|
148
|
-
}
|
|
149
|
-
|
|
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
|
-
|
|
153
|
-
|
|
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
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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.
|
package/dist/DopplerSDK.d.mts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { Address,
|
|
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
|
-
|
|
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():
|
|
57
|
+
getChainId(): C;
|
|
47
58
|
/**
|
|
48
59
|
* Get the underlying clients
|
|
49
60
|
*/
|
|
50
61
|
getClients(): {
|
|
51
|
-
publicClient:
|
|
62
|
+
publicClient: SupportedPublicClient;
|
|
52
63
|
walletClient?: WalletClient;
|
|
53
64
|
};
|
|
54
65
|
}
|
package/dist/DopplerSDK.d.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { Address,
|
|
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
|
-
|
|
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():
|
|
57
|
+
getChainId(): C;
|
|
47
58
|
/**
|
|
48
59
|
* Get the underlying clients
|
|
49
60
|
*/
|
|
50
61
|
getClients(): {
|
|
51
|
-
publicClient:
|
|
62
|
+
publicClient: SupportedPublicClient;
|
|
52
63
|
walletClient?: WalletClient;
|
|
53
64
|
};
|
|
54
65
|
}
|
package/dist/DopplerSDK.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
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-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
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-
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
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
|
|
20
|
+
get: function () { return chunk4ES2NJPN_js.DopplerSDK; }
|
|
21
21
|
});
|
|
22
22
|
//# sourceMappingURL=DopplerSDK.js.map
|
|
23
23
|
//# sourceMappingURL=DopplerSDK.js.map
|
package/dist/DopplerSDK.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { DopplerSDK } from './chunk-
|
|
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-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
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-
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
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
|