#!/bin/sh
# Verify an AstraNL receipt through the A2A door (A2A v1.0 JSON-RPC, skill verify). No key.
# The A2A door carries verify; the estimate itself comes from the MCP or HTTPS door.
REF=${1:?usage: a2a_verify.sh alk_...}
curl -s https://astranl.com/a2a -H 'Content-Type: application/json' -H 'A2A-Version: 1.0' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"SendMessage\",\"params\":{\"message\":{\"role\":\"ROLE_USER\",\"messageId\":\"m1\",\"parts\":[{\"data\":{\"ref\":\"$REF\"}}],\"metadata\":{\"skill\":\"verify\"}}}}" \
  | jq -r '.result.message.parts[0].text' | jq '{verdict: .integrity.verdict, proof_level: .integrity.proof_level}'
