nansen-mpp-payment
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMPP / Tempo
MPP / Tempo
The Nansen API supports three paid-access rails: API key, x402 (handled by ), and MPP via Tempo (handled by the separate tempo CLI). This skill covers the third.
nansen-clinansen-clitempo requestFor API-key auth, see . For x402 micropayment with a local wallet, see / .
nansen-wallet-managernansen-tradingnansen-wallet-managerNansen API支持三种付费访问方式:API密钥、x402(由处理)以及通过Tempo实现的MPP(由独立的tempo CLI处理)。本技能介绍的是第三种方式。
nansen-clinansen-clitempo request如需了解API密钥认证方式,请查看。如需了解使用本地钱包的x402微支付方式,请查看 / 。
nansen-wallet-managernansen-tradingnansen-wallet-managerWhen to use this skill
何时使用本技能
- User says "MPP", "tempo", "Authorization: Payment", or "Payment-Receipt".
- User has no Nansen API key and doesn't want to set up a Base/Solana wallet.
- User is already paying for other APIs through tempo and wants Nansen on the same rail.
- 用户提及“MPP”、“tempo”、“Authorization: Payment”或“Payment-Receipt”时。
- 用户没有Nansen API密钥且不想设置Base/Solana钱包时。
- 用户已经通过tempo为其他API付费,希望将Nansen接入同一支付渠道时。
One-time setup
一次性设置
bash
undefinedbash
undefined1. Install the tempo CLI
1. Install the tempo CLI
curl -fsSL https://tempo.xyz/install | bash
curl -fsSL https://tempo.xyz/install | bash
2. Log in (creates / unlocks the tempo wallet)
2. Log in (creates / unlocks the tempo wallet)
tempo wallet login
tempo wallet login
3. Fund it with USDC on the chain tempo selects for your environment
3. Fund it with USDC on the chain tempo selects for your environment
tempo wallet fund
tempo wallet fund
4. Confirm the wallet is ready
4. Confirm the wallet is ready
tempo wallet whoami
undefinedtempo wallet whoami
undefinedCalling the Nansen API
调用Nansen API
tempo requestAuthorization: PaymentWWW-Authenticate: Payment ...Payment-Receiptbash
undefinedtempo requestWWW-Authenticate: Payment ...Authorization: PaymentPayment-Receiptbash
undefinedSmart Money netflow
Smart Money netflow
tempo request POST https://api.nansen.ai/api/v1/smart-money/netflow
--json '{"chains":["solana"],"pagination":{"page":1,"page_size":10}}'
--json '{"chains":["solana"],"pagination":{"page":1,"page_size":10}}'
tempo request POST https://api.nansen.ai/api/v1/smart-money/netflow
--json '{"chains":["solana"],"pagination":{"page":1,"page_size":10}}'
--json '{"chains":["solana"],"pagination":{"page":1,"page_size":10}}'
TGM holders
TGM holders
tempo request POST https://api.nansen.ai/api/v1/tgm/holders
--json '{"token_address":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","chain":"solana"}'
--json '{"token_address":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","chain":"solana"}'
Endpoint paths and request shapes are the same as the rest of the Nansen API — run `nansen schema <command>` (no API key required) to look up the body shape, then call the matching `/api/v1/...` path through `tempo request`.tempo request POST https://api.nansen.ai/api/v1/tgm/holders
--json '{"token_address":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","chain":"solana"}'
--json '{"token_address":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","chain":"solana"}'
端点路径和请求格式与Nansen API的其他部分一致——运行`nansen schema <command>`(无需API密钥)即可查看请求体格式,然后通过`tempo request`调用对应的`/api/v1/...`路径。Discovering paid endpoints
发现付费端点
bash
curl https://api.nansen.ai/.well-known/x402Returns (when MPP is enabled server-side) and the list of paid resources.
paymentProtocols: ["x402", "mpp"]bash
curl https://api.nansen.ai/.well-known/x402返回内容包含(当MPP在服务器端启用时)以及付费资源列表。
paymentProtocols: ["x402", "mpp"]How MPP differs from x402
MPP与x402的区别
| x402 (nansen-cli native) | MPP via tempo (this skill) | |
|---|---|---|
| Header sent on retry | | |
| 402 challenge header | | |
| Success header | (none) | |
| Wallet | local, Privy, or WalletConnect — managed by | tempo-managed (separate CLI) |
| Chains | Base USDC, Solana SPL USDC, X Layer USDT0 | Tempo's chain (mainnet |
| nansen-cli code path | | not handled — call via |
| x402(nansen-cli原生支持) | MPP via tempo(本技能) | |
|---|---|---|
| 重试时发送的头信息 | | |
| 402挑战头信息 | | |
| 成功响应头信息 | (无) | |
| 钱包 | 本地钱包、Privy或WalletConnect —— 由 | 由tempo管理(独立CLI) |
| 链 | Base USDC、Solana SPL USDC、X Layer USDT0 | Tempo指定的链(生产环境为主网 |
| nansen-cli代码路径 | | 不处理——直接通过 |
Notes
注意事项
- MPP is server-side opt-in. If returns a 402 without
tempo request, MPP isn't enabled for that endpoint/environment — fall back to an API key or x402.WWW-Authenticate: Payment - Don't try to add flags to
--mpp-*— the supported integration is "use tempo separately". If the user asks for tighter integration, point them at this skill and confirm the requirement before adding code.nansen-cli - Per-request price is the same as x402 (1 credit ≈ $0.001 with 10x markup, e.g. 1-credit endpoints cost $0.01).
- MPP需要服务器端启用。如果返回402但未携带
tempo request头信息,则该端点/环境未启用MPP——请改用API密钥或x402方式。WWW-Authenticate: Payment - 不要尝试给添加
nansen-cli参数——支持的集成方式是“单独使用tempo”。如果用户要求更紧密的集成,请引导他们查看本技能,并在添加代码前确认需求。--mpp-* - 单次请求的价格与x402相同(1积分≈0.001美元,加价10倍后,例如1积分的端点费用为0.01美元)。
Source
参考来源
- npm: https://www.npmjs.com/package/nansen-cli
- GitHub: https://github.com/nansen-ai/nansen-cli
- MPP protocol: https://mpp.dev/protocol
- Tempo docs: https://docs.tempo.xyz
- npm: https://www.npmjs.com/package/nansen-cli
- GitHub: https://github.com/nansen-ai/nansen-cli
- MPP协议: https://mpp.dev/protocol
- Tempo文档: https://docs.tempo.xyz