@ubi.fun/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +10 -0
- package/README.md +279 -0
- package/dist/abi/AddressFeeSplitManager.d.cts +938 -0
- package/dist/abi/AddressFeeSplitManager.d.ts +939 -0
- package/dist/abi/AddressFeeSplitManager.d.ts.map +1 -0
- package/dist/abi/BidWall.d.cts +739 -0
- package/dist/abi/BidWall.d.ts +740 -0
- package/dist/abi/BidWall.d.ts.map +1 -0
- package/dist/abi/FairLaunch.d.cts +535 -0
- package/dist/abi/FairLaunch.d.ts +536 -0
- package/dist/abi/FairLaunch.d.ts.map +1 -0
- package/dist/abi/FeeEscrow.d.cts +281 -0
- package/dist/abi/FeeEscrow.d.ts +282 -0
- package/dist/abi/FeeEscrow.d.ts.map +1 -0
- package/dist/abi/Flaunch.d.cts +775 -0
- package/dist/abi/Flaunch.d.ts +776 -0
- package/dist/abi/Flaunch.d.ts.map +1 -0
- package/dist/abi/FlaunchPositionManager.d.cts +2170 -0
- package/dist/abi/FlaunchPositionManager.d.ts +2171 -0
- package/dist/abi/FlaunchPositionManager.d.ts.map +1 -0
- package/dist/abi/FlaunchZap.d.cts +300 -0
- package/dist/abi/FlaunchZap.d.ts +301 -0
- package/dist/abi/FlaunchZap.d.ts.map +1 -0
- package/dist/abi/InitialPrice.d.cts +252 -0
- package/dist/abi/InitialPrice.d.ts +253 -0
- package/dist/abi/InitialPrice.d.ts.map +1 -0
- package/dist/abi/Memecoin.d.cts +680 -0
- package/dist/abi/Memecoin.d.ts +681 -0
- package/dist/abi/Memecoin.d.ts.map +1 -0
- package/dist/abi/Multicall.d.cts +332 -0
- package/dist/abi/Multicall.d.ts +333 -0
- package/dist/abi/Multicall.d.ts.map +1 -0
- package/dist/abi/PoolManager.d.cts +1056 -0
- package/dist/abi/PoolManager.d.ts +1057 -0
- package/dist/abi/PoolManager.d.ts.map +1 -0
- package/dist/abi/PoolSwap.d.cts +89 -0
- package/dist/abi/PoolSwap.d.ts +90 -0
- package/dist/abi/PoolSwap.d.ts.map +1 -0
- package/dist/abi/Quoter.d.cts +485 -0
- package/dist/abi/Quoter.d.ts +486 -0
- package/dist/abi/Quoter.d.ts.map +1 -0
- package/dist/abi/ReferralEscrow.d.cts +459 -0
- package/dist/abi/ReferralEscrow.d.ts +460 -0
- package/dist/abi/ReferralEscrow.d.ts.map +1 -0
- package/dist/abi/TreasuryManager.d.cts +325 -0
- package/dist/abi/TreasuryManager.d.ts +326 -0
- package/dist/abi/TreasuryManager.d.ts.map +1 -0
- package/dist/abi/TreasuryManagerFactory.d.cts +433 -0
- package/dist/abi/TreasuryManagerFactory.d.ts +434 -0
- package/dist/abi/TreasuryManagerFactory.d.ts.map +1 -0
- package/dist/abi/UniversalRewardsDistributor.d.cts +191 -0
- package/dist/abi/UniversalRewardsDistributor.d.ts +192 -0
- package/dist/abi/UniversalRewardsDistributor.d.ts.map +1 -0
- package/dist/abi/XHandleClaims.d.cts +383 -0
- package/dist/abi/XHandleClaims.d.ts +384 -0
- package/dist/abi/XHandleClaims.d.ts.map +1 -0
- package/dist/abi/index.cjs +13541 -0
- package/dist/abi/index.cjs.map +1 -0
- package/dist/abi/index.d.cts +18 -0
- package/dist/abi/index.d.ts +19 -0
- package/dist/abi/index.d.ts.map +1 -0
- package/dist/abi/index.js +13522 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/addresses/index.cjs +90 -0
- package/dist/addresses/index.cjs.map +1 -0
- package/dist/addresses/index.js +70 -0
- package/dist/addresses/index.js.map +1 -0
- package/dist/addresses.d.cts +48 -0
- package/dist/addresses.d.ts +49 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/clients/BidWallClient.d.cts +44 -0
- package/dist/clients/BidWallClient.d.ts +45 -0
- package/dist/clients/BidWallClient.d.ts.map +1 -0
- package/dist/clients/FairLaunchClient.d.cts +47 -0
- package/dist/clients/FairLaunchClient.d.ts +48 -0
- package/dist/clients/FairLaunchClient.d.ts.map +1 -0
- package/dist/clients/FeeEscrowClient.d.cts +40 -0
- package/dist/clients/FeeEscrowClient.d.ts +41 -0
- package/dist/clients/FeeEscrowClient.d.ts.map +1 -0
- package/dist/clients/FlaunchClient.d.cts +35 -0
- package/dist/clients/FlaunchClient.d.ts +36 -0
- package/dist/clients/FlaunchClient.d.ts.map +1 -0
- package/dist/clients/FlaunchPositionManagerClient.d.cts +117 -0
- package/dist/clients/FlaunchPositionManagerClient.d.ts +118 -0
- package/dist/clients/FlaunchPositionManagerClient.d.ts.map +1 -0
- package/dist/clients/FlaunchZapClient.d.cts +127 -0
- package/dist/clients/FlaunchZapClient.d.ts +128 -0
- package/dist/clients/FlaunchZapClient.d.ts.map +1 -0
- package/dist/clients/InitialPriceClient.d.cts +32 -0
- package/dist/clients/InitialPriceClient.d.ts +33 -0
- package/dist/clients/InitialPriceClient.d.ts.map +1 -0
- package/dist/clients/MemecoinClient.d.cts +66 -0
- package/dist/clients/MemecoinClient.d.ts +67 -0
- package/dist/clients/MemecoinClient.d.ts.map +1 -0
- package/dist/clients/MulticallClient.d.cts +15 -0
- package/dist/clients/MulticallClient.d.ts +16 -0
- package/dist/clients/MulticallClient.d.ts.map +1 -0
- package/dist/clients/PoolManagerClient.d.cts +50 -0
- package/dist/clients/PoolManagerClient.d.ts +51 -0
- package/dist/clients/PoolManagerClient.d.ts.map +1 -0
- package/dist/clients/PoolSwapClient.d.cts +37 -0
- package/dist/clients/PoolSwapClient.d.ts +38 -0
- package/dist/clients/PoolSwapClient.d.ts.map +1 -0
- package/dist/clients/QuoterClient.d.cts +58 -0
- package/dist/clients/QuoterClient.d.ts +59 -0
- package/dist/clients/QuoterClient.d.ts.map +1 -0
- package/dist/clients/ReferralEscrowClient.d.cts +39 -0
- package/dist/clients/ReferralEscrowClient.d.ts +40 -0
- package/dist/clients/ReferralEscrowClient.d.ts.map +1 -0
- package/dist/clients/TreasuryManagerClient.d.cts +71 -0
- package/dist/clients/TreasuryManagerClient.d.ts +72 -0
- package/dist/clients/TreasuryManagerClient.d.ts.map +1 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.cts +15 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.ts +16 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.ts.map +1 -0
- package/dist/clients/UniversalRewardsDistributorClient.d.cts +45 -0
- package/dist/clients/UniversalRewardsDistributorClient.d.ts +46 -0
- package/dist/clients/UniversalRewardsDistributorClient.d.ts.map +1 -0
- package/dist/clients/XHandleClaimsClient.d.cts +64 -0
- package/dist/clients/XHandleClaimsClient.d.ts +65 -0
- package/dist/clients/XHandleClaimsClient.d.ts.map +1 -0
- package/dist/helpers/chainIdToChain.d.cts +113 -0
- package/dist/helpers/chainIdToChain.d.ts +114 -0
- package/dist/helpers/chainIdToChain.d.ts.map +1 -0
- package/dist/helpers/hex.d.cts +3 -0
- package/dist/helpers/hex.d.ts +4 -0
- package/dist/helpers/hex.d.ts.map +1 -0
- package/dist/helpers/index.cjs +196 -0
- package/dist/helpers/index.cjs.map +1 -0
- package/dist/helpers/index.d.cts +3 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +184 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/ipfs.d.cts +56 -0
- package/dist/helpers/ipfs.d.ts +57 -0
- package/dist/helpers/ipfs.d.ts.map +1 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.cts +28 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.ts +29 -0
- package/dist/hooks/FlaunchPositionManagerHooks.d.ts.map +1 -0
- package/dist/hooks/index.cjs +73 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +70 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.cjs +16808 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16718 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.cjs +2 -0
- package/dist/index.umd.cjs.map +1 -0
- package/dist/sdk/FlaunchSDK.d.cts +520 -0
- package/dist/sdk/FlaunchSDK.d.ts +521 -0
- package/dist/sdk/FlaunchSDK.d.ts.map +1 -0
- package/dist/sdk/calldata.d.cts +65 -0
- package/dist/sdk/calldata.d.ts +66 -0
- package/dist/sdk/calldata.d.ts.map +1 -0
- package/dist/sdk/drift.d.cts +20 -0
- package/dist/sdk/drift.d.ts +21 -0
- package/dist/sdk/drift.d.ts.map +1 -0
- package/dist/sdk/factory.d.cts +20 -0
- package/dist/sdk/factory.d.ts +21 -0
- package/dist/sdk/factory.d.ts.map +1 -0
- package/dist/types.d.cts +56 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/index.cjs +455 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +4 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +431 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/parseSwap.d.cts +45 -0
- package/dist/utils/parseSwap.d.ts +46 -0
- package/dist/utils/parseSwap.d.ts.map +1 -0
- package/dist/utils/slippage.d.cts +11 -0
- package/dist/utils/slippage.d.ts +12 -0
- package/dist/utils/slippage.d.ts.map +1 -0
- package/dist/utils/swap.d.cts +49 -0
- package/dist/utils/swap.d.ts +50 -0
- package/dist/utils/swap.d.ts.map +1 -0
- package/dist/utils/univ4.d.cts +78 -0
- package/dist/utils/univ4.d.ts +79 -0
- package/dist/utils/univ4.d.ts.map +1 -0
- package/package.json +161 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlaunchClient.d.ts","sourceRoot":"","sources":["../../src/clients/FlaunchClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAMX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAE3C;;;GAGG;AACH,qBAAa,WAAW;IACtB,SAAgB,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAEnD;;;;;OAKG;gBACS,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D;;;;OAIG;IACH,OAAO,CAAC,WAAW,EAAE,OAAO;IAM5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM;IAMxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM;CAKzB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type EventLog, HexString } from "@delvtech/drift";
|
|
2
|
+
import { type Hex } from "viem";
|
|
3
|
+
import { FlaunchPositionManagerAbi } from "../abi/FlaunchPositionManager.cjs";
|
|
4
|
+
export type FlaunchPositionManagerABI = typeof FlaunchPositionManagerAbi;
|
|
5
|
+
export type PoolCreatedLog = EventLog<FlaunchPositionManagerABI, "PoolCreated"> & {
|
|
6
|
+
timestamp: number;
|
|
7
|
+
};
|
|
8
|
+
export type PoolCreatedLogs = PoolCreatedLog[];
|
|
9
|
+
export interface WatchPoolCreatedParams {
|
|
10
|
+
onPoolCreated: ({ logs, isFetchingFromStart, }: {
|
|
11
|
+
logs: PoolCreatedLogs;
|
|
12
|
+
isFetchingFromStart: boolean;
|
|
13
|
+
}) => void;
|
|
14
|
+
startBlockNumber?: bigint;
|
|
15
|
+
}
|
|
16
|
+
export type BaseSwapLog = EventLog<FlaunchPositionManagerABI, "PoolSwap"> & {
|
|
17
|
+
timestamp: number;
|
|
18
|
+
};
|
|
19
|
+
export type BuySwapLog = BaseSwapLog & {
|
|
20
|
+
type: "BUY";
|
|
21
|
+
delta: {
|
|
22
|
+
coinsBought: bigint;
|
|
23
|
+
usdcSold: bigint;
|
|
24
|
+
fees: {
|
|
25
|
+
isInUSDC: boolean;
|
|
26
|
+
amount: bigint;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type SellSwapLog = BaseSwapLog & {
|
|
31
|
+
type: "SELL";
|
|
32
|
+
delta: {
|
|
33
|
+
coinsSold: bigint;
|
|
34
|
+
usdcBought: bigint;
|
|
35
|
+
fees: {
|
|
36
|
+
isInUSDC: boolean;
|
|
37
|
+
amount: bigint;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type PoolSwapLog = BuySwapLog | SellSwapLog | BaseSwapLog;
|
|
42
|
+
export type PoolSwapLogs = PoolSwapLog[];
|
|
43
|
+
export interface WatchPoolSwapParams<TUSDCIsCurrencyZero extends boolean | undefined = undefined> {
|
|
44
|
+
onPoolSwap: ({ logs, isFetchingFromStart, }: {
|
|
45
|
+
logs: TUSDCIsCurrencyZero extends boolean ? (BuySwapLog | SellSwapLog)[] : BaseSwapLog[];
|
|
46
|
+
isFetchingFromStart: boolean;
|
|
47
|
+
}) => void;
|
|
48
|
+
usdcIsCurrencyZero?: TUSDCIsCurrencyZero;
|
|
49
|
+
startBlockNumber?: bigint;
|
|
50
|
+
filterByPoolId?: HexString;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Client for the PositionManager, the Uniswap v4 hook at the center of the
|
|
54
|
+
* protocol: it creates pools, collects and splits fees, and emits the
|
|
55
|
+
* PoolCreated / PoolSwap events integrators index.
|
|
56
|
+
*
|
|
57
|
+
* Launch coins through the FlaunchZap (see ReadWriteFlaunchZap) and trade
|
|
58
|
+
* through PoolSwap; this client is the read/event surface.
|
|
59
|
+
*/
|
|
60
|
+
export declare class ReadFlaunchPositionManager {
|
|
61
|
+
readonly contract: ReadContract<FlaunchPositionManagerABI>;
|
|
62
|
+
drift: Drift;
|
|
63
|
+
pollPoolCreatedNow?: () => Promise<void>;
|
|
64
|
+
pollPoolSwapNow?: () => Promise<void>;
|
|
65
|
+
readonly TOTAL_SUPPLY: bigint;
|
|
66
|
+
constructor(address: Address, drift?: Drift);
|
|
67
|
+
getFeeCalculator({ forFairLaunch }: {
|
|
68
|
+
forFairLaunch: boolean;
|
|
69
|
+
}): Promise<`0x${string}`>;
|
|
70
|
+
isValidCoin(coinAddress: Address): Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Reads the exact pool key for a coin, as stored by the hook. Prefer this
|
|
73
|
+
* over assembling the key by hand.
|
|
74
|
+
*/
|
|
75
|
+
poolKey(coinAddress: Address): Promise<{
|
|
76
|
+
currency0: `0x${string}`;
|
|
77
|
+
currency1: `0x${string}`;
|
|
78
|
+
fee: number;
|
|
79
|
+
tickSpacing: number;
|
|
80
|
+
hooks: `0x${string}`;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* The live fee distribution for a pool (swapFee, referrer, protocol shares
|
|
84
|
+
* in hundredths of a percent)
|
|
85
|
+
*/
|
|
86
|
+
getPoolFeeDistribution(poolId: HexString): Promise<{
|
|
87
|
+
swapFee: number;
|
|
88
|
+
referrer: number;
|
|
89
|
+
protocol: number;
|
|
90
|
+
active: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* The flaunch fee a launch would owe, in native units (msg.value; USDC at 18
|
|
94
|
+
* decimals on Arc). Reads through the initial price contract so sender fee
|
|
95
|
+
* exemptions apply.
|
|
96
|
+
*/
|
|
97
|
+
getFlaunchingFee(params: {
|
|
98
|
+
sender: Address;
|
|
99
|
+
initialPriceParams: HexString;
|
|
100
|
+
slippagePercent?: number;
|
|
101
|
+
}): Promise<bigint>;
|
|
102
|
+
watchPoolCreated({ onPoolCreated, startBlockNumber, }: WatchPoolCreatedParams): Promise<{
|
|
103
|
+
cleanup: () => void;
|
|
104
|
+
pollPoolCreatedNow: () => Promise<void>;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Parses a transaction hash to extract PoolSwap events and return parsed swap data
|
|
108
|
+
* @param txHash - The transaction hash to parse
|
|
109
|
+
* @param usdcIsCurrencyZero - Whether USDC is currency0 in the pool (optional)
|
|
110
|
+
* @returns Parsed swap log or undefined if no PoolSwap event found
|
|
111
|
+
*/
|
|
112
|
+
parseSwapTx(txHash: Hex, usdcIsCurrencyZero?: boolean): Promise<PoolSwapLog | undefined>;
|
|
113
|
+
watchPoolSwap<T extends boolean | undefined = undefined>({ onPoolSwap, usdcIsCurrencyZero, startBlockNumber, filterByPoolId, }: WatchPoolSwapParams<T>): Promise<{
|
|
114
|
+
cleanup: () => void;
|
|
115
|
+
pollPoolSwapNow: () => Promise<void>;
|
|
116
|
+
}>;
|
|
117
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type EventLog, HexString } from "@delvtech/drift";
|
|
2
|
+
import { type Hex } from "viem";
|
|
3
|
+
import { FlaunchPositionManagerAbi } from "../abi/FlaunchPositionManager.js";
|
|
4
|
+
export type FlaunchPositionManagerABI = typeof FlaunchPositionManagerAbi;
|
|
5
|
+
export type PoolCreatedLog = EventLog<FlaunchPositionManagerABI, "PoolCreated"> & {
|
|
6
|
+
timestamp: number;
|
|
7
|
+
};
|
|
8
|
+
export type PoolCreatedLogs = PoolCreatedLog[];
|
|
9
|
+
export interface WatchPoolCreatedParams {
|
|
10
|
+
onPoolCreated: ({ logs, isFetchingFromStart, }: {
|
|
11
|
+
logs: PoolCreatedLogs;
|
|
12
|
+
isFetchingFromStart: boolean;
|
|
13
|
+
}) => void;
|
|
14
|
+
startBlockNumber?: bigint;
|
|
15
|
+
}
|
|
16
|
+
export type BaseSwapLog = EventLog<FlaunchPositionManagerABI, "PoolSwap"> & {
|
|
17
|
+
timestamp: number;
|
|
18
|
+
};
|
|
19
|
+
export type BuySwapLog = BaseSwapLog & {
|
|
20
|
+
type: "BUY";
|
|
21
|
+
delta: {
|
|
22
|
+
coinsBought: bigint;
|
|
23
|
+
usdcSold: bigint;
|
|
24
|
+
fees: {
|
|
25
|
+
isInUSDC: boolean;
|
|
26
|
+
amount: bigint;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type SellSwapLog = BaseSwapLog & {
|
|
31
|
+
type: "SELL";
|
|
32
|
+
delta: {
|
|
33
|
+
coinsSold: bigint;
|
|
34
|
+
usdcBought: bigint;
|
|
35
|
+
fees: {
|
|
36
|
+
isInUSDC: boolean;
|
|
37
|
+
amount: bigint;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type PoolSwapLog = BuySwapLog | SellSwapLog | BaseSwapLog;
|
|
42
|
+
export type PoolSwapLogs = PoolSwapLog[];
|
|
43
|
+
export interface WatchPoolSwapParams<TUSDCIsCurrencyZero extends boolean | undefined = undefined> {
|
|
44
|
+
onPoolSwap: ({ logs, isFetchingFromStart, }: {
|
|
45
|
+
logs: TUSDCIsCurrencyZero extends boolean ? (BuySwapLog | SellSwapLog)[] : BaseSwapLog[];
|
|
46
|
+
isFetchingFromStart: boolean;
|
|
47
|
+
}) => void;
|
|
48
|
+
usdcIsCurrencyZero?: TUSDCIsCurrencyZero;
|
|
49
|
+
startBlockNumber?: bigint;
|
|
50
|
+
filterByPoolId?: HexString;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Client for the PositionManager, the Uniswap v4 hook at the center of the
|
|
54
|
+
* protocol: it creates pools, collects and splits fees, and emits the
|
|
55
|
+
* PoolCreated / PoolSwap events integrators index.
|
|
56
|
+
*
|
|
57
|
+
* Launch coins through the FlaunchZap (see ReadWriteFlaunchZap) and trade
|
|
58
|
+
* through PoolSwap; this client is the read/event surface.
|
|
59
|
+
*/
|
|
60
|
+
export declare class ReadFlaunchPositionManager {
|
|
61
|
+
readonly contract: ReadContract<FlaunchPositionManagerABI>;
|
|
62
|
+
drift: Drift;
|
|
63
|
+
pollPoolCreatedNow?: () => Promise<void>;
|
|
64
|
+
pollPoolSwapNow?: () => Promise<void>;
|
|
65
|
+
readonly TOTAL_SUPPLY: bigint;
|
|
66
|
+
constructor(address: Address, drift?: Drift);
|
|
67
|
+
getFeeCalculator({ forFairLaunch }: {
|
|
68
|
+
forFairLaunch: boolean;
|
|
69
|
+
}): Promise<`0x${string}`>;
|
|
70
|
+
isValidCoin(coinAddress: Address): Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Reads the exact pool key for a coin, as stored by the hook. Prefer this
|
|
73
|
+
* over assembling the key by hand.
|
|
74
|
+
*/
|
|
75
|
+
poolKey(coinAddress: Address): Promise<{
|
|
76
|
+
currency0: `0x${string}`;
|
|
77
|
+
currency1: `0x${string}`;
|
|
78
|
+
fee: number;
|
|
79
|
+
tickSpacing: number;
|
|
80
|
+
hooks: `0x${string}`;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* The live fee distribution for a pool (swapFee, referrer, protocol shares
|
|
84
|
+
* in hundredths of a percent)
|
|
85
|
+
*/
|
|
86
|
+
getPoolFeeDistribution(poolId: HexString): Promise<{
|
|
87
|
+
swapFee: number;
|
|
88
|
+
referrer: number;
|
|
89
|
+
protocol: number;
|
|
90
|
+
active: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* The flaunch fee a launch would owe, in native units (msg.value; USDC at 18
|
|
94
|
+
* decimals on Arc). Reads through the initial price contract so sender fee
|
|
95
|
+
* exemptions apply.
|
|
96
|
+
*/
|
|
97
|
+
getFlaunchingFee(params: {
|
|
98
|
+
sender: Address;
|
|
99
|
+
initialPriceParams: HexString;
|
|
100
|
+
slippagePercent?: number;
|
|
101
|
+
}): Promise<bigint>;
|
|
102
|
+
watchPoolCreated({ onPoolCreated, startBlockNumber, }: WatchPoolCreatedParams): Promise<{
|
|
103
|
+
cleanup: () => void;
|
|
104
|
+
pollPoolCreatedNow: () => Promise<void>;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Parses a transaction hash to extract PoolSwap events and return parsed swap data
|
|
108
|
+
* @param txHash - The transaction hash to parse
|
|
109
|
+
* @param usdcIsCurrencyZero - Whether USDC is currency0 in the pool (optional)
|
|
110
|
+
* @returns Parsed swap log or undefined if no PoolSwap event found
|
|
111
|
+
*/
|
|
112
|
+
parseSwapTx(txHash: Hex, usdcIsCurrencyZero?: boolean): Promise<PoolSwapLog | undefined>;
|
|
113
|
+
watchPoolSwap<T extends boolean | undefined = undefined>({ onPoolSwap, usdcIsCurrencyZero, startBlockNumber, filterByPoolId, }: WatchPoolSwapParams<T>): Promise<{
|
|
114
|
+
cleanup: () => void;
|
|
115
|
+
pollPoolSwapNow: () => Promise<void>;
|
|
116
|
+
}>;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=FlaunchPositionManagerClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlaunchPositionManagerClient.d.ts","sourceRoot":"","sources":["../../src/clients/FlaunchPositionManagerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,QAAQ,EAEb,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAK1E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC;AACzE,MAAM,MAAM,cAAc,GAAG,QAAQ,CACnC,yBAAyB,EACzB,aAAa,CACd,GAAG;IACF,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,cAAc,EAAE,CAAC;AAE/C,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,CAAC,EACd,IAAI,EACJ,mBAAmB,GACpB,EAA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drift, type ReadWriteContract, type ReadWriteAdapter, type HexString } from "@delvtech/drift";
|
|
2
|
+
import { FlaunchZapAbi } from "../abi/FlaunchZap.cjs";
|
|
3
|
+
import { IPFSParams } from "../types.cjs";
|
|
4
|
+
export type FlaunchZapABI = typeof FlaunchZapAbi;
|
|
5
|
+
export interface FlaunchParams {
|
|
6
|
+
name: string;
|
|
7
|
+
symbol: string;
|
|
8
|
+
tokenUri: string;
|
|
9
|
+
/** Percent of supply (0-95) sold at the fixed fair launch price first. 0 for no fair launch. */
|
|
10
|
+
fairLaunchPercent: number;
|
|
11
|
+
/** Fair launch window in seconds (0 when fairLaunchPercent is 0). */
|
|
12
|
+
fairLaunchDuration: number;
|
|
13
|
+
/** Initial market cap in whole USD; $10,000 is the on-chain minimum and currently fee-free. */
|
|
14
|
+
initialMarketCapUSD: number;
|
|
15
|
+
/** Receives the Flaunch NFT (the revenue claim) and the creator revenue. */
|
|
16
|
+
creator: Address;
|
|
17
|
+
/** Creator vs floor-bid split of the creator share, 0-100 (the app defaults to 90). */
|
|
18
|
+
creatorFeeAllocationPercent: number;
|
|
19
|
+
/** 0 (or omit) to launch now, or a start timestamp within 30 days. */
|
|
20
|
+
flaunchAt?: bigint;
|
|
21
|
+
/** Coins the creator buys at the launch price in the same transaction. */
|
|
22
|
+
premineAmount?: bigint;
|
|
23
|
+
/** Referrer credited on the premine swap fee (only relevant with premineAmount). */
|
|
24
|
+
premineReferrer?: Address;
|
|
25
|
+
treasuryManagerParams?: {
|
|
26
|
+
manager?: Address;
|
|
27
|
+
/** Permissions contract for a newly deployed manager; zero address = open. */
|
|
28
|
+
permissions?: Address;
|
|
29
|
+
initializeData?: HexString;
|
|
30
|
+
depositData?: HexString;
|
|
31
|
+
};
|
|
32
|
+
/** Restrict the fair launch to a Merkle whitelist (zero root = open launch). */
|
|
33
|
+
whitelistParams?: {
|
|
34
|
+
merkleRoot: HexString;
|
|
35
|
+
merkleIPFSHash: string;
|
|
36
|
+
maxTokens: bigint;
|
|
37
|
+
};
|
|
38
|
+
/** Reserve part of the supply for a launch airdrop (zero values = none). */
|
|
39
|
+
airdropParams?: {
|
|
40
|
+
airdropIndex: bigint;
|
|
41
|
+
airdropAmount: bigint;
|
|
42
|
+
airdropEndTime: bigint;
|
|
43
|
+
merkleRoot: HexString;
|
|
44
|
+
merkleIPFSHash: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface FlaunchIPFSParams extends Omit<FlaunchParams, "tokenUri">, IPFSParams {
|
|
48
|
+
}
|
|
49
|
+
export interface FlaunchWithSplitManagerParams extends Omit<FlaunchParams, "treasuryManagerParams"> {
|
|
50
|
+
/**
|
|
51
|
+
* Other recipients and their percentages (0-100, fractional allowed, 5
|
|
52
|
+
* decimal places of precision). The creator automatically receives the exact
|
|
53
|
+
* remainder to 100%. A recipient can be an X-handle escrow address
|
|
54
|
+
* (ReadXHandleClaims.escrowAddress) to pay a handle that has not claimed yet.
|
|
55
|
+
*/
|
|
56
|
+
splitReceivers: {
|
|
57
|
+
address: Address;
|
|
58
|
+
percent: number;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
export interface FlaunchWithSplitManagerIPFSParams extends Omit<FlaunchWithSplitManagerParams, "tokenUri">, IPFSParams {
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Base client for interacting with the FlaunchZap contract in read-only mode.
|
|
65
|
+
* The zap is the one-transaction launch entry point: token, Uniswap v4 pool,
|
|
66
|
+
* locked liquidity, fair launch, and the creator revenue stream.
|
|
67
|
+
*/
|
|
68
|
+
export declare class ReadFlaunchZap {
|
|
69
|
+
drift: Drift;
|
|
70
|
+
chainId: number;
|
|
71
|
+
readonly contract: ReadContract<FlaunchZapABI>;
|
|
72
|
+
readonly TOTAL_SUPPLY: bigint;
|
|
73
|
+
constructor(chainId: number, address: Address, drift?: Drift);
|
|
74
|
+
/**
|
|
75
|
+
* The msg.value required to flaunch: covers the premine purchase when there
|
|
76
|
+
* is one, plus the flaunch fee for market caps at or above the on-chain
|
|
77
|
+
* threshold. On Arc msg.value is native USDC at 18 decimals. Always send
|
|
78
|
+
* exactly this; sending less reverts with InsufficientFlaunchFee.
|
|
79
|
+
*/
|
|
80
|
+
valueRequiredToFlaunch(params: {
|
|
81
|
+
premineAmount: bigint;
|
|
82
|
+
initialPriceParams: HexString;
|
|
83
|
+
slippagePercent?: number;
|
|
84
|
+
}): Promise<bigint>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Extended client for interacting with the FlaunchZap contract with write capabilities
|
|
88
|
+
*/
|
|
89
|
+
export declare class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
90
|
+
contract: ReadWriteContract<FlaunchZapABI>;
|
|
91
|
+
constructor(chainId: number, address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
92
|
+
/**
|
|
93
|
+
* Flaunches a new token: creates the coin, its pool, locked liquidity, the
|
|
94
|
+
* fair launch (if any), and the creator revenue stream in one transaction
|
|
95
|
+
* @param params - Parameters for the flaunch
|
|
96
|
+
* @returns Transaction response for the flaunch creation
|
|
97
|
+
*/
|
|
98
|
+
flaunch(params: FlaunchParams): Promise<`0x${string}`>;
|
|
99
|
+
/**
|
|
100
|
+
* Flaunches a new token, first pinning the image + metadata through the
|
|
101
|
+
* ubi.fun API to produce the tokenUri. To host the metadata yourself, pin
|
|
102
|
+
* it however you like and call `flaunch({ tokenUri })` instead.
|
|
103
|
+
*/
|
|
104
|
+
flaunchIPFS(params: FlaunchIPFSParams): Promise<`0x${string}`>;
|
|
105
|
+
/**
|
|
106
|
+
* Flaunches a new token that splits the creator revenue between the creator
|
|
107
|
+
* and a list of recipients through the approved AddressFeeSplitManager.
|
|
108
|
+
* Shares are fixed at launch (5-decimal precision); the revenue NFT is
|
|
109
|
+
* deposited into the manager escrow rather than staying in the creator's
|
|
110
|
+
* wallet.
|
|
111
|
+
*
|
|
112
|
+
* Same layout the app uses: creatorShare/ownerShare are 0 and every payee is
|
|
113
|
+
* a recipient row (the manager requires recipient shares to total exactly
|
|
114
|
+
* 100%); the creator's row is the exact remainder after the listed
|
|
115
|
+
* receivers, so rounding can never brick the launch.
|
|
116
|
+
* @returns Transaction response for the flaunch creation
|
|
117
|
+
*/
|
|
118
|
+
flaunchWithSplitManager(params: FlaunchWithSplitManagerParams): Promise<`0x${string}`>;
|
|
119
|
+
/**
|
|
120
|
+
* Flaunches a new token that splits the creator fees to the creator and a
|
|
121
|
+
* list of recipients, pinning the token metadata through the ubi.fun API
|
|
122
|
+
* first. To host the metadata yourself, pin it however you like and call
|
|
123
|
+
* `flaunchWithSplitManager({ tokenUri })` instead.
|
|
124
|
+
* @returns Promise resolving to the transaction response for the flaunch creation
|
|
125
|
+
*/
|
|
126
|
+
flaunchIPFSWithSplitManager(params: FlaunchWithSplitManagerIPFSParams): Promise<`0x${string}`>;
|
|
127
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type ReadWriteAdapter, type HexString } from "@delvtech/drift";
|
|
2
|
+
import { FlaunchZapAbi } from "../abi/FlaunchZap.js";
|
|
3
|
+
import { IPFSParams } from "../types.js";
|
|
4
|
+
export type FlaunchZapABI = typeof FlaunchZapAbi;
|
|
5
|
+
export interface FlaunchParams {
|
|
6
|
+
name: string;
|
|
7
|
+
symbol: string;
|
|
8
|
+
tokenUri: string;
|
|
9
|
+
/** Percent of supply (0-95) sold at the fixed fair launch price first. 0 for no fair launch. */
|
|
10
|
+
fairLaunchPercent: number;
|
|
11
|
+
/** Fair launch window in seconds (0 when fairLaunchPercent is 0). */
|
|
12
|
+
fairLaunchDuration: number;
|
|
13
|
+
/** Initial market cap in whole USD; $10,000 is the on-chain minimum and currently fee-free. */
|
|
14
|
+
initialMarketCapUSD: number;
|
|
15
|
+
/** Receives the Flaunch NFT (the revenue claim) and the creator revenue. */
|
|
16
|
+
creator: Address;
|
|
17
|
+
/** Creator vs floor-bid split of the creator share, 0-100 (the app defaults to 90). */
|
|
18
|
+
creatorFeeAllocationPercent: number;
|
|
19
|
+
/** 0 (or omit) to launch now, or a start timestamp within 30 days. */
|
|
20
|
+
flaunchAt?: bigint;
|
|
21
|
+
/** Coins the creator buys at the launch price in the same transaction. */
|
|
22
|
+
premineAmount?: bigint;
|
|
23
|
+
/** Referrer credited on the premine swap fee (only relevant with premineAmount). */
|
|
24
|
+
premineReferrer?: Address;
|
|
25
|
+
treasuryManagerParams?: {
|
|
26
|
+
manager?: Address;
|
|
27
|
+
/** Permissions contract for a newly deployed manager; zero address = open. */
|
|
28
|
+
permissions?: Address;
|
|
29
|
+
initializeData?: HexString;
|
|
30
|
+
depositData?: HexString;
|
|
31
|
+
};
|
|
32
|
+
/** Restrict the fair launch to a Merkle whitelist (zero root = open launch). */
|
|
33
|
+
whitelistParams?: {
|
|
34
|
+
merkleRoot: HexString;
|
|
35
|
+
merkleIPFSHash: string;
|
|
36
|
+
maxTokens: bigint;
|
|
37
|
+
};
|
|
38
|
+
/** Reserve part of the supply for a launch airdrop (zero values = none). */
|
|
39
|
+
airdropParams?: {
|
|
40
|
+
airdropIndex: bigint;
|
|
41
|
+
airdropAmount: bigint;
|
|
42
|
+
airdropEndTime: bigint;
|
|
43
|
+
merkleRoot: HexString;
|
|
44
|
+
merkleIPFSHash: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface FlaunchIPFSParams extends Omit<FlaunchParams, "tokenUri">, IPFSParams {
|
|
48
|
+
}
|
|
49
|
+
export interface FlaunchWithSplitManagerParams extends Omit<FlaunchParams, "treasuryManagerParams"> {
|
|
50
|
+
/**
|
|
51
|
+
* Other recipients and their percentages (0-100, fractional allowed, 5
|
|
52
|
+
* decimal places of precision). The creator automatically receives the exact
|
|
53
|
+
* remainder to 100%. A recipient can be an X-handle escrow address
|
|
54
|
+
* (ReadXHandleClaims.escrowAddress) to pay a handle that has not claimed yet.
|
|
55
|
+
*/
|
|
56
|
+
splitReceivers: {
|
|
57
|
+
address: Address;
|
|
58
|
+
percent: number;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
export interface FlaunchWithSplitManagerIPFSParams extends Omit<FlaunchWithSplitManagerParams, "tokenUri">, IPFSParams {
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Base client for interacting with the FlaunchZap contract in read-only mode.
|
|
65
|
+
* The zap is the one-transaction launch entry point: token, Uniswap v4 pool,
|
|
66
|
+
* locked liquidity, fair launch, and the creator revenue stream.
|
|
67
|
+
*/
|
|
68
|
+
export declare class ReadFlaunchZap {
|
|
69
|
+
drift: Drift;
|
|
70
|
+
chainId: number;
|
|
71
|
+
readonly contract: ReadContract<FlaunchZapABI>;
|
|
72
|
+
readonly TOTAL_SUPPLY: bigint;
|
|
73
|
+
constructor(chainId: number, address: Address, drift?: Drift);
|
|
74
|
+
/**
|
|
75
|
+
* The msg.value required to flaunch: covers the premine purchase when there
|
|
76
|
+
* is one, plus the flaunch fee for market caps at or above the on-chain
|
|
77
|
+
* threshold. On Arc msg.value is native USDC at 18 decimals. Always send
|
|
78
|
+
* exactly this; sending less reverts with InsufficientFlaunchFee.
|
|
79
|
+
*/
|
|
80
|
+
valueRequiredToFlaunch(params: {
|
|
81
|
+
premineAmount: bigint;
|
|
82
|
+
initialPriceParams: HexString;
|
|
83
|
+
slippagePercent?: number;
|
|
84
|
+
}): Promise<bigint>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Extended client for interacting with the FlaunchZap contract with write capabilities
|
|
88
|
+
*/
|
|
89
|
+
export declare class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
90
|
+
contract: ReadWriteContract<FlaunchZapABI>;
|
|
91
|
+
constructor(chainId: number, address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
92
|
+
/**
|
|
93
|
+
* Flaunches a new token: creates the coin, its pool, locked liquidity, the
|
|
94
|
+
* fair launch (if any), and the creator revenue stream in one transaction
|
|
95
|
+
* @param params - Parameters for the flaunch
|
|
96
|
+
* @returns Transaction response for the flaunch creation
|
|
97
|
+
*/
|
|
98
|
+
flaunch(params: FlaunchParams): Promise<`0x${string}`>;
|
|
99
|
+
/**
|
|
100
|
+
* Flaunches a new token, first pinning the image + metadata through the
|
|
101
|
+
* ubi.fun API to produce the tokenUri. To host the metadata yourself, pin
|
|
102
|
+
* it however you like and call `flaunch({ tokenUri })` instead.
|
|
103
|
+
*/
|
|
104
|
+
flaunchIPFS(params: FlaunchIPFSParams): Promise<`0x${string}`>;
|
|
105
|
+
/**
|
|
106
|
+
* Flaunches a new token that splits the creator revenue between the creator
|
|
107
|
+
* and a list of recipients through the approved AddressFeeSplitManager.
|
|
108
|
+
* Shares are fixed at launch (5-decimal precision); the revenue NFT is
|
|
109
|
+
* deposited into the manager escrow rather than staying in the creator's
|
|
110
|
+
* wallet.
|
|
111
|
+
*
|
|
112
|
+
* Same layout the app uses: creatorShare/ownerShare are 0 and every payee is
|
|
113
|
+
* a recipient row (the manager requires recipient shares to total exactly
|
|
114
|
+
* 100%); the creator's row is the exact remainder after the listed
|
|
115
|
+
* receivers, so rounding can never brick the launch.
|
|
116
|
+
* @returns Transaction response for the flaunch creation
|
|
117
|
+
*/
|
|
118
|
+
flaunchWithSplitManager(params: FlaunchWithSplitManagerParams): Promise<`0x${string}`>;
|
|
119
|
+
/**
|
|
120
|
+
* Flaunches a new token that splits the creator fees to the creator and a
|
|
121
|
+
* list of recipients, pinning the token metadata through the ubi.fun API
|
|
122
|
+
* first. To host the metadata yourself, pin it however you like and call
|
|
123
|
+
* `flaunchWithSplitManager({ tokenUri })` instead.
|
|
124
|
+
* @returns Promise resolving to the transaction response for the flaunch creation
|
|
125
|
+
*/
|
|
126
|
+
flaunchIPFSWithSplitManager(params: FlaunchWithSplitManagerIPFSParams): Promise<`0x${string}`>;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=FlaunchZapClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlaunchZapClient.d.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AM,EAAE,iBAAiB;IAY3C;;;;;;;;;;;;OAYG;IACG,uBAAuB,CAAC,MAAM,EAAE,6BAA6B;IA8EnE;;;;;;OAMG;IACG,2BAA2B,CAAC,MAAM,EAAE,iCAAiC;CAW5E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type HexString } from "@delvtech/drift";
|
|
2
|
+
import { InitialPriceAbi } from "../abi/InitialPrice.cjs";
|
|
3
|
+
export type InitialPriceABI = typeof InitialPriceAbi;
|
|
4
|
+
/**
|
|
5
|
+
* Client for the deployed IInitialPrice implementation (UsdcMarketCappedPrice):
|
|
6
|
+
* turns the launcher's chosen initial market cap (USDC, 6 decimals, abi-encoded
|
|
7
|
+
* as a single uint256) into the pool's starting price and the flaunch fee.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ReadInitialPrice {
|
|
10
|
+
readonly contract: ReadContract<InitialPriceABI>;
|
|
11
|
+
constructor(address: Address, drift?: Drift);
|
|
12
|
+
/**
|
|
13
|
+
* The flaunch fee for a launch, in the chain's native units (18 decimals on
|
|
14
|
+
* Arc, where msg.value is USDC at 18 decimals). Zero for market caps below
|
|
15
|
+
* the on-chain threshold and for fee-exempt senders.
|
|
16
|
+
* @param params.sender - The address that will send the launch
|
|
17
|
+
* @param params.initialPriceParams - The abi-encoded initial market cap
|
|
18
|
+
*/
|
|
19
|
+
getFlaunchingFee(params: {
|
|
20
|
+
sender: Address;
|
|
21
|
+
initialPriceParams: HexString;
|
|
22
|
+
}): Promise<bigint>;
|
|
23
|
+
/**
|
|
24
|
+
* The starting sqrt price for a launch
|
|
25
|
+
* @param params.usdcIsCurrencyZero - Whether USDC sorts as currency0
|
|
26
|
+
* @param params.initialPriceParams - The abi-encoded initial market cap
|
|
27
|
+
*/
|
|
28
|
+
getSqrtPriceX96(params: {
|
|
29
|
+
usdcIsCurrencyZero: boolean;
|
|
30
|
+
initialPriceParams: HexString;
|
|
31
|
+
}): Promise<bigint>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type HexString } from "@delvtech/drift";
|
|
2
|
+
import { InitialPriceAbi } from "../abi/InitialPrice.js";
|
|
3
|
+
export type InitialPriceABI = typeof InitialPriceAbi;
|
|
4
|
+
/**
|
|
5
|
+
* Client for the deployed IInitialPrice implementation (UsdcMarketCappedPrice):
|
|
6
|
+
* turns the launcher's chosen initial market cap (USDC, 6 decimals, abi-encoded
|
|
7
|
+
* as a single uint256) into the pool's starting price and the flaunch fee.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ReadInitialPrice {
|
|
10
|
+
readonly contract: ReadContract<InitialPriceABI>;
|
|
11
|
+
constructor(address: Address, drift?: Drift);
|
|
12
|
+
/**
|
|
13
|
+
* The flaunch fee for a launch, in the chain's native units (18 decimals on
|
|
14
|
+
* Arc, where msg.value is USDC at 18 decimals). Zero for market caps below
|
|
15
|
+
* the on-chain threshold and for fee-exempt senders.
|
|
16
|
+
* @param params.sender - The address that will send the launch
|
|
17
|
+
* @param params.initialPriceParams - The abi-encoded initial market cap
|
|
18
|
+
*/
|
|
19
|
+
getFlaunchingFee(params: {
|
|
20
|
+
sender: Address;
|
|
21
|
+
initialPriceParams: HexString;
|
|
22
|
+
}): Promise<bigint>;
|
|
23
|
+
/**
|
|
24
|
+
* The starting sqrt price for a launch
|
|
25
|
+
* @param params.usdcIsCurrencyZero - Whether USDC sorts as currency0
|
|
26
|
+
* @param params.initialPriceParams - The abi-encoded initial market cap
|
|
27
|
+
*/
|
|
28
|
+
getSqrtPriceX96(params: {
|
|
29
|
+
usdcIsCurrencyZero: boolean;
|
|
30
|
+
initialPriceParams: HexString;
|
|
31
|
+
}): Promise<bigint>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=InitialPriceClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InitialPriceClient.d.ts","sourceRoot":"","sources":["../../src/clients/InitialPriceClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC;AAErD;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B,SAAgB,QAAQ,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;gBAE5C,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D;;;;;;OAMG;IACH,gBAAgB,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,kBAAkB,EAAE,SAAS,CAAA;KAAE;IAO3E;;;;OAIG;IACH,eAAe,CAAC,MAAM,EAAE;QACtB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,kBAAkB,EAAE,SAAS,CAAC;KAC/B;CAOF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract } from "@delvtech/drift";
|
|
2
|
+
import { MemecoinAbi } from "../abi/Memecoin.cjs";
|
|
3
|
+
export type MemecoinABI = typeof MemecoinAbi;
|
|
4
|
+
/**
|
|
5
|
+
* Client for interacting with Memecoin (ERC20) contracts in read-only mode
|
|
6
|
+
* Provides methods to query basic token information and balances
|
|
7
|
+
*/
|
|
8
|
+
export declare class ReadMemecoin {
|
|
9
|
+
readonly contract: ReadContract<MemecoinABI>;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new ReadMemecoin instance
|
|
12
|
+
* @param address - The address of the Memecoin contract
|
|
13
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
14
|
+
* @throws Error if address is not provided
|
|
15
|
+
*/
|
|
16
|
+
constructor(address: Address, drift?: Drift);
|
|
17
|
+
/**
|
|
18
|
+
* Gets the name of the token
|
|
19
|
+
* @returns Promise<string> - The name of the token
|
|
20
|
+
*/
|
|
21
|
+
name(): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the symbol of the token
|
|
24
|
+
* @returns Promise<string> - The symbol of the token
|
|
25
|
+
*/
|
|
26
|
+
symbol(): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the token URI containing metadata
|
|
29
|
+
* @returns Promise<string> - The token URI
|
|
30
|
+
*/
|
|
31
|
+
tokenURI(): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the decimals of the token
|
|
34
|
+
* @returns Promise<number> - The decimals of the token
|
|
35
|
+
*/
|
|
36
|
+
decimals(): Promise<number>;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the total supply of the token
|
|
39
|
+
* @returns Promise<bigint> - The total supply
|
|
40
|
+
*/
|
|
41
|
+
totalSupply(): Promise<bigint>;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the token balance of a specific user
|
|
44
|
+
* @param user - The address of the user to check
|
|
45
|
+
* @returns Promise<bigint> - The token balance
|
|
46
|
+
*/
|
|
47
|
+
balanceOf(user: Address): Promise<bigint>;
|
|
48
|
+
/**
|
|
49
|
+
* Gets the allowance of an ERC20 token to a spender
|
|
50
|
+
* @param owner - The address of the owner to check
|
|
51
|
+
* @param spender - The address of the spender to check
|
|
52
|
+
* @returns Promise<bigint> - The allowance of the coin to the spender
|
|
53
|
+
*/
|
|
54
|
+
allowance(owner: Address, spender: Address): Promise<bigint>;
|
|
55
|
+
}
|
|
56
|
+
export declare class ReadWriteMemecoin extends ReadMemecoin {
|
|
57
|
+
contract: ReadWriteContract<MemecoinABI>;
|
|
58
|
+
constructor(address: Address, drift?: Drift);
|
|
59
|
+
/**
|
|
60
|
+
* Approves an amount of the token to be spent by another address
|
|
61
|
+
* @param spender - The address of the spender to approve
|
|
62
|
+
* @param amount - The amount of the token to approve
|
|
63
|
+
* @returns Promise<void> - The transaction receipt
|
|
64
|
+
*/
|
|
65
|
+
approve(spender: Address, amount: bigint): Promise<`0x${string}`>;
|
|
66
|
+
}
|