Skip to content

Commit 109e3e9

Browse files
Apply suggestions from code review
Co-authored-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com>
1 parent 08a245c commit 109e3e9

File tree

2 files changed

+41
-40
lines changed

2 files changed

+41
-40
lines changed

docs/whats-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ of the [MetaMask developer page](https://metamask.io/developer/).
1111

1212
## January 2025
1313

14-
- Documented Infura support for the [`eth_simulateV1`] method. ([#1798](https://github.com/MetaMask/metamask-docs/pull/1798))
14+
- Documented [`eth_simulateV1`](/services/reference/ethereum/json-rpc-methods/eth_simulatev1). ([#1798](https://github.com/MetaMask/metamask-docs/pull/1798))
1515

1616
## December 2024
1717

services/reference/ethereum/json-rpc-methods/eth_simulatev1.mdx

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "eth_simulateV1"
55
import Tabs from '@theme/Tabs';
66
import TabItem from '@theme/TabItem';
77

8-
Simulate transactions across multiple blocks. Allows you to test transactions with custom state and
8+
Simulates transactions across multiple blocks. Allows you to test transactions with custom state and
99
block parameters without submitting them to the network.
1010

1111
:::info important
@@ -26,7 +26,7 @@ assessing the `blockStateCalls` array of objects.
2626
- `gasLimit`: (string) Hexadecimal value that represents the maximum amount of gas that transactions
2727
are allowed to consume.
2828
- `number`: (string) Hexadecimal block number.
29-
- `prevRandao` (string) The previous value of randomness, which is
29+
- `prevRandao`: (string) The previous value of randomness, which is
3030
used as a source of randomness for various protocol operations.
3131
- `time`: (string) Hexadecimal value representing the Unix epoch time in seconds.
3232
- `stateOverrides`: _\[optional]_ Object to override account states:
@@ -37,7 +37,7 @@ assessing the `blockStateCalls` array of objects.
3737
before executing the call.
3838
- `stateDiff`: Object of key-value mappings to override individual slots in the account
3939
storage before executing the call.
40-
- `movePrecompileToAddress` (string) Moves the precompile to the supplied address.
40+
- `movePrecompileToAddress`: (string) Moves the precompile to the supplied address.
4141
- `calls`: _\[required]_ Array of transaction call objects:
4242
- `from`: _\[optional]_ 20 bytes - The address the transaction is sent from.
4343
- `to`: _\[optional]_ 20 bytes - The address the transaction is directed to.
@@ -53,7 +53,7 @@ assessing the `blockStateCalls` array of objects.
5353
- `traceTransfers`: _\[optional]_ Boolean value which when `true`, adds ETH transfers as ERC20 transfer
5454
events to the logs, allowing you to trace value transfers. The default is `false`.
5555
- `validation`: _\[optional]_ Boolean value which when `true`, does all the validation that a
56-
normal EVM would do, except contract sender and signature checks. When false, `eth_simulateV1` behaves like `eth_call`.
56+
normal EVM would do, except contract sender and signature checks. When `false`, `eth_simulateV1` behaves like `eth_call`.
5757
The default is `false`.
5858
- `blockParameter`: (string) [_optional_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
5959

@@ -100,10 +100,10 @@ An array of simulation result objects:
100100
- `stateRoot`: The root of the final state trie of the block.
101101
- `timestamp`: The unix timestamp for when the block was collated.
102102
- `totalDifficulty`: A hexadecimal of the total difficulty of the chain until this block.
103-
- `transactions`: [Array] An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
103+
- `transactions`: (Array) An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
104104
- `transactionsRoot`: The root of the transaction trie of the block.
105-
- `uncles`: [Array] An array of uncle hashes.
106-
- `withdrawals`: [Array] Withdrawal objects.
105+
- `uncles`: (Array) An array of uncle hashes.
106+
- `withdrawals`: (Array) Withdrawal objects.
107107
- `withdrawalsRoot`: Withdrawals trie root.
108108

109109
## Example
@@ -124,39 +124,39 @@ Replace `<YOUR-API-KEY>` with an API key from your [MetaMask Developer dashboard
124124
"id": 1,
125125
"method": "eth_simulateV1",
126126
"params": [
127-
{
128-
"blockStateCalls": [
129-
{
130-
"blockOverrides": {
131-
"baseFeePerGas": "0x9"
132-
},
133-
"stateOverrides": {
134-
"0xc000000000000000000000000000000000000000": {
135-
"balance": "0x4a817c800"
136-
}
137-
},
138-
"calls": [
139-
{
140-
"from": "0xc000000000000000000000000000000000000000",
141-
"to": "0xc000000000000000000000000000000000000001",
142-
"maxFeePerGas": "0xf",
143-
"value": "0x1"
144-
},
145-
{
146-
"from": "0xc000000000000000000000000000000000000000",
147-
"to": "0xc000000000000000000000000000000000000002",
148-
"maxFeePerGas": "0xf",
149-
"value": "0x1"
150-
}
151-
]
152-
}
153-
],
154-
"validation": true,
155-
"traceTransfers": true
156-
},
157-
"latest"
127+
{
128+
"blockStateCalls": [
129+
{
130+
"blockOverrides": {
131+
"baseFeePerGas": "0x9"
132+
},
133+
"stateOverrides": {
134+
"0xc000000000000000000000000000000000000000": {
135+
"balance": "0x4a817c800"
136+
}
137+
},
138+
"calls": [
139+
{
140+
"from": "0xc000000000000000000000000000000000000000",
141+
"to": "0xc000000000000000000000000000000000000001",
142+
"maxFeePerGas": "0xf",
143+
"value": "0x1"
144+
},
145+
{
146+
"from": "0xc000000000000000000000000000000000000000",
147+
"to": "0xc000000000000000000000000000000000000002",
148+
"maxFeePerGas": "0xf",
149+
"value": "0x1"
150+
}
151+
]
152+
}
153+
],
154+
"validation": true,
155+
"traceTransfers": true
156+
},
157+
"latest"
158158
]
159-
}'
159+
}'
160160
```
161161

162162
</TabItem>
@@ -256,5 +256,6 @@ Replace `<YOUR-API-KEY>` with an API key from your [MetaMask Developer dashboard
256256
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
257257
}
258258
```
259+
259260
</TabItem>
260261
</Tabs>

0 commit comments

Comments
 (0)