Skip to content

feat(python): add builder-code settlement metadata m - #35

Closed
PhilBot402 wants to merge 1 commit into
mainfrom
philbotpython-builder-code-m-f533
Closed

PhilBot402 wants to merge 1 commit into
mainfrom
philbotpython-builder-code-m-f533

Conversation

@PhilBot402

Copy link
Copy Markdown
Owner

Port of x402-foundation#3666 from TypeScript/Go to Python SDK.

Python v2 builder-code now encodes and parses facilitator-authored ERC-8021 Schema 2 settlement metadata (m). DataSuffixContext carries that metadata, metadata alone emits a suffix, and any m on the client payload is ignored. Encoding fails when the CBOR is larger than 65,535 bytes. Unsigned integers, text, arrays, and text-keyed maps round-trip, and map keys are sorted bytewise. This is the Python item on x402-foundation#3716. uv run pytest tests/unit/extensions/builder_code tests/unit/mechanisms/evm passed 952 tests, and ruff format and check passed.

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge) -- you may need to rebase if you initially pushed unsigned commits
  • I added a changelog fragment for user-facing changes (docs-only changes can skip)

AI disclosure: Automated by @phdargen. Use your own judgement

Open in Web Open in Cursor 

Port the facilitator-authored ERC-8021 Schema 2 field from the TypeScript and Go SDKs. Python now encodes and parses m, emits a suffix from metadata alone, ignores client-supplied m, and rejects CBOR larger than 65,535 bytes.

Co-authored-by: phdargen <phdargen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant