web3-tools-mcp 2.0.2 → 3.0.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/CHANGELOG.md +97 -0
- package/README.md +5 -0
- package/dist/anvil.d.ts +17 -19
- package/dist/anvil.d.ts.map +1 -1
- package/dist/anvil.js +124 -228
- package/dist/anvil.js.map +1 -1
- package/dist/chains.d.ts +9 -1
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +11 -2
- package/dist/chains.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js.map +1 -1
- package/dist/context.d.ts +22 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +24 -0
- package/dist/context.js.map +1 -0
- package/dist/hosted.d.ts +12 -0
- package/dist/hosted.d.ts.map +1 -0
- package/dist/hosted.js +12 -0
- package/dist/hosted.js.map +1 -0
- package/dist/http-server.d.ts +13 -0
- package/dist/http-server.d.ts.map +1 -1
- package/dist/http-server.js +13 -4
- package/dist/http-server.js.map +1 -1
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +24 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +23 -0
- package/dist/lib.js.map +1 -0
- package/dist/mcp-server.d.ts +4 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +43 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/oauth.d.ts +41 -6
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +75 -41
- package/dist/oauth.js.map +1 -1
- package/dist/preview.d.ts +7 -0
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +14 -2
- package/dist/preview.js.map +1 -1
- package/dist/signing-requests.d.ts +81 -0
- package/dist/signing-requests.d.ts.map +1 -0
- package/dist/signing-requests.js +138 -0
- package/dist/signing-requests.js.map +1 -0
- package/dist/tools/index.d.ts +27 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +37 -15
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/{advanced.d.ts → read/advanced.d.ts} +30 -26
- package/dist/tools/read/advanced.d.ts.map +1 -0
- package/dist/tools/{advanced.js → read/advanced.js} +10 -10
- package/dist/tools/read/advanced.js.map +1 -0
- package/dist/tools/{balance.d.ts → read/balance.d.ts} +8 -7
- package/dist/tools/read/balance.d.ts.map +1 -0
- package/dist/tools/{balance.js → read/balance.js} +2 -2
- package/dist/tools/read/balance.js.map +1 -0
- package/dist/tools/{contract-info.d.ts → read/contract-info.d.ts} +18 -15
- package/dist/tools/read/contract-info.d.ts.map +1 -0
- package/dist/tools/{contract-info.js → read/contract-info.js} +2 -2
- package/dist/tools/read/contract-info.js.map +1 -0
- package/dist/tools/{contract.d.ts → read/contract.d.ts} +14 -12
- package/dist/tools/read/contract.d.ts.map +1 -0
- package/dist/tools/{contract.js → read/contract.js} +2 -2
- package/dist/tools/read/contract.js.map +1 -0
- package/dist/tools/{ens.d.ts → read/ens.d.ts} +30 -25
- package/dist/tools/read/ens.d.ts.map +1 -0
- package/dist/tools/{ens.js → read/ens.js} +2 -2
- package/dist/tools/read/ens.js.map +1 -0
- package/dist/tools/read/gas.d.ts +171 -0
- package/dist/tools/read/gas.d.ts.map +1 -0
- package/dist/tools/read/gas.js +368 -0
- package/dist/tools/read/gas.js.map +1 -0
- package/dist/tools/{logs.d.ts → read/logs.d.ts} +6 -5
- package/dist/tools/read/logs.d.ts.map +1 -0
- package/dist/tools/{logs.js → read/logs.js} +2 -2
- package/dist/tools/read/logs.js.map +1 -0
- package/dist/tools/{signatures.d.ts → read/signatures.d.ts} +8 -4
- package/dist/tools/read/signatures.d.ts.map +1 -0
- package/dist/tools/{signatures.js → read/signatures.js} +1 -1
- package/dist/tools/read/signatures.js.map +1 -0
- package/dist/tools/read/signing.d.ts +27 -0
- package/dist/tools/read/signing.d.ts.map +1 -0
- package/dist/tools/read/signing.js +75 -0
- package/dist/tools/read/signing.js.map +1 -0
- package/dist/tools/sign/errors.d.ts +9 -0
- package/dist/tools/sign/errors.d.ts.map +1 -0
- package/dist/tools/sign/errors.js +29 -0
- package/dist/tools/sign/errors.js.map +1 -0
- package/dist/tools/{transactions.d.ts → sign/transactions.d.ts} +48 -62
- package/dist/tools/sign/transactions.d.ts.map +1 -0
- package/dist/tools/sign/transactions.js +316 -0
- package/dist/tools/sign/transactions.js.map +1 -0
- package/dist/tools/sign/wallet.d.ts +50 -0
- package/dist/tools/sign/wallet.d.ts.map +1 -0
- package/dist/tools/sign/wallet.js +180 -0
- package/dist/tools/sign/wallet.js.map +1 -0
- package/dist/utils.d.ts +5 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +5 -2
- package/dist/utils.js.map +1 -1
- package/dist/wallet-client.d.ts +33 -4
- package/dist/wallet-client.d.ts.map +1 -1
- package/dist/wallet-client.js +90 -24
- package/dist/wallet-client.js.map +1 -1
- package/dist/walletconnect.d.ts +100 -13
- package/dist/walletconnect.d.ts.map +1 -1
- package/dist/walletconnect.js +215 -50
- package/dist/walletconnect.js.map +1 -1
- package/package.json +10 -4
- package/src/anvil.ts +150 -271
- package/src/chains.ts +14 -2
- package/src/client.ts +0 -1
- package/src/context.ts +27 -0
- package/src/hosted.ts +11 -0
- package/src/http-server.ts +30 -5
- package/src/index.ts +15 -12
- package/src/lib.ts +24 -0
- package/src/mcp-server.ts +47 -0
- package/src/oauth.ts +98 -45
- package/src/preview.ts +21 -2
- package/src/signing-requests.ts +198 -0
- package/src/tools/index.ts +67 -16
- package/src/tools/{advanced.ts → read/advanced.ts} +13 -11
- package/src/tools/{balance.ts → read/balance.ts} +3 -3
- package/src/tools/{contract-info.ts → read/contract-info.ts} +3 -3
- package/src/tools/{contract.ts → read/contract.ts} +3 -3
- package/src/tools/{ens.ts → read/ens.ts} +3 -3
- package/src/tools/read/gas.ts +480 -0
- package/src/tools/{logs.ts → read/logs.ts} +3 -3
- package/src/tools/{signatures.ts → read/signatures.ts} +2 -2
- package/src/tools/read/signing.ts +86 -0
- package/src/tools/sign/errors.ts +28 -0
- package/src/tools/sign/transactions.ts +428 -0
- package/src/tools/sign/wallet.ts +216 -0
- package/src/utils.ts +5 -2
- package/src/wallet-client.ts +91 -22
- package/src/walletconnect.ts +250 -48
- package/dist/tools/advanced.d.ts.map +0 -1
- package/dist/tools/advanced.js.map +0 -1
- package/dist/tools/balance.d.ts.map +0 -1
- package/dist/tools/balance.js.map +0 -1
- package/dist/tools/contract-info.d.ts.map +0 -1
- package/dist/tools/contract-info.js.map +0 -1
- package/dist/tools/contract.d.ts.map +0 -1
- package/dist/tools/contract.js.map +0 -1
- package/dist/tools/ens.d.ts.map +0 -1
- package/dist/tools/ens.js.map +0 -1
- package/dist/tools/gas.d.ts +0 -99
- package/dist/tools/gas.d.ts.map +0 -1
- package/dist/tools/gas.js +0 -181
- package/dist/tools/gas.js.map +0 -1
- package/dist/tools/logs.d.ts.map +0 -1
- package/dist/tools/logs.js.map +0 -1
- package/dist/tools/signatures.d.ts.map +0 -1
- package/dist/tools/signatures.js.map +0 -1
- package/dist/tools/transactions.d.ts.map +0 -1
- package/dist/tools/transactions.js +0 -365
- package/dist/tools/transactions.js.map +0 -1
- package/src/tools/gas.ts +0 -219
- package/src/tools/transactions.ts +0 -456
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { collectSigningRequest } from '../../signing-requests.js';
|
|
3
|
+
import { createTool, formatResponse } from '../../utils.js';
|
|
4
|
+
import { failure } from '../sign/errors.js';
|
|
5
|
+
/**
|
|
6
|
+
* Collecting a signature that was not given within the tool call that asked for it.
|
|
7
|
+
*
|
|
8
|
+
* A read rather than a signing tool on purpose: the signature was requested — and charged
|
|
9
|
+
* for — once already, and a host metering signing should not bill an agent again for asking
|
|
10
|
+
* whether the human has got round to it yet.
|
|
11
|
+
*/
|
|
12
|
+
export default {
|
|
13
|
+
check_signing_request: createTool('Check Signing Request', 'Collect the result of a signing request that was still waiting for approval. Waits a while for the user to approve, then reports back. Call this instead of asking for the signature again — repeating the original tool would put a second request in front of the wallet.', z.object({
|
|
14
|
+
requestId: z.string().describe('The requestId returned when the signing tool said it was awaiting approval')
|
|
15
|
+
}), async (args, identity) => {
|
|
16
|
+
try {
|
|
17
|
+
const request = await collectSigningRequest(args.requestId, identity);
|
|
18
|
+
const waitedFor = `${Math.round((Date.now() - request.startedAt) / 1000)}s`;
|
|
19
|
+
if (request.state === 'pending') {
|
|
20
|
+
// Approved already and waiting on the chain is a different thing to report: there
|
|
21
|
+
// is nothing left for the user to do, and nothing to chase them about.
|
|
22
|
+
if (request.stage === 'mining') {
|
|
23
|
+
return formatResponse({
|
|
24
|
+
success: true,
|
|
25
|
+
status: 'mining',
|
|
26
|
+
requestId: request.id,
|
|
27
|
+
what: request.summary,
|
|
28
|
+
transactionHash: request.txHash,
|
|
29
|
+
waitingFor: waitedFor,
|
|
30
|
+
nextStep: 'Approved and broadcast. Call this again with the same requestId to get the mined result.',
|
|
31
|
+
message: 'Signed and sent. Waiting for it to be mined.'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return formatResponse({
|
|
35
|
+
success: true,
|
|
36
|
+
status: 'awaiting_approval',
|
|
37
|
+
requestId: request.id,
|
|
38
|
+
what: request.summary,
|
|
39
|
+
waitingFor: waitedFor,
|
|
40
|
+
nextStep: 'Still not approved. Ask the user to check their wallet and approve or reject it, then call this again with the same requestId.',
|
|
41
|
+
message: 'Nothing has been signed yet.'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (request.state === 'failed') {
|
|
45
|
+
return formatResponse({
|
|
46
|
+
success: false,
|
|
47
|
+
status: 'rejected_or_failed',
|
|
48
|
+
what: request.summary,
|
|
49
|
+
error: request.error,
|
|
50
|
+
message: 'Nothing was signed. The wallet rejected it, or it expired before anybody approved.'
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// A transaction carries how it ended on the chain; a message signature is just the
|
|
54
|
+
// signature, with nothing to mine.
|
|
55
|
+
const settled = request.result;
|
|
56
|
+
const reverted = settled?.receipt?.status === 'reverted';
|
|
57
|
+
return formatResponse({
|
|
58
|
+
success: !reverted,
|
|
59
|
+
status: settled?.receipt?.status ?? 'signed',
|
|
60
|
+
what: request.summary,
|
|
61
|
+
signedWith: request.signer,
|
|
62
|
+
result: request.result,
|
|
63
|
+
message: reverted
|
|
64
|
+
? 'Mined, but it reverted. The gas was spent and nothing else changed.'
|
|
65
|
+
: settled?.receipt?.status === 'broadcast'
|
|
66
|
+
? 'Approved and broadcast, but not mined yet.'
|
|
67
|
+
: 'Approved and done.'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
return failure(error, 'Could not check that signing request');
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=signing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signing.js","sourceRoot":"","sources":["../../../src/tools/read/signing.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WalletConnect rejects with a plain `{ code, message }` rather than an Error, which
|
|
3
|
+
* String() renders as "[object Object]" — the reason a wallet gave for refusing is the
|
|
4
|
+
* whole point of the message, so dig it out.
|
|
5
|
+
*/
|
|
6
|
+
export declare function describeError(error: unknown): string;
|
|
7
|
+
/** A refused or failed signing attempt, reported to the caller and to the log alike. */
|
|
8
|
+
export declare function failure(error: unknown, message: string): import("../../types.js").ToolResult;
|
|
9
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/tools/sign/errors.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CASpD;AAED,wFAAwF;AACxF,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uCAOtD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { log } from '../../log.js';
|
|
2
|
+
import { formatResponse } from '../../utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* WalletConnect rejects with a plain `{ code, message }` rather than an Error, which
|
|
5
|
+
* String() renders as "[object Object]" — the reason a wallet gave for refusing is the
|
|
6
|
+
* whole point of the message, so dig it out.
|
|
7
|
+
*/
|
|
8
|
+
export function describeError(error) {
|
|
9
|
+
if (error instanceof Error)
|
|
10
|
+
return error.message;
|
|
11
|
+
if (error && typeof error === 'object') {
|
|
12
|
+
const { message, code, reason } = error;
|
|
13
|
+
const text = message ?? reason;
|
|
14
|
+
if (text)
|
|
15
|
+
return code === undefined ? text : `${text} (code ${code})`;
|
|
16
|
+
return JSON.stringify(error);
|
|
17
|
+
}
|
|
18
|
+
return String(error);
|
|
19
|
+
}
|
|
20
|
+
/** A refused or failed signing attempt, reported to the caller and to the log alike. */
|
|
21
|
+
export function failure(error, message) {
|
|
22
|
+
log('warning', 'Transaction', `${message} — ${describeError(error)}`);
|
|
23
|
+
return formatResponse({
|
|
24
|
+
success: false,
|
|
25
|
+
error: describeError(error),
|
|
26
|
+
message
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/tools/sign/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,CAAA;IAChD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAA6D,CAAA;QAC/F,MAAM,IAAI,GAAG,OAAO,IAAI,MAAM,CAAA;QAC9B,IAAI,IAAI;YAAE,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,UAAU,IAAI,GAAG,CAAA;QACrE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;AACtB,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,OAAO,CAAC,KAAc,EAAE,OAAe;IACrD,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,MAAM,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACrE,OAAO,cAAc,CAAC;QACpB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC;QAC3B,OAAO;KACR,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -4,99 +4,114 @@ declare const _default: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
description: string;
|
|
6
6
|
schema: z.ZodObject<{
|
|
7
|
-
chain: z.ZodEnum<["
|
|
7
|
+
chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>;
|
|
8
8
|
to: z.ZodString;
|
|
9
9
|
amount: z.ZodString;
|
|
10
10
|
data: z.ZodOptional<z.ZodString>;
|
|
11
11
|
signWith: z.ZodEnum<["phone", "browser"]>;
|
|
12
|
+
account: z.ZodOptional<z.ZodString>;
|
|
12
13
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
chain: "
|
|
14
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
14
15
|
to: string;
|
|
15
16
|
amount: string;
|
|
16
|
-
signWith: "
|
|
17
|
+
signWith: "browser" | "phone";
|
|
17
18
|
data?: string | undefined;
|
|
19
|
+
account?: string | undefined;
|
|
18
20
|
}, {
|
|
19
|
-
chain: "
|
|
21
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
20
22
|
to: string;
|
|
21
23
|
amount: string;
|
|
22
|
-
signWith: "
|
|
24
|
+
signWith: "browser" | "phone";
|
|
23
25
|
data?: string | undefined;
|
|
26
|
+
account?: string | undefined;
|
|
24
27
|
}>;
|
|
25
28
|
handler: (args: {
|
|
26
|
-
chain: "
|
|
29
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
27
30
|
to: string;
|
|
28
31
|
amount: string;
|
|
29
|
-
signWith: "
|
|
32
|
+
signWith: "browser" | "phone";
|
|
30
33
|
data?: string | undefined;
|
|
31
|
-
|
|
34
|
+
account?: string | undefined;
|
|
35
|
+
}, identity: string) => Promise<import("../../types.js").ToolResult>;
|
|
36
|
+
available: (() => boolean) | undefined;
|
|
32
37
|
};
|
|
33
38
|
send_erc20_token: {
|
|
34
39
|
title: string;
|
|
35
40
|
description: string;
|
|
36
41
|
schema: z.ZodObject<{
|
|
37
|
-
chain: z.ZodEnum<["
|
|
42
|
+
chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>;
|
|
38
43
|
tokenAddress: z.ZodString;
|
|
39
44
|
to: z.ZodString;
|
|
40
45
|
amount: z.ZodString;
|
|
41
46
|
decimals: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
42
47
|
signWith: z.ZodEnum<["phone", "browser"]>;
|
|
48
|
+
account: z.ZodOptional<z.ZodString>;
|
|
43
49
|
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
chain: "
|
|
50
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
45
51
|
to: string;
|
|
46
52
|
decimals: number;
|
|
47
53
|
tokenAddress: string;
|
|
48
54
|
amount: string;
|
|
49
|
-
signWith: "
|
|
55
|
+
signWith: "browser" | "phone";
|
|
56
|
+
account?: string | undefined;
|
|
50
57
|
}, {
|
|
51
|
-
chain: "
|
|
58
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
52
59
|
to: string;
|
|
53
60
|
tokenAddress: string;
|
|
54
61
|
amount: string;
|
|
55
|
-
signWith: "
|
|
62
|
+
signWith: "browser" | "phone";
|
|
63
|
+
account?: string | undefined;
|
|
56
64
|
decimals?: number | undefined;
|
|
57
65
|
}>;
|
|
58
66
|
handler: (args: {
|
|
59
|
-
chain: "
|
|
67
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
60
68
|
to: string;
|
|
61
69
|
decimals: number;
|
|
62
70
|
tokenAddress: string;
|
|
63
71
|
amount: string;
|
|
64
|
-
signWith: "
|
|
65
|
-
|
|
72
|
+
signWith: "browser" | "phone";
|
|
73
|
+
account?: string | undefined;
|
|
74
|
+
}, identity: string) => Promise<import("../../types.js").ToolResult>;
|
|
75
|
+
available: (() => boolean) | undefined;
|
|
66
76
|
};
|
|
67
77
|
write_contract: {
|
|
68
78
|
title: string;
|
|
69
79
|
description: string;
|
|
70
80
|
schema: z.ZodObject<{
|
|
71
|
-
chain: z.ZodEnum<["
|
|
81
|
+
chain: z.ZodEnum<["mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>;
|
|
72
82
|
contractAddress: z.ZodString;
|
|
73
83
|
functionAbi: z.ZodString;
|
|
74
84
|
args: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>;
|
|
75
85
|
value: z.ZodOptional<z.ZodString>;
|
|
76
86
|
signWith: z.ZodEnum<["phone", "browser"]>;
|
|
87
|
+
account: z.ZodOptional<z.ZodString>;
|
|
77
88
|
}, "strip", z.ZodTypeAny, {
|
|
78
|
-
chain: "
|
|
89
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
79
90
|
contractAddress: string;
|
|
80
91
|
functionAbi: string;
|
|
81
|
-
signWith: "
|
|
92
|
+
signWith: "browser" | "phone";
|
|
82
93
|
value?: string | undefined;
|
|
94
|
+
account?: string | undefined;
|
|
83
95
|
args?: (string | number | boolean)[] | undefined;
|
|
84
96
|
}, {
|
|
85
|
-
chain: "
|
|
97
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
86
98
|
contractAddress: string;
|
|
87
99
|
functionAbi: string;
|
|
88
|
-
signWith: "
|
|
100
|
+
signWith: "browser" | "phone";
|
|
89
101
|
value?: string | undefined;
|
|
102
|
+
account?: string | undefined;
|
|
90
103
|
args?: (string | number | boolean)[] | undefined;
|
|
91
104
|
}>;
|
|
92
105
|
handler: (args: {
|
|
93
|
-
chain: "
|
|
106
|
+
chain: "mainnet" | "arbitrum" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost";
|
|
94
107
|
contractAddress: string;
|
|
95
108
|
functionAbi: string;
|
|
96
|
-
signWith: "
|
|
109
|
+
signWith: "browser" | "phone";
|
|
97
110
|
value?: string | undefined;
|
|
111
|
+
account?: string | undefined;
|
|
98
112
|
args?: (string | number | boolean)[] | undefined;
|
|
99
|
-
}) => Promise<import("
|
|
113
|
+
}, identity: string) => Promise<import("../../types.js").ToolResult>;
|
|
114
|
+
available: (() => boolean) | undefined;
|
|
100
115
|
};
|
|
101
116
|
sign_message: {
|
|
102
117
|
title: string;
|
|
@@ -104,51 +119,22 @@ declare const _default: {
|
|
|
104
119
|
schema: z.ZodObject<{
|
|
105
120
|
message: z.ZodString;
|
|
106
121
|
signWith: z.ZodEnum<["phone", "browser"]>;
|
|
122
|
+
account: z.ZodOptional<z.ZodString>;
|
|
107
123
|
}, "strip", z.ZodTypeAny, {
|
|
108
124
|
message: string;
|
|
109
|
-
signWith: "
|
|
125
|
+
signWith: "browser" | "phone";
|
|
126
|
+
account?: string | undefined;
|
|
110
127
|
}, {
|
|
111
128
|
message: string;
|
|
112
|
-
signWith: "
|
|
129
|
+
signWith: "browser" | "phone";
|
|
130
|
+
account?: string | undefined;
|
|
113
131
|
}>;
|
|
114
132
|
handler: (args: {
|
|
115
133
|
message: string;
|
|
116
|
-
signWith: "
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
title: string;
|
|
121
|
-
description: string;
|
|
122
|
-
schema: z.ZodObject<{
|
|
123
|
-
chains: z.ZodOptional<z.ZodArray<z.ZodEnum<["arbitrum" | "mainnet" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost", ...("arbitrum" | "mainnet" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[]]>, "many">>;
|
|
124
|
-
wallet: z.ZodOptional<z.ZodString>;
|
|
125
|
-
agent: z.ZodOptional<z.ZodString>;
|
|
126
|
-
}, "strip", z.ZodTypeAny, {
|
|
127
|
-
chains?: ("arbitrum" | "mainnet" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[] | undefined;
|
|
128
|
-
wallet?: string | undefined;
|
|
129
|
-
agent?: string | undefined;
|
|
130
|
-
}, {
|
|
131
|
-
chains?: ("arbitrum" | "mainnet" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[] | undefined;
|
|
132
|
-
wallet?: string | undefined;
|
|
133
|
-
agent?: string | undefined;
|
|
134
|
-
}>;
|
|
135
|
-
handler: (args: {
|
|
136
|
-
chains?: ("arbitrum" | "mainnet" | "avalanche" | "base" | "bnb" | "gnosis" | "sonic" | "optimism" | "polygon" | "zksync" | "linea" | "unichain" | "localhost")[] | undefined;
|
|
137
|
-
wallet?: string | undefined;
|
|
138
|
-
agent?: string | undefined;
|
|
139
|
-
}) => Promise<import("../types.js").ToolResult>;
|
|
140
|
-
};
|
|
141
|
-
disconnect_phone_wallet: {
|
|
142
|
-
title: string;
|
|
143
|
-
description: string;
|
|
144
|
-
schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
145
|
-
handler: (args: {}) => Promise<import("../types.js").ToolResult>;
|
|
146
|
-
};
|
|
147
|
-
wallet_status: {
|
|
148
|
-
title: string;
|
|
149
|
-
description: string;
|
|
150
|
-
schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
151
|
-
handler: (args: {}) => Promise<import("../types.js").ToolResult>;
|
|
134
|
+
signWith: "browser" | "phone";
|
|
135
|
+
account?: string | undefined;
|
|
136
|
+
}, identity: string) => Promise<import("../../types.js").ToolResult>;
|
|
137
|
+
available: (() => boolean) | undefined;
|
|
152
138
|
};
|
|
153
139
|
};
|
|
154
140
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/tools/sign/transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyNvB,wBAgNC"}
|