How to calculate transaction before submit the transaction?

Hi guys, I have built a transaction and submit it successfully, but how to get the transaction before I submit the transaction? I have tried with simulate transaction API but it returns 0x0000000000000000000000000000000000000000000000000000000000000000 in the response.

[
    {
        "version": "21305496",
        "hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "state_root_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "event_root_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "gas_used": "1",
        "success": true,
        "vm_status": "Executed successfully",
        "accumulator_root_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "changes": [
            {
                "address": "0x2b7db331dce05e73adb1c280efbd06a23d85cf7a7a69d52a1a8b710221ea340c",
                "state_key_hash": "0xf102cb504c854d49f1175e98ae6d834e14a0eae5b8f137e3b1e8b695df7b6c52",
                "data": {
                    "type": "0x1::account::Account",
                    "data": {
                        "authentication_key": "0x2b7db331dce05e73adb1c280efbd06a23d85cf7a7a69d52a1a8b710221ea340c",
                        "coin_register_events": {
                            "counter": "1",
                            "guid": {
                                "id": {
                                    "addr": "0x2b7db331dce05e73adb1c280efbd06a23d85cf7a7a69d52a1a8b710221ea340c",
                                    "creation_num": "0"
                                }
                            }
                        },
                        "rotation_capability_offer": {
                            "for": {
                                "vec": []
                            }
                        },
                        "sequence_number": "7",
                        "signer_capability_offer": {
                            "for": {
                                "vec": []
                            }
                        }
                    }
                },
                "type": "write_resource"
            },
            {
                "address": "0x2b7db331dce05e73adb1c280efbd06a23d85cf7a7a69d52a1a8b710221ea340c",
                "state_key_hash": "0x4b7995048ecabbc4261ea94139dd5512641d25680e9f75f18559bf8041c1d5b6",
                "data": {
                    "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
                    "data": {
                        "coin": {
                            "value": "51270"
                        },
                        "deposit_events": {
                            "counter": "6",
                            "guid": {
                                "id": {
                                    "addr": "0x2b7db331dce05e73adb1c280efbd06a23d85cf7a7a69d52a1a8b710221ea340c",
                                    "creation_num": "1"
                                }
                            }
                        },
                        "frozen": false,
                        "withdraw_events": {
                            "counter": "7",
                            "guid": {
                                "id": {
                                    "addr": "0x2b7db331dce05e73adb1c280efbd06a23d85cf7a7a69d52a1a8b710221ea340c",
                                    "creation_num": "2"
                                }
                            }
                        }
                    }
                },
                "type": "write_resource"
            },
            {
                "address": "0x8c263547a5d8275939e8b7d41849778cc10ee59ddb8cce37cc3cf2fceaeaf310",
                "state_key_hash": "0x1c1b5b53398eb835ea7c8f2570941b6da71f0af833c62b9ceab4d73995d21b3c",
                "data": {
                    "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
                    "data": {
                        "coin": {
                            "value": "45370"
                        },
                        "deposit_events": {
                            "counter": "8",
                            "guid": {
                                "id": {
                                    "addr": "0x8c263547a5d8275939e8b7d41849778cc10ee59ddb8cce37cc3cf2fceaeaf310",
                                    "creation_num": "1"
                                }
                            }
                        },
                        "frozen": false,
                        "withdraw_events": {
                            "counter": "7",
                            "guid": {
                                "id": {
                                    "addr": "0x8c263547a5d8275939e8b7d41849778cc10ee59ddb8cce37cc3cf2fceaeaf310",
                                    "creation_num": "2"
                                }
                            }
                        }
                    }
                },
                "type": "write_resource"
            }
        ],
        "sender": "0x2b7db331dce05e73adb1c280efbd06a23d85cf7a7a69d52a1a8b710221ea340c",
        "sequence_number": "6",
        "max_gas_amount": "2000",
        "gas_unit_price": "1",
        "expiration_timestamp_secs": "1661400174",
        "payload": {
            "function": "0x1::coin::transfer",
            "type_arguments": [
                "0x1::aptos_coin::AptosCoin"
            ],
            "arguments": [
                "0x8c263547a5d8275939e8b7d41849778cc10ee59ddb8cce37cc3cf2fceaeaf310",
                "27"
            ],
            "type": "entry_function_payload"
        },
        "signature": {
            "public_key": "0x6eabac72437d0c26fd84ee380c00455436d5bb8d764e6d18710d1defada00b3f",
            "signature": "0x19a75f34695c814ce7fb88dd49e992c9dfb150c13ce774ee7b38eb6bdc1c55f2bef95cb811d0b1d3c74971b66df77114806abb229e065ad045f00d9c35fc780d",
            "type": "ed25519_signature"
        },
        "events": [
            {
                "key": "0x02000000000000002b7db331dce05e73adb1c280efbd06a23d85cf7a7a69d52a1a8b710221ea340c",
                "sequence_number": "6",
                "type": "0x1::coin::WithdrawEvent",
                "data": {
                    "amount": "27"
                }
            },
            {
                "key": "0x01000000000000008c263547a5d8275939e8b7d41849778cc10ee59ddb8cce37cc3cf2fceaeaf310",
                "sequence_number": "7",
                "type": "0x1::coin::DepositEvent",
                "data": {
                    "amount": "27"
                }
            }
        ],
        "timestamp": "1661397479640029"
    }
]
1 Like