@exodus/web3-ethereum-utils 0.2.0 → 0.3.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/lib/signatures.d.ts +2 -2
- package/lib/signatures.js +2 -2
- package/lib/types.d.ts +1 -1
- package/package.json +2 -2
package/lib/signatures.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { MessageTypes, SignTypedDataVersion, TypedDataV1, TypedMessage } from '@metamask/eth-sig-util';
|
|
3
|
-
import {
|
|
3
|
+
import { TransactionParams } from './types.js';
|
|
4
4
|
export declare function signMessage(message: string, privateKey: Buffer): string;
|
|
5
5
|
export declare function signTypedData(typedData: TypedDataV1 | TypedMessage<MessageTypes>, privateKey: Buffer, version?: SignTypedDataVersion): string;
|
|
6
|
-
export declare function signTransaction(
|
|
6
|
+
export declare function signTransaction(transactionParams: TransactionParams, privateKey: Buffer): string;
|
package/lib/signatures.js
CHANGED
|
@@ -7,9 +7,9 @@ export function signMessage(message, privateKey) {
|
|
|
7
7
|
export function signTypedData(typedData, privateKey, version = SignTypedDataVersion.V4) {
|
|
8
8
|
return ethSigUtilSignTypedData({ privateKey, data: typedData, version });
|
|
9
9
|
}
|
|
10
|
-
export function signTransaction(
|
|
10
|
+
export function signTransaction(transactionParams, privateKey) {
|
|
11
11
|
// TODO: Do we need to support EIP-1559 transactions?
|
|
12
|
-
const { chainId: hexChainId, gas, ...rest } =
|
|
12
|
+
const { chainId: hexChainId, gas, ...rest } = transactionParams;
|
|
13
13
|
const chainId = Number.parseInt(hexChainId, 16);
|
|
14
14
|
const transaction = Transaction.fromTxData({ ...rest, gasLimit: gas }, { common: Common.custom({ chainId }) });
|
|
15
15
|
const signedTransaction = transaction.sign(privateKey);
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/web3-ethereum-utils",
|
|
3
3
|
"description": "Web3 Ethereum utils.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"@exodus/ethereumjs-tx": "^3.3.0-exodus.6",
|
|
31
31
|
"@metamask/eth-sig-util": "^4.0.1"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "d5409fdf3d13b54c95ffb6b1d7fed797e52f130a"
|
|
34
34
|
}
|