CLI Reference
Complete command-line interface reference for MPP-NEAR. Make gasless payments, swap tokens, and automate agent-to-agent transactions.
For AI Agents & Automated Systems
- ✅ Gasless payments via OutLayer custody wallets
- ✅ Cross-chain token swaps (20+ blockchains)
- ✅ Agent-to-agent payment checks
Installation
git clone https://github.com/kampouse/mpp-near.git
cd mpp-near
cargo install --path . --features intentsGlobal Options
| Option | Description |
|---|---|
-m, --method | Payment method (standard|intents, default: intents) |
-c, --config | Path to config file |
--rpc-url | RPC URL for standard provider |
-a, --account | Account ID for standard provider |
-k, --private-key | Private key for standard provider |
--api-key | API key for intents provider |
-v, --verbose | Verbose output |
Commands
mpp-near pay
Send gasless payments to any NEAR account.
# Basic payment (NEAR)
mpp-near pay --recipient merchant.near --amount 0.1
# Pay with USDC (gasless!)
mpp-near pay --recipient merchant.near --amount 10 --token usdc
# Pay with memo
mpp-near pay --recipient merchant.near --amount 1 --memo "Invoice #123"| Option | Description |
|---|---|
-r, --recipient | Recipient account ID |
-n, --amount | Amount to send |
-t, --token | Token (near|usdc|usdt, default: near) |
-o, --memo | Memo to include |
mpp-near register
Register a new OutLayer custody wallet for gasless operations.
mpp-near registerReturns an API key required for gasless operations. Save it securely - it's shown only once.
mpp-near balance
Check wallet balances.
# Check own balance
mpp-near balance --api-key wk_...
# Check specific account
mpp-near balance --account user.nearmpp-near fund-link
Generate a funding link for your wallet.
# Generate NEAR funding link
mpp-near fund-link --amount 0.1 --token near
# Generate USDC funding link
mpp-near fund-link --amount 10 --token usdc --memo "Top up"
# Fund to intents balance (for gasless operations)
mpp-near fund-link --amount 1 --token near --intentsOpens a browser link to fund your wallet. Auto-registers storage for the recipient.
mpp-near handoff
Show wallet management URL.
mpp-near handoff --api-key wk_...Use to configure spending policies, view transaction history, and set up multi-sig approval.
mpp-near storage-deposit
Register storage for an account (required before receiving tokens).
# Register storage for own account
mpp-near storage-deposit --token usdc
# Register storage for another account
mpp-near storage-deposit --account merchant.near --token usdcmpp-near swap
Swap tokens across 20+ blockchains (gasless).
# Swap NEAR to USDC
mpp-near swap --from near --to usdc --amount 1
# Swap USDT to NEAR
mpp-near swap --from usdt --to near --amount 10mpp-near tokens
List available tokens for swapping.
mpp-near tokens --api-key wk_...mpp-near create-check
Create a payment check (intents only).
# Create check for 10 USDC
mpp-near create-check --amount 10 --token usdc
# Create check with memo and expiry
mpp-near create-check --amount 10 --token usdc --memo "Payment" --expires-in 86400Returns a check key to share with the recipient. The check can be claimed using claim-check.
mpp-near claim-check
Claim a payment check (intents only).
# Claim entire check
mpp-near claim-check --check-key chk_...
# Claim partial amount
mpp-near claim-check --check-key chk_... --amount 5mpp-near verify
Verify a transaction.
# Verify transaction
mpp-near verify --tx-hash 0x...
# Verify with expected amount and recipient
mpp-near verify --tx-hash 0x... --expected-amount 0.1 --expected-recipient merchant.nearmpp-near server
Start a payment server.
# Start server on port 3000
mpp-near server --port 3000 --recipient wallet.near --min-amount 0.001mpp-near config
Show current configuration.
mpp-near configConfiguration File
Create a config file at ~/.mpp-near/config.toml or .mpp-config:
method = "intents"
[intents]
api_key = "wk_..."
api_url = "https://api.outlayer.fastnear.com"
[standard]
account = "user.near"
private_key = "ed25519:..."
rpc_url = "https://rpc.mainnet.near.org"Environment Variables
MPP_NEAR_API_KEY- OutLayer API key for gasless operationsMPP_NEAR_QUIET- Suppress info messages