# Accounts

You can add or create an account with the assigned name to it, and save the account to local ecrypted storage.  This will make it easier and safer to list and access the keys.&#x20;

> **`WRITE`** methods of a contract, do not depened on accounts storage, you can also load and provide account data (the `key`) on your own.&#x20;

### Manage accounts via CLI

See the help for `accounts` command to get full and up-to-date information

```
0xweb accounts --help
```

* **`add`** — adds an account

```bash
0xweb accounts add --key PRIVATE_KEY --name FOOBAR --pin YOUR_PASSWORD
```

* **`remove`** — removed the account

```bash
0xweb accounts remove --name FOOBAR --pin YOUR_PASSWORD
```

* **`list`** — show account names saved in storage

```bash
0xweb accounts list --pin YOUR_PASSWORD
```

* **`new`** — generates a new account. Remember to back-up the KEY [❗](https://emojipedia.org/exclamation-mark/)

```bash
0xweb accounts new --name FOOBAR --pin YOUR_PASSWORD
```

### Use the account in CLI

Provide the `name` and `pin` to retrieve the account from storage. For example, if you want to transfer a token:

```
0xweb token transfer USDC --from FOOBAR --to 0x.... --amount 10 --pin YOUR_PASSWORD
```

### Use the account in code

```typescript
import { USDC } from '@0xweb/eth/USDC/USDC'

async function example () {
    // read the configuration, safe to call multiple times, but can be called once at application start
    await Config.fetch();
    
    let usdcContract = new USDC();
    let decimals = await usdcContract.decimals();
    // 10$ to wei
    let wei = 10n * 10n**BigInt(decimals);
    let tx = await usdcContract.transfer('FOOBAR', '0x....', wei);
    let receipt = await tx.wait();
}
example();
```


---

# 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.0xweb.org/wallet/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.
