Skip to content
Business
Skill

/moonpay-wallet-statusline

Show MoonPay wallet balances in a compatible CLI status line using a local cache and refresh script. Use when the user asks to "show balances in the status bar", "add wallet to the CLI status line", or wants a persistent balance display while working.

BOOST
From plugin
moonpay-skills
11142 skills
Install
$ npx -y skills add moonpay/skills --skill moonpay-wallet-statusline --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/moonpay-wallet-statusline

Context preview

The summary Claude sees to decide when to auto-load this skill.

Show MoonPay wallet balances in a compatible CLI status line using a local cache and refresh script. Use when the user asks to "show balances in the status bar", "add wallet to the CLI status line", or wants a persistent balance display while working.

SKILL.md

moonpay-wallet-statusline.SKILL.md
name: moonpay-wallet-statusline
description: >
  Show MoonPay wallet balances in a compatible CLI status line using a local
  cache and refresh script. Use when the user asks to "show balances in the
  status bar", "add wallet to the CLI status line", or wants a persistent
  balance display while working.
tags: [wallet, statusline]

Wallet status line

Goal

Display cached MoonPay wallet balances in a compatible CLI status line. This skill creates:

  • `~/.config/moonpay/statusline.json` — tracked wallets, chains, and format
  • `~/.config/moonpay/refresh-statusline.sh` — refreshes balances from the MoonPay CLI
  • `~/.config/moonpay/statusline-cache.txt` — pre-rendered ANSI output for the status line

Any compatible status display can read the cache file directly.

Prerequisites

  • MoonPay CLI installed: `npm i -g @moonpay/cli`
  • Authenticated: `mp login` then `mp verify`
  • At least one wallet: `mp wallet list`
  • `jq` installed: `which jq`
  • `bc` installed: `which bc`
  • For status line integration: the target CLI supports a command-based status line or any equivalent scriptable status bar

Commands

# List wallets
mp wallet list
mp --json wallet list

# Fetch balances (used by the refresh script)
mp --json bitcoin balance retrieve --wallet <btc-address>
mp --json token balance list --wallet <address> --chain <chain>

# Refresh the status line cache
bash ~/.config/moonpay/refresh-statusline.sh

Supported chains

`solana`, `ethereum`, `base`, `polygon`, `arbitrum`, `optimism`, `bnb`, `avalanche`, `tron`, `bitcoin`, `ton`, `filecoin`

Bitcoin uses a separate command (`mp bitcoin balance retrieve`) and does not return USD values, so it is excluded from USD totals.

Workflow

1. Verify prerequisites

Run:

mp verify
mp wallet list
which jq
which bc

If the user wants integration with a specific CLI, verify that CLI's status line entry point too.

Examples:

# Claude Code
test -f ~/.claude/statusline.sh && echo "statusline script present"

# Cursor CLI
test -f ~/.cursor/statusline.sh && echo "cursor statusline script present"

If the target CLI does not yet have a status line configured, help the user set that up first, then come back to this skill.

2. Select wallet addresses and chains

Run `mp wallet list` and ask the user which wallet address(es) to track. Create one config entry per address and per chain.

Skip testnets/devnets by default. Exclude chains containing:

  • `testnet`
  • `devnet`
  • `sepolia`
  • `amoy`
  • `tempo`

3. Select display format

  • `amount` — symbol + balance (example: `BTC 0.00071`)
  • `amount+usd` — symbol + balance + USD when available (example: `mpSOL 0.00092 ($0.08)`)
  • `total+breakdown` — total USD first, then token breakdown (example: `$12.48 | SOL 0.03 ($4.55) | USDC 7.93 ($7.93)`)

If the same symbol appears on multiple chains, keep separate entries rather than merging them.

4. Write config

Create the config directory if needed:

mkdir -p ~/.config/moonpay

Write `~/.config/moonpay/statusline.json`. Each entry must represent exactly one wallet address on exactly one chain. Prefer storing the resolved address directly instead of a wallet name.

{
  "entries": [
    {
      "label": "btc-wallet",
      "address": "bc1qexample...",
      "chain": "bitcoin"
    },
    {
      "label": "base-wallet",
      "address": "0x1234...abcd",
      "chain": "base"
    },
    {
      "label": "sol-wallet",
      "address": "So1anaExamplePubkey...",
      "chain": "solana"
    }
  ],
  "format": "amount+usd"
}

5. Create refresh script

Write `~/.config/moonpay/refresh-statusline.sh`, then make it executable with `chmod +x ~/.config/moonpay/refresh-statusline.sh`.

This script:

1. Reads `~/.config/moonpay/statusline.json` 2. Validates that each config entry has one `address` and one `chain` 3. Fetches balances per configured address and chain 4. Aborts on any configured fetch error, preserving the previous cache 5. Formats ANSI-colored output for the status line 6. Writes the cache atomically 7. Deletes the cache if no balances are found

#!/usr/bin/env bash
set -euo pipefail

CONFIG="$HOME/.config/moonpay/statusline.json"
CACHE="$HOME/.config/moonpay/statusline-cache.txt"
TMP_CACHE="$(mktemp "${CACHE}.tmp.XXXXXX")"

BOLD_CYAN=$'\033[1;36m'
WHITE=$'\033[0;37m'
DIM_GREEN=$'\033[2;32m'
DIM=$'\033[2m'
RESET=$'\033[0m'

cleanup() {
  rm -f "$TMP_CACHE"
}
trap cleanup EXIT

require_bin() {
  command -v "$1" >/dev/null 2>&1 || {
    echo "missing dependency: $1" >&2
    exit 1
  }
}

trim_number() {
  printf "%s" "$1" | sed -E 's/(\.[0-9]*[1-9])0+$/\1/; s/\.0+$//'
}

format_usd() {
  printf '$%.2f' "${1:-0}"
}

join_by() {
  local separator="$1"
  shift
  local first=1
  for item in "$@"; do
    if [[ $first -eq 1 ]]; then
      printf "%s" "$item"
      first=0
    else
      printf "%s%s" "$separator" "$item"
    fi
  done
}

require_bin mp
require_bin jq
require_bin bc

[[ -f "$CONFIG" ]] || exit 1

FORMAT="$(jq -r '.format // "amount"' "$CONFIG")"
ENTRY_COUNT="$(jq '.entries | length' "$CONFIG")"
[[ "$ENTRY_COUNT" -gt 0 ]] || {
  rm -f "$CACHE"
  exit 0
}

declare -a RENDERED=()
USD_TOTAL="0"
HAS_USD_TOTAL=0

while IFS= read -r entry; do
  entry_label="$(jq -r '.label // empty' <<<"$entry")"
  wallet_address="$(jq -r '.address // empty' <<<"$entry")"
  chain="$(jq -r '.chain // empty' <<<"$entry")"

  [[ -n "$wallet_address" && -n "$chain" ]] || {
    echo "invalid config entry: each item needs address and chain" >&2
    exit 1
  }

  if [[ "$chain" == "bitcoin" ]]; then
    if ! btc_json="$(mp --json bitcoin balance retrieve --wallet "$wallet_address" 2>/dev/null)"; then
      echo "failed to fetch bitcoin balance for ${entry_label:-$wallet_address}" >&2
      exit 1
    fi

    btc_amount="$(jq -r '.total.btc // empty' <<<"$btc_json")"
    [[ -n "$btc_amount" && "$btc_amount" != "0" ]] || continue

    amount_display="$(trim_number "$btc_amount")"
    RENDERED+=("${BOLD
Read more
Ships withmoonpay-skills

Agent Skills for crypto infrastructure — wallet management, token trading, cross-chain bridges, fiat on/off ramp, prediction markets, and more. Skills are instructional folders that AI agents load dynamically to perform specialized tasks.

Get the whole plugin

Other skills on moonpay-skills.