@trustwallet/cli 0.22.0 → 0.23.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/dist/agent-wallet-loader.d.ts +31 -0
- package/dist/agent-wallet-loader.d.ts.map +1 -0
- package/dist/commands/erc8004.d.ts.map +1 -1
- package/dist/commands/onramp.d.ts.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/swap.d.ts.map +1 -1
- package/dist/commands/transfer.d.ts.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/config-loader.d.ts +6 -5
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/credentials-error.d.ts +5 -0
- package/dist/credentials-error.d.ts.map +1 -0
- package/dist/index.js +563 -431
- package/dist/serve-bootstrap.d.ts +32 -0
- package/dist/serve-bootstrap.d.ts.map +1 -0
- package/dist/stdio-console.d.ts +13 -0
- package/dist/stdio-console.d.ts.map +1 -0
- package/dist/walletconnect-config.d.ts +2 -2
- package/dist/walletconnect-config.d.ts.map +1 -1
- package/package.json +14 -14
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TwakCredentials } from '@twak/core';
|
|
2
|
+
export interface ServeBootstrapDeps {
|
|
3
|
+
/** Null when no credentials are configured yet. */
|
|
4
|
+
loadCredentials: () => Promise<TwakCredentials | null>;
|
|
5
|
+
initTrustSDK: (creds: TwakCredentials) => Promise<void>;
|
|
6
|
+
/** Runs once the Trust SDK is ready; its failure fails the attempt. */
|
|
7
|
+
onReady: () => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Completes the credential-dependent part of `twak serve` startup the first
|
|
11
|
+
* time API credentials are available, so the MCP server can start (and list
|
|
12
|
+
* its tools) before the user has set them up.
|
|
13
|
+
*
|
|
14
|
+
* `ensureReady` loads the credentials, initializes the Trust SDK, then runs
|
|
15
|
+
* `onReady` (the server's startup defaults, e.g. binding the agent wallet). It
|
|
16
|
+
* succeeds once and is a no-op afterwards; until then each call retries, so
|
|
17
|
+
* credentials saved by `twak init` while the server runs are picked up by the
|
|
18
|
+
* next tool call. Concurrent calls share one attempt. Credentials changed
|
|
19
|
+
* after success are not picked up: the Trust SDK is initialized once per
|
|
20
|
+
* process.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ServeBootstrap {
|
|
23
|
+
private readonly deps;
|
|
24
|
+
private ready?;
|
|
25
|
+
private attempt?;
|
|
26
|
+
constructor(deps: ServeBootstrapDeps);
|
|
27
|
+
private run;
|
|
28
|
+
ensureReady(): Promise<void>;
|
|
29
|
+
/** Credentials once ready; throws CREDENTIALS_MISSING before. */
|
|
30
|
+
credentials(): TwakCredentials;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=serve-bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-bootstrap.d.ts","sourceRoot":"","sources":["../src/serve-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,eAAe,EAAE,MAAM,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IACvD,YAAY,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,uEAAuE;IACvE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAc;IAIb,OAAO,CAAC,QAAQ,CAAC,IAAI;IAHjC,OAAO,CAAC,KAAK,CAAC,CAAmC;IACjD,OAAO,CAAC,OAAO,CAAC,CAAgB;gBAEH,IAAI,EAAE,kBAAkB;YAEvC,GAAG;IAQX,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAUlC,iEAAiE;IACjE,WAAW,IAAI,eAAe;CAI/B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Point every `console` method at stderr, for processes whose stdout carries a
|
|
3
|
+
* protocol (`twak serve`'s MCP stdio mode, where stdout is the JSON-RPC
|
|
4
|
+
* stream). Libraries log with `console.log` (WalletConnect sends its `info`
|
|
5
|
+
* and `fatal` logs there), and any such line would corrupt the stream.
|
|
6
|
+
*
|
|
7
|
+
* The methods are replaced on the existing object rather than swapping the
|
|
8
|
+
* global, so code that already holds a reference to `console` is covered too.
|
|
9
|
+
* Writes through `process.stdout.write` (the MCP stdio transport) are not
|
|
10
|
+
* affected.
|
|
11
|
+
*/
|
|
12
|
+
export declare function routeConsoleToStderr(target?: Console, stderr?: NodeJS.WritableStream): void;
|
|
13
|
+
//# sourceMappingURL=stdio-console.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio-console.d.ts","sourceRoot":"","sources":["../src/stdio-console.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,GAAE,OAAiB,EACzB,MAAM,GAAE,MAAM,CAAC,cAA+B,GAC7C,IAAI,CAEN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WalletConnectProvider } from '@twak/wallet';
|
|
1
|
+
import { WalletConnectProvider, type ChainClient } from '@twak/wallet';
|
|
2
2
|
/** Upper bound for resuming a stored WalletConnect session (relay round-trip). */
|
|
3
3
|
export declare const RESTORE_TIMEOUT_MS = 10000;
|
|
4
4
|
/** The single WalletConnect session file shared by every twak command. */
|
|
@@ -13,7 +13,7 @@ export declare const DEFAULT_WC_PROJECT_ID = "a863b78b54c4222603c8db4d6d880172";
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function resolveWcProjectId(flag?: string): Promise<string>;
|
|
15
15
|
/** A provider bound to the shared session file. */
|
|
16
|
-
export declare function createWalletConnectProvider(projectId: string): WalletConnectProvider;
|
|
16
|
+
export declare function createWalletConnectProvider(projectId: string, chainClient: ChainClient): WalletConnectProvider;
|
|
17
17
|
/** Rejects with NETWORK_ERROR when `promise` does not settle within `ms`. */
|
|
18
18
|
export declare function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T>;
|
|
19
19
|
//# sourceMappingURL=walletconnect-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletconnect-config.d.ts","sourceRoot":"","sources":["../src/walletconnect-config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"walletconnect-config.d.ts","sourceRoot":"","sources":["../src/walletconnect-config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGvE,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAEzC,0EAA0E;AAC1E,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;iFACiF;AACjF,eAAO,MAAM,qBAAqB,qCAAqC,CAAC;AAExE;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASvE;AAED,mDAAmD;AACnD,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,GACvB,qBAAqB,CAOvB;AAED,6EAA6E;AAC7E,wBAAsB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAahF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustwallet/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "TWAK CLI — command-line interface for Trust Wallet Agent Kit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"tsup": "8.5.1",
|
|
34
34
|
"typescript": "5.7.3",
|
|
35
35
|
"vitest": "4.1.2",
|
|
36
|
-
"@twak/actions": "0.
|
|
37
|
-
"@twak/contracts": "0.
|
|
38
|
-
"@twak/
|
|
39
|
-
"@twak/
|
|
40
|
-
"@twak/
|
|
41
|
-
"@twak/
|
|
42
|
-
"@twak/storage": "0.
|
|
43
|
-
"@twak/
|
|
44
|
-
"@twak/
|
|
45
|
-
"@twak/
|
|
46
|
-
"@twak/
|
|
47
|
-
"@twak/
|
|
48
|
-
"@twak/
|
|
36
|
+
"@twak/actions": "0.23.0",
|
|
37
|
+
"@twak/contracts": "0.23.0",
|
|
38
|
+
"@twak/core": "0.23.0",
|
|
39
|
+
"@twak/mcp": "0.23.0",
|
|
40
|
+
"@twak/operations": "0.23.0",
|
|
41
|
+
"@twak/security": "0.23.0",
|
|
42
|
+
"@twak/storage": "0.23.0",
|
|
43
|
+
"@twak/swap": "0.23.0",
|
|
44
|
+
"@twak/transactions": "0.23.0",
|
|
45
|
+
"@twak/wallet-core": "0.23.0",
|
|
46
|
+
"@twak/walletconnect": "0.23.0",
|
|
47
|
+
"@twak/x402": "0.23.0",
|
|
48
|
+
"@twak/wallet": "0.23.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|