easctl 0.1.1 → 0.1.3
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/README.md +1 -1
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/config.test.ts +4 -4
- package/src/commands/clear-key.ts +1 -1
- package/src/commands/set-key.ts +1 -1
- package/src/config.ts +1 -1
package/package.json
CHANGED
|
@@ -22,8 +22,8 @@ describe('config module', () => {
|
|
|
22
22
|
beforeEach(() => vi.clearAllMocks());
|
|
23
23
|
|
|
24
24
|
describe('getConfigPath', () => {
|
|
25
|
-
it('returns ~/.
|
|
26
|
-
expect(getConfigPath()).toBe('/mock/home/.
|
|
25
|
+
it('returns ~/.easctl', () => {
|
|
26
|
+
expect(getConfigPath()).toBe('/mock/home/.easctl');
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -61,7 +61,7 @@ describe('config module', () => {
|
|
|
61
61
|
vi.mocked(readFileSync).mockReturnValue('{}');
|
|
62
62
|
setStoredPrivateKey('0xabc123');
|
|
63
63
|
expect(writeFileSync).toHaveBeenCalledWith(
|
|
64
|
-
'/mock/home/.
|
|
64
|
+
'/mock/home/.easctl',
|
|
65
65
|
JSON.stringify({ privateKey: '0xabc123' }, null, 2) + '\n',
|
|
66
66
|
{ mode: 0o600 },
|
|
67
67
|
);
|
|
@@ -71,7 +71,7 @@ describe('config module', () => {
|
|
|
71
71
|
vi.mocked(readFileSync).mockReturnValue('{}');
|
|
72
72
|
setStoredPrivateKey('abc123');
|
|
73
73
|
expect(writeFileSync).toHaveBeenCalledWith(
|
|
74
|
-
'/mock/home/.
|
|
74
|
+
'/mock/home/.easctl',
|
|
75
75
|
JSON.stringify({ privateKey: '0xabc123' }, null, 2) + '\n',
|
|
76
76
|
{ mode: 0o600 },
|
|
77
77
|
);
|
|
@@ -3,7 +3,7 @@ import { clearStoredPrivateKey, getStoredPrivateKey } from '../config.js';
|
|
|
3
3
|
import { output } from '../output.js';
|
|
4
4
|
|
|
5
5
|
export const clearKeyCommand = new Command('clear-key')
|
|
6
|
-
.description('Remove the stored private key from ~/.
|
|
6
|
+
.description('Remove the stored private key from ~/.easctl')
|
|
7
7
|
.action(() => {
|
|
8
8
|
if (!getStoredPrivateKey()) {
|
|
9
9
|
output({ success: true, data: { cleared: false, message: 'No private key is currently stored' } });
|
package/src/commands/set-key.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { setStoredPrivateKey } from '../config.js';
|
|
|
4
4
|
import { output, handleError } from '../output.js';
|
|
5
5
|
|
|
6
6
|
export const setKeyCommand = new Command('set-key')
|
|
7
|
-
.description('Store your private key in ~/.
|
|
7
|
+
.description('Store your private key in ~/.easctl for future use')
|
|
8
8
|
.argument('<key>', 'Wallet private key (hex string, with or without 0x prefix)')
|
|
9
9
|
.action((key: string) => {
|
|
10
10
|
const normalized = key.startsWith('0x') ? key : `0x${key}`;
|