Skip to content

Commit 53d3c47

Browse files
committed
Website/wallet: split in different files for each subcommand
1 parent c45bdca commit 53d3c47

File tree

8 files changed

+518
-464
lines changed

8 files changed

+518
-464
lines changed

website/docs/developers/wallet.md

Lines changed: 0 additions & 463 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: address
3+
description: Get the public address from an encrypted key file
4+
sidebar_position: 1
5+
---
6+
7+
# address
8+
9+
Get the public address from an encrypted key file.
10+
11+
## Basic usage
12+
13+
```bash
14+
mina wallet address --from /path/to/encrypted/key
15+
```
16+
17+
## Arguments
18+
19+
**Required:**
20+
21+
- `--from <PATH>` - Path to encrypted key file
22+
23+
**Optional:**
24+
25+
- `[PASSWORD]` - Password to decrypt the key. Can be provided as an argument or
26+
via the `MINA_PRIVKEY_PASS` environment variable (recommended for security)
27+
28+
## Example
29+
30+
```bash
31+
# Get address from encrypted key
32+
mina wallet address --from ./keys/my-wallet
33+
34+
# Using environment variable for password
35+
export MINA_PRIVKEY_PASS="my-secret-password"
36+
mina wallet address --from ./keys/my-wallet
37+
```
38+
39+
This command simply decrypts the key file and displays the associated public
40+
address. It does not require a connection to a node.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
title: balance
3+
description: Query account balance and details using GraphQL
4+
sidebar_position: 2
5+
---
6+
7+
# balance
8+
9+
Query the balance and details of an account using GraphQL.
10+
11+
## Basic usage
12+
13+
```bash
14+
# Check balance using key file
15+
mina wallet balance --from /path/to/encrypted/key
16+
17+
# Check balance using public address
18+
mina wallet balance --address <PUBLIC_KEY>
19+
```
20+
21+
## Arguments
22+
23+
**Required (one of):**
24+
25+
- `--from <PATH>` - Path to encrypted key file
26+
- `--address <PUBLIC_KEY>` - Public key to query directly
27+
28+
**Optional:**
29+
30+
- `[PASSWORD]` - Password to decrypt the key (only required when using
31+
`--from`). Can be provided as an argument or via the `MINA_PRIVKEY_PASS`
32+
environment variable (recommended for security)
33+
- `--endpoint <URL>` - GraphQL endpoint URL (default:
34+
`http://localhost:3000/graphql`)
35+
- `--format <FORMAT>` - Output format: `text` (default) or `json`
36+
37+
## Examples
38+
39+
### Check balance using key file
40+
41+
```bash
42+
export MINA_PRIVKEY_PASS="my-secret-password"
43+
mina wallet balance --from ./keys/my-wallet
44+
```
45+
46+
### Check balance using public address
47+
48+
```bash
49+
mina wallet balance \
50+
--address B62qre3erTHfzQckNuibViWQGyyKwZseztqrjPZBv6SQF384Rg6ESAy
51+
```
52+
53+
### Check balance on remote node
54+
55+
```bash
56+
mina wallet balance \
57+
--address B62qre3erTHfzQckNuibViWQGyyKwZseztqrjPZBv6SQF384Rg6ESAy \
58+
--endpoint https://node.example.com:3000/graphql
59+
```
60+
61+
### Get balance in JSON format
62+
63+
```bash
64+
mina wallet balance \
65+
--address B62qre3erTHfzQckNuibViWQGyyKwZseztqrjPZBv6SQF384Rg6ESAy \
66+
--format json
67+
```
68+
69+
## Output
70+
71+
The balance command displays:
72+
73+
- **Total balance** - Total amount of MINA in the account (both nanomina and
74+
MINA)
75+
- **Liquid balance** - Amount available for spending
76+
- **Locked balance** - Amount locked due to vesting schedule
77+
- **Nonce** - Current account nonce
78+
- **Delegate** - Public key of the delegate (if set)
79+
80+
### Text format (default)
81+
82+
```
83+
Account: B62qre3erTHfzQckNuibViWQGyyKwZseztqrjPZBv6SQF384Rg6ESAy
84+
85+
Balance:
86+
Total: 1000.000000000 MINA
87+
Liquid: 800.000000000 MINA
88+
Locked: 200.000000000 MINA
89+
90+
Nonce: 5
91+
92+
Delegate: B62qkfHpLpELqpMK6ZvUTJ5wRqKDRF3UHyJ4Kv3FU79Sgs4qpBnx5RG
93+
```
94+
95+
### JSON format
96+
97+
```json
98+
{
99+
"account": "B62qre3erTHfzQckNuibViWQGyyKwZseztqrjPZBv6SQF384Rg6ESAy",
100+
"balance": {
101+
"total": "1000000000000",
102+
"total_mina": "1000.000000000",
103+
"liquid": "800000000000",
104+
"liquid_mina": "800.000000000",
105+
"locked": "200000000000",
106+
"locked_mina": "200.000000000"
107+
},
108+
"nonce": "5",
109+
"delegate": "B62qkfHpLpELqpMK6ZvUTJ5wRqKDRF3UHyJ4Kv3FU79Sgs4qpBnx5RG"
110+
}
111+
```
112+
113+
The JSON format includes both nanomina (raw values) and formatted MINA values
114+
for convenience.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: generate
3+
description: Generate a new encrypted key pair
4+
sidebar_position: 3
5+
---
6+
7+
# generate
8+
9+
Generate a new encrypted key pair for use with Mina.
10+
11+
## Basic usage
12+
13+
```bash
14+
mina wallet generate --output /path/to/key
15+
```
16+
17+
## Arguments
18+
19+
**Required:**
20+
21+
- `--output <PATH>` - Path where the encrypted key file will be saved
22+
23+
**Optional:**
24+
25+
- `[PASSWORD]` - Password to encrypt the key. Can be provided as an argument or
26+
via the `MINA_PRIVKEY_PASS` environment variable (recommended for security)
27+
28+
## Example
29+
30+
```bash
31+
# Generate new key with environment variable for password
32+
export MINA_PRIVKEY_PASS="my-secret-password"
33+
mina wallet generate --output ./keys/my-new-wallet
34+
```
35+
36+
This command generates a new random keypair, encrypts the private key with the
37+
provided password, and saves it to the specified path. It also creates a `.pub`
38+
file containing the public key.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Introduction
3+
description: CLI wallet commands for managing accounts and sending transactions
4+
sidebar_position: 15
5+
---
6+
7+
# Wallet operations
8+
9+
The Mina CLI provides wallet functionality for sending transactions and managing
10+
accounts. All wallet operations use encrypted key files and interact with a
11+
running Mina node via GraphQL.
12+
13+
## Introduction
14+
15+
The wallet commands provide a complete set of tools for managing Mina accounts
16+
and sending transactions directly from the command line. These commands handle
17+
key generation, account queries, and transaction submission.
18+
19+
### Prerequisites
20+
21+
Before using wallet commands, you need:
22+
23+
- An encrypted private key file
24+
- The password to decrypt the key
25+
- A running Mina node (local or remote) - only required for sending transactions
26+
and checking balances
27+
28+
### Environment variables
29+
30+
You can set the following environment variables for convenience:
31+
32+
```bash
33+
export MINA_PRIVKEY_PASS="your-password"
34+
export MINA_NETWORK="mainnet" # or "devnet"
35+
```
36+
37+
## Commands
38+
39+
The wallet CLI provides the following commands, each documented in detail in
40+
their respective sections:
41+
42+
- **[address](./address.md)** - Get the public address from an encrypted key
43+
file
44+
- **[balance](./balance.md)** - Query account balance and details using GraphQL
45+
- **[generate](./generate.md)** - Generate a new encrypted key pair
46+
- **[send](./send.md)** - Send a payment transaction to the network
47+
- **[status](./status.md)** - Check the status of a submitted transaction
48+
49+
## Understanding amounts
50+
51+
All amounts in the CLI are specified in **nanomina**:
52+
53+
- 1 MINA = 1,000,000,000 nanomina
54+
- 0.1 MINA = 100,000,000 nanomina
55+
- 0.01 MINA = 10,000,000 nanomina (common minimum fee)
56+
57+
## GraphQL integration
58+
59+
The wallet commands use the node's GraphQL API:
60+
61+
- **Account query** - Fetches current nonce and account information (`balance`
62+
command)
63+
- **sendPayment mutation** - Submits signed transactions to the network (`send`
64+
command)
65+
- **transactionStatus query** - Checks if a transaction is included in the
66+
blockchain (`status` command)
67+
- **pooledUserCommands query** - Lists pending transactions in the mempool
68+
(`status` command)
69+
70+
For more details on the GraphQL API, see the [GraphQL API](../graphql-api.md)
71+
documentation.

0 commit comments

Comments
 (0)