@sherwoodagent/cli 0.18.0 → 0.18.1
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/dist/{chat-MQPTP4QO.js → chat-7CB4YGGP.js} +4 -4
- package/dist/{chunk-EMDEQLUU.js → chunk-5ZC2A7UP.js} +2 -2
- package/dist/{chunk-PRX5GLSN.js → chunk-ARD44YTT.js} +2 -2
- package/dist/{chunk-KYABEFLH.js → chunk-FR4LYDPJ.js} +2 -2
- package/dist/chunk-L24NGLKY.js +124 -0
- package/dist/chunk-L24NGLKY.js.map +1 -0
- package/dist/{chunk-EDH6ICCT.js → chunk-Z2PNK3CC.js} +2 -2
- package/dist/{eas-Y7HS7FXK.js → eas-DOC4QKDF.js} +3 -3
- package/dist/{governor-UGIUQYPB.js → governor-E6AU3UWV.js} +3 -3
- package/dist/index.js +17 -18
- package/dist/index.js.map +1 -1
- package/dist/{research-NCY3MCN4.js → research-MHN7UGIU.js} +5 -5
- package/dist/{research-IUHVRHR3.js → research-V63URK4C.js} +3 -3
- package/dist/{session-CQZ743DX.js → session-OJX2MILJ.js} +4 -4
- package/dist/{xmtp-MJ53JW2W.js → xmtp-ATRMY76G.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-N65F7HRF.js +0 -74
- package/dist/chunk-N65F7HRF.js.map +0 -1
- /package/dist/{chat-MQPTP4QO.js.map → chat-7CB4YGGP.js.map} +0 -0
- /package/dist/{chunk-EMDEQLUU.js.map → chunk-5ZC2A7UP.js.map} +0 -0
- /package/dist/{chunk-PRX5GLSN.js.map → chunk-ARD44YTT.js.map} +0 -0
- /package/dist/{chunk-KYABEFLH.js.map → chunk-FR4LYDPJ.js.map} +0 -0
- /package/dist/{chunk-EDH6ICCT.js.map → chunk-Z2PNK3CC.js.map} +0 -0
- /package/dist/{eas-Y7HS7FXK.js.map → eas-DOC4QKDF.js.map} +0 -0
- /package/dist/{governor-UGIUQYPB.js.map → governor-E6AU3UWV.js.map} +0 -0
- /package/dist/{research-NCY3MCN4.js.map → research-MHN7UGIU.js.map} +0 -0
- /package/dist/{research-IUHVRHR3.js.map → research-V63URK4C.js.map} +0 -0
- /package/dist/{session-CQZ743DX.js.map → session-OJX2MILJ.js.map} +0 -0
- /package/dist/{xmtp-MJ53JW2W.js.map → xmtp-ATRMY76G.js.map} +0 -0
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
getTextRecord,
|
|
3
3
|
resolveSyndicate,
|
|
4
4
|
setTextRecord
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ARD44YTT.js";
|
|
6
6
|
import "./chunk-TPE6ZTUI.js";
|
|
7
7
|
import {
|
|
8
8
|
getAccount
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-L24NGLKY.js";
|
|
10
10
|
import "./chunk-MJMWA4LY.js";
|
|
11
11
|
import {
|
|
12
12
|
cacheGroupId,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import chalk from "chalk";
|
|
18
18
|
import ora from "ora";
|
|
19
19
|
async function loadXmtp() {
|
|
20
|
-
return import("./xmtp-
|
|
20
|
+
return import("./xmtp-ATRMY76G.js");
|
|
21
21
|
}
|
|
22
22
|
function formatTimestamp(date) {
|
|
23
23
|
return `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`;
|
|
@@ -352,4 +352,4 @@ function registerChatCommands(program) {
|
|
|
352
352
|
export {
|
|
353
353
|
registerChatCommands
|
|
354
354
|
};
|
|
355
|
-
//# sourceMappingURL=chat-
|
|
355
|
+
//# sourceMappingURL=chat-7CB4YGGP.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getAccount,
|
|
7
7
|
getPublicClient,
|
|
8
8
|
getWalletClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-L24NGLKY.js";
|
|
10
10
|
import {
|
|
11
11
|
getChain
|
|
12
12
|
} from "./chunk-MJMWA4LY.js";
|
|
@@ -455,4 +455,4 @@ export {
|
|
|
455
455
|
vetoProposal,
|
|
456
456
|
setProtocolFeeBps
|
|
457
457
|
};
|
|
458
|
-
//# sourceMappingURL=chunk-
|
|
458
|
+
//# sourceMappingURL=chunk-5ZC2A7UP.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getAccount,
|
|
12
12
|
getPublicClient,
|
|
13
13
|
getWalletClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-L24NGLKY.js";
|
|
15
15
|
import {
|
|
16
16
|
getChain
|
|
17
17
|
} from "./chunk-MJMWA4LY.js";
|
|
@@ -329,4 +329,4 @@ export {
|
|
|
329
329
|
setTextRecord,
|
|
330
330
|
getTextRecord
|
|
331
331
|
};
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
332
|
+
//# sourceMappingURL=chunk-ARD44YTT.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getAccount,
|
|
8
8
|
getPublicClient,
|
|
9
9
|
getWalletClient
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-L24NGLKY.js";
|
|
11
11
|
import {
|
|
12
12
|
getChain,
|
|
13
13
|
getChainConfig,
|
|
@@ -288,4 +288,4 @@ export {
|
|
|
288
288
|
queryApprovals,
|
|
289
289
|
queryJoinRequests
|
|
290
290
|
};
|
|
291
|
-
//# sourceMappingURL=chunk-
|
|
291
|
+
//# sourceMappingURL=chunk-FR4LYDPJ.js.map
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getChain,
|
|
3
|
+
getRpcUrl
|
|
4
|
+
} from "./chunk-MJMWA4LY.js";
|
|
5
|
+
import {
|
|
6
|
+
loadConfig
|
|
7
|
+
} from "./chunk-TWX6FSCM.js";
|
|
8
|
+
|
|
9
|
+
// src/lib/client.ts
|
|
10
|
+
import { createPublicClient, createWalletClient, http } from "viem";
|
|
11
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
12
|
+
var _publicClient = null;
|
|
13
|
+
var _walletClient = null;
|
|
14
|
+
function getPrivateKey() {
|
|
15
|
+
const config = loadConfig();
|
|
16
|
+
if (config.privateKey) {
|
|
17
|
+
const k = config.privateKey;
|
|
18
|
+
return k.startsWith("0x") ? k : `0x${k}`;
|
|
19
|
+
}
|
|
20
|
+
const env = process.env.PRIVATE_KEY;
|
|
21
|
+
if (env) {
|
|
22
|
+
return env.startsWith("0x") ? env : `0x${env}`;
|
|
23
|
+
}
|
|
24
|
+
throw new Error(
|
|
25
|
+
"Private key not found. Run 'sherwood config set --private-key <key>' or set PRIVATE_KEY env var."
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function getPublicClient() {
|
|
29
|
+
const chain = getChain();
|
|
30
|
+
if (_publicClient && _publicClient.chain?.id !== chain.id) {
|
|
31
|
+
_publicClient = null;
|
|
32
|
+
}
|
|
33
|
+
if (!_publicClient) {
|
|
34
|
+
_publicClient = createPublicClient({
|
|
35
|
+
chain,
|
|
36
|
+
transport: http(getRpcUrl())
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return _publicClient;
|
|
40
|
+
}
|
|
41
|
+
function getWalletClient() {
|
|
42
|
+
const chain = getChain();
|
|
43
|
+
if (_walletClient && _walletClient.chain?.id !== chain.id) {
|
|
44
|
+
_walletClient = null;
|
|
45
|
+
}
|
|
46
|
+
if (!_walletClient) {
|
|
47
|
+
const account = privateKeyToAccount(getPrivateKey());
|
|
48
|
+
_walletClient = createWalletClient({
|
|
49
|
+
account,
|
|
50
|
+
chain,
|
|
51
|
+
transport: http(getRpcUrl())
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return _walletClient;
|
|
55
|
+
}
|
|
56
|
+
function getAccount() {
|
|
57
|
+
return privateKeyToAccount(getPrivateKey());
|
|
58
|
+
}
|
|
59
|
+
async function estimateFeesWithBuffer() {
|
|
60
|
+
const client = getPublicClient();
|
|
61
|
+
const { maxFeePerGas, maxPriorityFeePerGas } = await client.estimateFeesPerGas();
|
|
62
|
+
return {
|
|
63
|
+
maxFeePerGas: maxFeePerGas * 120n / 100n,
|
|
64
|
+
maxPriorityFeePerGas: maxPriorityFeePerGas * 120n / 100n
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
var MAX_RETRIES = 3;
|
|
68
|
+
var GAS_BUMP_NUMERATOR = 110n;
|
|
69
|
+
var GAS_BUMP_DENOMINATOR = 100n;
|
|
70
|
+
function isUnderpricedError(msg) {
|
|
71
|
+
return msg.includes("replacement transaction underpriced");
|
|
72
|
+
}
|
|
73
|
+
function isNonceStaleError(msg) {
|
|
74
|
+
return msg.includes("nonce too low") || msg.includes("NONCE_EXPIRED");
|
|
75
|
+
}
|
|
76
|
+
function isRetryableError(err) {
|
|
77
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
78
|
+
return isUnderpricedError(msg) || isNonceStaleError(msg);
|
|
79
|
+
}
|
|
80
|
+
function bumpFees(fees) {
|
|
81
|
+
return {
|
|
82
|
+
maxFeePerGas: fees.maxFeePerGas * GAS_BUMP_NUMERATOR / GAS_BUMP_DENOMINATOR,
|
|
83
|
+
maxPriorityFeePerGas: fees.maxPriorityFeePerGas * GAS_BUMP_NUMERATOR / GAS_BUMP_DENOMINATOR
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
async function withRetry(send, txParams) {
|
|
87
|
+
const client = getPublicClient();
|
|
88
|
+
const account = getAccount();
|
|
89
|
+
let fees = await estimateFeesWithBuffer();
|
|
90
|
+
let nonce = await client.getTransactionCount({ address: account.address, blockTag: "pending" });
|
|
91
|
+
for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
|
|
92
|
+
try {
|
|
93
|
+
return await send({ ...txParams, ...fees, nonce });
|
|
94
|
+
} catch (err) {
|
|
95
|
+
if (attempt >= MAX_RETRIES || !isRetryableError(err)) throw err;
|
|
96
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
97
|
+
console.warn(` Retry ${attempt + 1}/${MAX_RETRIES}: ${isNonceStaleError(msg) ? "refreshing nonce" : "bumping gas"}...`);
|
|
98
|
+
if (isNonceStaleError(msg)) {
|
|
99
|
+
nonce = await client.getTransactionCount({ address: account.address, blockTag: "pending" });
|
|
100
|
+
} else {
|
|
101
|
+
fees = bumpFees(fees);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
throw new Error("withRetry: exhausted retries");
|
|
106
|
+
}
|
|
107
|
+
async function sendTxWithRetry(txParams) {
|
|
108
|
+
const wallet = getWalletClient();
|
|
109
|
+
return withRetry((p) => wallet.sendTransaction(p), txParams);
|
|
110
|
+
}
|
|
111
|
+
async function writeContractWithRetry(txParams) {
|
|
112
|
+
const wallet = getWalletClient();
|
|
113
|
+
return withRetry((p) => wallet.writeContract(p), txParams);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
getPublicClient,
|
|
118
|
+
getWalletClient,
|
|
119
|
+
getAccount,
|
|
120
|
+
estimateFeesWithBuffer,
|
|
121
|
+
sendTxWithRetry,
|
|
122
|
+
writeContractWithRetry
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=chunk-L24NGLKY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/client.ts"],"sourcesContent":["/**\n * viem client factory — resolves chain and RPC from the network module.\n * Private key is read from ~/.sherwood/config.json (set via `sherwood config set --private-key`),\n * with PRIVATE_KEY env var as fallback.\n */\n\n// dotenv loaded at entrypoint\nimport type { Hex } from \"viem\";\nimport { createPublicClient, createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\nimport { getChain, getRpcUrl } from \"./network.js\";\nimport { loadConfig } from \"./config.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _publicClient: any = null;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _walletClient: any = null;\n\n/**\n * Resolve the private key: config → env → error.\n */\nfunction getPrivateKey(): `0x${string}` {\n // 1. Config (~/.sherwood/config.json)\n const config = loadConfig();\n if (config.privateKey) {\n const k = config.privateKey;\n return (k.startsWith(\"0x\") ? k : `0x${k}`) as `0x${string}`;\n }\n\n // 2. Env var fallback\n const env = process.env.PRIVATE_KEY;\n if (env) {\n return (env.startsWith(\"0x\") ? env : `0x${env}`) as `0x${string}`;\n }\n\n throw new Error(\n \"Private key not found. Run 'sherwood config set --private-key <key>' or set PRIVATE_KEY env var.\",\n );\n}\n\nexport function getPublicClient() {\n const chain = getChain();\n // Auto-invalidate if network changed since last creation\n if (_publicClient && _publicClient.chain?.id !== chain.id) {\n _publicClient = null;\n }\n if (!_publicClient) {\n _publicClient = createPublicClient({\n chain,\n transport: http(getRpcUrl()),\n });\n }\n return _publicClient as ReturnType<typeof createPublicClient>;\n}\n\nexport function getWalletClient() {\n const chain = getChain();\n // Auto-invalidate if network changed since last creation\n if (_walletClient && _walletClient.chain?.id !== chain.id) {\n _walletClient = null;\n }\n if (!_walletClient) {\n const account = privateKeyToAccount(getPrivateKey());\n _walletClient = createWalletClient({\n account,\n chain,\n transport: http(getRpcUrl()),\n });\n }\n return _walletClient as ReturnType<typeof createWalletClient>;\n}\n\n/**\n * Reset cached clients. Required for tests that call setNetwork()\n * after a client was already created.\n */\nexport function resetClients() {\n _publicClient = null;\n _walletClient = null;\n}\n\nexport function getAccount() {\n return privateKeyToAccount(getPrivateKey());\n}\n\n/**\n * Estimate EIP-1559 fees with a 20% buffer to avoid stuck txs on Base gas spikes.\n */\nexport async function estimateFeesWithBuffer() {\n const client = getPublicClient();\n const { maxFeePerGas, maxPriorityFeePerGas } =\n await client.estimateFeesPerGas();\n return {\n maxFeePerGas: (maxFeePerGas * 120n) / 100n,\n maxPriorityFeePerGas: (maxPriorityFeePerGas * 120n) / 100n,\n };\n}\n\n// ── Retry helpers for nonce collision / underpriced tx recovery ──\n//\n// Gas bump ceiling: base * 1.2 (buffer) * 1.1^3 (max retries) ≈ 1.6x base fee.\n\nconst MAX_RETRIES = 3;\nconst GAS_BUMP_NUMERATOR = 110n;\nconst GAS_BUMP_DENOMINATOR = 100n;\n\nfunction isUnderpricedError(msg: string): boolean {\n return msg.includes(\"replacement transaction underpriced\");\n}\n\nfunction isNonceStaleError(msg: string): boolean {\n return msg.includes(\"nonce too low\") || msg.includes(\"NONCE_EXPIRED\");\n}\n\nfunction isRetryableError(err: unknown): boolean {\n const msg = err instanceof Error ? err.message : String(err);\n return isUnderpricedError(msg) || isNonceStaleError(msg);\n}\n\nfunction bumpFees(fees: { maxFeePerGas: bigint; maxPriorityFeePerGas: bigint }) {\n return {\n maxFeePerGas: (fees.maxFeePerGas * GAS_BUMP_NUMERATOR) / GAS_BUMP_DENOMINATOR,\n maxPriorityFeePerGas: (fees.maxPriorityFeePerGas * GAS_BUMP_NUMERATOR) / GAS_BUMP_DENOMINATOR,\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype TxSender = (params: any) => Promise<Hex>;\n\n/**\n * Shared retry loop: explicit nonce + EIP-1559 fee buffer + gas-bump on underpriced errors.\n * On \"nonce too low\" / \"NONCE_EXPIRED\", re-fetches nonce from pending state before retrying.\n */\nasync function withRetry(send: TxSender, txParams: Record<string, unknown>): Promise<Hex> {\n const client = getPublicClient();\n const account = getAccount();\n let fees = await estimateFeesWithBuffer();\n let nonce = await client.getTransactionCount({ address: account.address, blockTag: \"pending\" });\n\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n try {\n return await send({ ...txParams, ...fees, nonce });\n } catch (err) {\n if (attempt >= MAX_RETRIES || !isRetryableError(err)) throw err;\n\n const msg = err instanceof Error ? err.message : String(err);\n console.warn(` Retry ${attempt + 1}/${MAX_RETRIES}: ${isNonceStaleError(msg) ? \"refreshing nonce\" : \"bumping gas\"}...`);\n\n if (isNonceStaleError(msg)) {\n // Fresh nonce = fresh tx, no replacement needed — only bump fees for underpriced errors\n nonce = await client.getTransactionCount({ address: account.address, blockTag: \"pending\" });\n } else {\n fees = bumpFees(fees);\n }\n }\n }\n throw new Error(\"withRetry: exhausted retries\");\n}\n\n/**\n * Send a raw transaction with automatic gas-bump retry on nonce/underpriced errors.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function sendTxWithRetry(txParams: Record<string, any>): Promise<Hex> {\n const wallet = getWalletClient();\n return withRetry((p) => wallet.sendTransaction(p), txParams);\n}\n\n/**\n * Call writeContract with automatic gas-bump retry on nonce/underpriced errors.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function writeContractWithRetry(txParams: Record<string, any>): Promise<Hex> {\n const wallet = getWalletClient();\n return withRetry((p) => wallet.writeContract(p), txParams);\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAccount
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L24NGLKY.js";
|
|
4
4
|
|
|
5
5
|
// src/providers/research/messari.ts
|
|
6
6
|
import { base, baseSepolia } from "viem/chains";
|
|
@@ -436,4 +436,4 @@ export {
|
|
|
436
436
|
NansenProvider,
|
|
437
437
|
getResearchProvider
|
|
438
438
|
};
|
|
439
|
-
//# sourceMappingURL=chunk-
|
|
439
|
+
//# sourceMappingURL=chunk-Z2PNK3CC.js.map
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
queryApprovals,
|
|
7
7
|
queryJoinRequests,
|
|
8
8
|
revokeAttestation
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FR4LYDPJ.js";
|
|
10
10
|
import "./chunk-TPE6ZTUI.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-L24NGLKY.js";
|
|
12
12
|
import "./chunk-MJMWA4LY.js";
|
|
13
13
|
import "./chunk-TWX6FSCM.js";
|
|
14
14
|
export {
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
queryJoinRequests,
|
|
21
21
|
revokeAttestation
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=eas-
|
|
23
|
+
//# sourceMappingURL=eas-DOC4QKDF.js.map
|
|
@@ -34,9 +34,9 @@ import {
|
|
|
34
34
|
settleProposal,
|
|
35
35
|
vetoProposal,
|
|
36
36
|
vote
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-5ZC2A7UP.js";
|
|
38
38
|
import "./chunk-TPE6ZTUI.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-L24NGLKY.js";
|
|
40
40
|
import "./chunk-MJMWA4LY.js";
|
|
41
41
|
import "./chunk-TWX6FSCM.js";
|
|
42
42
|
export {
|
|
@@ -76,4 +76,4 @@ export {
|
|
|
76
76
|
vetoProposal,
|
|
77
77
|
vote
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=governor-
|
|
79
|
+
//# sourceMappingURL=governor-E6AU3UWV.js.map
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
setVotingPeriod,
|
|
30
30
|
settleProposal,
|
|
31
31
|
vote
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-5ZC2A7UP.js";
|
|
33
33
|
import {
|
|
34
34
|
fetchMetadata,
|
|
35
35
|
uploadMetadata
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
queryApprovals,
|
|
42
42
|
queryJoinRequests,
|
|
43
43
|
revokeAttestation
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-FR4LYDPJ.js";
|
|
45
45
|
import {
|
|
46
46
|
approveDepositor,
|
|
47
47
|
deposit,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
resolveVaultSyndicate,
|
|
58
58
|
setTextRecord,
|
|
59
59
|
setVaultAddress
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-ARD44YTT.js";
|
|
61
61
|
import {
|
|
62
62
|
AERODROME,
|
|
63
63
|
AGENT_REGISTRY,
|
|
@@ -78,8 +78,10 @@ import {
|
|
|
78
78
|
import {
|
|
79
79
|
getAccount,
|
|
80
80
|
getPublicClient,
|
|
81
|
-
getWalletClient
|
|
82
|
-
|
|
81
|
+
getWalletClient,
|
|
82
|
+
sendTxWithRetry,
|
|
83
|
+
writeContractWithRetry
|
|
84
|
+
} from "./chunk-L24NGLKY.js";
|
|
83
85
|
import {
|
|
84
86
|
VALID_NETWORKS,
|
|
85
87
|
getChain,
|
|
@@ -184,10 +186,9 @@ async function cloneTemplate(template) {
|
|
|
184
186
|
template,
|
|
185
187
|
"0x5af43d82803e903d91602b57fd5bf3"
|
|
186
188
|
]);
|
|
187
|
-
const wallet = getWalletClient();
|
|
188
189
|
const account = getAccount();
|
|
189
190
|
const chain = getChain();
|
|
190
|
-
const hash = await
|
|
191
|
+
const hash = await sendTxWithRetry({
|
|
191
192
|
account,
|
|
192
193
|
chain,
|
|
193
194
|
data: creationCode,
|
|
@@ -711,8 +712,7 @@ function registerStrategyTemplateCommands(strategy2) {
|
|
|
711
712
|
try {
|
|
712
713
|
const { initData } = await buildInitDataForTemplate(templateKey, opts, vault);
|
|
713
714
|
const account = getAccount();
|
|
714
|
-
const
|
|
715
|
-
const initHash = await wallet.writeContract({
|
|
715
|
+
const initHash = await writeContractWithRetry({
|
|
716
716
|
account,
|
|
717
717
|
chain: getChain(),
|
|
718
718
|
address: clone,
|
|
@@ -761,8 +761,7 @@ function registerStrategyTemplateCommands(strategy2) {
|
|
|
761
761
|
assetAmount = built.assetAmount;
|
|
762
762
|
extraApprovals = built.extraApprovals;
|
|
763
763
|
const account2 = getAccount();
|
|
764
|
-
const
|
|
765
|
-
const initHash = await wallet.writeContract({
|
|
764
|
+
const initHash = await writeContractWithRetry({
|
|
766
765
|
account: account2,
|
|
767
766
|
chain: getChain(),
|
|
768
767
|
address: clone,
|
|
@@ -821,9 +820,9 @@ function registerStrategyTemplateCommands(strategy2) {
|
|
|
821
820
|
console.error(chalk.red("Missing --name, --performance-fee, or --duration. Use --write-calls to skip proposal submission."));
|
|
822
821
|
process.exit(1);
|
|
823
822
|
}
|
|
824
|
-
const { propose: propose2 } = await import("./governor-
|
|
823
|
+
const { propose: propose2 } = await import("./governor-E6AU3UWV.js");
|
|
825
824
|
const { pinJSON } = await import("./ipfs-6XVOOHSR.js");
|
|
826
|
-
const { parseDuration: parseDuration2 } = await import("./governor-
|
|
825
|
+
const { parseDuration: parseDuration2 } = await import("./governor-E6AU3UWV.js");
|
|
827
826
|
const performanceFeeBps = BigInt(opts.performanceFee);
|
|
828
827
|
if (performanceFeeBps < 0n || performanceFeeBps > 10000n) {
|
|
829
828
|
console.error(chalk.red("--performance-fee must be 0-10000 (basis points)"));
|
|
@@ -2452,7 +2451,7 @@ try {
|
|
|
2452
2451
|
var require2 = createRequire(import.meta.url);
|
|
2453
2452
|
var { version: CLI_VERSION } = require2("../package.json");
|
|
2454
2453
|
async function loadXmtp() {
|
|
2455
|
-
return import("./xmtp-
|
|
2454
|
+
return import("./xmtp-ATRMY76G.js");
|
|
2456
2455
|
}
|
|
2457
2456
|
async function loadCron() {
|
|
2458
2457
|
return import("./cron-SKYKVZ6K.js");
|
|
@@ -3184,7 +3183,7 @@ vaultCmd.command("balance").description("Show LP share balance and asset value")
|
|
|
3184
3183
|
var strategy = program.command("strategy").description("Strategy templates \u2014 list, clone, propose");
|
|
3185
3184
|
registerStrategyTemplateCommands(strategy);
|
|
3186
3185
|
program.command("providers").description("List available DeFi providers").action(async () => {
|
|
3187
|
-
const { MessariProvider, NansenProvider } = await import("./research-
|
|
3186
|
+
const { MessariProvider, NansenProvider } = await import("./research-V63URK4C.js");
|
|
3188
3187
|
const providers = [new MoonwellProvider(), new UniswapProvider(), new MessariProvider(), new NansenProvider()];
|
|
3189
3188
|
for (const p of providers) {
|
|
3190
3189
|
const info = p.info();
|
|
@@ -3195,7 +3194,7 @@ ${info.name} (${info.type})`);
|
|
|
3195
3194
|
}
|
|
3196
3195
|
});
|
|
3197
3196
|
try {
|
|
3198
|
-
const { registerChatCommands } = await import("./chat-
|
|
3197
|
+
const { registerChatCommands } = await import("./chat-7CB4YGGP.js");
|
|
3199
3198
|
registerChatCommands(program);
|
|
3200
3199
|
} catch {
|
|
3201
3200
|
program.command("chat <name> [action] [actionArgs...]").description("Syndicate chat (XMTP) \u2014 requires @xmtp/cli").action(() => {
|
|
@@ -3205,14 +3204,14 @@ try {
|
|
|
3205
3204
|
process.exit(1);
|
|
3206
3205
|
});
|
|
3207
3206
|
}
|
|
3208
|
-
var { registerSessionCommands } = await import("./session-
|
|
3207
|
+
var { registerSessionCommands } = await import("./session-OJX2MILJ.js");
|
|
3209
3208
|
registerSessionCommands(program);
|
|
3210
3209
|
registerVeniceCommands(program);
|
|
3211
3210
|
registerAllowanceCommands(program);
|
|
3212
3211
|
registerIdentityCommands(program);
|
|
3213
3212
|
registerProposalCommands(program);
|
|
3214
3213
|
registerGovernorCommands(program);
|
|
3215
|
-
var { registerResearchCommands } = await import("./research-
|
|
3214
|
+
var { registerResearchCommands } = await import("./research-MHN7UGIU.js");
|
|
3216
3215
|
registerResearchCommands(program);
|
|
3217
3216
|
var configCmd = program.command("config");
|
|
3218
3217
|
configCmd.command("set").description("Save settings to ~/.sherwood/config.json (persists across sessions)").option("--private-key <key>", "Wallet private key (0x-prefixed)").option("--vault <address>", "Default SyndicateVault address").option("--rpc <url>", "Custom RPC URL for the active --chain network").option("--notify-to <id>", "Destination for cron summaries (Telegram chat ID, phone, etc.)").action((opts) => {
|