@universal-signer/core 0.0.1

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.
@@ -0,0 +1,10 @@
1
+ import { type LocalAccount } from "viem";
2
+ export interface AwsKmsConfig {
3
+ keyId: string;
4
+ region?: string;
5
+ credentials?: {
6
+ accessKeyId: string;
7
+ secretAccessKey: string;
8
+ };
9
+ }
10
+ export declare const createAwsAccount: (config: AwsKmsConfig) => Promise<LocalAccount>;
@@ -0,0 +1,9 @@
1
+ import type { ClientOptions } from "google-gax";
2
+ import { type LocalAccount } from "viem";
3
+ export interface GcpKmsConfig {
4
+ /** Full resource name of the CryptoKeyVersion */
5
+ name: string;
6
+ /** GCP client configuration options */
7
+ clientOptions?: ClientOptions;
8
+ }
9
+ export declare const createGcpAccount: (config: GcpKmsConfig) => Promise<LocalAccount>;
@@ -0,0 +1,13 @@
1
+ import type Transport from "@ledgerhq/hw-transport";
2
+ import { type LocalAccount } from "viem";
3
+ export interface LedgerConfig {
4
+ /** BIP-44 derivation path (default: "44'/60'/0'/0/0") */
5
+ derivationPath?: string;
6
+ /** Optional existing transport instance */
7
+ transport?: Transport;
8
+ }
9
+ export interface LedgerAccount extends LocalAccount {
10
+ /** Close the HID transport connection */
11
+ close: () => Promise<void>;
12
+ }
13
+ export declare const createLedgerAccount: (config?: LedgerConfig) => Promise<LedgerAccount>;
@@ -0,0 +1,5 @@
1
+ import type { Hex, LocalAccount } from "viem";
2
+ export declare const createLocalAccount: (config: {
3
+ privateKey?: Hex;
4
+ mnemonic?: string;
5
+ }) => LocalAccount;
@@ -0,0 +1,12 @@
1
+ import { type LocalAccount } from "viem";
2
+ export interface TrezorConfig {
3
+ /** Contact email for Trezor manifest */
4
+ email: string;
5
+ /** Application URL for Trezor manifest */
6
+ appUrl: string;
7
+ /** Application name for Trezor manifest */
8
+ appName: string;
9
+ /** BIP-44 derivation path (default: "m/44'/60'/0'/0/0") */
10
+ derivationPath?: string;
11
+ }
12
+ export declare const createTrezorAccount: (config: TrezorConfig) => Promise<LocalAccount>;
@@ -0,0 +1,8 @@
1
+ import type { LocalAccount } from "viem";
2
+ export declare const createTurnkeyAccount: (config: {
3
+ apiPublicKey: string;
4
+ apiPrivateKey: string;
5
+ baseUrl: string;
6
+ organizationId: string;
7
+ privateKeyId: string;
8
+ }) => Promise<LocalAccount>;
@@ -0,0 +1,9 @@
1
+ import { type Hash, type Hex } from "viem";
2
+ /**
3
+ * Decodes a DER signature, normalizes S (EIP-2), and recovers V.
4
+ */
5
+ export declare function normalizeKmsSignature(derSignature: Uint8Array | Buffer, digest: Hash, expectedAddress: string): Promise<{
6
+ r: Hex;
7
+ s: Hex;
8
+ v: bigint;
9
+ }>;
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@universal-signer/core",
3
+ "version": "0.0.1",
4
+ "description": "Universal blockchain signer for Hardware (Ledger, Trezor), Cloud KMS (AWS, GCP), Turnkey, and Local environments using Viem v2.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "sideEffects": false,
10
+ "license": "MIT",
11
+ "author": "Universal Signer Contributors",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/melonask/universal-signer.git"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/melonask/universal-signer/issues"
18
+ },
19
+ "homepage": "https://github.com/melonask/universal-signer#readme",
20
+ "keywords": [
21
+ "ethereum",
22
+ "viem",
23
+ "kms",
24
+ "aws-kms",
25
+ "gcp-kms",
26
+ "ledger",
27
+ "trezor",
28
+ "turnkey",
29
+ "hardware-wallet",
30
+ "signing",
31
+ "blockchain",
32
+ "web3",
33
+ "eip-712",
34
+ "ecdsa",
35
+ "secp256k1"
36
+ ],
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "exports": {
41
+ ".": {
42
+ "types": "./dist/index.d.ts",
43
+ "import": "./dist/index.js",
44
+ "require": "./dist/index.js"
45
+ }
46
+ },
47
+ "scripts": {
48
+ "build": "bun build ./src/index.ts --outdir ./dist --target node --format esm --sourcemap=none && tsc --emitDeclarationOnly --outDir dist",
49
+ "test": "bun test",
50
+ "typecheck": "tsc --noEmit",
51
+ "prepublishOnly": "bun run build && bun run test"
52
+ },
53
+ "publishConfig": {
54
+ "access": "public"
55
+ },
56
+ "engines": {
57
+ "node": ">=18.0.0"
58
+ },
59
+ "dependencies": {
60
+ "@aws-sdk/client-kms": "^3.972.0",
61
+ "@google-cloud/kms": "^5.2.1",
62
+ "@ledgerhq/hw-app-eth": "^7.3.0",
63
+ "@ledgerhq/hw-transport-node-hid": "^6.30.0",
64
+ "@trezor/connect": "^9.7.1",
65
+ "@turnkey/api-key-stamper": "^0.6.0",
66
+ "@turnkey/http": "^3.16.1",
67
+ "@turnkey/viem": "^0.14.21",
68
+ "viem": "^2.44.4"
69
+ },
70
+ "devDependencies": {
71
+ "@types/bun": "latest",
72
+ "@types/node": "^25.0.9",
73
+ "typescript": "^5.9.3"
74
+ },
75
+ "peerDependencies": {
76
+ "typescript": "^5",
77
+ "viem": "^2.44.0"
78
+ }
79
+ }