offer_shape: The payee offer is malformed

The payeeOffer is not well formed: its categories must be sorted, unique slugs or exactly ["*"], and issuedAt must not be later than expiresAt. On a human payment, a chain binding (chainId, verifyingContract) must also be typed (scheme: "eip712"). The open is refused and nothing is allocated. An offer with fields of the wrong type or form, no categories or more than 32, or a scheme other than eip712 answers 400 invalid_request first; so does any scheme, chainId or verifyingContract in the offer of a stream open. A child open on the plugin wire answers such an offer with 400 {"error": "malformed child request"}.

What to do

On the wire

HTTP 409, error type state_error.

With Dynamo-Error-Detail: 1:

{
  "error": "state",
  "reason": "offer_shape",
  "detail": "…",
  "errorDetail": {
    "type": "state_error",
    "code": "offer_shape",
    "message": "…",
    "param": "delegation",
    "doc_url": "…/errors/offer_shape.md",
    "fix": "the payee offer is malformed (sorted unique category slugs or [\"*\"], issuedAt <= expiresAt)"
  }
}

Without Dynamo-Error-Detail: 1 a stream open or a human payment receives the same body with no errorDetail. A child open on the plugin wire (POST /plugin/v1/streams/{id}/children) answers 409 {"error": "child open refused (fail closed)", "reason": "offer_shape"}, never with errorDetail.

The child adoption preparation on contract v2 (POST /owner/v1/streams/{id}/children/adopt-prepare) checks its payeeOffer the same way and sends errorDetail to every client.

See all error codes.