@liberfi.io/react-launchpad 0.1.1
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 +12 -0
- package/dist/index.d.mts +529 -0
- package/dist/index.d.ts +529 -0
- package/dist/index.js +797 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +779 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# @liberfi.io/react-launchpad
|
|
2
|
+
|
|
3
|
+
Launchpad domain runtime and React bindings.
|
|
4
|
+
|
|
5
|
+
This package is wallet-agnostic. ChainStream, Pinata, Privy, Next, and
|
|
6
|
+
browser routes stay in the application Adapter.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm add @liberfi.io/react-launchpad
|
|
12
|
+
```
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import BigNumber$1 from 'bignumber.js';
|
|
4
|
+
import { Chain } from '@liberfi.io/types';
|
|
5
|
+
|
|
6
|
+
declare enum LaunchPadPlatform {
|
|
7
|
+
PUMPFUN = "pumpfun",
|
|
8
|
+
RAYDIUM = "raydium"
|
|
9
|
+
}
|
|
10
|
+
declare enum CurveType {
|
|
11
|
+
CONSTANT_PRODUCT = "constant_product",
|
|
12
|
+
FIXED_PRICE = "fixed_price",
|
|
13
|
+
LINEAR_PRICE = "linear_price"
|
|
14
|
+
}
|
|
15
|
+
interface LaunchpadVestingSchedule {
|
|
16
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
17
|
+
totalAllocatedShare: BigNumber$1.Value;
|
|
18
|
+
cliffPeriod: number;
|
|
19
|
+
unlockPeriod: number;
|
|
20
|
+
startTime: number;
|
|
21
|
+
}
|
|
22
|
+
interface LaunchPadPoolInfo {
|
|
23
|
+
platform: LaunchPadPlatform;
|
|
24
|
+
creator: string;
|
|
25
|
+
mintA: string;
|
|
26
|
+
mintB: string;
|
|
27
|
+
mintDecimalsA: number;
|
|
28
|
+
mintDecimalsB: number;
|
|
29
|
+
vaultA: string;
|
|
30
|
+
vaultB: string;
|
|
31
|
+
supply: BigNumber$1.Value;
|
|
32
|
+
totalSellA: BigNumber$1.Value;
|
|
33
|
+
totalFundRaisingB: BigNumber$1.Value;
|
|
34
|
+
virtualA: BigNumber$1.Value;
|
|
35
|
+
virtualB: BigNumber$1.Value;
|
|
36
|
+
realA: BigNumber$1.Value;
|
|
37
|
+
realB: BigNumber$1.Value;
|
|
38
|
+
protocolFee: BigNumber$1.Value;
|
|
39
|
+
platformFee: BigNumber$1.Value;
|
|
40
|
+
migrateFee: BigNumber$1.Value;
|
|
41
|
+
vestingSchedule: LaunchpadVestingSchedule;
|
|
42
|
+
}
|
|
43
|
+
interface PoolBaseAmount {
|
|
44
|
+
virtualA: BigNumber$1.Value;
|
|
45
|
+
virtualB: BigNumber$1.Value;
|
|
46
|
+
realA: BigNumber$1.Value;
|
|
47
|
+
realB: BigNumber$1.Value;
|
|
48
|
+
}
|
|
49
|
+
interface PoolCurvePoint {
|
|
50
|
+
price: BigNumber$1.Value;
|
|
51
|
+
totalSellSupply: BigNumber$1.Value;
|
|
52
|
+
}
|
|
53
|
+
interface LaunchPadConfigInfo {
|
|
54
|
+
decimals: number;
|
|
55
|
+
minSupplyA: number;
|
|
56
|
+
minSellRateA: number;
|
|
57
|
+
minFundRaisingB: number;
|
|
58
|
+
minMigrateRateA: number;
|
|
59
|
+
maxLockRate: number;
|
|
60
|
+
}
|
|
61
|
+
interface CreateTokenIntent {
|
|
62
|
+
chain: Chain;
|
|
63
|
+
name: string;
|
|
64
|
+
symbol: string;
|
|
65
|
+
platform: LaunchPadPlatform;
|
|
66
|
+
imageUri?: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
website?: string;
|
|
69
|
+
twitter?: string;
|
|
70
|
+
telegram?: string;
|
|
71
|
+
metadataUri?: string;
|
|
72
|
+
}
|
|
73
|
+
type LaunchpadCreateStatus = "idle" | "validating" | "uploading" | "signing" | "submitting" | "succeeded" | "failed" | "rejected";
|
|
74
|
+
|
|
75
|
+
declare class BaseCurve {
|
|
76
|
+
static getPoolInitPriceByPool(args: {
|
|
77
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
78
|
+
decimalA: number;
|
|
79
|
+
decimalB: number;
|
|
80
|
+
}): BigNumber$1.Value;
|
|
81
|
+
static getPoolInitPriceByInit(args: {
|
|
82
|
+
a: BigNumber$1.Value;
|
|
83
|
+
b: BigNumber$1.Value;
|
|
84
|
+
decimalA: number;
|
|
85
|
+
decimalB: number;
|
|
86
|
+
}): BigNumber$1.Value;
|
|
87
|
+
static getPoolPrice(args: {
|
|
88
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
89
|
+
decimalA: number;
|
|
90
|
+
decimalB: number;
|
|
91
|
+
}): BigNumber$1.Value;
|
|
92
|
+
static getPoolEndPrice(args: {
|
|
93
|
+
supply: BigNumber$1.Value;
|
|
94
|
+
totalSell: BigNumber$1.Value;
|
|
95
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
96
|
+
totalFundRaising: BigNumber$1.Value;
|
|
97
|
+
migrateFee: BigNumber$1.Value;
|
|
98
|
+
decimalA: number;
|
|
99
|
+
decimalB: number;
|
|
100
|
+
}): BigNumber$1.Value;
|
|
101
|
+
static getPoolEndPriceReal(args: {
|
|
102
|
+
poolInfo: LaunchPadPoolInfo;
|
|
103
|
+
decimalA: number;
|
|
104
|
+
decimalB: number;
|
|
105
|
+
}): BigNumber$1.Value;
|
|
106
|
+
static getInitParam(args: {
|
|
107
|
+
supply: BigNumber$1.Value;
|
|
108
|
+
totalSell: BigNumber$1.Value;
|
|
109
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
110
|
+
totalFundRaising: BigNumber$1.Value;
|
|
111
|
+
migrateFee: BigNumber$1.Value;
|
|
112
|
+
}): {
|
|
113
|
+
a: BigNumber$1.Value;
|
|
114
|
+
b: BigNumber$1.Value;
|
|
115
|
+
c: BigNumber$1.Value;
|
|
116
|
+
};
|
|
117
|
+
static buyExactIn(args: {
|
|
118
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
119
|
+
amount: BigNumber$1.Value;
|
|
120
|
+
}): BigNumber$1.Value;
|
|
121
|
+
static buyExactOut(args: {
|
|
122
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
123
|
+
amount: BigNumber$1.Value;
|
|
124
|
+
}): BigNumber$1.Value;
|
|
125
|
+
static sellExactIn(args: {
|
|
126
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
127
|
+
amount: BigNumber$1.Value;
|
|
128
|
+
}): BigNumber$1.Value;
|
|
129
|
+
static sellExactOut(args: {
|
|
130
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
131
|
+
amount: BigNumber$1.Value;
|
|
132
|
+
}): BigNumber$1.Value;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
declare class ConstantProductCurve extends BaseCurve {
|
|
136
|
+
static getPoolInitPriceByPool({ poolInfo, decimalA, decimalB, }: {
|
|
137
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
138
|
+
decimalA: number;
|
|
139
|
+
decimalB: number;
|
|
140
|
+
}): BigNumber.Value;
|
|
141
|
+
static getPoolInitPriceByInit({ a, b, decimalA, decimalB, }: {
|
|
142
|
+
a: BigNumber.Value;
|
|
143
|
+
b: BigNumber.Value;
|
|
144
|
+
decimalA: number;
|
|
145
|
+
decimalB: number;
|
|
146
|
+
}): BigNumber.Value;
|
|
147
|
+
static getPoolPrice({ poolInfo, decimalA, decimalB, }: {
|
|
148
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
149
|
+
decimalA: number;
|
|
150
|
+
decimalB: number;
|
|
151
|
+
}): BigNumber.Value;
|
|
152
|
+
static getPoolEndPrice({ supply, totalSell, totalLockedAmount, totalFundRaising, migrateFee, decimalA, decimalB, }: {
|
|
153
|
+
supply: BigNumber.Value;
|
|
154
|
+
totalSell: BigNumber.Value;
|
|
155
|
+
totalLockedAmount: BigNumber.Value;
|
|
156
|
+
totalFundRaising: BigNumber.Value;
|
|
157
|
+
migrateFee: BigNumber.Value;
|
|
158
|
+
decimalA: number;
|
|
159
|
+
decimalB: number;
|
|
160
|
+
}): BigNumber.Value;
|
|
161
|
+
static getPoolEndPriceReal({ poolInfo, decimalA, decimalB, }: {
|
|
162
|
+
poolInfo: LaunchPadPoolInfo;
|
|
163
|
+
decimalA: number;
|
|
164
|
+
decimalB: number;
|
|
165
|
+
}): BigNumber.Value;
|
|
166
|
+
static getInitParam({ supply, totalFundRaising, totalSell, totalLockedAmount, migrateFee, }: {
|
|
167
|
+
supply: BigNumber.Value;
|
|
168
|
+
totalSell: BigNumber.Value;
|
|
169
|
+
totalLockedAmount: BigNumber.Value;
|
|
170
|
+
totalFundRaising: BigNumber.Value;
|
|
171
|
+
migrateFee: BigNumber.Value;
|
|
172
|
+
}): {
|
|
173
|
+
a: BigNumber.Value;
|
|
174
|
+
b: BigNumber.Value;
|
|
175
|
+
c: BigNumber.Value;
|
|
176
|
+
};
|
|
177
|
+
static buyExactIn({ poolInfo, amount, }: {
|
|
178
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
179
|
+
amount: BigNumber.Value;
|
|
180
|
+
}): BigNumber.Value;
|
|
181
|
+
static buyExactOut({ poolInfo, amount, }: {
|
|
182
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
183
|
+
amount: BigNumber.Value;
|
|
184
|
+
}): BigNumber.Value;
|
|
185
|
+
static sellExactIn({ poolInfo, amount, }: {
|
|
186
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
187
|
+
amount: BigNumber.Value;
|
|
188
|
+
}): BigNumber.Value;
|
|
189
|
+
static sellExactOut({ poolInfo, amount, }: {
|
|
190
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
191
|
+
amount: BigNumber.Value;
|
|
192
|
+
}): BigNumber.Value;
|
|
193
|
+
static getAmountOut({ amountIn, inputReserve, outputReserve, }: {
|
|
194
|
+
amountIn: BigNumber.Value;
|
|
195
|
+
inputReserve: BigNumber.Value;
|
|
196
|
+
outputReserve: BigNumber.Value;
|
|
197
|
+
}): BigNumber.Value;
|
|
198
|
+
static getAmountIn({ amountOut, inputReserve, outputReserve, }: {
|
|
199
|
+
amountOut: BigNumber.Value;
|
|
200
|
+
inputReserve: BigNumber.Value;
|
|
201
|
+
outputReserve: BigNumber.Value;
|
|
202
|
+
}): BigNumber.Value;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare class Curve {
|
|
206
|
+
static getCurvePreviewPoints({ curveType, pointCount, poolInfo, }: {
|
|
207
|
+
curveType: CurveType;
|
|
208
|
+
poolInfo: LaunchPadPoolInfo;
|
|
209
|
+
pointCount: number;
|
|
210
|
+
}): PoolCurvePoint[];
|
|
211
|
+
static getPoolCurvePointByInit({ curveType, pointCount, supply, totalFundRaising, totalSell, totalLockedAmount, migrateFee, decimalA, decimalB, }: {
|
|
212
|
+
curveType: CurveType;
|
|
213
|
+
supply: BigNumber$1.Value;
|
|
214
|
+
totalSell: BigNumber$1.Value;
|
|
215
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
216
|
+
totalFundRaising: BigNumber$1.Value;
|
|
217
|
+
migrateFee: BigNumber$1.Value;
|
|
218
|
+
decimalA: number;
|
|
219
|
+
decimalB: number;
|
|
220
|
+
pointCount: number;
|
|
221
|
+
}): PoolCurvePoint[];
|
|
222
|
+
static getPoolInitPriceByPool({ poolInfo, decimalA, decimalB, curveType, }: {
|
|
223
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
224
|
+
decimalA: number;
|
|
225
|
+
decimalB: number;
|
|
226
|
+
curveType: CurveType;
|
|
227
|
+
}): BigNumber$1.Value;
|
|
228
|
+
static getPoolInitPriceByInit({ a, b, decimalA, decimalB, curveType, }: {
|
|
229
|
+
a: BigNumber$1.Value;
|
|
230
|
+
b: BigNumber$1.Value;
|
|
231
|
+
decimalA: number;
|
|
232
|
+
decimalB: number;
|
|
233
|
+
curveType: CurveType;
|
|
234
|
+
}): BigNumber$1.Value;
|
|
235
|
+
static getPrice({ poolInfo, curveType, decimalA, decimalB, }: {
|
|
236
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
237
|
+
curveType: CurveType;
|
|
238
|
+
decimalA: number;
|
|
239
|
+
decimalB: number;
|
|
240
|
+
}): BigNumber$1.Value;
|
|
241
|
+
static getEndPrice({ poolInfo, curveType, decimalA, decimalB, }: {
|
|
242
|
+
poolInfo: LaunchPadPoolInfo;
|
|
243
|
+
curveType: CurveType;
|
|
244
|
+
decimalA: number;
|
|
245
|
+
decimalB: number;
|
|
246
|
+
}): BigNumber$1.Value;
|
|
247
|
+
static getPoolEndPriceReal({ poolInfo, curveType, decimalA, decimalB, }: {
|
|
248
|
+
poolInfo: LaunchPadPoolInfo;
|
|
249
|
+
curveType: CurveType;
|
|
250
|
+
decimalA: number;
|
|
251
|
+
decimalB: number;
|
|
252
|
+
}): BigNumber$1.Value;
|
|
253
|
+
static checkParam({ supply, totalFundRaising, totalSell, totalLockedAmount, decimalsA, decimalsB, config, migrateType, }: {
|
|
254
|
+
supply: BigNumber$1.Value;
|
|
255
|
+
totalSell: BigNumber$1.Value;
|
|
256
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
257
|
+
totalFundRaising: BigNumber$1.Value;
|
|
258
|
+
decimalsA: number;
|
|
259
|
+
decimalsB: number;
|
|
260
|
+
config: LaunchPadConfigInfo;
|
|
261
|
+
migrateType: "amm" | "cpmm";
|
|
262
|
+
}): void;
|
|
263
|
+
static buyExactIn({ poolInfo, amountB, protocolFeeRate, platformFeeRate, curveType, shareFeeRate, }: {
|
|
264
|
+
poolInfo: LaunchPadPoolInfo | (PoolBaseAmount & {
|
|
265
|
+
totalSellA: BigNumber$1.Value;
|
|
266
|
+
totalFundRaisingB: BigNumber$1.Value;
|
|
267
|
+
});
|
|
268
|
+
amountB: BigNumber$1.Value;
|
|
269
|
+
protocolFeeRate: BigNumber$1.Value;
|
|
270
|
+
platformFeeRate: BigNumber$1.Value;
|
|
271
|
+
curveType: CurveType;
|
|
272
|
+
shareFeeRate: BigNumber$1.Value;
|
|
273
|
+
}): {
|
|
274
|
+
amountA: BigNumber$1.Value;
|
|
275
|
+
amountB: BigNumber$1.Value;
|
|
276
|
+
splitFee: {
|
|
277
|
+
platformFee: BigNumber$1.Value;
|
|
278
|
+
shareFee: BigNumber$1.Value;
|
|
279
|
+
protocolFee: BigNumber$1.Value;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
static buyExactOut({ poolInfo, amountA, protocolFeeRate, platformFeeRate, curveType, shareFeeRate, }: {
|
|
283
|
+
poolInfo: LaunchPadPoolInfo | (PoolBaseAmount & {
|
|
284
|
+
totalSellA: BigNumber$1.Value;
|
|
285
|
+
totalFundRaisingB: BigNumber$1.Value;
|
|
286
|
+
});
|
|
287
|
+
amountA: BigNumber$1.Value;
|
|
288
|
+
protocolFeeRate: BigNumber$1.Value;
|
|
289
|
+
platformFeeRate: BigNumber$1.Value;
|
|
290
|
+
curveType: CurveType;
|
|
291
|
+
shareFeeRate: BigNumber$1.Value;
|
|
292
|
+
}): {
|
|
293
|
+
amountA: BigNumber$1.Value;
|
|
294
|
+
amountB: BigNumber$1.Value;
|
|
295
|
+
splitFee: {
|
|
296
|
+
platformFee: BigNumber$1.Value;
|
|
297
|
+
shareFee: BigNumber$1.Value;
|
|
298
|
+
protocolFee: BigNumber$1.Value;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
static sellExactIn({ poolInfo, amountA, protocolFeeRate, platformFeeRate, curveType, shareFeeRate, }: {
|
|
302
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
303
|
+
amountA: BigNumber$1.Value;
|
|
304
|
+
protocolFeeRate: BigNumber$1.Value;
|
|
305
|
+
platformFeeRate: BigNumber$1.Value;
|
|
306
|
+
curveType: CurveType;
|
|
307
|
+
shareFeeRate: BigNumber$1.Value;
|
|
308
|
+
}): {
|
|
309
|
+
amountA: BigNumber$1.Value;
|
|
310
|
+
amountB: BigNumber$1.Value;
|
|
311
|
+
splitFee: {
|
|
312
|
+
platformFee: BigNumber$1.Value;
|
|
313
|
+
shareFee: BigNumber$1.Value;
|
|
314
|
+
protocolFee: BigNumber$1.Value;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
static sellExactOut({ poolInfo, amountB, protocolFeeRate, platformFeeRate, curveType, shareFeeRate, }: {
|
|
318
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
319
|
+
amountB: BigNumber$1.Value;
|
|
320
|
+
protocolFeeRate: BigNumber$1.Value;
|
|
321
|
+
platformFeeRate: BigNumber$1.Value;
|
|
322
|
+
curveType: CurveType;
|
|
323
|
+
shareFeeRate: BigNumber$1.Value;
|
|
324
|
+
}): {
|
|
325
|
+
amountA: BigNumber$1.Value;
|
|
326
|
+
amountB: BigNumber$1.Value;
|
|
327
|
+
splitFee: {
|
|
328
|
+
platformFee: BigNumber$1.Value;
|
|
329
|
+
shareFee: BigNumber$1.Value;
|
|
330
|
+
protocolFee: BigNumber$1.Value;
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
static splitFee({ totalFee, protocolFeeRate, platformFeeRate, shareFeeRate, }: {
|
|
334
|
+
totalFee: BigNumber$1.Value;
|
|
335
|
+
protocolFeeRate: BigNumber$1.Value;
|
|
336
|
+
platformFeeRate: BigNumber$1.Value;
|
|
337
|
+
shareFeeRate: BigNumber$1.Value;
|
|
338
|
+
}): {
|
|
339
|
+
platformFee: BigNumber$1.Value;
|
|
340
|
+
shareFee: BigNumber$1.Value;
|
|
341
|
+
protocolFee: BigNumber$1.Value;
|
|
342
|
+
};
|
|
343
|
+
static calculateFee({ amount, feeRate, }: {
|
|
344
|
+
amount: BigNumber$1.Value;
|
|
345
|
+
feeRate: BigNumber$1.Value;
|
|
346
|
+
}): BigNumber$1.Value;
|
|
347
|
+
static calculatePreFee({ postFeeAmount, feeRate, }: {
|
|
348
|
+
postFeeAmount: BigNumber$1.Value;
|
|
349
|
+
feeRate: BigNumber$1.Value;
|
|
350
|
+
}): BigNumber$1.Value;
|
|
351
|
+
static getCurve(curveType: CurveType): typeof BaseCurve;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
declare class FixedPriceCurve extends BaseCurve {
|
|
355
|
+
static getPoolInitPriceByPool({ poolInfo, decimalA, decimalB, }: {
|
|
356
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
357
|
+
decimalA: number;
|
|
358
|
+
decimalB: number;
|
|
359
|
+
}): BigNumber$1.Value;
|
|
360
|
+
static getPoolInitPriceByInit({ a, b, decimalA, decimalB, }: {
|
|
361
|
+
a: BigNumber$1.Value;
|
|
362
|
+
b: BigNumber$1.Value;
|
|
363
|
+
decimalA: number;
|
|
364
|
+
decimalB: number;
|
|
365
|
+
}): BigNumber$1.Value;
|
|
366
|
+
static getPoolPrice({ poolInfo, decimalA, decimalB, }: {
|
|
367
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
368
|
+
decimalA: number;
|
|
369
|
+
decimalB: number;
|
|
370
|
+
}): BigNumber$1.Value;
|
|
371
|
+
static getPoolEndPrice({ supply, totalSell, totalLockedAmount, totalFundRaising, migrateFee, decimalA, decimalB, }: {
|
|
372
|
+
supply: BigNumber$1.Value;
|
|
373
|
+
totalSell: BigNumber$1.Value;
|
|
374
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
375
|
+
totalFundRaising: BigNumber$1.Value;
|
|
376
|
+
migrateFee: BigNumber$1.Value;
|
|
377
|
+
decimalA: number;
|
|
378
|
+
decimalB: number;
|
|
379
|
+
}): BigNumber$1.Value;
|
|
380
|
+
static getPoolEndPriceReal({ poolInfo, decimalA, decimalB, }: {
|
|
381
|
+
poolInfo: LaunchPadPoolInfo;
|
|
382
|
+
decimalA: number;
|
|
383
|
+
decimalB: number;
|
|
384
|
+
}): BigNumber$1.Value;
|
|
385
|
+
static getInitParam({ supply, totalFundRaising, totalLockedAmount, migrateFee, }: {
|
|
386
|
+
supply: BigNumber$1.Value;
|
|
387
|
+
totalSell: BigNumber$1.Value;
|
|
388
|
+
totalFundRaising: BigNumber$1.Value;
|
|
389
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
390
|
+
migrateFee: BigNumber$1.Value;
|
|
391
|
+
}): {
|
|
392
|
+
a: BigNumber$1.Value;
|
|
393
|
+
b: BigNumber$1.Value;
|
|
394
|
+
c: BigNumber$1.Value;
|
|
395
|
+
};
|
|
396
|
+
static buyExactIn({ poolInfo, amount, }: {
|
|
397
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
398
|
+
amount: BigNumber$1.Value;
|
|
399
|
+
}): BigNumber$1.Value;
|
|
400
|
+
static buyExactOut({ poolInfo, amount, }: {
|
|
401
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
402
|
+
amount: BigNumber$1.Value;
|
|
403
|
+
}): BigNumber$1.Value;
|
|
404
|
+
static sellExactIn({ poolInfo, amount, }: {
|
|
405
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
406
|
+
amount: BigNumber$1.Value;
|
|
407
|
+
}): BigNumber$1.Value;
|
|
408
|
+
static sellExactOut({ poolInfo, amount, }: {
|
|
409
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
410
|
+
amount: BigNumber$1.Value;
|
|
411
|
+
}): BigNumber$1.Value;
|
|
412
|
+
static getAmountOut({ amountIn, initInput, initOutput, }: {
|
|
413
|
+
amountIn: BigNumber$1.Value;
|
|
414
|
+
initInput: BigNumber$1.Value;
|
|
415
|
+
initOutput: BigNumber$1.Value;
|
|
416
|
+
}): BigNumber$1.Value;
|
|
417
|
+
static getAmountIn({ amountOut, initInput, initOutput, }: {
|
|
418
|
+
amountOut: BigNumber$1.Value;
|
|
419
|
+
initInput: BigNumber$1.Value;
|
|
420
|
+
initOutput: BigNumber$1.Value;
|
|
421
|
+
}): BigNumber$1.Value;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
declare class LinearPriceCurve extends BaseCurve {
|
|
425
|
+
static getPoolInitPriceByPool(args: {
|
|
426
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
427
|
+
decimalA: number;
|
|
428
|
+
decimalB: number;
|
|
429
|
+
}): BigNumber$1.Value;
|
|
430
|
+
static getPoolInitPriceByInit(args: {
|
|
431
|
+
a: BigNumber$1.Value;
|
|
432
|
+
b: BigNumber$1.Value;
|
|
433
|
+
decimalA: number;
|
|
434
|
+
decimalB: number;
|
|
435
|
+
}): BigNumber$1.Value;
|
|
436
|
+
static getPoolPrice({ poolInfo, decimalA, decimalB, }: {
|
|
437
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
438
|
+
decimalA: number;
|
|
439
|
+
decimalB: number;
|
|
440
|
+
}): BigNumber$1.Value;
|
|
441
|
+
static getPoolEndPrice({ supply, totalSell, totalLockedAmount, totalFundRaising, migrateFee, decimalA, decimalB, }: {
|
|
442
|
+
supply: BigNumber$1.Value;
|
|
443
|
+
totalSell: BigNumber$1.Value;
|
|
444
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
445
|
+
totalFundRaising: BigNumber$1.Value;
|
|
446
|
+
migrateFee: BigNumber$1.Value;
|
|
447
|
+
decimalA: number;
|
|
448
|
+
decimalB: number;
|
|
449
|
+
}): BigNumber$1.Value;
|
|
450
|
+
static getPoolEndPriceReal({ poolInfo, decimalA, decimalB, }: {
|
|
451
|
+
poolInfo: LaunchPadPoolInfo;
|
|
452
|
+
decimalA: number;
|
|
453
|
+
decimalB: number;
|
|
454
|
+
}): BigNumber$1.Value;
|
|
455
|
+
static getInitParam({ supply, totalFundRaising, totalLockedAmount, migrateFee, }: {
|
|
456
|
+
supply: BigNumber$1.Value;
|
|
457
|
+
totalSell: BigNumber$1.Value;
|
|
458
|
+
totalLockedAmount: BigNumber$1.Value;
|
|
459
|
+
totalFundRaising: BigNumber$1.Value;
|
|
460
|
+
migrateFee: BigNumber$1.Value;
|
|
461
|
+
}): {
|
|
462
|
+
a: BigNumber$1.Value;
|
|
463
|
+
b: BigNumber$1.Value;
|
|
464
|
+
c: BigNumber$1.Value;
|
|
465
|
+
};
|
|
466
|
+
static buyExactIn({ poolInfo, amount, }: {
|
|
467
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
468
|
+
amount: BigNumber$1.Value;
|
|
469
|
+
}): BigNumber$1.Value;
|
|
470
|
+
static buyExactOut({ poolInfo, amount, }: {
|
|
471
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
472
|
+
amount: BigNumber$1.Value;
|
|
473
|
+
}): BigNumber$1.Value;
|
|
474
|
+
static sellExactIn({ poolInfo, amount, }: {
|
|
475
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
476
|
+
amount: BigNumber$1.Value;
|
|
477
|
+
}): BigNumber$1.Value;
|
|
478
|
+
static sellExactOut({ poolInfo, amount, }: {
|
|
479
|
+
poolInfo: LaunchPadPoolInfo | PoolBaseAmount;
|
|
480
|
+
amount: BigNumber$1.Value;
|
|
481
|
+
}): BigNumber$1.Value;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
interface LaunchpadCreateSnapshot {
|
|
485
|
+
status: LaunchpadCreateStatus;
|
|
486
|
+
intent?: CreateTokenIntent;
|
|
487
|
+
txHash?: string;
|
|
488
|
+
error?: Error;
|
|
489
|
+
}
|
|
490
|
+
interface LaunchpadUploadPort {
|
|
491
|
+
upload(intent: CreateTokenIntent): Promise<string>;
|
|
492
|
+
}
|
|
493
|
+
interface LaunchpadSignerPort {
|
|
494
|
+
sign(payload: string): Promise<string>;
|
|
495
|
+
}
|
|
496
|
+
interface LaunchpadExecutionPort {
|
|
497
|
+
submit(signed: string, intent: CreateTokenIntent): Promise<{
|
|
498
|
+
txHash: string;
|
|
499
|
+
}>;
|
|
500
|
+
}
|
|
501
|
+
interface LaunchpadCreateRuntime {
|
|
502
|
+
snapshot(): LaunchpadCreateSnapshot;
|
|
503
|
+
submit(intent: CreateTokenIntent): Promise<LaunchpadCreateSnapshot>;
|
|
504
|
+
}
|
|
505
|
+
declare function validateCreateTokenIntent(intent: CreateTokenIntent): void;
|
|
506
|
+
declare function createLaunchpadCreateRuntime(options: {
|
|
507
|
+
upload?: LaunchpadUploadPort;
|
|
508
|
+
signer?: LaunchpadSignerPort;
|
|
509
|
+
execution: LaunchpadExecutionPort;
|
|
510
|
+
onChange?: (snapshot: LaunchpadCreateSnapshot) => void;
|
|
511
|
+
}): LaunchpadCreateRuntime;
|
|
512
|
+
|
|
513
|
+
declare function createInMemoryLaunchpadPorts(options?: {
|
|
514
|
+
uploadError?: Error;
|
|
515
|
+
signError?: Error;
|
|
516
|
+
submitError?: Error;
|
|
517
|
+
timeout?: boolean;
|
|
518
|
+
}): {
|
|
519
|
+
upload: LaunchpadUploadPort;
|
|
520
|
+
signer: LaunchpadSignerPort;
|
|
521
|
+
execution: LaunchpadExecutionPort;
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
declare const PACKAGE_NAME: "@liberfi.io/react-launchpad";
|
|
525
|
+
|
|
526
|
+
declare function LaunchpadProvider({ children }: PropsWithChildren): react.FunctionComponentElement<react.ProviderProps<boolean>>;
|
|
527
|
+
declare function useLaunchpadReady(): boolean;
|
|
528
|
+
|
|
529
|
+
export { BaseCurve, ConstantProductCurve, type CreateTokenIntent, Curve, CurveType, FixedPriceCurve, type LaunchPadConfigInfo, LaunchPadPlatform, type LaunchPadPoolInfo, type LaunchpadCreateRuntime, type LaunchpadCreateSnapshot, type LaunchpadCreateStatus, type LaunchpadExecutionPort, LaunchpadProvider, type LaunchpadSignerPort, type LaunchpadUploadPort, LinearPriceCurve, PACKAGE_NAME, type PoolCurvePoint, createInMemoryLaunchpadPorts, createLaunchpadCreateRuntime, useLaunchpadReady, validateCreateTokenIntent };
|