Skip to content
Snippets Groups Projects
Commit 245fb07b authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

Merge branch 'features-2773' into 'master'

Features 2773

See merge request !16
parents 03c5b590 8b60b0f8
No related branches found
No related tags found
1 merge request!16Features 2773
......@@ -405,3 +405,22 @@ dap_chain_wallet_t * dap_chain_wallet_open(const char * a_wallet_name, const cha
DAP_DELETE(l_file_name);
return l_wallet;
}
/**
* @brief dap_chain_wallet_get_balance
* @param a_wallet
* @param a_net_id
* @return
*/
uint64_t dap_chain_wallet_get_balance(dap_chain_wallet_t *a_wallet, dap_chain_net_id_t a_net_id, char *a_token_ticker)
{
dap_chain_net_t *l_net = dap_chain_net_by_id(a_net_id);
dap_chain_addr_t *l_addr =dap_chain_wallet_get_addr(a_wallet, a_net_id);
uint64_t l_balance = 0;
if (l_net)
{
dap_ledger_t *l_ledger = l_net->pub.ledger;
l_balance = dap_chain_ledger_calc_balance(l_ledger, l_addr, a_token_ticker);
}
return l_balance;
}
......@@ -58,4 +58,6 @@ size_t dap_chain_wallet_get_certs_number( dap_chain_wallet_t * a_wallet);
dap_pkey_t * dap_chain_wallet_get_pkey( dap_chain_wallet_t * a_wallet,uint32_t a_key_idx);
dap_enc_key_t * dap_chain_wallet_get_key( dap_chain_wallet_t * a_wallet,uint32_t a_key_idx);
uint64_t dap_chain_wallet_get_balance(dap_chain_wallet_t *a_wallet, dap_chain_net_id_t a_net_id, char *a_token_ticker);
int dap_chain_wallet_save_file( dap_chain_wallet_t * a_wallet);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment