@magicblock-labs/mirage
v0.4.1
Published
CLI for MagicBlock private payments, wallet funding, and Open Wallet Standard workflows.
Maintainers
Readme
Packages
| Package | Description | Version | Docs |
|:--------------------------|:---------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------|
| @magicblock-labs/mirage | Commander-based CLI for MagicBlock private payments and wallet flows | |
|
Install
npm install -g @magicblock-labs/mirageAfter install, the CLI is available as:
mirage --helpMirage includes built-in support for Open Wallet Standard (OWS), and exposes the bundled CLI through mirage ows ....
Mirage also uses the shared OWS config at ~/.ows/config.json for its default Solana RPC.
What It Does
mirage addressprints the Solana public key for an OWS walletmirage balanceshows the wallet balance throughows fund balancemirage fundopenshttps://one.magicblock.app/in the browser withrcv=<wallet-pubkey>mirage transferaccepts UI amounts like0.1, defaults--mintto mainnet USDC, resolves mint decimals over Solana RPC, builds a transaction from the MagicBlock payments API, signs it with OWS, and sends it on Solanamirage swapaccepts UI amounts, fetches a MagicBlock swap quote, builds the unsigned swap transaction, signs it with OWS, and sends it on Solanamirage ows ...forwards directly to the bundledowsCLImirage api ...exposes low-level commands generated from the checked-in OpenAPI schemamirage invoke ...allow to create arbitrary transaction using a program IDL (onchain or manually provided)
mirage address, mirage balance, mirage fund, mirage transfer, and mirage swap default to the agent-treasury wallet. If agent-treasury does not exist yet, Mirage creates it automatically before running the command. Passing --wallet <name> uses that existing OWS wallet instead.
Examples
mirage address
mirage address --wallet agent-treasury-1
mirage balance
mirage balance --wallet agent-treasury-1
mirage fund
mirage fund --wallet agent-treasury-1
mirage transfer \
--to <recipient> \
--amount 0.1
# equivalent explicit mint
mirage transfer \
--to <recipient> \
--mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--amount 0.1
mirage swap \
--input-mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--output-mint Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB \
--amount 1 \
--slippage-bps 50
mirage ows sign message --wallet agent-treasury --chain solana --message "hello"
mirage invoke 852a53jomx7dGmkpbFPGXNJymRxywo3WsH1vusNASJRr --cluster devnetSkills
This repo includes a reusable agentic Solana wallet skill in skills/mirage-solana-wallet/SKILL.md.
- Install it from GitHub with
npx skills add magicblock-labs/mirage. - To install this specific skill non-interactively, use
npx skills add magicblock-labs/mirage --skill mirage-solana-wallet. - The skill covers creating Solana wallets with
mirage ows wallet create, funding wallets throughmirage fund, invoking any Anchor program by its IDL withmirage invoke(interactive or via non-interactive--show-idl/--ix/--arg/--account/--dry-runflags for agents and scripts), sending public or private SPL transfers withmirage transfer, building swaps withmirage swap, and signing arbitrary Solana transactions withmirage ows sign tx.
Development
npm install
npm run build
npm testOpenAPI codegen commands:
npm run openapi:generate
npm run openapi:update -- "/path/to/api.json"