wative 1.1.15 → 1.1.17

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 (65) hide show
  1. package/lib/account.d.ts +14 -0
  2. package/lib/account.d.ts.map +1 -0
  3. package/lib/assets.d.ts +11 -0
  4. package/lib/assets.d.ts.map +1 -0
  5. package/lib/chain.d.ts +6 -0
  6. package/lib/chain.d.ts.map +1 -0
  7. package/lib/config.d.ts +23 -0
  8. package/lib/config.d.ts.map +1 -0
  9. package/lib/daemon-watcher.js +181 -0
  10. package/lib/home_page.d.ts +4 -0
  11. package/lib/home_page.d.ts.map +1 -0
  12. package/lib/index.d.ts +2 -0
  13. package/lib/index.d.ts.map +1 -0
  14. package/lib/index.esm.js +1 -1
  15. package/lib/index.umd.js +1 -1
  16. package/lib/network.d.ts +28 -0
  17. package/lib/network.d.ts.map +1 -0
  18. package/lib/ssh/client.d.ts +120 -0
  19. package/lib/ssh/client.d.ts.map +1 -0
  20. package/lib/ssh/client_example.d.ts +19 -0
  21. package/lib/ssh/client_example.d.ts.map +1 -0
  22. package/lib/ssh/client_test.d.ts +27 -0
  23. package/lib/ssh/client_test.d.ts.map +1 -0
  24. package/lib/ssh/config_manager.d.ts +55 -0
  25. package/lib/ssh/config_manager.d.ts.map +1 -0
  26. package/lib/ssh/config_template.d.ts +52 -0
  27. package/lib/ssh/config_template.d.ts.map +1 -0
  28. package/lib/ssh/index.d.ts +7 -0
  29. package/lib/ssh/index.d.ts.map +1 -0
  30. package/lib/ssh/remote_server_example.d.ts +16 -0
  31. package/lib/ssh/remote_server_example.d.ts.map +1 -0
  32. package/lib/ssh/service_manager.d.ts +119 -0
  33. package/lib/ssh/service_manager.d.ts.map +1 -0
  34. package/lib/ssh/types.d.ts +45 -0
  35. package/lib/ssh/types.d.ts.map +1 -0
  36. package/lib/ssh/utils.d.ts +11 -0
  37. package/lib/ssh/utils.d.ts.map +1 -0
  38. package/lib/ssh/wative_server.d.ts +26 -0
  39. package/lib/ssh/wative_server.d.ts.map +1 -0
  40. package/lib/tools.d.ts +6 -0
  41. package/lib/tools.d.ts.map +1 -0
  42. package/lib/tx_gas_utils.d.ts +18 -0
  43. package/lib/tx_gas_utils.d.ts.map +1 -0
  44. package/lib/utils.d.ts +49 -0
  45. package/lib/utils.d.ts.map +1 -0
  46. package/lib/wative.d.ts +2 -0
  47. package/lib/wative.d.ts.map +1 -0
  48. package/lib/wative.esm.js +1 -1
  49. package/lib/wative.umd.js +1 -1
  50. package/lib/web3.d.ts +59 -0
  51. package/lib/web3.d.ts.map +1 -0
  52. package/package.json +9 -5
  53. package/src/assets.ts +1 -10
  54. package/src/daemon-watcher.js +181 -0
  55. package/src/ssh/client.rs +221 -0
  56. package/src/ssh/client.ts +389 -0
  57. package/src/ssh/config_manager.ts +317 -0
  58. package/src/ssh/index.ts +49 -36
  59. package/src/ssh/service_manager.ts +684 -0
  60. package/src/ssh/types.ts +35 -1
  61. package/src/ssh/wative_server.ts +1 -2
  62. package/src/wative.ts +560 -122
  63. package/bin/wative-ssh.sh +0 -44
  64. package/lib/wative-ssh.esm.js +0 -1
  65. package/lib/wative-ssh.umd.js +0 -1
@@ -0,0 +1,120 @@
1
+ export interface SSHAuthConfig {
2
+ username: string;
3
+ privateKeyPath: string;
4
+ publicKeyPath: string;
5
+ passphrase?: string;
6
+ }
7
+ export interface SSHConfig {
8
+ host: string;
9
+ port: number;
10
+ clientAuth: SSHAuthConfig;
11
+ useRemoteServer?: boolean;
12
+ remoteServer?: {
13
+ host: string;
14
+ port?: number;
15
+ auth: SSHAuthConfig;
16
+ };
17
+ }
18
+ export interface WativeRequest {
19
+ method: string;
20
+ keystoreId?: string;
21
+ chainId?: string;
22
+ params?: any;
23
+ }
24
+ export interface WativeResponse {
25
+ status: boolean;
26
+ data?: any;
27
+ msg?: string;
28
+ }
29
+ export declare class WativeSSHClient {
30
+ private config;
31
+ constructor(config: SSHConfig);
32
+ /**
33
+ * Execute a command on the SSH server
34
+ * @param command The command to execute
35
+ * @returns Promise<string> The command output
36
+ */
37
+ private executeCommand;
38
+ /**
39
+ * Execute a command through remote server
40
+ * @param command The command to execute
41
+ * @returns Promise<string> The command output
42
+ */
43
+ private executeCommandThroughRemoteServer;
44
+ /**
45
+ * Send a request to the Wative server
46
+ * @param request The request object
47
+ * @returns Promise<WativeResponse> The server response
48
+ */
49
+ sendRequest(request: WativeRequest): Promise<WativeResponse>;
50
+ /**
51
+ * Get root account for a keystore and chain
52
+ * @param keystoreId The keystore ID
53
+ * @param chainId The chain ID
54
+ * @returns Promise<any> The root account data
55
+ */
56
+ getRootAccount(keystoreId: string, chainId: string): Promise<any>;
57
+ /**
58
+ * Get sub accounts for a keystore and chain
59
+ * @param keystoreId The keystore ID
60
+ * @param chainId The chain ID
61
+ * @param startIndex Optional start index
62
+ * @param endIndex Optional end index
63
+ * @returns Promise<any> The sub account data
64
+ */
65
+ getSubAccount(keystoreId: string, chainId: string, startIndex?: number, endIndex?: number): Promise<any>;
66
+ /**
67
+ * Sign a transaction
68
+ * @param txParams Transaction parameters
69
+ * @param rpcUrl RPC URL
70
+ * @returns Promise<any> The signed transaction
71
+ */
72
+ signTransaction(txParams: any, rpcUrl: string): Promise<any>;
73
+ /**
74
+ * Sign and send a transaction
75
+ * @param txParams Transaction parameters
76
+ * @param rpcUrl RPC URL
77
+ * @returns Promise<any> The transaction hash
78
+ */
79
+ signAndSendTransaction(txParams: any, rpcUrl: string): Promise<any>;
80
+ /**
81
+ * Sign a Solana transaction
82
+ * @param txParams Transaction parameters
83
+ * @param rpcUrl RPC URL
84
+ * @param priorityFee Priority fee
85
+ * @returns Promise<any> The signed transaction
86
+ */
87
+ signSolanaTransaction(txParams: any, rpcUrl: string, priorityFee?: any): Promise<any>;
88
+ /**
89
+ * Send a signed Solana transaction
90
+ * @param txParams Transaction parameters with signature
91
+ * @param rpcUrl RPC URL
92
+ * @returns Promise<any> The transaction result
93
+ */
94
+ sendSignedSolanaTransaction(txParams: any, rpcUrl: string): Promise<any>;
95
+ /**
96
+ * Sign a message
97
+ * @param account The account to sign with
98
+ * @param message The message to sign
99
+ * @returns Promise<any> The signature
100
+ */
101
+ signMessage(account: string, message: string): Promise<any>;
102
+ /**
103
+ * Sign typed data (EIP-712)
104
+ * @param account The account to sign with
105
+ * @param domain The domain
106
+ * @param typesName The types name
107
+ * @param types The types
108
+ * @param message The message
109
+ * @returns Promise<any> The signature
110
+ */
111
+ signTypedData(account: string, domain: string, typesName: string, types: string, message: string): Promise<any>;
112
+ }
113
+ /**
114
+ * Create a new Wative SSH client instance
115
+ * @param config SSH configuration
116
+ * @returns WativeSSHClient instance
117
+ */
118
+ export declare function createWativeSSHClient(config: SSHConfig): WativeSSHClient;
119
+ export default WativeSSHClient;
120
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/ssh/client.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IAExB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IAIb,UAAU,EAAE,aAAa,CAAC;IAG1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,aAAa,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,O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MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CAetH;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CAExE;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { SSHConfig } from './client';
2
+ /**
3
+ * Example usage of the Wative SSH Client
4
+ */
5
+ declare function example(): Promise<void>;
6
+ /**
7
+ * Error handling example
8
+ */
9
+ declare function errorHandlingExample(): Promise<void>;
10
+ /**
11
+ * Utility function to test connection
12
+ */
13
+ export declare function testConnection(config: SSHConfig): Promise<boolean>;
14
+ /**
15
+ * Batch operations example
16
+ */
17
+ declare function batchOperationsExample(): Promise<void>;
18
+ export { example, errorHandlingExample, batchOperationsExample };
19
+ //# sourceMappingURL=client_example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client_example.d.ts","sourceRoot":"","sources":["../../src/ssh/client_example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,SAAS,EAAyB,MAAM,UAAU,CAAC;AAI7E;;GAEG;AACH,iBAAe,OAAO,kBA6JrB;AAED;;GAEG;AACH,iBAAe,oBAAoB,kBA+BlC;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAWxE;AAED;;GAEG;AACH,iBAAe,sBAAsB,kBAiCpC;AAwBD,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Simple test for the Wative SSH Client
3
+ * This test assumes you have a running Wative server and proper SSH keys set up
4
+ */
5
+ declare function runBasicTest(): Promise<boolean>;
6
+ /**
7
+ * Test different request methods
8
+ */
9
+ declare function runMethodTests(): Promise<void>;
10
+ /**
11
+ * Test connection with invalid configuration
12
+ */
13
+ declare function runNegativeTests(): Promise<void>;
14
+ /**
15
+ * Test remote server connection mode
16
+ */
17
+ declare function runRemoteServerTest(): Promise<void>;
18
+ /**
19
+ * Performance test
20
+ */
21
+ declare function runPerformanceTest(): Promise<void>;
22
+ /**
23
+ * Main test runner
24
+ */
25
+ declare function runAllTests(): Promise<void>;
26
+ export { runBasicTest, runMethodTests, runNegativeTests, runPerformanceTest, runRemoteServerTest, runAllTests };
27
+ //# sourceMappingURL=client_test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client_test.d.ts","sourceRoot":"","sources":["../../src/ssh/client_test.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,iBAAe,YAAY,qBAwF1B;AAED;;GAEG;AACH,iBAAe,cAAc,kBAqD5B;AAED;;GAEG;AACH,iBAAe,gBAAgB,kBA4C9B;AAED;;GAEG;AACH,iBAAe,mBAAmB,kBAqDjC;AAED;;GAEG;AACH,iBAAe,kBAAkB,kBAyChC;AAED;;GAEG;AACH,iBAAe,WAAW,kBAiEzB;AAUD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACZ,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { SSHServiceConfig } from './types';
2
+ export declare class SSHConfigManager {
3
+ private configDir;
4
+ private keystorePath;
5
+ constructor(configDir?: string, keystorePath?: string);
6
+ /**
7
+ * 获取 keystore 路径
8
+ */
9
+ getKeystorePath(): string;
10
+ /**
11
+ * 获取配置目录路径
12
+ */
13
+ getConfigDir(): string;
14
+ /**
15
+ * 创建新的 SSH 服务配置
16
+ */
17
+ createServiceConfig(serviceName: string, port: number, allowedKeystores: string[], clientName?: string, description?: string): Promise<SSHServiceConfig>;
18
+ /**
19
+ * 加载服务配置
20
+ */
21
+ loadServiceConfig(serviceName: string): SSHServiceConfig;
22
+ /**
23
+ * 获取所有服务配置列表
24
+ */
25
+ listServiceConfigs(): string[];
26
+ /**
27
+ * 删除服务配置
28
+ */
29
+ removeServiceConfig(serviceName: string): void;
30
+ /**
31
+ * 更新服务配置
32
+ */
33
+ updateServiceConfig(serviceName: string, updates: Partial<SSHServiceConfig>): void;
34
+ /**
35
+ * 验证 keystore 密码
36
+ */
37
+ validateKeystorePasswords(keystoreIds: string[], passwords: {
38
+ [keystoreId: string]: string;
39
+ }): Promise<{
40
+ [keystoreId: string]: boolean;
41
+ }>;
42
+ /**
43
+ * 生成默认配置(向后兼容)
44
+ */
45
+ private isValidServiceName;
46
+ private isPortInUse;
47
+ private generateServiceKeyPair;
48
+ private generateClientKeyPair;
49
+ private generateSecurePassphrase;
50
+ private getServiceConfigPath;
51
+ private saveServiceConfig;
52
+ private parseConfigData;
53
+ private removeServiceKeys;
54
+ }
55
+ //# sourceMappingURL=config_manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config_manager.d.ts","sourceRoot":"","sources":["../../src/ssh/config_manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,qBAAa,gBAAgB;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,YAAY,CAAS;gBAEjB,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;IAerD;;OAEG;IACI,eAAe,IAAI,MAAM;IAIhC;;OAEG;IACI,YAAY,IAAI,MAAM;IAI7B;;OAEG;IACU,mBAAmB,CAC5B,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,EAAE,EAC1B,UAAU,GAAE,MAAyB,EACrC,WAAW,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,gBAAgB,CAAC;IA+C5B;;OAEG;IACI,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB;IAW/D;;OAEG;IACI,kBAAkB,IAAI,MAAM,EAAE;IAiBrC;;OAEG;IACI,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAWrD;;OAEG;IACI,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAMzF;;OAEG;IACU,yBAAyB,CAClC,WAAW,EAAE,MAAM,EAAE,EACrB,SAAS,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAyB7C;;OAEG;IAGH,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,WAAW;YAiBL,sBAAsB;YAwBtB,qBAAqB;IAmBnC,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,eAAe;IA4BvB,OAAO,CAAC,iBAAiB;CAc5B"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * SSH 服务配置模板和示例
3
+ * 这个文件提供了创建 SSH 服务配置的模板和示例
4
+ */
5
+ import { SSHServiceConfig } from './types';
6
+ /**
7
+ * 默认 SSH 服务配置模板
8
+ */
9
+ export declare const defaultServiceTemplate: SSHServiceConfig;
10
+ /**
11
+ * 开发环境 SSH 服务配置模板
12
+ */
13
+ export declare const developmentServiceTemplate: SSHServiceConfig;
14
+ /**
15
+ * 生产环境 SSH 服务配置模板
16
+ */
17
+ export declare const productionServiceTemplate: SSHServiceConfig;
18
+ /**
19
+ * 多租户 SSH 服务配置模板
20
+ */
21
+ export declare const multiTenantServiceTemplate: SSHServiceConfig;
22
+ /**
23
+ * 配置模板映射
24
+ */
25
+ export declare const configTemplates: {
26
+ default: SSHServiceConfig;
27
+ development: SSHServiceConfig;
28
+ production: SSHServiceConfig;
29
+ 'multi-tenant': SSHServiceConfig;
30
+ };
31
+ /**
32
+ * 获取配置模板
33
+ */
34
+ export declare function getConfigTemplate(templateName: string): SSHServiceConfig | null;
35
+ /**
36
+ * 列出所有可用的配置模板
37
+ */
38
+ export declare function listConfigTemplates(): string[];
39
+ /**
40
+ * 创建自定义配置模板
41
+ */
42
+ export declare function createCustomTemplate(name: string, port: number, keystores: string[], clients: {
43
+ name: string;
44
+ keystores: string[];
45
+ }[], options?: {
46
+ description?: string;
47
+ listen?: string;
48
+ keystorePath?: string;
49
+ logSize?: number;
50
+ logBackups?: number;
51
+ }): SSHServiceConfig;
52
+ //# sourceMappingURL=config_template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config_template.d.ts","sourceRoot":"","sources":["../../src/ssh/config_template.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,gBAwBpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,gBAwBxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,gBA+BvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,gBA+BxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;CAK3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAE/E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,EAAE,EAChD,OAAO,CAAC,EAAE;IACN,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,GACF,gBAAgB,CA4BlB"}
@@ -0,0 +1,7 @@
1
+ export { WativeSSHClient, SSHConfig, createWativeSSHClient } from './client';
2
+ export { WativeWielderServer } from './wative_server';
3
+ export * from './types';
4
+ export * from './utils';
5
+ declare const mainWithConfig: (configName?: string) => Promise<void>;
6
+ export { mainWithConfig };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ssh/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAKxB,QAAA,MAAM,cAAc,GAAU,aAAa,MAAM,kBA+BhD,CAAC;AAsBF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Remote Server Connection Example
3
+ *
4
+ * This example demonstrates how to use the Wative SSH client
5
+ * to connect to a Wative service deployed on a remote server.
6
+ *
7
+ * Architecture:
8
+ * Client -> Remote Server (SSH) -> Wative Service (SSH)
9
+ */
10
+ import { SSHConfig } from './index';
11
+ declare const remoteServerConfig: SSHConfig;
12
+ declare function demonstrateRemoteServerConnection(): Promise<void>;
13
+ declare function explainConnectionFlow(): void;
14
+ declare function showKeyManagementTips(): void;
15
+ export { demonstrateRemoteServerConnection, explainConnectionFlow, showKeyManagementTips, remoteServerConfig };
16
+ //# sourceMappingURL=remote_server_example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote_server_example.d.ts","sourceRoot":"","sources":["../../src/ssh/remote_server_example.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAyB,SAAS,EAAE,MAAM,SAAS,CAAC;AAG3D,QAAA,MAAM,kBAAkB,EAAE,SAgCzB,CAAC;AAEF,iBAAe,iCAAiC,kBA4D/C;AAGD,iBAAS,qBAAqB,SAmB7B;AAGD,iBAAS,qBAAqB,SAqB7B;AAWD,OAAO,EACL,iCAAiC,EACjC,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EACnB,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { SSHServiceConfig } from './types';
2
+ export declare class SSHServiceManager {
3
+ private configManager;
4
+ private runningServices;
5
+ private logger;
6
+ private pidDir;
7
+ constructor(configDir?: string, keystorePath?: string);
8
+ /**
9
+ * 确保 PID 目录存在
10
+ */
11
+ private ensurePidDir;
12
+ /**
13
+ * 检查端口是否被占用
14
+ * @param port 要检查的端口号
15
+ * @param host 主机地址,默认为 '127.0.0.1'
16
+ * @returns Promise<boolean> 如果端口被占用返回 true,否则返回 false
17
+ */
18
+ private isPortInUse;
19
+ /**
20
+ * 获取服务的 PID 文件路径
21
+ */
22
+ private getPidFilePath;
23
+ /**
24
+ * 写入 PID 文件
25
+ */
26
+ private writePidFile;
27
+ /**
28
+ * 读取 PID 文件
29
+ */
30
+ private readPidFile;
31
+ /**
32
+ * 删除 PID 文件
33
+ */
34
+ private removePidFile;
35
+ /**
36
+ * 检查进程是否存在
37
+ */
38
+ private isProcessRunning;
39
+ /**
40
+ * 启动指定的 SSH 服务
41
+ */
42
+ startService(serviceName: string, passwords?: {
43
+ [keystoreId: string]: string;
44
+ }): Promise<void>;
45
+ /**
46
+ * 停止指定的 SSH 服务
47
+ */
48
+ stopService(serviceName: string): Promise<void>;
49
+ /**
50
+ * 重启指定的 SSH 服务
51
+ */
52
+ restartService(serviceName: string, passwords?: {
53
+ [keystoreId: string]: string;
54
+ }): Promise<void>;
55
+ /**
56
+ * 获取所有运行中的服务
57
+ */
58
+ getRunningServices(): string[];
59
+ /**
60
+ * 获取服务配置
61
+ */
62
+ getServiceConfig(serviceName: string): SSHServiceConfig;
63
+ /**
64
+ * 获取服务状态
65
+ */
66
+ getServiceStatus(serviceName: string): 'running' | 'stopped' | 'not_found';
67
+ /**
68
+ * 停止所有服务
69
+ */
70
+ stopAllServices(): Promise<void>;
71
+ /**
72
+ * 创建新的服务配置
73
+ */
74
+ createService(serviceName: string, port: number, allowedKeystores: string[], clientName?: string, description?: string): Promise<SSHServiceConfig>;
75
+ /**
76
+ * 删除服务配置
77
+ */
78
+ removeService(serviceName: string): Promise<void>;
79
+ /**
80
+ * 列出所有服务配置
81
+ */
82
+ listServices(): {
83
+ name: string;
84
+ status: string;
85
+ port?: number;
86
+ description?: string;
87
+ }[];
88
+ /**
89
+ * 更新服务配置中的 keystore 列表
90
+ */
91
+ updateServiceKeystores(serviceName: string, keystores: string[]): void;
92
+ /**
93
+ * 交互式输入密码(公共方法)
94
+ */
95
+ promptForPasswords(keystoreIds: string[]): Promise<{
96
+ [keystoreId: string]: string;
97
+ }>;
98
+ /**
99
+ * 创建服务器实例
100
+ */
101
+ private createServerInstance;
102
+ /**
103
+ * 显示日志
104
+ */
105
+ showLogs(serviceName?: string, lines?: number, follow?: boolean): Promise<void>;
106
+ /**
107
+ * 设置日志记录器
108
+ */
109
+ private setupLogger;
110
+ /**
111
+ * 设置服务特定的日志记录器
112
+ */
113
+ private setupServiceLogger;
114
+ /**
115
+ * 清理超过3天的旧日志文件
116
+ */
117
+ private cleanupOldLogs;
118
+ }
119
+ //# sourceMappingURL=service_manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service_manager.d.ts","sourceRoot":"","sources":["../../src/ssh/service_manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AAQ5D,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,eAAe,CAA2C;IAClE,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,MAAM,CAAS;gBAEX,SAAS,CAA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AU9D;;OAEG;IACI,YAAY,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE;IAoB9F;;OAEG;IACI,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAS7E;;OAEG;IACU,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IA6CjG;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAqC5B;;OAEG;IACU,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAgDvG;;OAEG;IACH,OAAO,CAAC,WAAW;IAgCnB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgD1B;;OAEG;IACH,OAAO,CAAC,cAAc;CAoBzB"}
@@ -0,0 +1,45 @@
1
+ import { TxParams } from "@walletbunker/core/lib/types";
2
+ type SubAccountMessageParams = {
3
+ rootAccount: string;
4
+ chainId: string;
5
+ startIndex?: number;
6
+ endIndex?: number;
7
+ };
8
+ type SignMessageParams = {
9
+ txParams: TxParams;
10
+ rpcUrl: string;
11
+ };
12
+ type SSHServiceConfig = {
13
+ name: string;
14
+ description?: string;
15
+ ssh: {
16
+ listen: string;
17
+ port: number;
18
+ log: {
19
+ size: number;
20
+ backups: number;
21
+ };
22
+ };
23
+ keystore: {
24
+ path: string;
25
+ allowed_keystores: string[];
26
+ };
27
+ clients: {
28
+ name: string;
29
+ public_key_path: string;
30
+ allowed_keystores: string[];
31
+ }[];
32
+ server_keys: {
33
+ private_key_path: string;
34
+ passphrase: string;
35
+ };
36
+ };
37
+ type ServiceInstance = {
38
+ config: SSHServiceConfig;
39
+ passwords: {
40
+ [keystoreId: string]: string;
41
+ };
42
+ server: any;
43
+ };
44
+ export { SubAccountMessageParams, SignMessageParams, SSHServiceConfig, ServiceInstance };
45
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ssh/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAEvD,KAAK,uBAAuB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,iBAAiB,GAAG;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE;YACD,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL,CAAC;IACF,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,iBAAiB,EAAE,MAAM,EAAE,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,iBAAiB,EAAE,MAAM,EAAE,CAAC;KAC/B,EAAE,CAAC;IACJ,WAAW,EAAE;QACT,gBAAgB,EAAE,MAAM,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;CACL,CAAA;AAED,KAAK,eAAe,GAAG;IACnB,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC5C,MAAM,EAAE,GAAG,CAAC;CACf,CAAA;AAED,OAAO,EACH,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAClB,CAAA"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Check the existence of the file
3
+ * @filePath
4
+ */
5
+ declare const checkFileExistence: (filePath: string) => void;
6
+ declare function sleep(time?: number): Promise<unknown>;
7
+ declare const getAndGenerateConfig: (keystorePath: string) => Promise<{
8
+ [key: string]: any;
9
+ }>;
10
+ export { checkFileExistence, sleep, getAndGenerateConfig, };
11
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/ssh/utils.ts"],"names":[],"mappings":"AAQA;;;EAGE;AACF,QAAA,MAAM,kBAAkB,GAAI,UAAU,MAAM,SAM3C,CAAA;AAED,iBAAS,KAAK,CAAC,IAAI,SAAI,oBAMtB;AAsBD,QAAA,MAAM,oBAAoB,GAAU,cAAc,MAAM;;EAkCvD,CAAA;AAED,OAAO,EACH,kBAAkB,EAClB,KAAK,EACL,oBAAoB,GACvB,CAAA"}
@@ -0,0 +1,26 @@
1
+ export declare class WativeWielderServer {
2
+ private wativeCore;
3
+ private _allowedAppIds;
4
+ private _allowedPubKeys;
5
+ private _allowedKeystoreIds;
6
+ private _idRsaPrivatePath;
7
+ private _idRsaPassphrase;
8
+ private _keystoreDirectoryPath;
9
+ private _sessionIdAppIdMap;
10
+ constructor(idRsaPrivatePath: string, idRsaPassphrase: string | undefined, allowedAppIds: string[], allowedPublicKeyPath: string[], allowedKeystoreIds: string[][], keystoreDirectoryPath: string, keystoreIds: string[], passwords: string[]);
11
+ listen(host: string, port: number): void;
12
+ private web3Request;
13
+ private checkValue;
14
+ private getBytesIndex;
15
+ private getRootAccount;
16
+ private getChainType;
17
+ private getSubAccount;
18
+ private signMessage;
19
+ private signTypedData;
20
+ private signSolanaTransaction;
21
+ private sendSignedSolanaTransaction;
22
+ private getPrioritizationFee;
23
+ }
24
+ export declare const sleep: (ms: number) => Promise<unknown>;
25
+ export default WativeWielderServer;
26
+ //# sourceMappingURL=wative_server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wative_server.d.ts","sourceRoot":"","sources":["../../src/ssh/wative_server.ts"],"names":[],"mappings":"AAuCA,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,mBAAmB,CAAkB;IAE7C,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,gBAAgB,CAAqB;IAE7C,OAAO,CAAC,sBAAsB,CAAS;IACvC,OAAO,CAAC,kBAAkB,CAAW;gBAGjC,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,MAAM,GAAG,SAAS,EAEnC,aAAa,EAAE,MAAM,EAAE,EACvB,oBAAoB,EAAE,MAAM,EAAE,EAC9B,kBAAkB,EAAE,MAAM,EAAE,EAAE,EAE9B,qBAAqB,EAAE,MAAM,EAC7B,WAAW,EAAE,MAAM,EAAE,EACrB,SAAS,EAAE,MAAM,EAAE;IA4ChB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;YAoE1B,WAAW;IA4FzB,OAAO,CAAC,UAAU;IA2BlB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,cAAc;IAqBtB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,aAAa;YA6BP,WAAW;YAMX,aAAa;YAqBb,qBAAqB;YA2FrB,2BAA2B;YAW3B,oBAAoB;CAqCrC;AAED,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,qBAE/B,CAAA;AAED,eAAe,mBAAmB,CAAC"}
package/lib/tools.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ declare const WativeCore: any;
2
+ export declare const sendSolanaRawTransaction: (chain_id: string, chain_rpc_url: string, chain_symbols: string, account_address: string, wative_core: typeof WativeCore) => Promise<void>;
3
+ export declare const selectToolsOptions: (keystore_path: string, keystore_slug: string, account_address: string, wative_core: typeof WativeCore) => Promise<void>;
4
+ export declare const showTools: (keystore_path: string, wative_core: typeof WativeCore) => Promise<void>;
5
+ export {};
6
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAQ,UAAU,KAA2B,CAAC;AAsK9C,eAAO,MAAM,wBAAwB,GAAU,UAAU,MAAM,EAAE,eAAe,MAAM,EAAE,eAAe,MAAM,EAAE,iBAAiB,MAAM,EAAE,aAAa,OAAO,UAAU,kBA8HrK,CAAA;AA0gBD,eAAO,MAAM,kBAAkB,GAAU,eAAe,MAAM,EAAE,eAAe,MAAM,EAAE,iBAAiB,MAAM,EAAE,aAAa,OAAO,UAAU,kBA+B7I,CAAA;AAED,eAAO,MAAM,SAAS,GAAU,eAAe,MAAM,EAAE,aAAa,OAAO,UAAU,kBA4DpF,CAAA"}
@@ -0,0 +1,18 @@
1
+ export declare class GasUtil {
2
+ query: any;
3
+ constructor(rpcUrl: string);
4
+ analyzeGasUsage(txParams: any): Promise<{
5
+ blockGasLimit: any;
6
+ estimatedGasHex: string;
7
+ simulationFails: any;
8
+ }>;
9
+ estimateTxGas(txParams: any): Promise<any>;
10
+ addGasBuffer(initialGasLimitHex: string, blockGasLimitHex: string, multiplier?: number): string;
11
+ getBufferedGasLimit(txParams: any, multiplier: number): Promise<{
12
+ gasLimit: string;
13
+ simulationFails: any;
14
+ }>;
15
+ getGasPrice(): Promise<any>;
16
+ getTransactionCount(account: string): Promise<any>;
17
+ }
18
+ //# sourceMappingURL=tx_gas_utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx_gas_utils.d.ts","sourceRoot":"","sources":["../src/tx_gas_utils.ts"],"names":[],"mappings":"AAuCA,qBAAa,OAAO;IAChB,KAAK,EAAE,GAAG,CAAC;gBACC,MAAM,EAAE,MAAM;IAIpB,eAAe,CAAC,QAAQ,EAAE,GAAG;;;;;IA0B7B,aAAa,CAAC,QAAQ,EAAE,GAAG;IAMjC,YAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,UAAU,SAAM;IAc7E,mBAAmB,CAAC,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM;;;;IAkBrD,WAAW;IAKX,mBAAmB,CAAC,OAAO,EAAE,MAAM;CAI5C"}
package/lib/utils.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ export declare const inputSomething: (text: string, validate_func?: Function) => Promise<any>;
2
+ export declare const getAccountRange: (account_info: any) => Promise<{
3
+ from: any;
4
+ to: any;
5
+ } | null>;
6
+ export declare const getAccountIndexByKeystoreSlug: (keystore_path: string, keystore_slug: string, account_address: string) => Promise<string | null>;
7
+ export declare const getAccountIndex: (account_info: any, message: string) => Promise<any>;
8
+ export declare const tagValidator: (tag: string) => true | "Tag length should be less than 10" | "Tag should be alphanumeric";
9
+ export declare const addrValidator: (tag: string) => true | "Address length should be greater than 6";
10
+ export declare const numberValidator: (value: string) => true | "Value should be a number";
11
+ export declare const gasValidator: (value: string) => true | "Value should be a number";
12
+ export declare const passphraseValidator: (passphrase: string) => true | "Passphrase should be equal to 12 or 24 words" | "Passphrase word should be valid";
13
+ export declare const expandAmountValidator: (amount: string) => true | "Amount should be a number" | "Amount should be less than 2000";
14
+ export declare const lastAccountNoValidator: (last_account_no: string) => true | "Last account no should be a number";
15
+ export declare const accountIndexOrAddressValidator: (account_index_or_address: string) => true | "Address should be valid";
16
+ export declare const chainAddressValidator: (chain_address: string) => true | "Address should be valid";
17
+ export declare const selectSomething: (options: any[], message?: string, _default?: any) => Promise<any>;
18
+ export declare const selectCheckboxSomething: (options: any[], message?: string, _default?: any) => Promise<any>;
19
+ export declare const showIntroduction: () => void;
20
+ export declare const getKeystorePath: () => Promise<string>;
21
+ export declare const getChainId: (text: string, update?: boolean) => Promise<any>;
22
+ export declare const getRpcUrl: (chain_id: string, text: string, update?: boolean) => Promise<any>;
23
+ export declare const getMulticallAddress: (text: string) => Promise<null>;
24
+ export declare const getSymbol: (text: string) => Promise<any>;
25
+ export declare const getColor: (text: string) => Promise<any>;
26
+ export declare const getAccountNameByKeystoreSlug: (keystore_path: string, keystore_slug: string) => any;
27
+ export declare const getKeystoreSlugByAccountName: (account_name: string) => string;
28
+ export declare const batchGetKeystoreSlugByAccountName: (account_name_list: string[]) => string[];
29
+ export declare const getAccountName: (text: string, account_name_list: string[]) => Promise<any>;
30
+ export declare const inputMaskedPassword: (text: string, validate_func?: Function) => Promise<any>;
31
+ export declare const inputPasswordWithoutValidator: (text: string) => Promise<any>;
32
+ export declare const importMaskedPassphrase: (text: string, validate_func?: Function) => Promise<any>;
33
+ export declare const inputPassword: (text: string) => Promise<any>;
34
+ export declare const confirmSomething: (text: string, _default?: boolean) => Promise<any>;
35
+ export declare const editorSomething: (text: string, validate_func?: Function) => Promise<any>;
36
+ export declare const hexValidator: (value: string) => boolean;
37
+ export interface Result {
38
+ status: boolean;
39
+ output: any;
40
+ }
41
+ export declare const excutePromiseFunction: (fn: Function, params: any) => Promise<Result>;
42
+ export declare const getAccountChainType: (account_address: string) => "evm" | "solana" | "unknown";
43
+ export declare const checkFileExistence: (file_path: string) => boolean;
44
+ export declare const chunkArray: (array: any, size: number) => any;
45
+ export declare const sleep: (ms: number) => Promise<unknown>;
46
+ export declare const formatAddr: (addr: string, force_full_addr?: boolean) => string;
47
+ export declare const listWithLazyBalanceLoading: (options: string[], is_evm: boolean, keystore_path: string, asset_info_list: any, network_info: any, show_gas_token: boolean, show_extended_token: boolean, direct_display: boolean, message?: string, default_account?: any) => Promise<any>;
48
+ export declare const updateStorage: (keystore_path: string) => void;
49
+ //# sourceMappingURL=utils.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