@coinbase/agentkit 0.10.1 → 0.10.2
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 +137 -40
- package/dist/action-providers/across/schemas.d.ts +1 -1
- package/dist/action-providers/baseAccount/baseAccountActionProvider.d.ts +46 -0
- package/dist/action-providers/baseAccount/baseAccountActionProvider.js +404 -0
- package/dist/action-providers/baseAccount/baseAccountActionProvider.test.d.ts +1 -0
- package/dist/action-providers/baseAccount/baseAccountActionProvider.test.js +325 -0
- package/dist/action-providers/baseAccount/index.d.ts +2 -0
- package/dist/action-providers/baseAccount/index.js +18 -0
- package/dist/action-providers/baseAccount/schemas.d.ts +43 -0
- package/dist/action-providers/baseAccount/schemas.js +62 -0
- package/dist/action-providers/baseAccount/types.d.ts +17 -0
- package/dist/action-providers/baseAccount/types.js +2 -0
- package/dist/action-providers/baseAccount/utils.d.ts +14 -0
- package/dist/action-providers/baseAccount/utils.js +57 -0
- package/dist/action-providers/cdp/cdpEvmWalletActionProvider.js +2 -1
- package/dist/action-providers/cdp/cdpEvmWalletActionProvider.test.js +3 -1
- package/dist/action-providers/cdp/cdpSmartWalletActionProvider.js +2 -1
- package/dist/action-providers/cdp/cdpSmartWalletActionProvider.test.js +3 -1
- package/dist/action-providers/cdp/swapUtils.d.ts +0 -9
- package/dist/action-providers/cdp/swapUtils.js +0 -36
- package/dist/action-providers/clanker/schemas.d.ts +2 -2
- package/dist/action-providers/flaunch/client_utils.d.ts +25 -0
- package/dist/action-providers/flaunch/client_utils.js +62 -0
- package/dist/action-providers/flaunch/constants.d.ts +41 -20
- package/dist/action-providers/flaunch/constants.js +111 -36
- package/dist/action-providers/flaunch/flaunchActionProvider.d.ts +4 -43
- package/dist/action-providers/flaunch/flaunchActionProvider.js +132 -200
- package/dist/action-providers/flaunch/flaunchActionProvider.test.js +108 -13
- package/dist/action-providers/flaunch/metadata_utils.d.ts +12 -0
- package/dist/action-providers/flaunch/metadata_utils.js +216 -0
- package/dist/action-providers/flaunch/schemas.d.ts +39 -3
- package/dist/action-providers/flaunch/schemas.js +62 -10
- package/dist/action-providers/flaunch/{utils.d.ts → swap_utils.d.ts} +17 -19
- package/dist/action-providers/flaunch/{utils.js → swap_utils.js} +137 -172
- package/dist/action-providers/index.d.ts +1 -0
- package/dist/action-providers/index.js +1 -0
- package/dist/action-providers/pyth/pythActionProvider.d.ts +2 -2
- package/dist/action-providers/pyth/pythActionProvider.js +83 -31
- package/dist/action-providers/pyth/pythActionProvider.test.js +178 -26
- package/dist/action-providers/pyth/schemas.d.ts +6 -0
- package/dist/action-providers/pyth/schemas.js +9 -1
- package/dist/action-providers/superfluid/superfluidSuperTokenCreatorActionProvider.js +5 -4
- package/dist/action-providers/superfluid/utils/parseLogs.d.ts +2 -1
- package/dist/action-providers/superfluid/utils/parseLogs.js +6 -3
- package/dist/action-providers/wallet/walletActionProvider.js +3 -0
- package/dist/action-providers/x402/schemas.d.ts +7 -0
- package/dist/action-providers/x402/schemas.js +11 -1
- package/dist/action-providers/x402/utils.d.ts +55 -0
- package/dist/action-providers/x402/utils.js +160 -0
- package/dist/action-providers/x402/x402ActionProvider.d.ts +9 -9
- package/dist/action-providers/x402/x402ActionProvider.js +158 -39
- package/dist/action-providers/x402/x402ActionProvider.test.js +116 -10
- package/dist/utils.d.ts +10 -0
- package/dist/utils.js +43 -13
- package/dist/wallet-providers/cdpEvmWalletProvider.d.ts +7 -0
- package/dist/wallet-providers/cdpEvmWalletProvider.js +14 -21
- package/dist/wallet-providers/cdpEvmWalletProvider.test.js +7 -0
- package/dist/wallet-providers/cdpSmartWalletProvider.d.ts +7 -0
- package/dist/wallet-providers/cdpSmartWalletProvider.js +23 -6
- package/dist/wallet-providers/cdpSmartWalletProvider.test.js +6 -10
- package/dist/wallet-providers/evmWalletProvider.d.ts +9 -2
- package/dist/wallet-providers/evmWalletProvider.js +4 -0
- package/dist/wallet-providers/legacyCdpSmartWalletProvider.d.ts +9 -0
- package/dist/wallet-providers/legacyCdpSmartWalletProvider.js +11 -0
- package/dist/wallet-providers/legacyCdpWalletProvider.d.ts +7 -0
- package/dist/wallet-providers/legacyCdpWalletProvider.js +16 -0
- package/dist/wallet-providers/legacyCdpWalletProvider.test.js +6 -0
- package/dist/wallet-providers/privyEvmDelegatedEmbeddedWalletProvider.d.ts +7 -0
- package/dist/wallet-providers/privyEvmDelegatedEmbeddedWalletProvider.js +27 -0
- package/dist/wallet-providers/privyEvmWalletProvider.test.js +11 -0
- package/dist/wallet-providers/viemWalletProvider.d.ts +8 -1
- package/dist/wallet-providers/viemWalletProvider.js +21 -1
- package/dist/wallet-providers/viemWalletProvider.test.js +21 -1
- package/dist/wallet-providers/zeroDevWalletProvider.d.ts +7 -0
- package/dist/wallet-providers/zeroDevWalletProvider.js +12 -0
- package/dist/wallet-providers/zeroDevWalletProvider.test.js +10 -0
- package/package.json +6 -4
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PERMIT2_ADDRESS = void 0;
|
|
4
4
|
exports.isNativeEth = isNativeEth;
|
|
5
5
|
exports.getTokenDetails = getTokenDetails;
|
|
6
|
-
exports.retryWithExponentialBackoff = retryWithExponentialBackoff;
|
|
7
6
|
const viem_1 = require("viem");
|
|
8
7
|
// Permit2 contract address is the same across all networks
|
|
9
8
|
exports.PERMIT2_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
@@ -105,38 +104,3 @@ async function getTokenDetails(walletProvider, fromToken, toToken) {
|
|
|
105
104
|
}
|
|
106
105
|
return { fromTokenDecimals, toTokenDecimals, fromTokenName, toTokenName };
|
|
107
106
|
}
|
|
108
|
-
/**
|
|
109
|
-
* Utility function to sleep for a given number of milliseconds
|
|
110
|
-
*
|
|
111
|
-
* @param ms - Number of milliseconds to sleep
|
|
112
|
-
* @returns Promise that resolves after the specified delay
|
|
113
|
-
*/
|
|
114
|
-
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
115
|
-
/**
|
|
116
|
-
* Retry function with exponential backoff
|
|
117
|
-
*
|
|
118
|
-
* @param fn - The function to retry
|
|
119
|
-
* @param maxRetries - Maximum number of retries (default: 3)
|
|
120
|
-
* @param baseDelay - Base delay in milliseconds (default: 1000)
|
|
121
|
-
* @returns Promise that resolves with the function result or rejects with the last error
|
|
122
|
-
*/
|
|
123
|
-
async function retryWithExponentialBackoff(fn, maxRetries = 3, baseDelay = 1000) {
|
|
124
|
-
let lastError;
|
|
125
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
126
|
-
// Wait before each attempt
|
|
127
|
-
// Calculate delay with exponential backoff: baseDelay * 2^attempt
|
|
128
|
-
const delay = baseDelay * Math.pow(2, attempt);
|
|
129
|
-
await sleep(delay);
|
|
130
|
-
try {
|
|
131
|
-
return await fn();
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
lastError = error;
|
|
135
|
-
// If this was the last attempt, throw the error
|
|
136
|
-
if (attempt === maxRetries) {
|
|
137
|
-
throw lastError;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
throw lastError;
|
|
142
|
-
}
|
|
@@ -27,9 +27,9 @@ export declare const ClankTokenSchema: z.ZodObject<{
|
|
|
27
27
|
id: z.ZodDefault<z.ZodString>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
id: string;
|
|
30
|
+
tokenName: string;
|
|
30
31
|
tokenSymbol: string;
|
|
31
32
|
image: string;
|
|
32
|
-
tokenName: string;
|
|
33
33
|
vaultPercentage: number;
|
|
34
34
|
lockDuration_Days: number;
|
|
35
35
|
vestingDuration_Days: number;
|
|
@@ -40,9 +40,9 @@ export declare const ClankTokenSchema: z.ZodObject<{
|
|
|
40
40
|
platform: string;
|
|
41
41
|
}[] | undefined;
|
|
42
42
|
}, {
|
|
43
|
+
tokenName: string;
|
|
43
44
|
tokenSymbol: string;
|
|
44
45
|
image: string;
|
|
45
|
-
tokenName: string;
|
|
46
46
|
vaultPercentage: number;
|
|
47
47
|
lockDuration_Days: number;
|
|
48
48
|
vestingDuration_Days: number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Address, Hex, TransactionReceipt } from "viem";
|
|
2
|
+
import { EvmWalletProvider } from "../../wallet-providers";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the memecoin address from the transaction receipt
|
|
5
|
+
*
|
|
6
|
+
* @param receipt - The transaction receipt
|
|
7
|
+
* @param chainId - The chain id
|
|
8
|
+
* @returns The memecoin address
|
|
9
|
+
*/
|
|
10
|
+
export declare function getMemecoinAddressFromReceipt(receipt: TransactionReceipt, chainId: string): Address;
|
|
11
|
+
/**
|
|
12
|
+
* Calculates the ETH required to flaunch a token, takes into account the ETH for premine and the flaunching fee
|
|
13
|
+
*
|
|
14
|
+
* @param walletProvider - The EVM wallet provider
|
|
15
|
+
* @param params - The flaunch parameters
|
|
16
|
+
* @param params.premineAmount - The amount to premine
|
|
17
|
+
* @param params.initialPriceParams - The initial price parameters
|
|
18
|
+
* @param params.slippagePercent - The slippage percentage (optional, defaults to 5%)
|
|
19
|
+
* @returns Promise that resolves to the ETH amount required
|
|
20
|
+
*/
|
|
21
|
+
export declare function ethRequiredToFlaunch(walletProvider: EvmWalletProvider, params: {
|
|
22
|
+
premineAmount: bigint;
|
|
23
|
+
initialPriceParams: Hex;
|
|
24
|
+
slippagePercent?: number;
|
|
25
|
+
}): Promise<bigint>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMemecoinAddressFromReceipt = getMemecoinAddressFromReceipt;
|
|
4
|
+
exports.ethRequiredToFlaunch = ethRequiredToFlaunch;
|
|
5
|
+
const viem_1 = require("viem");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
/**
|
|
8
|
+
* Gets the memecoin address from the transaction receipt
|
|
9
|
+
*
|
|
10
|
+
* @param receipt - The transaction receipt
|
|
11
|
+
* @param chainId - The chain id
|
|
12
|
+
* @returns The memecoin address
|
|
13
|
+
*/
|
|
14
|
+
function getMemecoinAddressFromReceipt(receipt, chainId) {
|
|
15
|
+
const filteredPoolCreatedEvent = receipt.logs
|
|
16
|
+
.map(log => {
|
|
17
|
+
try {
|
|
18
|
+
if (log.address.toLowerCase() !== constants_1.FlaunchPositionManagerV1_1Address[chainId].toLowerCase()) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const event = (0, viem_1.decodeEventLog)({
|
|
22
|
+
abi: constants_1.POSITION_MANAGERV1_1_ABI,
|
|
23
|
+
data: log.data,
|
|
24
|
+
topics: log.topics,
|
|
25
|
+
});
|
|
26
|
+
return event.eventName === "PoolCreated" ? event.args : null;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
.filter((event) => event !== null)[0];
|
|
33
|
+
if (!filteredPoolCreatedEvent) {
|
|
34
|
+
throw new Error("Could not find PoolCreated event in transaction receipt");
|
|
35
|
+
}
|
|
36
|
+
return filteredPoolCreatedEvent._memecoin;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Calculates the ETH required to flaunch a token, takes into account the ETH for premine and the flaunching fee
|
|
40
|
+
*
|
|
41
|
+
* @param walletProvider - The EVM wallet provider
|
|
42
|
+
* @param params - The flaunch parameters
|
|
43
|
+
* @param params.premineAmount - The amount to premine
|
|
44
|
+
* @param params.initialPriceParams - The initial price parameters
|
|
45
|
+
* @param params.slippagePercent - The slippage percentage (optional, defaults to 5%)
|
|
46
|
+
* @returns Promise that resolves to the ETH amount required
|
|
47
|
+
*/
|
|
48
|
+
function ethRequiredToFlaunch(walletProvider, params) {
|
|
49
|
+
const chainId = walletProvider.getNetwork().chainId;
|
|
50
|
+
if (!chainId)
|
|
51
|
+
throw new Error("Chain ID is not set.");
|
|
52
|
+
return walletProvider.readContract({
|
|
53
|
+
address: constants_1.FlaunchZapAddress[chainId],
|
|
54
|
+
abi: constants_1.FLAUNCH_ZAP_ABI,
|
|
55
|
+
functionName: "calculateFee",
|
|
56
|
+
args: [
|
|
57
|
+
params.premineAmount ?? 0n,
|
|
58
|
+
BigInt(params.slippagePercent ?? 5 * 100),
|
|
59
|
+
params.initialPriceParams,
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -1,34 +1,52 @@
|
|
|
1
1
|
import { Addresses } from "./types";
|
|
2
2
|
import { erc20Abi as ERC20_ABI } from "viem";
|
|
3
3
|
export { ERC20_ABI };
|
|
4
|
+
export declare const TOTAL_SUPPLY: bigint;
|
|
4
5
|
export declare const FastFlaunchZapAddress: Addresses;
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const FlaunchZapAddress: Addresses;
|
|
7
|
+
export declare const RevenueManagerAddress: Addresses;
|
|
8
|
+
export declare const AddressFeeSplitManagerAddress: Addresses;
|
|
9
|
+
export declare const FlaunchPositionManagerV1_1Address: Addresses;
|
|
6
10
|
export declare const FLETHAddress: Addresses;
|
|
7
11
|
export declare const FLETHHooksAddress: Addresses;
|
|
8
12
|
export declare const QuoterAddress: Addresses;
|
|
9
13
|
export declare const UniversalRouterAddress: Addresses;
|
|
10
14
|
export declare const Permit2Address: Addresses;
|
|
11
|
-
export declare const
|
|
12
|
-
type: string;
|
|
13
|
-
name: string;
|
|
15
|
+
export declare const FLAUNCH_ZAP_ABI: ({
|
|
14
16
|
inputs: {
|
|
17
|
+
internalType: string;
|
|
15
18
|
name: string;
|
|
16
19
|
type: string;
|
|
20
|
+
}[];
|
|
21
|
+
name: string;
|
|
22
|
+
outputs: {
|
|
17
23
|
internalType: string;
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
}[];
|
|
27
|
+
stateMutability: string;
|
|
28
|
+
type: string;
|
|
29
|
+
} | {
|
|
30
|
+
inputs: {
|
|
18
31
|
components: {
|
|
32
|
+
internalType: string;
|
|
19
33
|
name: string;
|
|
20
34
|
type: string;
|
|
21
|
-
internalType: string;
|
|
22
35
|
}[];
|
|
36
|
+
internalType: string;
|
|
37
|
+
name: string;
|
|
38
|
+
type: string;
|
|
23
39
|
}[];
|
|
40
|
+
name: string;
|
|
24
41
|
outputs: {
|
|
42
|
+
internalType: string;
|
|
25
43
|
name: string;
|
|
26
44
|
type: string;
|
|
27
|
-
internalType: string;
|
|
28
45
|
}[];
|
|
29
46
|
stateMutability: string;
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
type: string;
|
|
48
|
+
})[];
|
|
49
|
+
export declare const POSITION_MANAGERV1_1_ABI: readonly [{
|
|
32
50
|
readonly name: "PoolCreated";
|
|
33
51
|
readonly type: "event";
|
|
34
52
|
readonly inputs: readonly [{
|
|
@@ -64,6 +82,9 @@ export declare const POSITION_MANAGER_ABI: readonly [{
|
|
|
64
82
|
}, {
|
|
65
83
|
readonly type: "uint256";
|
|
66
84
|
readonly name: "initialTokenFairLaunch";
|
|
85
|
+
}, {
|
|
86
|
+
readonly type: "uint256";
|
|
87
|
+
readonly name: "fairLaunchDuration";
|
|
67
88
|
}, {
|
|
68
89
|
readonly type: "uint256";
|
|
69
90
|
readonly name: "premineAmount";
|
|
@@ -93,41 +114,41 @@ export declare const POSITION_MANAGER_ABI: readonly [{
|
|
|
93
114
|
readonly name: "poolId";
|
|
94
115
|
readonly indexed: true;
|
|
95
116
|
}, {
|
|
96
|
-
readonly name: "flAmount0";
|
|
97
117
|
readonly type: "int256";
|
|
118
|
+
readonly name: "flAmount0";
|
|
98
119
|
}, {
|
|
99
|
-
readonly name: "flAmount1";
|
|
100
120
|
readonly type: "int256";
|
|
121
|
+
readonly name: "flAmount1";
|
|
101
122
|
}, {
|
|
102
|
-
readonly name: "flFee0";
|
|
103
123
|
readonly type: "int256";
|
|
124
|
+
readonly name: "flFee0";
|
|
104
125
|
}, {
|
|
105
|
-
readonly name: "flFee1";
|
|
106
126
|
readonly type: "int256";
|
|
127
|
+
readonly name: "flFee1";
|
|
107
128
|
}, {
|
|
108
|
-
readonly name: "ispAmount0";
|
|
109
129
|
readonly type: "int256";
|
|
130
|
+
readonly name: "ispAmount0";
|
|
110
131
|
}, {
|
|
111
|
-
readonly name: "ispAmount1";
|
|
112
132
|
readonly type: "int256";
|
|
133
|
+
readonly name: "ispAmount1";
|
|
113
134
|
}, {
|
|
114
|
-
readonly name: "ispFee0";
|
|
115
135
|
readonly type: "int256";
|
|
136
|
+
readonly name: "ispFee0";
|
|
116
137
|
}, {
|
|
117
|
-
readonly name: "ispFee1";
|
|
118
138
|
readonly type: "int256";
|
|
139
|
+
readonly name: "ispFee1";
|
|
119
140
|
}, {
|
|
120
|
-
readonly name: "uniAmount0";
|
|
121
141
|
readonly type: "int256";
|
|
142
|
+
readonly name: "uniAmount0";
|
|
122
143
|
}, {
|
|
123
|
-
readonly name: "uniAmount1";
|
|
124
144
|
readonly type: "int256";
|
|
145
|
+
readonly name: "uniAmount1";
|
|
125
146
|
}, {
|
|
126
|
-
readonly name: "uniFee0";
|
|
127
147
|
readonly type: "int256";
|
|
148
|
+
readonly name: "uniFee0";
|
|
128
149
|
}, {
|
|
129
|
-
readonly name: "uniFee1";
|
|
130
150
|
readonly type: "int256";
|
|
151
|
+
readonly name: "uniFee1";
|
|
131
152
|
}];
|
|
132
153
|
}];
|
|
133
154
|
export declare const QUOTER_ABI: readonly [{
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PERMIT_TYPES = exports.PERMIT_DETAILS = exports.PERMIT2_ABI = exports.UNIVERSAL_ROUTER_ABI = exports.URCommands = exports.V4Actions = exports.IV4RouterAbiExactOutput = exports.IV4RouterAbiExactInput = exports.QUOTER_ABI = exports.
|
|
3
|
+
exports.PERMIT_TYPES = exports.PERMIT_DETAILS = exports.PERMIT2_ABI = exports.UNIVERSAL_ROUTER_ABI = exports.URCommands = exports.V4Actions = exports.IV4RouterAbiExactOutput = exports.IV4RouterAbiExactInput = exports.QUOTER_ABI = exports.POSITION_MANAGERV1_1_ABI = exports.FLAUNCH_ZAP_ABI = exports.Permit2Address = exports.UniversalRouterAddress = exports.QuoterAddress = exports.FLETHHooksAddress = exports.FLETHAddress = exports.FlaunchPositionManagerV1_1Address = exports.AddressFeeSplitManagerAddress = exports.RevenueManagerAddress = exports.FlaunchZapAddress = exports.FastFlaunchZapAddress = exports.TOTAL_SUPPLY = exports.ERC20_ABI = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const chains_1 = require("viem/chains");
|
|
6
6
|
const viem_2 = require("viem");
|
|
7
7
|
Object.defineProperty(exports, "ERC20_ABI", { enumerable: true, get: function () { return viem_2.erc20Abi; } });
|
|
8
|
+
exports.TOTAL_SUPPLY = 100000000000n * 10n ** 18n; // 100 Billion tokens in wei
|
|
8
9
|
exports.FastFlaunchZapAddress = {
|
|
9
10
|
[chains_1.base.id]: "0xd79e27f51ddf9df5ee76106ee192530f474b02f6",
|
|
10
11
|
[chains_1.baseSepolia.id]: "0x251e97446a7019E5DA4860d4CF47291321C693D0",
|
|
11
12
|
};
|
|
12
|
-
exports.
|
|
13
|
-
[chains_1.base.id]: "
|
|
14
|
-
[chains_1.baseSepolia.id]: "
|
|
13
|
+
exports.FlaunchZapAddress = {
|
|
14
|
+
[chains_1.base.id]: "0xfa9e8528ee95eb109bffd1a2d59cb95b300a672a",
|
|
15
|
+
[chains_1.baseSepolia.id]: "0xb2f5d987de90e026b61805e60b6002d367461474",
|
|
16
|
+
};
|
|
17
|
+
exports.RevenueManagerAddress = {
|
|
18
|
+
[chains_1.base.id]: "0x712fa8ddc7347b4b6b029aa21710f365cd02d898",
|
|
19
|
+
[chains_1.baseSepolia.id]: "0x17E02501dE3e420347e7C5fCAe3AD787C5aea690",
|
|
20
|
+
};
|
|
21
|
+
exports.AddressFeeSplitManagerAddress = {
|
|
22
|
+
[chains_1.base.id]: "0x6baa4ec493a9698dc7388c0f290e29ea3d149f99",
|
|
23
|
+
[chains_1.baseSepolia.id]: "0xf72dcdee692c188de6b14c6213e849982e04069b",
|
|
24
|
+
};
|
|
25
|
+
exports.FlaunchPositionManagerV1_1Address = {
|
|
26
|
+
[chains_1.base.id]: "0xf785bb58059fab6fb19bdda2cb9078d9e546efdc",
|
|
27
|
+
[chains_1.baseSepolia.id]: "0x24347e0dd16357059abfc1b321df354873552fdc",
|
|
15
28
|
};
|
|
16
29
|
exports.FLETHAddress = {
|
|
17
30
|
[chains_1.base.id]: "0x000000000D564D5be76f7f0d28fE52605afC7Cf8",
|
|
@@ -33,52 +46,114 @@ exports.Permit2Address = {
|
|
|
33
46
|
[chains_1.base.id]: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
34
47
|
[chains_1.baseSepolia.id]: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
35
48
|
};
|
|
36
|
-
exports.
|
|
49
|
+
exports.FLAUNCH_ZAP_ABI = [
|
|
37
50
|
{
|
|
51
|
+
inputs: [
|
|
52
|
+
{ internalType: "uint256", name: "_premineAmount", type: "uint256" },
|
|
53
|
+
{ internalType: "uint256", name: "_slippage", type: "uint256" },
|
|
54
|
+
{ internalType: "bytes", name: "_initialPriceParams", type: "bytes" },
|
|
55
|
+
],
|
|
56
|
+
name: "calculateFee",
|
|
57
|
+
outputs: [{ internalType: "uint256", name: "ethRequired_", type: "uint256" }],
|
|
58
|
+
stateMutability: "view",
|
|
38
59
|
type: "function",
|
|
39
|
-
|
|
60
|
+
},
|
|
61
|
+
{
|
|
40
62
|
inputs: [
|
|
41
63
|
{
|
|
42
|
-
name: "_params",
|
|
43
|
-
type: "tuple",
|
|
44
|
-
internalType: "struct FastFlaunchZap.FastFlaunchParams",
|
|
45
64
|
components: [
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "tokenUri",
|
|
58
|
-
type: "string",
|
|
59
|
-
internalType: "string",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "creator",
|
|
63
|
-
type: "address",
|
|
64
|
-
internalType: "address",
|
|
65
|
-
},
|
|
65
|
+
{ internalType: "string", name: "name", type: "string" },
|
|
66
|
+
{ internalType: "string", name: "symbol", type: "string" },
|
|
67
|
+
{ internalType: "string", name: "tokenUri", type: "string" },
|
|
68
|
+
{ internalType: "uint256", name: "initialTokenFairLaunch", type: "uint256" },
|
|
69
|
+
{ internalType: "uint256", name: "fairLaunchDuration", type: "uint256" },
|
|
70
|
+
{ internalType: "uint256", name: "premineAmount", type: "uint256" },
|
|
71
|
+
{ internalType: "address", name: "creator", type: "address" },
|
|
72
|
+
{ internalType: "uint24", name: "creatorFeeAllocation", type: "uint24" },
|
|
73
|
+
{ internalType: "uint256", name: "flaunchAt", type: "uint256" },
|
|
74
|
+
{ internalType: "bytes", name: "initialPriceParams", type: "bytes" },
|
|
75
|
+
{ internalType: "bytes", name: "feeCalculatorParams", type: "bytes" },
|
|
66
76
|
],
|
|
77
|
+
internalType: "struct PositionManager.FlaunchParams",
|
|
78
|
+
name: "_flaunchParams",
|
|
79
|
+
type: "tuple",
|
|
67
80
|
},
|
|
68
81
|
],
|
|
82
|
+
name: "flaunch",
|
|
69
83
|
outputs: [
|
|
84
|
+
{ internalType: "address", name: "memecoin_", type: "address" },
|
|
85
|
+
{ internalType: "uint256", name: "ethSpent_", type: "uint256" },
|
|
86
|
+
{ internalType: "address", name: "", type: "address" },
|
|
87
|
+
],
|
|
88
|
+
stateMutability: "payable",
|
|
89
|
+
type: "function",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
inputs: [
|
|
70
93
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
94
|
+
components: [
|
|
95
|
+
{ internalType: "string", name: "name", type: "string" },
|
|
96
|
+
{ internalType: "string", name: "symbol", type: "string" },
|
|
97
|
+
{ internalType: "string", name: "tokenUri", type: "string" },
|
|
98
|
+
{ internalType: "uint256", name: "initialTokenFairLaunch", type: "uint256" },
|
|
99
|
+
{ internalType: "uint256", name: "fairLaunchDuration", type: "uint256" },
|
|
100
|
+
{ internalType: "uint256", name: "premineAmount", type: "uint256" },
|
|
101
|
+
{ internalType: "address", name: "creator", type: "address" },
|
|
102
|
+
{ internalType: "uint24", name: "creatorFeeAllocation", type: "uint24" },
|
|
103
|
+
{ internalType: "uint256", name: "flaunchAt", type: "uint256" },
|
|
104
|
+
{ internalType: "bytes", name: "initialPriceParams", type: "bytes" },
|
|
105
|
+
{ internalType: "bytes", name: "feeCalculatorParams", type: "bytes" },
|
|
106
|
+
],
|
|
107
|
+
internalType: "struct PositionManager.FlaunchParams",
|
|
108
|
+
name: "_flaunchParams",
|
|
109
|
+
type: "tuple",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
components: [
|
|
113
|
+
{ internalType: "bytes32", name: "merkleRoot", type: "bytes32" },
|
|
114
|
+
{ internalType: "string", name: "merkleIPFSHash", type: "string" },
|
|
115
|
+
{ internalType: "uint256", name: "maxTokens", type: "uint256" },
|
|
116
|
+
],
|
|
117
|
+
internalType: "struct FlaunchZap.WhitelistParams",
|
|
118
|
+
name: "_whitelistParams",
|
|
119
|
+
type: "tuple",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
components: [
|
|
123
|
+
{ internalType: "uint256", name: "airdropIndex", type: "uint256" },
|
|
124
|
+
{ internalType: "uint256", name: "airdropAmount", type: "uint256" },
|
|
125
|
+
{ internalType: "uint256", name: "airdropEndTime", type: "uint256" },
|
|
126
|
+
{ internalType: "bytes32", name: "merkleRoot", type: "bytes32" },
|
|
127
|
+
{ internalType: "string", name: "merkleIPFSHash", type: "string" },
|
|
128
|
+
],
|
|
129
|
+
internalType: "struct FlaunchZap.AirdropParams",
|
|
130
|
+
name: "_airdropParams",
|
|
131
|
+
type: "tuple",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
components: [
|
|
135
|
+
{ internalType: "address", name: "manager", type: "address" },
|
|
136
|
+
{ internalType: "bytes", name: "initializeData", type: "bytes" },
|
|
137
|
+
{ internalType: "bytes", name: "depositData", type: "bytes" },
|
|
138
|
+
],
|
|
139
|
+
internalType: "struct FlaunchZap.TreasuryManagerParams",
|
|
140
|
+
name: "_treasuryManagerParams",
|
|
141
|
+
type: "tuple",
|
|
74
142
|
},
|
|
75
143
|
],
|
|
76
|
-
|
|
144
|
+
name: "flaunch",
|
|
145
|
+
outputs: [
|
|
146
|
+
{ internalType: "address", name: "memecoin_", type: "address" },
|
|
147
|
+
{ internalType: "uint256", name: "ethSpent_", type: "uint256" },
|
|
148
|
+
{ internalType: "address", name: "deployedManager_", type: "address" },
|
|
149
|
+
],
|
|
150
|
+
stateMutability: "payable",
|
|
151
|
+
type: "function",
|
|
77
152
|
},
|
|
78
153
|
];
|
|
79
|
-
exports.
|
|
80
|
-
"event PoolCreated(bytes32 indexed _poolId, address _memecoin, address _memecoinTreasury, uint256 _tokenId, bool _currencyFlipped, uint256 _flaunchFee, (string name, string symbol, string tokenUri, uint256 initialTokenFairLaunch, uint256 premineAmount, address creator, uint24 creatorFeeAllocation, uint256 flaunchAt, bytes initialPriceParams, bytes feeCalculatorParams) _params)",
|
|
81
|
-
"event PoolSwap(bytes32 indexed poolId,
|
|
154
|
+
exports.POSITION_MANAGERV1_1_ABI = (0, viem_1.parseAbi)([
|
|
155
|
+
"event PoolCreated(bytes32 indexed _poolId, address _memecoin, address _memecoinTreasury, uint256 _tokenId, bool _currencyFlipped, uint256 _flaunchFee, (string name, string symbol, string tokenUri, uint256 initialTokenFairLaunch, uint256 fairLaunchDuration, uint256 premineAmount, address creator, uint24 creatorFeeAllocation, uint256 flaunchAt, bytes initialPriceParams, bytes feeCalculatorParams) _params)",
|
|
156
|
+
"event PoolSwap(bytes32 indexed poolId, int256 flAmount0, int256 flAmount1, int256 flFee0, int256 flFee1, int256 ispAmount0, int256 ispAmount1, int256 ispFee0, int256 ispFee1, int256 uniAmount0, int256 uniAmount1, int256 uniFee0, int256 uniFee1)",
|
|
82
157
|
]);
|
|
83
158
|
exports.QUOTER_ABI = [
|
|
84
159
|
{
|
|
@@ -1,51 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flaunch Action Provider
|
|
3
|
-
*
|
|
4
|
-
* This file contains the implementation of the FlaunchActionProvider,
|
|
5
|
-
* which provides actions for flaunch operations.
|
|
6
|
-
*
|
|
7
|
-
* @module flaunch
|
|
8
|
-
*/
|
|
9
1
|
import { z } from "zod";
|
|
10
2
|
import { ActionProvider } from "../actionProvider";
|
|
11
3
|
import { Network } from "../../network";
|
|
12
4
|
import { EvmWalletProvider } from "../../wallet-providers";
|
|
13
5
|
import { FlaunchSchema, BuyCoinWithETHInputSchema, BuyCoinWithCoinInputSchema, SellCoinSchema } from "./schemas";
|
|
14
|
-
/**
|
|
15
|
-
* Configuration options for the FarcasterActionProvider.
|
|
16
|
-
*/
|
|
17
|
-
export interface FlaunchActionProviderConfig {
|
|
18
|
-
/**
|
|
19
|
-
* Pinata JWT.
|
|
20
|
-
*/
|
|
21
|
-
pinataJwt?: string;
|
|
22
|
-
}
|
|
23
6
|
/**
|
|
24
7
|
* FlaunchActionProvider provides actions for flaunch operations.
|
|
25
8
|
*
|
|
26
9
|
* @description
|
|
27
10
|
* This provider is designed to work with EvmWalletProvider for blockchain interactions.
|
|
28
|
-
* It supports all evm networks.
|
|
29
11
|
*/
|
|
30
12
|
export declare class FlaunchActionProvider extends ActionProvider<EvmWalletProvider> {
|
|
31
|
-
private readonly pinataJwt;
|
|
32
13
|
/**
|
|
33
14
|
* Constructor for the FlaunchActionProvider.
|
|
34
15
|
*
|
|
35
|
-
* @param config - The configuration options for the FlaunchActionProvider.
|
|
36
16
|
*/
|
|
37
|
-
constructor(
|
|
17
|
+
constructor();
|
|
38
18
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Replace or modify this with your actual action.
|
|
41
|
-
*
|
|
42
|
-
* @description
|
|
43
|
-
* This is a template action that demonstrates the basic structure.
|
|
44
|
-
* Replace it with your actual implementation.
|
|
19
|
+
* Launches a new memecoin using the flaunch protocol.
|
|
45
20
|
*
|
|
46
21
|
* @param walletProvider - The wallet provider instance for blockchain interactions
|
|
47
22
|
* @param args - Arguments defined by FlaunchSchema
|
|
48
|
-
* @returns A promise that resolves to a string describing the
|
|
23
|
+
* @returns A promise that resolves to a string describing the transaction result
|
|
49
24
|
*/
|
|
50
25
|
flaunch(walletProvider: EvmWalletProvider, args: z.infer<typeof FlaunchSchema>): Promise<string>;
|
|
51
26
|
/**
|
|
@@ -79,24 +54,10 @@ export declare class FlaunchActionProvider extends ActionProvider<EvmWalletProvi
|
|
|
79
54
|
* @returns True if the network is supported
|
|
80
55
|
*/
|
|
81
56
|
supportsNetwork(network: Network): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Handles the process of buying a flaunch coin with ETH.
|
|
84
|
-
*
|
|
85
|
-
* @param walletProvider - The wallet provider instance
|
|
86
|
-
* @param coinAddress - The address of the flaunch coin
|
|
87
|
-
* @param swapType - The type of swap (EXACT_IN or EXACT_OUT)
|
|
88
|
-
* @param swapParams - Parameters specific to the swap type
|
|
89
|
-
* @param swapParams.amountIn - The amount of ETH to spend (for EXACT_IN)
|
|
90
|
-
* @param swapParams.amountOut - The amount of coins to buy (for EXACT_OUT)
|
|
91
|
-
* @param slippagePercent - The slippage percentage
|
|
92
|
-
* @returns A promise that resolves to a string describing the transaction result
|
|
93
|
-
*/
|
|
94
|
-
private _buyFlaunchCoin;
|
|
95
57
|
}
|
|
96
58
|
/**
|
|
97
59
|
* Factory function to create a new FlaunchActionProvider instance.
|
|
98
60
|
*
|
|
99
|
-
* @param config - Configuration options for the FlaunchActionProvider
|
|
100
61
|
* @returns A new FlaunchActionProvider instance
|
|
101
62
|
*/
|
|
102
|
-
export declare const flaunchActionProvider: (
|
|
63
|
+
export declare const flaunchActionProvider: () => FlaunchActionProvider;
|