Skip to content

Commit

Permalink
temp: export shared types [no ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
jochem-brouwer committed Oct 9, 2024
1 parent 787c27a commit f4887ef
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions packages/tx/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Line is added so I can open a placeholder PR on github [REMOVE ME]
import { bytesToBigInt, toBytes } from '@ethereumjs/util'

import type { FeeMarket1559Tx } from './1559/tx.js'
Expand Down Expand Up @@ -617,3 +618,56 @@ export type AuthorizationListBytesItem = [
]
export type AuthorizationListBytes = AuthorizationListBytesItem[]
export type AuthorizationList = AuthorizationListItem[]

type NestedUint8Array = (Uint8Array | NestedUint8Array)[]

// This is all necessary in Block
export interface MinimalTxInterfaceBlock {
supports(capability: Capability): boolean
serialize(): Uint8Array
raw(): NestedUint8Array // TODO make more explicit, can deduce exactly what the raw returns
toJSON(): any // more typesafe

// Properties
maxFeePerGas: bigint
gasPrice: bigint
numBlobs: number
maxFeePerBlobGas: bigint
blobVersionedHashes: Uint8Array[]

// Can likely throw out
getValidationErrors(): string
isSigned(): boolean
}

// This is all necessary in VM
export interface MinimalTxInterfaceVM {
hash(): Uint8Array // Only used in debug logger !?
supports(capability: Capability): boolean
getSenderAddress(): Address
isSigned(): boolean // Only used in debug logger !?
getIntrinsicGas(): bigint
getUpfrontCost(): bigint
getEffectivePriorityFee(): bigint
serialize(): Uint8Array

// Properties
common: Common
gasLimit: bigint
gasPrice: bigint
maxFeePerGas: bigint
maxFeePerBlobGas: bigint
numBlobs: number
data: Uint8Array
AccessListJSON: any // Todo type
authorizationList: any // Todo type
to: Address | undefined | null // Note null got added here
value: bigint
nonce: bigint
blobVersionedHashes: Uint8Array[]
type: number
blobs: any // Todo type

// Can likely throw out
errorStr(): string
}

0 comments on commit f4887ef

Please sign in to comment.