BaseClientOptions
BaseClientOptions<
TChain
>:StateOptions
&object
Options for creating an Tevm MemoryClient instance
Type declaration
allowUnlimitedContractSize?
optional
readonly
allowUnlimitedContractSize:boolean
Enable/disable unlimited contract size. Defaults to false.
chainCommon?
optional
readonly
chainCommon:TevmChainCommon
<TChain
>
The chain of the blockchain. Defaults to tevmDevnet. Required for some APIs such as getEnsAddress
to work.
Highly recomended you always set this in fork mode as it will speed up client creation via not having to fetch the chain info
Example
`
customCrypto?
optional
readonly
customCrypto:CustomCrypto
Custom crypto functionality provided to the EVM. For 4844 support, kzg must be passed.
customPrecompiles?
optional
readonly
customPrecompiles:CustomPrecompile
[]
Custom precompiles allow you to run arbitrary JavaScript code in the EVM.
See the Precompile guide documentation for a deeper dive
An ever growing standard library of precompiles is provided at tevm/precompiles
Notice
Not implemented yet Implementation pr
Below example shows how to make a precompile so you can call fs.writeFile
and fs.readFile
in your contracts.
Note: this specific precompile is also provided in the standard library
For security precompiles can only be added statically when the vm is created.
Example
eips?
optional
readonly
eips:ReadonlyArray
<number
>
Eips to enable. Defaults to [1559, 4895]
hardfork?
optional
readonly
hardfork:Hardfork
Hardfork to use. Defaults to shanghai
loggingLevel?
optional
readonly
loggingLevel:LogOptions
["level"
]
Configure logging options for the client
miningConfig?
optional
readonly
miningConfig:MiningConfig
The configuration for mining. Defaults to ‘auto'
- 'auto’ will mine a block on every transaction
- ’interval’ will mine a block every
interval
milliseconds - ’manual’ will not mine a block automatically and requires a manual call to
mineBlock
persister?
optional
readonly
persister:SyncStoragePersister
The memory client can optionally initialize and persist it’s state to an external source like local storage
using createSyncPersister
Example
profiler?
optional
readonly
profiler:boolean
Enable profiler. Defaults to false.
Type parameters
• TChain extends ViemChain
= ViemChain
Source
BaseClientOptions.ts:14