@exodus/web3-ethereum-utils 4.3.1 → 4.5.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
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { SignTypedDataVersion } from '@metamask/eth-sig-util';
|
|
1
|
+
import { SignTypedDataVersion } from '@exodus/ethereumjs/eth-sig-util';
|
|
4
2
|
import type { EthTransactionParams } from './types.js';
|
|
5
|
-
import type { MessageTypes, TypedDataV1, TypedMessage } from '@
|
|
3
|
+
import type { MessageTypes, TypedDataV1, TypedMessage } from '@exodus/ethereumjs/eth-sig-util';
|
|
6
4
|
export declare function signMessage(message: string, privateKey: Buffer): string;
|
|
7
5
|
export declare function signTypedData(typedData: TypedDataV1 | TypedMessage<MessageTypes>, privateKey: Buffer, version?: SignTypedDataVersion): string;
|
|
8
6
|
export declare function signTransaction(transactionParams: EthTransactionParams, privateKey: Buffer): Buffer;
|
package/lib/signatures.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Common, Hardfork } from '@exodus/ethereumjs/common';
|
|
2
|
+
import { SignTypedDataVersion, personalSign, signTypedData as ethSigUtilSignTypedData, } from '@exodus/ethereumjs/eth-sig-util';
|
|
2
3
|
import { FeeMarketEIP1559Transaction, Transaction as LegacyTransaction, } from '@exodus/ethereumjs/tx';
|
|
3
|
-
import { SignTypedDataVersion, personalSign, signTypedData as ethSigUtilSignTypedData, } from '@metamask/eth-sig-util';
|
|
4
4
|
const custom = Common.default?.custom || Common.custom;
|
|
5
5
|
export function signMessage(message, privateKey) {
|
|
6
6
|
return personalSign({ privateKey, data: message });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BN from 'bn.js';
|
|
2
2
|
import type { Asset } from '@exodus/web3-types';
|
|
3
3
|
import type { CreateCurrencyParams } from '@exodus/web3-utils';
|
|
4
|
-
export declare const getCreateCurrencyParams: (asset: Asset, amount: CreateCurrencyParams[
|
|
4
|
+
export declare const getCreateCurrencyParams: (asset: Asset, amount: CreateCurrencyParams["amount"]) => {
|
|
5
5
|
amount: string | number;
|
|
6
6
|
base: string;
|
|
7
7
|
symbol: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const enum MessageTypeEnum {
|
|
2
|
-
'RawMessage' = 0
|
|
3
|
-
'TypedData' = 1
|
|
2
|
+
'RawMessage' = 0,// References to the `eth_sign` RPC method.
|
|
3
|
+
'TypedData' = 1,// References to the `eth_signTypedData` RPC method.
|
|
4
4
|
'Unknown' = 2
|
|
5
5
|
}
|
|
6
6
|
export declare const getMessageType: (message: string) => MessageTypeEnum;
|
|
@@ -163,6 +163,17 @@ export const simulateTransactions = async ({ transactions, apiEndpoint, origin,
|
|
|
163
163
|
errorMessage: error?.humanReadableError,
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
+
const { action } = response;
|
|
167
|
+
if (action === 'BLOCK') {
|
|
168
|
+
const warning = {
|
|
169
|
+
kind: 'MALICIOUS_ACTION',
|
|
170
|
+
severity: 'CRITICAL',
|
|
171
|
+
// We use a generic default message unless we find a known warning type below
|
|
172
|
+
// (TODO: add known warning types)
|
|
173
|
+
message: 'This dApp could be malicious. Do not proceed unless you are certain this is safe.',
|
|
174
|
+
};
|
|
175
|
+
simulationResult.warnings.push(warning);
|
|
176
|
+
}
|
|
166
177
|
const noExpectedStateChangesDetected = Object.keys(expectedStateChanges).length === 0;
|
|
167
178
|
// This is a self-send transaction, adding a zero "transfer" so that the UI can display it.
|
|
168
179
|
if (noExpectedStateChangesDetected) {
|
package/lib/transactions.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { EthTransaction } from './types.js';
|
|
4
2
|
import type { ApprovalBalanceChange } from '@exodus/web3-types';
|
|
5
3
|
export declare function getTransactionId(serializedTransaction: Buffer, isEIP1559Transaction?: boolean): string;
|
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": "4.
|
|
4
|
+
"version": "4.5.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -34,14 +34,13 @@
|
|
|
34
34
|
"test": "run -T exodus-test --jest --esbuild"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@exodus/web3-types": "1.57.
|
|
37
|
+
"@exodus/web3-types": "1.57.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@exodus/basic-utils": "^3.0.1",
|
|
41
|
-
"@exodus/ethereumjs": "^1.
|
|
41
|
+
"@exodus/ethereumjs": "^1.5.0",
|
|
42
42
|
"@exodus/solidity-contract": "^1.2.1",
|
|
43
43
|
"@exodus/web3-utils": "^1.50.1",
|
|
44
|
-
"@metamask/eth-sig-util": "^4.0.1",
|
|
45
44
|
"minimalistic-assert": "^1.0.1"
|
|
46
45
|
},
|
|
47
46
|
"author": "Exodus Movement, Inc.",
|
|
@@ -49,5 +48,5 @@
|
|
|
49
48
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Aweb3-ethereum-utils"
|
|
50
49
|
},
|
|
51
50
|
"homepage": "https://github.com/ExodusMovement/assets/tree/master/web3/web3-ethereum-utils",
|
|
52
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "a703c06af7e51ff5810dc4feb397ef61639059fa"
|
|
53
52
|
}
|