wative 1.2.6 → 1.2.8

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.
@@ -1,119 +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
- }
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
119
  //# sourceMappingURL=service_manager.d.ts.map
@@ -1,45 +1,44 @@
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 };
1
+ type SubAccountMessageParams = {
2
+ rootAccount: string;
3
+ chainId: string;
4
+ startIndex?: number;
5
+ endIndex?: number;
6
+ };
7
+ type SignMessageParams = {
8
+ txParams: any;
9
+ rpcUrl: string;
10
+ };
11
+ type SSHServiceConfig = {
12
+ name: string;
13
+ description?: string;
14
+ ssh: {
15
+ listen: string;
16
+ port: number;
17
+ log: {
18
+ size: number;
19
+ backups: number;
20
+ };
21
+ };
22
+ keystore: {
23
+ path: string;
24
+ allowed_keystores: string[];
25
+ };
26
+ clients: {
27
+ name: string;
28
+ public_key_path: string;
29
+ allowed_keystores: string[];
30
+ }[];
31
+ server_keys: {
32
+ private_key_path: string;
33
+ passphrase: string;
34
+ };
35
+ };
36
+ type ServiceInstance = {
37
+ config: SSHServiceConfig;
38
+ passwords: {
39
+ [keystoreId: string]: string;
40
+ };
41
+ server: any;
42
+ };
43
+ export { SubAccountMessageParams, SignMessageParams, SSHServiceConfig, ServiceInstance };
45
44
  //# sourceMappingURL=types.d.ts.map
@@ -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@@
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, };
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
11
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/ssh/utils.ts"],"names":[],"mappings":"AAQA;;;EAGE;AACF,QAAA,MAAM,kBAAkB,aAAc,MAAM,SAM3C,CAAA;AAED,iBAAS,KAAK,CAAC,IAAI,SAAI,oBAMtB;AAsBD,QAAA,MAAM,oBAAoB,iBAAwB,MAAM;;EAkCvD,CAAA;AAED,OAAO,EACH,kBAAkB,EAClB,KAAK,EACL,oBAAoB,GACvB,CAAA"}
@@ -1,26 +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;
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
26
  //# sourceMappingURL=wative_server.d.ts.map
@@ -1 +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;IACp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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,OAAQ,MAAM,qBAE/B,CAAA;AAED,eAAe,mBAAmB,CAAC"}
package/lib/tools.d.ts CHANGED
@@ -1,6 +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 {};
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
6
  //# sourceMappingURL=tools.d.ts.map
@@ -1 +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;AAygBD,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"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAQ,UAAU,KAA2B,CAAC;AAsK9C,eAAO,MAAM,wBAAwB,aAAoB,MAAM,iBAAiB,MAAM,iBAAiB,MAAM,mBAAmB,MAAM,eAAe,iBAAiB,kBA8HrK,CAAA;AAygBD,eAAO,MAAM,kBAAkB,kBAAyB,MAAM,iBAAiB,MAAM,mBAAmB,MAAM,eAAe,iBAAiB,kBA+B7I,CAAA;AAED,eAAO,MAAM,SAAS,kBAAyB,MAAM,eAAe,iBAAiB,kBA4DpF,CAAA"}
@@ -1,18 +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
- }
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
18
  //# sourceMappingURL=tx_gas_utils.d.ts.map
package/lib/utils.d.ts CHANGED
@@ -1,49 +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<any>;
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;
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<any>;
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
49
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,cAAc,GAAU,MAAM,MAAM,EAAE,gBAAgB,QAAQ,iBAW1E,CAAA;AAED,eAAO,MAAM,eAAe,GAAU,cAAc,GAAG;;;SAsBtD,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAU,eAAe,MAAM,EAAE,eAAe,MAAM,EAAE,iBAAiB,MAAM,2BA0BxH,CAAA;AAED,eAAO,MAAM,eAAe,GAAU,cAAc,GAAG,EAAE,SAAS,MAAM,iBAgCvE,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,8EAgBvC,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,qDAKxC,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,sCAK5C,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,sCAKzC,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,Y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HD,eAAO,MAAM,0BAA0B,YAC1B,MAAM,EAAE,UACT,OAAO,iBACA,MAAM,mBACJ,GAAG,gBACN,GAAG,kBACD,OAAO,uBACF,OAAO,kBACZ,OAAO,YACb,MAAM,oBACE,GAAG,iBA4GxB,CAAC;AAEF,eAAO,MAAM,aAAa,kBAAmB,MAAM,SAgDlD,CAAA"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=wallet-cli.d.ts.map
package/lib/wative.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Command } from 'commander';
2
- declare const program: Command;
3
- export { program };
1
+ import { Command } from 'commander';
2
+ declare const program: Command;
3
+ export { program };
4
4
  //# sourceMappingURL=wative.d.ts.map