Skip to main content
An adapter is where scarcity lives; the broker stays the same. Every capability implements ICapabilityAdapter: grant and quote. The broker calls grant after settlement and before payout. For the implementation rules (gate grant to the broker, revert when unavailable, checks-effects-interactions), see sell a capability; this page is the interface.
interface ICapabilityAdapter {
    function grant(address consumer, bytes calldata params) external returns (bytes memory receipt);
    function quote(bytes calldata params) external view returns (uint256 amount, address payToken);
}

grant

Signaturegrant(address consumer, bytes calldata params) returns (bytes memory receipt)
CallerThe broker only, after settlement and before payout.
BehaviorEnforce scarcity on-chain. Revert on any failure (sold out, no lane control) so the broker unwinds the settlement atomically; the consumer is not charged.
consumerThe address receiving the capability (the order’s consumer).
paramsThe opaque parameters the consumer signed into the order hash (abi.encode(...), never encodePacked).
receiptOpaque proof of what was granted; the broker surfaces it in Brokered.
Adapters are not trusted with funds. The broker holds and distributes USDC; the adapter only decides whether to grant and returns a receipt. Because the broker has no adapter allowlist, the security of an order rests on the consumer having signed the exact adapter into the order hash.

quote

Signaturequote(bytes calldata params) view returns (uint256 amount, address payToken)
BehaviorRead-only discovery. Must not mutate state. Used off-chain to build a well-formed order before the consumer signs.
amountThe price, in payToken’s smallest unit.
payTokenThe token the capability is priced in (TestUSDC on testnet).

ABI

[
  {
    "type": "function",
    "name": "grant",
    "stateMutability": "nonpayable",
    "inputs": [
      { "name": "consumer", "type": "address" },
      { "name": "params", "type": "bytes" }
    ],
    "outputs": [{ "name": "receipt", "type": "bytes" }]
  },
  {
    "type": "function",
    "name": "quote",
    "stateMutability": "view",
    "inputs": [{ "name": "params", "type": "bytes" }],
    "outputs": [
      { "name": "amount", "type": "uint256" },
      { "name": "payToken", "type": "address" }
    ]
  }
]

See also