diff --git a/@types/frame/rpc.d.ts b/@types/frame/rpc.d.ts index 7c24e76ec..6f7b61bb2 100644 --- a/@types/frame/rpc.d.ts +++ b/@types/frame/rpc.d.ts @@ -7,6 +7,7 @@ type RPCRequestCallback = RPCCallback type Address = string // 20 hex bytes, 0x-prefixed type Caip2ChainId = string // format: ":", ex: "eip155:1" +type TransactionType = '0x0' | '0x1' | '0x2' | '0x4' interface RPCId { id: number @@ -151,6 +152,12 @@ declare namespace RPC { } namespace SendTransaction { + interface Authorization { + contractAddress: Address + chainId: string + nonce: string + } + interface TxParams { nonce?: string gasPrice?: string @@ -163,7 +170,8 @@ declare namespace RPC { data?: string value?: string chainId: string - type?: string + type?: TransactionType + authorizationList?: Authorization[] } interface Request extends Omit { diff --git a/app/tray/Account/Requests/TransactionRequest/ViewData/index.js b/app/tray/Account/Requests/TransactionRequest/ViewData/index.js index 7850faf28..eef151336 100644 --- a/app/tray/Account/Requests/TransactionRequest/ViewData/index.js +++ b/app/tray/Account/Requests/TransactionRequest/ViewData/index.js @@ -136,7 +136,10 @@ class ViewData extends React.Component { decodeRawTx(tx) { const decodeTx = {} Object.keys(tx).forEach((key) => { - if (tx[key] && !tx[key].startsWith('0x')) { + console.log('key: ', key) + if (key === 'authorizationList') { + decodeTx[key] = tx[key].toString() + } else if (tx[key] && !tx[key].startsWith('0x')) { decodeTx[key] = tx[key] } else if ( [ diff --git a/main/accounts/index.ts b/main/accounts/index.ts index 91dfd6ad3..69c97a66f 100644 --- a/main/accounts/index.ts +++ b/main/accounts/index.ts @@ -7,34 +7,38 @@ import { v5 as uuidv5 } from 'uuid' import provider from '../provider' import store from '../store' import FrameAccount from './Account' -import ExternalDataScanner, { DataScanner } from '../externalData' +import ExternalDataScanner from '../externalData' import Signer from '../signers/Signer' -import { signerCompatibility as transactionCompatibility, maxFee, SignerCompatibility } from '../transaction' +import { signerCompatibility as transactionCompatibility, maxFee } from '../transaction' import { weiIntToEthInt, hexToInt } from '../../resources/utils' import { accountPanelCrumb, signerPanelCrumb } from '../../resources/domain/nav' import { usesBaseFee, TransactionData, GasFeesSource } from '../../resources/domain/transaction' import { findUnavailableSigners, isSignerReady } from '../../resources/domain/signer' -import { +import { ReplacementType, RequestStatus, RequestMode } from './types' + +import { openBlockExplorer } from '../windows/window' +import { ApprovalType } from '../../resources/constants' +import { accountNS } from '../../resources/domain/account' +import { chainUsesOptimismFees } from '../../resources/utils/chains' + +import type { PrefixedHexString } from '@ethereumjs/util' + +import type { Chain } from '../chains' +import type { SignerCompatibility } from '../transaction' +import type { ActionType } from '../transaction/actions' +import type { DataScanner } from '../externalData' + +import type { AccountRequest, AccessRequest, TransactionRequest, TransactionReceipt, - ReplacementType, - RequestStatus, - RequestMode, TypedMessage, PermitSignatureRequest } from './types' -import type { Chain } from '../chains' -import { ActionType } from '../transaction/actions' -import { openBlockExplorer } from '../windows/window' -import { ApprovalType } from '../../resources/constants' -import { accountNS } from '../../resources/domain/account' -import { chainUsesOptimismFees } from '../../resources/utils/chains' - function notify(title: string, body: string, action: (event: Electron.Event) => void) { const notification = new Notification({ title, body }) notification.on('click', action) @@ -158,7 +162,7 @@ export class Accounts extends EventEmitter { return this._current ? this.accounts[this._current] : null } - updateNonce(reqId: string, nonce: string) { + updateNonce(reqId: string, nonce: PrefixedHexString) { log.info('Update Nonce: ', reqId, nonce) const currentAccount = this.current() @@ -1215,7 +1219,7 @@ export class Accounts extends EventEmitter { const txRequest = this.getTransactionRequest(currentAccount, handlerId) const initialNonce = txRequest.payload.params[0].nonce if (initialNonce) { - txRequest.data.nonce = initialNonce + txRequest.data.nonce = initialNonce as PrefixedHexString } else { delete txRequest.data.nonce } diff --git a/main/contracts/erc20.ts b/main/contracts/erc20.ts index eb80af83d..712933083 100644 --- a/main/contracts/erc20.ts +++ b/main/contracts/erc20.ts @@ -1,11 +1,13 @@ +import provider from '../provider' import { TransactionDescription } from '@ethersproject/abi' import { Contract } from '@ethersproject/contracts' import { Web3Provider } from '@ethersproject/providers' import { addHexPrefix } from '@ethereumjs/util' -import provider from '../provider' import { BigNumber } from 'ethers' import { erc20Interface } from '../../resources/contracts' +import type { PrefixedHexString } from '@ethereumjs/util' + export interface TokenData { decimals?: number name: string @@ -75,7 +77,7 @@ export default class Erc20Contract { } static encodeCallData(fn: string, params: any[]) { - return erc20Interface.encodeFunctionData(fn, params) + return erc20Interface.encodeFunctionData(fn, params) as PrefixedHexString } async getTokenData(): Promise { diff --git a/main/provider/helpers.ts b/main/provider/helpers.ts index e4691d251..6e8606172 100644 --- a/main/provider/helpers.ts +++ b/main/provider/helpers.ts @@ -1,13 +1,13 @@ import { padToEven, - unpadHexString, addHexPrefix, stripHexPrefix, intToHex, - toBuffer, pubToAddress, ecrecover, - hashPersonalMessage + hashPersonalMessage, + toBytes, + unpadHex } from '@ethereumjs/util' import log from 'electron-log' import BN from 'bignumber.js' @@ -16,10 +16,12 @@ import { isHexString } from 'ethers/lib/utils' import store from '../store' import protectedMethods from '../api/protectedMethods' -import { usesBaseFee, TransactionData, GasFeesSource } from '../../resources/domain/transaction' +import { usesBaseFee, GasFeesSource } from '../../resources/domain/transaction' import { getAddress } from '../../resources/utils' -import type { Chain, Permission } from '../store/state' +import type { TransactionData } from '../../resources/domain/transaction' +import type { Chain } from '../store/state' +import type { PrefixedHexString } from '@ethereumjs/util' const permission = (date: number, method: string) => ({ parentCapability: method, date }) @@ -53,8 +55,8 @@ export function checkExistingNonceGas(tx: TransactionData) { // Bump fees by 10% const bumpedFee = Math.max(Math.ceil(existingFee * 1.1), feeInt) const bumpedBase = Math.max(Math.ceil((existingMax - existingFee) * 1.1), Math.ceil(maxInt - feeInt)) - tx.maxFeePerGas = '0x' + (bumpedBase + bumpedFee).toString(16) - tx.maxPriorityFeePerGas = '0x' + bumpedFee.toString(16) + tx.maxFeePerGas = intToHex(bumpedBase + bumpedFee) + tx.maxPriorityFeePerGas = intToHex(bumpedFee) tx.gasFeesSource = GasFeesSource.Frame tx.feesUpdated = true } @@ -64,7 +66,7 @@ export function checkExistingNonceGas(tx: TransactionData) { if (existingPrice >= priceInt) { // Bump price by 10% const bumpedPrice = Math.ceil(existingPrice * 1.1) - tx.gasPrice = '0x' + bumpedPrice.toString(16) + tx.gasPrice = intToHex(bumpedPrice) tx.gasFeesSource = GasFeesSource.Frame tx.feesUpdated = true } @@ -85,7 +87,7 @@ export function feeTotalOverMax(rawTx: TransactionData, maxTotalFee: number) { function parseValue(value = '') { const parsedHex = parseInt(value, 16) - return (!!parsedHex && addHexPrefix(unpadHexString(value))) || '0x0' + return (!!parsedHex && addHexPrefix(unpadHex(value))) || '0x0' } export function getRawTx(newTx: RPC.SendTransaction.TxParams): TransactionData { @@ -93,7 +95,7 @@ export function getRawTx(newTx: RPC.SendTransaction.TxParams): TransactionData { const getNonce = () => { // pass through hex string or undefined if (rawTx.nonce === undefined || isHexString(rawTx.nonce)) { - return rawTx.nonce + return rawTx.nonce as PrefixedHexString } // convert positive integer strings to hex, reject everything else @@ -106,15 +108,25 @@ export function getRawTx(newTx: RPC.SendTransaction.TxParams): TransactionData { const tx: TransactionData = { ...rawTx, + maxPriorityFeePerGas: isHexString(rawTx.maxPriorityFeePerGas) + ? (rawTx.maxPriorityFeePerGas as PrefixedHexString) + : intToHex(parseInt(rawTx.maxPriorityFeePerGas || '0', 10)), + maxFeePerGas: isHexString(rawTx.maxFeePerGas) + ? (rawTx.maxFeePerGas as PrefixedHexString) + : intToHex(parseInt(rawTx.maxFeePerGas || '0', 10)), + gasPrice: isHexString(rawTx.gasPrice) + ? (rawTx.gasPrice as PrefixedHexString) + : intToHex(parseInt(rawTx.gasPrice || '0', 10)), ...(from && { from: getAddress(from) }), ...(to && { to: getAddress(to) }), type: '0x0', value: parseValue(value), data: addHexPrefix(padToEven(stripHexPrefix(data || '0x'))), - gasLimit: gasLimit || gas, + gasLimit: (gasLimit || gas) as PrefixedHexString, chainId: rawTx.chainId, nonce: getNonce(), - gasFeesSource: GasFeesSource.Dapp + gasFeesSource: GasFeesSource.Dapp, + authorizationList: [] } return tx @@ -139,10 +151,12 @@ export function getSignedAddress(signed: string, message: string, cb: Callback { if (err) { @@ -427,7 +419,7 @@ export class Provider extends EventEmitter { return handlerId } - private async getGasEstimate(rawTx: TransactionData) { + private async getGasEstimate(rawTx: TransactionData): Promise { const { from, to, value, data, nonce } = rawTx const txParams = { from, to, value, data, nonce } @@ -443,7 +435,7 @@ export class Provider extends EventEmitter { id: parseInt(rawTx.chainId, 16) } - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { this.connection.send( payload, (response) => { @@ -496,7 +488,7 @@ export class Provider extends EventEmitter { const gas = gasFees(rawTx) const { chainConfig } = connection - const estimateGasLimit = async () => { + const estimateGasLimit = async (): Promise => { try { return await this.getGasEstimate(rawTx) } catch (error) { diff --git a/main/signers/Signer/derive.ts b/main/signers/Signer/derive.ts index 22cdddb56..c28c16910 100644 --- a/main/signers/Signer/derive.ts +++ b/main/signers/Signer/derive.ts @@ -16,8 +16,8 @@ export function deriveHDAccounts(publicKey: string, chainCode: string, cb: Callb hdk.chainCode = Buffer.from(chainCode, 'hex') const derive = (index: number) => { const derivedKey = hdk.derive(`m/${index}`) - const address = publicToAddress(derivedKey.publicKey, true) - return toChecksumAddress(`0x${address.toString('hex')}`) + const address = Buffer.from(publicToAddress(derivedKey.publicKey, true)).toString('hex') + return toChecksumAddress(`0x${address}`) } const accounts = [] for (let i = 0; i < 100; i++) { diff --git a/main/signers/hot/HotSigner/worker.js b/main/signers/hot/HotSigner/worker.js index 5c4aa8299..f6a183eef 100644 --- a/main/signers/hot/HotSigner/worker.js +++ b/main/signers/hot/HotSigner/worker.js @@ -72,7 +72,7 @@ class HotSignerWorker { } const chainId = parseInt(rawTx.chainId, 16) - const hardfork = parseInt(rawTx.type) === 2 ? 'london' : 'berlin' + const hardfork = parseInt(rawTx.type) === 2 ? 'london' : parseInt(rawTx.type) === 4 ? 'pectra' : 'london' const common = chainConfig(chainId, hardfork) const tx = TransactionFactory.fromTxData(rawTx, { common }) diff --git a/main/signers/lattice/Lattice/index.ts b/main/signers/lattice/Lattice/index.ts index ad821353e..a1dc04813 100644 --- a/main/signers/lattice/Lattice/index.ts +++ b/main/signers/lattice/Lattice/index.ts @@ -309,7 +309,10 @@ export default class Lattice extends Signer { } }) - cb(null, addHexPrefix(signedTx.serialize().toString('hex'))) + const serializedTx = signedTx.serialize() + const txHex = addHexPrefix(Buffer.from(serializedTx).toString('hex')) + + cb(null, txHex) } catch (err) { log.error('error signing transaction with Lattice', err) const latticeErrorMessage = (err as LatticeResponseError).errorMessage @@ -386,7 +389,8 @@ export default class Lattice extends Signer { const fwVersion = (this.connection as Client).getFwVersion() if (fwVersion && (fwVersion.major > 0 || fwVersion.minor >= 15)) { - const payload = tx.type ? tx.getMessageToSign(false) : encode(tx.getMessageToSign(false)) + const message = tx.getMessageToSign() + const payload = tx.type ? message : encode(message) const to = tx.to?.toString() ?? undefined diff --git a/main/signers/ledger/Ledger/eth.ts b/main/signers/ledger/Ledger/eth.ts index 1e077375e..b68e7bf14 100644 --- a/main/signers/ledger/Ledger/eth.ts +++ b/main/signers/ledger/Ledger/eth.ts @@ -1,9 +1,9 @@ import log from 'electron-log' +import Transport from '@ledgerhq/hw-transport' +import Eth from '@ledgerhq/hw-app-eth' import { encode } from 'rlp' import { addHexPrefix, stripHexPrefix, padToEven } from '@ethereumjs/util' import { SignTypedDataVersion, TypedDataUtils } from '@metamask/eth-sig-util' -import Transport from '@ledgerhq/hw-transport' -import Eth from '@ledgerhq/hw-app-eth' import { Derivation, getDerivationPath, deriveHDAccounts } from '../../Signer/derive' import { sign } from '../../../transaction' @@ -82,14 +82,17 @@ export default class LedgerEthereumApp { async signTransaction(path: string, ledgerTx: TransactionData) { const signedTx = await sign(ledgerTx, (tx) => { // legacy transactions aren't RLP encoded before they're returned - const message = tx.getMessageToSign(false) + const message = Buffer.from(tx.getHashedMessageToSign()) const legacyMessage = message[0] !== tx.type const rawTxHex = legacyMessage ? Buffer.from(encode(message)).toString('hex') : message.toString('hex') return this.eth.signTransaction(path, rawTxHex, null) }) - return addHexPrefix(signedTx.serialize().toString('hex')) + const serializedTx = signedTx.serialize() + const txHex = addHexPrefix(Buffer.from(serializedTx).toString('hex')) + + return txHex } async getAddress(path: string, display: boolean, chainCode: boolean) { diff --git a/main/signers/trezor/Trezor/index.ts b/main/signers/trezor/Trezor/index.ts index a8865e3eb..588858658 100644 --- a/main/signers/trezor/Trezor/index.ts +++ b/main/signers/trezor/Trezor/index.ts @@ -321,7 +321,10 @@ export default class Trezor extends Signer { } }) - cb(null, addHexPrefix(signedTx.serialize().toString('hex'))) + const serializedTx = signedTx.serialize() + const txHex = addHexPrefix(Buffer.from(serializedTx).toString('hex')) + + cb(null, txHex) } catch (e: unknown) { const err = e as DeviceError cb(err) diff --git a/main/transaction/index.ts b/main/transaction/index.ts index c4d25b0f1..54155e601 100644 --- a/main/transaction/index.ts +++ b/main/transaction/index.ts @@ -1,12 +1,12 @@ import BigNumber from 'bignumber.js' -import { addHexPrefix, intToHex } from '@ethereumjs/util' +import { addHexPrefix, intToHex, PrefixedHexString } from '@ethereumjs/util' import { TransactionFactory, TypedTransaction } from '@ethereumjs/tx' import { Common } from '@ethereumjs/common' +import chainConfig from '../chains/config' import { AppVersion, SignerSummary } from '../signers/Signer' import { GasFeesSource, TransactionData, typeSupportsBaseFee } from '../../resources/domain/transaction' import { isNonZeroHex } from '../../resources/utils' -import chainConfig from '../chains/config' import { TransactionRequest, TxClassification } from '../accounts/types' import type { Gas } from '../store/state' @@ -115,7 +115,7 @@ function populate(rawTx: TransactionData, chainConfig: Common, gas: Gas): Transa } // EIP-1559 case - txData.type = intToHex(2) + txData.type = parseInt(txData.type) === 4 ? intToHex(4) : intToHex(2) const useFrameMaxFeePerGas = !rawTx.maxFeePerGas || isNaN(parseInt(rawTx.maxFeePerGas, 16)) const useFrameMaxPriorityFeePerGas = @@ -144,8 +144,8 @@ function populate(rawTx: TransactionData, chainConfig: Common, gas: Gas): Transa // if no valid dapp-supplied value for maxPriorityFeePerGas we use the Frame-supplied value txData.maxPriorityFeePerGas = useFrameMaxPriorityFeePerGas - ? addHexPrefix(BigNumber(maxPriorityFee).toString(16)) - : txData.maxPriorityFeePerGas + ? (addHexPrefix(BigNumber(maxPriorityFee).toString(16)) as PrefixedHexString) + : (txData.maxPriorityFeePerGas as PrefixedHexString) return txData } diff --git a/package-lock.json b/package-lock.json index 29f1c9b04..b3df4a00b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,9 @@ "license": "GPL-3.0", "dependencies": { "@eth-optimism/sdk": "3.2.0", - "@ethereumjs/common": "3.1.1", - "@ethereumjs/tx": "4.1.1", - "@ethereumjs/util": "8.0.3", + "@ethereumjs/common": "4.4.0", + "@ethereumjs/tx": "5.4.0", + "@ethereumjs/util": "9.1.0", "@ethersproject/contracts": "5.7.0", "@ethersproject/providers": "5.7.2", "@framelabs/pylon-client": "0.0.10", @@ -2109,29 +2109,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/@chainsafe/as-sha256": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", - "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==" - }, - "node_modules/@chainsafe/persistent-merkle-tree": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", - "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1" - } - }, - "node_modules/@chainsafe/ssz": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", - "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", - "dependencies": { - "@chainsafe/as-sha256": "^0.3.1", - "@chainsafe/persistent-merkle-tree": "^0.4.2", - "case": "^1.6.3" - } - }, "node_modules/@colors/colors": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", @@ -2875,28 +2852,50 @@ } }, "node_modules/@ethereumjs/common": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-3.1.1.tgz", - "integrity": "sha512-iEl4gQtcrj2udNhEizs04z7WA15ez1QoXL0XzaCyaNgwRyXezIg1DnfNeZUUpJnkrOF/0rYXyq2UFSLxt1NPQg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-4.4.0.tgz", + "integrity": "sha512-Fy5hMqF6GsE6DpYTyqdDIJPJgUtDn4dL120zKw+Pswuo+iLyBsEYuSyzMw6NVzD2vDzcBG9fE4+qX4X2bPc97w==", "dependencies": { - "@ethereumjs/util": "^8.0.5", - "crc-32": "^1.2.0" + "@ethereumjs/util": "^9.1.0" } }, - "node_modules/@ethereumjs/common/node_modules/@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "dependencies": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" + "node_modules/@ethereumjs/rlp": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", + "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", + "bin": { + "rlp": "bin/rlp" }, "engines": { "node": ">=14" } }, - "node_modules/@ethereumjs/common/node_modules/@noble/hashes": { + "node_modules/@ethereumjs/tx": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-5.4.0.tgz", + "integrity": "sha512-SCHnK7m/AouZ7nyoR0MEXw1OO/tQojSbp88t8oxhwes5iZkZCtfFdUrJaiIb72qIpH2FVw6s1k1uP7LXuH7PsA==", + "dependencies": { + "@ethereumjs/common": "^4.4.0", + "@ethereumjs/rlp": "^5.0.2", + "@ethereumjs/util": "^9.1.0", + "ethereum-cryptography": "^2.2.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@ethereumjs/tx/node_modules/@ethereumjs/rlp": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", + "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==", + "bin": { + "rlp": "bin/rlp.cjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@ethereumjs/tx/node_modules/@noble/hashes": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", @@ -2907,7 +2906,7 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@ethereumjs/common/node_modules/@scure/bip32": { + "node_modules/@ethereumjs/tx/node_modules/@scure/bip32": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", @@ -2920,7 +2919,7 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@ethereumjs/common/node_modules/@scure/bip39": { + "node_modules/@ethereumjs/tx/node_modules/@scure/bip39": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", @@ -2932,7 +2931,7 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@ethereumjs/common/node_modules/ethereum-cryptography": { + "node_modules/@ethereumjs/tx/node_modules/ethereum-cryptography": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", @@ -2943,66 +2942,30 @@ "@scure/bip39": "1.3.0" } }, - "node_modules/@ethereumjs/rlp": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", - "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@ethereumjs/tx": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-4.1.1.tgz", - "integrity": "sha512-QDj7nuROfoeyK83RObMA0XCZ+LUDdneNkSCIekO498uEKTY25FxI4Whduc/6j0wdd4IqpQvkq+/7vxSULjGIBQ==", + "node_modules/@ethereumjs/util": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.1.0.tgz", + "integrity": "sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==", "dependencies": { - "@chainsafe/ssz": "0.9.4", - "@ethereumjs/common": "^3.1.1", - "@ethereumjs/rlp": "^4.0.1", - "@ethereumjs/util": "^8.0.5", - "@ethersproject/providers": "^5.7.2", - "ethereum-cryptography": "^1.1.2" + "@ethereumjs/rlp": "^5.0.2", + "ethereum-cryptography": "^2.2.1" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "c-kzg": "^1.0.8" - }, - "peerDependenciesMeta": { - "c-kzg": { - "optional": true - } + "node": ">=18" } }, - "node_modules/@ethereumjs/tx/node_modules/@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "dependencies": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" + "node_modules/@ethereumjs/util/node_modules/@ethereumjs/rlp": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", + "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==", + "bin": { + "rlp": "bin/rlp.cjs" }, "engines": { - "node": ">=14" - } - }, - "node_modules/@ethereumjs/tx/node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "dependencies": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" + "node": ">=18" } }, - "node_modules/@ethereumjs/tx/node_modules/@noble/hashes": { + "node_modules/@ethereumjs/util/node_modules/@noble/hashes": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", @@ -3013,7 +2976,7 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@ethereumjs/tx/node_modules/@scure/bip32": { + "node_modules/@ethereumjs/util/node_modules/@scure/bip32": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", @@ -3026,7 +2989,7 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@ethereumjs/tx/node_modules/@scure/bip39": { + "node_modules/@ethereumjs/util/node_modules/@scure/bip39": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", @@ -3038,17 +3001,15 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@ethereumjs/util": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.0.3.tgz", - "integrity": "sha512-0apCbwc8xAaie6W7q6QyogfyRS2BMU816a8KwpnpRw9Qrc6Bws+l7J3LfCLMt2iL6Wi8CYb0B29AeIr2N4vHnw==", + "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", "dependencies": { - "@ethereumjs/rlp": "^4.0.0-beta.2", - "async": "^3.2.4", - "ethereum-cryptography": "^1.1.2" - }, - "engines": { - "node": ">=14" + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" } }, "node_modules/@ethersproject/abi": { @@ -4947,6 +4908,66 @@ "node": ">=14.0.0" } }, + "node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", + "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", + "dependencies": { + "@ethereumjs/rlp": "^4.0.1", + "ethereum-cryptography": "^2.0.0", + "micro-ftch": "^0.3.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@metamask/eth-sig-util/node_modules/bn.js": { "version": "4.12.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", @@ -9872,98 +9893,6 @@ "tslib": "^2.6.2" } }, - "node_modules/@trezor/connect/node_modules/@ethereumjs/common": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-4.4.0.tgz", - "integrity": "sha512-Fy5hMqF6GsE6DpYTyqdDIJPJgUtDn4dL120zKw+Pswuo+iLyBsEYuSyzMw6NVzD2vDzcBG9fE4+qX4X2bPc97w==", - "dependencies": { - "@ethereumjs/util": "^9.1.0" - } - }, - "node_modules/@trezor/connect/node_modules/@ethereumjs/rlp": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", - "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==", - "bin": { - "rlp": "bin/rlp.cjs" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@trezor/connect/node_modules/@ethereumjs/tx": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-5.4.0.tgz", - "integrity": "sha512-SCHnK7m/AouZ7nyoR0MEXw1OO/tQojSbp88t8oxhwes5iZkZCtfFdUrJaiIb72qIpH2FVw6s1k1uP7LXuH7PsA==", - "dependencies": { - "@ethereumjs/common": "^4.4.0", - "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.1.0", - "ethereum-cryptography": "^2.2.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@trezor/connect/node_modules/@ethereumjs/util": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.1.0.tgz", - "integrity": "sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==", - "dependencies": { - "@ethereumjs/rlp": "^5.0.2", - "ethereum-cryptography": "^2.2.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@trezor/connect/node_modules/@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@trezor/connect/node_modules/@scure/bip32": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", - "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", - "dependencies": { - "@noble/curves": "~1.4.0", - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@trezor/connect/node_modules/@scure/bip39": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", - "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", - "dependencies": { - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@trezor/connect/node_modules/ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "dependencies": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" - } - }, "node_modules/@trezor/env-utils": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@trezor/env-utils/-/env-utils-1.2.1.tgz", @@ -12537,14 +12466,6 @@ } ] }, - "node_modules/case": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", - "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -16597,14 +16518,6 @@ "uuid": "^10.0.0" } }, - "node_modules/gridplus-sdk/node_modules/@ethereumjs/common": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-4.4.0.tgz", - "integrity": "sha512-Fy5hMqF6GsE6DpYTyqdDIJPJgUtDn4dL120zKw+Pswuo+iLyBsEYuSyzMw6NVzD2vDzcBG9fE4+qX4X2bPc97w==", - "dependencies": { - "@ethereumjs/util": "^9.1.0" - } - }, "node_modules/gridplus-sdk/node_modules/@ethereumjs/rlp": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", @@ -16616,32 +16529,6 @@ "node": ">=18" } }, - "node_modules/gridplus-sdk/node_modules/@ethereumjs/tx": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-5.4.0.tgz", - "integrity": "sha512-SCHnK7m/AouZ7nyoR0MEXw1OO/tQojSbp88t8oxhwes5iZkZCtfFdUrJaiIb72qIpH2FVw6s1k1uP7LXuH7PsA==", - "dependencies": { - "@ethereumjs/common": "^4.4.0", - "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.1.0", - "ethereum-cryptography": "^2.2.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/gridplus-sdk/node_modules/@ethereumjs/util": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.1.0.tgz", - "integrity": "sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==", - "dependencies": { - "@ethereumjs/rlp": "^5.0.2", - "ethereum-cryptography": "^2.2.1" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/gridplus-sdk/node_modules/@metamask/eth-sig-util": { "version": "8.1.2", "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-8.1.2.tgz", @@ -29475,29 +29362,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "@chainsafe/as-sha256": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", - "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==" - }, - "@chainsafe/persistent-merkle-tree": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", - "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", - "requires": { - "@chainsafe/as-sha256": "^0.3.1" - } - }, - "@chainsafe/ssz": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", - "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", - "requires": { - "@chainsafe/as-sha256": "^0.3.1", - "@chainsafe/persistent-merkle-tree": "^0.4.2", - "case": "^1.6.3" - } - }, "@colors/colors": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", @@ -30107,23 +29971,33 @@ } }, "@ethereumjs/common": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-3.1.1.tgz", - "integrity": "sha512-iEl4gQtcrj2udNhEizs04z7WA15ez1QoXL0XzaCyaNgwRyXezIg1DnfNeZUUpJnkrOF/0rYXyq2UFSLxt1NPQg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-4.4.0.tgz", + "integrity": "sha512-Fy5hMqF6GsE6DpYTyqdDIJPJgUtDn4dL120zKw+Pswuo+iLyBsEYuSyzMw6NVzD2vDzcBG9fE4+qX4X2bPc97w==", "requires": { - "@ethereumjs/util": "^8.0.5", - "crc-32": "^1.2.0" + "@ethereumjs/util": "^9.1.0" + } + }, + "@ethereumjs/rlp": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", + "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==" + }, + "@ethereumjs/tx": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-5.4.0.tgz", + "integrity": "sha512-SCHnK7m/AouZ7nyoR0MEXw1OO/tQojSbp88t8oxhwes5iZkZCtfFdUrJaiIb72qIpH2FVw6s1k1uP7LXuH7PsA==", + "requires": { + "@ethereumjs/common": "^4.4.0", + "@ethereumjs/rlp": "^5.0.2", + "@ethereumjs/util": "^9.1.0", + "ethereum-cryptography": "^2.2.1" }, "dependencies": { - "@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "requires": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" - } + "@ethereumjs/rlp": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", + "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==" }, "@noble/hashes": { "version": "1.4.0", @@ -30162,46 +30036,19 @@ } } }, - "@ethereumjs/rlp": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", - "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==" - }, - "@ethereumjs/tx": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-4.1.1.tgz", - "integrity": "sha512-QDj7nuROfoeyK83RObMA0XCZ+LUDdneNkSCIekO498uEKTY25FxI4Whduc/6j0wdd4IqpQvkq+/7vxSULjGIBQ==", + "@ethereumjs/util": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.1.0.tgz", + "integrity": "sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==", "requires": { - "@chainsafe/ssz": "0.9.4", - "@ethereumjs/common": "^3.1.1", - "@ethereumjs/rlp": "^4.0.1", - "@ethereumjs/util": "^8.0.5", - "@ethersproject/providers": "^5.7.2", - "ethereum-cryptography": "^1.1.2" + "@ethereumjs/rlp": "^5.0.2", + "ethereum-cryptography": "^2.2.1" }, "dependencies": { - "@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "requires": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" - }, - "dependencies": { - "ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "requires": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" - } - } - } + "@ethereumjs/rlp": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", + "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==" }, "@noble/hashes": { "version": "1.4.0", @@ -30226,19 +30073,20 @@ "@noble/hashes": "~1.4.0", "@scure/base": "~1.1.6" } + }, + "ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "requires": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } } } }, - "@ethereumjs/util": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.0.3.tgz", - "integrity": "sha512-0apCbwc8xAaie6W7q6QyogfyRS2BMU816a8KwpnpRw9Qrc6Bws+l7J3LfCLMt2iL6Wi8CYb0B29AeIr2N4vHnw==", - "requires": { - "@ethereumjs/rlp": "^4.0.0-beta.2", - "async": "^3.2.4", - "ethereum-cryptography": "^1.1.2" - } - }, "@ethersproject/abi": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", @@ -31563,6 +31411,53 @@ "tweetnacl-util": "^0.15.1" }, "dependencies": { + "@ethereumjs/util": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", + "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", + "requires": { + "@ethereumjs/rlp": "^4.0.1", + "ethereum-cryptography": "^2.0.0", + "micro-ftch": "^0.3.1" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "requires": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + } + } + }, + "@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==" + }, + "@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "requires": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + } + }, + "@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "requires": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + } + }, "bn.js": { "version": "4.12.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", @@ -34852,76 +34747,6 @@ "bs58": "^6.0.0", "bs58check": "^4.0.0", "cross-fetch": "^4.0.0" - }, - "dependencies": { - "@ethereumjs/common": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-4.4.0.tgz", - "integrity": "sha512-Fy5hMqF6GsE6DpYTyqdDIJPJgUtDn4dL120zKw+Pswuo+iLyBsEYuSyzMw6NVzD2vDzcBG9fE4+qX4X2bPc97w==", - "requires": { - "@ethereumjs/util": "^9.1.0" - } - }, - "@ethereumjs/rlp": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", - "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==" - }, - "@ethereumjs/tx": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-5.4.0.tgz", - "integrity": "sha512-SCHnK7m/AouZ7nyoR0MEXw1OO/tQojSbp88t8oxhwes5iZkZCtfFdUrJaiIb72qIpH2FVw6s1k1uP7LXuH7PsA==", - "requires": { - "@ethereumjs/common": "^4.4.0", - "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.1.0", - "ethereum-cryptography": "^2.2.1" - } - }, - "@ethereumjs/util": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.1.0.tgz", - "integrity": "sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==", - "requires": { - "@ethereumjs/rlp": "^5.0.2", - "ethereum-cryptography": "^2.2.1" - } - }, - "@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==" - }, - "@scure/bip32": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", - "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", - "requires": { - "@noble/curves": "~1.4.0", - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - } - }, - "@scure/bip39": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", - "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", - "requires": { - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - } - }, - "ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "requires": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" - } - } } }, "@trezor/connect-analytics": { @@ -36982,11 +36807,6 @@ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001692.tgz", "integrity": "sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A==" }, - "case": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", - "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==" - }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -40157,39 +39977,11 @@ "uuid": "^10.0.0" }, "dependencies": { - "@ethereumjs/common": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-4.4.0.tgz", - "integrity": "sha512-Fy5hMqF6GsE6DpYTyqdDIJPJgUtDn4dL120zKw+Pswuo+iLyBsEYuSyzMw6NVzD2vDzcBG9fE4+qX4X2bPc97w==", - "requires": { - "@ethereumjs/util": "^9.1.0" - } - }, "@ethereumjs/rlp": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==" }, - "@ethereumjs/tx": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-5.4.0.tgz", - "integrity": "sha512-SCHnK7m/AouZ7nyoR0MEXw1OO/tQojSbp88t8oxhwes5iZkZCtfFdUrJaiIb72qIpH2FVw6s1k1uP7LXuH7PsA==", - "requires": { - "@ethereumjs/common": "^4.4.0", - "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.1.0", - "ethereum-cryptography": "^2.2.1" - } - }, - "@ethereumjs/util": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.1.0.tgz", - "integrity": "sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==", - "requires": { - "@ethereumjs/rlp": "^5.0.2", - "ethereum-cryptography": "^2.2.1" - } - }, "@metamask/eth-sig-util": { "version": "8.1.2", "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-8.1.2.tgz", diff --git a/package.json b/package.json index dbeb5ce08..70055928b 100644 --- a/package.json +++ b/package.json @@ -62,9 +62,9 @@ "license": "GPL-3.0", "dependencies": { "@eth-optimism/sdk": "3.2.0", - "@ethereumjs/common": "3.1.1", - "@ethereumjs/tx": "4.1.1", - "@ethereumjs/util": "8.0.3", + "@ethereumjs/common": "4.4.0", + "@ethereumjs/tx": "5.4.0", + "@ethereumjs/util": "9.1.0", "@ethersproject/contracts": "5.7.0", "@ethersproject/providers": "5.7.2", "@framelabs/pylon-client": "0.0.10", diff --git a/resources/domain/transaction/index.ts b/resources/domain/transaction/index.ts index 39b550e6e..fd27b2821 100644 --- a/resources/domain/transaction/index.ts +++ b/resources/domain/transaction/index.ts @@ -1,6 +1,8 @@ import { JsonTx } from '@ethereumjs/tx' import { addHexPrefix, isHexString } from '@ethereumjs/util' +import type { PrefixedHexString } from '@ethereumjs/util' + export enum GasFeesSource { Dapp = 'Dapp', Frame = 'Frame' @@ -12,7 +14,7 @@ export interface TransactionData extends Omit { from?: string feesUpdated?: boolean chainId: string - type: string + type: PrefixedHexString gasFeesSource: GasFeesSource recipientType?: string } diff --git a/resources/utils/index.ts b/resources/utils/index.ts index fafef6b41..b138116f8 100644 --- a/resources/utils/index.ts +++ b/resources/utils/index.ts @@ -1,5 +1,5 @@ import { randomInt } from 'crypto' -import { addHexPrefix, intToHex, stripHexPrefix } from '@ethereumjs/util' +import { addHexPrefix, intToHex, PrefixedHexString, stripHexPrefix } from '@ethereumjs/util' import { getAddress as getChecksumAddress } from '@ethersproject/address' const weiToGwei = (wei: number) => wei / 1e9 @@ -82,11 +82,11 @@ const matchFilter = (filter = '', properties: string[] = []) => { } function getAddress(address: Address) { - const lowerCaseAddress = address.toLowerCase() + const lowerCaseAddress = address.toLowerCase() as PrefixedHexString try { // this will throw if the address can't be checksummed - return getChecksumAddress(lowerCaseAddress) + return getChecksumAddress(lowerCaseAddress) as PrefixedHexString } catch (e) { console.warn(`could not checksum address ${address}, using lowercase address`, e) return lowerCaseAddress