@glideco/ap2-adapter
v0.1.0
Published
AP2 (Agent Payments Protocol — Google) wire-format adapter for Glide. Encodes Glide's agent_grants + 13-axis AgentPolicyEnvelope as AP2 IntentMandate / CartMandate / PaymentMandate Verifiable Digital Credentials (VDCs). Pinned to AP2 spec v0.1-alpha. Pure
Maintainers
Readme
@glideco/ap2-adapter
AP2 (Agent Payments Protocol — Google) wire-format adapter for Glide. Encodes Glide's agent_grants + 13-axis AgentPolicyEnvelope as AP2 IntentMandate / CartMandate / PaymentMandate Verifiable Digital Credentials (VDCs). Pinned to AP2 spec v0.1-alpha.
Pure functions, no IO.
Install
npm install @glideco/ap2-adapterUsage
import {
encodeIntentMandate,
encodeCartMandate,
encodePaymentMandate,
validateMandateChain,
} from '@glideco/ap2-adapter';
const intent = encodeIntentMandate({ grant, policy, userDid, agentDid });
// → AP2 IntentMandate VDC envelope (proof block left empty for the caller's signer)License
MIT
Spec version
Pinned to AP2 v0.1-alpha — exported as AP2_SPEC_VERSION. AP2 spec is in alpha and the wire shape may change between minor versions. We pin the version literal in the credential @context so verifiers reject mismatched mandates rather than silently misparsing them.
When AP2 ships v0.2 (or any breaking change to the JSON-LD context), bump this constant in the same PR that updates the encoder logic and re-run the round-trip property tests.
