#[no_mangle]
pub unsafe extern "C" fn iohk_jormungandr_wallet_set_state(
    wallet: WalletPtr,
    value: u64,
    counters: SpendingCounters
) -> ErrorPtr
Expand description

update the wallet account state

this is the value retrieved from any jormungandr endpoint that allows to query for the account state. It gives the value associated to the account as well as the counter.

It is important to be sure to have an updated wallet state before doing any transactions otherwise future transactions may fail to be accepted by any nodes of the blockchain because of invalid signature state.

Errors

  • this function may fail if the wallet pointer is null;

On error the function returns a ErrorPtr. On success NULL is returned. The ErrorPtr can then be observed to gathered details of the error. Don’t forget to call iohk_jormungandr_wallet_delete_error to free the ErrorPtr from memory and avoid memory leaks.

Safety

This function dereference raw pointers. Even though the function checks if the pointers are null. Mind not to put random values in or you may see unexpected behaviors