Comment on page
Accounts
Creating accounts that will interact with the blockchain.
Using the SDK starts with creating at least one account.
Whenever a new transaction is to be done, you will need to register the new account using the public key (B32 format or binary format).
ret_code_t
vertices_account_new_from_b32(
char *public_b32,
account_info_t **account);
public_b32
: string containing account addressaccount
: pointer toaccount_info_t *
Below is the structure
account_info_t
typedef struct
{
char public_b32[PUBLIC_B32_STR_MAX_LENGTH]; //!< b32 public address, with `\0` termination character
unsigned char public_key[ADDRESS_LENGTH]; //!< 32-bytes public key
int32_t amount; //!< amount of tokens on account
} account_info_t;
VTC_SUCCESS
: successVTC_ERROR_NO_MEM
: no more room for registering a new account
Request the last info on the blockchain regarding the account: amount, opted-in apps, etc...
ret_code_t
vertices_account_update(account_info_t *account);
account
pointer to the account, given byvertices_account_new_from_b32
.
VTC_SUCCESS
on success
Delete the instance of the account, freeing up the spot to store another account.
ret_code_t
vertices_account_free(account_info_t *account);
account
given byvertices_account_add
.
VTC_SUCCESS
on success
Last modified 2yr ago