⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/gator-permissions-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Bump `@metamask/transaction-controller` from `^62.11.0` to `^62.17.0` ([#7775](https://github.com/MetaMask/core/pull/7775), [#7802](https://github.com/MetaMask/core/pull/7802), [#7832](https://github.com/MetaMask/core/pull/7832), [#7854](https://github.com/MetaMask/core/pull/7854), [#7872](https://github.com/MetaMask/core/pull/7872)), ([#7897](https://github.com/MetaMask/core/pull/7897))
- **BREAKING:** Refactor `GatorPermissionsController`: simplified config, permission storage, and public API ([#7847](https://github.com/MetaMask/core/pull/7847))
- Constructor now requires `config`, internal configuration is removed from controller state
- New `initialize()` function performs a syncronisation process if required when the controller is first initialized
- Replaces `gatorPermissionsMapSerialized` with `grantedPermissions` property in internal state, replaces related types, and utility functions
- `fetchAndUpdateGatorPermissions()` no longer accepts parameters and resolves to `void`
- `getPendingRevocations` / `pendingRevocations` getter replaced by `isPendingRevocation(permissionContext)`; list on `state.pendingRevocations`
- Bump `@metamask/transaction-controller` from `^62.11.0` to `^62.17.0` ([#7775](https://github.com/MetaMask/core/pull/7775), [#7802](https://github.com/MetaMask/core/pull/7802), [#7832](https://github.com/MetaMask/core/pull/7832), [#7854](https://github.com/MetaMask/core/pull/7854), [#7872](https://github.com/MetaMask/core/pull/7872)), ([#7897](https://github.com/MetaMask/core/pull/7897))>>>>>>> Stashed changes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git conflict marker accidentally left in CHANGELOG

High Severity

Line 18 ends with >>>>>>> Stashed changes, a git stash conflict marker that was accidentally committed. This will render visibly in the published changelog and signals an incomplete merge resolution.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this in the release PR


## [1.1.2]

Expand Down
25 changes: 15 additions & 10 deletions packages/gator-permissions-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ or
```typescript
import { GatorPermissionsController } from '@metamask/gator-permissions-controller';

// Create the controller
// Create the controller with required config
const gatorPermissionsController = new GatorPermissionsController({
messenger: yourMessenger,
config: {
supportedPermissionTypes: [
'native-token-stream',
'native-token-periodic',
'erc20-token-stream',
'erc20-token-periodic',
'erc20-token-revocation',
],
// Optional: override the default gator permissions provider Snap id
// gatorPermissionsProviderSnapId: 'npm:@metamask/gator-permissions-snap',
},
});

// Enable the feature (requires authentication)
gatorPermissionsController.enableGatorPermissions();
```

### Fetch from Profile Sync
Expand All @@ -33,12 +41,9 @@ gatorPermissionsController.enableGatorPermissions();
const permissions =
await gatorPermissionsController.fetchAndUpdateGatorPermissions();

// Fetch permissions with optional filter params
const filteredPermissions =
await gatorPermissionsController.fetchAndUpdateGatorPermissions({
origin: 'https://example.com',
chainId: '0x1',
});
// Fetch permissions and update internal state
const permissions =
await gatorPermissionsController.fetchAndUpdateGatorPermissions();
```

## Contributing
Expand Down
Loading
Loading