wative 1.1.16 → 1.1.18
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/lib/account.d.ts +14 -0
- package/lib/account.d.ts.map +1 -0
- package/lib/assets.d.ts +11 -0
- package/lib/assets.d.ts.map +1 -0
- package/lib/chain.d.ts +6 -0
- package/lib/chain.d.ts.map +1 -0
- package/lib/config.d.ts +23 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/daemon-watcher.js +181 -0
- package/lib/home_page.d.ts +4 -0
- package/lib/home_page.d.ts.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +1 -1
- package/lib/network.d.ts +28 -0
- package/lib/network.d.ts.map +1 -0
- package/lib/ssh/client.d.ts +120 -0
- package/lib/ssh/client.d.ts.map +1 -0
- package/lib/ssh/client_example.d.ts +19 -0
- package/lib/ssh/client_example.d.ts.map +1 -0
- package/lib/ssh/client_test.d.ts +27 -0
- package/lib/ssh/client_test.d.ts.map +1 -0
- package/lib/ssh/config_manager.d.ts +55 -0
- package/lib/ssh/config_manager.d.ts.map +1 -0
- package/lib/ssh/config_template.d.ts +52 -0
- package/lib/ssh/config_template.d.ts.map +1 -0
- package/lib/ssh/index.d.ts +8 -0
- package/lib/ssh/index.d.ts.map +1 -0
- package/lib/ssh/remote_server_example.d.ts +16 -0
- package/lib/ssh/remote_server_example.d.ts.map +1 -0
- package/lib/ssh/service_manager.d.ts +119 -0
- package/lib/ssh/service_manager.d.ts.map +1 -0
- package/lib/ssh/types.d.ts +45 -0
- package/lib/ssh/types.d.ts.map +1 -0
- package/lib/ssh/utils.d.ts +11 -0
- package/lib/ssh/utils.d.ts.map +1 -0
- package/lib/ssh/wative_server.d.ts +26 -0
- package/lib/ssh/wative_server.d.ts.map +1 -0
- package/lib/tools.d.ts +6 -0
- package/lib/tools.d.ts.map +1 -0
- package/lib/tx_gas_utils.d.ts +18 -0
- package/lib/tx_gas_utils.d.ts.map +1 -0
- package/lib/utils.d.ts +49 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/wative.d.ts +4 -0
- package/lib/wative.d.ts.map +1 -0
- package/lib/wative.esm.js +1 -1
- package/lib/wative.umd.js +1 -1
- package/lib/web3.d.ts +59 -0
- package/lib/web3.d.ts.map +1 -0
- package/package.json +10 -6
- package/src/daemon-watcher.js +181 -0
- package/src/index.ts +22 -6
- package/src/ssh/client.rs +221 -0
- package/src/ssh/client.ts +389 -0
- package/src/ssh/config_manager.ts +317 -0
- package/src/ssh/index.ts +50 -36
- package/src/ssh/service_manager.ts +684 -0
- package/src/ssh/types.ts +35 -1
- package/src/ssh/wative_server.ts +1 -2
- package/src/wative.ts +566 -122
- package/bin/wative-ssh.sh +0 -44
- package/lib/wative-ssh.esm.js +0 -1
- package/lib/wative-ssh.umd.js +0 -1
package/lib/network.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Result } from "./utils";
|
|
2
|
+
export declare const createNetwork: (keystore_path: string) => Promise<void>;
|
|
3
|
+
export declare const selectOrEditNetwork: (keystore_path: string, selected_network: any) => Promise<void>;
|
|
4
|
+
export declare const updateNetwork: (keystore_path: string, default_network: any) => Promise<void>;
|
|
5
|
+
export declare const removeNetwork: (keystore_path: string, default_network: any) => Promise<void>;
|
|
6
|
+
export declare const addNetwork: (keystore_path: string) => Promise<void>;
|
|
7
|
+
export declare const showAvailableNetworks: (keystore_path: string) => Promise<void>;
|
|
8
|
+
export declare const showDataview: (keystore_path: string) => Promise<void>;
|
|
9
|
+
export declare const updateStatus: (keystore_path: string) => Promise<void>;
|
|
10
|
+
export declare const selectFlag: () => Promise<boolean | undefined>;
|
|
11
|
+
export declare const getShowTokenList: (keystore_path: string, chain_name: string) => any;
|
|
12
|
+
export declare const showTokenList: (keystore_path: string) => Promise<void>;
|
|
13
|
+
export declare const enhancedBalanceDisplay: (keystore_path: string) => Promise<void>;
|
|
14
|
+
export declare const showNetwork: (keystore_path: string) => Promise<void>;
|
|
15
|
+
export declare const selectDefaultNetwork: (keystore_path: string) => Promise<any>;
|
|
16
|
+
export declare const getNetworkTypeByName: (keystore_path: string, network_name: string) => "solana" | "evm" | "unknown";
|
|
17
|
+
export declare const getNetworkInfoByName: (keystore_path: string, network_name: string) => any;
|
|
18
|
+
export declare const getAccountAddress: (keystore_path: string, keystore_slug: string, account_id: number) => any;
|
|
19
|
+
export declare const getPKAccountAddress: (keystore_path: string, keystore_slug: string) => any;
|
|
20
|
+
export declare const switchPPNetwork: (keystore_path: string, keystore_slug: string, account_id: number) => Promise<void>;
|
|
21
|
+
export declare const showAllAccounts: (keystore_path: string, keystore_slug: string, account_index: number) => Promise<void>;
|
|
22
|
+
export declare const switchNetworkByAccountName: (keystore_path: string, keystore_slug: string, is_keystore_slug: boolean) => Promise<void>;
|
|
23
|
+
export declare const accountBalanceLog: (keystore_slug: string, account_id: number, keystore_path: string, default_network: string) => Promise<void>;
|
|
24
|
+
export declare const getAccountBalance: (account: string, keystore_path: string, default_network: string) => Promise<Result>;
|
|
25
|
+
export declare const getDefaultNetworkByAddress: (keystore_path: string, keystore_slug: string, account_address: string) => any;
|
|
26
|
+
export declare const getEvmNetworks: (keystore_path: string) => any;
|
|
27
|
+
export declare const getStatus: (keystore_path: string) => any;
|
|
28
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAMA,OAAO,EAQH,MAAM,EAIT,MAAM,SAAS,CAAC;AASjB,eAAO,MAAM,aAAa,GAAU,eAAe,MAAM,kBAcxD,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAU,eAAe,MAAM,EAAE,kBAAkB,GAAG,kBA2BrF,CAAA;AAED,eAAO,MAAM,aAAa,GAAU,eAAe,MAAM,EAAE,iBAAiB,GAAG,kBA2E9E,CAAA;AAED,eAAO,MAAM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;AAED,eAAO,MAAM,iBAAiB,GAAU,eAAe,MAAM,EAAE,YAAY,MAAM,EAAE,eAAe,MAAM,EAAE,iBAAiB,MAAM,kBAoBhI,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAU,SAAS,MAAM,EAAE,eAAe,MAAM,EAAE,iBAAiB,MAAM,oBA4BtG,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAI,eAAe,MAAM,EAAE,eAAe,MAAM,EAAE,iBAAiB,MAAM,QAkB/G,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,eAAe,MAAM,QAYnD,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,eAAe,MAAM,QAI9C,CAAA"}
|
|
@@ -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;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EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAalE;;;;;OAKG;IACG,sBAAsB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAazE;;;;;;OAMG;IACG,qBAAqB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAc3F;;;;;OAKG;IACG,2BAA2B,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAa9E;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAajE;;;;;;;;OAQG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,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,8 @@
|
|
|
1
|
+
export { WativeSSHClient, SSHConfig, createWativeSSHClient } from './client';
|
|
2
|
+
export { WativeWielderServer } from './wative_server';
|
|
3
|
+
export { SSHConfigManager } from './config_manager';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './utils';
|
|
6
|
+
declare const mainWithConfig: (configName?: string) => Promise<void>;
|
|
7
|
+
export { mainWithConfig };
|
|
8
|
+
//# 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,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,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,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;IAOrD;;OAEG;IACH,OAAO,CAAC,YAAY;IAMpB;;;;;OAKG;YACW,WAAW;IAqBzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IACH,OAAO,CAAC,YAAY;IAKpB;;OAEG;IACH,OAAO,CAAC,WAAW;IAanB;;OAEG;IACH,OAAO,CAAC,aAAa;IAOrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACU,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA2D3G;;OAEG;IACU,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0G5D;;OAEG;IACU,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG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;;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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) => 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"}
|