# Transactions

## Payment

```c
ret_code_t
vertices_transaction_pay_new(
            account_info_t *account, 
            char *receiver, 
            uint64_t amount, 
            void *params);
```

### Parameters

* `account`: sender account. Handle after creating the account using `vertices_account_add`.
* `receiver`: public base-32 address of the receiver account.
* `amount`: the number of tokens to be sent. In Algorand's case in microAlgos.
* `params`: in Algorand's case, `note` that will be included in the transaction.

### Return codes

* `VTC_SUCCESS` if the transaction went through
* `VTC_ERROR_INVALID_PARAM` if one parameter is incorrect
* �`VTC_ERROR_NO_MEM` if there is no room to queue the payment transaction

## Application call

```c
ret_code_t
vertices_transaction_app_call(
    account_info_t *account, 
    uint64_t app_id, 
    void *params);
```

### Parameters

* `account`: sender account. Handle after creating the account using `vertices_account_add`.
* `app_id`: Algorand application ID
* `params`: in Algorand's case, a pointer to `app_values_t` that has been zeroed before.

```c
typedef struct
{
    uint32_t count;
    app_key_value_t values[APPS_KV_MAX_COUNT];
} app_values_t;

typedef struct
{
    char name[APPS_KV_NAME_MAX_LENGTH]; //!< variable name, ASCII-encoded, can contains up to APPS_KV_NAME_MAX_LENGTH bytes
    value_type_t type; //!< type [tt]
    union
    {
        uint64_t value_uint;
        uint8_t value_slice[APPS_KV_SLICE_MAX_SIZE];
    };
} app_key_value_t;

typedef enum
{
    VALUE_TYPE_NONE = 0,
    VALUE_TYPE_BYTESLICE,
    VALUE_TYPE_INTEGER,
} value_type_t;
```

### Return codes

* `VTC_SUCCESS` if the transaction went through
* `VTC_ERROR_INVALID_PARAM` if one parameter is incorrect
* �`VTC_ERROR_NO_MEM` if there is no room to queue the payment transaction
