---
updatedAt: 2025-05-19T20:52:10.000Z
agentTools:
  projectIndex: https://docs.arianee.org/llms.txt
---

# Get $ARIA20 & Manage Credits

To interact with Arianee Protocol, you need the native crypto tokens and $ARIA20.

## Request $ARIA20 - Testnet

> 💡
>
> * Method for test purposes.
> * If no `address` is passed, the creator's address will be used.

#### Method

```javascript Method
creator.requestTestnetAria20(address?)
```

| Parameter | Type   | Required | Description               |
| :-------- | :----- | :------- | :------------------------ |
| `address` | String | ❌        | Recipient wallet address. |

***

## Get $ARIA20 allowance

Get the $ARIA20 allowance of the passed address for the passed spender address. This method allows the Store smart contract to spend aria from the creator's wallet.

> ⚠️
>
> Getting $ARIA20 allowance is mandatory to buy credits.

> 💡
>
> If no `address` is passed, the creator's address will be used.

#### Method

```javascript Method
creator.getAriaAllowance(spender, address?)
```

| Parameter | Type   | Required | Description             |
| :-------- | :----- | :------- | :---------------------- |
| `spender` | String | ✅        | Spender wallet address. |
| `address` | String | ❌        | Target wallet address.  |

***

## Get native balance

Get the native balance.

> 💡
>
> If no `address` is passed, the creator's address will be used.

#### Method

```javascript Method
creator.getNativeBalance(address?)
```

| Parameter | Type   | Required | Description            |
| :-------- | :----- | :------- | :--------------------- |
| `address` | String | ✅        | Target wallet address. |

#### Return Payload

`promise` returns `bigint`.

***

## Get credit balance

Get the balance of the passed credit type.

> 💡
>
> If no `address` is passed, the creator's address will be used.

#### Method

```javascript Method
creator.getCreditBalance(type, address?)
```

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `type`
      </td>

      <td>
        String
      </td>

      <td>
        ✅
      </td>

      <td>
        The type of credit:\
        → `smartAsset` = 0: type of credit to mint digital passport.\
        → `message` = 1: type of credit to mint and sent messages to digital passports.\
        → `arianeeEvent` = 2: type of credit to create, mint, and link an Arianee Event to a digital passport.\
        → `update` = 3: type of credit to update minted NFT.
      </td>
    </tr>

    <tr>
      <td>
        `address`
      </td>

      <td>
        String
      </td>

      <td>
        ❌
      </td>

      <td>
        Target wallet address.
      </td>
    </tr>
  </tbody>
</Table>

#### Return Payload

`promise` returns `bigint`.

***

## Get credit price

Get the credit price of the target credit type on the protocol.

#### Method

```javascript Method
creator.getCreditPrice(creditType)
```

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `creditType`
      </td>

      <td>
        String
      </td>

      <td>
        ✅
      </td>

      <td>
        The type of credit:\
        → `smartAsset` = 0: type of credit to mint digital passport.\
        → `message` = 1: type of credit to mint and sent messages to digital passports.\
        → `arianeeEvent` = 2: type of credit to create, mint, and link an Arianee Event to a digital passport.\
        → `update` = 3: type of credit to update minted digital passport.
      </td>
    </tr>
  </tbody>
</Table>

#### Return Payload

`promise` returns `bigint`.

***

## Buy credits

Credits are mandatory to use each charged feature on the Arianee Protocol.

> ⚠️
>
> This method performs a blockchain transaction. It costs $ARIA20.

#### Method

```javascript Method
creator.buyCredit(creditType, amount, overrideTransaction?:NonPayableOverrides)
```

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `creditType`
      </td>

      <td>
        String
      </td>

      <td>
        ✅
      </td>

      <td>
        The type of credit:\
        → `smartAsset` = 0: type of credit to mint digital passport.\
        → `message` = 1: type of credit to mint and sent messages to digital passports.\
        → `arianeeEvent` = 2: type of credit to create, mint, and link an Arianee Event to a digital passport.\
        → `update` = 3: type of credit to update minted digital passport.
      </td>
    </tr>

    <tr>
      <td>
        `amount`
      </td>

      <td>
        Number
      </td>

      <td>
        ✅
      </td>

      <td>
        Number of credits to buy.
      </td>
    </tr>

    <tr>
      <td>
        `overrides`
      </td>

      <td>
        `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas`
      </td>

      <td>
        ❌
      </td>

      <td>
        Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed.
      </td>
    </tr>
  </tbody>
</Table>

#### Return Payload

`promise` returns `object`: The receipt of the blockchain transaction.