simulateTransaction
Simulate sending a transaction.
https://api.1inch.com/web3/501
Supported on: Solana
Request
Request
object jsonrpc
* string (Enum)JSON-RPC version
2.0
method
* string The method to call
params
array Method parameters
items
any id
* number Request ID
JavaScript
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const response = await fetch('https://api.1inch.com/web3/501', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'simulateTransaction',
params: [],
id: 1,
}),
});
const data = await response.json();
console.log(data);
Response
Simulate Transaction Response
Simulate Transaction Response
object context
* object slot
* integer The slot this response corresponds to
apiVersion
string The current solana versions running on the node
additionalProperties
none value
* object accounts
any oneOf[0]
null oneOf[1]
array Array of accounts with same ordering as transaction message.accountKeys
err
* any oneOf[0]
null oneOf[1]
object Error details if simulation failed
oneOf[2]
string Error message if simulation failed
innerInstructions
object Inner instructions executed during the transaction
loadedAccountsDataSize
integer Size of loaded account data
logs
any oneOf[0]
null oneOf[1]
array Array of log messages the transaction instructions output during execution
items
string replacementBlockhash
any oneOf[0]
null oneOf[1]
object Replacement blockhash information
returnData
any oneOf[0]
null oneOf[1]
object Data returned from program
unitsConsumed
integer Number of compute units consumed during the transaction
additionalProperties
none additionalProperties
none JSON
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"context": {
"slot": 218
},
"value": {
"err": null,
"accounts": null,
"logs": [],
"returnData": null,
"unitsConsumed": 33
}
}