@whetstone-research/doppler-sdk 0.0.1-alpha.3 → 0.0.1-alpha.4
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 +102 -122
- package/dist/DopplerSDK.js +4 -4
- package/dist/DopplerSDK.mjs +3 -3
- package/dist/builders.d.mts +113 -0
- package/dist/builders.d.ts +113 -0
- package/dist/builders.js +18 -0
- package/dist/builders.js.map +1 -0
- package/dist/builders.mjs +5 -0
- package/dist/builders.mjs.map +1 -0
- package/dist/{chunk-PJUMZDYX.js → chunk-CEBZTG4L.js} +4 -4
- package/dist/{chunk-PJUMZDYX.js.map → chunk-CEBZTG4L.js.map} +1 -1
- package/dist/{chunk-EXGRVQZO.mjs → chunk-IZH2Z3KC.mjs} +7 -172
- package/dist/chunk-IZH2Z3KC.mjs.map +1 -0
- package/dist/{chunk-IMFXY3NB.js → chunk-K7ZUQXWH.js} +6 -171
- package/dist/chunk-K7ZUQXWH.js.map +1 -0
- package/dist/chunk-NURZN25J.js +266 -0
- package/dist/chunk-NURZN25J.js.map +1 -0
- package/dist/{chunk-Q2ZI4TU5.mjs → chunk-THNQAO5Y.mjs} +3 -3
- package/dist/{chunk-Q2ZI4TU5.mjs.map → chunk-THNQAO5Y.mjs.map} +1 -1
- package/dist/chunk-TMXOB6MR.mjs +263 -0
- package/dist/chunk-TMXOB6MR.mjs.map +1 -0
- package/dist/entities/DopplerFactory.d.mts +1 -26
- package/dist/entities/DopplerFactory.d.ts +1 -26
- package/dist/entities/DopplerFactory.js +2 -2
- package/dist/entities/DopplerFactory.mjs +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +97 -88
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-EXGRVQZO.mjs.map +0 -1
- package/dist/chunk-IMFXY3NB.js.map +0 -1
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,76 @@ 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
|
+
.withUserAddress('0x...')
|
|
112
|
+
.build()
|
|
113
|
+
|
|
114
|
+
const result = await sdk.factory.createDynamicAuction(params)
|
|
115
|
+
console.log('Hook address:', result.hookAddress)
|
|
116
|
+
console.log('Token address:', result.tokenAddress)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Builder Pattern (Recommended)
|
|
120
|
+
|
|
121
|
+
Prefer using the builders to construct `CreateStaticAuctionParams` and `CreateDynamicAuctionParams` fluently and safely. Builders apply sensible defaults and can compute ticks and gamma for you.
|
|
151
122
|
|
|
152
|
-
|
|
153
|
-
|
|
123
|
+
```typescript
|
|
124
|
+
import { StaticAuctionBuilder, DynamicAuctionBuilder } from '@whetstone-research/doppler-sdk'
|
|
125
|
+
import { parseEther } from 'viem'
|
|
126
|
+
|
|
127
|
+
// Dynamic auction via builder
|
|
128
|
+
const dynamicParams = new DynamicAuctionBuilder()
|
|
129
|
+
.tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
|
|
130
|
+
.saleConfig({ initialSupply: parseEther('1000000'), numTokensToSell: parseEther('500000'), numeraire: wethAddress })
|
|
131
|
+
.poolConfig({ fee: 3000, tickSpacing: 60 })
|
|
132
|
+
.auctionByPriceRange({
|
|
133
|
+
priceRange: { startPrice: 0.0001, endPrice: 0.001 },
|
|
134
|
+
minProceeds: parseEther('100'),
|
|
135
|
+
maxProceeds: parseEther('1000'),
|
|
136
|
+
})
|
|
137
|
+
.withMigration({ type: 'uniswapV2' })
|
|
138
|
+
.withUserAddress('0x...')
|
|
139
|
+
.build()
|
|
140
|
+
|
|
141
|
+
const dyn = await sdk.factory.createDynamicAuction(dynamicParams)
|
|
142
|
+
|
|
143
|
+
// Static auction via builder
|
|
144
|
+
const staticParams = new StaticAuctionBuilder()
|
|
145
|
+
.tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
|
|
146
|
+
.saleConfig({ initialSupply: parseEther('1000000000'), numTokensToSell: parseEther('900000000'), numeraire: wethAddress })
|
|
147
|
+
.poolByPriceRange({ priceRange: { startPrice: 0.0001, endPrice: 0.001 }, fee: 3000 })
|
|
148
|
+
.withMigration({ type: 'uniswapV2' })
|
|
149
|
+
.withUserAddress('0x...')
|
|
150
|
+
.build()
|
|
151
|
+
|
|
152
|
+
const stat = await sdk.factory.createStaticAuction(staticParams)
|
|
154
153
|
```
|
|
155
154
|
|
|
156
155
|
### Simplified Creation with Defaults
|
|
@@ -158,52 +157,33 @@ console.log('Token address:', result.tokenAddress);
|
|
|
158
157
|
The SDK intelligently applies defaults when parameters are omitted. Here are examples with minimal configuration:
|
|
159
158
|
|
|
160
159
|
```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
|
|
160
|
+
// Minimal static auction via builder
|
|
161
|
+
const staticMinimal = new StaticAuctionBuilder()
|
|
162
|
+
.tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
|
|
163
|
+
.saleConfig({ initialSupply: parseEther('1000000000'), numTokensToSell: parseEther('900000000'), numeraire: '0x...' })
|
|
164
|
+
.poolByTicks({ fee: 10000 }) // uses default tick range and numPositions
|
|
165
|
+
.withMigration({ type: 'uniswapV2' })
|
|
166
|
+
.withUserAddress('0x...')
|
|
167
|
+
.build()
|
|
168
|
+
|
|
169
|
+
const staticResult = await sdk.factory.createStaticAuction(staticMinimal)
|
|
170
|
+
|
|
171
|
+
// Minimal dynamic auction via builder
|
|
172
|
+
const dynamicMinimal = new DynamicAuctionBuilder()
|
|
173
|
+
.tokenConfig({ name: 'My Token', symbol: 'MTK', tokenURI: 'https://example.com/metadata.json' })
|
|
174
|
+
.saleConfig({ initialSupply: parseEther('1000000'), numTokensToSell: parseEther('900000'), numeraire: '0x...' })
|
|
175
|
+
.poolConfig({ fee: 3000, tickSpacing: 60 })
|
|
176
|
+
.auctionByTicks({
|
|
177
|
+
startTick: -92103,
|
|
178
|
+
endTick: -69080,
|
|
192
179
|
minProceeds: parseEther('100'),
|
|
193
180
|
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
|
-
});
|
|
181
|
+
}) // duration/epoch defaults applied; gamma computed automatically
|
|
182
|
+
.withMigration({ type: 'uniswapV4' })
|
|
183
|
+
.withUserAddress('0x...')
|
|
184
|
+
.build()
|
|
185
|
+
|
|
186
|
+
const dynamicResult = await sdk.factory.createDynamicAuction(dynamicMinimal)
|
|
207
187
|
```
|
|
208
188
|
|
|
209
189
|
## Interacting with Auctions
|
|
@@ -429,4 +409,4 @@ Contributions are welcome! Please see our [Contributing Guide](../../CONTRIBUTIN
|
|
|
429
409
|
|
|
430
410
|
## License
|
|
431
411
|
|
|
432
|
-
MIT License - see [LICENSE](../../LICENSE) for details.
|
|
412
|
+
MIT License - see [LICENSE](../../LICENSE) for details.
|
package/dist/DopplerSDK.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCEBZTG4L_js = require('./chunk-CEBZTG4L.js');
|
|
4
|
+
require('./chunk-KRN3ROUE.js');
|
|
4
5
|
require('./chunk-P7CHGWY7.js');
|
|
5
6
|
require('./chunk-EMXBYWZR.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-KRN3ROUE.js');
|
|
7
|
+
require('./chunk-K7ZUQXWH.js');
|
|
8
8
|
require('./chunk-376RZEND.js');
|
|
9
9
|
require('./chunk-G4X44AWK.js');
|
|
10
10
|
require('./chunk-UYYQHQRJ.js');
|
|
@@ -17,7 +17,7 @@ require('./chunk-KEXKKQVW.js');
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "DopplerSDK", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkCEBZTG4L_js.DopplerSDK; }
|
|
21
21
|
});
|
|
22
22
|
//# sourceMappingURL=DopplerSDK.js.map
|
|
23
23
|
//# sourceMappingURL=DopplerSDK.js.map
|
package/dist/DopplerSDK.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { DopplerSDK } from './chunk-
|
|
1
|
+
export { DopplerSDK } from './chunk-THNQAO5Y.mjs';
|
|
2
|
+
import './chunk-AZLFJNTG.mjs';
|
|
2
3
|
import './chunk-QSQGLWNY.mjs';
|
|
3
4
|
import './chunk-65NYPZFH.mjs';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-AZLFJNTG.mjs';
|
|
5
|
+
import './chunk-IZH2Z3KC.mjs';
|
|
6
6
|
import './chunk-JSJSYBHG.mjs';
|
|
7
7
|
import './chunk-677KDMY7.mjs';
|
|
8
8
|
import './chunk-DEFXRGPD.mjs';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { PriceRange, GovernanceConfig, MigrationConfig, CreateStaticAuctionParams, CreateDynamicAuctionParams } from './types.mjs';
|
|
3
|
+
|
|
4
|
+
declare class StaticAuctionBuilder {
|
|
5
|
+
private token?;
|
|
6
|
+
private sale?;
|
|
7
|
+
private pool?;
|
|
8
|
+
private vesting?;
|
|
9
|
+
private governance?;
|
|
10
|
+
private migration?;
|
|
11
|
+
private integrator?;
|
|
12
|
+
private userAddress?;
|
|
13
|
+
tokenConfig(params: {
|
|
14
|
+
name: string;
|
|
15
|
+
symbol: string;
|
|
16
|
+
tokenURI: string;
|
|
17
|
+
yearlyMintRate?: bigint;
|
|
18
|
+
}): this;
|
|
19
|
+
saleConfig(params: {
|
|
20
|
+
initialSupply: bigint;
|
|
21
|
+
numTokensToSell: bigint;
|
|
22
|
+
numeraire: Address;
|
|
23
|
+
}): this;
|
|
24
|
+
poolByTicks(params: {
|
|
25
|
+
startTick?: number;
|
|
26
|
+
endTick?: number;
|
|
27
|
+
fee?: number;
|
|
28
|
+
numPositions?: number;
|
|
29
|
+
maxShareToBeSold?: bigint;
|
|
30
|
+
}): this;
|
|
31
|
+
poolByPriceRange(params: {
|
|
32
|
+
priceRange: PriceRange;
|
|
33
|
+
fee?: number;
|
|
34
|
+
numPositions?: number;
|
|
35
|
+
maxShareToBeSold?: bigint;
|
|
36
|
+
}): this;
|
|
37
|
+
withVesting(params?: {
|
|
38
|
+
duration?: bigint;
|
|
39
|
+
cliffDuration?: number;
|
|
40
|
+
}): this;
|
|
41
|
+
withGovernance(params?: GovernanceConfig | {
|
|
42
|
+
useDefaults?: boolean;
|
|
43
|
+
}): this;
|
|
44
|
+
withMigration(migration: MigrationConfig): this;
|
|
45
|
+
withUserAddress(address: Address): this;
|
|
46
|
+
withIntegrator(address?: Address): this;
|
|
47
|
+
build(): CreateStaticAuctionParams;
|
|
48
|
+
}
|
|
49
|
+
declare class DynamicAuctionBuilder {
|
|
50
|
+
private token?;
|
|
51
|
+
private sale?;
|
|
52
|
+
private auction?;
|
|
53
|
+
private pool?;
|
|
54
|
+
private vesting?;
|
|
55
|
+
private governance?;
|
|
56
|
+
private migration?;
|
|
57
|
+
private integrator?;
|
|
58
|
+
private userAddress?;
|
|
59
|
+
private startTimeOffset?;
|
|
60
|
+
private blockTimestamp?;
|
|
61
|
+
tokenConfig(params: {
|
|
62
|
+
name: string;
|
|
63
|
+
symbol: string;
|
|
64
|
+
tokenURI: string;
|
|
65
|
+
yearlyMintRate?: bigint;
|
|
66
|
+
}): this;
|
|
67
|
+
saleConfig(params: {
|
|
68
|
+
initialSupply: bigint;
|
|
69
|
+
numTokensToSell: bigint;
|
|
70
|
+
numeraire?: Address;
|
|
71
|
+
}): this;
|
|
72
|
+
poolConfig(params: {
|
|
73
|
+
fee: number;
|
|
74
|
+
tickSpacing: number;
|
|
75
|
+
}): this;
|
|
76
|
+
auctionByTicks(params: {
|
|
77
|
+
startTick: number;
|
|
78
|
+
endTick: number;
|
|
79
|
+
minProceeds: bigint;
|
|
80
|
+
maxProceeds: bigint;
|
|
81
|
+
durationDays?: number;
|
|
82
|
+
epochLength?: number;
|
|
83
|
+
gamma?: number;
|
|
84
|
+
numPdSlugs?: number;
|
|
85
|
+
}): this;
|
|
86
|
+
auctionByPriceRange(params: {
|
|
87
|
+
priceRange: PriceRange;
|
|
88
|
+
minProceeds: bigint;
|
|
89
|
+
maxProceeds: bigint;
|
|
90
|
+
durationDays?: number;
|
|
91
|
+
epochLength?: number;
|
|
92
|
+
gamma?: number;
|
|
93
|
+
tickSpacing?: number;
|
|
94
|
+
numPdSlugs?: number;
|
|
95
|
+
}): this;
|
|
96
|
+
withVesting(params?: {
|
|
97
|
+
duration?: bigint;
|
|
98
|
+
cliffDuration?: number;
|
|
99
|
+
}): this;
|
|
100
|
+
withGovernance(params?: GovernanceConfig | {
|
|
101
|
+
useDefaults?: boolean;
|
|
102
|
+
}): this;
|
|
103
|
+
withMigration(migration: MigrationConfig): this;
|
|
104
|
+
withUserAddress(address: Address): this;
|
|
105
|
+
withIntegrator(address?: Address): this;
|
|
106
|
+
withTime(params?: {
|
|
107
|
+
startTimeOffset?: number;
|
|
108
|
+
blockTimestamp?: number;
|
|
109
|
+
}): this;
|
|
110
|
+
build(): CreateDynamicAuctionParams;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { DynamicAuctionBuilder, StaticAuctionBuilder };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { PriceRange, GovernanceConfig, MigrationConfig, CreateStaticAuctionParams, CreateDynamicAuctionParams } from './types.js';
|
|
3
|
+
|
|
4
|
+
declare class StaticAuctionBuilder {
|
|
5
|
+
private token?;
|
|
6
|
+
private sale?;
|
|
7
|
+
private pool?;
|
|
8
|
+
private vesting?;
|
|
9
|
+
private governance?;
|
|
10
|
+
private migration?;
|
|
11
|
+
private integrator?;
|
|
12
|
+
private userAddress?;
|
|
13
|
+
tokenConfig(params: {
|
|
14
|
+
name: string;
|
|
15
|
+
symbol: string;
|
|
16
|
+
tokenURI: string;
|
|
17
|
+
yearlyMintRate?: bigint;
|
|
18
|
+
}): this;
|
|
19
|
+
saleConfig(params: {
|
|
20
|
+
initialSupply: bigint;
|
|
21
|
+
numTokensToSell: bigint;
|
|
22
|
+
numeraire: Address;
|
|
23
|
+
}): this;
|
|
24
|
+
poolByTicks(params: {
|
|
25
|
+
startTick?: number;
|
|
26
|
+
endTick?: number;
|
|
27
|
+
fee?: number;
|
|
28
|
+
numPositions?: number;
|
|
29
|
+
maxShareToBeSold?: bigint;
|
|
30
|
+
}): this;
|
|
31
|
+
poolByPriceRange(params: {
|
|
32
|
+
priceRange: PriceRange;
|
|
33
|
+
fee?: number;
|
|
34
|
+
numPositions?: number;
|
|
35
|
+
maxShareToBeSold?: bigint;
|
|
36
|
+
}): this;
|
|
37
|
+
withVesting(params?: {
|
|
38
|
+
duration?: bigint;
|
|
39
|
+
cliffDuration?: number;
|
|
40
|
+
}): this;
|
|
41
|
+
withGovernance(params?: GovernanceConfig | {
|
|
42
|
+
useDefaults?: boolean;
|
|
43
|
+
}): this;
|
|
44
|
+
withMigration(migration: MigrationConfig): this;
|
|
45
|
+
withUserAddress(address: Address): this;
|
|
46
|
+
withIntegrator(address?: Address): this;
|
|
47
|
+
build(): CreateStaticAuctionParams;
|
|
48
|
+
}
|
|
49
|
+
declare class DynamicAuctionBuilder {
|
|
50
|
+
private token?;
|
|
51
|
+
private sale?;
|
|
52
|
+
private auction?;
|
|
53
|
+
private pool?;
|
|
54
|
+
private vesting?;
|
|
55
|
+
private governance?;
|
|
56
|
+
private migration?;
|
|
57
|
+
private integrator?;
|
|
58
|
+
private userAddress?;
|
|
59
|
+
private startTimeOffset?;
|
|
60
|
+
private blockTimestamp?;
|
|
61
|
+
tokenConfig(params: {
|
|
62
|
+
name: string;
|
|
63
|
+
symbol: string;
|
|
64
|
+
tokenURI: string;
|
|
65
|
+
yearlyMintRate?: bigint;
|
|
66
|
+
}): this;
|
|
67
|
+
saleConfig(params: {
|
|
68
|
+
initialSupply: bigint;
|
|
69
|
+
numTokensToSell: bigint;
|
|
70
|
+
numeraire?: Address;
|
|
71
|
+
}): this;
|
|
72
|
+
poolConfig(params: {
|
|
73
|
+
fee: number;
|
|
74
|
+
tickSpacing: number;
|
|
75
|
+
}): this;
|
|
76
|
+
auctionByTicks(params: {
|
|
77
|
+
startTick: number;
|
|
78
|
+
endTick: number;
|
|
79
|
+
minProceeds: bigint;
|
|
80
|
+
maxProceeds: bigint;
|
|
81
|
+
durationDays?: number;
|
|
82
|
+
epochLength?: number;
|
|
83
|
+
gamma?: number;
|
|
84
|
+
numPdSlugs?: number;
|
|
85
|
+
}): this;
|
|
86
|
+
auctionByPriceRange(params: {
|
|
87
|
+
priceRange: PriceRange;
|
|
88
|
+
minProceeds: bigint;
|
|
89
|
+
maxProceeds: bigint;
|
|
90
|
+
durationDays?: number;
|
|
91
|
+
epochLength?: number;
|
|
92
|
+
gamma?: number;
|
|
93
|
+
tickSpacing?: number;
|
|
94
|
+
numPdSlugs?: number;
|
|
95
|
+
}): this;
|
|
96
|
+
withVesting(params?: {
|
|
97
|
+
duration?: bigint;
|
|
98
|
+
cliffDuration?: number;
|
|
99
|
+
}): this;
|
|
100
|
+
withGovernance(params?: GovernanceConfig | {
|
|
101
|
+
useDefaults?: boolean;
|
|
102
|
+
}): this;
|
|
103
|
+
withMigration(migration: MigrationConfig): this;
|
|
104
|
+
withUserAddress(address: Address): this;
|
|
105
|
+
withIntegrator(address?: Address): this;
|
|
106
|
+
withTime(params?: {
|
|
107
|
+
startTimeOffset?: number;
|
|
108
|
+
blockTimestamp?: number;
|
|
109
|
+
}): this;
|
|
110
|
+
build(): CreateDynamicAuctionParams;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { DynamicAuctionBuilder, StaticAuctionBuilder };
|
package/dist/builders.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkNURZN25J_js = require('./chunk-NURZN25J.js');
|
|
4
|
+
require('./chunk-ER42VG7H.js');
|
|
5
|
+
require('./chunk-KEXKKQVW.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "DynamicAuctionBuilder", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkNURZN25J_js.DynamicAuctionBuilder; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "StaticAuctionBuilder", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkNURZN25J_js.StaticAuctionBuilder; }
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=builders.js.map
|
|
18
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"builders.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"builders.mjs"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkEMXBYWZR_js = require('./chunk-EMXBYWZR.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkK7ZUQXWH_js = require('./chunk-K7ZUQXWH.js');
|
|
5
5
|
var chunk376RZEND_js = require('./chunk-376RZEND.js');
|
|
6
6
|
var chunkG4X44AWK_js = require('./chunk-G4X44AWK.js');
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@ var DopplerSDK = class {
|
|
|
17
17
|
*/
|
|
18
18
|
get factory() {
|
|
19
19
|
if (!this._factory) {
|
|
20
|
-
this._factory = new
|
|
20
|
+
this._factory = new chunkK7ZUQXWH_js.DopplerFactory(this.publicClient, this.walletClient, this.chainId);
|
|
21
21
|
}
|
|
22
22
|
return this._factory;
|
|
23
23
|
}
|
|
@@ -78,5 +78,5 @@ var DopplerSDK = class {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
exports.DopplerSDK = DopplerSDK;
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-CEBZTG4L.js.map
|
|
82
|
+
//# sourceMappingURL=chunk-CEBZTG4L.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/DopplerSDK.ts"],"names":["DopplerFactory","Quoter","StaticAuction","DynamicAuction"],"mappings":";;;;;;;;AAMO,IAAM,aAAN,MAAiB;AAAA,EAOtB,YAAY,MAAA,EAA0B;AACpC,IAAA,IAAA,CAAK,eAAe,MAAA,CAAO,YAAA;AAC3B,IAAA,IAAA,CAAK,eAAe,MAAA,CAAO,YAAA;AAC3B,IAAA,IAAA,CAAK,UAAU,MAAA,CAAO,OAAA;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,OAAA,GAA0B;AAC5B,IAAA,IAAI,CAAC,KAAK,QAAA,EAAU;AAClB,MAAA,IAAA,CAAK,QAAA,GAAW,IAAIA,+BAAA,CAAe,IAAA,CAAK,cAAc,IAAA,CAAK,YAAA,EAAc,KAAK,OAAO,CAAA;AAAA,IACvF;AACA,IAAA,OAAO,IAAA,CAAK,QAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,MAAA,GAAiB;AACnB,IAAA,IAAI,CAAC,KAAK,OAAA,EAAS;AACjB,MAAA,IAAA,CAAK,UAAU,IAAIC,uBAAA,CAAO,IAAA,CAAK,YAAA,EAAc,KAAK,OAAO,CAAA;AAAA,IAC3D;AACA,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA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AAA;AAAA;AAAA,EAKA,UAAA,GAAqB;AACnB,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA,GAA0E;AACxE,IAAA,OAAO;AAAA,MACL,cAAc,IAAA,CAAK,YAAA;AAAA,MACnB,cAAc,IAAA,CAAK;AAAA,KACrB;AAAA,EACF;AACF","file":"chunk-CEBZTG4L.js","sourcesContent":["import type { Address, PublicClient, WalletClient } from 'viem'\nimport type { DopplerSDKConfig, HookInfo, PoolInfo } from './types'\nimport { DopplerFactory } from './entities/DopplerFactory'\nimport { StaticAuction, DynamicAuction } from './entities/auction'\nimport { Quoter } from './entities/quoter'\n\nexport class DopplerSDK {\n private publicClient: PublicClient\n private walletClient?: WalletClient\n private chainId: number\n private _factory?: DopplerFactory\n private _quoter?: Quoter\n\n constructor(config: DopplerSDKConfig) {\n this.publicClient = config.publicClient\n this.walletClient = config.walletClient\n this.chainId = config.chainId\n }\n\n /**\n * Get the factory instance for creating auctions\n */\n get factory(): DopplerFactory {\n if (!this._factory) {\n this._factory = new DopplerFactory(this.publicClient, this.walletClient, this.chainId)\n }\n return this._factory\n }\n\n /**\n * Get the quoter instance for price queries\n */\n get quoter(): Quoter {\n if (!this._quoter) {\n this._quoter = new Quoter(this.publicClient, this.chainId)\n }\n return this._quoter\n }\n\n /**\n * Get a StaticAuction instance for interacting with a static auction pool\n * @param poolAddress The address of the Uniswap V3 pool\n */\n async getStaticAuction(poolAddress: Address): Promise<StaticAuction> {\n return new StaticAuction(this.publicClient, poolAddress)\n }\n\n /**\n * Get a DynamicAuction instance for interacting with a dynamic auction hook\n * @param hookAddress The address of the Uniswap V4 hook\n */\n async getDynamicAuction(hookAddress: Address): Promise<DynamicAuction> {\n return new DynamicAuction(this.publicClient, hookAddress)\n }\n\n /**\n * Get information about a static auction pool\n * @param poolAddress The address of the pool\n */\n async getPoolInfo(poolAddress: Address): Promise<PoolInfo> {\n const auction = new StaticAuction(this.publicClient, poolAddress)\n return auction.getPoolInfo()\n }\n\n /**\n * Get information about a dynamic auction hook\n * @param hookAddress The address of the hook\n */\n async getHookInfo(hookAddress: Address): Promise<HookInfo> {\n const auction = new DynamicAuction(this.publicClient, hookAddress)\n return auction.getHookInfo()\n }\n\n /**\n * Get the current chain ID\n */\n getChainId(): number {\n return this.chainId\n }\n\n /**\n * Get the underlying clients\n */\n getClients(): { publicClient: PublicClient; walletClient?: WalletClient } {\n return {\n publicClient: this.publicClient,\n walletClient: this.walletClient\n }\n }\n}"]}
|