diff --git a/modules/common/dap_chain_datum_tx_receipt.c b/modules/common/dap_chain_datum_tx_receipt.c index e7e27e3dcce5bdb608f66a47e76b0ea4bbf6641e..dd3148ed05cb907af7734cad06ce591580606113 100644 --- a/modules/common/dap_chain_datum_tx_receipt.c +++ b/modules/common/dap_chain_datum_tx_receipt.c @@ -109,6 +109,32 @@ dap_sign_t* dap_chain_datum_tx_receipt_sign_get(dap_chain_datum_tx_receipt_t * l return l_sign; } +uint32_t dap_chain_datum_tx_receipt_type_get(dap_chain_datum_tx_receipt_t * l_receipt) +{ + if (!l_receipt) + return -1; + return l_receipt->receipt_info.units_type.enm; +} +uint64_t dap_chain_datum_tx_receipt_srv_uid_get(dap_chain_datum_tx_receipt_t * l_receipt) +{ + if (!l_receipt) + return -1; + return l_receipt->receipt_info.srv_uid.uint64; +} +uint64_t dap_chain_datum_tx_receipt_units_get(dap_chain_datum_tx_receipt_t * l_receipt) +{ + if (!l_receipt) + return -1; + return l_receipt->receipt_info.units; +} +uint256_t dap_chain_datum_tx_receipt_value_get(dap_chain_datum_tx_receipt_t * l_receipt) +{ + uint256_t res = {}; + if (!l_receipt) + return res; + return l_receipt->receipt_info.value_datoshi; +} + /** * @brief dap_chain_datum_tx_receipt_signs_count * @param a_receipt diff --git a/modules/common/include/dap_chain_datum_tx_receipt.h b/modules/common/include/dap_chain_datum_tx_receipt.h index 60d2dd15ae0e7b2df648a6e1781f45668578a318..f534726ab692883f63990258dba512c817106d67 100644 --- a/modules/common/include/dap_chain_datum_tx_receipt.h +++ b/modules/common/include/dap_chain_datum_tx_receipt.h @@ -50,6 +50,10 @@ dap_chain_datum_tx_receipt_t * dap_chain_datum_tx_receipt_create(dap_chain_net_s dap_chain_datum_tx_receipt_t *dap_chain_datum_tx_receipt_sign_add(dap_chain_datum_tx_receipt_t *a_receipt, dap_enc_key_t *a_key); dap_sign_t* dap_chain_datum_tx_receipt_sign_get(dap_chain_datum_tx_receipt_t * l_receipt, size_t l_receipt_size , uint16_t sign_position); +uint32_t dap_chain_datum_tx_receipt_utype_get(dap_chain_datum_tx_receipt_t * l_receipt); +uint64_t dap_chain_datum_tx_receipt_srv_uid_get(dap_chain_datum_tx_receipt_t * l_receipt); +uint64_t dap_chain_datum_tx_receipt_units_get(dap_chain_datum_tx_receipt_t * l_receipt); +uint256_t dap_chain_datum_tx_receipt_value_get(dap_chain_datum_tx_receipt_t * l_receipt); uint16_t dap_chain_datum_tx_receipt_signs_count(dap_chain_datum_tx_receipt_t * l_receipt, size_t l_receipt_size); #ifdef __cplusplus