Aptos
/v1/transactions/simulate50 크레딧
Simulate a transaction
매개변수
| 이름 | 타입 | 설명 |
|---|---|---|
| estimate_max_gas_amount | boolean | Query. If true, the max gas in the transaction is ignored and the maximum possible gas is used. (선택) |
| estimate_gas_unit_price | boolean | Query. If true, the gas unit price in the transaction is ignored and the estimated price is used. (선택) |
| estimate_prioritized_gas_unit_price | boolean | Query. If true, a higher (prioritized) price than the standard estimate is used. (선택) |
| sender | string | Body. Address of the sending account. |
| sequence_number | string (u64) | Body. Sequence number of the transaction for the sender. |
| max_gas_amount | string (u64) | Body. Maximum gas units. |
| gas_unit_price | string (u64) | Body. Price per gas unit, in octas. |
| expiration_timestamp_secs | string (u64) | Body. Unix time (seconds) after which the transaction is no longer valid. |
| payload | object | Body. Transaction payload. |
| signature | object | Body. Signature with zero-padded (invalid) signature bytes; the node does not verify it for simulation. |
반환값
타입
object[]
Array with the simulated user transaction: gas_used, success, vm_status, changes, events and the other user transaction fields, without state hashes.
코드 예제
curl 'https://holy-burned-sky-apt-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7/v1/transactions/simulate' \
-X POST \
-H 'content-type: application/json' \
-d '{
"sender": "0x1",
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "100",
"expiration_timestamp_secs": "1893456000",
"payload": {
"type": "entry_function_payload",
"function": "0x1::aptos_account::transfer",
"type_arguments": [],
"arguments": [
"0x2",
"1000"
]
},
"signature": {
"type": "ed25519_signature",
"public_key": "0x0000000000000000000000000000000000000000000000000000000000000000",
"signature": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
}'