@trustwallet/cli 0.9.0 → 0.11.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/commands/alert.d.ts.map +1 -1
- package/dist/commands/automate.d.ts.map +1 -1
- package/dist/commands/erc20.d.ts.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/onramp.d.ts.map +1 -1
- package/dist/commands/query.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 +8 -0
- package/dist/commands/transfer.d.ts.map +1 -1
- package/dist/commands/wallet.d.ts.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/x402.d.ts.map +1 -1
- package/dist/index.js +4007 -2696
- package/dist/output.d.ts +25 -0
- package/dist/output.d.ts.map +1 -1
- package/package.json +15 -13
- package/scripts/polyfill-banner.js +5 -0
package/dist/output.d.ts
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
|
+
import { CommandError } from '@twak/core';
|
|
1
2
|
export declare function output(data: unknown, json: boolean): void;
|
|
2
3
|
export declare function success(message: string): void;
|
|
3
4
|
export declare function error(message: string): void;
|
|
4
5
|
export declare function warn(message: string): void;
|
|
5
6
|
export declare function info(message: string): void;
|
|
6
7
|
export declare function dim(message: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* Classify an error into a `CommandError` — pure, no side effects.
|
|
10
|
+
*
|
|
11
|
+
* Flow:
|
|
12
|
+
* 1. If already a CommandError → return unchanged (preserves subclass identity).
|
|
13
|
+
* 2. Else try the classifier chain: TwakError → fs → wallet-load.
|
|
14
|
+
* 3. Else → CommandError('UNKNOWN_ERROR', rawMessage).
|
|
15
|
+
*
|
|
16
|
+
* Use when you need the typed code but want to control how it's surfaced
|
|
17
|
+
* (e.g. the watch daemon logs classified tick errors without setting exitCode).
|
|
18
|
+
*/
|
|
19
|
+
export declare function classifyError(err: unknown): CommandError;
|
|
20
|
+
/**
|
|
21
|
+
* Standard error handler for command action blocks.
|
|
22
|
+
*
|
|
23
|
+
* Output:
|
|
24
|
+
* - json=true: emit a single JSON object to stdout: { error, errorCode }.
|
|
25
|
+
* - json=false: print human message to stderr. Unknown errors get prefixed with
|
|
26
|
+
* `${fallbackPrefix}: ...` so the user knows the command failed even if
|
|
27
|
+
* the raw message is opaque.
|
|
28
|
+
*
|
|
29
|
+
* Always sets process.exitCode = 1.
|
|
30
|
+
*/
|
|
31
|
+
export declare function handleCommandError(err: unknown, json: boolean, fallbackPrefix: string): void;
|
|
7
32
|
export declare function safeExit(): void;
|
|
8
33
|
//# sourceMappingURL=output.d.ts.map
|
package/dist/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAIb,MAAM,YAAY,CAAC;AAEpB,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAMzD;AAKD,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAKxD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAS5F;AAED,wBAAgB,QAAQ,IAAI,IAAI,CAa/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustwallet/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.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",
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"node-fetch": "2.7.0",
|
|
17
|
+
"qrcode": "1.5.4",
|
|
17
18
|
"qrcode-terminal": "0.12.0",
|
|
18
|
-
"@napi-rs/keyring": "1.2.0"
|
|
19
|
+
"@napi-rs/keyring": "1.2.0",
|
|
20
|
+
"fake-indexeddb": "6.2.5"
|
|
19
21
|
},
|
|
20
22
|
"optionalDependencies": {
|
|
21
23
|
"@amplitude/analytics-node": "1.5.39"
|
|
@@ -28,17 +30,17 @@
|
|
|
28
30
|
"tsup": "8.5.1",
|
|
29
31
|
"typescript": "5.7.3",
|
|
30
32
|
"vitest": "4.1.2",
|
|
31
|
-
"@twak/actions": "0.
|
|
32
|
-
"@twak/blockchain": "0.
|
|
33
|
-
"@twak/core": "0.
|
|
34
|
-
"@twak/mcp": "0.
|
|
35
|
-
"@twak/security": "0.
|
|
36
|
-
"@twak/storage": "0.
|
|
37
|
-
"@twak/swap": "0.
|
|
38
|
-
"@twak/transactions": "0.
|
|
39
|
-
"@twak/wallet": "0.
|
|
40
|
-
"@twak/wallet-core": "0.
|
|
41
|
-
"@twak/walletconnect": "0.
|
|
33
|
+
"@twak/actions": "0.11.0",
|
|
34
|
+
"@twak/blockchain": "0.11.0",
|
|
35
|
+
"@twak/core": "0.11.0",
|
|
36
|
+
"@twak/mcp": "0.11.0",
|
|
37
|
+
"@twak/security": "0.11.0",
|
|
38
|
+
"@twak/storage": "0.11.0",
|
|
39
|
+
"@twak/swap": "0.11.0",
|
|
40
|
+
"@twak/transactions": "0.11.0",
|
|
41
|
+
"@twak/wallet": "0.11.0",
|
|
42
|
+
"@twak/wallet-core": "0.11.0",
|
|
43
|
+
"@twak/walletconnect": "0.11.0"
|
|
42
44
|
},
|
|
43
45
|
"publishConfig": {
|
|
44
46
|
"access": "public"
|
|
@@ -63,4 +63,9 @@
|
|
|
63
63
|
if (typeof globalThis.window === 'undefined') globalThis.window = globalThis;
|
|
64
64
|
if (typeof globalThis.self === 'undefined') globalThis.self = globalThis;
|
|
65
65
|
if (typeof globalThis.navigator === 'undefined') globalThis.navigator = { onLine: true, userAgent: 'Mozilla/5.0 (twak)' };
|
|
66
|
+
|
|
67
|
+
// WalletConnect v2 SDK reaches for indexedDB at module load; polyfill for Node.
|
|
68
|
+
if (typeof globalThis.indexedDB === 'undefined') {
|
|
69
|
+
try { require('fake-indexeddb/auto'); } catch (_) { /* not in use; skip */ }
|
|
70
|
+
}
|
|
66
71
|
})();
|