关于 moonpay-block-explorer
moonpay-block-explorer 是用于查找区块链浏览器链接的技能,覆盖交易、钱包和代币页面。它根据链选择对应浏览器,并说明如何从 MoonPay 命令结果中提取信息并打开页面。
主要功能
- 01生成多条链的交易浏览器链接
- 02打开钱包地址页面
- 03打开代币合约页面
- 04从交易结果提取链和哈希
- 05提供 macOS 与 Linux 打开方式
适用场景
- 01查看兑换或跨链交易结果
- 02检查钱包链上活动
- 03查看代币合约与持有者信息
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ moonpay/ skills --skill moonpay-block-explorer安装后在 Claude Code 中输入/moonpay-block-explorer确认已加载。
详细介绍
区块浏览器
目标
完成兑换、跨链或转账后,在正确的区块浏览器中打开结果。也可用于查看钱包地址和代币合约页面。
浏览器 URL
| 链 | 交易 | 钱包 | 代币 |
|---|---|---|---|
| solana | https://solscan.io/tx/{sig} | https://solscan.io/account/{addr} | https://solscan.io/token/{addr} |
| ethereum | https://etherscan.io/tx/{hash} | https://etherscan.io/address/{addr} | https://etherscan.io/token/{addr} |
| base | https://basescan.org/tx/{hash} | https://basescan.org/address/{addr} | https://basescan.org/token/{addr} |
| polygon | https://polygonscan.com/tx/{hash} | https://polygonscan.com/address/{addr} | https://polygonscan.com/token/{addr} |
| arbitrum | https://arbiscan.io/tx/{hash} | https://arbiscan.io/address/{addr} | https://arbiscan.io/token/{addr} |
| optimism | https://optimistic.etherscan.io/tx/{hash} | https://optimistic.etherscan.io/address/{addr} | https://optimistic.etherscan.io/token/{addr} |
| bnb | https://bscscan.com/tx/{hash} | https://bscscan.com/address/{addr} | https://bscscan.com/token/{addr} |
| avalanche | https://snowscan.xyz/tx/{hash} | https://snowscan.xyz/address/{addr} | https://snowscan.xyz/token/{addr} |
| bitcoin | https://mempool.space/tx/{txid} | https://mempool.space/address/{addr} | — |
打开交易
完成兑换或跨链后,提取链和交易哈希,然后打开:
# macOS
open "https://solscan.io/tx/5rQ52JVb6q7H..."
# Linux
xdg-open "https://etherscan.io/tx/0xabcd..."
从兑换/跨链输出中获取
mp token swap 和 mp token bridge 会返回包含交易签名的结果。根据链选择正确的浏览器。
RESULT=$(mp --json token swap --wallet main --chain solana \
--from-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--from-amount 1 \
--to-token So11111111111111111111111111111111111111111)
# Open in browser
SIG=$(echo "$RESULT" | jq -r '.signature')
open "https://solscan.io/tx/$SIG"
从交易列表中获取
mp transaction list 会返回包含 from.txHash 和 to.txHash 的交易。根据链字段选择浏览器:
# View most recent transaction
TX=$(mp --json transaction list --wallet <addr> | jq -r '.items[0].from.txHash')
CHAIN=$(mp --json transaction list --wallet <addr> | jq -r '.items[0].from.chain')
# Build URL from chain → explorer table above
打开钱包
查看钱包地址的所有链上活动:
# Solana wallet
open "https://solscan.io/account/N39jn2g1tA7dmdyyoHt9yiQegQoVhnfQzq1ZzuZRF9e"
# EVM wallet (same address works on any EVM explorer)
open "https://etherscan.io/address/0xf9e39F70d7636902e57a89C18B1BE39EBb5b9589"
从以下命令获取钱包地址:mp wallet list 或 mp wallet retrieve --wallet <name>
打开代币页面
在浏览器中查看代币合约、持有者和市场数据:
# USDC on Solana
open "https://solscan.io/token/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
# USDC on Ethereum
open "https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
从以下命令获取代币地址:mp token search --query "USDC" --chain solana
打开结账 URL
mp buy 会返回结账 URL。直接打开即可:
URL=$(mp --json buy --token sol --amount 1 --wallet <addr> --email <email> | jq -r '.url')
open "$URL"
平台检测
if [[ "$OSTYPE" == "darwin"* ]]; then
open "$URL"
else
xdg-open "$URL"
fi
提示
- 完成任何兑换、跨链或转账后,可选择在浏览器中打开结果
- EVM 钱包在所有 EVM 链上共用一个地址,同一地址可在 etherscan、basescan、polygonscan 等浏览器中使用。
- Bitcoin 使用
mempool.space,没有代币页面,只有交易和地址页面。 - Solana 签名是 base58 字符串,EVM 交易哈希以
0x开头。
相关技能
- moonpay-swap-tokens — 生成交易签名的兑换和跨链命令
- moonpay-buy-crypto — 返回结账 URL 的购买命令
- moonpay-check-wallet — 获取钱包地址,以便在浏览器中查看
评论
支持 Markdown