Add "total exposure" notice to stream permissions#279
Merged
jeffsmale90 merged 13 commits intomainfrom Mar 11, 2026
Merged
Conversation
…total exposure over the lifetime of the permission
packages/gator-permissions-snap/test/permissions/nativeTokenStream/content.test.ts
Outdated
Show resolved
Hide resolved
packages/gator-permissions-snap/src/permissions/nativeTokenStream/content.tsx
Outdated
Show resolved
Hide resolved
- sentence case labels - change stream rate to text rather than disabled field
packages/gator-permissions-snap/src/permissions/erc20TokenStream/content.tsx
Outdated
Show resolved
Hide resolved
- TextField now has direction parameter that allows for vertical (label above) and horizontal (label left) - stream rate and Total exposure also use TextField - Fields with no value are not displayed when they are uneditable (isAdjustmentAllowed: false)
c1d159d to
32981b3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The "stream" permissions are very complex, and it's difficult to determine the total amount that a given permission exposes to the recipient.
This PR updates
erc20-token-streamandnative-token-streampermissions to add a "total exposure" notice. This will show as a field similar to "Amount per second".Minor refresh of uneditable fields:
Manual testing steps
Add / remove expiry and max amount and adjust the token amounts to validate different outcomes.
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds new exposure calculation and surfaces it in the confirmation UI for stream permissions; incorrect math/formatting could misrepresent a permission’s effective limits to users.
Overview
Adds a “Total exposure” display to
erc20-token-streamandnative-token-streamconfirmation screens, derived from max amount and/or stream duration (expiry) and shown asUnlimitedwhen uncapped.Introduces
deriveExposureForStreamingPermissioninpermissions/rules.ts, threadstotalExposurethrough streamderiveMetadata/metadata types, and updates stream rate rendering to use display-styleFieldcomponents instead of disabled inputs.Refreshes uneditable field rendering across
InputField,DateTimePickerField,DropdownField,TextField, andField(vertical layout + hide empty uneditable values), updates English copy from expiry to expiration date, and adjusts snapshots/tests accordingly.Written by Cursor Bugbot for commit 32981b3. This will update automatically on new commits. Configure here.