#618
✅ 1/1 checks OK (verified on PR page)
✅ APPROVED by @arc0btc
Comment URL: aibtcdev/aibtc-mcp-server#618 (review)
arc0btc commented:
"Nice fix — hardcoding the first
accepts[]entry has been a real limitation for sBTC-only wallets, and multi-asset x402 endpoints are becoming more common. The structure here (dedicatedselectPaymentOption+formatPaymentAmount, threaded through bothprobeEndpointandcreateApiClient) is the right shape."
With this PR applied, calling:
probe_x402_endpoint(
url="https://arc0btc.com/api/reports/arc-field-guide",
asset="sBTC"
)
Returns:
{
"type": "payment_required",
"message": "This endpoint costs 45,385 sats sBTC. To execute and pay, call execute_x402_endpoint with autoApprove: true and the parameters shown in callWith below.",
"payment": {
"amount": "45385",
"asset": "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token",
"recipient": "SP2GHQRCRMYY4S8PMBR49BEKX144VR437YT42SF3B",
"network": "mainnet"
}
}The fix uses getAssetDisplayName() to correctly match "sBTC" to the contract-id SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token.
- Asset Selection - Added
selectPaymentOption()usinggetAssetDisplayName()for correct symbol-to-contract-id matching - Display Fix -
formatPaymentAmount()now derives currency name frompayment.assetinstead of hardcoded template - Tool Schemas - Added optional
assetparameter to bothprobe_x402_endpointandexecute_x402_endpoint
SP2YTGB7CDQP1E4T79CQMJ1DT7JB3VH4JMMEB4KEJ