@rocketh/signer 0.17.4 → 0.17.6
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 +6 -0
- package/package.json +5 -4
- package/src/index.ts +14 -0
package/README.md
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
1
|
# @rocketh/signer
|
|
2
|
+
|
|
3
|
+
Signer utilities for rocketh, providing signer protocol functions for private key-based signing and wallet integration.
|
|
4
|
+
|
|
5
|
+
For full documentation, visit [rocketh.dev](https://rocketh.dev).
|
|
6
|
+
|
|
7
|
+
For hardhat-deploy documentation, see [rocketh.dev/hardhat-deploy/](https://rocketh.dev/hardhat-deploy/).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocketh/signer",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.6",
|
|
4
4
|
"description": "add signer to rocketh",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -18,15 +18,16 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"src"
|
|
22
23
|
],
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"eip-1193": "^0.6.5",
|
|
25
26
|
"eip-1193-signer": "^0.1.1",
|
|
26
|
-
"@rocketh/core": "0.17.
|
|
27
|
+
"@rocketh/core": "0.17.9"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"as-soon": "^0.
|
|
30
|
+
"as-soon": "^0.1.4",
|
|
30
31
|
"rimraf": "^6.1.2",
|
|
31
32
|
"typescript": "^5.9.3"
|
|
32
33
|
},
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {EIP1193LocalSigner} from 'eip-1193-signer';
|
|
2
|
+
import type {SignerProtocolFunction} from '@rocketh/core/types';
|
|
3
|
+
|
|
4
|
+
export const privateKey: SignerProtocolFunction = async (protocolString: string) => {
|
|
5
|
+
const [proto, privateKeyString] = protocolString.split(':');
|
|
6
|
+
if (!privateKeyString.startsWith('0x')) {
|
|
7
|
+
throw new Error(`Private key must start with 0x, got: ${privateKeyString}`);
|
|
8
|
+
}
|
|
9
|
+
const privateKey = privateKeyString as `0x${string}`;
|
|
10
|
+
return {
|
|
11
|
+
type: 'signerOnly',
|
|
12
|
+
signer: new EIP1193LocalSigner(privateKey),
|
|
13
|
+
};
|
|
14
|
+
};
|