@flaunch/sdk 0.1.0
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 +9 -0
- package/README.md +315 -0
- package/dist/abi/FairLaunch.d.ts +364 -0
- package/dist/abi/FairLaunch.d.ts.map +1 -0
- package/dist/abi/FastFlaunchZap.d.ts +75 -0
- package/dist/abi/FastFlaunchZap.d.ts.map +1 -0
- package/dist/abi/Flaunch.d.ts +832 -0
- package/dist/abi/Flaunch.d.ts.map +1 -0
- package/dist/abi/FlaunchPositionManager.d.ts +2030 -0
- package/dist/abi/FlaunchPositionManager.d.ts.map +1 -0
- package/dist/abi/Memecoin.d.ts +743 -0
- package/dist/abi/Memecoin.d.ts.map +1 -0
- package/dist/abi/Permit2.d.ts +701 -0
- package/dist/abi/Permit2.d.ts.map +1 -0
- package/dist/abi/PoolManager.d.ts +1057 -0
- package/dist/abi/PoolManager.d.ts.map +1 -0
- package/dist/abi/Quoter.d.ts +486 -0
- package/dist/abi/Quoter.d.ts.map +1 -0
- package/dist/abi/UniversalRouter.d.ts +342 -0
- package/dist/abi/UniversalRouter.d.ts.map +1 -0
- package/dist/abi/index.cjs +3023 -0
- package/dist/abi/index.cjs.map +1 -0
- package/dist/abi/index.d.ts +6 -0
- package/dist/abi/index.d.ts.map +1 -0
- package/dist/abi/index.js +3015 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/addresses/index.cjs +5334 -0
- package/dist/addresses/index.cjs.map +1 -0
- package/dist/addresses/index.js +5321 -0
- package/dist/addresses/index.js.map +1 -0
- package/dist/addresses.d.ts +12 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/clients/FairLaunchClient.d.ts +21 -0
- package/dist/clients/FairLaunchClient.d.ts.map +1 -0
- package/dist/clients/FastFlaunchClient.d.ts +25 -0
- package/dist/clients/FastFlaunchClient.d.ts.map +1 -0
- package/dist/clients/FlaunchClient.d.ts +10 -0
- package/dist/clients/FlaunchClient.d.ts.map +1 -0
- package/dist/clients/FlaunchPositionManagerClient.d.ts +89 -0
- package/dist/clients/FlaunchPositionManagerClient.d.ts.map +1 -0
- package/dist/clients/MemecoinClient.d.ts +12 -0
- package/dist/clients/MemecoinClient.d.ts.map +1 -0
- package/dist/clients/Permit2Client.d.ts +13 -0
- package/dist/clients/Permit2Client.d.ts.map +1 -0
- package/dist/clients/PoolManagerClient.d.ts +32 -0
- package/dist/clients/PoolManagerClient.d.ts.map +1 -0
- package/dist/clients/QuoterClient.d.ts +12 -0
- package/dist/clients/QuoterClient.d.ts.map +1 -0
- package/dist/helpers/hex.d.ts +4 -0
- package/dist/helpers/hex.d.ts.map +1 -0
- package/dist/helpers/index.cjs +191 -0
- package/dist/helpers/index.cjs.map +1 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +177 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/ipfs.d.ts +47 -0
- package/dist/helpers/ipfs.d.ts.map +1 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.ts +12 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.ts.map +1 -0
- package/dist/hooks/index.cjs +69 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +64 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.cjs.js +11498 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +11466 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/sdk/FlaunchSDK.d.ts +121 -0
- package/dist/sdk/FlaunchSDK.d.ts.map +1 -0
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/univ4.d.ts +20 -0
- package/dist/utils/univ4.d.ts.map +1 -0
- package/dist/utils/universalRouter.d.ts +74 -0
- package/dist/utils/universalRouter.d.ts.map +1 -0
- package/package.json +88 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) https://flaunch.gg/
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
# Flaunch SDK
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/package/@flaunch/sdk)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
A TypeScript SDK for seamless interaction with the Flaunch protocol and Uniswap V4.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- 🚀 Flaunch new memecoins
|
|
13
|
+
- 💱 Buy and sell memecoins via Uniswap V4 hooks
|
|
14
|
+
- 📊 Read functions for token and pool data
|
|
15
|
+
- 🔒 Built-in Permit2 support for gasless approvals
|
|
16
|
+
- 🔵 Works on Base and Base Sepolia networks
|
|
17
|
+
|
|
18
|
+
## Table of Contents
|
|
19
|
+
|
|
20
|
+
- [Installation](#installation)
|
|
21
|
+
- [Quick Start](#quick-start)
|
|
22
|
+
- [Usage](#usage)
|
|
23
|
+
- [Read Operations](#read-operations-with-viem)
|
|
24
|
+
- [Write Operations](#write-operations-with-viem--wagmi)
|
|
25
|
+
- [Selling with Permit2](#selling-with-permit2)
|
|
26
|
+
- [Flaunching a Memecoin](#flaunching-a-memecoin)
|
|
27
|
+
- [How to generate Base64Image from file upload](#how-to-generate-base64image-from-user-uploaded-file)
|
|
28
|
+
- [All SDK functions](#all-sdk-functions)
|
|
29
|
+
- [React Hooks](#react-hooks)
|
|
30
|
+
- [Flaunch Docs](#flaunch-reference)
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
Using pnpm (recommended):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm add @flaunch/sdk @delvtech/drift
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Using npm:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @flaunch/sdk @delvtech/drift
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Using yarn:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
yarn add @flaunch/sdk @delvtech/drift
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
Here's a simple example to get started with reading token metadata:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { ReadFlaunchSDK } from "@flaunch/sdk";
|
|
58
|
+
import { createDrift } from "@delvtech/drift";
|
|
59
|
+
import { viemAdapter } from "@delvtech/drift-viem";
|
|
60
|
+
import { base } from "viem/chains";
|
|
61
|
+
|
|
62
|
+
const publicClient = createPublicClient({
|
|
63
|
+
chain: base,
|
|
64
|
+
transport: http(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const drift = createDrift({
|
|
68
|
+
adapter: viemAdapter({ publicClient }),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const flaunchRead = new ReadFlaunchSDK(base.id, drift);
|
|
72
|
+
const { symbol, name, image } = await flaunchRead.getCoinMetadata(coinAddress);
|
|
73
|
+
// returns: {symbol: "TEST", name: "Test", image: "https://<IMAGE_URL>"}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
The SDK has 2 exports:
|
|
79
|
+
|
|
80
|
+
1. `ReadFlaunchSDK`: public read only operations
|
|
81
|
+
2. `ReadWriteFlaunchSDK`: read and write operations (extends `ReadFlaunchSDK`)
|
|
82
|
+
|
|
83
|
+
### Read Operations (with Viem)
|
|
84
|
+
|
|
85
|
+
1. First, install the Viem adapter:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pnpm add @delvtech/drift-viem
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
2. Initialize the SDK for read operations:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
import { ReadFlaunchSDK } from "@flaunch/sdk";
|
|
95
|
+
import { createDrift } from "@delvtech/drift";
|
|
96
|
+
import { viemAdapter } from "@delvtech/drift-viem";
|
|
97
|
+
import { base, baseSepolia } from "viem/chains";
|
|
98
|
+
|
|
99
|
+
const publicClient = createPublicClient({
|
|
100
|
+
chain: base,
|
|
101
|
+
transport: http("<RPC_URL>"), // "<RPC_URL>" is optional, defaults to public RPC
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const drift = createDrift({
|
|
105
|
+
adapter: viemAdapter({ publicClient }),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const flaunchRead = new ReadFlaunchSDK(base.id, drift);
|
|
109
|
+
|
|
110
|
+
// Read token metadata
|
|
111
|
+
const { symbol, name, image } = await flaunchRead.getCoinMetadata(coinAddress);
|
|
112
|
+
// returns: {symbol: "TEST", name: "Test", image: "https://<IMAGE_URL>"}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Write Operations (with Viem + Wagmi)
|
|
116
|
+
|
|
117
|
+
For write operations, you'll need both Viem and Wagmi. Here's how to set it up in a React component:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
import { ReadWriteFlaunchSDK } from "@flaunch/sdk";
|
|
121
|
+
import { createDrift } from "@delvtech/drift";
|
|
122
|
+
import { viemAdapter } from "@delvtech/drift-viem";
|
|
123
|
+
import { base } from "viem/chains";
|
|
124
|
+
import { useWalletClient } from "wagmi";
|
|
125
|
+
import { useMemo } from "react";
|
|
126
|
+
|
|
127
|
+
// ... your React component ...
|
|
128
|
+
|
|
129
|
+
const { data: walletClient } = useWalletClient();
|
|
130
|
+
|
|
131
|
+
const flaunchWrite = useMemo(() => {
|
|
132
|
+
if (walletClient) {
|
|
133
|
+
const drift = createDrift({
|
|
134
|
+
adapter: viemAdapter({ publicClient, walletClient }),
|
|
135
|
+
});
|
|
136
|
+
return new ReadWriteFlaunchSDK(base.id, drift);
|
|
137
|
+
}
|
|
138
|
+
}, [walletClient]);
|
|
139
|
+
|
|
140
|
+
// Execute a buy transaction
|
|
141
|
+
const buyTokens = async () => {
|
|
142
|
+
const hash = await flaunchWrite.buyCoin({
|
|
143
|
+
coinAddress,
|
|
144
|
+
slippagePercent: 5,
|
|
145
|
+
swapType: "EXACT_IN",
|
|
146
|
+
amountIn: parseEther("0.1"),
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// Wait for confirmation
|
|
150
|
+
const receipt = await flaunchWrite.drift.waitForTransaction({ hash });
|
|
151
|
+
console.log(receipt.status === "success" ? "Success" : "Failed");
|
|
152
|
+
};
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Selling with Permit2
|
|
156
|
+
|
|
157
|
+
Permit2 enables gasless token approvals. Here's how to implement token selling with Permit2:
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { useSignTypedData } from "wagmi";
|
|
161
|
+
import { parseEther, Hex } from "viem";
|
|
162
|
+
|
|
163
|
+
const {
|
|
164
|
+
signTypedData,
|
|
165
|
+
status: sigStatus,
|
|
166
|
+
error: sigError,
|
|
167
|
+
data: signature,
|
|
168
|
+
} = useSignTypedData();
|
|
169
|
+
|
|
170
|
+
// Check allowance and permit if needed
|
|
171
|
+
const { allowance } = await flaunchWrite.getPermit2AllowanceAndNonce(
|
|
172
|
+
coinAddress
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
if (allowance < parseEther(coinAmount)) {
|
|
176
|
+
const { typedData, permitSingle } = await flaunchWrite.getPermit2TypedData(
|
|
177
|
+
coinAddress
|
|
178
|
+
);
|
|
179
|
+
signTypedData(typedData);
|
|
180
|
+
|
|
181
|
+
// then call this when signature is not undefined
|
|
182
|
+
const hash = await flaunchWrite.sellCoin({
|
|
183
|
+
coinAddress,
|
|
184
|
+
amountIn: parseEther(coinAmount),
|
|
185
|
+
slippagePercent: 5,
|
|
186
|
+
permitSingle,
|
|
187
|
+
signature,
|
|
188
|
+
});
|
|
189
|
+
} else {
|
|
190
|
+
// if already approved
|
|
191
|
+
const hash = await flaunchWrite.sellCoin({
|
|
192
|
+
coinAddress,
|
|
193
|
+
amountIn: parseEther(coinAmount),
|
|
194
|
+
slippagePercent: 5,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Flaunching a Memecoin
|
|
200
|
+
|
|
201
|
+
"Fast" Flaunch your own memecoin with default parameters:
|
|
202
|
+
|
|
203
|
+
- $10k starting market cap
|
|
204
|
+
- 60% of the total supply goes to the fair launch
|
|
205
|
+
|
|
206
|
+
_**Fast Flaunch doesn't incur any protocol fees!**_
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
const hash = await flaunchWrite.fastFlaunchIPFS({
|
|
210
|
+
name: "Test",
|
|
211
|
+
symbol: "TEST",
|
|
212
|
+
creator: address,
|
|
213
|
+
creatorFeeAllocationPercent: 30,
|
|
214
|
+
metadata: {
|
|
215
|
+
base64Image: imageData, // refer to the code below, on how to generate this base64Image
|
|
216
|
+
description: "Your memecoin description",
|
|
217
|
+
// optional:
|
|
218
|
+
websiteUrl: "https://example.com/",
|
|
219
|
+
discordUrl: "https://discord.gg/example",
|
|
220
|
+
twitterUrl: "https://x.com/example",
|
|
221
|
+
telegramUrl: "https://t.me/example",
|
|
222
|
+
},
|
|
223
|
+
pinataConfig: {
|
|
224
|
+
// Use one-time JWT for client-side uploads
|
|
225
|
+
// Refer: https://www.pinata.cloud/blog/how-to-upload-to-ipfs-from-the-frontend-with-signed-jwts/
|
|
226
|
+
jwt: pinataJWT,
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
#### How to generate `base64Image` from User uploaded file
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
// handle image file input and convert into base64
|
|
235
|
+
const handleImageChange = useCallback(
|
|
236
|
+
(e: ChangeEvent<HTMLInputElement>) => {
|
|
237
|
+
if (e.target.files && e.target.files[0]) {
|
|
238
|
+
const file = e.target.files[0];
|
|
239
|
+
|
|
240
|
+
// read the file as base64
|
|
241
|
+
const reader = new FileReader();
|
|
242
|
+
reader.onloadend = () => {
|
|
243
|
+
const base64String = reader.result as string;
|
|
244
|
+
|
|
245
|
+
// this can be passed to the flaunch function call
|
|
246
|
+
handleFlaunch({ imageData: base64String });
|
|
247
|
+
|
|
248
|
+
// use `storedImagePreview` to display the uploaded image with <image src={storedImagePreview} />
|
|
249
|
+
setStoredImagePreview(base64String);
|
|
250
|
+
};
|
|
251
|
+
reader.readAsDataURL(file);
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
[setStoredImagePreview]
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
// File upload input
|
|
258
|
+
<input
|
|
259
|
+
type="file"
|
|
260
|
+
accept="image/*"
|
|
261
|
+
onchange="handleImageChange(event)"
|
|
262
|
+
id="image-upload"
|
|
263
|
+
/>;
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### All SDK functions
|
|
267
|
+
|
|
268
|
+
For a list of all the functions in the SDK, refer to: [FlaunchSDK.ts](./src/sdk/FlaunchSDK.ts)
|
|
269
|
+
|
|
270
|
+
### React Hooks
|
|
271
|
+
|
|
272
|
+
The package also has hooks to listen for new Flaunches and new Coin Swaps. Refer to: [hooks](./src/hooks/FlaunchPositionManagerHooks.ts)
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
import { usePoolCreatedEvents, usePoolSwapEvents } from "@flaunch/sdk/hooks";
|
|
276
|
+
|
|
277
|
+
const { logs: poolCreatedLogs } = usePoolCreatedEvents(flaunchRead);
|
|
278
|
+
const { logs: poolSwapLogs } = usePoolSwapEvents(flaunchRead, coinAddress);
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The `poolSwapLogs` calculates & returns the net swapped amount:
|
|
282
|
+
*
|
|
283
|
+
* type BuySwapLog = {
|
|
284
|
+
* ...eventLog,
|
|
285
|
+
* timestamp: number;
|
|
286
|
+
* type: "BUY";
|
|
287
|
+
* delta: {
|
|
288
|
+
* coinsBought: bigint;
|
|
289
|
+
* flETHSold: bigint;
|
|
290
|
+
* fees: {
|
|
291
|
+
* isInFLETH: boolean;
|
|
292
|
+
* amount: bigint;
|
|
293
|
+
* };
|
|
294
|
+
* };
|
|
295
|
+
* };
|
|
296
|
+
*
|
|
297
|
+
* type SellSwapLog = {
|
|
298
|
+
* ...eventLog,
|
|
299
|
+
* timestamp: number;
|
|
300
|
+
* type: "SELL";
|
|
301
|
+
* delta: {
|
|
302
|
+
* coinsSold: bigint;
|
|
303
|
+
* flETHBought: bigint;
|
|
304
|
+
* fees: {
|
|
305
|
+
* isInFLETH: boolean;
|
|
306
|
+
* amount: bigint;
|
|
307
|
+
* };
|
|
308
|
+
* };
|
|
309
|
+
* };
|
|
310
|
+
*/
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Flaunch Reference
|
|
314
|
+
|
|
315
|
+
For detailed protocol documentation, visit our [Docs](https://docs.flaunch.gg/).
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
export declare const FairLaunchAbi: readonly [{
|
|
2
|
+
readonly inputs: readonly [{
|
|
3
|
+
readonly internalType: "contract IPoolManager";
|
|
4
|
+
readonly name: "_poolManager";
|
|
5
|
+
readonly type: "address";
|
|
6
|
+
}];
|
|
7
|
+
readonly stateMutability: "nonpayable";
|
|
8
|
+
readonly type: "constructor";
|
|
9
|
+
}, {
|
|
10
|
+
readonly inputs: readonly [];
|
|
11
|
+
readonly name: "CannotModifyLiquidityDuringFairLaunch";
|
|
12
|
+
readonly type: "error";
|
|
13
|
+
}, {
|
|
14
|
+
readonly inputs: readonly [];
|
|
15
|
+
readonly name: "CannotSellTokenDuringFairLaunch";
|
|
16
|
+
readonly type: "error";
|
|
17
|
+
}, {
|
|
18
|
+
readonly inputs: readonly [];
|
|
19
|
+
readonly name: "NotPositionManager";
|
|
20
|
+
readonly type: "error";
|
|
21
|
+
}, {
|
|
22
|
+
readonly anonymous: false;
|
|
23
|
+
readonly inputs: readonly [{
|
|
24
|
+
readonly indexed: true;
|
|
25
|
+
readonly internalType: "PoolId";
|
|
26
|
+
readonly name: "_poolId";
|
|
27
|
+
readonly type: "bytes32";
|
|
28
|
+
}, {
|
|
29
|
+
readonly indexed: false;
|
|
30
|
+
readonly internalType: "uint256";
|
|
31
|
+
readonly name: "_tokens";
|
|
32
|
+
readonly type: "uint256";
|
|
33
|
+
}, {
|
|
34
|
+
readonly indexed: false;
|
|
35
|
+
readonly internalType: "uint256";
|
|
36
|
+
readonly name: "_startsAt";
|
|
37
|
+
readonly type: "uint256";
|
|
38
|
+
}, {
|
|
39
|
+
readonly indexed: false;
|
|
40
|
+
readonly internalType: "uint256";
|
|
41
|
+
readonly name: "_endsAt";
|
|
42
|
+
readonly type: "uint256";
|
|
43
|
+
}];
|
|
44
|
+
readonly name: "FairLaunchCreated";
|
|
45
|
+
readonly type: "event";
|
|
46
|
+
}, {
|
|
47
|
+
readonly anonymous: false;
|
|
48
|
+
readonly inputs: readonly [{
|
|
49
|
+
readonly indexed: true;
|
|
50
|
+
readonly internalType: "PoolId";
|
|
51
|
+
readonly name: "_poolId";
|
|
52
|
+
readonly type: "bytes32";
|
|
53
|
+
}, {
|
|
54
|
+
readonly indexed: false;
|
|
55
|
+
readonly internalType: "uint256";
|
|
56
|
+
readonly name: "_revenue";
|
|
57
|
+
readonly type: "uint256";
|
|
58
|
+
}, {
|
|
59
|
+
readonly indexed: false;
|
|
60
|
+
readonly internalType: "uint256";
|
|
61
|
+
readonly name: "_supply";
|
|
62
|
+
readonly type: "uint256";
|
|
63
|
+
}, {
|
|
64
|
+
readonly indexed: false;
|
|
65
|
+
readonly internalType: "uint256";
|
|
66
|
+
readonly name: "_endedAt";
|
|
67
|
+
readonly type: "uint256";
|
|
68
|
+
}];
|
|
69
|
+
readonly name: "FairLaunchEnded";
|
|
70
|
+
readonly type: "event";
|
|
71
|
+
}, {
|
|
72
|
+
readonly inputs: readonly [];
|
|
73
|
+
readonly name: "FAIR_LAUNCH_WINDOW";
|
|
74
|
+
readonly outputs: readonly [{
|
|
75
|
+
readonly internalType: "uint256";
|
|
76
|
+
readonly name: "";
|
|
77
|
+
readonly type: "uint256";
|
|
78
|
+
}];
|
|
79
|
+
readonly stateMutability: "view";
|
|
80
|
+
readonly type: "function";
|
|
81
|
+
}, {
|
|
82
|
+
readonly inputs: readonly [{
|
|
83
|
+
readonly components: readonly [{
|
|
84
|
+
readonly internalType: "Currency";
|
|
85
|
+
readonly name: "currency0";
|
|
86
|
+
readonly type: "address";
|
|
87
|
+
}, {
|
|
88
|
+
readonly internalType: "Currency";
|
|
89
|
+
readonly name: "currency1";
|
|
90
|
+
readonly type: "address";
|
|
91
|
+
}, {
|
|
92
|
+
readonly internalType: "uint24";
|
|
93
|
+
readonly name: "fee";
|
|
94
|
+
readonly type: "uint24";
|
|
95
|
+
}, {
|
|
96
|
+
readonly internalType: "int24";
|
|
97
|
+
readonly name: "tickSpacing";
|
|
98
|
+
readonly type: "int24";
|
|
99
|
+
}, {
|
|
100
|
+
readonly internalType: "contract IHooks";
|
|
101
|
+
readonly name: "hooks";
|
|
102
|
+
readonly type: "address";
|
|
103
|
+
}];
|
|
104
|
+
readonly internalType: "struct PoolKey";
|
|
105
|
+
readonly name: "_poolKey";
|
|
106
|
+
readonly type: "tuple";
|
|
107
|
+
}, {
|
|
108
|
+
readonly internalType: "uint256";
|
|
109
|
+
readonly name: "_tokenFees";
|
|
110
|
+
readonly type: "uint256";
|
|
111
|
+
}, {
|
|
112
|
+
readonly internalType: "bool";
|
|
113
|
+
readonly name: "_nativeIsZero";
|
|
114
|
+
readonly type: "bool";
|
|
115
|
+
}];
|
|
116
|
+
readonly name: "closePosition";
|
|
117
|
+
readonly outputs: readonly [{
|
|
118
|
+
readonly components: readonly [{
|
|
119
|
+
readonly internalType: "uint256";
|
|
120
|
+
readonly name: "startsAt";
|
|
121
|
+
readonly type: "uint256";
|
|
122
|
+
}, {
|
|
123
|
+
readonly internalType: "uint256";
|
|
124
|
+
readonly name: "endsAt";
|
|
125
|
+
readonly type: "uint256";
|
|
126
|
+
}, {
|
|
127
|
+
readonly internalType: "int24";
|
|
128
|
+
readonly name: "initialTick";
|
|
129
|
+
readonly type: "int24";
|
|
130
|
+
}, {
|
|
131
|
+
readonly internalType: "uint256";
|
|
132
|
+
readonly name: "revenue";
|
|
133
|
+
readonly type: "uint256";
|
|
134
|
+
}, {
|
|
135
|
+
readonly internalType: "uint256";
|
|
136
|
+
readonly name: "supply";
|
|
137
|
+
readonly type: "uint256";
|
|
138
|
+
}, {
|
|
139
|
+
readonly internalType: "bool";
|
|
140
|
+
readonly name: "closed";
|
|
141
|
+
readonly type: "bool";
|
|
142
|
+
}];
|
|
143
|
+
readonly internalType: "struct FairLaunch.FairLaunchInfo";
|
|
144
|
+
readonly name: "";
|
|
145
|
+
readonly type: "tuple";
|
|
146
|
+
}];
|
|
147
|
+
readonly stateMutability: "nonpayable";
|
|
148
|
+
readonly type: "function";
|
|
149
|
+
}, {
|
|
150
|
+
readonly inputs: readonly [{
|
|
151
|
+
readonly internalType: "PoolId";
|
|
152
|
+
readonly name: "_poolId";
|
|
153
|
+
readonly type: "bytes32";
|
|
154
|
+
}, {
|
|
155
|
+
readonly internalType: "int24";
|
|
156
|
+
readonly name: "_initialTick";
|
|
157
|
+
readonly type: "int24";
|
|
158
|
+
}, {
|
|
159
|
+
readonly internalType: "uint256";
|
|
160
|
+
readonly name: "_flaunchesAt";
|
|
161
|
+
readonly type: "uint256";
|
|
162
|
+
}, {
|
|
163
|
+
readonly internalType: "uint256";
|
|
164
|
+
readonly name: "_initialTokenFairLaunch";
|
|
165
|
+
readonly type: "uint256";
|
|
166
|
+
}];
|
|
167
|
+
readonly name: "createPosition";
|
|
168
|
+
readonly outputs: readonly [{
|
|
169
|
+
readonly components: readonly [{
|
|
170
|
+
readonly internalType: "uint256";
|
|
171
|
+
readonly name: "startsAt";
|
|
172
|
+
readonly type: "uint256";
|
|
173
|
+
}, {
|
|
174
|
+
readonly internalType: "uint256";
|
|
175
|
+
readonly name: "endsAt";
|
|
176
|
+
readonly type: "uint256";
|
|
177
|
+
}, {
|
|
178
|
+
readonly internalType: "int24";
|
|
179
|
+
readonly name: "initialTick";
|
|
180
|
+
readonly type: "int24";
|
|
181
|
+
}, {
|
|
182
|
+
readonly internalType: "uint256";
|
|
183
|
+
readonly name: "revenue";
|
|
184
|
+
readonly type: "uint256";
|
|
185
|
+
}, {
|
|
186
|
+
readonly internalType: "uint256";
|
|
187
|
+
readonly name: "supply";
|
|
188
|
+
readonly type: "uint256";
|
|
189
|
+
}, {
|
|
190
|
+
readonly internalType: "bool";
|
|
191
|
+
readonly name: "closed";
|
|
192
|
+
readonly type: "bool";
|
|
193
|
+
}];
|
|
194
|
+
readonly internalType: "struct FairLaunch.FairLaunchInfo";
|
|
195
|
+
readonly name: "";
|
|
196
|
+
readonly type: "tuple";
|
|
197
|
+
}];
|
|
198
|
+
readonly stateMutability: "nonpayable";
|
|
199
|
+
readonly type: "function";
|
|
200
|
+
}, {
|
|
201
|
+
readonly inputs: readonly [{
|
|
202
|
+
readonly internalType: "PoolId";
|
|
203
|
+
readonly name: "_poolId";
|
|
204
|
+
readonly type: "bytes32";
|
|
205
|
+
}];
|
|
206
|
+
readonly name: "fairLaunchInfo";
|
|
207
|
+
readonly outputs: readonly [{
|
|
208
|
+
readonly components: readonly [{
|
|
209
|
+
readonly internalType: "uint256";
|
|
210
|
+
readonly name: "startsAt";
|
|
211
|
+
readonly type: "uint256";
|
|
212
|
+
}, {
|
|
213
|
+
readonly internalType: "uint256";
|
|
214
|
+
readonly name: "endsAt";
|
|
215
|
+
readonly type: "uint256";
|
|
216
|
+
}, {
|
|
217
|
+
readonly internalType: "int24";
|
|
218
|
+
readonly name: "initialTick";
|
|
219
|
+
readonly type: "int24";
|
|
220
|
+
}, {
|
|
221
|
+
readonly internalType: "uint256";
|
|
222
|
+
readonly name: "revenue";
|
|
223
|
+
readonly type: "uint256";
|
|
224
|
+
}, {
|
|
225
|
+
readonly internalType: "uint256";
|
|
226
|
+
readonly name: "supply";
|
|
227
|
+
readonly type: "uint256";
|
|
228
|
+
}, {
|
|
229
|
+
readonly internalType: "bool";
|
|
230
|
+
readonly name: "closed";
|
|
231
|
+
readonly type: "bool";
|
|
232
|
+
}];
|
|
233
|
+
readonly internalType: "struct FairLaunch.FairLaunchInfo";
|
|
234
|
+
readonly name: "";
|
|
235
|
+
readonly type: "tuple";
|
|
236
|
+
}];
|
|
237
|
+
readonly stateMutability: "view";
|
|
238
|
+
readonly type: "function";
|
|
239
|
+
}, {
|
|
240
|
+
readonly inputs: readonly [{
|
|
241
|
+
readonly components: readonly [{
|
|
242
|
+
readonly internalType: "Currency";
|
|
243
|
+
readonly name: "currency0";
|
|
244
|
+
readonly type: "address";
|
|
245
|
+
}, {
|
|
246
|
+
readonly internalType: "Currency";
|
|
247
|
+
readonly name: "currency1";
|
|
248
|
+
readonly type: "address";
|
|
249
|
+
}, {
|
|
250
|
+
readonly internalType: "uint24";
|
|
251
|
+
readonly name: "fee";
|
|
252
|
+
readonly type: "uint24";
|
|
253
|
+
}, {
|
|
254
|
+
readonly internalType: "int24";
|
|
255
|
+
readonly name: "tickSpacing";
|
|
256
|
+
readonly type: "int24";
|
|
257
|
+
}, {
|
|
258
|
+
readonly internalType: "contract IHooks";
|
|
259
|
+
readonly name: "hooks";
|
|
260
|
+
readonly type: "address";
|
|
261
|
+
}];
|
|
262
|
+
readonly internalType: "struct PoolKey";
|
|
263
|
+
readonly name: "_poolKey";
|
|
264
|
+
readonly type: "tuple";
|
|
265
|
+
}, {
|
|
266
|
+
readonly internalType: "int256";
|
|
267
|
+
readonly name: "_amountSpecified";
|
|
268
|
+
readonly type: "int256";
|
|
269
|
+
}, {
|
|
270
|
+
readonly internalType: "bool";
|
|
271
|
+
readonly name: "_nativeIsZero";
|
|
272
|
+
readonly type: "bool";
|
|
273
|
+
}];
|
|
274
|
+
readonly name: "fillFromPosition";
|
|
275
|
+
readonly outputs: readonly [{
|
|
276
|
+
readonly internalType: "BeforeSwapDelta";
|
|
277
|
+
readonly name: "beforeSwapDelta_";
|
|
278
|
+
readonly type: "int256";
|
|
279
|
+
}, {
|
|
280
|
+
readonly internalType: "BalanceDelta";
|
|
281
|
+
readonly name: "balanceDelta_";
|
|
282
|
+
readonly type: "int256";
|
|
283
|
+
}, {
|
|
284
|
+
readonly components: readonly [{
|
|
285
|
+
readonly internalType: "uint256";
|
|
286
|
+
readonly name: "startsAt";
|
|
287
|
+
readonly type: "uint256";
|
|
288
|
+
}, {
|
|
289
|
+
readonly internalType: "uint256";
|
|
290
|
+
readonly name: "endsAt";
|
|
291
|
+
readonly type: "uint256";
|
|
292
|
+
}, {
|
|
293
|
+
readonly internalType: "int24";
|
|
294
|
+
readonly name: "initialTick";
|
|
295
|
+
readonly type: "int24";
|
|
296
|
+
}, {
|
|
297
|
+
readonly internalType: "uint256";
|
|
298
|
+
readonly name: "revenue";
|
|
299
|
+
readonly type: "uint256";
|
|
300
|
+
}, {
|
|
301
|
+
readonly internalType: "uint256";
|
|
302
|
+
readonly name: "supply";
|
|
303
|
+
readonly type: "uint256";
|
|
304
|
+
}, {
|
|
305
|
+
readonly internalType: "bool";
|
|
306
|
+
readonly name: "closed";
|
|
307
|
+
readonly type: "bool";
|
|
308
|
+
}];
|
|
309
|
+
readonly internalType: "struct FairLaunch.FairLaunchInfo";
|
|
310
|
+
readonly name: "fairLaunchInfo_";
|
|
311
|
+
readonly type: "tuple";
|
|
312
|
+
}];
|
|
313
|
+
readonly stateMutability: "nonpayable";
|
|
314
|
+
readonly type: "function";
|
|
315
|
+
}, {
|
|
316
|
+
readonly inputs: readonly [{
|
|
317
|
+
readonly internalType: "PoolId";
|
|
318
|
+
readonly name: "_poolId";
|
|
319
|
+
readonly type: "bytes32";
|
|
320
|
+
}];
|
|
321
|
+
readonly name: "inFairLaunchWindow";
|
|
322
|
+
readonly outputs: readonly [{
|
|
323
|
+
readonly internalType: "bool";
|
|
324
|
+
readonly name: "";
|
|
325
|
+
readonly type: "bool";
|
|
326
|
+
}];
|
|
327
|
+
readonly stateMutability: "view";
|
|
328
|
+
readonly type: "function";
|
|
329
|
+
}, {
|
|
330
|
+
readonly inputs: readonly [{
|
|
331
|
+
readonly internalType: "PoolId";
|
|
332
|
+
readonly name: "_poolId";
|
|
333
|
+
readonly type: "bytes32";
|
|
334
|
+
}, {
|
|
335
|
+
readonly internalType: "int256";
|
|
336
|
+
readonly name: "_revenue";
|
|
337
|
+
readonly type: "int256";
|
|
338
|
+
}];
|
|
339
|
+
readonly name: "modifyRevenue";
|
|
340
|
+
readonly outputs: readonly [];
|
|
341
|
+
readonly stateMutability: "nonpayable";
|
|
342
|
+
readonly type: "function";
|
|
343
|
+
}, {
|
|
344
|
+
readonly inputs: readonly [];
|
|
345
|
+
readonly name: "poolManager";
|
|
346
|
+
readonly outputs: readonly [{
|
|
347
|
+
readonly internalType: "contract IPoolManager";
|
|
348
|
+
readonly name: "";
|
|
349
|
+
readonly type: "address";
|
|
350
|
+
}];
|
|
351
|
+
readonly stateMutability: "view";
|
|
352
|
+
readonly type: "function";
|
|
353
|
+
}, {
|
|
354
|
+
readonly inputs: readonly [];
|
|
355
|
+
readonly name: "positionManager";
|
|
356
|
+
readonly outputs: readonly [{
|
|
357
|
+
readonly internalType: "address";
|
|
358
|
+
readonly name: "";
|
|
359
|
+
readonly type: "address";
|
|
360
|
+
}];
|
|
361
|
+
readonly stateMutability: "view";
|
|
362
|
+
readonly type: "function";
|
|
363
|
+
}];
|
|
364
|
+
//# sourceMappingURL=FairLaunch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FairLaunch.d.ts","sourceRoot":"","sources":["../../src/abi/FairLaunch.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsPhB,CAAC"}
|