Skip to content

feat(#548): add TokenGateController for token-gated invoice access - #597

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
Ebuka042-pixel:feature/548-token-gate-controller
Jul 30, 2026
Merged

feat(#548): add TokenGateController for token-gated invoice access#597
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
Ebuka042-pixel:feature/548-token-gate-controller

Conversation

@Ebuka042-pixel

Copy link
Copy Markdown
Contributor
  • Add src/tokenGateController.ts with TokenGateController class
    • verify(callerAccountId, policy) checks Horizon balance
    • throws TokenGateAccessDeniedError when strict + balance insufficient
    • non-strict mode warns instead of throwing
    • caches results via SimpleCache with configurable TTL (default 15s)
  • Add TokenGatePolicy interface to src/types.ts
  • Add accessPolicy field to Invoice interface in src/types.ts
  • Add TokenGateAccessDeniedError to src/errors.ts
  • Integrate into src/client.ts getInvoice(): verify called when accessPolicy set
  • Add tokenGateController + callerAccountId to StellarSplitClientConfig
  • Export from src/index.ts
  • Add unit tests in test/tokenGateController.test.ts
    closes Token-Gated Invoice Access Controller #548

…ice access

- Add src/tokenGateController.ts with TokenGateController class
  - verify(callerAccountId, policy) checks Horizon balance
  - throws TokenGateAccessDeniedError when strict + balance insufficient
  - non-strict mode warns instead of throwing
  - caches results via SimpleCache with configurable TTL (default 15s)
- Add TokenGatePolicy interface to src/types.ts
- Add accessPolicy field to Invoice interface in src/types.ts
- Add TokenGateAccessDeniedError to src/errors.ts
- Integrate into src/client.ts getInvoice(): verify called when accessPolicy set
- Add tokenGateController + callerAccountId to StellarSplitClientConfig
- Export from src/index.ts
- Add unit tests in test/tokenGateController.test.ts
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Ebuka042-pixel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Kingsman-99
Kingsman-99 merged commit d77cc1d into Stellar-split:main Jul 30, 2026
1 check passed
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.

Token-Gated Invoice Access Controller

2 participants