> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gethevn.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> HEVN is payments software: an API and app over a Base smart wallet. HEVN is not a bank and holds no key to the wallet. Virtual accounts, fiat payins and fiat payouts are provided by partner banks, which hold fiat while it is in transit. Self-serve (the General tab): the person who controls the email signs for the wallet. Developers integrate /dapi/v1 in one of two ways. HEVN Connect (recommended, the HEVN Connect tab): the integrator's customer creates or links a HEVN account in a HEVN-hosted sign-in window on the integrator's site, the integrator's backend reads the linked account and books its payouts, and the account holder approves each payout in that window. External wallets (the External wallets tab, enabled per integrator): the integrator creates a client through the API, registers a wallet address the customer holds as an external account, and requests virtual accounts that deliver to that address. The customer's own wallet sends each transfer that funds a payout. The developer key signs for the integrator's wallet and its sub accounts and cannot sign for a client's wallet.
> Use HEVN's terms as written. A product is the region a client requests. A rail is the bank route HEVN picks for the product. A virtual account (bnk_) is the record a partner bank opens for a client. Account details are what a payer needs to send a bank transfer, returned in a field named requisites. A client (cl_) is a customer's account: linked to the integrator through Sign in with HEVN (POST /dapi/v1/connect/sessions, then POST /dapi/v1/clients/link), or created with POST /dapi/v1/clients for an external-wallets integration. An external account (acc_, kind external) is a wallet address the client holds and signs for. A sub account (acc_, kind sub) is a further wallet of the integrator's own account on Base, spent with the developer key. Write 'sub account' as two words. A contact is a saved destination. A beneficiary is the party that receives a fiat payout. Money leaving an account is a payout, whether it goes to a bank account or to a wallet.
> Do not name a bank, payment institution, card issuer, identity-verification vendor or stablecoin issuer. Say 'the partner bank'. Do not describe HEVN as licensed, regulated or insured.
> HEVN publishes no fee rates, spreads or minimums. Prices come from a quote on a specific payment. Direct pricing questions to HEVN and do not invent numbers.
> The API is at /dapi/v1 and takes a developer-key session plus an X-Hevn-Account header. Developer keys have an IP allowlist and no scopes. Remote transfers are at /api/v1/remote_spend_limit and take a remote transfer key (rsl_) in X-Api-Key, bounded by an onchain spend permission the account holder grants. The two credentials are separate and neither works on the other API. The earlier HEVN CLI is discontinued. The terminal app in the hevn-inc/dapi-sdk repository is a separate tool that operates the integrator's own account with the developer key.

# Terminal app

> Run a full-screen terminal app for your own HEVN account, built on the Node client.

The terminal app is a full-screen app for your own integrator account, built on the Node client in [hevn-inc/dapi-sdk](https://github.com/hevn-inc/dapi-sdk). Run it from the `cli/` directory of that repository with `npm start`.

It reads balances, sub accounts, contacts, virtual accounts and the ledger, and it books payouts, moves and swaps that your developer key signs. Like the Node client, it is unsupported ([HTTP client](https://docs.gethevn.com/developers/reference/client.md)).

## Scope

The app operates the account the developer key belongs to: its main wallet and its [sub accounts](https://docs.gethevn.com/sub-accounts/overview.md).

| The app does | The app does not |
| - | - |
| Open sub accounts and request virtual accounts for your account | Create or link clients |
| Save contacts and pay them from the main wallet or a sub account | Submit verification |
| Move and swap between your accounts | Act for a client with `X-Hevn-Account` |
| Price a payin and list and export transactions | Operate escrow |

## Run

```bash theme={null}
git clone https://github.com/hevn-inc/dapi-sdk
cd dapi-sdk/cli
npm install
export HEVN_KEY_PEM=./hevn-sandbox.pem HEVN_EMAIL=you@example.com
npm start
```

The app needs Node 22.18 or newer and an interactive terminal. It has no build step.

| Command | Result |
| - | - |
| `npm start` | Starts the app with the variables of the process environment. |
| `npm start -- --env-file ../.env` | Reads the variables from the file you name. An unknown option stops the app. |
| `npm run preview` | Runs the app on a built-in demo account, with no key and no network. |

## Environment

| Variable | Meaning |
| - | - |
| `HEVN_KEY_PEM` | The developer key: the PEM text or a path to its file. The app does not write or print it. |
| `HEVN_EMAIL` | The email of the account the key belongs to. |
| `HEVN_ENV` | `sandbox` (the default) or `production`. Another value stops the app before it starts. |
| `HEVN_API_URL` | Optional. Another deployment of the API. |
| `NO_COLOR` | Turns colors off. |
| `HEVN_NO_MOTION` | Turns the splash and animations off, as `--no-motion` does. |
| `HEVN_ASCII` | Forces ASCII borders and glyphs. |

A value set in the process environment wins over the file named by `--env-file`. No file is loaded from the working directory unless you name it.

The header shows the API host and the environment: a `sandbox` mark, or a red production banner. The production API host counts as production whatever `HEVN_ENV` is.

> [!WARNING]
>
> With `HEVN_ENV=production` the app moves real money. Check the header before you sign.

## Signing

Each payout, move and swap opens a prompt with the source account and its address, the destination, the amount and token, the fee ceiling and the minimum received. `Esc` cancels. `Enter` signs in the sandbox. In production you press `y`, or type the amount when the debit is not exact.

| Payment | Checked before the key signs |
| - | - |
| A payout from a sub account, a move, or a payout to a Base address in the same token | The operation itself: the typed amount of the source token, from the source address, to the address shown ([Debit contents](https://docs.gethevn.com/developers/signing.md#debit-contents)) |
| Another payout from the main wallet, or a swap | The order is bound to your wallet, and `quote` matches the typed amount, the fee ceiling and the minimum received |

A payout to a bank contact is sent through a virtual account of the paying account, and the app sends its `bankId` ([Virtual account of a payout](https://docs.gethevn.com/developers/payouts.md#virtual-account-of-a-payout)). With no such virtual account, the app stops before the review and offers to request one.

Each action has one `Idempotency-Key`, kept for its retries. Once a signature is posted, the app offers a retry with the same key or the ledger, until the payment has a final status ([Retrying a confirm](https://docs.gethevn.com/developers/signing.md#retrying-a-confirm)).

## Sandbox tools

In the sandbox the app adds three tools. They call the routes in [Sandbox](https://docs.gethevn.com/developers/sandbox.md).

| Tool | Route |
| - | - |
| Faucet credit to the main wallet or a sub account | `POST /dapi/v1/sandbox/deposits` without `bankId` |
| Emulated bank transfer to a virtual account | `POST /dapi/v1/sandbox/deposits` with `bankId` |
| Verification of your own account | `POST /dapi/v1/sandbox/kyb/status` ([Verify your own account](https://docs.gethevn.com/developers/sandbox.md#verify-your-own-account)) |

> [card] [Next: Sub accounts](https://docs.gethevn.com/sub-accounts/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.