Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 4a942f4

Browse files
committed
Fix nextjs problem
1 parent e746566 commit 4a942f4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

packages/web3-eth-accounts/src/tx/transactionFactory.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@ import type {
3131
} from './types.js';
3232
import { BaseTransaction } from './baseTransaction.js';
3333

34-
let extraTxTypes: Map<Numbers, typeof BaseTransaction<unknown>>;
35-
// use the global object, to work fine even if web3-eth and web3-eth-accounts was on a different versions:
36-
const typedGlobal = global as unknown as {extraTxTypes: Map<Numbers, typeof BaseTransaction<unknown>>}
37-
if (!typedGlobal.extraTxTypes) {
38-
extraTxTypes = new Map();
39-
typedGlobal.extraTxTypes = extraTxTypes;
40-
} else {
41-
extraTxTypes = typedGlobal.extraTxTypes;
42-
}
34+
const extraTxTypes: Map<Numbers, typeof BaseTransaction<unknown>> = new Map();
4335

4436
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
4537
export class TransactionFactory {
@@ -145,7 +137,7 @@ export class TransactionFactory {
145137
*/
146138
public static fromBlockBodyData(data: Uint8Array | Uint8Array[], txOptions: TxOptions = {}) {
147139
if (isUint8Array(data)) {
148-
return this.fromSerializedData(data , txOptions);
140+
return this.fromSerializedData(data, txOptions);
149141
}
150142
if (Array.isArray(data)) {
151143
// It is a legacy transaction

0 commit comments

Comments
 (0)