@faremeter/wallet-ledger 0.14.0 → 0.16.0
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/dist/src/evm.d.ts.map +1 -1
- package/dist/src/evm.js +1 -6
- package/dist/src/logger.d.ts +1 -1
- package/dist/src/logger.d.ts.map +1 -1
- package/dist/src/logger.js +2 -2
- package/dist/src/types.d.ts +1 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/evm.ts +4 -10
- package/src/logger.ts +2 -2
- package/src/types.ts +1 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faremeter/wallet-ledger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Ledger hardware wallet integration for secure Faremeter payments on Solana and EVM",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"faremeter",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"@ledgerhq/hw-transport": "^6.31.0",
|
|
20
20
|
"@ledgerhq/hw-transport-node-hid": "^6.29.0",
|
|
21
21
|
"@ledgerhq/hw-transport-webusb": "^6.29.0",
|
|
22
|
-
"@logtape/logtape": "1.0.4",
|
|
23
22
|
"@solana/web3.js": "1.98.4",
|
|
24
23
|
"arktype": "2.1.21",
|
|
25
|
-
"viem": "2.
|
|
26
|
-
"@faremeter/
|
|
24
|
+
"viem": "2.41.2",
|
|
25
|
+
"@faremeter/logs": "^0.16.0",
|
|
26
|
+
"@faremeter/types": "^0.16.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"tsc-esm-fix": "3.1.2",
|
package/src/evm.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createWalletClient,
|
|
3
|
-
http,
|
|
4
2
|
type Hex,
|
|
5
3
|
type LocalAccount,
|
|
6
4
|
type TransactionSerializable,
|
|
@@ -94,10 +92,12 @@ export async function createLedgerEvmWallet(
|
|
|
94
92
|
message: "object",
|
|
95
93
|
});
|
|
96
94
|
|
|
95
|
+
type TypeDefinition = Record<string, { name: string; type: string }[]>;
|
|
96
|
+
|
|
97
97
|
const validated = typedDataParams.assert(parameters);
|
|
98
98
|
const { domain, types, primaryType, message } = validated as {
|
|
99
99
|
domain?: TypedDataDomain;
|
|
100
|
-
types:
|
|
100
|
+
types: TypeDefinition;
|
|
101
101
|
primaryType: string;
|
|
102
102
|
message: Record<string, unknown>;
|
|
103
103
|
};
|
|
@@ -108,7 +108,7 @@ export async function createLedgerEvmWallet(
|
|
|
108
108
|
// for signing.
|
|
109
109
|
|
|
110
110
|
// Build types with EIP712Domain
|
|
111
|
-
const typesWithDomain = {
|
|
111
|
+
const typesWithDomain: TypeDefinition = {
|
|
112
112
|
EIP712Domain: [
|
|
113
113
|
...(domain?.name ? [{ name: "name", type: "string" }] : []),
|
|
114
114
|
...(domain?.version ? [{ name: "version", type: "string" }] : []),
|
|
@@ -154,15 +154,9 @@ export async function createLedgerEvmWallet(
|
|
|
154
154
|
},
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
const client = createWalletClient({
|
|
158
|
-
account: ledgerAccount,
|
|
159
|
-
transport: http(chain.rpcUrls.default.http[0]),
|
|
160
|
-
});
|
|
161
|
-
|
|
162
157
|
return {
|
|
163
158
|
chain,
|
|
164
159
|
address: formattedAddress,
|
|
165
|
-
client,
|
|
166
160
|
signTransaction: async (tx: TransactionSerializable) => {
|
|
167
161
|
return await ledgerAccount.signTransaction(tx);
|
|
168
162
|
},
|
package/src/logger.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { getLogger } from "@
|
|
1
|
+
import { getLogger } from "@faremeter/logs";
|
|
2
2
|
|
|
3
|
-
export const logger = getLogger(["faremeter", "wallet-ledger"]);
|
|
3
|
+
export const logger = await getLogger(["faremeter", "wallet-ledger"]);
|
package/src/types.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Hex,
|
|
3
|
-
WalletClient,
|
|
4
|
-
TransactionSerializable,
|
|
5
|
-
TypedDataDefinition,
|
|
6
|
-
} from "viem";
|
|
1
|
+
import type { Hex, TransactionSerializable, TypedDataDefinition } from "viem";
|
|
7
2
|
import { evm } from "@faremeter/types";
|
|
8
3
|
import type { PublicKey, VersionedTransaction } from "@solana/web3.js";
|
|
9
4
|
import type Transport from "@ledgerhq/hw-transport";
|
|
@@ -11,7 +6,6 @@ import type Transport from "@ledgerhq/hw-transport";
|
|
|
11
6
|
export interface LedgerEvmWallet {
|
|
12
7
|
chain: evm.ChainInfo;
|
|
13
8
|
address: Hex;
|
|
14
|
-
client: WalletClient;
|
|
15
9
|
signTransaction: (tx: TransactionSerializable) => Promise<Hex>;
|
|
16
10
|
signTypedData: (params: TypedDataDefinition) => Promise<Hex>;
|
|
17
11
|
disconnect: () => Promise<void>;
|