@flaunch/sdk 0.3.0 → 0.4.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/README.md +78 -0
- package/dist/abi/BidWallV1_1.d.ts +740 -0
- package/dist/abi/BidWallV1_1.d.ts.map +1 -0
- package/dist/abi/FairLaunchV1_1.d.ts +522 -0
- package/dist/abi/FairLaunchV1_1.d.ts.map +1 -0
- package/dist/abi/FastFlaunchZap.d.ts +30 -20
- package/dist/abi/FastFlaunchZap.d.ts.map +1 -1
- package/dist/abi/FlaunchPositionManagerV1_1.d.ts +2053 -0
- package/dist/abi/FlaunchPositionManagerV1_1.d.ts.map +1 -0
- package/dist/abi/FlaunchV1_1.d.ts +850 -0
- package/dist/abi/FlaunchV1_1.d.ts.map +1 -0
- package/dist/abi/FlaunchZap.d.ts +330 -0
- package/dist/abi/FlaunchZap.d.ts.map +1 -0
- package/dist/abi/RevenueManager.d.ts +648 -0
- package/dist/abi/RevenueManager.d.ts.map +1 -0
- package/dist/abi/TreasuryManagerFactory.d.ts +434 -0
- package/dist/abi/TreasuryManagerFactory.d.ts.map +1 -0
- package/dist/abi/index.cjs +27 -58
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.js +27 -58
- package/dist/abi/index.js.map +1 -1
- package/dist/addresses/index.cjs +127 -91
- package/dist/addresses/index.cjs.map +1 -1
- package/dist/addresses/index.js +121 -92
- package/dist/addresses/index.js.map +1 -1
- package/dist/addresses.d.ts +7 -0
- package/dist/addresses.d.ts.map +1 -1
- package/dist/clients/BidWallClient.d.ts +20 -0
- package/dist/clients/BidWallClient.d.ts.map +1 -1
- package/dist/clients/BidWallV1_1Client.d.ts +46 -0
- package/dist/clients/BidWallV1_1Client.d.ts.map +1 -0
- package/dist/clients/FairLaunchClient.d.ts +20 -0
- package/dist/clients/FairLaunchClient.d.ts.map +1 -1
- package/dist/clients/FairLaunchV1_1Client.d.ts +50 -0
- package/dist/clients/FairLaunchV1_1Client.d.ts.map +1 -0
- package/dist/clients/FastFlaunchClient.d.ts +40 -0
- package/dist/clients/FastFlaunchClient.d.ts.map +1 -1
- package/dist/clients/FlaunchClient.d.ts +20 -0
- package/dist/clients/FlaunchClient.d.ts.map +1 -1
- package/dist/clients/FlaunchPositionManagerV1_1Client.d.ts +90 -0
- package/dist/clients/FlaunchPositionManagerV1_1Client.d.ts.map +1 -0
- package/dist/clients/FlaunchV1_1Client.d.ts +31 -0
- package/dist/clients/FlaunchV1_1Client.d.ts.map +1 -0
- package/dist/clients/FlaunchZapClient.d.ts +70 -0
- package/dist/clients/FlaunchZapClient.d.ts.map +1 -0
- package/dist/clients/MemecoinClient.d.ts +27 -0
- package/dist/clients/MemecoinClient.d.ts.map +1 -1
- package/dist/clients/Permit2Client.d.ts +17 -0
- package/dist/clients/Permit2Client.d.ts.map +1 -1
- package/dist/clients/QuoterClient.d.ts +39 -3
- package/dist/clients/QuoterClient.d.ts.map +1 -1
- package/dist/clients/RevenueManagerClient.d.ts +42 -0
- package/dist/clients/RevenueManagerClient.d.ts.map +1 -0
- package/dist/clients/StateViewClient.d.ts +30 -0
- package/dist/clients/StateViewClient.d.ts.map +1 -1
- package/dist/clients/TreasuryManagerFactoryClient.d.ts +24 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.ts.map +1 -0
- package/dist/helpers/chainIdToChain.d.ts +5 -0
- package/dist/helpers/chainIdToChain.d.ts.map +1 -0
- package/dist/helpers/index.cjs +5310 -0
- package/dist/helpers/index.cjs.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +5313 -4
- package/dist/helpers/index.js.map +1 -1
- package/dist/hooks/FlaunchPositionManagerHooks.d.ts +42 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.ts.map +1 -1
- package/dist/hooks/index.cjs +95 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +94 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs.js +16748 -11289
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +16742 -11291
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/sdk/FlaunchSDK.d.ts +288 -15
- package/dist/sdk/FlaunchSDK.d.ts.map +1 -1
- package/dist/utils/universalRouter.d.ts +2 -0
- package/dist/utils/universalRouter.d.ts.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -7,10 +7,13 @@ A TypeScript SDK for seamless interaction with the Flaunch protocol and Uniswap
|
|
|
7
7
|
|
|
8
8
|

|
|
9
9
|
|
|
10
|
+
_Note: Add this `llms-full.txt` file into Cursor IDE / LLMs to provide context about using the Flaunch SDK: [llms-full.txt](https://raw.githubusercontent.com/flayerlabs/flaunch-sdk/refs/heads/master/llms-full.txt)_
|
|
11
|
+
|
|
10
12
|
## Features
|
|
11
13
|
|
|
12
14
|
- 🚀 Flaunch new memecoins
|
|
13
15
|
- 💱 Buy and sell memecoins via Uniswap V4 hooks
|
|
16
|
+
- 🏗️ Build your own token launchpads on top of the flaunch protocol
|
|
14
17
|
- 📊 Read functions for token and pool data
|
|
15
18
|
- 🔒 Built-in Permit2 support for gasless approvals
|
|
16
19
|
- 🔵 Works on Base and Base Sepolia networks
|
|
@@ -25,6 +28,7 @@ A TypeScript SDK for seamless interaction with the Flaunch protocol and Uniswap
|
|
|
25
28
|
- [Selling with Permit2](#selling-with-permit2)
|
|
26
29
|
- [Flaunching a Memecoin](#flaunching-a-memecoin)
|
|
27
30
|
- [How to generate Base64Image from file upload](#how-to-generate-base64image-from-user-uploaded-file)
|
|
31
|
+
- [Advanced Integration: Revenue Sharing with RevenueManager](#advanced-integration-revenue-sharing-with-revenuemanager)
|
|
28
32
|
- [All SDK functions](#all-sdk-functions)
|
|
29
33
|
- [React Hooks](#react-hooks)
|
|
30
34
|
- [Flaunch Docs](#flaunch-reference)
|
|
@@ -263,6 +267,80 @@ const handleImageChange = useCallback(
|
|
|
263
267
|
/>;
|
|
264
268
|
```
|
|
265
269
|
|
|
270
|
+
### Advanced Integration: Revenue Sharing with RevenueManager
|
|
271
|
+
|
|
272
|
+
For platforms building on top of Flaunch, the `RevenueManager` contract enables sophisticated revenue-sharing models. It allows platforms to automatically take a protocol fee from the trading fees generated by memecoins launched through their integration.
|
|
273
|
+
|
|
274
|
+
**Key Concepts:**
|
|
275
|
+
|
|
276
|
+
1. **Deployment & Initialization**: Before flaunching tokens via your platform, deploy an instance of your `RevenueManager` with your protocol fee and recipient address.
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
const revenueManagerInstanceAddress = await flaunchWrite.deployRevenueManager({
|
|
280
|
+
protocolRecipient: "0xabc...",
|
|
281
|
+
protocolFeePercent: 20, // 20% revenue share between protocol and 80% to coin creators (of the 1% swap fees)
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
2. **Flaunching Directly to Manager**: Instead of the creator receiving the Flaunch NFT, you'd flaunch the token directly into the `RevenueManager`. This automatically sets up the fee split.
|
|
286
|
+
|
|
287
|
+
```ts
|
|
288
|
+
await flaunchWrite.flaunchIPFSWithRevenueManager({
|
|
289
|
+
name: "...",
|
|
290
|
+
symbol: "...",
|
|
291
|
+
metadata: {
|
|
292
|
+
base64Image: "...",
|
|
293
|
+
},
|
|
294
|
+
pinataConfig: {
|
|
295
|
+
jwt: "...",
|
|
296
|
+
},
|
|
297
|
+
fairLaunchPercent: 40,
|
|
298
|
+
fairLaunchDuration: 30 * 60, // 30 mins
|
|
299
|
+
initialMarketCapUSD: 1_000,
|
|
300
|
+
creator: "0x...",
|
|
301
|
+
creatorFeeAllocationPercent: 100,
|
|
302
|
+
// **Note:** Specify your instance of the RevenueManager here
|
|
303
|
+
revenueManagerInstanceAddress: "...",
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
3. **Claiming Fees**: Creators can claim their share of earned fees, and the protocol can claim its share via the `RevenueManager` contract.
|
|
308
|
+
|
|
309
|
+
```ts
|
|
310
|
+
// check address' balance
|
|
311
|
+
const balance = await flaunchRead.revenueManagerBalance({
|
|
312
|
+
revenueManagerAddress: revenueManagerInstanceAddress,
|
|
313
|
+
recipient: "0xabc...",
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// protocol claim: the connected wallet must be the protocol recipient for the revenue manager
|
|
317
|
+
await flaunchWrite.revenueManagerProtocolClaim({
|
|
318
|
+
revenueManagerAddress: revenueManagerInstanceAddress,
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// creator claim: the connected wallet must be the coin's creator for them to claim their share
|
|
322
|
+
await flaunchWrite.revenueManagerCreatorClaim({
|
|
323
|
+
revenueManagerAddress: revenueManagerInstanceAddress,
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// creator claim: for specific flaunch token ids:
|
|
327
|
+
await flaunchWrite.revenueManagerCreatorClaimForTokens({
|
|
328
|
+
revenueManagerAddress: revenueManagerInstanceAddress,
|
|
329
|
+
flaunchTokens: [
|
|
330
|
+
{
|
|
331
|
+
flaunch: FlaunchAddress[base.id],
|
|
332
|
+
tokenId: 5,
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
flaunch: FlaunchV1_1Address[base.id],
|
|
336
|
+
tokenId: 10,
|
|
337
|
+
},
|
|
338
|
+
],
|
|
339
|
+
});
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Refer to the [RevenueManager Docs](https://docs.flaunch.gg/manager-types/revenuemanager) for detailed implementation guides and function references.
|
|
343
|
+
|
|
266
344
|
### All SDK functions
|
|
267
345
|
|
|
268
346
|
For a list of all the functions in the SDK, refer to: [FlaunchSDK.ts](./src/sdk/FlaunchSDK.ts)
|