@trustwallet/cli 0.6.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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/dist/analytics.d.ts +6 -0
  3. package/dist/analytics.d.ts.map +1 -0
  4. package/dist/branding.d.ts +3 -0
  5. package/dist/branding.d.ts.map +1 -0
  6. package/dist/commands/alert.d.ts +3 -0
  7. package/dist/commands/alert.d.ts.map +1 -0
  8. package/dist/commands/auth.d.ts +3 -0
  9. package/dist/commands/auth.d.ts.map +1 -0
  10. package/dist/commands/automate.d.ts +3 -0
  11. package/dist/commands/automate.d.ts.map +1 -0
  12. package/dist/commands/erc20.d.ts +3 -0
  13. package/dist/commands/erc20.d.ts.map +1 -0
  14. package/dist/commands/init.d.ts +3 -0
  15. package/dist/commands/init.d.ts.map +1 -0
  16. package/dist/commands/onramp.d.ts +3 -0
  17. package/dist/commands/onramp.d.ts.map +1 -0
  18. package/dist/commands/query.d.ts +3 -0
  19. package/dist/commands/query.d.ts.map +1 -0
  20. package/dist/commands/serve.d.ts +3 -0
  21. package/dist/commands/serve.d.ts.map +1 -0
  22. package/dist/commands/skill.d.ts +3 -0
  23. package/dist/commands/skill.d.ts.map +1 -0
  24. package/dist/commands/swap.d.ts +3 -0
  25. package/dist/commands/swap.d.ts.map +1 -0
  26. package/dist/commands/telemetry.d.ts +3 -0
  27. package/dist/commands/telemetry.d.ts.map +1 -0
  28. package/dist/commands/transfer.d.ts +3 -0
  29. package/dist/commands/transfer.d.ts.map +1 -0
  30. package/dist/commands/wallet.d.ts +3 -0
  31. package/dist/commands/wallet.d.ts.map +1 -0
  32. package/dist/commands/watch.d.ts +3 -0
  33. package/dist/commands/watch.d.ts.map +1 -0
  34. package/dist/commands/x402.d.ts +3 -0
  35. package/dist/commands/x402.d.ts.map +1 -0
  36. package/dist/config-loader.d.ts +16 -0
  37. package/dist/config-loader.d.ts.map +1 -0
  38. package/dist/index.d.ts +3 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +28257 -0
  41. package/dist/output.d.ts +7 -0
  42. package/dist/output.d.ts.map +1 -0
  43. package/package.json +57 -0
  44. package/scripts/polyfill-banner.js +54 -0
  45. package/scripts/postinstall.js +18 -0
  46. package/trust-sdk/720.js +2 -0
  47. package/trust-sdk/index.js +3 -0
  48. package/trust-sdk/index.mjs +31 -0
  49. package/trust-sdk/package.json +17 -0
  50. package/trust-sdk/skiko.js +87 -0
  51. package/trust-sdk/skiko.mjs +1070 -0
  52. package/trust-sdk/skiko.wasm +0 -0
  53. package/trust-sdk/trust-sdk.d.ts +6594 -0
  54. package/trust-sdk/trust-sdk.js +3 -0
  55. package/trust-sdk/wallet-core.wasm +0 -0
@@ -0,0 +1,7 @@
1
+ export declare function output(data: unknown, json: boolean): void;
2
+ export declare function success(message: string): void;
3
+ export declare function error(message: string): void;
4
+ export declare function warn(message: string): void;
5
+ export declare function info(message: string): void;
6
+ export declare function dim(message: string): void;
7
+ //# sourceMappingURL=output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAMzD;AAED,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"}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@trustwallet/cli",
3
+ "version": "0.6.0",
4
+ "description": "TWAK CLI — command-line interface for Trust Wallet Agent Kit",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "twak": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "trust-sdk",
13
+ "scripts"
14
+ ],
15
+ "dependencies": {
16
+ "boxen": "5.1.2",
17
+ "chalk": "4.1.2",
18
+ "commander": "12.1.0",
19
+ "node-fetch": "2.7.0",
20
+ "ora": "5.4.1",
21
+ "qrcode-terminal": "0.12.0"
22
+ },
23
+ "optionalDependencies": {
24
+ "@amplitude/analytics-node": "1.5.39"
25
+ },
26
+ "devDependencies": {
27
+ "tsup": "8.5.1",
28
+ "typescript": "5.7.3",
29
+ "@twak/actions": "0.6.0",
30
+ "@twak/blockchain": "0.6.0",
31
+ "@twak/core": "0.6.0",
32
+ "@twak/mcp": "0.6.0",
33
+ "@twak/security": "0.6.0",
34
+ "@twak/storage": "0.6.0",
35
+ "@twak/swap": "0.6.0",
36
+ "@twak/transactions": "0.6.0",
37
+ "@twak/wallet": "0.6.0",
38
+ "@twak/wallet-core": "0.6.0",
39
+ "@twak/walletconnect": "0.6.0"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/trustwallet/twak.git",
48
+ "directory": "packages/cli"
49
+ },
50
+ "scripts": {
51
+ "prebuild": "rm -rf trust-sdk && cp -r ../../vendor/trust-sdk trust-sdk",
52
+ "build": "tsup && tsc --emitDeclarationOnly --outDir dist",
53
+ "typecheck": "tsc --noEmit",
54
+ "lint": "eslint src/",
55
+ "clean": "rm -rf dist"
56
+ }
57
+ }
@@ -0,0 +1,54 @@
1
+ // trust-sdk polyfill banner — injected at bundle top before any module init.
2
+ // 1. Stubs browser globals (document.currentScript) for trust-sdk's webpack publicPath
3
+ // 2. Hooks require() to resolve trust-sdk from the bundled trust-sdk/ directory
4
+ ;(function() {
5
+ var path = require('node:path');
6
+ var fs = require('node:fs');
7
+ var Module = require('node:module');
8
+
9
+ // --- Locate the bundled trust-sdk directory ---
10
+ var sdkDir = '';
11
+ try {
12
+ sdkDir = path.dirname(require.resolve('@trustwallet-trust-sdk/trust-sdk'));
13
+ } catch (_) {
14
+ var dir = __dirname;
15
+ for (var i = 0; i < 10; i++) {
16
+ var candidate = path.join(dir, 'trust-sdk', 'trust-sdk.js');
17
+ if (fs.existsSync(candidate)) { sdkDir = path.dirname(candidate); break; }
18
+ var parent = path.dirname(dir);
19
+ if (parent === dir) break;
20
+ dir = parent;
21
+ }
22
+ }
23
+
24
+ // --- Hook require() to redirect trust-sdk to bundled copy ---
25
+ if (sdkDir) {
26
+ var originalResolveFilename = Module._resolveFilename;
27
+ Module._resolveFilename = function(request, parentModule, isMain, options) {
28
+ if (request === '@trustwallet-trust-sdk/trust-sdk') {
29
+ return path.join(sdkDir, 'index.js');
30
+ }
31
+ return originalResolveFilename.call(this, request, parentModule, isMain, options);
32
+ };
33
+ }
34
+
35
+ // --- Stub browser globals ---
36
+ if (typeof globalThis.document === 'undefined') {
37
+ var scriptStub = { src: sdkDir ? 'file://' + sdkDir + '/trust-sdk.js' : '' };
38
+ globalThis.document = {
39
+ createElement: function() { return { setAttribute: function(){}, getAttribute: function(){ return null; }, style: {}, addEventListener: function(){}, appendChild: function(){}, removeChild: function(){}, innerText: '', textContent: '', src: '' }; },
40
+ body: { appendChild: function(){}, removeChild: function(){} },
41
+ createTextNode: function() { return {}; },
42
+ execCommand: function() { return false; },
43
+ getElementById: function() { return null; },
44
+ getElementsByTagName: function() { return [scriptStub]; },
45
+ querySelector: function() { return null; },
46
+ querySelectorAll: function() { return []; },
47
+ currentScript: scriptStub,
48
+ head: { appendChild: function(){} }
49
+ };
50
+ }
51
+ if (typeof globalThis.window === 'undefined') globalThis.window = globalThis;
52
+ if (typeof globalThis.self === 'undefined') globalThis.self = globalThis;
53
+ if (typeof globalThis.navigator === 'undefined') globalThis.navigator = { onLine: true, userAgent: 'Mozilla/5.0 (twak)' };
54
+ })();
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ // Link the bundled trust-sdk into node_modules so require() finds it.
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const sdkSource = path.resolve(__dirname, '..', 'trust-sdk');
7
+ const nmDir = path.resolve(__dirname, '..', 'node_modules', '@trustwallet-trust-sdk');
8
+ const sdkLink = path.join(nmDir, 'trust-sdk');
9
+
10
+ if (!fs.existsSync(sdkSource)) process.exit(0); // dev environment, skip
11
+
12
+ if (fs.existsSync(sdkLink)) process.exit(0); // already linked
13
+
14
+ fs.mkdirSync(nmDir, { recursive: true });
15
+
16
+ // Use junction on Windows, symlink on Unix
17
+ const type = process.platform === 'win32' ? 'junction' : 'dir';
18
+ fs.symlinkSync(sdkSource, sdkLink, type);
@@ -0,0 +1,2 @@
1
+ "use strict";(globalThis.webpackChunktrust_sdk=globalThis.webpackChunktrust_sdk||[]).push([[720],{720:s=>{s.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}}]);
2
+ //# sourceMappingURL=720.js.map
@@ -0,0 +1,3 @@
1
+ const sdk = require('./trust-sdk.js');
2
+ const inner = sdk['trust-sdk'];
3
+ module.exports = inner;
@@ -0,0 +1,31 @@
1
+ import sdk from './trust-sdk.js';
2
+ const inner = sdk['trust-sdk'] || sdk;
3
+ export const {
4
+ WalletCoreKotlin,
5
+ TrustSDKContext,
6
+ TrustSDKConfig,
7
+ ClientPlatformApp,
8
+ ClientPlatform,
9
+ AuthCredentials,
10
+ LogMode,
11
+ LogSeverity,
12
+ BlockchainService,
13
+ AccountManagementService,
14
+ DefinedChain,
15
+ Asset,
16
+ TransactionTransfer,
17
+ TransactionSmartContract,
18
+ Node,
19
+ TokenType,
20
+ MessageType,
21
+ Account,
22
+ BalanceType,
23
+ BalanceResult,
24
+ SigningResult,
25
+ SimpleFee,
26
+ GasFee,
27
+ NoneFee,
28
+ Derivation,
29
+ Allowance,
30
+ } = inner;
31
+ export default inner;
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@trustwallet-trust-sdk/trust-sdk",
3
+ "version": "0.0.0-alpha",
4
+ "main": "index.js",
5
+ "module": "index.mjs",
6
+ "types": "trust-sdk.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./trust-sdk.d.ts",
10
+ "import": "./index.mjs",
11
+ "require": "./index.js"
12
+ }
13
+ },
14
+ "dependencies": {
15
+ "node-fetch": "2.7.0"
16
+ }
17
+ }