Evaluates a Solana smart contract transaction by simulating the execution of a list of instructions. This allows you to test contract interactions and validate parameters before sending an actual transaction. The simulation will return the result of the contract execution, including any errors or return values.
Return: JSON object containing the simulation result, including logs, errors, and return values.
-----------Request--------------
from apiclient.Solana.Instruction import Instruction, InstructionAccount, InstructionAccountType, InstructionDiscriminator, InstructionDiscriminatorType
instructions = [
Instruction(
program_address="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
accounts=[InstructionAccount("address1", InstructionAccountType.WRITABLE)],
data=[("u64", 1000), ("address", "So11111111111111111111111111111111111111112")],
discriminator=InstructionDiscriminator(InstructionDiscriminatorType.U8, 42)
)
]
evaluateSolanaSmartContractTransaction(
instructions= instructions,
account_id=1,
specific_from_address="6jNyFbaWhwvcEvQrF6gRVbv3y7Bc9mesBS5EZacaeKgM"
)
----------------response ------------
{
"FunctionData":
{
"Message":"Solana Transaction Dry Run Status - Success! Expected balance after execution: 10044319666",
},
"Meta": {
"AccessToken": "0a1e...a514",
"Destination": "0421...e936",
"Source": "99bf...c264",
"Time": "2025-05-21 17:49:18.549"
}
}
instructionsobject<p>List of Instruction objects representing the Solana instructions to execute.
Each Instruction should specify the program_address, accounts, data (list of (type, value) tuples), and optionally discriminator.</p>
account_idintegerThe account ID to use for this operation.
specific_from_addressstring<p>The specific Solana address to send from. If not provided, the default account address is used.</p>