# Accounts

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).

## Create

```c
ret_code_t
vertices_account_new_from_b32(
                char *public_b32,
                account_info_t **account);
```

### Parameters

* `public_b32`: string containing account address
* `account`: pointer to `account_info_t *`&#x20;

Below is the structure `account_info_t`

```c
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;
```

### Return codes

* `VTC_SUCCESS` : success
* `VTC_ERROR_NO_MEM` : no more room for registering a new account

## Update

Request the last info on the blockchain regarding the account: amount, opted-in apps, etc...

```c
ret_code_t
vertices_account_update(account_info_t *account);
```

### Parameters

* `account` pointer to the account, given by `vertices_account_new_from_b32`.�

### Return codes

* `VTC_SUCCESS` on success

## Delete

Delete the instance of the account, freeing up the spot to store another account.

```
ret_code_t
vertices_account_free(account_info_t *account);
```

### Parameters

* `account` given by `vertices_account_add`.

### Return codes

* `VTC_SUCCESS` on success


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vertices.network/vertices-sdk/api-reference/accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
