|
| 1 | +// Line is added so I can open a placeholder PR on github [REMOVE ME] |
1 | 2 | import { bytesToBigInt, toBytes } from '@ethereumjs/util' |
2 | 3 |
|
3 | 4 | import type { FeeMarket1559Tx } from './1559/tx.js' |
@@ -617,3 +618,56 @@ export type AuthorizationListBytesItem = [ |
617 | 618 | ] |
618 | 619 | export type AuthorizationListBytes = AuthorizationListBytesItem[] |
619 | 620 | 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