@flaunch/sdk 0.7.0 → 0.8.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 +8 -8
- package/dist/abi/AnyPositionManager.d.ts +1922 -0
- package/dist/abi/AnyPositionManager.d.ts.map +1 -0
- package/dist/abi/FeeEscrow.d.ts +282 -0
- package/dist/abi/FeeEscrow.d.ts.map +1 -0
- package/dist/abi/ReferralEscrow.d.ts +321 -0
- package/dist/abi/ReferralEscrow.d.ts.map +1 -0
- package/dist/abi/index.cjs +10989 -1717
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.d.ts +18 -0
- package/dist/abi/index.d.ts.map +1 -1
- package/dist/abi/index.js +10972 -1718
- package/dist/abi/index.js.map +1 -1
- package/dist/addresses/index.cjs +16 -0
- package/dist/addresses/index.cjs.map +1 -1
- package/dist/addresses/index.js +14 -1
- package/dist/addresses/index.js.map +1 -1
- package/dist/addresses.d.ts +3 -0
- package/dist/addresses.d.ts.map +1 -1
- package/dist/clients/AnyPositionManagerClient.d.ts +87 -0
- package/dist/clients/AnyPositionManagerClient.d.ts.map +1 -0
- package/dist/clients/FairLaunchClient.d.ts +3 -0
- package/dist/clients/FairLaunchClient.d.ts.map +1 -1
- package/dist/clients/FeeEscrowClient.d.ts +39 -0
- package/dist/clients/FeeEscrowClient.d.ts.map +1 -0
- package/dist/clients/FlaunchPositionManagerClient.d.ts +12 -0
- package/dist/clients/FlaunchPositionManagerClient.d.ts.map +1 -1
- package/dist/clients/InitialPriceClient.d.ts +4 -0
- package/dist/clients/InitialPriceClient.d.ts.map +1 -1
- package/dist/clients/MemecoinClient.d.ts +5 -0
- package/dist/clients/MemecoinClient.d.ts.map +1 -1
- package/dist/clients/QuoterClient.d.ts +6 -6
- package/dist/clients/QuoterClient.d.ts.map +1 -1
- package/dist/clients/ReferralEscrowClient.d.ts +40 -0
- package/dist/clients/ReferralEscrowClient.d.ts.map +1 -0
- package/dist/hooks/index.cjs +2 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs.js +2863 -395
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2863 -417
- 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 +136 -90
- package/dist/sdk/FlaunchSDK.d.ts.map +1 -1
- package/dist/sdk/drift.d.ts +21 -0
- package/dist/sdk/drift.d.ts.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/universalRouter.d.ts +2 -2
- package/dist/utils/universalRouter.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createDrift } from '@delvtech/drift';
|
|
2
|
-
import { zeroAddress, parseEther, encodeAbiParameters, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1,
|
|
1
|
+
import { createDrift as createDrift$1 } from '@delvtech/drift';
|
|
2
|
+
import { zeroAddress, parseEther, encodeAbiParameters, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, parseUnits, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, zeroHash, formatUnits as formatUnits$1, concat, toHex as toHex$1, createPublicClient, http } from 'viem';
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
import { TickMath } from '@uniswap/v3-sdk';
|
|
5
5
|
import { viemAdapter } from '@delvtech/drift-viem';
|
|
@@ -5307,6 +5307,7 @@ const sourceId = 5; // goerli
|
|
|
5307
5307
|
testnet: true,
|
|
5308
5308
|
});
|
|
5309
5309
|
|
|
5310
|
+
// doesn't use FeeEscrow
|
|
5310
5311
|
const FlaunchPositionManagerAddress = {
|
|
5311
5312
|
[base.id]: "0x51Bba15255406Cfe7099a42183302640ba7dAFDC",
|
|
5312
5313
|
[baseSepolia.id]: "0x9A7059cA00dA92843906Cb4bCa1D005cE848AFdC",
|
|
@@ -5315,6 +5316,18 @@ const FlaunchPositionManagerV1_1Address = {
|
|
|
5315
5316
|
[base.id]: "0xf785bb58059fab6fb19bdda2cb9078d9e546efdc",
|
|
5316
5317
|
[baseSepolia.id]: "0x24347e0dd16357059abfc1b321df354873552fdc",
|
|
5317
5318
|
};
|
|
5319
|
+
const AnyPositionManagerAddress = {
|
|
5320
|
+
[base.id]: "0x69a96de474521f7c6c0be3ea0498e5cf2f0565dc",
|
|
5321
|
+
[baseSepolia.id]: "0xe999c5676b0e0f83292074441292f4b3b11d65dc",
|
|
5322
|
+
};
|
|
5323
|
+
const FeeEscrowAddress = {
|
|
5324
|
+
[base.id]: "0x72e6f7948b1B1A343B477F39aAbd2E35E6D27dde",
|
|
5325
|
+
[baseSepolia.id]: "0x73E27908b7d35A9251a54799A8ef4C17e4ED9FF9",
|
|
5326
|
+
};
|
|
5327
|
+
const ReferralEscrowAddress = {
|
|
5328
|
+
[base.id]: "0xBD39c7Be6D98BD1a3e4Ad482baF99d738947fE55",
|
|
5329
|
+
[baseSepolia.id]: "0x0651cadC51b6a13CB3465C134A22154a2b633779",
|
|
5330
|
+
};
|
|
5318
5331
|
const FLETHAddress = {
|
|
5319
5332
|
[base.id]: "0x000000000D564D5be76f7f0d28fE52605afC7Cf8",
|
|
5320
5333
|
[baseSepolia.id]: "0x79FC52701cD4BE6f9Ba9aDC94c207DE37e3314eb",
|
|
@@ -7376,9 +7389,7 @@ const ETH = zeroAddress;
|
|
|
7376
7389
|
const ethToMemecoin = (params) => {
|
|
7377
7390
|
const flETH = FLETHAddress[params.chainId];
|
|
7378
7391
|
const flETHHooks = FLETHHooksAddress[params.chainId];
|
|
7379
|
-
const flaunchHooks = params.
|
|
7380
|
-
? FlaunchPositionManagerAddress[params.chainId]
|
|
7381
|
-
: FlaunchPositionManagerV1_1Address[params.chainId];
|
|
7392
|
+
const flaunchHooks = params.positionManagerAddress;
|
|
7382
7393
|
// Determine actions based on swapType
|
|
7383
7394
|
const v4Actions = ("0x" +
|
|
7384
7395
|
(params.swapType === "EXACT_IN"
|
|
@@ -7513,9 +7524,7 @@ const ethToMemecoin = (params) => {
|
|
|
7513
7524
|
const memecoinToEthWithPermit2 = (params) => {
|
|
7514
7525
|
const flETH = FLETHAddress[params.chainId];
|
|
7515
7526
|
const flETHHooks = FLETHHooksAddress[params.chainId];
|
|
7516
|
-
const flaunchHooks = params.
|
|
7517
|
-
? FlaunchPositionManagerAddress[params.chainId]
|
|
7518
|
-
: FlaunchPositionManagerV1_1Address[params.chainId];
|
|
7527
|
+
const flaunchHooks = params.positionManagerAddress;
|
|
7519
7528
|
const v4Actions = ("0x" +
|
|
7520
7529
|
V4Actions.SWAP_EXACT_IN +
|
|
7521
7530
|
V4Actions.SETTLE_ALL +
|
|
@@ -7941,7 +7950,7 @@ const InitialPriceAbi = [
|
|
|
7941
7950
|
];
|
|
7942
7951
|
|
|
7943
7952
|
class ReadInitialPrice {
|
|
7944
|
-
constructor(address, drift = createDrift()) {
|
|
7953
|
+
constructor(address, drift = createDrift$1()) {
|
|
7945
7954
|
if (!address) {
|
|
7946
7955
|
throw new Error("Address is required");
|
|
7947
7956
|
}
|
|
@@ -7963,10 +7972,17 @@ class ReadInitialPrice {
|
|
|
7963
7972
|
_initialPriceParams: params.initialPriceParams,
|
|
7964
7973
|
});
|
|
7965
7974
|
}
|
|
7975
|
+
getSqrtPriceX96(params) {
|
|
7976
|
+
return this.contract.read("getSqrtPriceX96", {
|
|
7977
|
+
_flipped: !params.isFLETHZero,
|
|
7978
|
+
_initialPriceParams: params.initialPriceParams,
|
|
7979
|
+
0: zeroAddress, // sender
|
|
7980
|
+
});
|
|
7981
|
+
}
|
|
7966
7982
|
}
|
|
7967
7983
|
|
|
7968
7984
|
class ReadFlaunchPositionManager {
|
|
7969
|
-
constructor(address, drift = createDrift()) {
|
|
7985
|
+
constructor(address, drift = createDrift$1()) {
|
|
7970
7986
|
this.TOTAL_SUPPLY = 100n * 10n ** 27n; // 100 Billion tokens in wei
|
|
7971
7987
|
this.drift = drift;
|
|
7972
7988
|
if (!address) {
|
|
@@ -7983,6 +7999,16 @@ class ReadFlaunchPositionManager {
|
|
|
7983
7999
|
});
|
|
7984
8000
|
return poolKey.tickSpacing !== 0;
|
|
7985
8001
|
}
|
|
8002
|
+
/**
|
|
8003
|
+
* Gets the ETH balance for the creator to claim
|
|
8004
|
+
* @param creator - The address of the creator to check
|
|
8005
|
+
* @returns The balance of the creator
|
|
8006
|
+
*/
|
|
8007
|
+
creatorBalance(creator) {
|
|
8008
|
+
return this.contract.read("balances", {
|
|
8009
|
+
_recipient: creator,
|
|
8010
|
+
});
|
|
8011
|
+
}
|
|
7986
8012
|
async getFlaunchingFee(params) {
|
|
7987
8013
|
const readInitialPrice = new ReadInitialPrice(await this.contract.read("initialPrice"), this.drift);
|
|
7988
8014
|
const flaunchingFee = await readInitialPrice.getFlaunchingFee(params);
|
|
@@ -8180,6 +8206,78 @@ class ReadFlaunchPositionManager {
|
|
|
8180
8206
|
};
|
|
8181
8207
|
}
|
|
8182
8208
|
}
|
|
8209
|
+
class ReadWriteFlaunchPositionManager extends ReadFlaunchPositionManager {
|
|
8210
|
+
constructor(address, drift = createDrift$1()) {
|
|
8211
|
+
super(address, drift);
|
|
8212
|
+
}
|
|
8213
|
+
async flaunch({ name, symbol, tokenUri, fairLaunchPercent, initialMarketCapUSD, creator, creatorFeeAllocationPercent, flaunchAt, }) {
|
|
8214
|
+
const initialMCapInUSDCWei = parseUnits(initialMarketCapUSD.toString(), 6);
|
|
8215
|
+
const initialPriceParams = encodeAbiParameters([
|
|
8216
|
+
{
|
|
8217
|
+
type: "uint256",
|
|
8218
|
+
},
|
|
8219
|
+
], [initialMCapInUSDCWei]);
|
|
8220
|
+
const fairLaunchInBps = BigInt(fairLaunchPercent * 100);
|
|
8221
|
+
const creatorFeeAllocationInBps = creatorFeeAllocationPercent * 100;
|
|
8222
|
+
let sender = zeroAddress;
|
|
8223
|
+
if (this.drift.adapter.getSignerAddress) {
|
|
8224
|
+
sender = await this.drift.adapter.getSignerAddress();
|
|
8225
|
+
}
|
|
8226
|
+
const flaunchingFee = await this.getFlaunchingFee({
|
|
8227
|
+
sender,
|
|
8228
|
+
initialPriceParams,
|
|
8229
|
+
slippagePercent: 5,
|
|
8230
|
+
});
|
|
8231
|
+
return this.contract.write("flaunch", {
|
|
8232
|
+
_params: {
|
|
8233
|
+
name,
|
|
8234
|
+
symbol,
|
|
8235
|
+
tokenUri,
|
|
8236
|
+
initialTokenFairLaunch: (this.TOTAL_SUPPLY * fairLaunchInBps) / 10000n,
|
|
8237
|
+
premineAmount: 0n,
|
|
8238
|
+
creator,
|
|
8239
|
+
creatorFeeAllocation: creatorFeeAllocationInBps,
|
|
8240
|
+
flaunchAt: flaunchAt ?? 0n,
|
|
8241
|
+
initialPriceParams,
|
|
8242
|
+
feeCalculatorParams: "0x",
|
|
8243
|
+
},
|
|
8244
|
+
}, {
|
|
8245
|
+
value: flaunchingFee,
|
|
8246
|
+
onMined: async () => {
|
|
8247
|
+
if (this.pollPoolCreatedNow) {
|
|
8248
|
+
await this.pollPoolCreatedNow();
|
|
8249
|
+
}
|
|
8250
|
+
},
|
|
8251
|
+
});
|
|
8252
|
+
}
|
|
8253
|
+
async flaunchIPFS({ name, symbol, fairLaunchPercent, initialMarketCapUSD, creator, creatorFeeAllocationPercent, flaunchAt, metadata, pinataConfig, }) {
|
|
8254
|
+
const tokenUri = await generateTokenUri(name, {
|
|
8255
|
+
metadata,
|
|
8256
|
+
pinataConfig,
|
|
8257
|
+
});
|
|
8258
|
+
return this.flaunch({
|
|
8259
|
+
name,
|
|
8260
|
+
symbol,
|
|
8261
|
+
tokenUri,
|
|
8262
|
+
fairLaunchPercent,
|
|
8263
|
+
initialMarketCapUSD,
|
|
8264
|
+
creator,
|
|
8265
|
+
creatorFeeAllocationPercent,
|
|
8266
|
+
flaunchAt,
|
|
8267
|
+
});
|
|
8268
|
+
}
|
|
8269
|
+
/**
|
|
8270
|
+
* Withdraws the creator's share of the revenue
|
|
8271
|
+
* @param recipient - The address to withdraw the revenue to
|
|
8272
|
+
* @returns Transaction response
|
|
8273
|
+
*/
|
|
8274
|
+
withdrawFees(recipient) {
|
|
8275
|
+
return this.contract.write("withdrawFees", {
|
|
8276
|
+
_recipient: recipient,
|
|
8277
|
+
_unwrap: true,
|
|
8278
|
+
});
|
|
8279
|
+
}
|
|
8280
|
+
}
|
|
8183
8281
|
|
|
8184
8282
|
const bytes32ToUint256 = (value) => {
|
|
8185
8283
|
return hexToBigInt$1(value);
|
|
@@ -8883,7 +8981,7 @@ const PoolManagerAbi = [
|
|
|
8883
8981
|
];
|
|
8884
8982
|
|
|
8885
8983
|
class ReadPoolManager {
|
|
8886
|
-
constructor(address, drift = createDrift()) {
|
|
8984
|
+
constructor(address, drift = createDrift$1()) {
|
|
8887
8985
|
if (!address) {
|
|
8888
8986
|
throw new Error("Address is required");
|
|
8889
8987
|
}
|
|
@@ -9173,7 +9271,7 @@ class ReadStateView {
|
|
|
9173
9271
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
9174
9272
|
* @throws Error if address is not provided
|
|
9175
9273
|
*/
|
|
9176
|
-
constructor(address, drift = createDrift()) {
|
|
9274
|
+
constructor(address, drift = createDrift$1()) {
|
|
9177
9275
|
if (!address) {
|
|
9178
9276
|
throw new Error("Address is required");
|
|
9179
9277
|
}
|
|
@@ -9484,7 +9582,7 @@ class ReadFairLaunch {
|
|
|
9484
9582
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
9485
9583
|
* @throws Error if address is not provided
|
|
9486
9584
|
*/
|
|
9487
|
-
constructor(address, drift = createDrift()) {
|
|
9585
|
+
constructor(address, drift = createDrift$1()) {
|
|
9488
9586
|
if (!address) {
|
|
9489
9587
|
throw new Error("Address is required");
|
|
9490
9588
|
}
|
|
@@ -9493,6 +9591,9 @@ class ReadFairLaunch {
|
|
|
9493
9591
|
address,
|
|
9494
9592
|
});
|
|
9495
9593
|
}
|
|
9594
|
+
fairLaunchDuration({ poolId }) {
|
|
9595
|
+
return 30 * 60; // 30 minutes
|
|
9596
|
+
}
|
|
9496
9597
|
/**
|
|
9497
9598
|
* Gets information about a fair launch for a specific pool
|
|
9498
9599
|
* @param poolId - The ID of the pool
|
|
@@ -9941,7 +10042,7 @@ class ReadBidWall {
|
|
|
9941
10042
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
9942
10043
|
* @throws Error if address is not provided
|
|
9943
10044
|
*/
|
|
9944
|
-
constructor(address, drift = createDrift()) {
|
|
10045
|
+
constructor(address, drift = createDrift$1()) {
|
|
9945
10046
|
if (!address) {
|
|
9946
10047
|
throw new Error("Address is required");
|
|
9947
10048
|
}
|
|
@@ -9972,137 +10073,6 @@ class ReadBidWall {
|
|
|
9972
10073
|
}
|
|
9973
10074
|
}
|
|
9974
10075
|
|
|
9975
|
-
const FastFlaunchZapAbi = [
|
|
9976
|
-
{
|
|
9977
|
-
inputs: [
|
|
9978
|
-
{
|
|
9979
|
-
internalType: "contract PositionManager",
|
|
9980
|
-
name: "_positionManager",
|
|
9981
|
-
type: "address",
|
|
9982
|
-
},
|
|
9983
|
-
],
|
|
9984
|
-
stateMutability: "nonpayable",
|
|
9985
|
-
type: "constructor",
|
|
9986
|
-
},
|
|
9987
|
-
{
|
|
9988
|
-
inputs: [],
|
|
9989
|
-
name: "CREATOR_FEE_ALLOCATION",
|
|
9990
|
-
outputs: [{ internalType: "uint24", name: "", type: "uint24" }],
|
|
9991
|
-
stateMutability: "view",
|
|
9992
|
-
type: "function",
|
|
9993
|
-
},
|
|
9994
|
-
{
|
|
9995
|
-
inputs: [],
|
|
9996
|
-
name: "FAIR_LAUNCH_SUPPLY",
|
|
9997
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
9998
|
-
stateMutability: "view",
|
|
9999
|
-
type: "function",
|
|
10000
|
-
},
|
|
10001
|
-
{
|
|
10002
|
-
inputs: [],
|
|
10003
|
-
name: "USDC_MARKET_CAP",
|
|
10004
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
10005
|
-
stateMutability: "view",
|
|
10006
|
-
type: "function",
|
|
10007
|
-
},
|
|
10008
|
-
{
|
|
10009
|
-
inputs: [
|
|
10010
|
-
{
|
|
10011
|
-
components: [
|
|
10012
|
-
{ internalType: "string", name: "name", type: "string" },
|
|
10013
|
-
{ internalType: "string", name: "symbol", type: "string" },
|
|
10014
|
-
{ internalType: "string", name: "tokenUri", type: "string" },
|
|
10015
|
-
{ internalType: "address", name: "creator", type: "address" },
|
|
10016
|
-
],
|
|
10017
|
-
internalType: "struct FastFlaunchZap.FastFlaunchParams",
|
|
10018
|
-
name: "_params",
|
|
10019
|
-
type: "tuple",
|
|
10020
|
-
},
|
|
10021
|
-
],
|
|
10022
|
-
name: "flaunch",
|
|
10023
|
-
outputs: [{ internalType: "address", name: "memecoin_", type: "address" }],
|
|
10024
|
-
stateMutability: "nonpayable",
|
|
10025
|
-
type: "function",
|
|
10026
|
-
},
|
|
10027
|
-
{
|
|
10028
|
-
inputs: [],
|
|
10029
|
-
name: "positionManager",
|
|
10030
|
-
outputs: [
|
|
10031
|
-
{ internalType: "contract PositionManager", name: "", type: "address" },
|
|
10032
|
-
],
|
|
10033
|
-
stateMutability: "view",
|
|
10034
|
-
type: "function",
|
|
10035
|
-
},
|
|
10036
|
-
];
|
|
10037
|
-
|
|
10038
|
-
/**
|
|
10039
|
-
* Base client for interacting with the FastFlaunchZap contract in read-only mode
|
|
10040
|
-
* Provides basic contract initialization
|
|
10041
|
-
*/
|
|
10042
|
-
class ReadFastFlaunchZap {
|
|
10043
|
-
/**
|
|
10044
|
-
* Creates a new ReadFastFlaunchZap instance
|
|
10045
|
-
* @param address - The address of the FastFlaunchZap contract
|
|
10046
|
-
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
10047
|
-
* @throws Error if address is not provided
|
|
10048
|
-
*/
|
|
10049
|
-
constructor(address, drift = createDrift()) {
|
|
10050
|
-
if (!address) {
|
|
10051
|
-
throw new Error("Address is required");
|
|
10052
|
-
}
|
|
10053
|
-
this.contract = drift.contract({
|
|
10054
|
-
abi: FastFlaunchZapAbi,
|
|
10055
|
-
address,
|
|
10056
|
-
});
|
|
10057
|
-
}
|
|
10058
|
-
}
|
|
10059
|
-
/**
|
|
10060
|
-
* Extended client for interacting with the FastFlaunchZap contract with write capabilities
|
|
10061
|
-
* Provides methods to create new fast flaunches with direct URI or IPFS metadata
|
|
10062
|
-
*/
|
|
10063
|
-
class ReadWriteFastFlaunchZap extends ReadFastFlaunchZap {
|
|
10064
|
-
/**
|
|
10065
|
-
* Creates a new ReadWriteFastFlaunchZap instance
|
|
10066
|
-
* @param address - The address of the FastFlaunchZap contract
|
|
10067
|
-
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
10068
|
-
*/
|
|
10069
|
-
constructor(address, drift = createDrift()) {
|
|
10070
|
-
super(address, drift);
|
|
10071
|
-
}
|
|
10072
|
-
/**
|
|
10073
|
-
* Creates a new fast flaunch with direct token URI
|
|
10074
|
-
* @param params - Parameters for the fast flaunch including name, symbol, tokenUri, and creator
|
|
10075
|
-
* @returns Transaction response for the flaunch creation
|
|
10076
|
-
*/
|
|
10077
|
-
fastFlaunch({ name, symbol, tokenUri, creator }) {
|
|
10078
|
-
return this.contract.write("flaunch", {
|
|
10079
|
-
_params: {
|
|
10080
|
-
name,
|
|
10081
|
-
symbol,
|
|
10082
|
-
tokenUri,
|
|
10083
|
-
creator,
|
|
10084
|
-
},
|
|
10085
|
-
});
|
|
10086
|
-
}
|
|
10087
|
-
/**
|
|
10088
|
-
* Creates a new fast flaunch with metadata stored on IPFS
|
|
10089
|
-
* @param params - Parameters for the fast flaunch including name, symbol, creator, metadata, and Pinata config
|
|
10090
|
-
* @returns Promise resolving to the transaction response for the flaunch creation
|
|
10091
|
-
*/
|
|
10092
|
-
async fastFlaunchIPFS({ name, symbol, creator, metadata, pinataConfig, }) {
|
|
10093
|
-
const tokenUri = await generateTokenUri(name, {
|
|
10094
|
-
metadata,
|
|
10095
|
-
pinataConfig,
|
|
10096
|
-
});
|
|
10097
|
-
return this.fastFlaunch({
|
|
10098
|
-
name,
|
|
10099
|
-
symbol,
|
|
10100
|
-
tokenUri,
|
|
10101
|
-
creator,
|
|
10102
|
-
});
|
|
10103
|
-
}
|
|
10104
|
-
}
|
|
10105
|
-
|
|
10106
10076
|
const FlaunchZapAbi = [
|
|
10107
10077
|
{
|
|
10108
10078
|
inputs: [
|
|
@@ -11891,7 +11861,7 @@ const FlaunchPositionManagerV1_1Abi = [
|
|
|
11891
11861
|
];
|
|
11892
11862
|
|
|
11893
11863
|
class ReadFlaunchPositionManagerV1_1 {
|
|
11894
|
-
constructor(address, drift = createDrift()) {
|
|
11864
|
+
constructor(address, drift = createDrift$1()) {
|
|
11895
11865
|
this.TOTAL_SUPPLY = 100n * 10n ** 27n; // 100 Billion tokens in wei
|
|
11896
11866
|
this.drift = drift;
|
|
11897
11867
|
if (!address) {
|
|
@@ -12114,7 +12084,7 @@ class ReadFlaunchPositionManagerV1_1 {
|
|
|
12114
12084
|
}
|
|
12115
12085
|
}
|
|
12116
12086
|
class ReadWriteFlaunchPositionManagerV1_1 extends ReadFlaunchPositionManagerV1_1 {
|
|
12117
|
-
constructor(address, drift = createDrift()) {
|
|
12087
|
+
constructor(address, drift = createDrift$1()) {
|
|
12118
12088
|
super(address, drift);
|
|
12119
12089
|
}
|
|
12120
12090
|
/**
|
|
@@ -12197,7 +12167,7 @@ class ReadFlaunchZap {
|
|
|
12197
12167
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
12198
12168
|
* @throws Error if address is not provided
|
|
12199
12169
|
*/
|
|
12200
|
-
constructor(chainId, address, drift = createDrift()) {
|
|
12170
|
+
constructor(chainId, address, drift = createDrift$1()) {
|
|
12201
12171
|
this.TOTAL_SUPPLY = 100n * 10n ** 27n; // 100 Billion tokens in wei
|
|
12202
12172
|
this.chainId = chainId;
|
|
12203
12173
|
this.drift = drift;
|
|
@@ -12242,7 +12212,7 @@ class ReadFlaunchZap {
|
|
|
12242
12212
|
* Extended client for interacting with the FlaunchZap contract with write capabilities
|
|
12243
12213
|
*/
|
|
12244
12214
|
class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
12245
|
-
constructor(chainId, address, drift = createDrift()) {
|
|
12215
|
+
constructor(chainId, address, drift = createDrift$1()) {
|
|
12246
12216
|
super(chainId, address, drift);
|
|
12247
12217
|
}
|
|
12248
12218
|
/**
|
|
@@ -12284,7 +12254,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
|
12284
12254
|
depositData: "0x",
|
|
12285
12255
|
},
|
|
12286
12256
|
_whitelistParams: {
|
|
12287
|
-
merkleRoot:
|
|
12257
|
+
merkleRoot: zeroHash,
|
|
12288
12258
|
merkleIPFSHash: "",
|
|
12289
12259
|
maxTokens: 0n,
|
|
12290
12260
|
},
|
|
@@ -12292,7 +12262,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
|
12292
12262
|
airdropIndex: 0n,
|
|
12293
12263
|
airdropAmount: 0n,
|
|
12294
12264
|
airdropEndTime: 0n,
|
|
12295
|
-
merkleRoot:
|
|
12265
|
+
merkleRoot: zeroHash,
|
|
12296
12266
|
merkleIPFSHash: "",
|
|
12297
12267
|
},
|
|
12298
12268
|
}, {
|
|
@@ -12360,7 +12330,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
|
12360
12330
|
depositData: "0x",
|
|
12361
12331
|
},
|
|
12362
12332
|
_whitelistParams: {
|
|
12363
|
-
merkleRoot:
|
|
12333
|
+
merkleRoot: zeroHash,
|
|
12364
12334
|
merkleIPFSHash: "",
|
|
12365
12335
|
maxTokens: 0n,
|
|
12366
12336
|
},
|
|
@@ -12368,7 +12338,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
|
12368
12338
|
airdropIndex: 0n,
|
|
12369
12339
|
airdropAmount: 0n,
|
|
12370
12340
|
airdropEndTime: 0n,
|
|
12371
|
-
merkleRoot:
|
|
12341
|
+
merkleRoot: zeroHash,
|
|
12372
12342
|
merkleIPFSHash: "",
|
|
12373
12343
|
},
|
|
12374
12344
|
}, {
|
|
@@ -12999,7 +12969,7 @@ class ReadFlaunch {
|
|
|
12999
12969
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
13000
12970
|
* @throws Error if address is not provided
|
|
13001
12971
|
*/
|
|
13002
|
-
constructor(address, drift = createDrift()) {
|
|
12972
|
+
constructor(address, drift = createDrift$1()) {
|
|
13003
12973
|
if (!address) {
|
|
13004
12974
|
throw new Error("Address is required");
|
|
13005
12975
|
}
|
|
@@ -13543,7 +13513,7 @@ class ReadMemecoin {
|
|
|
13543
13513
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
13544
13514
|
* @throws Error if address is not provided
|
|
13545
13515
|
*/
|
|
13546
|
-
constructor(address, drift = createDrift()) {
|
|
13516
|
+
constructor(address, drift = createDrift$1()) {
|
|
13547
13517
|
if (!address) {
|
|
13548
13518
|
throw new Error("Address is required");
|
|
13549
13519
|
}
|
|
@@ -13573,6 +13543,13 @@ class ReadMemecoin {
|
|
|
13573
13543
|
tokenURI() {
|
|
13574
13544
|
return this.contract.read("tokenURI");
|
|
13575
13545
|
}
|
|
13546
|
+
/**
|
|
13547
|
+
* Gets the total supply of the token
|
|
13548
|
+
* @returns Promise<bigint> - The total supply
|
|
13549
|
+
*/
|
|
13550
|
+
totalSupply() {
|
|
13551
|
+
return this.contract.read("totalSupply");
|
|
13552
|
+
}
|
|
13576
13553
|
/**
|
|
13577
13554
|
* Gets the token balance of a specific user
|
|
13578
13555
|
* @param user - The address of the user to check
|
|
@@ -13941,7 +13918,7 @@ class ReadQuoter {
|
|
|
13941
13918
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
13942
13919
|
* @throws Error if address is not provided
|
|
13943
13920
|
*/
|
|
13944
|
-
constructor(chainId, address, drift = createDrift()) {
|
|
13921
|
+
constructor(chainId, address, drift = createDrift$1()) {
|
|
13945
13922
|
this.chainId = chainId;
|
|
13946
13923
|
if (!address) {
|
|
13947
13924
|
throw new Error("Address is required");
|
|
@@ -13955,10 +13932,10 @@ class ReadQuoter {
|
|
|
13955
13932
|
* Gets a quote for selling an exact amount of tokens for ETH
|
|
13956
13933
|
* @param coinAddress - The address of the token to sell
|
|
13957
13934
|
* @param amountIn - The exact amount of tokens to sell
|
|
13958
|
-
* @param
|
|
13935
|
+
* @param positionManagerAddress - The address of the position manager to use
|
|
13959
13936
|
* @returns Promise<bigint> - The expected amount of ETH to receive
|
|
13960
13937
|
*/
|
|
13961
|
-
async getSellQuoteExactInput(coinAddress, amountIn,
|
|
13938
|
+
async getSellQuoteExactInput(coinAddress, amountIn, positionManagerAddress) {
|
|
13962
13939
|
const res = await this.contract.simulateWrite("quoteExactInput", {
|
|
13963
13940
|
params: {
|
|
13964
13941
|
exactAmount: amountIn,
|
|
@@ -13967,9 +13944,7 @@ class ReadQuoter {
|
|
|
13967
13944
|
{
|
|
13968
13945
|
fee: 0,
|
|
13969
13946
|
tickSpacing: 60,
|
|
13970
|
-
hooks:
|
|
13971
|
-
? FlaunchPositionManagerAddress[this.chainId]
|
|
13972
|
-
: FlaunchPositionManagerV1_1Address[this.chainId],
|
|
13947
|
+
hooks: positionManagerAddress,
|
|
13973
13948
|
hookData: "0x",
|
|
13974
13949
|
intermediateCurrency: FLETHAddress[this.chainId],
|
|
13975
13950
|
},
|
|
@@ -13989,10 +13964,10 @@ class ReadQuoter {
|
|
|
13989
13964
|
* Gets a quote for buying tokens with an exact amount of ETH
|
|
13990
13965
|
* @param coinAddress - The address of the token to buy
|
|
13991
13966
|
* @param ethIn - The exact amount of ETH to spend
|
|
13992
|
-
* @param
|
|
13967
|
+
* @param positionManagerAddress - The address of the position manager to use
|
|
13993
13968
|
* @returns Promise<bigint> - The expected amount of tokens to receive
|
|
13994
13969
|
*/
|
|
13995
|
-
async getBuyQuoteExactInput(coinAddress, ethIn,
|
|
13970
|
+
async getBuyQuoteExactInput(coinAddress, ethIn, positionManagerAddress) {
|
|
13996
13971
|
const res = await this.contract.simulateWrite("quoteExactInput", {
|
|
13997
13972
|
params: {
|
|
13998
13973
|
exactAmount: ethIn,
|
|
@@ -14008,9 +13983,7 @@ class ReadQuoter {
|
|
|
14008
13983
|
{
|
|
14009
13984
|
fee: 0,
|
|
14010
13985
|
tickSpacing: 60,
|
|
14011
|
-
hooks:
|
|
14012
|
-
? FlaunchPositionManagerAddress[this.chainId]
|
|
14013
|
-
: FlaunchPositionManagerV1_1Address[this.chainId],
|
|
13986
|
+
hooks: positionManagerAddress,
|
|
14014
13987
|
hookData: "0x",
|
|
14015
13988
|
intermediateCurrency: coinAddress,
|
|
14016
13989
|
},
|
|
@@ -14023,10 +13996,10 @@ class ReadQuoter {
|
|
|
14023
13996
|
* Gets a quote for buying an exact amount of tokens with ETH
|
|
14024
13997
|
* @param coinAddress - The address of the token to buy
|
|
14025
13998
|
* @param coinOut - The exact amount of tokens to receive
|
|
14026
|
-
* @param
|
|
13999
|
+
* @param positionManagerAddress - The address of the position manager to use
|
|
14027
14000
|
* @returns Promise<bigint> - The required amount of ETH to spend
|
|
14028
14001
|
*/
|
|
14029
|
-
async getBuyQuoteExactOutput(coinAddress, coinOut,
|
|
14002
|
+
async getBuyQuoteExactOutput(coinAddress, coinOut, positionManagerAddress) {
|
|
14030
14003
|
const res = await this.contract.simulateWrite("quoteExactOutput", {
|
|
14031
14004
|
params: {
|
|
14032
14005
|
path: [
|
|
@@ -14041,9 +14014,7 @@ class ReadQuoter {
|
|
|
14041
14014
|
intermediateCurrency: FLETHAddress[this.chainId],
|
|
14042
14015
|
fee: 0,
|
|
14043
14016
|
tickSpacing: 60,
|
|
14044
|
-
hooks:
|
|
14045
|
-
? FlaunchPositionManagerAddress[this.chainId]
|
|
14046
|
-
: FlaunchPositionManagerV1_1Address[this.chainId],
|
|
14017
|
+
hooks: positionManagerAddress,
|
|
14047
14018
|
hookData: "0x",
|
|
14048
14019
|
},
|
|
14049
14020
|
],
|
|
@@ -14608,7 +14579,7 @@ class ReadPermit2 {
|
|
|
14608
14579
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
14609
14580
|
* @throws Error if address is not provided
|
|
14610
14581
|
*/
|
|
14611
|
-
constructor(address, drift = createDrift()) {
|
|
14582
|
+
constructor(address, drift = createDrift$1()) {
|
|
14612
14583
|
if (!address) {
|
|
14613
14584
|
throw new Error("Address is required");
|
|
14614
14585
|
}
|
|
@@ -14633,7 +14604,7 @@ class ReadPermit2 {
|
|
|
14633
14604
|
}
|
|
14634
14605
|
}
|
|
14635
14606
|
class ReadWritePermit2 extends ReadPermit2 {
|
|
14636
|
-
constructor(address, drift = createDrift()) {
|
|
14607
|
+
constructor(address, drift = createDrift$1()) {
|
|
14637
14608
|
super(address, drift);
|
|
14638
14609
|
}
|
|
14639
14610
|
/**
|
|
@@ -14646,27 +14617,2339 @@ class ReadWritePermit2 extends ReadPermit2 {
|
|
|
14646
14617
|
}
|
|
14647
14618
|
}
|
|
14648
14619
|
|
|
14649
|
-
const
|
|
14620
|
+
const AnyPositionManagerAbi = [
|
|
14650
14621
|
{
|
|
14651
14622
|
inputs: [
|
|
14652
|
-
{
|
|
14653
|
-
|
|
14654
|
-
|
|
14623
|
+
{
|
|
14624
|
+
components: [
|
|
14625
|
+
{ internalType: "address", name: "nativeToken", type: "address" },
|
|
14626
|
+
{
|
|
14627
|
+
internalType: "contract IPoolManager",
|
|
14628
|
+
name: "poolManager",
|
|
14629
|
+
type: "address",
|
|
14630
|
+
},
|
|
14631
|
+
{
|
|
14632
|
+
components: [
|
|
14633
|
+
{ internalType: "uint24", name: "swapFee", type: "uint24" },
|
|
14634
|
+
{ internalType: "uint24", name: "referrer", type: "uint24" },
|
|
14635
|
+
{ internalType: "uint24", name: "protocol", type: "uint24" },
|
|
14636
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
14637
|
+
],
|
|
14638
|
+
internalType: "struct FeeDistributor.FeeDistribution",
|
|
14639
|
+
name: "feeDistribution",
|
|
14640
|
+
type: "tuple",
|
|
14641
|
+
},
|
|
14642
|
+
{
|
|
14643
|
+
internalType: "contract IInitialPrice",
|
|
14644
|
+
name: "initialPrice",
|
|
14645
|
+
type: "address",
|
|
14646
|
+
},
|
|
14647
|
+
{ internalType: "address", name: "protocolOwner", type: "address" },
|
|
14648
|
+
{
|
|
14649
|
+
internalType: "address",
|
|
14650
|
+
name: "protocolFeeRecipient",
|
|
14651
|
+
type: "address",
|
|
14652
|
+
},
|
|
14653
|
+
{ internalType: "address", name: "flayGovernance", type: "address" },
|
|
14654
|
+
{ internalType: "address", name: "feeEscrow", type: "address" },
|
|
14655
|
+
{
|
|
14656
|
+
internalType: "contract FeeExemptions",
|
|
14657
|
+
name: "feeExemptions",
|
|
14658
|
+
type: "address",
|
|
14659
|
+
},
|
|
14660
|
+
{
|
|
14661
|
+
internalType: "contract TreasuryActionManager",
|
|
14662
|
+
name: "actionManager",
|
|
14663
|
+
type: "address",
|
|
14664
|
+
},
|
|
14665
|
+
{ internalType: "address", name: "bidWall", type: "address" },
|
|
14666
|
+
],
|
|
14667
|
+
internalType: "struct AnyPositionManager.ConstructorParams",
|
|
14668
|
+
name: "params",
|
|
14669
|
+
type: "tuple",
|
|
14670
|
+
},
|
|
14655
14671
|
],
|
|
14656
14672
|
stateMutability: "nonpayable",
|
|
14657
14673
|
type: "constructor",
|
|
14658
14674
|
},
|
|
14659
|
-
{ inputs: [], name: "
|
|
14675
|
+
{ inputs: [], name: "AlreadyFlaunched", type: "error" },
|
|
14676
|
+
{ inputs: [], name: "AlreadyInitialized", type: "error" },
|
|
14677
|
+
{ inputs: [], name: "CallerIsNotBidWall", type: "error" },
|
|
14678
|
+
{ inputs: [], name: "CallerIsNotCreator", type: "error" },
|
|
14660
14679
|
{
|
|
14661
|
-
inputs: [
|
|
14662
|
-
|
|
14663
|
-
{ internalType: "bytes32", name: "neededRole", type: "bytes32" },
|
|
14664
|
-
],
|
|
14665
|
-
name: "AccessControlUnauthorizedAccount",
|
|
14680
|
+
inputs: [{ internalType: "address", name: "_caller", type: "address" }],
|
|
14681
|
+
name: "CallerNotCreator",
|
|
14666
14682
|
type: "error",
|
|
14667
14683
|
},
|
|
14668
|
-
{ inputs: [], name: "
|
|
14669
|
-
{ inputs: [], name: "
|
|
14684
|
+
{ inputs: [], name: "CannotBeInitializedDirectly", type: "error" },
|
|
14685
|
+
{ inputs: [], name: "HookNotImplemented", type: "error" },
|
|
14686
|
+
{ inputs: [], name: "InvalidPool", type: "error" },
|
|
14687
|
+
{ inputs: [], name: "LockFailure", type: "error" },
|
|
14688
|
+
{ inputs: [], name: "NewOwnerIsZeroAddress", type: "error" },
|
|
14689
|
+
{ inputs: [], name: "NoHandoverRequest", type: "error" },
|
|
14690
|
+
{ inputs: [], name: "NotPoolManager", type: "error" },
|
|
14691
|
+
{ inputs: [], name: "NotSelf", type: "error" },
|
|
14692
|
+
{ inputs: [], name: "ProtocolFeeInvalid", type: "error" },
|
|
14693
|
+
{ inputs: [], name: "RecipientZeroAddress", type: "error" },
|
|
14694
|
+
{ inputs: [], name: "ReferrerFeeInvalid", type: "error" },
|
|
14695
|
+
{ inputs: [], name: "SwapFeeInvalid", type: "error" },
|
|
14696
|
+
{ inputs: [], name: "Unauthorized", type: "error" },
|
|
14697
|
+
{
|
|
14698
|
+
inputs: [{ internalType: "PoolId", name: "_poolId", type: "bytes32" }],
|
|
14699
|
+
name: "UnknownPool",
|
|
14700
|
+
type: "error",
|
|
14701
|
+
},
|
|
14702
|
+
{
|
|
14703
|
+
anonymous: false,
|
|
14704
|
+
inputs: [
|
|
14705
|
+
{
|
|
14706
|
+
indexed: true,
|
|
14707
|
+
internalType: "PoolId",
|
|
14708
|
+
name: "_poolId",
|
|
14709
|
+
type: "bytes32",
|
|
14710
|
+
},
|
|
14711
|
+
{
|
|
14712
|
+
indexed: false,
|
|
14713
|
+
internalType: "uint24",
|
|
14714
|
+
name: "_allocation",
|
|
14715
|
+
type: "uint24",
|
|
14716
|
+
},
|
|
14717
|
+
],
|
|
14718
|
+
name: "CreatorFeeAllocationUpdated",
|
|
14719
|
+
type: "event",
|
|
14720
|
+
},
|
|
14721
|
+
{
|
|
14722
|
+
anonymous: false,
|
|
14723
|
+
inputs: [
|
|
14724
|
+
{
|
|
14725
|
+
indexed: false,
|
|
14726
|
+
internalType: "address",
|
|
14727
|
+
name: "_feeCalculator",
|
|
14728
|
+
type: "address",
|
|
14729
|
+
},
|
|
14730
|
+
],
|
|
14731
|
+
name: "FairLaunchFeeCalculatorUpdated",
|
|
14732
|
+
type: "event",
|
|
14733
|
+
},
|
|
14734
|
+
{
|
|
14735
|
+
anonymous: false,
|
|
14736
|
+
inputs: [
|
|
14737
|
+
{
|
|
14738
|
+
indexed: false,
|
|
14739
|
+
internalType: "address",
|
|
14740
|
+
name: "_feeCalculator",
|
|
14741
|
+
type: "address",
|
|
14742
|
+
},
|
|
14743
|
+
],
|
|
14744
|
+
name: "FeeCalculatorUpdated",
|
|
14745
|
+
type: "event",
|
|
14746
|
+
},
|
|
14747
|
+
{
|
|
14748
|
+
anonymous: false,
|
|
14749
|
+
inputs: [
|
|
14750
|
+
{
|
|
14751
|
+
components: [
|
|
14752
|
+
{ internalType: "uint24", name: "swapFee", type: "uint24" },
|
|
14753
|
+
{ internalType: "uint24", name: "referrer", type: "uint24" },
|
|
14754
|
+
{ internalType: "uint24", name: "protocol", type: "uint24" },
|
|
14755
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
14756
|
+
],
|
|
14757
|
+
indexed: false,
|
|
14758
|
+
internalType: "struct FeeDistributor.FeeDistribution",
|
|
14759
|
+
name: "_feeDistribution",
|
|
14760
|
+
type: "tuple",
|
|
14761
|
+
},
|
|
14762
|
+
],
|
|
14763
|
+
name: "FeeDistributionUpdated",
|
|
14764
|
+
type: "event",
|
|
14765
|
+
},
|
|
14766
|
+
{
|
|
14767
|
+
anonymous: false,
|
|
14768
|
+
inputs: [
|
|
14769
|
+
{ indexed: true, internalType: "bytes32", name: "id", type: "bytes32" },
|
|
14770
|
+
{
|
|
14771
|
+
indexed: true,
|
|
14772
|
+
internalType: "address",
|
|
14773
|
+
name: "sender",
|
|
14774
|
+
type: "address",
|
|
14775
|
+
},
|
|
14776
|
+
{
|
|
14777
|
+
indexed: false,
|
|
14778
|
+
internalType: "uint128",
|
|
14779
|
+
name: "feeAmount0",
|
|
14780
|
+
type: "uint128",
|
|
14781
|
+
},
|
|
14782
|
+
{
|
|
14783
|
+
indexed: false,
|
|
14784
|
+
internalType: "uint128",
|
|
14785
|
+
name: "feeAmount1",
|
|
14786
|
+
type: "uint128",
|
|
14787
|
+
},
|
|
14788
|
+
],
|
|
14789
|
+
name: "HookFee",
|
|
14790
|
+
type: "event",
|
|
14791
|
+
},
|
|
14792
|
+
{
|
|
14793
|
+
anonymous: false,
|
|
14794
|
+
inputs: [
|
|
14795
|
+
{ indexed: true, internalType: "bytes32", name: "id", type: "bytes32" },
|
|
14796
|
+
{
|
|
14797
|
+
indexed: true,
|
|
14798
|
+
internalType: "address",
|
|
14799
|
+
name: "sender",
|
|
14800
|
+
type: "address",
|
|
14801
|
+
},
|
|
14802
|
+
{
|
|
14803
|
+
indexed: false,
|
|
14804
|
+
internalType: "int128",
|
|
14805
|
+
name: "amount0",
|
|
14806
|
+
type: "int128",
|
|
14807
|
+
},
|
|
14808
|
+
{
|
|
14809
|
+
indexed: false,
|
|
14810
|
+
internalType: "int128",
|
|
14811
|
+
name: "amount1",
|
|
14812
|
+
type: "int128",
|
|
14813
|
+
},
|
|
14814
|
+
{
|
|
14815
|
+
indexed: false,
|
|
14816
|
+
internalType: "uint128",
|
|
14817
|
+
name: "hookLPfeeAmount0",
|
|
14818
|
+
type: "uint128",
|
|
14819
|
+
},
|
|
14820
|
+
{
|
|
14821
|
+
indexed: false,
|
|
14822
|
+
internalType: "uint128",
|
|
14823
|
+
name: "hookLPfeeAmount1",
|
|
14824
|
+
type: "uint128",
|
|
14825
|
+
},
|
|
14826
|
+
],
|
|
14827
|
+
name: "HookSwap",
|
|
14828
|
+
type: "event",
|
|
14829
|
+
},
|
|
14830
|
+
{
|
|
14831
|
+
anonymous: false,
|
|
14832
|
+
inputs: [
|
|
14833
|
+
{
|
|
14834
|
+
indexed: false,
|
|
14835
|
+
internalType: "address",
|
|
14836
|
+
name: "_initialPrice",
|
|
14837
|
+
type: "address",
|
|
14838
|
+
},
|
|
14839
|
+
],
|
|
14840
|
+
name: "InitialPriceUpdated",
|
|
14841
|
+
type: "event",
|
|
14842
|
+
},
|
|
14843
|
+
{
|
|
14844
|
+
anonymous: false,
|
|
14845
|
+
inputs: [
|
|
14846
|
+
{
|
|
14847
|
+
indexed: false,
|
|
14848
|
+
internalType: "address",
|
|
14849
|
+
name: "_memecoin",
|
|
14850
|
+
type: "address",
|
|
14851
|
+
},
|
|
14852
|
+
{
|
|
14853
|
+
indexed: false,
|
|
14854
|
+
internalType: "address",
|
|
14855
|
+
name: "_creator",
|
|
14856
|
+
type: "address",
|
|
14857
|
+
},
|
|
14858
|
+
],
|
|
14859
|
+
name: "MemecoinApproved",
|
|
14860
|
+
type: "event",
|
|
14861
|
+
},
|
|
14862
|
+
{
|
|
14863
|
+
anonymous: false,
|
|
14864
|
+
inputs: [
|
|
14865
|
+
{
|
|
14866
|
+
indexed: true,
|
|
14867
|
+
internalType: "address",
|
|
14868
|
+
name: "pendingOwner",
|
|
14869
|
+
type: "address",
|
|
14870
|
+
},
|
|
14871
|
+
],
|
|
14872
|
+
name: "OwnershipHandoverCanceled",
|
|
14873
|
+
type: "event",
|
|
14874
|
+
},
|
|
14875
|
+
{
|
|
14876
|
+
anonymous: false,
|
|
14877
|
+
inputs: [
|
|
14878
|
+
{
|
|
14879
|
+
indexed: true,
|
|
14880
|
+
internalType: "address",
|
|
14881
|
+
name: "pendingOwner",
|
|
14882
|
+
type: "address",
|
|
14883
|
+
},
|
|
14884
|
+
],
|
|
14885
|
+
name: "OwnershipHandoverRequested",
|
|
14886
|
+
type: "event",
|
|
14887
|
+
},
|
|
14888
|
+
{
|
|
14889
|
+
anonymous: false,
|
|
14890
|
+
inputs: [
|
|
14891
|
+
{
|
|
14892
|
+
indexed: true,
|
|
14893
|
+
internalType: "address",
|
|
14894
|
+
name: "oldOwner",
|
|
14895
|
+
type: "address",
|
|
14896
|
+
},
|
|
14897
|
+
{
|
|
14898
|
+
indexed: true,
|
|
14899
|
+
internalType: "address",
|
|
14900
|
+
name: "newOwner",
|
|
14901
|
+
type: "address",
|
|
14902
|
+
},
|
|
14903
|
+
],
|
|
14904
|
+
name: "OwnershipTransferred",
|
|
14905
|
+
type: "event",
|
|
14906
|
+
},
|
|
14907
|
+
{
|
|
14908
|
+
anonymous: false,
|
|
14909
|
+
inputs: [
|
|
14910
|
+
{
|
|
14911
|
+
indexed: true,
|
|
14912
|
+
internalType: "PoolId",
|
|
14913
|
+
name: "_poolId",
|
|
14914
|
+
type: "bytes32",
|
|
14915
|
+
},
|
|
14916
|
+
{
|
|
14917
|
+
indexed: false,
|
|
14918
|
+
internalType: "address",
|
|
14919
|
+
name: "_memecoin",
|
|
14920
|
+
type: "address",
|
|
14921
|
+
},
|
|
14922
|
+
{
|
|
14923
|
+
indexed: false,
|
|
14924
|
+
internalType: "address",
|
|
14925
|
+
name: "_memecoinTreasury",
|
|
14926
|
+
type: "address",
|
|
14927
|
+
},
|
|
14928
|
+
{
|
|
14929
|
+
indexed: false,
|
|
14930
|
+
internalType: "uint256",
|
|
14931
|
+
name: "_tokenId",
|
|
14932
|
+
type: "uint256",
|
|
14933
|
+
},
|
|
14934
|
+
{
|
|
14935
|
+
indexed: false,
|
|
14936
|
+
internalType: "bool",
|
|
14937
|
+
name: "_currencyFlipped",
|
|
14938
|
+
type: "bool",
|
|
14939
|
+
},
|
|
14940
|
+
{
|
|
14941
|
+
components: [
|
|
14942
|
+
{ internalType: "address", name: "memecoin", type: "address" },
|
|
14943
|
+
{ internalType: "address", name: "creator", type: "address" },
|
|
14944
|
+
{
|
|
14945
|
+
internalType: "uint24",
|
|
14946
|
+
name: "creatorFeeAllocation",
|
|
14947
|
+
type: "uint24",
|
|
14948
|
+
},
|
|
14949
|
+
{ internalType: "bytes", name: "initialPriceParams", type: "bytes" },
|
|
14950
|
+
{ internalType: "bytes", name: "feeCalculatorParams", type: "bytes" },
|
|
14951
|
+
],
|
|
14952
|
+
indexed: false,
|
|
14953
|
+
internalType: "struct AnyPositionManager.FlaunchParams",
|
|
14954
|
+
name: "_params",
|
|
14955
|
+
type: "tuple",
|
|
14956
|
+
},
|
|
14957
|
+
],
|
|
14958
|
+
name: "PoolCreated",
|
|
14959
|
+
type: "event",
|
|
14960
|
+
},
|
|
14961
|
+
{
|
|
14962
|
+
anonymous: false,
|
|
14963
|
+
inputs: [
|
|
14964
|
+
{
|
|
14965
|
+
indexed: true,
|
|
14966
|
+
internalType: "PoolId",
|
|
14967
|
+
name: "_poolId",
|
|
14968
|
+
type: "bytes32",
|
|
14969
|
+
},
|
|
14970
|
+
{
|
|
14971
|
+
components: [
|
|
14972
|
+
{ internalType: "uint24", name: "swapFee", type: "uint24" },
|
|
14973
|
+
{ internalType: "uint24", name: "referrer", type: "uint24" },
|
|
14974
|
+
{ internalType: "uint24", name: "protocol", type: "uint24" },
|
|
14975
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
14976
|
+
],
|
|
14977
|
+
indexed: false,
|
|
14978
|
+
internalType: "struct FeeDistributor.FeeDistribution",
|
|
14979
|
+
name: "_feeDistribution",
|
|
14980
|
+
type: "tuple",
|
|
14981
|
+
},
|
|
14982
|
+
],
|
|
14983
|
+
name: "PoolFeeDistributionUpdated",
|
|
14984
|
+
type: "event",
|
|
14985
|
+
},
|
|
14986
|
+
{
|
|
14987
|
+
anonymous: false,
|
|
14988
|
+
inputs: [
|
|
14989
|
+
{
|
|
14990
|
+
indexed: true,
|
|
14991
|
+
internalType: "PoolId",
|
|
14992
|
+
name: "_poolId",
|
|
14993
|
+
type: "bytes32",
|
|
14994
|
+
},
|
|
14995
|
+
{
|
|
14996
|
+
indexed: false,
|
|
14997
|
+
internalType: "uint256",
|
|
14998
|
+
name: "_donateAmount",
|
|
14999
|
+
type: "uint256",
|
|
15000
|
+
},
|
|
15001
|
+
{
|
|
15002
|
+
indexed: false,
|
|
15003
|
+
internalType: "uint256",
|
|
15004
|
+
name: "_creatorAmount",
|
|
15005
|
+
type: "uint256",
|
|
15006
|
+
},
|
|
15007
|
+
{
|
|
15008
|
+
indexed: false,
|
|
15009
|
+
internalType: "uint256",
|
|
15010
|
+
name: "_bidWallAmount",
|
|
15011
|
+
type: "uint256",
|
|
15012
|
+
},
|
|
15013
|
+
{
|
|
15014
|
+
indexed: false,
|
|
15015
|
+
internalType: "uint256",
|
|
15016
|
+
name: "_governanceAmount",
|
|
15017
|
+
type: "uint256",
|
|
15018
|
+
},
|
|
15019
|
+
{
|
|
15020
|
+
indexed: false,
|
|
15021
|
+
internalType: "uint256",
|
|
15022
|
+
name: "_protocolAmount",
|
|
15023
|
+
type: "uint256",
|
|
15024
|
+
},
|
|
15025
|
+
],
|
|
15026
|
+
name: "PoolFeesDistributed",
|
|
15027
|
+
type: "event",
|
|
15028
|
+
},
|
|
15029
|
+
{
|
|
15030
|
+
anonymous: false,
|
|
15031
|
+
inputs: [
|
|
15032
|
+
{
|
|
15033
|
+
indexed: true,
|
|
15034
|
+
internalType: "PoolId",
|
|
15035
|
+
name: "_poolId",
|
|
15036
|
+
type: "bytes32",
|
|
15037
|
+
},
|
|
15038
|
+
{
|
|
15039
|
+
indexed: false,
|
|
15040
|
+
internalType: "uint256",
|
|
15041
|
+
name: "_amount0",
|
|
15042
|
+
type: "uint256",
|
|
15043
|
+
},
|
|
15044
|
+
{
|
|
15045
|
+
indexed: false,
|
|
15046
|
+
internalType: "uint256",
|
|
15047
|
+
name: "_amount1",
|
|
15048
|
+
type: "uint256",
|
|
15049
|
+
},
|
|
15050
|
+
],
|
|
15051
|
+
name: "PoolFeesReceived",
|
|
15052
|
+
type: "event",
|
|
15053
|
+
},
|
|
15054
|
+
{
|
|
15055
|
+
anonymous: false,
|
|
15056
|
+
inputs: [
|
|
15057
|
+
{
|
|
15058
|
+
indexed: true,
|
|
15059
|
+
internalType: "PoolId",
|
|
15060
|
+
name: "_poolId",
|
|
15061
|
+
type: "bytes32",
|
|
15062
|
+
},
|
|
15063
|
+
{
|
|
15064
|
+
indexed: false,
|
|
15065
|
+
internalType: "bool",
|
|
15066
|
+
name: "zeroForOne",
|
|
15067
|
+
type: "bool",
|
|
15068
|
+
},
|
|
15069
|
+
{
|
|
15070
|
+
indexed: false,
|
|
15071
|
+
internalType: "uint256",
|
|
15072
|
+
name: "_amount0",
|
|
15073
|
+
type: "uint256",
|
|
15074
|
+
},
|
|
15075
|
+
{
|
|
15076
|
+
indexed: false,
|
|
15077
|
+
internalType: "uint256",
|
|
15078
|
+
name: "_amount1",
|
|
15079
|
+
type: "uint256",
|
|
15080
|
+
},
|
|
15081
|
+
],
|
|
15082
|
+
name: "PoolFeesSwapped",
|
|
15083
|
+
type: "event",
|
|
15084
|
+
},
|
|
15085
|
+
{
|
|
15086
|
+
anonymous: false,
|
|
15087
|
+
inputs: [
|
|
15088
|
+
{
|
|
15089
|
+
indexed: true,
|
|
15090
|
+
internalType: "PoolId",
|
|
15091
|
+
name: "_poolId",
|
|
15092
|
+
type: "bytes32",
|
|
15093
|
+
},
|
|
15094
|
+
{
|
|
15095
|
+
indexed: false,
|
|
15096
|
+
internalType: "uint160",
|
|
15097
|
+
name: "_sqrtPriceX96",
|
|
15098
|
+
type: "uint160",
|
|
15099
|
+
},
|
|
15100
|
+
{ indexed: false, internalType: "int24", name: "_tick", type: "int24" },
|
|
15101
|
+
{
|
|
15102
|
+
indexed: false,
|
|
15103
|
+
internalType: "uint24",
|
|
15104
|
+
name: "_protocolFee",
|
|
15105
|
+
type: "uint24",
|
|
15106
|
+
},
|
|
15107
|
+
{
|
|
15108
|
+
indexed: false,
|
|
15109
|
+
internalType: "uint24",
|
|
15110
|
+
name: "_swapFee",
|
|
15111
|
+
type: "uint24",
|
|
15112
|
+
},
|
|
15113
|
+
{
|
|
15114
|
+
indexed: false,
|
|
15115
|
+
internalType: "uint128",
|
|
15116
|
+
name: "_liquidity",
|
|
15117
|
+
type: "uint128",
|
|
15118
|
+
},
|
|
15119
|
+
],
|
|
15120
|
+
name: "PoolStateUpdated",
|
|
15121
|
+
type: "event",
|
|
15122
|
+
},
|
|
15123
|
+
{
|
|
15124
|
+
anonymous: false,
|
|
15125
|
+
inputs: [
|
|
15126
|
+
{
|
|
15127
|
+
indexed: true,
|
|
15128
|
+
internalType: "PoolId",
|
|
15129
|
+
name: "poolId",
|
|
15130
|
+
type: "bytes32",
|
|
15131
|
+
},
|
|
15132
|
+
{
|
|
15133
|
+
indexed: false,
|
|
15134
|
+
internalType: "int256",
|
|
15135
|
+
name: "flAmount0",
|
|
15136
|
+
type: "int256",
|
|
15137
|
+
},
|
|
15138
|
+
{
|
|
15139
|
+
indexed: false,
|
|
15140
|
+
internalType: "int256",
|
|
15141
|
+
name: "flAmount1",
|
|
15142
|
+
type: "int256",
|
|
15143
|
+
},
|
|
15144
|
+
{
|
|
15145
|
+
indexed: false,
|
|
15146
|
+
internalType: "int256",
|
|
15147
|
+
name: "flFee0",
|
|
15148
|
+
type: "int256",
|
|
15149
|
+
},
|
|
15150
|
+
{
|
|
15151
|
+
indexed: false,
|
|
15152
|
+
internalType: "int256",
|
|
15153
|
+
name: "flFee1",
|
|
15154
|
+
type: "int256",
|
|
15155
|
+
},
|
|
15156
|
+
{
|
|
15157
|
+
indexed: false,
|
|
15158
|
+
internalType: "int256",
|
|
15159
|
+
name: "ispAmount0",
|
|
15160
|
+
type: "int256",
|
|
15161
|
+
},
|
|
15162
|
+
{
|
|
15163
|
+
indexed: false,
|
|
15164
|
+
internalType: "int256",
|
|
15165
|
+
name: "ispAmount1",
|
|
15166
|
+
type: "int256",
|
|
15167
|
+
},
|
|
15168
|
+
{
|
|
15169
|
+
indexed: false,
|
|
15170
|
+
internalType: "int256",
|
|
15171
|
+
name: "ispFee0",
|
|
15172
|
+
type: "int256",
|
|
15173
|
+
},
|
|
15174
|
+
{
|
|
15175
|
+
indexed: false,
|
|
15176
|
+
internalType: "int256",
|
|
15177
|
+
name: "ispFee1",
|
|
15178
|
+
type: "int256",
|
|
15179
|
+
},
|
|
15180
|
+
{
|
|
15181
|
+
indexed: false,
|
|
15182
|
+
internalType: "int256",
|
|
15183
|
+
name: "uniAmount0",
|
|
15184
|
+
type: "int256",
|
|
15185
|
+
},
|
|
15186
|
+
{
|
|
15187
|
+
indexed: false,
|
|
15188
|
+
internalType: "int256",
|
|
15189
|
+
name: "uniAmount1",
|
|
15190
|
+
type: "int256",
|
|
15191
|
+
},
|
|
15192
|
+
{
|
|
15193
|
+
indexed: false,
|
|
15194
|
+
internalType: "int256",
|
|
15195
|
+
name: "uniFee0",
|
|
15196
|
+
type: "int256",
|
|
15197
|
+
},
|
|
15198
|
+
{
|
|
15199
|
+
indexed: false,
|
|
15200
|
+
internalType: "int256",
|
|
15201
|
+
name: "uniFee1",
|
|
15202
|
+
type: "int256",
|
|
15203
|
+
},
|
|
15204
|
+
],
|
|
15205
|
+
name: "PoolSwap",
|
|
15206
|
+
type: "event",
|
|
15207
|
+
},
|
|
15208
|
+
{
|
|
15209
|
+
anonymous: false,
|
|
15210
|
+
inputs: [
|
|
15211
|
+
{
|
|
15212
|
+
indexed: false,
|
|
15213
|
+
internalType: "address",
|
|
15214
|
+
name: "_referralEscrow",
|
|
15215
|
+
type: "address",
|
|
15216
|
+
},
|
|
15217
|
+
],
|
|
15218
|
+
name: "ReferralEscrowUpdated",
|
|
15219
|
+
type: "event",
|
|
15220
|
+
},
|
|
15221
|
+
{
|
|
15222
|
+
anonymous: false,
|
|
15223
|
+
inputs: [
|
|
15224
|
+
{
|
|
15225
|
+
indexed: true,
|
|
15226
|
+
internalType: "PoolId",
|
|
15227
|
+
name: "_poolId",
|
|
15228
|
+
type: "bytes32",
|
|
15229
|
+
},
|
|
15230
|
+
{
|
|
15231
|
+
indexed: false,
|
|
15232
|
+
internalType: "address",
|
|
15233
|
+
name: "_recipient",
|
|
15234
|
+
type: "address",
|
|
15235
|
+
},
|
|
15236
|
+
{
|
|
15237
|
+
indexed: false,
|
|
15238
|
+
internalType: "address",
|
|
15239
|
+
name: "_token",
|
|
15240
|
+
type: "address",
|
|
15241
|
+
},
|
|
15242
|
+
{
|
|
15243
|
+
indexed: false,
|
|
15244
|
+
internalType: "uint256",
|
|
15245
|
+
name: "_amount",
|
|
15246
|
+
type: "uint256",
|
|
15247
|
+
},
|
|
15248
|
+
],
|
|
15249
|
+
name: "ReferrerFeePaid",
|
|
15250
|
+
type: "event",
|
|
15251
|
+
},
|
|
15252
|
+
{
|
|
15253
|
+
inputs: [],
|
|
15254
|
+
name: "MAX_PROTOCOL_ALLOCATION",
|
|
15255
|
+
outputs: [{ internalType: "uint24", name: "", type: "uint24" }],
|
|
15256
|
+
stateMutability: "view",
|
|
15257
|
+
type: "function",
|
|
15258
|
+
},
|
|
15259
|
+
{
|
|
15260
|
+
inputs: [],
|
|
15261
|
+
name: "MIN_DISTRIBUTE_THRESHOLD",
|
|
15262
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
15263
|
+
stateMutability: "view",
|
|
15264
|
+
type: "function",
|
|
15265
|
+
},
|
|
15266
|
+
{
|
|
15267
|
+
inputs: [],
|
|
15268
|
+
name: "actionManager",
|
|
15269
|
+
outputs: [
|
|
15270
|
+
{
|
|
15271
|
+
internalType: "contract TreasuryActionManager",
|
|
15272
|
+
name: "",
|
|
15273
|
+
type: "address",
|
|
15274
|
+
},
|
|
15275
|
+
],
|
|
15276
|
+
stateMutability: "view",
|
|
15277
|
+
type: "function",
|
|
15278
|
+
},
|
|
15279
|
+
{
|
|
15280
|
+
inputs: [
|
|
15281
|
+
{ internalType: "address", name: "_sender", type: "address" },
|
|
15282
|
+
{
|
|
15283
|
+
components: [
|
|
15284
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15285
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15286
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15287
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15288
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15289
|
+
],
|
|
15290
|
+
internalType: "struct PoolKey",
|
|
15291
|
+
name: "_key",
|
|
15292
|
+
type: "tuple",
|
|
15293
|
+
},
|
|
15294
|
+
{
|
|
15295
|
+
components: [
|
|
15296
|
+
{ internalType: "int24", name: "tickLower", type: "int24" },
|
|
15297
|
+
{ internalType: "int24", name: "tickUpper", type: "int24" },
|
|
15298
|
+
{ internalType: "int256", name: "liquidityDelta", type: "int256" },
|
|
15299
|
+
{ internalType: "bytes32", name: "salt", type: "bytes32" },
|
|
15300
|
+
],
|
|
15301
|
+
internalType: "struct IPoolManager.ModifyLiquidityParams",
|
|
15302
|
+
name: "",
|
|
15303
|
+
type: "tuple",
|
|
15304
|
+
},
|
|
15305
|
+
{ internalType: "BalanceDelta", name: "_delta", type: "int256" },
|
|
15306
|
+
{ internalType: "BalanceDelta", name: "_feesAccrued", type: "int256" },
|
|
15307
|
+
{ internalType: "bytes", name: "", type: "bytes" },
|
|
15308
|
+
],
|
|
15309
|
+
name: "afterAddLiquidity",
|
|
15310
|
+
outputs: [
|
|
15311
|
+
{ internalType: "bytes4", name: "selector_", type: "bytes4" },
|
|
15312
|
+
{ internalType: "BalanceDelta", name: "", type: "int256" },
|
|
15313
|
+
],
|
|
15314
|
+
stateMutability: "nonpayable",
|
|
15315
|
+
type: "function",
|
|
15316
|
+
},
|
|
15317
|
+
{
|
|
15318
|
+
inputs: [
|
|
15319
|
+
{ internalType: "address", name: "_sender", type: "address" },
|
|
15320
|
+
{
|
|
15321
|
+
components: [
|
|
15322
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15323
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15324
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15325
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15326
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15327
|
+
],
|
|
15328
|
+
internalType: "struct PoolKey",
|
|
15329
|
+
name: "_key",
|
|
15330
|
+
type: "tuple",
|
|
15331
|
+
},
|
|
15332
|
+
{ internalType: "uint256", name: "_amount0", type: "uint256" },
|
|
15333
|
+
{ internalType: "uint256", name: "_amount1", type: "uint256" },
|
|
15334
|
+
{ internalType: "bytes", name: "", type: "bytes" },
|
|
15335
|
+
],
|
|
15336
|
+
name: "afterDonate",
|
|
15337
|
+
outputs: [{ internalType: "bytes4", name: "selector_", type: "bytes4" }],
|
|
15338
|
+
stateMutability: "nonpayable",
|
|
15339
|
+
type: "function",
|
|
15340
|
+
},
|
|
15341
|
+
{
|
|
15342
|
+
inputs: [
|
|
15343
|
+
{ internalType: "address", name: "", type: "address" },
|
|
15344
|
+
{
|
|
15345
|
+
components: [
|
|
15346
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15347
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15348
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15349
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15350
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15351
|
+
],
|
|
15352
|
+
internalType: "struct PoolKey",
|
|
15353
|
+
name: "",
|
|
15354
|
+
type: "tuple",
|
|
15355
|
+
},
|
|
15356
|
+
{ internalType: "uint160", name: "", type: "uint160" },
|
|
15357
|
+
{ internalType: "int24", name: "", type: "int24" },
|
|
15358
|
+
],
|
|
15359
|
+
name: "afterInitialize",
|
|
15360
|
+
outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
|
|
15361
|
+
stateMutability: "nonpayable",
|
|
15362
|
+
type: "function",
|
|
15363
|
+
},
|
|
15364
|
+
{
|
|
15365
|
+
inputs: [
|
|
15366
|
+
{ internalType: "address", name: "_sender", type: "address" },
|
|
15367
|
+
{
|
|
15368
|
+
components: [
|
|
15369
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15370
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15371
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15372
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15373
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15374
|
+
],
|
|
15375
|
+
internalType: "struct PoolKey",
|
|
15376
|
+
name: "_key",
|
|
15377
|
+
type: "tuple",
|
|
15378
|
+
},
|
|
15379
|
+
{
|
|
15380
|
+
components: [
|
|
15381
|
+
{ internalType: "int24", name: "tickLower", type: "int24" },
|
|
15382
|
+
{ internalType: "int24", name: "tickUpper", type: "int24" },
|
|
15383
|
+
{ internalType: "int256", name: "liquidityDelta", type: "int256" },
|
|
15384
|
+
{ internalType: "bytes32", name: "salt", type: "bytes32" },
|
|
15385
|
+
],
|
|
15386
|
+
internalType: "struct IPoolManager.ModifyLiquidityParams",
|
|
15387
|
+
name: "",
|
|
15388
|
+
type: "tuple",
|
|
15389
|
+
},
|
|
15390
|
+
{ internalType: "BalanceDelta", name: "_delta", type: "int256" },
|
|
15391
|
+
{ internalType: "BalanceDelta", name: "_feesAccrued", type: "int256" },
|
|
15392
|
+
{ internalType: "bytes", name: "", type: "bytes" },
|
|
15393
|
+
],
|
|
15394
|
+
name: "afterRemoveLiquidity",
|
|
15395
|
+
outputs: [
|
|
15396
|
+
{ internalType: "bytes4", name: "selector_", type: "bytes4" },
|
|
15397
|
+
{ internalType: "BalanceDelta", name: "", type: "int256" },
|
|
15398
|
+
],
|
|
15399
|
+
stateMutability: "nonpayable",
|
|
15400
|
+
type: "function",
|
|
15401
|
+
},
|
|
15402
|
+
{
|
|
15403
|
+
inputs: [
|
|
15404
|
+
{ internalType: "address", name: "_sender", type: "address" },
|
|
15405
|
+
{
|
|
15406
|
+
components: [
|
|
15407
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15408
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15409
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15410
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15411
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15412
|
+
],
|
|
15413
|
+
internalType: "struct PoolKey",
|
|
15414
|
+
name: "_key",
|
|
15415
|
+
type: "tuple",
|
|
15416
|
+
},
|
|
15417
|
+
{
|
|
15418
|
+
components: [
|
|
15419
|
+
{ internalType: "bool", name: "zeroForOne", type: "bool" },
|
|
15420
|
+
{ internalType: "int256", name: "amountSpecified", type: "int256" },
|
|
15421
|
+
{
|
|
15422
|
+
internalType: "uint160",
|
|
15423
|
+
name: "sqrtPriceLimitX96",
|
|
15424
|
+
type: "uint160",
|
|
15425
|
+
},
|
|
15426
|
+
],
|
|
15427
|
+
internalType: "struct IPoolManager.SwapParams",
|
|
15428
|
+
name: "_params",
|
|
15429
|
+
type: "tuple",
|
|
15430
|
+
},
|
|
15431
|
+
{ internalType: "BalanceDelta", name: "_delta", type: "int256" },
|
|
15432
|
+
{ internalType: "bytes", name: "_hookData", type: "bytes" },
|
|
15433
|
+
],
|
|
15434
|
+
name: "afterSwap",
|
|
15435
|
+
outputs: [
|
|
15436
|
+
{ internalType: "bytes4", name: "selector_", type: "bytes4" },
|
|
15437
|
+
{ internalType: "int128", name: "hookDeltaUnspecified_", type: "int128" },
|
|
15438
|
+
],
|
|
15439
|
+
stateMutability: "nonpayable",
|
|
15440
|
+
type: "function",
|
|
15441
|
+
},
|
|
15442
|
+
{
|
|
15443
|
+
inputs: [
|
|
15444
|
+
{ internalType: "address", name: "_memecoin", type: "address" },
|
|
15445
|
+
{ internalType: "address", name: "_creator", type: "address" },
|
|
15446
|
+
],
|
|
15447
|
+
name: "approveMemecoin",
|
|
15448
|
+
outputs: [],
|
|
15449
|
+
stateMutability: "nonpayable",
|
|
15450
|
+
type: "function",
|
|
15451
|
+
},
|
|
15452
|
+
{
|
|
15453
|
+
inputs: [{ internalType: "address", name: "_memecoin", type: "address" }],
|
|
15454
|
+
name: "approvedMemecoinToCreator",
|
|
15455
|
+
outputs: [{ internalType: "address", name: "_creator", type: "address" }],
|
|
15456
|
+
stateMutability: "view",
|
|
15457
|
+
type: "function",
|
|
15458
|
+
},
|
|
15459
|
+
{
|
|
15460
|
+
inputs: [
|
|
15461
|
+
{ internalType: "address", name: "", type: "address" },
|
|
15462
|
+
{
|
|
15463
|
+
components: [
|
|
15464
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15465
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15466
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15467
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15468
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15469
|
+
],
|
|
15470
|
+
internalType: "struct PoolKey",
|
|
15471
|
+
name: "",
|
|
15472
|
+
type: "tuple",
|
|
15473
|
+
},
|
|
15474
|
+
{
|
|
15475
|
+
components: [
|
|
15476
|
+
{ internalType: "int24", name: "tickLower", type: "int24" },
|
|
15477
|
+
{ internalType: "int24", name: "tickUpper", type: "int24" },
|
|
15478
|
+
{ internalType: "int256", name: "liquidityDelta", type: "int256" },
|
|
15479
|
+
{ internalType: "bytes32", name: "salt", type: "bytes32" },
|
|
15480
|
+
],
|
|
15481
|
+
internalType: "struct IPoolManager.ModifyLiquidityParams",
|
|
15482
|
+
name: "",
|
|
15483
|
+
type: "tuple",
|
|
15484
|
+
},
|
|
15485
|
+
{ internalType: "bytes", name: "", type: "bytes" },
|
|
15486
|
+
],
|
|
15487
|
+
name: "beforeAddLiquidity",
|
|
15488
|
+
outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
|
|
15489
|
+
stateMutability: "nonpayable",
|
|
15490
|
+
type: "function",
|
|
15491
|
+
},
|
|
15492
|
+
{
|
|
15493
|
+
inputs: [
|
|
15494
|
+
{ internalType: "address", name: "", type: "address" },
|
|
15495
|
+
{
|
|
15496
|
+
components: [
|
|
15497
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15498
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15499
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15500
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15501
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15502
|
+
],
|
|
15503
|
+
internalType: "struct PoolKey",
|
|
15504
|
+
name: "",
|
|
15505
|
+
type: "tuple",
|
|
15506
|
+
},
|
|
15507
|
+
{ internalType: "uint256", name: "", type: "uint256" },
|
|
15508
|
+
{ internalType: "uint256", name: "", type: "uint256" },
|
|
15509
|
+
{ internalType: "bytes", name: "", type: "bytes" },
|
|
15510
|
+
],
|
|
15511
|
+
name: "beforeDonate",
|
|
15512
|
+
outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
|
|
15513
|
+
stateMutability: "nonpayable",
|
|
15514
|
+
type: "function",
|
|
15515
|
+
},
|
|
15516
|
+
{
|
|
15517
|
+
inputs: [
|
|
15518
|
+
{ internalType: "address", name: "", type: "address" },
|
|
15519
|
+
{
|
|
15520
|
+
components: [
|
|
15521
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15522
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15523
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15524
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15525
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15526
|
+
],
|
|
15527
|
+
internalType: "struct PoolKey",
|
|
15528
|
+
name: "",
|
|
15529
|
+
type: "tuple",
|
|
15530
|
+
},
|
|
15531
|
+
{ internalType: "uint160", name: "", type: "uint160" },
|
|
15532
|
+
],
|
|
15533
|
+
name: "beforeInitialize",
|
|
15534
|
+
outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
|
|
15535
|
+
stateMutability: "view",
|
|
15536
|
+
type: "function",
|
|
15537
|
+
},
|
|
15538
|
+
{
|
|
15539
|
+
inputs: [
|
|
15540
|
+
{ internalType: "address", name: "", type: "address" },
|
|
15541
|
+
{
|
|
15542
|
+
components: [
|
|
15543
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15544
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15545
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15546
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15547
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15548
|
+
],
|
|
15549
|
+
internalType: "struct PoolKey",
|
|
15550
|
+
name: "",
|
|
15551
|
+
type: "tuple",
|
|
15552
|
+
},
|
|
15553
|
+
{
|
|
15554
|
+
components: [
|
|
15555
|
+
{ internalType: "int24", name: "tickLower", type: "int24" },
|
|
15556
|
+
{ internalType: "int24", name: "tickUpper", type: "int24" },
|
|
15557
|
+
{ internalType: "int256", name: "liquidityDelta", type: "int256" },
|
|
15558
|
+
{ internalType: "bytes32", name: "salt", type: "bytes32" },
|
|
15559
|
+
],
|
|
15560
|
+
internalType: "struct IPoolManager.ModifyLiquidityParams",
|
|
15561
|
+
name: "",
|
|
15562
|
+
type: "tuple",
|
|
15563
|
+
},
|
|
15564
|
+
{ internalType: "bytes", name: "", type: "bytes" },
|
|
15565
|
+
],
|
|
15566
|
+
name: "beforeRemoveLiquidity",
|
|
15567
|
+
outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
|
|
15568
|
+
stateMutability: "nonpayable",
|
|
15569
|
+
type: "function",
|
|
15570
|
+
},
|
|
15571
|
+
{
|
|
15572
|
+
inputs: [
|
|
15573
|
+
{ internalType: "address", name: "_sender", type: "address" },
|
|
15574
|
+
{
|
|
15575
|
+
components: [
|
|
15576
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15577
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15578
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15579
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15580
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15581
|
+
],
|
|
15582
|
+
internalType: "struct PoolKey",
|
|
15583
|
+
name: "_key",
|
|
15584
|
+
type: "tuple",
|
|
15585
|
+
},
|
|
15586
|
+
{
|
|
15587
|
+
components: [
|
|
15588
|
+
{ internalType: "bool", name: "zeroForOne", type: "bool" },
|
|
15589
|
+
{ internalType: "int256", name: "amountSpecified", type: "int256" },
|
|
15590
|
+
{
|
|
15591
|
+
internalType: "uint160",
|
|
15592
|
+
name: "sqrtPriceLimitX96",
|
|
15593
|
+
type: "uint160",
|
|
15594
|
+
},
|
|
15595
|
+
],
|
|
15596
|
+
internalType: "struct IPoolManager.SwapParams",
|
|
15597
|
+
name: "_params",
|
|
15598
|
+
type: "tuple",
|
|
15599
|
+
},
|
|
15600
|
+
{ internalType: "bytes", name: "_hookData", type: "bytes" },
|
|
15601
|
+
],
|
|
15602
|
+
name: "beforeSwap",
|
|
15603
|
+
outputs: [
|
|
15604
|
+
{ internalType: "bytes4", name: "selector_", type: "bytes4" },
|
|
15605
|
+
{
|
|
15606
|
+
internalType: "BeforeSwapDelta",
|
|
15607
|
+
name: "beforeSwapDelta_",
|
|
15608
|
+
type: "int256",
|
|
15609
|
+
},
|
|
15610
|
+
{ internalType: "uint24", name: "", type: "uint24" },
|
|
15611
|
+
],
|
|
15612
|
+
stateMutability: "nonpayable",
|
|
15613
|
+
type: "function",
|
|
15614
|
+
},
|
|
15615
|
+
{
|
|
15616
|
+
inputs: [],
|
|
15617
|
+
name: "bidWall",
|
|
15618
|
+
outputs: [{ internalType: "contract BidWall", name: "", type: "address" }],
|
|
15619
|
+
stateMutability: "view",
|
|
15620
|
+
type: "function",
|
|
15621
|
+
},
|
|
15622
|
+
{
|
|
15623
|
+
inputs: [],
|
|
15624
|
+
name: "cancelOwnershipHandover",
|
|
15625
|
+
outputs: [],
|
|
15626
|
+
stateMutability: "payable",
|
|
15627
|
+
type: "function",
|
|
15628
|
+
},
|
|
15629
|
+
{
|
|
15630
|
+
inputs: [
|
|
15631
|
+
{
|
|
15632
|
+
components: [
|
|
15633
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15634
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15635
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15636
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15637
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15638
|
+
],
|
|
15639
|
+
internalType: "struct PoolKey",
|
|
15640
|
+
name: "_key",
|
|
15641
|
+
type: "tuple",
|
|
15642
|
+
},
|
|
15643
|
+
],
|
|
15644
|
+
name: "closeBidWall",
|
|
15645
|
+
outputs: [],
|
|
15646
|
+
stateMutability: "nonpayable",
|
|
15647
|
+
type: "function",
|
|
15648
|
+
},
|
|
15649
|
+
{
|
|
15650
|
+
inputs: [
|
|
15651
|
+
{ internalType: "address", name: "pendingOwner", type: "address" },
|
|
15652
|
+
],
|
|
15653
|
+
name: "completeOwnershipHandover",
|
|
15654
|
+
outputs: [],
|
|
15655
|
+
stateMutability: "payable",
|
|
15656
|
+
type: "function",
|
|
15657
|
+
},
|
|
15658
|
+
{
|
|
15659
|
+
inputs: [],
|
|
15660
|
+
name: "fairLaunchFeeCalculator",
|
|
15661
|
+
outputs: [
|
|
15662
|
+
{ internalType: "contract IFeeCalculator", name: "", type: "address" },
|
|
15663
|
+
],
|
|
15664
|
+
stateMutability: "view",
|
|
15665
|
+
type: "function",
|
|
15666
|
+
},
|
|
15667
|
+
{
|
|
15668
|
+
inputs: [],
|
|
15669
|
+
name: "feeCalculator",
|
|
15670
|
+
outputs: [
|
|
15671
|
+
{ internalType: "contract IFeeCalculator", name: "", type: "address" },
|
|
15672
|
+
],
|
|
15673
|
+
stateMutability: "view",
|
|
15674
|
+
type: "function",
|
|
15675
|
+
},
|
|
15676
|
+
{
|
|
15677
|
+
inputs: [],
|
|
15678
|
+
name: "feeEscrow",
|
|
15679
|
+
outputs: [
|
|
15680
|
+
{ internalType: "contract FeeEscrow", name: "", type: "address" },
|
|
15681
|
+
],
|
|
15682
|
+
stateMutability: "view",
|
|
15683
|
+
type: "function",
|
|
15684
|
+
},
|
|
15685
|
+
{
|
|
15686
|
+
inputs: [],
|
|
15687
|
+
name: "feeExemptions",
|
|
15688
|
+
outputs: [
|
|
15689
|
+
{ internalType: "contract FeeExemptions", name: "", type: "address" },
|
|
15690
|
+
],
|
|
15691
|
+
stateMutability: "view",
|
|
15692
|
+
type: "function",
|
|
15693
|
+
},
|
|
15694
|
+
{
|
|
15695
|
+
inputs: [
|
|
15696
|
+
{ internalType: "PoolId", name: "_poolId", type: "bytes32" },
|
|
15697
|
+
{ internalType: "uint256", name: "_amount", type: "uint256" },
|
|
15698
|
+
],
|
|
15699
|
+
name: "feeSplit",
|
|
15700
|
+
outputs: [
|
|
15701
|
+
{ internalType: "uint256", name: "bidWall_", type: "uint256" },
|
|
15702
|
+
{ internalType: "uint256", name: "creator_", type: "uint256" },
|
|
15703
|
+
{ internalType: "uint256", name: "protocol_", type: "uint256" },
|
|
15704
|
+
],
|
|
15705
|
+
stateMutability: "view",
|
|
15706
|
+
type: "function",
|
|
15707
|
+
},
|
|
15708
|
+
{
|
|
15709
|
+
inputs: [
|
|
15710
|
+
{
|
|
15711
|
+
components: [
|
|
15712
|
+
{ internalType: "address", name: "memecoin", type: "address" },
|
|
15713
|
+
{ internalType: "address", name: "creator", type: "address" },
|
|
15714
|
+
{
|
|
15715
|
+
internalType: "uint24",
|
|
15716
|
+
name: "creatorFeeAllocation",
|
|
15717
|
+
type: "uint24",
|
|
15718
|
+
},
|
|
15719
|
+
{ internalType: "bytes", name: "initialPriceParams", type: "bytes" },
|
|
15720
|
+
{ internalType: "bytes", name: "feeCalculatorParams", type: "bytes" },
|
|
15721
|
+
],
|
|
15722
|
+
internalType: "struct AnyPositionManager.FlaunchParams",
|
|
15723
|
+
name: "_params",
|
|
15724
|
+
type: "tuple",
|
|
15725
|
+
},
|
|
15726
|
+
],
|
|
15727
|
+
name: "flaunch",
|
|
15728
|
+
outputs: [],
|
|
15729
|
+
stateMutability: "nonpayable",
|
|
15730
|
+
type: "function",
|
|
15731
|
+
},
|
|
15732
|
+
{
|
|
15733
|
+
inputs: [],
|
|
15734
|
+
name: "flaunchContract",
|
|
15735
|
+
outputs: [
|
|
15736
|
+
{ internalType: "contract IAnyFlaunch", name: "", type: "address" },
|
|
15737
|
+
],
|
|
15738
|
+
stateMutability: "view",
|
|
15739
|
+
type: "function",
|
|
15740
|
+
},
|
|
15741
|
+
{
|
|
15742
|
+
inputs: [],
|
|
15743
|
+
name: "flayGovernance",
|
|
15744
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
15745
|
+
stateMutability: "view",
|
|
15746
|
+
type: "function",
|
|
15747
|
+
},
|
|
15748
|
+
{
|
|
15749
|
+
inputs: [{ internalType: "bool", name: "_isFairLaunch", type: "bool" }],
|
|
15750
|
+
name: "getFeeCalculator",
|
|
15751
|
+
outputs: [
|
|
15752
|
+
{ internalType: "contract IFeeCalculator", name: "", type: "address" },
|
|
15753
|
+
],
|
|
15754
|
+
stateMutability: "view",
|
|
15755
|
+
type: "function",
|
|
15756
|
+
},
|
|
15757
|
+
{
|
|
15758
|
+
inputs: [
|
|
15759
|
+
{ internalType: "bytes", name: "_initialPriceParams", type: "bytes" },
|
|
15760
|
+
],
|
|
15761
|
+
name: "getFlaunchingMarketCap",
|
|
15762
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
15763
|
+
stateMutability: "view",
|
|
15764
|
+
type: "function",
|
|
15765
|
+
},
|
|
15766
|
+
{
|
|
15767
|
+
inputs: [],
|
|
15768
|
+
name: "getHookPermissions",
|
|
15769
|
+
outputs: [
|
|
15770
|
+
{
|
|
15771
|
+
components: [
|
|
15772
|
+
{ internalType: "bool", name: "beforeInitialize", type: "bool" },
|
|
15773
|
+
{ internalType: "bool", name: "afterInitialize", type: "bool" },
|
|
15774
|
+
{ internalType: "bool", name: "beforeAddLiquidity", type: "bool" },
|
|
15775
|
+
{ internalType: "bool", name: "afterAddLiquidity", type: "bool" },
|
|
15776
|
+
{ internalType: "bool", name: "beforeRemoveLiquidity", type: "bool" },
|
|
15777
|
+
{ internalType: "bool", name: "afterRemoveLiquidity", type: "bool" },
|
|
15778
|
+
{ internalType: "bool", name: "beforeSwap", type: "bool" },
|
|
15779
|
+
{ internalType: "bool", name: "afterSwap", type: "bool" },
|
|
15780
|
+
{ internalType: "bool", name: "beforeDonate", type: "bool" },
|
|
15781
|
+
{ internalType: "bool", name: "afterDonate", type: "bool" },
|
|
15782
|
+
{ internalType: "bool", name: "beforeSwapReturnDelta", type: "bool" },
|
|
15783
|
+
{ internalType: "bool", name: "afterSwapReturnDelta", type: "bool" },
|
|
15784
|
+
{
|
|
15785
|
+
internalType: "bool",
|
|
15786
|
+
name: "afterAddLiquidityReturnDelta",
|
|
15787
|
+
type: "bool",
|
|
15788
|
+
},
|
|
15789
|
+
{
|
|
15790
|
+
internalType: "bool",
|
|
15791
|
+
name: "afterRemoveLiquidityReturnDelta",
|
|
15792
|
+
type: "bool",
|
|
15793
|
+
},
|
|
15794
|
+
],
|
|
15795
|
+
internalType: "struct Hooks.Permissions",
|
|
15796
|
+
name: "",
|
|
15797
|
+
type: "tuple",
|
|
15798
|
+
},
|
|
15799
|
+
],
|
|
15800
|
+
stateMutability: "pure",
|
|
15801
|
+
type: "function",
|
|
15802
|
+
},
|
|
15803
|
+
{
|
|
15804
|
+
inputs: [{ internalType: "PoolId", name: "_poolId", type: "bytes32" }],
|
|
15805
|
+
name: "getPoolFeeDistribution",
|
|
15806
|
+
outputs: [
|
|
15807
|
+
{
|
|
15808
|
+
components: [
|
|
15809
|
+
{ internalType: "uint24", name: "swapFee", type: "uint24" },
|
|
15810
|
+
{ internalType: "uint24", name: "referrer", type: "uint24" },
|
|
15811
|
+
{ internalType: "uint24", name: "protocol", type: "uint24" },
|
|
15812
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
15813
|
+
],
|
|
15814
|
+
internalType: "struct FeeDistributor.FeeDistribution",
|
|
15815
|
+
name: "feeDistribution_",
|
|
15816
|
+
type: "tuple",
|
|
15817
|
+
},
|
|
15818
|
+
],
|
|
15819
|
+
stateMutability: "view",
|
|
15820
|
+
type: "function",
|
|
15821
|
+
},
|
|
15822
|
+
{
|
|
15823
|
+
inputs: [],
|
|
15824
|
+
name: "initialPrice",
|
|
15825
|
+
outputs: [
|
|
15826
|
+
{ internalType: "contract IInitialPrice", name: "", type: "address" },
|
|
15827
|
+
],
|
|
15828
|
+
stateMutability: "view",
|
|
15829
|
+
type: "function",
|
|
15830
|
+
},
|
|
15831
|
+
{
|
|
15832
|
+
inputs: [],
|
|
15833
|
+
name: "nativeToken",
|
|
15834
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
15835
|
+
stateMutability: "view",
|
|
15836
|
+
type: "function",
|
|
15837
|
+
},
|
|
15838
|
+
{
|
|
15839
|
+
inputs: [],
|
|
15840
|
+
name: "notifier",
|
|
15841
|
+
outputs: [{ internalType: "contract Notifier", name: "", type: "address" }],
|
|
15842
|
+
stateMutability: "view",
|
|
15843
|
+
type: "function",
|
|
15844
|
+
},
|
|
15845
|
+
{
|
|
15846
|
+
inputs: [],
|
|
15847
|
+
name: "owner",
|
|
15848
|
+
outputs: [{ internalType: "address", name: "result", type: "address" }],
|
|
15849
|
+
stateMutability: "view",
|
|
15850
|
+
type: "function",
|
|
15851
|
+
},
|
|
15852
|
+
{
|
|
15853
|
+
inputs: [
|
|
15854
|
+
{ internalType: "address", name: "pendingOwner", type: "address" },
|
|
15855
|
+
],
|
|
15856
|
+
name: "ownershipHandoverExpiresAt",
|
|
15857
|
+
outputs: [{ internalType: "uint256", name: "result", type: "uint256" }],
|
|
15858
|
+
stateMutability: "view",
|
|
15859
|
+
type: "function",
|
|
15860
|
+
},
|
|
15861
|
+
{
|
|
15862
|
+
inputs: [
|
|
15863
|
+
{
|
|
15864
|
+
components: [
|
|
15865
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15866
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15867
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15868
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15869
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15870
|
+
],
|
|
15871
|
+
internalType: "struct PoolKey",
|
|
15872
|
+
name: "_poolKey",
|
|
15873
|
+
type: "tuple",
|
|
15874
|
+
},
|
|
15875
|
+
],
|
|
15876
|
+
name: "poolFees",
|
|
15877
|
+
outputs: [
|
|
15878
|
+
{
|
|
15879
|
+
components: [
|
|
15880
|
+
{ internalType: "uint256", name: "amount0", type: "uint256" },
|
|
15881
|
+
{ internalType: "uint256", name: "amount1", type: "uint256" },
|
|
15882
|
+
],
|
|
15883
|
+
internalType: "struct InternalSwapPool.ClaimableFees",
|
|
15884
|
+
name: "",
|
|
15885
|
+
type: "tuple",
|
|
15886
|
+
},
|
|
15887
|
+
],
|
|
15888
|
+
stateMutability: "view",
|
|
15889
|
+
type: "function",
|
|
15890
|
+
},
|
|
15891
|
+
{
|
|
15892
|
+
inputs: [{ internalType: "address", name: "_token", type: "address" }],
|
|
15893
|
+
name: "poolKey",
|
|
15894
|
+
outputs: [
|
|
15895
|
+
{
|
|
15896
|
+
components: [
|
|
15897
|
+
{ internalType: "Currency", name: "currency0", type: "address" },
|
|
15898
|
+
{ internalType: "Currency", name: "currency1", type: "address" },
|
|
15899
|
+
{ internalType: "uint24", name: "fee", type: "uint24" },
|
|
15900
|
+
{ internalType: "int24", name: "tickSpacing", type: "int24" },
|
|
15901
|
+
{ internalType: "contract IHooks", name: "hooks", type: "address" },
|
|
15902
|
+
],
|
|
15903
|
+
internalType: "struct PoolKey",
|
|
15904
|
+
name: "",
|
|
15905
|
+
type: "tuple",
|
|
15906
|
+
},
|
|
15907
|
+
],
|
|
15908
|
+
stateMutability: "view",
|
|
15909
|
+
type: "function",
|
|
15910
|
+
},
|
|
15911
|
+
{
|
|
15912
|
+
inputs: [],
|
|
15913
|
+
name: "poolManager",
|
|
15914
|
+
outputs: [
|
|
15915
|
+
{ internalType: "contract IPoolManager", name: "", type: "address" },
|
|
15916
|
+
],
|
|
15917
|
+
stateMutability: "view",
|
|
15918
|
+
type: "function",
|
|
15919
|
+
},
|
|
15920
|
+
{
|
|
15921
|
+
inputs: [],
|
|
15922
|
+
name: "referralEscrow",
|
|
15923
|
+
outputs: [
|
|
15924
|
+
{ internalType: "contract ReferralEscrow", name: "", type: "address" },
|
|
15925
|
+
],
|
|
15926
|
+
stateMutability: "view",
|
|
15927
|
+
type: "function",
|
|
15928
|
+
},
|
|
15929
|
+
{
|
|
15930
|
+
inputs: [],
|
|
15931
|
+
name: "renounceOwnership",
|
|
15932
|
+
outputs: [],
|
|
15933
|
+
stateMutability: "payable",
|
|
15934
|
+
type: "function",
|
|
15935
|
+
},
|
|
15936
|
+
{
|
|
15937
|
+
inputs: [],
|
|
15938
|
+
name: "requestOwnershipHandover",
|
|
15939
|
+
outputs: [],
|
|
15940
|
+
stateMutability: "payable",
|
|
15941
|
+
type: "function",
|
|
15942
|
+
},
|
|
15943
|
+
{
|
|
15944
|
+
inputs: [
|
|
15945
|
+
{
|
|
15946
|
+
internalType: "contract IFeeCalculator",
|
|
15947
|
+
name: "_feeCalculator",
|
|
15948
|
+
type: "address",
|
|
15949
|
+
},
|
|
15950
|
+
],
|
|
15951
|
+
name: "setFairLaunchFeeCalculator",
|
|
15952
|
+
outputs: [],
|
|
15953
|
+
stateMutability: "nonpayable",
|
|
15954
|
+
type: "function",
|
|
15955
|
+
},
|
|
15956
|
+
{
|
|
15957
|
+
inputs: [
|
|
15958
|
+
{
|
|
15959
|
+
internalType: "contract IFeeCalculator",
|
|
15960
|
+
name: "_feeCalculator",
|
|
15961
|
+
type: "address",
|
|
15962
|
+
},
|
|
15963
|
+
],
|
|
15964
|
+
name: "setFeeCalculator",
|
|
15965
|
+
outputs: [],
|
|
15966
|
+
stateMutability: "nonpayable",
|
|
15967
|
+
type: "function",
|
|
15968
|
+
},
|
|
15969
|
+
{
|
|
15970
|
+
inputs: [
|
|
15971
|
+
{
|
|
15972
|
+
components: [
|
|
15973
|
+
{ internalType: "uint24", name: "swapFee", type: "uint24" },
|
|
15974
|
+
{ internalType: "uint24", name: "referrer", type: "uint24" },
|
|
15975
|
+
{ internalType: "uint24", name: "protocol", type: "uint24" },
|
|
15976
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
15977
|
+
],
|
|
15978
|
+
internalType: "struct FeeDistributor.FeeDistribution",
|
|
15979
|
+
name: "_feeDistribution",
|
|
15980
|
+
type: "tuple",
|
|
15981
|
+
},
|
|
15982
|
+
],
|
|
15983
|
+
name: "setFeeDistribution",
|
|
15984
|
+
outputs: [],
|
|
15985
|
+
stateMutability: "nonpayable",
|
|
15986
|
+
type: "function",
|
|
15987
|
+
},
|
|
15988
|
+
{
|
|
15989
|
+
inputs: [
|
|
15990
|
+
{ internalType: "address", name: "_flaunchContract", type: "address" },
|
|
15991
|
+
],
|
|
15992
|
+
name: "setFlaunch",
|
|
15993
|
+
outputs: [],
|
|
15994
|
+
stateMutability: "nonpayable",
|
|
15995
|
+
type: "function",
|
|
15996
|
+
},
|
|
15997
|
+
{
|
|
15998
|
+
inputs: [
|
|
15999
|
+
{ internalType: "address", name: "_initialPrice", type: "address" },
|
|
16000
|
+
],
|
|
16001
|
+
name: "setInitialPrice",
|
|
16002
|
+
outputs: [],
|
|
16003
|
+
stateMutability: "nonpayable",
|
|
16004
|
+
type: "function",
|
|
16005
|
+
},
|
|
16006
|
+
{
|
|
16007
|
+
inputs: [
|
|
16008
|
+
{ internalType: "PoolId", name: "_poolId", type: "bytes32" },
|
|
16009
|
+
{
|
|
16010
|
+
components: [
|
|
16011
|
+
{ internalType: "uint24", name: "swapFee", type: "uint24" },
|
|
16012
|
+
{ internalType: "uint24", name: "referrer", type: "uint24" },
|
|
16013
|
+
{ internalType: "uint24", name: "protocol", type: "uint24" },
|
|
16014
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
16015
|
+
],
|
|
16016
|
+
internalType: "struct FeeDistributor.FeeDistribution",
|
|
16017
|
+
name: "_feeDistribution",
|
|
16018
|
+
type: "tuple",
|
|
16019
|
+
},
|
|
16020
|
+
],
|
|
16021
|
+
name: "setPoolFeeDistribution",
|
|
16022
|
+
outputs: [],
|
|
16023
|
+
stateMutability: "nonpayable",
|
|
16024
|
+
type: "function",
|
|
16025
|
+
},
|
|
16026
|
+
{
|
|
16027
|
+
inputs: [{ internalType: "uint24", name: "_protocol", type: "uint24" }],
|
|
16028
|
+
name: "setProtocolFeeDistribution",
|
|
16029
|
+
outputs: [],
|
|
16030
|
+
stateMutability: "nonpayable",
|
|
16031
|
+
type: "function",
|
|
16032
|
+
},
|
|
16033
|
+
{
|
|
16034
|
+
inputs: [
|
|
16035
|
+
{
|
|
16036
|
+
internalType: "address payable",
|
|
16037
|
+
name: "_referralEscrow",
|
|
16038
|
+
type: "address",
|
|
16039
|
+
},
|
|
16040
|
+
],
|
|
16041
|
+
name: "setReferralEscrow",
|
|
16042
|
+
outputs: [],
|
|
16043
|
+
stateMutability: "nonpayable",
|
|
16044
|
+
type: "function",
|
|
16045
|
+
},
|
|
16046
|
+
{
|
|
16047
|
+
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
|
|
16048
|
+
name: "transferOwnership",
|
|
16049
|
+
outputs: [],
|
|
16050
|
+
stateMutability: "payable",
|
|
16051
|
+
type: "function",
|
|
16052
|
+
},
|
|
16053
|
+
{
|
|
16054
|
+
inputs: [{ internalType: "bytes", name: "data", type: "bytes" }],
|
|
16055
|
+
name: "unlockCallback",
|
|
16056
|
+
outputs: [{ internalType: "bytes", name: "", type: "bytes" }],
|
|
16057
|
+
stateMutability: "nonpayable",
|
|
16058
|
+
type: "function",
|
|
16059
|
+
},
|
|
16060
|
+
{ stateMutability: "payable", type: "receive" },
|
|
16061
|
+
];
|
|
16062
|
+
|
|
16063
|
+
class ReadAnyPositionManager {
|
|
16064
|
+
constructor(address, drift = createDrift$1()) {
|
|
16065
|
+
this.TOTAL_SUPPLY = 100n * 10n ** 27n; // 100 Billion tokens in wei
|
|
16066
|
+
this.drift = drift;
|
|
16067
|
+
if (!address) {
|
|
16068
|
+
throw new Error("Address is required");
|
|
16069
|
+
}
|
|
16070
|
+
this.contract = drift.contract({
|
|
16071
|
+
abi: AnyPositionManagerAbi,
|
|
16072
|
+
address,
|
|
16073
|
+
});
|
|
16074
|
+
}
|
|
16075
|
+
async isValidCoin(coinAddress) {
|
|
16076
|
+
const poolKey = await this.contract.read("poolKey", {
|
|
16077
|
+
_token: coinAddress,
|
|
16078
|
+
});
|
|
16079
|
+
return poolKey.tickSpacing !== 0;
|
|
16080
|
+
}
|
|
16081
|
+
async getFlaunchingFee(params) {
|
|
16082
|
+
return 0n;
|
|
16083
|
+
}
|
|
16084
|
+
async watchPoolCreated({ onPoolCreated, startBlockNumber, }) {
|
|
16085
|
+
let intervalId;
|
|
16086
|
+
if (startBlockNumber !== undefined) {
|
|
16087
|
+
onPoolCreated({
|
|
16088
|
+
logs: [],
|
|
16089
|
+
isFetchingFromStart: true,
|
|
16090
|
+
});
|
|
16091
|
+
}
|
|
16092
|
+
let lastBlockNumber = startBlockNumber
|
|
16093
|
+
? startBlockNumber - 1n
|
|
16094
|
+
: await this.drift.getBlockNumber();
|
|
16095
|
+
const pollEvents = async () => {
|
|
16096
|
+
try {
|
|
16097
|
+
const currentBlockNumber = await this.drift.getBlockNumber();
|
|
16098
|
+
if (currentBlockNumber > lastBlockNumber) {
|
|
16099
|
+
const _logs = await this.contract.getEvents("PoolCreated", {
|
|
16100
|
+
fromBlock: lastBlockNumber + 1n,
|
|
16101
|
+
toBlock: currentBlockNumber,
|
|
16102
|
+
});
|
|
16103
|
+
// Get timestamps for each log
|
|
16104
|
+
const logsWithTimestamps = await Promise.all([..._logs].reverse().map(async (log) => {
|
|
16105
|
+
const block = await this.drift.getBlock(log.blockNumber);
|
|
16106
|
+
return {
|
|
16107
|
+
...log,
|
|
16108
|
+
timestamp: Number(block?.timestamp) * 1000, // convert to ms for js
|
|
16109
|
+
};
|
|
16110
|
+
}));
|
|
16111
|
+
if (logsWithTimestamps.length > 0) {
|
|
16112
|
+
onPoolCreated({
|
|
16113
|
+
logs: logsWithTimestamps,
|
|
16114
|
+
isFetchingFromStart: false,
|
|
16115
|
+
});
|
|
16116
|
+
}
|
|
16117
|
+
else {
|
|
16118
|
+
onPoolCreated({
|
|
16119
|
+
logs: [],
|
|
16120
|
+
isFetchingFromStart: false,
|
|
16121
|
+
});
|
|
16122
|
+
}
|
|
16123
|
+
lastBlockNumber = currentBlockNumber;
|
|
16124
|
+
}
|
|
16125
|
+
}
|
|
16126
|
+
catch (error) {
|
|
16127
|
+
console.error("Error polling events:", error);
|
|
16128
|
+
}
|
|
16129
|
+
};
|
|
16130
|
+
intervalId = setInterval(pollEvents, 5000);
|
|
16131
|
+
this.pollPoolCreatedNow = pollEvents;
|
|
16132
|
+
// Return both cleanup function and immediate poll function
|
|
16133
|
+
return {
|
|
16134
|
+
cleanup: () => {
|
|
16135
|
+
if (intervalId) {
|
|
16136
|
+
clearInterval(intervalId);
|
|
16137
|
+
}
|
|
16138
|
+
// Clear the pollNow function when cleaning up
|
|
16139
|
+
this.pollPoolCreatedNow = undefined;
|
|
16140
|
+
},
|
|
16141
|
+
pollPoolCreatedNow: pollEvents,
|
|
16142
|
+
};
|
|
16143
|
+
}
|
|
16144
|
+
async watchPoolSwap({ onPoolSwap, flETHIsCurrencyZero, startBlockNumber, filterByPoolId, }) {
|
|
16145
|
+
let intervalId;
|
|
16146
|
+
if (startBlockNumber !== undefined) {
|
|
16147
|
+
onPoolSwap({
|
|
16148
|
+
logs: [],
|
|
16149
|
+
isFetchingFromStart: true,
|
|
16150
|
+
});
|
|
16151
|
+
}
|
|
16152
|
+
let lastBlockNumber = startBlockNumber
|
|
16153
|
+
? startBlockNumber - 1n
|
|
16154
|
+
: await this.drift.getBlockNumber();
|
|
16155
|
+
const pollEvents = async () => {
|
|
16156
|
+
try {
|
|
16157
|
+
const currentBlockNumber = await this.drift.getBlockNumber();
|
|
16158
|
+
if (currentBlockNumber > lastBlockNumber) {
|
|
16159
|
+
const _logs = await this.contract.getEvents("PoolSwap", {
|
|
16160
|
+
fromBlock: lastBlockNumber + 1n,
|
|
16161
|
+
toBlock: currentBlockNumber,
|
|
16162
|
+
filter: {
|
|
16163
|
+
poolId: filterByPoolId,
|
|
16164
|
+
},
|
|
16165
|
+
});
|
|
16166
|
+
// Get timestamps for each log
|
|
16167
|
+
const logsWithTimestamps = await Promise.all([..._logs].reverse().map(async (log) => {
|
|
16168
|
+
const block = await this.drift.getBlock(log.blockNumber);
|
|
16169
|
+
const timestamp = Number(block?.timestamp) * 1000; // convert to ms for js
|
|
16170
|
+
if (flETHIsCurrencyZero === undefined) {
|
|
16171
|
+
return {
|
|
16172
|
+
...log,
|
|
16173
|
+
timestamp,
|
|
16174
|
+
};
|
|
16175
|
+
}
|
|
16176
|
+
const { flAmount0, flAmount1, flFee0, flFee1, ispAmount0, ispAmount1, ispFee0, ispFee1, uniAmount0, uniAmount1, uniFee0, uniFee1, } = log.args;
|
|
16177
|
+
const currency0Delta = flAmount0 + ispAmount0 + uniAmount0;
|
|
16178
|
+
const currency1Delta = flAmount1 + ispAmount1 + uniAmount1;
|
|
16179
|
+
const currency0Fees = flFee0 + ispFee0 + uniFee0;
|
|
16180
|
+
const currency1Fees = flFee1 + ispFee1 + uniFee1;
|
|
16181
|
+
let feesIsInFLETH;
|
|
16182
|
+
let swapType;
|
|
16183
|
+
if (flETHIsCurrencyZero) {
|
|
16184
|
+
swapType = currency0Delta < 0 ? "BUY" : "SELL";
|
|
16185
|
+
feesIsInFLETH = currency0Fees < 0;
|
|
16186
|
+
}
|
|
16187
|
+
else {
|
|
16188
|
+
swapType = currency1Delta < 0 ? "BUY" : "SELL";
|
|
16189
|
+
feesIsInFLETH = currency1Fees < 0;
|
|
16190
|
+
}
|
|
16191
|
+
const absCurrency0Delta = currency0Delta < 0 ? -currency0Delta : currency0Delta;
|
|
16192
|
+
const absCurrency1Delta = currency1Delta < 0 ? -currency1Delta : currency1Delta;
|
|
16193
|
+
const absCurrency0Fees = currency0Fees < 0 ? -currency0Fees : currency0Fees;
|
|
16194
|
+
const absCurrency1Fees = currency1Fees < 0 ? -currency1Fees : currency1Fees;
|
|
16195
|
+
const fees = {
|
|
16196
|
+
isInFLETH: feesIsInFLETH,
|
|
16197
|
+
amount: flETHIsCurrencyZero
|
|
16198
|
+
? feesIsInFLETH
|
|
16199
|
+
? absCurrency0Fees
|
|
16200
|
+
: absCurrency1Fees
|
|
16201
|
+
: feesIsInFLETH
|
|
16202
|
+
? absCurrency1Fees
|
|
16203
|
+
: absCurrency0Fees,
|
|
16204
|
+
};
|
|
16205
|
+
if (swapType === "BUY") {
|
|
16206
|
+
return {
|
|
16207
|
+
...log,
|
|
16208
|
+
timestamp,
|
|
16209
|
+
type: swapType,
|
|
16210
|
+
delta: {
|
|
16211
|
+
coinsBought: flETHIsCurrencyZero
|
|
16212
|
+
? absCurrency1Delta - (!fees.isInFLETH ? fees.amount : 0n)
|
|
16213
|
+
: absCurrency0Delta -
|
|
16214
|
+
(!fees.isInFLETH ? fees.amount : 0n),
|
|
16215
|
+
flETHSold: flETHIsCurrencyZero
|
|
16216
|
+
? absCurrency0Delta - (fees.isInFLETH ? fees.amount : 0n)
|
|
16217
|
+
: absCurrency1Delta - (fees.isInFLETH ? fees.amount : 0n),
|
|
16218
|
+
fees,
|
|
16219
|
+
},
|
|
16220
|
+
};
|
|
16221
|
+
}
|
|
16222
|
+
else {
|
|
16223
|
+
return {
|
|
16224
|
+
...log,
|
|
16225
|
+
timestamp,
|
|
16226
|
+
type: swapType,
|
|
16227
|
+
delta: {
|
|
16228
|
+
coinsSold: flETHIsCurrencyZero
|
|
16229
|
+
? absCurrency1Delta - (!fees.isInFLETH ? fees.amount : 0n)
|
|
16230
|
+
: absCurrency0Delta -
|
|
16231
|
+
(!fees.isInFLETH ? fees.amount : 0n),
|
|
16232
|
+
flETHBought: flETHIsCurrencyZero
|
|
16233
|
+
? absCurrency0Delta - (fees.isInFLETH ? fees.amount : 0n)
|
|
16234
|
+
: absCurrency1Delta - (fees.isInFLETH ? fees.amount : 0n),
|
|
16235
|
+
fees,
|
|
16236
|
+
},
|
|
16237
|
+
};
|
|
16238
|
+
}
|
|
16239
|
+
}));
|
|
16240
|
+
if (logsWithTimestamps.length > 0) {
|
|
16241
|
+
onPoolSwap({
|
|
16242
|
+
logs: logsWithTimestamps,
|
|
16243
|
+
isFetchingFromStart: false,
|
|
16244
|
+
});
|
|
16245
|
+
}
|
|
16246
|
+
else {
|
|
16247
|
+
onPoolSwap({
|
|
16248
|
+
logs: [],
|
|
16249
|
+
isFetchingFromStart: false,
|
|
16250
|
+
});
|
|
16251
|
+
}
|
|
16252
|
+
lastBlockNumber = currentBlockNumber;
|
|
16253
|
+
}
|
|
16254
|
+
}
|
|
16255
|
+
catch (error) {
|
|
16256
|
+
console.error("Error polling events:", error);
|
|
16257
|
+
}
|
|
16258
|
+
};
|
|
16259
|
+
intervalId = setInterval(pollEvents, 5000);
|
|
16260
|
+
this.pollPoolSwapNow = pollEvents;
|
|
16261
|
+
// Return both cleanup function and immediate poll function
|
|
16262
|
+
return {
|
|
16263
|
+
cleanup: () => {
|
|
16264
|
+
if (intervalId) {
|
|
16265
|
+
clearInterval(intervalId);
|
|
16266
|
+
}
|
|
16267
|
+
// Clear the pollNow function when cleaning up
|
|
16268
|
+
this.pollPoolSwapNow = undefined;
|
|
16269
|
+
},
|
|
16270
|
+
pollPoolSwapNow: pollEvents,
|
|
16271
|
+
};
|
|
16272
|
+
}
|
|
16273
|
+
}
|
|
16274
|
+
class ReadWriteAnyPositionManager extends ReadAnyPositionManager {
|
|
16275
|
+
constructor(address, drift = createDrift$1()) {
|
|
16276
|
+
super(address, drift);
|
|
16277
|
+
}
|
|
16278
|
+
async flaunch({ memecoin, initialMarketCapUSD, creator, creatorFeeAllocationPercent, }) {
|
|
16279
|
+
const initialMCapInUSDCWei = parseUnits(initialMarketCapUSD.toString(), 6);
|
|
16280
|
+
const initialPriceParams = encodeAbiParameters([
|
|
16281
|
+
{
|
|
16282
|
+
type: "uint256",
|
|
16283
|
+
},
|
|
16284
|
+
], [initialMCapInUSDCWei]);
|
|
16285
|
+
const creatorFeeAllocationInBps = creatorFeeAllocationPercent * 100;
|
|
16286
|
+
return this.contract.write("flaunch", {
|
|
16287
|
+
_params: {
|
|
16288
|
+
memecoin,
|
|
16289
|
+
creator,
|
|
16290
|
+
creatorFeeAllocation: creatorFeeAllocationInBps,
|
|
16291
|
+
initialPriceParams,
|
|
16292
|
+
feeCalculatorParams: "0x",
|
|
16293
|
+
},
|
|
16294
|
+
}, {
|
|
16295
|
+
onMined: async () => {
|
|
16296
|
+
if (this.pollPoolCreatedNow) {
|
|
16297
|
+
await this.pollPoolCreatedNow();
|
|
16298
|
+
}
|
|
16299
|
+
},
|
|
16300
|
+
});
|
|
16301
|
+
}
|
|
16302
|
+
}
|
|
16303
|
+
|
|
16304
|
+
const FeeEscrowAbi = [
|
|
16305
|
+
{
|
|
16306
|
+
inputs: [
|
|
16307
|
+
{ internalType: "address", name: "_nativeToken", type: "address" },
|
|
16308
|
+
{ internalType: "address", name: "_indexer", type: "address" },
|
|
16309
|
+
],
|
|
16310
|
+
stateMutability: "nonpayable",
|
|
16311
|
+
type: "constructor",
|
|
16312
|
+
},
|
|
16313
|
+
{ inputs: [], name: "AlreadyInitialized", type: "error" },
|
|
16314
|
+
{ inputs: [], name: "InvalidRecipient", type: "error" },
|
|
16315
|
+
{ inputs: [], name: "NewOwnerIsZeroAddress", type: "error" },
|
|
16316
|
+
{ inputs: [], name: "NoHandoverRequest", type: "error" },
|
|
16317
|
+
{ inputs: [], name: "PoolIdNotIndexed", type: "error" },
|
|
16318
|
+
{ inputs: [], name: "RecipientZeroAddress", type: "error" },
|
|
16319
|
+
{ inputs: [], name: "Unauthorized", type: "error" },
|
|
16320
|
+
{
|
|
16321
|
+
anonymous: false,
|
|
16322
|
+
inputs: [
|
|
16323
|
+
{
|
|
16324
|
+
indexed: true,
|
|
16325
|
+
internalType: "PoolId",
|
|
16326
|
+
name: "_poolId",
|
|
16327
|
+
type: "bytes32",
|
|
16328
|
+
},
|
|
16329
|
+
{
|
|
16330
|
+
indexed: false,
|
|
16331
|
+
internalType: "address",
|
|
16332
|
+
name: "_payee",
|
|
16333
|
+
type: "address",
|
|
16334
|
+
},
|
|
16335
|
+
{
|
|
16336
|
+
indexed: false,
|
|
16337
|
+
internalType: "address",
|
|
16338
|
+
name: "_token",
|
|
16339
|
+
type: "address",
|
|
16340
|
+
},
|
|
16341
|
+
{
|
|
16342
|
+
indexed: false,
|
|
16343
|
+
internalType: "uint256",
|
|
16344
|
+
name: "_amount",
|
|
16345
|
+
type: "uint256",
|
|
16346
|
+
},
|
|
16347
|
+
],
|
|
16348
|
+
name: "Deposit",
|
|
16349
|
+
type: "event",
|
|
16350
|
+
},
|
|
16351
|
+
{
|
|
16352
|
+
anonymous: false,
|
|
16353
|
+
inputs: [
|
|
16354
|
+
{
|
|
16355
|
+
indexed: true,
|
|
16356
|
+
internalType: "address",
|
|
16357
|
+
name: "pendingOwner",
|
|
16358
|
+
type: "address",
|
|
16359
|
+
},
|
|
16360
|
+
],
|
|
16361
|
+
name: "OwnershipHandoverCanceled",
|
|
16362
|
+
type: "event",
|
|
16363
|
+
},
|
|
16364
|
+
{
|
|
16365
|
+
anonymous: false,
|
|
16366
|
+
inputs: [
|
|
16367
|
+
{
|
|
16368
|
+
indexed: true,
|
|
16369
|
+
internalType: "address",
|
|
16370
|
+
name: "pendingOwner",
|
|
16371
|
+
type: "address",
|
|
16372
|
+
},
|
|
16373
|
+
],
|
|
16374
|
+
name: "OwnershipHandoverRequested",
|
|
16375
|
+
type: "event",
|
|
16376
|
+
},
|
|
16377
|
+
{
|
|
16378
|
+
anonymous: false,
|
|
16379
|
+
inputs: [
|
|
16380
|
+
{
|
|
16381
|
+
indexed: true,
|
|
16382
|
+
internalType: "address",
|
|
16383
|
+
name: "oldOwner",
|
|
16384
|
+
type: "address",
|
|
16385
|
+
},
|
|
16386
|
+
{
|
|
16387
|
+
indexed: true,
|
|
16388
|
+
internalType: "address",
|
|
16389
|
+
name: "newOwner",
|
|
16390
|
+
type: "address",
|
|
16391
|
+
},
|
|
16392
|
+
],
|
|
16393
|
+
name: "OwnershipTransferred",
|
|
16394
|
+
type: "event",
|
|
16395
|
+
},
|
|
16396
|
+
{
|
|
16397
|
+
anonymous: false,
|
|
16398
|
+
inputs: [
|
|
16399
|
+
{
|
|
16400
|
+
indexed: false,
|
|
16401
|
+
internalType: "address",
|
|
16402
|
+
name: "_sender",
|
|
16403
|
+
type: "address",
|
|
16404
|
+
},
|
|
16405
|
+
{
|
|
16406
|
+
indexed: false,
|
|
16407
|
+
internalType: "address",
|
|
16408
|
+
name: "_recipient",
|
|
16409
|
+
type: "address",
|
|
16410
|
+
},
|
|
16411
|
+
{
|
|
16412
|
+
indexed: false,
|
|
16413
|
+
internalType: "address",
|
|
16414
|
+
name: "_token",
|
|
16415
|
+
type: "address",
|
|
16416
|
+
},
|
|
16417
|
+
{
|
|
16418
|
+
indexed: false,
|
|
16419
|
+
internalType: "uint256",
|
|
16420
|
+
name: "_amount",
|
|
16421
|
+
type: "uint256",
|
|
16422
|
+
},
|
|
16423
|
+
],
|
|
16424
|
+
name: "Withdrawal",
|
|
16425
|
+
type: "event",
|
|
16426
|
+
},
|
|
16427
|
+
{
|
|
16428
|
+
inputs: [
|
|
16429
|
+
{ internalType: "PoolId", name: "_poolId", type: "bytes32" },
|
|
16430
|
+
{ internalType: "address", name: "_recipient", type: "address" },
|
|
16431
|
+
{ internalType: "uint256", name: "_amount", type: "uint256" },
|
|
16432
|
+
],
|
|
16433
|
+
name: "allocateFees",
|
|
16434
|
+
outputs: [],
|
|
16435
|
+
stateMutability: "nonpayable",
|
|
16436
|
+
type: "function",
|
|
16437
|
+
},
|
|
16438
|
+
{
|
|
16439
|
+
inputs: [{ internalType: "address", name: "_recipient", type: "address" }],
|
|
16440
|
+
name: "balances",
|
|
16441
|
+
outputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }],
|
|
16442
|
+
stateMutability: "view",
|
|
16443
|
+
type: "function",
|
|
16444
|
+
},
|
|
16445
|
+
{
|
|
16446
|
+
inputs: [],
|
|
16447
|
+
name: "cancelOwnershipHandover",
|
|
16448
|
+
outputs: [],
|
|
16449
|
+
stateMutability: "payable",
|
|
16450
|
+
type: "function",
|
|
16451
|
+
},
|
|
16452
|
+
{
|
|
16453
|
+
inputs: [
|
|
16454
|
+
{ internalType: "address", name: "pendingOwner", type: "address" },
|
|
16455
|
+
],
|
|
16456
|
+
name: "completeOwnershipHandover",
|
|
16457
|
+
outputs: [],
|
|
16458
|
+
stateMutability: "payable",
|
|
16459
|
+
type: "function",
|
|
16460
|
+
},
|
|
16461
|
+
{
|
|
16462
|
+
inputs: [],
|
|
16463
|
+
name: "indexer",
|
|
16464
|
+
outputs: [
|
|
16465
|
+
{ internalType: "contract IndexerSubscriber", name: "", type: "address" },
|
|
16466
|
+
],
|
|
16467
|
+
stateMutability: "view",
|
|
16468
|
+
type: "function",
|
|
16469
|
+
},
|
|
16470
|
+
{
|
|
16471
|
+
inputs: [],
|
|
16472
|
+
name: "nativeToken",
|
|
16473
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
16474
|
+
stateMutability: "view",
|
|
16475
|
+
type: "function",
|
|
16476
|
+
},
|
|
16477
|
+
{
|
|
16478
|
+
inputs: [],
|
|
16479
|
+
name: "owner",
|
|
16480
|
+
outputs: [{ internalType: "address", name: "result", type: "address" }],
|
|
16481
|
+
stateMutability: "view",
|
|
16482
|
+
type: "function",
|
|
16483
|
+
},
|
|
16484
|
+
{
|
|
16485
|
+
inputs: [
|
|
16486
|
+
{ internalType: "address", name: "pendingOwner", type: "address" },
|
|
16487
|
+
],
|
|
16488
|
+
name: "ownershipHandoverExpiresAt",
|
|
16489
|
+
outputs: [{ internalType: "uint256", name: "result", type: "uint256" }],
|
|
16490
|
+
stateMutability: "view",
|
|
16491
|
+
type: "function",
|
|
16492
|
+
},
|
|
16493
|
+
{
|
|
16494
|
+
inputs: [],
|
|
16495
|
+
name: "renounceOwnership",
|
|
16496
|
+
outputs: [],
|
|
16497
|
+
stateMutability: "payable",
|
|
16498
|
+
type: "function",
|
|
16499
|
+
},
|
|
16500
|
+
{
|
|
16501
|
+
inputs: [],
|
|
16502
|
+
name: "requestOwnershipHandover",
|
|
16503
|
+
outputs: [],
|
|
16504
|
+
stateMutability: "payable",
|
|
16505
|
+
type: "function",
|
|
16506
|
+
},
|
|
16507
|
+
{
|
|
16508
|
+
inputs: [{ internalType: "address", name: "_indexer", type: "address" }],
|
|
16509
|
+
name: "setIndexer",
|
|
16510
|
+
outputs: [],
|
|
16511
|
+
stateMutability: "nonpayable",
|
|
16512
|
+
type: "function",
|
|
16513
|
+
},
|
|
16514
|
+
{
|
|
16515
|
+
inputs: [{ internalType: "PoolId", name: "_poolId", type: "bytes32" }],
|
|
16516
|
+
name: "totalFeesAllocated",
|
|
16517
|
+
outputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }],
|
|
16518
|
+
stateMutability: "view",
|
|
16519
|
+
type: "function",
|
|
16520
|
+
},
|
|
16521
|
+
{
|
|
16522
|
+
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
|
|
16523
|
+
name: "transferOwnership",
|
|
16524
|
+
outputs: [],
|
|
16525
|
+
stateMutability: "payable",
|
|
16526
|
+
type: "function",
|
|
16527
|
+
},
|
|
16528
|
+
{
|
|
16529
|
+
inputs: [
|
|
16530
|
+
{ internalType: "address", name: "_recipient", type: "address" },
|
|
16531
|
+
{ internalType: "bool", name: "_unwrap", type: "bool" },
|
|
16532
|
+
],
|
|
16533
|
+
name: "withdrawFees",
|
|
16534
|
+
outputs: [],
|
|
16535
|
+
stateMutability: "nonpayable",
|
|
16536
|
+
type: "function",
|
|
16537
|
+
},
|
|
16538
|
+
{ stateMutability: "payable", type: "receive" },
|
|
16539
|
+
];
|
|
16540
|
+
|
|
16541
|
+
/**
|
|
16542
|
+
* Client for interacting with the FeeEscrow contract in read-only mode
|
|
16543
|
+
* Provides methods to query fee balances and withdraw fees
|
|
16544
|
+
*/
|
|
16545
|
+
class ReadFeeEscrow {
|
|
16546
|
+
/**
|
|
16547
|
+
* Creates a new ReadFeeEscrow instance
|
|
16548
|
+
* @param address - The address of the FeeEscrow contract
|
|
16549
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
16550
|
+
* @throws Error if address is not provided
|
|
16551
|
+
*/
|
|
16552
|
+
constructor(address, drift = createDrift$1()) {
|
|
16553
|
+
if (!address) {
|
|
16554
|
+
throw new Error("Address is required");
|
|
16555
|
+
}
|
|
16556
|
+
this.contract = drift.contract({
|
|
16557
|
+
abi: FeeEscrowAbi,
|
|
16558
|
+
address,
|
|
16559
|
+
});
|
|
16560
|
+
}
|
|
16561
|
+
/**
|
|
16562
|
+
* Gets the claimable balance of fees for a creator
|
|
16563
|
+
* @param creator - The address of the creator to check
|
|
16564
|
+
* @returns Promise<bigint> - The claimable balance of fees
|
|
16565
|
+
*/
|
|
16566
|
+
balances(creator) {
|
|
16567
|
+
return this.contract.read("balances", {
|
|
16568
|
+
_recipient: creator,
|
|
16569
|
+
});
|
|
16570
|
+
}
|
|
16571
|
+
}
|
|
16572
|
+
/**
|
|
16573
|
+
* Extended client for interacting with the FeeEscrow contract with write capabilities
|
|
16574
|
+
* Provides methods to withdraw fees
|
|
16575
|
+
*/
|
|
16576
|
+
class ReadWriteFeeEscrow extends ReadFeeEscrow {
|
|
16577
|
+
constructor(address, drift = createDrift$1()) {
|
|
16578
|
+
super(address, drift);
|
|
16579
|
+
}
|
|
16580
|
+
/**
|
|
16581
|
+
* Withdraws fees as ETH to a recipient
|
|
16582
|
+
* @param recipient - The address to receive the fees
|
|
16583
|
+
* @param unwrap - Whether to unwrap the native token before sending
|
|
16584
|
+
* @returns Promise<void>
|
|
16585
|
+
*/
|
|
16586
|
+
withdrawFees(recipient) {
|
|
16587
|
+
return this.contract.write("withdrawFees", {
|
|
16588
|
+
_recipient: recipient,
|
|
16589
|
+
_unwrap: true,
|
|
16590
|
+
});
|
|
16591
|
+
}
|
|
16592
|
+
}
|
|
16593
|
+
|
|
16594
|
+
const ReferralEscrowAbi = [
|
|
16595
|
+
{
|
|
16596
|
+
inputs: [
|
|
16597
|
+
{ internalType: "address", name: "_nativeToken", type: "address" },
|
|
16598
|
+
{ internalType: "address", name: "_positionManager", type: "address" },
|
|
16599
|
+
],
|
|
16600
|
+
stateMutability: "nonpayable",
|
|
16601
|
+
type: "constructor",
|
|
16602
|
+
},
|
|
16603
|
+
{ inputs: [], name: "AlreadyInitialized", type: "error" },
|
|
16604
|
+
{ inputs: [], name: "MismatchedTokensAndLimits", type: "error" },
|
|
16605
|
+
{ inputs: [], name: "NewOwnerIsZeroAddress", type: "error" },
|
|
16606
|
+
{ inputs: [], name: "NoHandoverRequest", type: "error" },
|
|
16607
|
+
{ inputs: [], name: "Unauthorized", type: "error" },
|
|
16608
|
+
{
|
|
16609
|
+
anonymous: false,
|
|
16610
|
+
inputs: [
|
|
16611
|
+
{
|
|
16612
|
+
indexed: true,
|
|
16613
|
+
internalType: "address",
|
|
16614
|
+
name: "pendingOwner",
|
|
16615
|
+
type: "address",
|
|
16616
|
+
},
|
|
16617
|
+
],
|
|
16618
|
+
name: "OwnershipHandoverCanceled",
|
|
16619
|
+
type: "event",
|
|
16620
|
+
},
|
|
16621
|
+
{
|
|
16622
|
+
anonymous: false,
|
|
16623
|
+
inputs: [
|
|
16624
|
+
{
|
|
16625
|
+
indexed: true,
|
|
16626
|
+
internalType: "address",
|
|
16627
|
+
name: "pendingOwner",
|
|
16628
|
+
type: "address",
|
|
16629
|
+
},
|
|
16630
|
+
],
|
|
16631
|
+
name: "OwnershipHandoverRequested",
|
|
16632
|
+
type: "event",
|
|
16633
|
+
},
|
|
16634
|
+
{
|
|
16635
|
+
anonymous: false,
|
|
16636
|
+
inputs: [
|
|
16637
|
+
{
|
|
16638
|
+
indexed: true,
|
|
16639
|
+
internalType: "address",
|
|
16640
|
+
name: "oldOwner",
|
|
16641
|
+
type: "address",
|
|
16642
|
+
},
|
|
16643
|
+
{
|
|
16644
|
+
indexed: true,
|
|
16645
|
+
internalType: "address",
|
|
16646
|
+
name: "newOwner",
|
|
16647
|
+
type: "address",
|
|
16648
|
+
},
|
|
16649
|
+
],
|
|
16650
|
+
name: "OwnershipTransferred",
|
|
16651
|
+
type: "event",
|
|
16652
|
+
},
|
|
16653
|
+
{
|
|
16654
|
+
anonymous: false,
|
|
16655
|
+
inputs: [
|
|
16656
|
+
{
|
|
16657
|
+
indexed: true,
|
|
16658
|
+
internalType: "PoolId",
|
|
16659
|
+
name: "_poolId",
|
|
16660
|
+
type: "bytes32",
|
|
16661
|
+
},
|
|
16662
|
+
{
|
|
16663
|
+
indexed: true,
|
|
16664
|
+
internalType: "address",
|
|
16665
|
+
name: "_user",
|
|
16666
|
+
type: "address",
|
|
16667
|
+
},
|
|
16668
|
+
{
|
|
16669
|
+
indexed: true,
|
|
16670
|
+
internalType: "address",
|
|
16671
|
+
name: "_token",
|
|
16672
|
+
type: "address",
|
|
16673
|
+
},
|
|
16674
|
+
{
|
|
16675
|
+
indexed: false,
|
|
16676
|
+
internalType: "uint256",
|
|
16677
|
+
name: "_amount",
|
|
16678
|
+
type: "uint256",
|
|
16679
|
+
},
|
|
16680
|
+
],
|
|
16681
|
+
name: "TokensAssigned",
|
|
16682
|
+
type: "event",
|
|
16683
|
+
},
|
|
16684
|
+
{
|
|
16685
|
+
anonymous: false,
|
|
16686
|
+
inputs: [
|
|
16687
|
+
{
|
|
16688
|
+
indexed: true,
|
|
16689
|
+
internalType: "address",
|
|
16690
|
+
name: "_user",
|
|
16691
|
+
type: "address",
|
|
16692
|
+
},
|
|
16693
|
+
{
|
|
16694
|
+
indexed: false,
|
|
16695
|
+
internalType: "address",
|
|
16696
|
+
name: "_recipient",
|
|
16697
|
+
type: "address",
|
|
16698
|
+
},
|
|
16699
|
+
{
|
|
16700
|
+
indexed: true,
|
|
16701
|
+
internalType: "address",
|
|
16702
|
+
name: "_token",
|
|
16703
|
+
type: "address",
|
|
16704
|
+
},
|
|
16705
|
+
{
|
|
16706
|
+
indexed: false,
|
|
16707
|
+
internalType: "uint256",
|
|
16708
|
+
name: "_amount",
|
|
16709
|
+
type: "uint256",
|
|
16710
|
+
},
|
|
16711
|
+
],
|
|
16712
|
+
name: "TokensClaimed",
|
|
16713
|
+
type: "event",
|
|
16714
|
+
},
|
|
16715
|
+
{
|
|
16716
|
+
anonymous: false,
|
|
16717
|
+
inputs: [
|
|
16718
|
+
{
|
|
16719
|
+
indexed: true,
|
|
16720
|
+
internalType: "address",
|
|
16721
|
+
name: "_user",
|
|
16722
|
+
type: "address",
|
|
16723
|
+
},
|
|
16724
|
+
{
|
|
16725
|
+
indexed: true,
|
|
16726
|
+
internalType: "address",
|
|
16727
|
+
name: "_token",
|
|
16728
|
+
type: "address",
|
|
16729
|
+
},
|
|
16730
|
+
{
|
|
16731
|
+
indexed: false,
|
|
16732
|
+
internalType: "uint256",
|
|
16733
|
+
name: "_tokenIn",
|
|
16734
|
+
type: "uint256",
|
|
16735
|
+
},
|
|
16736
|
+
{
|
|
16737
|
+
indexed: false,
|
|
16738
|
+
internalType: "uint256",
|
|
16739
|
+
name: "_ethOut",
|
|
16740
|
+
type: "uint256",
|
|
16741
|
+
},
|
|
16742
|
+
],
|
|
16743
|
+
name: "TokensSwapped",
|
|
16744
|
+
type: "event",
|
|
16745
|
+
},
|
|
16746
|
+
{
|
|
16747
|
+
inputs: [
|
|
16748
|
+
{ internalType: "address", name: "_user", type: "address" },
|
|
16749
|
+
{ internalType: "address", name: "_token", type: "address" },
|
|
16750
|
+
],
|
|
16751
|
+
name: "allocations",
|
|
16752
|
+
outputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }],
|
|
16753
|
+
stateMutability: "view",
|
|
16754
|
+
type: "function",
|
|
16755
|
+
},
|
|
16756
|
+
{
|
|
16757
|
+
inputs: [
|
|
16758
|
+
{ internalType: "PoolId", name: "_poolId", type: "bytes32" },
|
|
16759
|
+
{ internalType: "address", name: "_user", type: "address" },
|
|
16760
|
+
{ internalType: "address", name: "_token", type: "address" },
|
|
16761
|
+
{ internalType: "uint256", name: "_amount", type: "uint256" },
|
|
16762
|
+
],
|
|
16763
|
+
name: "assignTokens",
|
|
16764
|
+
outputs: [],
|
|
16765
|
+
stateMutability: "nonpayable",
|
|
16766
|
+
type: "function",
|
|
16767
|
+
},
|
|
16768
|
+
{
|
|
16769
|
+
inputs: [],
|
|
16770
|
+
name: "cancelOwnershipHandover",
|
|
16771
|
+
outputs: [],
|
|
16772
|
+
stateMutability: "payable",
|
|
16773
|
+
type: "function",
|
|
16774
|
+
},
|
|
16775
|
+
{
|
|
16776
|
+
inputs: [
|
|
16777
|
+
{ internalType: "address[]", name: "_tokens", type: "address[]" },
|
|
16778
|
+
{
|
|
16779
|
+
internalType: "uint160[]",
|
|
16780
|
+
name: "_sqrtPriceX96Limits",
|
|
16781
|
+
type: "uint160[]",
|
|
16782
|
+
},
|
|
16783
|
+
{ internalType: "address payable", name: "_recipient", type: "address" },
|
|
16784
|
+
],
|
|
16785
|
+
name: "claimAndSwap",
|
|
16786
|
+
outputs: [],
|
|
16787
|
+
stateMutability: "nonpayable",
|
|
16788
|
+
type: "function",
|
|
16789
|
+
},
|
|
16790
|
+
{
|
|
16791
|
+
inputs: [
|
|
16792
|
+
{ internalType: "address[]", name: "_tokens", type: "address[]" },
|
|
16793
|
+
{ internalType: "address payable", name: "_recipient", type: "address" },
|
|
16794
|
+
],
|
|
16795
|
+
name: "claimTokens",
|
|
16796
|
+
outputs: [],
|
|
16797
|
+
stateMutability: "nonpayable",
|
|
16798
|
+
type: "function",
|
|
16799
|
+
},
|
|
16800
|
+
{
|
|
16801
|
+
inputs: [
|
|
16802
|
+
{ internalType: "address", name: "pendingOwner", type: "address" },
|
|
16803
|
+
],
|
|
16804
|
+
name: "completeOwnershipHandover",
|
|
16805
|
+
outputs: [],
|
|
16806
|
+
stateMutability: "payable",
|
|
16807
|
+
type: "function",
|
|
16808
|
+
},
|
|
16809
|
+
{
|
|
16810
|
+
inputs: [],
|
|
16811
|
+
name: "nativeToken",
|
|
16812
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
16813
|
+
stateMutability: "view",
|
|
16814
|
+
type: "function",
|
|
16815
|
+
},
|
|
16816
|
+
{
|
|
16817
|
+
inputs: [],
|
|
16818
|
+
name: "owner",
|
|
16819
|
+
outputs: [{ internalType: "address", name: "result", type: "address" }],
|
|
16820
|
+
stateMutability: "view",
|
|
16821
|
+
type: "function",
|
|
16822
|
+
},
|
|
16823
|
+
{
|
|
16824
|
+
inputs: [
|
|
16825
|
+
{ internalType: "address", name: "pendingOwner", type: "address" },
|
|
16826
|
+
],
|
|
16827
|
+
name: "ownershipHandoverExpiresAt",
|
|
16828
|
+
outputs: [{ internalType: "uint256", name: "result", type: "uint256" }],
|
|
16829
|
+
stateMutability: "view",
|
|
16830
|
+
type: "function",
|
|
16831
|
+
},
|
|
16832
|
+
{
|
|
16833
|
+
inputs: [],
|
|
16834
|
+
name: "poolSwap",
|
|
16835
|
+
outputs: [{ internalType: "contract PoolSwap", name: "", type: "address" }],
|
|
16836
|
+
stateMutability: "view",
|
|
16837
|
+
type: "function",
|
|
16838
|
+
},
|
|
16839
|
+
{
|
|
16840
|
+
inputs: [],
|
|
16841
|
+
name: "positionManager",
|
|
16842
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
16843
|
+
stateMutability: "view",
|
|
16844
|
+
type: "function",
|
|
16845
|
+
},
|
|
16846
|
+
{
|
|
16847
|
+
inputs: [],
|
|
16848
|
+
name: "renounceOwnership",
|
|
16849
|
+
outputs: [],
|
|
16850
|
+
stateMutability: "payable",
|
|
16851
|
+
type: "function",
|
|
16852
|
+
},
|
|
16853
|
+
{
|
|
16854
|
+
inputs: [],
|
|
16855
|
+
name: "requestOwnershipHandover",
|
|
16856
|
+
outputs: [],
|
|
16857
|
+
stateMutability: "payable",
|
|
16858
|
+
type: "function",
|
|
16859
|
+
},
|
|
16860
|
+
{
|
|
16861
|
+
inputs: [{ internalType: "address", name: "_poolSwap", type: "address" }],
|
|
16862
|
+
name: "setPoolSwap",
|
|
16863
|
+
outputs: [],
|
|
16864
|
+
stateMutability: "nonpayable",
|
|
16865
|
+
type: "function",
|
|
16866
|
+
},
|
|
16867
|
+
{
|
|
16868
|
+
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
|
|
16869
|
+
name: "transferOwnership",
|
|
16870
|
+
outputs: [],
|
|
16871
|
+
stateMutability: "payable",
|
|
16872
|
+
type: "function",
|
|
16873
|
+
},
|
|
16874
|
+
{ stateMutability: "payable", type: "receive" },
|
|
16875
|
+
];
|
|
16876
|
+
|
|
16877
|
+
/**
|
|
16878
|
+
* Client for interacting with the ReferralEscrow contract in read-only mode
|
|
16879
|
+
* Provides methods to query token allocations
|
|
16880
|
+
*/
|
|
16881
|
+
class ReadReferralEscrow {
|
|
16882
|
+
/**
|
|
16883
|
+
* Creates a new ReadReferralEscrow instance
|
|
16884
|
+
* @param address - The address of the ReferralEscrow contract
|
|
16885
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
16886
|
+
* @throws Error if address is not provided
|
|
16887
|
+
*/
|
|
16888
|
+
constructor(address, drift = createDrift$1()) {
|
|
16889
|
+
if (!address) {
|
|
16890
|
+
throw new Error("Address is required");
|
|
16891
|
+
}
|
|
16892
|
+
this.contract = drift.contract({
|
|
16893
|
+
abi: ReferralEscrowAbi,
|
|
16894
|
+
address,
|
|
16895
|
+
});
|
|
16896
|
+
}
|
|
16897
|
+
/**
|
|
16898
|
+
* Gets the token allocation for a specific user and token
|
|
16899
|
+
* @param user - The address of the user to check
|
|
16900
|
+
* @param token - The address of the token
|
|
16901
|
+
* @returns Promise<bigint> - The allocated token amount
|
|
16902
|
+
*/
|
|
16903
|
+
allocations(user, token) {
|
|
16904
|
+
return this.contract.read("allocations", {
|
|
16905
|
+
_user: user,
|
|
16906
|
+
_token: token,
|
|
16907
|
+
});
|
|
16908
|
+
}
|
|
16909
|
+
}
|
|
16910
|
+
/**
|
|
16911
|
+
* Extended client for interacting with the ReferralEscrow contract with write capabilities
|
|
16912
|
+
* Provides methods to claim tokens
|
|
16913
|
+
*/
|
|
16914
|
+
class ReadWriteReferralEscrow extends ReadReferralEscrow {
|
|
16915
|
+
constructor(address, drift = createDrift$1()) {
|
|
16916
|
+
super(address, drift);
|
|
16917
|
+
}
|
|
16918
|
+
/**
|
|
16919
|
+
* Claims tokens for a recipient
|
|
16920
|
+
* @param tokens - Array of token addresses to claim
|
|
16921
|
+
* @param recipient - The address to receive the claimed tokens
|
|
16922
|
+
* @returns Promise<void>
|
|
16923
|
+
*/
|
|
16924
|
+
claimTokens(tokens, recipient) {
|
|
16925
|
+
return this.contract.write("claimTokens", {
|
|
16926
|
+
_tokens: tokens,
|
|
16927
|
+
_recipient: recipient,
|
|
16928
|
+
});
|
|
16929
|
+
}
|
|
16930
|
+
}
|
|
16931
|
+
|
|
16932
|
+
const BidWallV1_1Abi = [
|
|
16933
|
+
{
|
|
16934
|
+
inputs: [
|
|
16935
|
+
{ internalType: "address", name: "_nativeToken", type: "address" },
|
|
16936
|
+
{ internalType: "address", name: "_poolManager", type: "address" },
|
|
16937
|
+
{ internalType: "address", name: "_protocolOwner", type: "address" },
|
|
16938
|
+
],
|
|
16939
|
+
stateMutability: "nonpayable",
|
|
16940
|
+
type: "constructor",
|
|
16941
|
+
},
|
|
16942
|
+
{ inputs: [], name: "AccessControlBadConfirmation", type: "error" },
|
|
16943
|
+
{
|
|
16944
|
+
inputs: [
|
|
16945
|
+
{ internalType: "address", name: "account", type: "address" },
|
|
16946
|
+
{ internalType: "bytes32", name: "neededRole", type: "bytes32" },
|
|
16947
|
+
],
|
|
16948
|
+
name: "AccessControlUnauthorizedAccount",
|
|
16949
|
+
type: "error",
|
|
16950
|
+
},
|
|
16951
|
+
{ inputs: [], name: "AlreadyInitialized", type: "error" },
|
|
16952
|
+
{ inputs: [], name: "CallerIsNotCreator", type: "error" },
|
|
14670
16953
|
{ inputs: [], name: "NewOwnerIsZeroAddress", type: "error" },
|
|
14671
16954
|
{ inputs: [], name: "NoHandoverRequest", type: "error" },
|
|
14672
16955
|
{ inputs: [], name: "NotPositionManager", type: "error" },
|
|
@@ -15247,7 +17530,7 @@ class ReadBidWallV1_1 {
|
|
|
15247
17530
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
15248
17531
|
* @throws Error if address is not provided
|
|
15249
17532
|
*/
|
|
15250
|
-
constructor(address, drift = createDrift()) {
|
|
17533
|
+
constructor(address, drift = createDrift$1()) {
|
|
15251
17534
|
if (!address) {
|
|
15252
17535
|
throw new Error("Address is required");
|
|
15253
17536
|
}
|
|
@@ -15655,7 +17938,7 @@ class ReadFairLaunchV1_1 {
|
|
|
15655
17938
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
15656
17939
|
* @throws Error if address is not provided
|
|
15657
17940
|
*/
|
|
15658
|
-
constructor(address, drift = createDrift()) {
|
|
17941
|
+
constructor(address, drift = createDrift$1()) {
|
|
15659
17942
|
if (!address) {
|
|
15660
17943
|
throw new Error("Address is required");
|
|
15661
17944
|
}
|
|
@@ -16320,7 +18603,7 @@ class ReadFlaunchV1_1 {
|
|
|
16320
18603
|
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
16321
18604
|
* @throws Error if address is not provided
|
|
16322
18605
|
*/
|
|
16323
|
-
constructor(address, drift = createDrift()) {
|
|
18606
|
+
constructor(address, drift = createDrift$1()) {
|
|
16324
18607
|
if (!address) {
|
|
16325
18608
|
throw new Error("Address is required");
|
|
16326
18609
|
}
|
|
@@ -16734,7 +19017,7 @@ const TreasuryManagerFactoryAbi = [
|
|
|
16734
19017
|
];
|
|
16735
19018
|
|
|
16736
19019
|
class ReadTreasuryManagerFactory {
|
|
16737
|
-
constructor(address, drift = createDrift()) {
|
|
19020
|
+
constructor(address, drift = createDrift$1()) {
|
|
16738
19021
|
if (!address) {
|
|
16739
19022
|
throw new Error("Address is required");
|
|
16740
19023
|
}
|
|
@@ -16745,7 +19028,7 @@ class ReadTreasuryManagerFactory {
|
|
|
16745
19028
|
}
|
|
16746
19029
|
}
|
|
16747
19030
|
class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
|
|
16748
|
-
constructor(chainId, address, drift = createDrift()) {
|
|
19031
|
+
constructor(chainId, address, drift = createDrift$1()) {
|
|
16749
19032
|
super(address, drift);
|
|
16750
19033
|
this.chainId = chainId;
|
|
16751
19034
|
}
|
|
@@ -17811,7 +20094,7 @@ class ReadMulticall {
|
|
|
17811
20094
|
}
|
|
17812
20095
|
|
|
17813
20096
|
class ReadRevenueManager {
|
|
17814
|
-
constructor(address, drift = createDrift()) {
|
|
20097
|
+
constructor(address, drift = createDrift$1()) {
|
|
17815
20098
|
this.drift = drift;
|
|
17816
20099
|
this.contract = drift.contract({
|
|
17817
20100
|
abi: RevenueManagerAbi,
|
|
@@ -17882,7 +20165,7 @@ class ReadRevenueManager {
|
|
|
17882
20165
|
}
|
|
17883
20166
|
}
|
|
17884
20167
|
class ReadWriteRevenueManager extends ReadRevenueManager {
|
|
17885
|
-
constructor(address, drift = createDrift()) {
|
|
20168
|
+
constructor(address, drift = createDrift$1()) {
|
|
17886
20169
|
super(address, drift);
|
|
17887
20170
|
}
|
|
17888
20171
|
/**
|
|
@@ -17911,6 +20194,17 @@ class ReadWriteRevenueManager extends ReadRevenueManager {
|
|
|
17911
20194
|
}
|
|
17912
20195
|
}
|
|
17913
20196
|
|
|
20197
|
+
/**
|
|
20198
|
+
* Enumeration of Flaunch contract versions
|
|
20199
|
+
*/
|
|
20200
|
+
var FlaunchVersion;
|
|
20201
|
+
(function (FlaunchVersion) {
|
|
20202
|
+
FlaunchVersion["V1"] = "V1";
|
|
20203
|
+
FlaunchVersion["V1_1"] = "V1_1";
|
|
20204
|
+
FlaunchVersion["V1_1_1"] = "V1_1_1";
|
|
20205
|
+
FlaunchVersion["ANY"] = "ANY";
|
|
20206
|
+
})(FlaunchVersion || (FlaunchVersion = {}));
|
|
20207
|
+
|
|
17914
20208
|
// our min/max tick range that is valid for the tick spacing (60)
|
|
17915
20209
|
const TickFinder = {
|
|
17916
20210
|
MIN_TICK: -887220,
|
|
@@ -18007,17 +20301,83 @@ const chainIdToChain = {
|
|
|
18007
20301
|
[baseSepolia.id]: baseSepolia,
|
|
18008
20302
|
};
|
|
18009
20303
|
|
|
20304
|
+
const FastFlaunchZapAbi = [
|
|
20305
|
+
{
|
|
20306
|
+
inputs: [
|
|
20307
|
+
{
|
|
20308
|
+
internalType: "contract PositionManager",
|
|
20309
|
+
name: "_positionManager",
|
|
20310
|
+
type: "address",
|
|
20311
|
+
},
|
|
20312
|
+
],
|
|
20313
|
+
stateMutability: "nonpayable",
|
|
20314
|
+
type: "constructor",
|
|
20315
|
+
},
|
|
20316
|
+
{
|
|
20317
|
+
inputs: [],
|
|
20318
|
+
name: "CREATOR_FEE_ALLOCATION",
|
|
20319
|
+
outputs: [{ internalType: "uint24", name: "", type: "uint24" }],
|
|
20320
|
+
stateMutability: "view",
|
|
20321
|
+
type: "function",
|
|
20322
|
+
},
|
|
20323
|
+
{
|
|
20324
|
+
inputs: [],
|
|
20325
|
+
name: "FAIR_LAUNCH_SUPPLY",
|
|
20326
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
20327
|
+
stateMutability: "view",
|
|
20328
|
+
type: "function",
|
|
20329
|
+
},
|
|
20330
|
+
{
|
|
20331
|
+
inputs: [],
|
|
20332
|
+
name: "USDC_MARKET_CAP",
|
|
20333
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
20334
|
+
stateMutability: "view",
|
|
20335
|
+
type: "function",
|
|
20336
|
+
},
|
|
20337
|
+
{
|
|
20338
|
+
inputs: [
|
|
20339
|
+
{
|
|
20340
|
+
components: [
|
|
20341
|
+
{ internalType: "string", name: "name", type: "string" },
|
|
20342
|
+
{ internalType: "string", name: "symbol", type: "string" },
|
|
20343
|
+
{ internalType: "string", name: "tokenUri", type: "string" },
|
|
20344
|
+
{ internalType: "address", name: "creator", type: "address" },
|
|
20345
|
+
],
|
|
20346
|
+
internalType: "struct FastFlaunchZap.FastFlaunchParams",
|
|
20347
|
+
name: "_params",
|
|
20348
|
+
type: "tuple",
|
|
20349
|
+
},
|
|
20350
|
+
],
|
|
20351
|
+
name: "flaunch",
|
|
20352
|
+
outputs: [{ internalType: "address", name: "memecoin_", type: "address" }],
|
|
20353
|
+
stateMutability: "nonpayable",
|
|
20354
|
+
type: "function",
|
|
20355
|
+
},
|
|
20356
|
+
{
|
|
20357
|
+
inputs: [],
|
|
20358
|
+
name: "positionManager",
|
|
20359
|
+
outputs: [
|
|
20360
|
+
{ internalType: "contract PositionManager", name: "", type: "address" },
|
|
20361
|
+
],
|
|
20362
|
+
stateMutability: "view",
|
|
20363
|
+
type: "function",
|
|
20364
|
+
},
|
|
20365
|
+
];
|
|
20366
|
+
|
|
18010
20367
|
/**
|
|
18011
20368
|
* Base class for interacting with Flaunch protocol in read-only mode
|
|
18012
20369
|
*/
|
|
18013
20370
|
class ReadFlaunchSDK {
|
|
18014
|
-
constructor(chainId, drift = createDrift()) {
|
|
20371
|
+
constructor(chainId, drift = createDrift$1()) {
|
|
18015
20372
|
this.TICK_SPACING = TICK_SPACING;
|
|
18016
20373
|
this.chainId = chainId;
|
|
18017
20374
|
this.drift = drift;
|
|
18018
20375
|
this.resolveIPFS = resolveIPFS;
|
|
18019
20376
|
this.readPositionManager = new ReadFlaunchPositionManager(FlaunchPositionManagerAddress[this.chainId], drift);
|
|
18020
20377
|
this.readPositionManagerV1_1 = new ReadFlaunchPositionManagerV1_1(FlaunchPositionManagerV1_1Address[this.chainId], drift);
|
|
20378
|
+
this.readAnyPositionManager = new ReadAnyPositionManager(AnyPositionManagerAddress[this.chainId], drift);
|
|
20379
|
+
this.readFeeEscrow = new ReadFeeEscrow(FeeEscrowAddress[this.chainId], drift);
|
|
20380
|
+
this.readReferralEscrow = new ReadReferralEscrow(ReferralEscrowAddress[this.chainId], drift);
|
|
18021
20381
|
this.readFlaunchZap = new ReadFlaunchZap(this.chainId, FlaunchZapAddress[this.chainId], drift);
|
|
18022
20382
|
this.readPoolManager = new ReadPoolManager(PoolManagerAddress[this.chainId], drift);
|
|
18023
20383
|
this.readStateView = new ReadStateView(StateViewAddress[this.chainId], drift);
|
|
@@ -18031,21 +20391,89 @@ class ReadFlaunchSDK {
|
|
|
18031
20391
|
this.readPermit2 = new ReadPermit2(Permit2Address[this.chainId], drift);
|
|
18032
20392
|
}
|
|
18033
20393
|
/**
|
|
18034
|
-
* Checks if a given coin address is a valid Flaunch coin (
|
|
20394
|
+
* Checks if a given coin address is a valid Flaunch coin (supports all versions)
|
|
18035
20395
|
* @param coinAddress - The address of the coin to check
|
|
18036
20396
|
* @returns Promise<boolean> - True if the coin is valid, false otherwise
|
|
18037
20397
|
*/
|
|
18038
20398
|
async isValidCoin(coinAddress) {
|
|
18039
20399
|
return ((await this.readPositionManagerV1_1.isValidCoin(coinAddress)) ||
|
|
18040
|
-
(await this.readPositionManager.isValidCoin(coinAddress))
|
|
20400
|
+
(await this.readPositionManager.isValidCoin(coinAddress)) ||
|
|
20401
|
+
(await this.readAnyPositionManager.isValidCoin(coinAddress)));
|
|
18041
20402
|
}
|
|
18042
20403
|
/**
|
|
18043
|
-
*
|
|
20404
|
+
* Determines the version of a Flaunch coin
|
|
18044
20405
|
* @param coinAddress - The address of the coin to check
|
|
18045
|
-
* @returns Promise<
|
|
20406
|
+
* @returns Promise<FlaunchVersion> - The version of the coin
|
|
20407
|
+
*/
|
|
20408
|
+
async getCoinVersion(coinAddress) {
|
|
20409
|
+
if (await this.readPositionManager.isValidCoin(coinAddress)) {
|
|
20410
|
+
return FlaunchVersion.V1;
|
|
20411
|
+
}
|
|
20412
|
+
else if (await this.readPositionManagerV1_1.isValidCoin(coinAddress)) {
|
|
20413
|
+
return FlaunchVersion.V1_1;
|
|
20414
|
+
}
|
|
20415
|
+
else if (await this.readAnyPositionManager.isValidCoin(coinAddress)) {
|
|
20416
|
+
return FlaunchVersion.ANY;
|
|
20417
|
+
}
|
|
20418
|
+
throw new Error(`Unknown coin version for address: ${coinAddress}`);
|
|
20419
|
+
}
|
|
20420
|
+
// TODO: update these get functions to support V1.1.1 and new AnyPositionManager
|
|
20421
|
+
/**
|
|
20422
|
+
* Gets the position manager address for a given version
|
|
20423
|
+
* @param version - The version to get the position manager address for
|
|
20424
|
+
*/
|
|
20425
|
+
getPositionManager(version) {
|
|
20426
|
+
switch (version) {
|
|
20427
|
+
case FlaunchVersion.V1:
|
|
20428
|
+
return this.readPositionManager;
|
|
20429
|
+
case FlaunchVersion.V1_1:
|
|
20430
|
+
return this.readPositionManagerV1_1;
|
|
20431
|
+
case FlaunchVersion.ANY:
|
|
20432
|
+
return this.readAnyPositionManager;
|
|
20433
|
+
default:
|
|
20434
|
+
return this.readPositionManagerV1_1;
|
|
20435
|
+
}
|
|
20436
|
+
}
|
|
20437
|
+
/**
|
|
20438
|
+
* Gets the fair launch address for a given version
|
|
20439
|
+
* @param version - The version to get the fair launch address for
|
|
20440
|
+
*/
|
|
20441
|
+
getFairLaunch(version) {
|
|
20442
|
+
switch (version) {
|
|
20443
|
+
case FlaunchVersion.V1:
|
|
20444
|
+
return this.readFairLaunch;
|
|
20445
|
+
case FlaunchVersion.V1_1:
|
|
20446
|
+
return this.readFairLaunchV1_1;
|
|
20447
|
+
case FlaunchVersion.ANY:
|
|
20448
|
+
return this.readFairLaunchV1_1;
|
|
20449
|
+
default:
|
|
20450
|
+
return this.readFairLaunchV1_1;
|
|
20451
|
+
}
|
|
20452
|
+
}
|
|
20453
|
+
/**
|
|
20454
|
+
* Gets the bid wall address for a given version
|
|
20455
|
+
* @param version - The version to get the bid wall address for
|
|
18046
20456
|
*/
|
|
18047
|
-
|
|
18048
|
-
|
|
20457
|
+
getBidWall(version) {
|
|
20458
|
+
switch (version) {
|
|
20459
|
+
case FlaunchVersion.V1:
|
|
20460
|
+
return this.readBidWall;
|
|
20461
|
+
case FlaunchVersion.V1_1:
|
|
20462
|
+
return this.readBidWallV1_1;
|
|
20463
|
+
case FlaunchVersion.ANY:
|
|
20464
|
+
return this.readBidWallV1_1;
|
|
20465
|
+
default:
|
|
20466
|
+
return this.readBidWallV1_1;
|
|
20467
|
+
}
|
|
20468
|
+
}
|
|
20469
|
+
getPositionManagerAddress(version) {
|
|
20470
|
+
return this.getPositionManager(version).contract.address;
|
|
20471
|
+
}
|
|
20472
|
+
getFairLaunchAddress(version) {
|
|
20473
|
+
return this.getFairLaunch(version).contract.address;
|
|
20474
|
+
}
|
|
20475
|
+
getBidWallAddress(version) {
|
|
20476
|
+
return this.getBidWall(version).contract.address;
|
|
18049
20477
|
}
|
|
18050
20478
|
/**
|
|
18051
20479
|
* Retrieves metadata for a given Flaunch coin
|
|
@@ -18169,69 +20597,45 @@ class ReadFlaunchSDK {
|
|
|
18169
20597
|
return processedResults;
|
|
18170
20598
|
}
|
|
18171
20599
|
/**
|
|
18172
|
-
* Watches for pool creation events
|
|
18173
|
-
* @param params - Parameters for watching pool creation
|
|
18174
|
-
* @returns Subscription to pool creation events
|
|
18175
|
-
*/
|
|
18176
|
-
watchPoolCreatedV1(params) {
|
|
18177
|
-
return this.readPositionManager.watchPoolCreated(params);
|
|
18178
|
-
}
|
|
18179
|
-
/**
|
|
18180
|
-
* Watches for pool creation events on V1.1 contracts
|
|
20600
|
+
* Watches for pool creation events
|
|
18181
20601
|
* @param params - Parameters for watching pool creation
|
|
20602
|
+
* @param version - Version of Flaunch to use (defaults to V1_1)
|
|
18182
20603
|
* @returns Subscription to pool creation events
|
|
18183
20604
|
*/
|
|
18184
|
-
watchPoolCreated(params) {
|
|
18185
|
-
return
|
|
18186
|
-
|
|
18187
|
-
|
|
18188
|
-
* Polls for current pool creation events on V1 contracts
|
|
18189
|
-
* @returns Current pool creation events or undefined if polling is not available
|
|
18190
|
-
*/
|
|
18191
|
-
pollPoolCreatedNowV1() {
|
|
18192
|
-
const poll = this.readPositionManager.pollPoolCreatedNow;
|
|
18193
|
-
if (!poll) {
|
|
18194
|
-
return undefined;
|
|
18195
|
-
}
|
|
18196
|
-
return poll();
|
|
20605
|
+
watchPoolCreated(params, version = FlaunchVersion.V1_1) {
|
|
20606
|
+
return version === FlaunchVersion.V1
|
|
20607
|
+
? this.readPositionManager.watchPoolCreated(params)
|
|
20608
|
+
: this.readPositionManagerV1_1.watchPoolCreated(params);
|
|
18197
20609
|
}
|
|
18198
20610
|
/**
|
|
18199
|
-
* Polls for current pool creation events
|
|
20611
|
+
* Polls for current pool creation events
|
|
20612
|
+
* @param version - Version of Flaunch to use (defaults to V1_1)
|
|
18200
20613
|
* @returns Current pool creation events or undefined if polling is not available
|
|
18201
20614
|
*/
|
|
18202
|
-
pollPoolCreatedNow() {
|
|
18203
|
-
const
|
|
20615
|
+
pollPoolCreatedNow(version = FlaunchVersion.V1_1) {
|
|
20616
|
+
const positionManager = version === FlaunchVersion.V1
|
|
20617
|
+
? this.readPositionManager
|
|
20618
|
+
: this.readPositionManagerV1_1;
|
|
20619
|
+
const poll = positionManager.pollPoolCreatedNow;
|
|
18204
20620
|
if (!poll) {
|
|
18205
20621
|
return undefined;
|
|
18206
20622
|
}
|
|
18207
20623
|
return poll();
|
|
18208
20624
|
}
|
|
18209
20625
|
/**
|
|
18210
|
-
* Watches for pool swap events
|
|
18211
|
-
* @param params - Parameters for watching pool swaps including optional coin filter
|
|
18212
|
-
* @returns Subscription to pool swap events
|
|
18213
|
-
*/
|
|
18214
|
-
async watchPoolSwapV1(params) {
|
|
18215
|
-
return this.readPositionManager.watchPoolSwap({
|
|
18216
|
-
...params,
|
|
18217
|
-
filterByPoolId: params.filterByCoin
|
|
18218
|
-
? await this.poolId(params.filterByCoin, true)
|
|
18219
|
-
: undefined,
|
|
18220
|
-
flETHIsCurrencyZero: params.filterByCoin
|
|
18221
|
-
? this.flETHIsCurrencyZero(params.filterByCoin)
|
|
18222
|
-
: undefined,
|
|
18223
|
-
});
|
|
18224
|
-
}
|
|
18225
|
-
/**
|
|
18226
|
-
* Watches for pool swap events on V1.1 contracts
|
|
20626
|
+
* Watches for pool swap events
|
|
18227
20627
|
* @param params - Parameters for watching pool swaps including optional coin filter
|
|
20628
|
+
* @param version - Version of Flaunch to use (defaults to V1_1)
|
|
18228
20629
|
* @returns Subscription to pool swap events
|
|
18229
20630
|
*/
|
|
18230
|
-
async watchPoolSwap(params) {
|
|
18231
|
-
|
|
20631
|
+
async watchPoolSwap(params, version = FlaunchVersion.V1_1) {
|
|
20632
|
+
const positionManager = version === FlaunchVersion.V1
|
|
20633
|
+
? this.readPositionManager
|
|
20634
|
+
: this.readPositionManagerV1_1;
|
|
20635
|
+
return positionManager.watchPoolSwap({
|
|
18232
20636
|
...params,
|
|
18233
20637
|
filterByPoolId: params.filterByCoin
|
|
18234
|
-
? await this.poolId(params.filterByCoin)
|
|
20638
|
+
? await this.poolId(params.filterByCoin, version)
|
|
18235
20639
|
: undefined,
|
|
18236
20640
|
flETHIsCurrencyZero: params.filterByCoin
|
|
18237
20641
|
? this.flETHIsCurrencyZero(params.filterByCoin)
|
|
@@ -18239,22 +20643,15 @@ class ReadFlaunchSDK {
|
|
|
18239
20643
|
});
|
|
18240
20644
|
}
|
|
18241
20645
|
/**
|
|
18242
|
-
* Polls for current pool swap events
|
|
18243
|
-
* @
|
|
18244
|
-
*/
|
|
18245
|
-
pollPoolSwapNowV1() {
|
|
18246
|
-
const poll = this.readPositionManager.pollPoolSwapNow;
|
|
18247
|
-
if (!poll) {
|
|
18248
|
-
return undefined;
|
|
18249
|
-
}
|
|
18250
|
-
return poll();
|
|
18251
|
-
}
|
|
18252
|
-
/**
|
|
18253
|
-
* Polls for current pool swap events on V1.1 contracts
|
|
20646
|
+
* Polls for current pool swap events
|
|
20647
|
+
* @param version - Version of Flaunch to use (defaults to V1_1)
|
|
18254
20648
|
* @returns Current pool swap events or undefined if polling is not available
|
|
18255
20649
|
*/
|
|
18256
|
-
pollPoolSwapNow() {
|
|
18257
|
-
const
|
|
20650
|
+
pollPoolSwapNow(version = FlaunchVersion.V1_1) {
|
|
20651
|
+
const positionManager = version === FlaunchVersion.V1
|
|
20652
|
+
? this.readPositionManager
|
|
20653
|
+
: this.readPositionManagerV1_1;
|
|
20654
|
+
const poll = positionManager.pollPoolSwapNow;
|
|
18258
20655
|
if (!poll) {
|
|
18259
20656
|
return undefined;
|
|
18260
20657
|
}
|
|
@@ -18271,29 +20668,25 @@ class ReadFlaunchSDK {
|
|
|
18271
20668
|
/**
|
|
18272
20669
|
* Gets the current tick for a given coin's pool
|
|
18273
20670
|
* @param coinAddress - The address of the coin
|
|
18274
|
-
* @param
|
|
20671
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18275
20672
|
* @returns Promise<number> - The current tick of the pool
|
|
18276
20673
|
*/
|
|
18277
|
-
async currentTick(coinAddress,
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
}
|
|
18281
|
-
const poolId = await this.poolId(coinAddress, isV1Coin);
|
|
20674
|
+
async currentTick(coinAddress, version) {
|
|
20675
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20676
|
+
const poolId = await this.poolId(coinAddress, coinVersion);
|
|
18282
20677
|
const poolState = await this.readStateView.poolSlot0({ poolId });
|
|
18283
20678
|
return poolState.tick;
|
|
18284
20679
|
}
|
|
18285
20680
|
/**
|
|
18286
20681
|
* Calculates the coin price in ETH based on the current tick
|
|
18287
20682
|
* @param coinAddress - The address of the coin
|
|
18288
|
-
* @param
|
|
20683
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18289
20684
|
* @returns Promise<string> - The price of the coin in ETH with 18 decimals precision
|
|
18290
20685
|
*/
|
|
18291
|
-
async coinPriceInETH(coinAddress,
|
|
18292
|
-
|
|
18293
|
-
isV1Coin = await this.isV1Coin(coinAddress);
|
|
18294
|
-
}
|
|
20686
|
+
async coinPriceInETH(coinAddress, version) {
|
|
20687
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
18295
20688
|
const isFLETHZero = this.flETHIsCurrencyZero(coinAddress);
|
|
18296
|
-
const currentTick = await this.currentTick(coinAddress,
|
|
20689
|
+
const currentTick = await this.currentTick(coinAddress, coinVersion);
|
|
18297
20690
|
const price = Math.pow(1.0001, currentTick);
|
|
18298
20691
|
let ethPerCoin = 0;
|
|
18299
20692
|
if (isFLETHZero) {
|
|
@@ -18304,6 +20697,27 @@ class ReadFlaunchSDK {
|
|
|
18304
20697
|
}
|
|
18305
20698
|
return ethPerCoin.toFixed(18);
|
|
18306
20699
|
}
|
|
20700
|
+
/**
|
|
20701
|
+
* Calculates the coin price in USD based on the current ETH/USDC price
|
|
20702
|
+
* @param coinAddress - The address of the coin
|
|
20703
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
20704
|
+
* @returns Promise<string> - The price of the coin in USD with 2 decimal precision
|
|
20705
|
+
*/
|
|
20706
|
+
async coinPriceInUSD({ coinAddress, version, drift, }) {
|
|
20707
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20708
|
+
const ethPerCoin = await this.coinPriceInETH(coinAddress, coinVersion);
|
|
20709
|
+
const ethPrice = await this.getETHUSDCPrice(drift);
|
|
20710
|
+
return (parseFloat(ethPerCoin) * ethPrice).toFixed(2);
|
|
20711
|
+
}
|
|
20712
|
+
async coinMarketCapInUSD({ coinAddress, version, drift, }) {
|
|
20713
|
+
const totalSupply = 100000000000; // 100 Billion tokens
|
|
20714
|
+
const priceInUSD = await this.coinPriceInUSD({
|
|
20715
|
+
coinAddress,
|
|
20716
|
+
version,
|
|
20717
|
+
drift,
|
|
20718
|
+
});
|
|
20719
|
+
return (parseFloat(priceInUSD) * totalSupply).toFixed(2);
|
|
20720
|
+
}
|
|
18307
20721
|
/**
|
|
18308
20722
|
* Gets the current ETH/USDC price
|
|
18309
20723
|
* @param drift - Optional drift instance to get price from Base Mainnet
|
|
@@ -18317,81 +20731,76 @@ class ReadFlaunchSDK {
|
|
|
18317
20731
|
}
|
|
18318
20732
|
return this.readQuoter.getETHUSDCPrice();
|
|
18319
20733
|
}
|
|
20734
|
+
async initialSqrtPriceX96(params) {
|
|
20735
|
+
const initialMCapInUSDCWei = parseUnits(params.initialMarketCapUSD.toString(), 6);
|
|
20736
|
+
const initialPriceParams = encodeAbiParameters([
|
|
20737
|
+
{
|
|
20738
|
+
type: "uint256",
|
|
20739
|
+
},
|
|
20740
|
+
], [initialMCapInUSDCWei]);
|
|
20741
|
+
const isFLETHZero = this.flETHIsCurrencyZero(params.coinAddress);
|
|
20742
|
+
const initialPrice = new ReadInitialPrice(await this.readPositionManagerV1_1.initialPrice(), this.drift);
|
|
20743
|
+
return initialPrice.getSqrtPriceX96({
|
|
20744
|
+
isFLETHZero,
|
|
20745
|
+
initialPriceParams,
|
|
20746
|
+
});
|
|
20747
|
+
}
|
|
18320
20748
|
/**
|
|
18321
20749
|
* Gets information about a fair launch for a given coin
|
|
18322
20750
|
* @param coinAddress - The address of the coin
|
|
18323
|
-
* @param
|
|
20751
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18324
20752
|
* @returns Fair launch information from the appropriate contract version
|
|
18325
20753
|
*/
|
|
18326
|
-
async fairLaunchInfo(coinAddress,
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
}
|
|
18330
|
-
const poolId = await this.poolId(coinAddress, isV1Coin);
|
|
18331
|
-
return isV1Coin
|
|
18332
|
-
? this.readFairLaunch.fairLaunchInfo({ poolId })
|
|
18333
|
-
: this.readFairLaunchV1_1.fairLaunchInfo({ poolId });
|
|
20754
|
+
async fairLaunchInfo(coinAddress, version) {
|
|
20755
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20756
|
+
const poolId = await this.poolId(coinAddress, coinVersion);
|
|
20757
|
+
return this.getFairLaunch(coinVersion).fairLaunchInfo({ poolId });
|
|
18334
20758
|
}
|
|
18335
20759
|
/**
|
|
18336
20760
|
* Checks if a fair launch is currently active for a given coin
|
|
18337
20761
|
* @param coinAddress - The address of the coin
|
|
18338
|
-
* @param
|
|
20762
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18339
20763
|
* @returns Promise<boolean> - True if fair launch is active, false otherwise
|
|
18340
20764
|
*/
|
|
18341
|
-
async isFairLaunchActive(coinAddress,
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
}
|
|
18345
|
-
const poolId = await this.poolId(coinAddress, isV1Coin);
|
|
18346
|
-
return isV1Coin
|
|
18347
|
-
? this.readFairLaunch.isFairLaunchActive({ poolId })
|
|
18348
|
-
: this.readFairLaunchV1_1.isFairLaunchActive({ poolId });
|
|
20765
|
+
async isFairLaunchActive(coinAddress, version) {
|
|
20766
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20767
|
+
const poolId = await this.poolId(coinAddress, coinVersion);
|
|
20768
|
+
return this.getFairLaunch(coinVersion).isFairLaunchActive({ poolId });
|
|
18349
20769
|
}
|
|
18350
20770
|
/**
|
|
18351
20771
|
* Gets the duration of a fair launch for a given coin
|
|
18352
20772
|
* @param coinAddress - The address of the coin
|
|
18353
|
-
* @param
|
|
20773
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18354
20774
|
* @returns Promise<number> - The duration in seconds (30 minutes for V1, variable for V1.1)
|
|
18355
20775
|
*/
|
|
18356
|
-
async fairLaunchDuration(coinAddress,
|
|
18357
|
-
|
|
18358
|
-
|
|
18359
|
-
}
|
|
18360
|
-
if (isV1Coin) {
|
|
18361
|
-
return 30 * 60; // 30 minutes
|
|
18362
|
-
}
|
|
18363
|
-
const poolId = await this.poolId(coinAddress, isV1Coin);
|
|
18364
|
-
return this.readFairLaunchV1_1.fairLaunchDuration({ poolId });
|
|
20776
|
+
async fairLaunchDuration(coinAddress, version) {
|
|
20777
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20778
|
+
const poolId = await this.poolId(coinAddress, coinVersion);
|
|
20779
|
+
return this.getFairLaunch(coinVersion).fairLaunchDuration({ poolId });
|
|
18365
20780
|
}
|
|
18366
20781
|
/**
|
|
18367
20782
|
* Gets the initial tick for a fair launch
|
|
18368
20783
|
* @param coinAddress - The address of the coin
|
|
18369
|
-
* @param
|
|
20784
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18370
20785
|
* @returns Promise<number> - The initial tick value
|
|
18371
20786
|
*/
|
|
18372
|
-
async initialTick(coinAddress,
|
|
18373
|
-
|
|
18374
|
-
|
|
18375
|
-
}
|
|
18376
|
-
const poolId = await this.poolId(coinAddress, isV1Coin);
|
|
18377
|
-
const fairLaunchInfo = isV1Coin
|
|
18378
|
-
? await this.readFairLaunch.fairLaunchInfo({ poolId })
|
|
18379
|
-
: await this.readFairLaunchV1_1.fairLaunchInfo({ poolId });
|
|
20787
|
+
async initialTick(coinAddress, version) {
|
|
20788
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20789
|
+
const poolId = await this.poolId(coinAddress, coinVersion);
|
|
20790
|
+
const fairLaunchInfo = await this.getFairLaunch(coinVersion).fairLaunchInfo({ poolId });
|
|
18380
20791
|
return fairLaunchInfo.initialTick;
|
|
18381
20792
|
}
|
|
18382
20793
|
/**
|
|
18383
20794
|
* Gets information about the ETH-only position in a fair launch
|
|
18384
20795
|
* @param coinAddress - The address of the coin
|
|
18385
|
-
* @param
|
|
20796
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18386
20797
|
* @returns Promise<{flETHAmount: bigint, coinAmount: bigint, tickLower: number, tickUpper: number}> - Position details
|
|
18387
20798
|
*/
|
|
18388
|
-
async fairLaunchETHOnlyPosition(coinAddress,
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18392
|
-
const
|
|
18393
|
-
const initialTick = await this.initialTick(coinAddress, isV1Coin);
|
|
18394
|
-
const currentTick = await this.currentTick(coinAddress, isV1Coin);
|
|
20799
|
+
async fairLaunchETHOnlyPosition(coinAddress, version) {
|
|
20800
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20801
|
+
const poolId = await this.poolId(coinAddress, coinVersion);
|
|
20802
|
+
const initialTick = await this.initialTick(coinAddress, coinVersion);
|
|
20803
|
+
const currentTick = await this.currentTick(coinAddress, coinVersion);
|
|
18395
20804
|
const isFLETHZero = this.flETHIsCurrencyZero(coinAddress);
|
|
18396
20805
|
let tickLower;
|
|
18397
20806
|
let tickUpper;
|
|
@@ -18413,9 +20822,7 @@ class ReadFlaunchSDK {
|
|
|
18413
20822
|
}
|
|
18414
20823
|
const { liquidity } = await this.readStateView.positionInfo({
|
|
18415
20824
|
poolId,
|
|
18416
|
-
owner:
|
|
18417
|
-
? FairLaunchAddress[this.chainId]
|
|
18418
|
-
: FairLaunchV1_1Address[this.chainId],
|
|
20825
|
+
owner: this.getFairLaunchAddress(coinVersion),
|
|
18419
20826
|
tickLower,
|
|
18420
20827
|
tickUpper,
|
|
18421
20828
|
salt: "",
|
|
@@ -18434,16 +20841,14 @@ class ReadFlaunchSDK {
|
|
|
18434
20841
|
/**
|
|
18435
20842
|
* Gets information about the coin-only position in a fair launch
|
|
18436
20843
|
* @param coinAddress - The address of the coin
|
|
18437
|
-
* @param
|
|
20844
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18438
20845
|
* @returns Promise<{flETHAmount: bigint, coinAmount: bigint, tickLower: number, tickUpper: number}> - Position details
|
|
18439
20846
|
*/
|
|
18440
|
-
async fairLaunchCoinOnlyPosition(coinAddress,
|
|
18441
|
-
|
|
18442
|
-
|
|
18443
|
-
|
|
18444
|
-
const
|
|
18445
|
-
const initialTick = await this.initialTick(coinAddress, isV1Coin);
|
|
18446
|
-
const currentTick = await this.currentTick(coinAddress, isV1Coin);
|
|
20847
|
+
async fairLaunchCoinOnlyPosition(coinAddress, version) {
|
|
20848
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20849
|
+
const poolId = await this.poolId(coinAddress, coinVersion);
|
|
20850
|
+
const initialTick = await this.initialTick(coinAddress, coinVersion);
|
|
20851
|
+
const currentTick = await this.currentTick(coinAddress, coinVersion);
|
|
18447
20852
|
const isFLETHZero = this.flETHIsCurrencyZero(coinAddress);
|
|
18448
20853
|
let tickLower;
|
|
18449
20854
|
let tickUpper;
|
|
@@ -18465,9 +20870,7 @@ class ReadFlaunchSDK {
|
|
|
18465
20870
|
}
|
|
18466
20871
|
const { liquidity } = await this.readStateView.positionInfo({
|
|
18467
20872
|
poolId,
|
|
18468
|
-
owner:
|
|
18469
|
-
? FairLaunchAddress[this.chainId]
|
|
18470
|
-
: FairLaunchV1_1Address[this.chainId],
|
|
20873
|
+
owner: this.getFairLaunchAddress(coinVersion),
|
|
18471
20874
|
tickLower,
|
|
18472
20875
|
tickUpper,
|
|
18473
20876
|
salt: "",
|
|
@@ -18486,21 +20889,15 @@ class ReadFlaunchSDK {
|
|
|
18486
20889
|
/**
|
|
18487
20890
|
* Gets information about the bid wall position for a coin
|
|
18488
20891
|
* @param coinAddress - The address of the coin
|
|
18489
|
-
* @param
|
|
20892
|
+
* @param version - Optional specific version to use. If not provided, will be determined automatically
|
|
18490
20893
|
* @returns Promise<{flETHAmount: bigint, coinAmount: bigint, pendingEth: bigint, tickLower: number, tickUpper: number}> - Bid wall position details
|
|
18491
20894
|
*/
|
|
18492
|
-
async bidWallPosition(coinAddress,
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
}
|
|
18496
|
-
const poolId = await this.poolId(coinAddress, isV1Coin);
|
|
20895
|
+
async bidWallPosition(coinAddress, version) {
|
|
20896
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
20897
|
+
const poolId = await this.poolId(coinAddress, coinVersion);
|
|
18497
20898
|
const isFLETHZero = this.flETHIsCurrencyZero(coinAddress);
|
|
18498
|
-
const { amount0_: amount0, amount1_: amount1, pendingEth_: pendingEth, } =
|
|
18499
|
-
|
|
18500
|
-
: await this.readBidWallV1_1.position({ poolId });
|
|
18501
|
-
const { tickLower, tickUpper } = isV1Coin
|
|
18502
|
-
? await this.readBidWall.poolInfo({ poolId })
|
|
18503
|
-
: await this.readBidWallV1_1.poolInfo({ poolId });
|
|
20899
|
+
const { amount0_: amount0, amount1_: amount1, pendingEth_: pendingEth, } = await this.getBidWall(coinVersion).position({ poolId });
|
|
20900
|
+
const { tickLower, tickUpper } = await this.getBidWall(coinVersion).poolInfo({ poolId });
|
|
18504
20901
|
const [flETHAmount, coinAmount] = isFLETHZero
|
|
18505
20902
|
? [amount0, amount1]
|
|
18506
20903
|
: [amount1, amount0];
|
|
@@ -18512,6 +20909,29 @@ class ReadFlaunchSDK {
|
|
|
18512
20909
|
tickUpper,
|
|
18513
20910
|
};
|
|
18514
20911
|
}
|
|
20912
|
+
/**
|
|
20913
|
+
* Gets the ETH balance for the creator to claim
|
|
20914
|
+
* @param creator - The address of the creator to check
|
|
20915
|
+
* @param isV1 - Optional boolean to check the balance for V1. V1.1 & AnyPositionManager use the same FeeEscrow contract
|
|
20916
|
+
* @returns The balance of the creator
|
|
20917
|
+
*/
|
|
20918
|
+
creatorRevenue(creator, isV1) {
|
|
20919
|
+
if (isV1) {
|
|
20920
|
+
return this.readPositionManager.creatorBalance(creator);
|
|
20921
|
+
}
|
|
20922
|
+
else {
|
|
20923
|
+
return this.readFeeEscrow.balances(creator);
|
|
20924
|
+
}
|
|
20925
|
+
}
|
|
20926
|
+
/**
|
|
20927
|
+
* Gets the balance of a recipient for a given coin
|
|
20928
|
+
* @param recipient - The address of the recipient to check
|
|
20929
|
+
* @param coinAddress - The address of the coin
|
|
20930
|
+
* @returns Promise<bigint> - The balance of the recipient
|
|
20931
|
+
*/
|
|
20932
|
+
referralBalance(recipient, coinAddress) {
|
|
20933
|
+
return this.readReferralEscrow.allocations(recipient, coinAddress);
|
|
20934
|
+
}
|
|
18515
20935
|
/**
|
|
18516
20936
|
* Gets the claimable balance of ETH for the recipient from a revenue manager
|
|
18517
20937
|
* @param params - Parameters for checking the balance
|
|
@@ -18568,21 +20988,24 @@ class ReadFlaunchSDK {
|
|
|
18568
20988
|
/**
|
|
18569
20989
|
* Gets the pool ID for a given coin
|
|
18570
20990
|
* @param coinAddress - The address of the coin
|
|
18571
|
-
* @param
|
|
20991
|
+
* @param version - Optional specific version to use
|
|
18572
20992
|
* @returns Promise<string> - The pool ID
|
|
18573
20993
|
*/
|
|
18574
|
-
async poolId(coinAddress,
|
|
18575
|
-
|
|
18576
|
-
|
|
20994
|
+
async poolId(coinAddress, version) {
|
|
20995
|
+
let hookAddress;
|
|
20996
|
+
if (version) {
|
|
20997
|
+
hookAddress = this.getPositionManagerAddress(version);
|
|
20998
|
+
}
|
|
20999
|
+
else {
|
|
21000
|
+
const coinVersion = await this.getCoinVersion(coinAddress);
|
|
21001
|
+
hookAddress = this.getPositionManagerAddress(coinVersion);
|
|
18577
21002
|
}
|
|
18578
21003
|
return getPoolId(orderPoolKey({
|
|
18579
21004
|
currency0: FLETHAddress[this.chainId],
|
|
18580
21005
|
currency1: coinAddress,
|
|
18581
21006
|
fee: 0,
|
|
18582
21007
|
tickSpacing: 60,
|
|
18583
|
-
hooks:
|
|
18584
|
-
? FlaunchPositionManagerAddress[this.chainId]
|
|
18585
|
-
: FlaunchPositionManagerV1_1Address[this.chainId],
|
|
21008
|
+
hooks: hookAddress,
|
|
18586
21009
|
}));
|
|
18587
21010
|
}
|
|
18588
21011
|
/**
|
|
@@ -18629,40 +21052,34 @@ class ReadFlaunchSDK {
|
|
|
18629
21052
|
* Gets a quote for selling an exact amount of tokens for ETH
|
|
18630
21053
|
* @param coinAddress - The address of the token to sell
|
|
18631
21054
|
* @param amountIn - The exact amount of tokens to sell
|
|
18632
|
-
* @param
|
|
21055
|
+
* @param version - Optional specific version to use
|
|
18633
21056
|
* @returns Promise<bigint> - The expected amount of ETH to receive
|
|
18634
21057
|
*/
|
|
18635
|
-
async getSellQuoteExactInput(coinAddress, amountIn,
|
|
18636
|
-
|
|
18637
|
-
|
|
18638
|
-
}
|
|
18639
|
-
return this.readQuoter.getSellQuoteExactInput(coinAddress, amountIn, isV1Coin);
|
|
21058
|
+
async getSellQuoteExactInput(coinAddress, amountIn, version) {
|
|
21059
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
21060
|
+
return this.readQuoter.getSellQuoteExactInput(coinAddress, amountIn, this.getPositionManagerAddress(coinVersion));
|
|
18640
21061
|
}
|
|
18641
21062
|
/**
|
|
18642
21063
|
* Gets a quote for buying tokens with an exact amount of ETH
|
|
18643
21064
|
* @param coinAddress - The address of the token to buy
|
|
18644
21065
|
* @param ethIn - The exact amount of ETH to spend
|
|
18645
|
-
* @param
|
|
21066
|
+
* @param version - Optional specific version to use
|
|
18646
21067
|
* @returns Promise<bigint> - The expected amount of tokens to receive
|
|
18647
21068
|
*/
|
|
18648
|
-
async getBuyQuoteExactInput(coinAddress, amountIn,
|
|
18649
|
-
|
|
18650
|
-
|
|
18651
|
-
}
|
|
18652
|
-
return this.readQuoter.getBuyQuoteExactInput(coinAddress, amountIn, isV1Coin);
|
|
21069
|
+
async getBuyQuoteExactInput(coinAddress, amountIn, version) {
|
|
21070
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
21071
|
+
return this.readQuoter.getBuyQuoteExactInput(coinAddress, amountIn, this.getPositionManagerAddress(coinVersion));
|
|
18653
21072
|
}
|
|
18654
21073
|
/**
|
|
18655
21074
|
* Gets a quote for buying an exact amount of tokens with ETH
|
|
18656
21075
|
* @param coinAddress - The address of the token to buy
|
|
18657
21076
|
* @param coinOut - The exact amount of tokens to receive
|
|
18658
|
-
* @param
|
|
21077
|
+
* @param version - Optional specific version to use
|
|
18659
21078
|
* @returns Promise<bigint> - The required amount of ETH to spend
|
|
18660
21079
|
*/
|
|
18661
|
-
async getBuyQuoteExactOutput(coinAddress, amountOut,
|
|
18662
|
-
|
|
18663
|
-
|
|
18664
|
-
}
|
|
18665
|
-
return this.readQuoter.getBuyQuoteExactOutput(coinAddress, amountOut, isV1Coin);
|
|
21080
|
+
async getBuyQuoteExactOutput(coinAddress, amountOut, version) {
|
|
21081
|
+
const coinVersion = version || (await this.getCoinVersion(coinAddress));
|
|
21082
|
+
return this.readQuoter.getBuyQuoteExactOutput(coinAddress, amountOut, this.getPositionManagerAddress(coinVersion));
|
|
18666
21083
|
}
|
|
18667
21084
|
/**
|
|
18668
21085
|
* Determines if flETH is currency0 in the pool
|
|
@@ -18683,10 +21100,13 @@ class ReadFlaunchSDK {
|
|
|
18683
21100
|
}
|
|
18684
21101
|
}
|
|
18685
21102
|
class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
18686
|
-
constructor(chainId, drift = createDrift()) {
|
|
21103
|
+
constructor(chainId, drift = createDrift$1()) {
|
|
18687
21104
|
super(chainId, drift);
|
|
18688
|
-
this.
|
|
18689
|
-
this.
|
|
21105
|
+
this.readWritePositionManager = new ReadWriteFlaunchPositionManager(FlaunchPositionManagerAddress[this.chainId], drift);
|
|
21106
|
+
this.readWritePositionManagerV1_1 = new ReadWriteFlaunchPositionManagerV1_1(FlaunchPositionManagerV1_1Address[this.chainId], drift);
|
|
21107
|
+
this.readWriteAnyPositionManager = new ReadWriteAnyPositionManager(AnyPositionManagerAddress[this.chainId], drift);
|
|
21108
|
+
this.readWriteFeeEscrow = new ReadWriteFeeEscrow(FeeEscrowAddress[this.chainId], drift);
|
|
21109
|
+
this.readWriteReferralEscrow = new ReadWriteReferralEscrow(ReferralEscrowAddress[this.chainId], drift);
|
|
18690
21110
|
this.readWriteFlaunchZap = new ReadWriteFlaunchZap(this.chainId, FlaunchZapAddress[this.chainId], drift);
|
|
18691
21111
|
this.readWriteTreasuryManagerFactory = new ReadWriteTreasuryManagerFactory(this.chainId, TreasuryManagerFactoryAddress[this.chainId], drift);
|
|
18692
21112
|
this.readWritePermit2 = new ReadWritePermit2(Permit2Address[this.chainId], drift);
|
|
@@ -18723,7 +21143,7 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18723
21143
|
return event.args._manager;
|
|
18724
21144
|
}
|
|
18725
21145
|
/**
|
|
18726
|
-
* Creates a new Flaunch on
|
|
21146
|
+
* Creates a new Flaunch on the specified version
|
|
18727
21147
|
* @param params - Parameters for creating the Flaunch
|
|
18728
21148
|
* @returns Transaction response
|
|
18729
21149
|
*/
|
|
@@ -18731,37 +21151,13 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18731
21151
|
return this.readWriteFlaunchZap.flaunch(params);
|
|
18732
21152
|
}
|
|
18733
21153
|
/**
|
|
18734
|
-
* Creates a new Flaunch
|
|
21154
|
+
* Creates a new Flaunch with IPFS metadata and optional version specification
|
|
18735
21155
|
* @param params - Parameters for creating the Flaunch with IPFS data
|
|
18736
21156
|
* @returns Transaction response
|
|
18737
21157
|
*/
|
|
18738
21158
|
flaunchIPFS(params) {
|
|
18739
21159
|
return this.readWriteFlaunchZap.flaunchIPFS(params);
|
|
18740
21160
|
}
|
|
18741
|
-
/**
|
|
18742
|
-
* Creates a new fast Flaunch on V1.1
|
|
18743
|
-
* @param params - Parameters for creating the fast Flaunch
|
|
18744
|
-
* @throws Error if FastFlaunchZap is not deployed on the current chain
|
|
18745
|
-
* @returns Transaction response
|
|
18746
|
-
*/
|
|
18747
|
-
fastFlaunch(params) {
|
|
18748
|
-
if (this.readWriteFastFlaunchZap.contract.address === zeroAddress) {
|
|
18749
|
-
throw new Error(`FastFlaunchZap is not deployed at chainId: ${this.chainId}`);
|
|
18750
|
-
}
|
|
18751
|
-
return this.readWriteFastFlaunchZap.fastFlaunch(params);
|
|
18752
|
-
}
|
|
18753
|
-
/**
|
|
18754
|
-
* Creates a new fast Flaunch on V1.1 with IPFS metadata
|
|
18755
|
-
* @param params - Parameters for creating the fast Flaunch with IPFS data
|
|
18756
|
-
* @throws Error if FastFlaunchZap is not deployed on the current chain
|
|
18757
|
-
* @returns Transaction response
|
|
18758
|
-
*/
|
|
18759
|
-
fastFlaunchIPFS(params) {
|
|
18760
|
-
if (this.readWriteFastFlaunchZap.contract.address === zeroAddress) {
|
|
18761
|
-
throw new Error(`FastFlaunchZap is not deployed at chainId: ${this.chainId}`);
|
|
18762
|
-
}
|
|
18763
|
-
return this.readWriteFastFlaunchZap.fastFlaunchIPFS(params);
|
|
18764
|
-
}
|
|
18765
21161
|
/**
|
|
18766
21162
|
* Creates a new Flaunch with revenue manager configuration
|
|
18767
21163
|
* @param params - Parameters for creating the Flaunch with revenue manager
|
|
@@ -18786,6 +21182,14 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18786
21182
|
}
|
|
18787
21183
|
return this.readWriteFlaunchZap.flaunchIPFSWithRevenueManager(params);
|
|
18788
21184
|
}
|
|
21185
|
+
/**
|
|
21186
|
+
* Creates a new Flaunch with AnyPositionManager for external coins
|
|
21187
|
+
* @param params - Parameters for creating the Flaunch with AnyPositionManager
|
|
21188
|
+
* @returns Transaction response
|
|
21189
|
+
*/
|
|
21190
|
+
anyFlaunch(params) {
|
|
21191
|
+
return this.readWriteAnyPositionManager.flaunch(params);
|
|
21192
|
+
}
|
|
18789
21193
|
/**
|
|
18790
21194
|
* Gets the balance of a specific coin for the connected wallet
|
|
18791
21195
|
* @param coinAddress - The address of the coin to check
|
|
@@ -18800,13 +21204,11 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18800
21204
|
/**
|
|
18801
21205
|
* Buys a coin with ETH
|
|
18802
21206
|
* @param params - Parameters for buying the coin including amount, slippage, and referrer
|
|
18803
|
-
* @param
|
|
21207
|
+
* @param version - Optional specific version to use. If not provided, will determine automatically
|
|
18804
21208
|
* @returns Transaction response for the buy operation
|
|
18805
21209
|
*/
|
|
18806
|
-
async buyCoin(params,
|
|
18807
|
-
|
|
18808
|
-
isV1Coin = await this.isV1Coin(params.coinAddress);
|
|
18809
|
-
}
|
|
21210
|
+
async buyCoin(params, version) {
|
|
21211
|
+
const coinVersion = version || (await this.getCoinVersion(params.coinAddress));
|
|
18810
21212
|
const sender = await this.drift.getSignerAddress();
|
|
18811
21213
|
let amountIn;
|
|
18812
21214
|
let amountOutMin;
|
|
@@ -18816,7 +21218,8 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18816
21218
|
if (params.swapType === "EXACT_IN") {
|
|
18817
21219
|
amountIn = params.amountIn;
|
|
18818
21220
|
if (params.amountOutMin === undefined) {
|
|
18819
|
-
|
|
21221
|
+
// Currently only V1 and V1.1 are supported in the Quoter
|
|
21222
|
+
amountOutMin = getAmountWithSlippage(await this.readQuoter.getBuyQuoteExactInput(params.coinAddress, amountIn, this.getPositionManagerAddress(coinVersion)), (params.slippagePercent / 100).toFixed(18).toString(), params.swapType);
|
|
18820
21223
|
}
|
|
18821
21224
|
else {
|
|
18822
21225
|
amountOutMin = params.amountOutMin;
|
|
@@ -18825,12 +21228,14 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18825
21228
|
else {
|
|
18826
21229
|
amountOut = params.amountOut;
|
|
18827
21230
|
if (params.amountInMax === undefined) {
|
|
18828
|
-
|
|
21231
|
+
// Currently only V1 and V1.1 are supported in the Quoter
|
|
21232
|
+
amountInMax = getAmountWithSlippage(await this.readQuoter.getBuyQuoteExactOutput(params.coinAddress, amountOut, this.getPositionManagerAddress(coinVersion)), (params.slippagePercent / 100).toFixed(18).toString(), params.swapType);
|
|
18829
21233
|
}
|
|
18830
21234
|
else {
|
|
18831
21235
|
amountInMax = params.amountInMax;
|
|
18832
21236
|
}
|
|
18833
21237
|
}
|
|
21238
|
+
// When UniversalRouter supports isAny parameter, add it here
|
|
18834
21239
|
const { commands, inputs } = ethToMemecoin({
|
|
18835
21240
|
sender: sender,
|
|
18836
21241
|
memecoin: params.coinAddress,
|
|
@@ -18841,7 +21246,7 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18841
21246
|
amountOutMin: amountOutMin,
|
|
18842
21247
|
amountOut: amountOut,
|
|
18843
21248
|
amountInMax: amountInMax,
|
|
18844
|
-
|
|
21249
|
+
positionManagerAddress: this.getPositionManagerAddress(coinVersion),
|
|
18845
21250
|
});
|
|
18846
21251
|
return this.drift.adapter.write({
|
|
18847
21252
|
abi: UniversalRouterAbi,
|
|
@@ -18857,22 +21262,22 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18857
21262
|
/**
|
|
18858
21263
|
* Sells a coin for ETH
|
|
18859
21264
|
* @param params - Parameters for selling the coin including amount, slippage, permit data, and referrer
|
|
18860
|
-
* @param
|
|
21265
|
+
* @param version - Optional specific version to use. If not provided, will determine automatically
|
|
18861
21266
|
* @returns Transaction response for the sell operation
|
|
18862
21267
|
*/
|
|
18863
|
-
async sellCoin(params,
|
|
18864
|
-
|
|
18865
|
-
isV1Coin = await this.isV1Coin(params.coinAddress);
|
|
18866
|
-
}
|
|
21268
|
+
async sellCoin(params, version) {
|
|
21269
|
+
const coinVersion = version || (await this.getCoinVersion(params.coinAddress));
|
|
18867
21270
|
let ethOutMin;
|
|
18868
21271
|
await this.readQuoter.contract.cache.clear();
|
|
18869
21272
|
if (params.ethOutMin === undefined) {
|
|
18870
|
-
|
|
21273
|
+
// Currently only V1 and V1.1 are supported in the Quoter
|
|
21274
|
+
ethOutMin = getAmountWithSlippage(await this.readQuoter.getSellQuoteExactInput(params.coinAddress, params.amountIn, this.getPositionManagerAddress(coinVersion)), (params.slippagePercent / 100).toFixed(18).toString(), "EXACT_IN");
|
|
18871
21275
|
}
|
|
18872
21276
|
else {
|
|
18873
21277
|
ethOutMin = params.ethOutMin;
|
|
18874
21278
|
}
|
|
18875
21279
|
await this.readPermit2.contract.cache.clear();
|
|
21280
|
+
// When UniversalRouter supports isAny parameter, add it here
|
|
18876
21281
|
const { commands, inputs } = memecoinToEthWithPermit2({
|
|
18877
21282
|
chainId: this.chainId,
|
|
18878
21283
|
memecoin: params.coinAddress,
|
|
@@ -18881,7 +21286,7 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18881
21286
|
permitSingle: params.permitSingle,
|
|
18882
21287
|
signature: params.signature,
|
|
18883
21288
|
referrer: params.referrer ?? null,
|
|
18884
|
-
|
|
21289
|
+
positionManagerAddress: this.getPositionManagerAddress(coinVersion),
|
|
18885
21290
|
});
|
|
18886
21291
|
return this.drift.write({
|
|
18887
21292
|
abi: UniversalRouterAbi,
|
|
@@ -18922,6 +21327,31 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18922
21327
|
nonce,
|
|
18923
21328
|
};
|
|
18924
21329
|
}
|
|
21330
|
+
/**
|
|
21331
|
+
* Withdraws the creator's share of the revenue
|
|
21332
|
+
* @param params - Parameters for withdrawing the creator's share of the revenue
|
|
21333
|
+
* @param params.recipient - The address to withdraw the revenue to. Defaults to the connected wallet
|
|
21334
|
+
* @param params.isV1 - Optional boolean to withdraw from V1. V1.1 & AnyPositionManager use the same FeeEscrow contract
|
|
21335
|
+
* @returns Transaction response
|
|
21336
|
+
*/
|
|
21337
|
+
async withdrawCreatorRevenue(params) {
|
|
21338
|
+
const recipient = params.recipient ?? (await this.drift.getSignerAddress());
|
|
21339
|
+
if (params.isV1) {
|
|
21340
|
+
return this.readWritePositionManager.withdrawFees(recipient);
|
|
21341
|
+
}
|
|
21342
|
+
else {
|
|
21343
|
+
return this.readWriteFeeEscrow.withdrawFees(recipient);
|
|
21344
|
+
}
|
|
21345
|
+
}
|
|
21346
|
+
/**
|
|
21347
|
+
* Claims the referral balance for a given recipient
|
|
21348
|
+
* @param coins - The addresses of the coins to claim
|
|
21349
|
+
* @param recipient - The address of the recipient to claim the balance for
|
|
21350
|
+
* @returns Transaction response
|
|
21351
|
+
*/
|
|
21352
|
+
claimReferralBalance(coins, recipient) {
|
|
21353
|
+
return this.readWriteReferralEscrow.claimTokens(coins, recipient);
|
|
21354
|
+
}
|
|
18925
21355
|
/**
|
|
18926
21356
|
* Claims the protocol's share of the revenue
|
|
18927
21357
|
* @param params - Parameters for claiming the protocol's share of the revenue
|
|
@@ -18951,6 +21381,26 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
18951
21381
|
}
|
|
18952
21382
|
}
|
|
18953
21383
|
|
|
21384
|
+
/**
|
|
21385
|
+
* Creates a Drift instance with the provided clients
|
|
21386
|
+
* @param params - Parameters for creating the Drift instance
|
|
21387
|
+
* @returns Drift instance configured with the appropriate clients
|
|
21388
|
+
* @throws Error if publicClient.chain is not configured
|
|
21389
|
+
*/
|
|
21390
|
+
function createDrift(params) {
|
|
21391
|
+
const { publicClient, walletClient } = params;
|
|
21392
|
+
if (!publicClient.chain) {
|
|
21393
|
+
throw new Error("publicClient must be configured with a chain");
|
|
21394
|
+
}
|
|
21395
|
+
return walletClient
|
|
21396
|
+
? createDrift$1({
|
|
21397
|
+
adapter: viemAdapter({ publicClient, walletClient }),
|
|
21398
|
+
})
|
|
21399
|
+
: createDrift$1({
|
|
21400
|
+
adapter: viemAdapter({ publicClient }),
|
|
21401
|
+
});
|
|
21402
|
+
}
|
|
21403
|
+
|
|
18954
21404
|
/**
|
|
18955
21405
|
* Creates a Flaunch SDK instance with the provided clients
|
|
18956
21406
|
* @param params - Parameters for creating the SDK
|
|
@@ -18965,12 +21415,8 @@ function createFlaunch(params) {
|
|
|
18965
21415
|
const chainId = publicClient.chain.id;
|
|
18966
21416
|
// Return appropriate SDK type based on whether walletClient is provided
|
|
18967
21417
|
return walletClient
|
|
18968
|
-
? new ReadWriteFlaunchSDK(chainId, createDrift({
|
|
18969
|
-
|
|
18970
|
-
}))
|
|
18971
|
-
: new ReadFlaunchSDK(chainId, createDrift({
|
|
18972
|
-
adapter: viemAdapter({ publicClient }),
|
|
18973
|
-
}));
|
|
21418
|
+
? new ReadWriteFlaunchSDK(chainId, createDrift({ publicClient, walletClient }))
|
|
21419
|
+
: new ReadFlaunchSDK(chainId, createDrift({ publicClient }));
|
|
18974
21420
|
}
|
|
18975
21421
|
|
|
18976
21422
|
const FlaunchSDK = {
|
|
@@ -18978,5 +21424,5 @@ const FlaunchSDK = {
|
|
|
18978
21424
|
ReadWriteFlaunchSDK,
|
|
18979
21425
|
};
|
|
18980
21426
|
|
|
18981
|
-
export { BidWallAddress, BidWallV1_1Address, FLETHAddress, FLETHHooksAddress, FairLaunchAbi, FairLaunchAddress, FairLaunchV1_1Address, FastFlaunchZapAbi, FastFlaunchZapAddress, FlaunchAddress, FlaunchPositionManagerAbi, FlaunchPositionManagerAddress, FlaunchPositionManagerV1_1Address, FlaunchSDK, FlaunchV1_1Address, FlaunchZapAddress, MemecoinAbi, Permit2Address, PoolManagerAbi, PoolManagerAddress, QuoterAddress, ReadFlaunchSDK, ReadWriteFlaunchSDK, RevenueManagerAddress, StateViewAddress, TICK_SPACING, TickFinder, TreasuryManagerFactoryAddress, USDCETHPoolKeys, UniversalRouterAddress, bytes32ToUint256, calculateUnderlyingTokenBalances, chainIdToChain, createFlaunch, generateTokenUri, getPoolId, getSqrtPriceX96FromTick, getValidTick, orderPoolKey, resolveIPFS, uint256ToBytes32, uploadFileToIPFS, uploadImageToIPFS, uploadJsonToIPFS };
|
|
21427
|
+
export { AnyPositionManagerAbi, AnyPositionManagerAddress, BidWallAddress, BidWallV1_1Abi, BidWallV1_1Address, BidwallAbi, FLETHAddress, FLETHHooksAddress, FairLaunchAbi, FairLaunchAddress, FairLaunchV1_1Abi, FairLaunchV1_1Address, FastFlaunchZapAbi, FastFlaunchZapAddress, FeeEscrowAbi, FeeEscrowAddress, FlaunchAbi, FlaunchAddress, FlaunchPositionManagerAbi, FlaunchPositionManagerAddress, FlaunchPositionManagerV1_1Abi, FlaunchPositionManagerV1_1Address, FlaunchSDK, FlaunchV1_1Abi, FlaunchV1_1Address, FlaunchVersion, FlaunchZapAbi, FlaunchZapAddress, InitialPriceAbi, MemecoinAbi, MulticallAbi, Permit2Abi, Permit2Address, PoolManagerAbi, PoolManagerAddress, QuoterAbi, QuoterAddress, ReadFlaunchSDK, ReadWriteFlaunchSDK, ReferralEscrowAbi, ReferralEscrowAddress, RevenueManagerAbi, RevenueManagerAddress, StateViewAbi, StateViewAddress, TICK_SPACING, TickFinder, TreasuryManagerFactoryAbi, TreasuryManagerFactoryAddress, USDCETHPoolKeys, UniversalRouterAbi, UniversalRouterAddress, bytes32ToUint256, calculateUnderlyingTokenBalances, chainIdToChain, createDrift, createFlaunch, generateTokenUri, getPoolId, getSqrtPriceX96FromTick, getValidTick, orderPoolKey, resolveIPFS, uint256ToBytes32, uploadFileToIPFS, uploadImageToIPFS, uploadJsonToIPFS };
|
|
18982
21428
|
//# sourceMappingURL=index.esm.js.map
|