Skip to content

Commit f4887ef

Browse files
temp: export shared types [no ci]
1 parent 787c27a commit f4887ef

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

packages/tx/src/types.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Line is added so I can open a placeholder PR on github [REMOVE ME]
12
import { bytesToBigInt, toBytes } from '@ethereumjs/util'
23

34
import type { FeeMarket1559Tx } from './1559/tx.js'
@@ -617,3 +618,56 @@ export type AuthorizationListBytesItem = [
617618
]
618619
export type AuthorizationListBytes = AuthorizationListBytesItem[]
619620
export type AuthorizationList = AuthorizationListItem[]
621+
622+
type NestedUint8Array = (Uint8Array | NestedUint8Array)[]
623+
624+
// This is all necessary in Block
625+
export interface MinimalTxInterfaceBlock {
626+
supports(capability: Capability): boolean
627+
serialize(): Uint8Array
628+
raw(): NestedUint8Array // TODO make more explicit, can deduce exactly what the raw returns
629+
toJSON(): any // more typesafe
630+
631+
// Properties
632+
maxFeePerGas: bigint
633+
gasPrice: bigint
634+
numBlobs: number
635+
maxFeePerBlobGas: bigint
636+
blobVersionedHashes: Uint8Array[]
637+
638+
// Can likely throw out
639+
getValidationErrors(): string
640+
isSigned(): boolean
641+
}
642+
643+
// This is all necessary in VM
644+
export interface MinimalTxInterfaceVM {
645+
hash(): Uint8Array // Only used in debug logger !?
646+
supports(capability: Capability): boolean
647+
getSenderAddress(): Address
648+
isSigned(): boolean // Only used in debug logger !?
649+
getIntrinsicGas(): bigint
650+
getUpfrontCost(): bigint
651+
getEffectivePriorityFee(): bigint
652+
serialize(): Uint8Array
653+
654+
// Properties
655+
common: Common
656+
gasLimit: bigint
657+
gasPrice: bigint
658+
maxFeePerGas: bigint
659+
maxFeePerBlobGas: bigint
660+
numBlobs: number
661+
data: Uint8Array
662+
AccessListJSON: any // Todo type
663+
authorizationList: any // Todo type
664+
to: Address | undefined | null // Note null got added here
665+
value: bigint
666+
nonce: bigint
667+
blobVersionedHashes: Uint8Array[]
668+
type: number
669+
blobs: any // Todo type
670+
671+
// Can likely throw out
672+
errorStr(): string
673+
}

0 commit comments

Comments
 (0)