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 intents

Global Options

OptionDescription
-m, --methodPayment method (standard|intents, default: intents)
-c, --configPath to config file
--rpc-urlRPC URL for standard provider
-a, --accountAccount ID for standard provider
-k, --private-keyPrivate key for standard provider
--api-keyAPI key for intents provider
-v, --verboseVerbose 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"
OptionDescription
-r, --recipientRecipient account ID
-n, --amountAmount to send
-t, --tokenToken (near|usdc|usdt, default: near)
-o, --memoMemo to include

mpp-near register

Register a new OutLayer custody wallet for gasless operations.

mpp-near register

Returns 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.near

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 --intents

Opens 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 usdc

mpp-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 10

mpp-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 86400

Returns 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 5

mpp-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.near

mpp-near server

Start a payment server.

# Start server on port 3000
mpp-near server --port 3000 --recipient wallet.near --min-amount 0.001

mpp-near config

Show current configuration.

mpp-near config

Configuration 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 operations
  • MPP_NEAR_QUIET - Suppress info messages