-
Notifications
You must be signed in to change notification settings - Fork 34
Provide inclusion_fee in the getTransaction / getTransactions responses #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Discussed with Tomer who also agrees with showing the inclusion fee charged in the transaction response. |
The RPC API does not show the resource fee and transaction fee. This is an example of a {
"id": "1",
"jsonrpc": "2.0",
"result": {
"applicationOrder": 1,
"createdAt": "1745364479",
"diagnosticEventsXdr": [
"AAAAAQAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgH5mumCbF08hXH/ZjU82f12XYWThtzssJHgDWy/zjjMkAAAAPAAAACWluY3JlbWVudAAAAAAAAAE=",
"AAAAAQAAAAAAAAABH5mumCbF08hXH/ZjU82f12XYWThtzssJHgDWy/zjjMkAAAACAAAAAAAAAAIAAAAPAAAACWZuX3JldHVybgAAAAAAAA8AAAAJaW5jcmVtZW50AAAAAAAAAwAAAAE=",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAACnJlYWRfZW50cnkAAAAAAAUAAAAAAAAAAg==",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAC3dyaXRlX2VudHJ5AAAAAAUAAAAAAAAAAQ==",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAEGxlZGdlcl9yZWFkX2J5dGUAAAAFAAAAAAAAAxQ=",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAEWxlZGdlcl93cml0ZV9ieXRlAAAAAAAABQAAAAAAAACE",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxj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AAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAEWludm9rZV90aW1lX25zZWNzAAAAAAAABQAAAAAABSFd",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAD21heF9yd19rZXlfYnl0ZQAAAAAFAAAAAAAAADA=",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAEG1heF9yd19kYXRhX2J5dGUAAAAFAAAAAAAAAIQ=",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAEG1heF9yd19jb2RlX2J5dGUAAAAFAAAAAAAAAqw=",
"AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAE21heF9lbWl0X2V2ZW50X2J5dGUAAAAABQAAAAAAAAAA"
],
"envelopeXdr": "AAAAAgAAAAAPhtFBHmdMLwxUHbawcnI7LYDUr7czSmKDxFaPEdSH+gAGbOIAAwSmAAAALAAAAAAAAAAAAAAAAQAAAAAAAAAYAAAAAAAAAAEfma6YJsXTyFcf9mNTzZ/XZdhZOG3OywkeANbL/OOMyQAAAAlpbmNyZW1lbnQAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAeqthKclgE0U7tpfd2KZ8vFfJf4+VCt5YQMCYXnLHS+ewAAAAEAAAAGAAAAAR+ZrpgmxdPIVx/2Y1PNn9dl2Fk4bc7LCR4A1sv844zJAAAAFAAAAAEACGVwAAADFAAAAIQAAAAAAAZsfgAAAAER1If6AAAAQPWkg/ufVrwI73lQmCYmWk0Y67eD0MwQnvIGV8+FZgAjBxbYwCJ9yCWghZTvKPSDJOYFlDmMuC/Ha5tbHJ1KCQ8=",
"feeBump": false,
"latestLedger": 591250,
"latestLedgerCloseTime": "1745364489",
"ledger": 591248,
"oldestLedger": 470291,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MAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAA8AAAAMY29yZV9tZXRyaWNzAAAADwAAABBtYXhfcndfZGF0YV9ieXRlAAAABQAAAAAAAACEAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAEG1heF9yd19jb2RlX2J5dGUAAAAFAAAAAAAAAqwAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAAPAAAADGNvcmVfbWV0cmljcwAAAA8AAAATbWF4X2VtaXRfZXZlbnRfYnl0ZQAAAAAFAAAAAAAAAAA=",
"resultXdr": "AAAAAAAFENcAAAAAAAAAAQAAAAAAAAAYAAAAAN8HGiSdA/wvIjE/dcc0olS76gMSTOp3ABcE2wZwsvwCAAAAAA==",
"status": "SUCCESS",
"txHash": "cb774c248481ed0c20c07efa067d09ea49a9f2153850ca1381ef0ba1dd8759ac"
}
} Of course if the XDR is rendered as JSON, then the resource fee and transaction fee are visible because they are fields in the XDR, but these are raw info, and we can't change the XDR. This is one of those times where a decision we make at a low level, to omit the inclusion fee because it can be derived, has a developer impact. {
"id": "1",
"jsonrpc": "2.0",
"result": {
"applicationOrder": 1,
"createdAt": "1745364479",
"diagnosticEventsJson": [
{
"event": {
"body": {
"v0": {
"data": "void",
"topics": [
{
"symbol": "fn_call"
},
{
"bytes": "1f99ae9826c5d3c8571ff66353cd9fd765d859386dcecb091e00d6cbfce38cc9"
},
{
"symbol": "increment"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": true
},
{
"event": {
"body": {
"v0": {
"data": {
"u32": 1
},
"topics": [
{
"symbol": "fn_return"
},
{
"symbol": "increment"
}
]
}
},
"contract_id": "1f99ae9826c5d3c8571ff66353cd9fd765d859386dcecb091e00d6cbfce38cc9",
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": true
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 2
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "read_entry"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 1
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "write_entry"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 788
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "ledger_read_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 132
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "ledger_write_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 84
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "read_key_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "write_key_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 104
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "read_data_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 132
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "write_data_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 684
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "read_code_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "write_code_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "emit_event"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "emit_event_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 491209
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "cpu_insn"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 1178377
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "mem_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 438493
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "invoke_time_nsecs"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 48
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "max_rw_key_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 132
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "max_rw_data_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 684
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "max_rw_code_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "max_emit_event_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
}
],
"envelopeJson": {
"tx": {
"signatures": [
{
"hint": "11d487fa",
"signature": "f5a483fb9f56bc08ef79509826265a4d18ebb783d0cc109ef20657cf856600230716d8c0227dc825a08594ef28f48324e60594398cb82fc76b9b5b1c9d4a090f"
}
],
"tx": {
"cond": "none",
"ext": {
"v1": {
"ext": "v0",
"resource_fee": 420990,
"resources": {
"footprint": {
"read_only": [
{
"contract_code": {
"hash": "aab6129c96013453bb697ddd8a67cbc57c97f8f950ade5840c0985e72c74be7b"
}
}
],
"read_write": [
{
"contract_data": {
"contract": "CAPZTLUYE3C5HSCXD73GGU6NT7LWLWCZHBW45SYJDYANNS744OGMSVXT",
"durability": "persistent",
"key": "ledger_key_contract_instance"
}
}
]
},
"instructions": 550256,
"read_bytes": 788,
"write_bytes": 132
}
}
},
"fee": 421090,
"memo": "none",
"operations": [
{
"body": {
"invoke_host_function": {
"auth": [],
"host_function": {
"invoke_contract": {
"args": [],
"contract_address": "CAPZTLUYE3C5HSCXD73GGU6NT7LWLWCZHBW45SYJDYANNS744OGMSVXT",
"function_name": "increment"
}
}
}
},
"source_account": null
}
],
"seq_num": 849535941214252,
"source_account": "GAHYNUKBDZTUYLYMKQO3NMDSOI5S3AGUV63TGSTCQPCFNDYR2SD7UXMR"
}
}
},
"feeBump": false,
"latestLedger": 591260,
"latestLedgerCloseTime": "1745364539",
"ledger": 591248,
"oldestLedger": 470301,
"oldestLedgerCloseTime": "1744759052",
"resultJson": {
"ext": "v0",
"fee_charged": 331991,
"result": {
"tx_success": [
{
"op_inner": {
"invoke_host_function": {
"success": "df071a249d03fc2f22313f75c734a254bbea03124cea77001704db0670b2fc02"
}
}
}
]
}
},
"resultMetaJson": {
"v3": {
"ext": "v0",
"operations": [
{
"changes": [
{
"state": {
"data": {
"contract_data": {
"contract": "CAPZTLUYE3C5HSCXD73GGU6NT7LWLWCZHBW45SYJDYANNS744OGMSVXT",
"durability": "persistent",
"ext": "v0",
"key": "ledger_key_contract_instance",
"val": {
"contract_instance": {
"executable": {
"wasm": "aab6129c96013453bb697ddd8a67cbc57c97f8f950ade5840c0985e72c74be7b"
},
"storage": null
}
}
}
},
"ext": "v0",
"last_modified_ledger_seq": 591214
}
},
{
"updated": {
"data": {
"contract_data": {
"contract": "CAPZTLUYE3C5HSCXD73GGU6NT7LWLWCZHBW45SYJDYANNS744OGMSVXT",
"durability": "persistent",
"ext": "v0",
"key": "ledger_key_contract_instance",
"val": {
"contract_instance": {
"executable": {
"wasm": "aab6129c96013453bb697ddd8a67cbc57c97f8f950ade5840c0985e72c74be7b"
},
"storage": [
{
"key": {
"symbol": "COUNTER"
},
"val": {
"u32": 1
}
}
]
}
}
}
},
"ext": "v0",
"last_modified_ledger_seq": 591248
}
}
]
}
],
"soroban_meta": {
"diagnostic_events": [
{
"event": {
"body": {
"v0": {
"data": "void",
"topics": [
{
"symbol": "fn_call"
},
{
"bytes": "1f99ae9826c5d3c8571ff66353cd9fd765d859386dcecb091e00d6cbfce38cc9"
},
{
"symbol": "increment"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": true
},
{
"event": {
"body": {
"v0": {
"data": {
"u32": 1
},
"topics": [
{
"symbol": "fn_return"
},
{
"symbol": "increment"
}
]
}
},
"contract_id": "1f99ae9826c5d3c8571ff66353cd9fd765d859386dcecb091e00d6cbfce38cc9",
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": true
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 2
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "read_entry"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 1
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "write_entry"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 788
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "ledger_read_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 132
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "ledger_write_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 84
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "read_key_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "write_key_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 104
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "read_data_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 132
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "write_data_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 684
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "read_code_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "write_code_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "emit_event"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "emit_event_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 491209
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "cpu_insn"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 1178377
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "mem_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 438493
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "invoke_time_nsecs"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 48
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "max_rw_key_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 132
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "max_rw_data_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 684
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "max_rw_code_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
},
{
"event": {
"body": {
"v0": {
"data": {
"u64": 0
},
"topics": [
{
"symbol": "core_metrics"
},
{
"symbol": "max_emit_event_byte"
}
]
}
},
"contract_id": null,
"ext": "v0",
"type_": "diagnostic"
},
"in_successful_contract_call": false
}
],
"events": [],
"ext": {
"v1": {
"ext": "v0",
"rent_fee_charged": 294604,
"total_non_refundable_resource_fee_charged": 37208,
"total_refundable_resource_fee_charged": 294683
}
},
"return_value": {
"u32": 1
}
},
"tx_changes_after": [
{
"state": {
"data": {
"account": {
"account_id": "GAHYNUKBDZTUYLYMKQO3NMDSOI5S3AGUV63TGSTCQPCFNDYR2SD7UXMR",
"balance": 199640485511,
"ext": {
"v1": {
"ext": {
"v2": {
"ext": {
"v3": {
"ext": "v0",
"seq_ledger": 591248,
"seq_time": 1745364479
}
},
"num_sponsored": 0,
"num_sponsoring": 0,
"signer_sponsoring_i_ds": []
}
},
"liabilities": {
"buying": 0,
"selling": 0
}
}
},
"flags": 0,
"home_domain": "",
"inflation_dest": null,
"num_sub_entries": 0,
"seq_num": 849535941214252,
"signers": [],
"thresholds": "01000000"
}
},
"ext": "v0",
"last_modified_ledger_seq": 591248
}
},
{
"updated": {
"data": {
"account": {
"account_id": "GAHYNUKBDZTUYLYMKQO3NMDSOI5S3AGUV63TGSTCQPCFNDYR2SD7UXMR",
"balance": 199640574610,
"ext": {
"v1": {
"ext": {
"v2": {
"ext": {
"v3": {
"ext": "v0",
"seq_ledger": 591248,
"seq_time": 1745364479
}
},
"num_sponsored": 0,
"num_sponsoring": 0,
"signer_sponsoring_i_ds": []
}
},
"liabilities": {
"buying": 0,
"selling": 0
}
}
},
"flags": 0,
"home_domain": "",
"inflation_dest": null,
"num_sub_entries": 0,
"seq_num": 849535941214252,
"signers": [],
"thresholds": "01000000"
}
},
"ext": "v0",
"last_modified_ledger_seq": 591248
}
}
],
"tx_changes_before": [
{
"state": {
"data": {
"account": {
"account_id": "GAHYNUKBDZTUYLYMKQO3NMDSOI5S3AGUV63TGSTCQPCFNDYR2SD7UXMR",
"balance": 199640485511,
"ext": {
"v1": {
"ext": {
"v2": {
"ext": {
"v3": {
"ext": "v0",
"seq_ledger": 591214,
"seq_time": 1745364308
}
},
"num_sponsored": 0,
"num_sponsoring": 0,
"signer_sponsoring_i_ds": []
}
},
"liabilities": {
"buying": 0,
"selling": 0
}
}
},
"flags": 0,
"home_domain": "",
"inflation_dest": null,
"num_sub_entries": 0,
"seq_num": 849535941214251,
"signers": [],
"thresholds": "01000000"
}
},
"ext": "v0",
"last_modified_ledger_seq": 591248
}
},
{
"updated": {
"data": {
"account": {
"account_id": "GAHYNUKBDZTUYLYMKQO3NMDSOI5S3AGUV63TGSTCQPCFNDYR2SD7UXMR",
"balance": 199640485511,
"ext": {
"v1": {
"ext": {
"v2": {
"ext": {
"v3": {
"ext": "v0",
"seq_ledger": 591248,
"seq_time": 1745364479
}
},
"num_sponsored": 0,
"num_sponsoring": 0,
"signer_sponsoring_i_ds": []
}
},
"liabilities": {
"buying": 0,
"selling": 0
}
}
},
"flags": 0,
"home_domain": "",
"inflation_dest": null,
"num_sub_entries": 0,
"seq_num": 849535941214252,
"signers": [],
"thresholds": "01000000"
}
},
"ext": "v0",
"last_modified_ledger_seq": 591248
}
}
]
}
},
"status": "SUCCESS",
"txHash": "cb774c248481ed0c20c07efa067d09ea49a9f2153850ca1381ef0ba1dd8759ac"
}
} |
It's there in the XDR. You may need to request the response in json. The only thing missing is the inclusion fee. |
@janewang note this part of his reply:
Unfortunately, this isn't something we have control over. However, the total fee is present in the XDR as well, which is inclusion+resource. From above, "resultJson": {
"ext": "v0",
"fee_charged": 331991,
"result": {
"tx_success": [ |
Of course, it can be derived, but it would be simpler if it is in the response in itself. Also, I think inclusion fee is a pretty important thing to know from a transaction. Is it something that the core team could change? |
I don't think it is pragmatic to include the inclusion fee in the transaction XDR. It's redundant information that would make every transaction larger. I think the XDR as it is tells a good story, we maybe just haven't done a good job of telling that story. The story being that resource fee is the cost of executing the tx, it's paying for the resources that'll be used. A user is always welcome to pay more, and by doing so they increase the chance of their tx making it. They can pay more by increasing the total fee they'll pay to be above the resource fee. The ask is to only expose inclusion fee, but that's a bit odd to expose in isolation, so we should consider how to expose all the fees. Fee information could be added to the For example, below are the fee fields in the rpc {
"result": {
"envelopeJson": {
"tx": {
"tx": {
"ext": {
"v1": {
"resource_fee": 420990
}
},
"fee": 421090
}
}
},
"resultJson": {
"fee_charged": 331991
},
"resultMetaJson": {
"v3": {
"soroban_meta": {
"ext": {
"v1": {
"rent_fee_charged": 294604,
"total_non_refundable_resource_fee_charged": 37208,
"total_refundable_resource_fee_charged": 294683
}
}
}
}
}
}
} There are two categories of fees, proposed fees in the original tx, and charged fees in the result and result meta. Maybe something like the following would capture all existing fees communicated, plus a couple derived ones, including the inclusion fee: {
"fees": {
"proposed": {
"resource": ..., // envelopeJson.tx.tx.ext.v1.resource_fee
"inclusion": ..., // derived
"total": ..., // envelopeJson.tx.tx.fee
},
"charged": {
"resource": {
"resource_non_refundable": {
"total": ..., // resultMetaJson.v3.soroban_meta.ext.v1.total_non_refundable_resource_fee_charged
},
"resource_refundable": {
"rent": ..., // resultMetaJson.v3.soroban_meta.ext.v1.rent_fee_charged
"other": ..., // derived
"total": ..., // resultMetaJson.v3.soroban_meta.ext.v1.total_refundable_resource_fee_charged
},
"total": ..., // derived
},
"inclusion": ..., // derived
"total": ..., // resultJson.fee_charged
}
}
} |
Thanks for starting the discussion @janewang, we definitely have a serious devx issue around fees: fees in Stellar are unique and challenging to reason about (proposed inclusion fee is only one part of the story). @leighmcculloch's illustration of the current situation is spot-on: you currently have to visit multiple inner xdr/json fields and do the math. I also agree that it's unrealistic to change the xdr. The suggested @janewang at the same time I think we should pursue surfacing this information in laboratory and cli without waiting for RPC |
Good point, let's discuss this more broadly. I've started a conversation here: We can reopen this issue if the discussion there circles back to solving this problem with the RPC, and a more specific feature request aligned with it's API. |
Uh oh!
There was an error while loading. Please reload this page.
What problem does your feature solve?
The transaction response should clarify all the fees used in the transaction - total fee charge, resource fees, and inclusion fees.
It is very strange in the RPC API that we show
resource fees
andtransaction fee
, but do not showinclusion fee
. I believe the visibility of inclusion fee should be addressed on the RPC API level, since it would just be an additional field, it wouldn't break the existing API design.As to how we present fees -- currently shown as
total fees - resource fees = inclusion fee
-- this seems to be used across the stack ( RPC + various tools CLI / JS SDK). We could shift towards a sum of the parts approach where (resource fee + inclusion fee = total fee
) for better intuition. This was a proposed a while back in this doc: https://docs.google.com/document/d/1KwUgCe5Rx6FekOJvWI5FZjViWueCcV5izE4GVR2QW5U/edit?tab=t.0 I recall that most folks didn't really understood how fees worked when we insisted on the mental model of total fees - resource fees = inclusion fee .When we switched to a sum of the parts description in the developer docs, that was a lightbulb moment for many folks. We could also do the same across the stack.
The text was updated successfully, but these errors were encountered: