Skip to content

feat(tron): add TRC20 approval resource sponsoring extension - #84

Open
boboliu-1010 wants to merge 22 commits into
mainfrom
feat/trc20-approval-resource-sponsoring-v1.2.0
Open

feat(tron): add TRC20 approval resource sponsoring extension#84
boboliu-1010 wants to merge 22 commits into
mainfrom
feat/trc20-approval-resource-sponsoring-v1.2.0

Conversation

@boboliu-1010

@boboliu-1010 boboliu-1010 commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds the TRC20 Approval Resource Sponsoring extension on top of the released v1.1.0 baseline, targeting the v1.2.0 release of the TypeScript Extensions and TRON packages.

This PR:

  • carries forward the x402 v2 specification migration from docs: migrate and update x402 v2 specifications #81;
  • defines the TRC20 approval resource sponsoring protocol and wire format;
  • implements client, server, and facilitator extension hooks;
  • validates the exact signed approval transaction before broadcast;
  • delegates and reclaims TRON Energy and Bandwidth around approval;
  • requires an intent-aware Resource Owner signer, a non-owner Active Permission, and strict local JSON/protobuf validation before and after signing;
  • durably recovers every non-terminal sponsorship state and only replaces an Undelegate after its original txID is confirmed failed;
  • submits Undelegate recovery debt before continuing Permit2 settlement, while confirmation and capacity release run asynchronously;
  • adds unit, integration, and repeatable Nile end-to-end examples;
  • adds changesets for minor releases of @bankofai/x402-extensions and @bankofai/x402-tron.

Tests

  • Core: 649 tests passed
  • Extensions: 531 tests passed
  • TRON: 215 tests passed
  • Core, Extensions, and TRON CJS/ESM/DTS builds passed
  • Facilitator example TypeScript check passed
  • TRON lint and formatting checks passed
  • Nile fresh-wallet end-to-end flow passed: activation, funding, verification, resource delegation, approval, Permit2 payment settlement, asynchronous recovery reconciliation, and zero remaining delegation
  • Nile settlement transaction: c5b08dbb68db496a97314a4eb82c3e7a53429ebed9d3182f424c6f0420bfd84c

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge)

@Will-Guan
Will-Guan requested a review from roger-gan August 26, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants