Skip to content
Open
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0987569
feat: added rewards controller and rewards data service messenger
satyajeetkolhapure Sep 8, 2025
6428e5d
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 8, 2025
02f32cc
fix: lint issues
satyajeetkolhapure Sep 8, 2025
f6c0f35
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 8, 2025
9890457
fix: reverted yarn lock
satyajeetkolhapure Sep 8, 2025
5b75ddd
fix: reverted yarn lock to the first commit
satyajeetkolhapure Sep 8, 2025
1cac54a
fix: removed dependencies from rewards controller package
satyajeetkolhapure Sep 8, 2025
a85d2f9
fix: lint errors
satyajeetkolhapure Sep 9, 2025
ac0b219
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 9, 2025
0bd1b81
fix: changed solana package version
satyajeetkolhapure Sep 9, 2025
0d6137a
fix: changed versions and added yarn lock
satyajeetkolhapure Sep 9, 2025
0bcbd36
fix: added codeowner and @metamask/keyring-controller package
satyajeetkolhapure Sep 9, 2025
06db6e8
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 9, 2025
973b461
fix: corrected the codeowner for rewards controller
satyajeetkolhapure Sep 9, 2025
7a30821
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 9, 2025
2181c1e
fix: added description in changelog
satyajeetkolhapure Sep 9, 2025
a9e8da1
fix: lint issues
satyajeetkolhapure Sep 9, 2025
89e902c
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 9, 2025
fe71c1e
PR Review: merge controller changes
VGR-GIT Sep 9, 2025
110488e
Merge branch 'main' into feat/add-rewards-controller
VGR-GIT Sep 9, 2025
84368f8
fix: improved test coverage
satyajeetkolhapure Sep 9, 2025
3622ff4
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 9, 2025
ca05e0b
fix: added references in tsconfig.build.json
satyajeetkolhapure Sep 9, 2025
5d2ab1a
fix: improved test coverage
satyajeetkolhapure Sep 10, 2025
0f0bfb2
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 10, 2025
dab912c
fix: added getPointsEvents change
satyajeetkolhapure Sep 10, 2025
8e8c8e1
fix: made 100% test coverage
satyajeetkolhapure Sep 10, 2025
5e485e6
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 10, 2025
aaadd5d
fix: lint issues
satyajeetkolhapure Sep 10, 2025
6438b46
fix: formatting issue with changelog
satyajeetkolhapure Sep 10, 2025
cd6b4df
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 10, 2025
1719e26
fix: formatting issue with changelog
satyajeetkolhapure Sep 10, 2025
a5324a6
fix: formatting issue with changelog
satyajeetkolhapure Sep 10, 2025
bcb55ab
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 10, 2025
cd16b6f
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 10, 2025
989d789
fix: formatting issue with changelog
satyajeetkolhapure Sep 10, 2025
b830342
fix: cursor review comment
satyajeetkolhapure Sep 10, 2025
ac826d6
fix: review comments
satyajeetkolhapure Sep 10, 2025
4397435
Update packages/rewards-controller/src/RewardsController.ts
satyajeetkolhapure Sep 10, 2025
229ef99
fix: review comments
satyajeetkolhapure Sep 10, 2025
9dba63b
fix: review comments
satyajeetkolhapure Sep 11, 2025
7d3f29f
fix: review comments
satyajeetkolhapure Sep 11, 2025
af3c35e
fix: review comments
satyajeetkolhapure Sep 11, 2025
b2f541f
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 11, 2025
02fe388
fix: review comments
satyajeetkolhapure Sep 11, 2025
f155fa3
Merge branch 'main' into feat/add-rewards-controller
satyajeetkolhapure Sep 11, 2025
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
/packages/permission-log-controller @MetaMask/wallet-api-platform-engineers @MetaMask/core-platform
/packages/profile-sync-controller @MetaMask/identity
/packages/remote-feature-flag-controller @MetaMask/extension-platform @MetaMask/mobile-platform
/packages/rewards-controller @MetaMask/rewards @MetaMask/core-platform
/packages/foundryup @MetaMask/mobile-platform @MetaMask/extension-platform

## Package Release related
Expand Down Expand Up @@ -140,6 +141,8 @@
/packages/phishing-controller/CHANGELOG.md @MetaMask/product-safety @MetaMask/core-platform
/packages/profile-sync-controller/package.json @MetaMask/identity @MetaMask/core-platform
/packages/profile-sync-controller/CHANGELOG.md @MetaMask/identity @MetaMask/core-platform
/packages/rewards-controller/package.json @MetaMask/rewards @MetaMask/core-platform
/packages/rewards-controller/CHANGELOG.md @MetaMask/rewards @MetaMask/core-platform
/packages/selected-network-controller/package.json @MetaMask/wallet-api-platform-engineers @MetaMask/core-platform
/packages/selected-network-controller/CHANGELOG.md @MetaMask/wallet-api-platform-engineers @MetaMask/core-platform
/packages/signature-controller/package.json @MetaMask/confirmations @MetaMask/core-platform
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Each package in this repository has its own README where you can find installati
- [`@metamask/profile-sync-controller`](packages/profile-sync-controller)
- [`@metamask/rate-limit-controller`](packages/rate-limit-controller)
- [`@metamask/remote-feature-flag-controller`](packages/remote-feature-flag-controller)
- [`@metamask/rewards-controller`](packages/rewards-controller)
- [`@metamask/sample-controllers`](packages/sample-controllers)
- [`@metamask/seedless-onboarding-controller`](packages/seedless-onboarding-controller)
- [`@metamask/selected-network-controller`](packages/selected-network-controller)
Expand Down Expand Up @@ -130,6 +131,7 @@ linkStyle default opacity:0.5
profile_sync_controller(["@metamask/profile-sync-controller"]);
rate_limit_controller(["@metamask/rate-limit-controller"]);
remote_feature_flag_controller(["@metamask/remote-feature-flag-controller"]);
rewards_controller(["@metamask/rewards-controller"]);
sample_controllers(["@metamask/sample-controllers"]);
seedless_onboarding_controller(["@metamask/seedless-onboarding-controller"]);
selected_network_controller(["@metamask/selected-network-controller"]);
Expand All @@ -154,14 +156,17 @@ linkStyle default opacity:0.5
assets_controllers --> base_controller;
assets_controllers --> controller_utils;
assets_controllers --> polling_controller;
assets_controllers --> account_tree_controller;
assets_controllers --> accounts_controller;
assets_controllers --> approval_controller;
assets_controllers --> keyring_controller;
assets_controllers --> multichain_account_service;
assets_controllers --> network_controller;
assets_controllers --> permission_controller;
assets_controllers --> phishing_controller;
assets_controllers --> preferences_controller;
assets_controllers --> transaction_controller;
base_controller --> messenger;
base_controller --> json_rpc_engine;
bridge_controller --> base_controller;
bridge_controller --> controller_utils;
Expand Down Expand Up @@ -244,6 +249,7 @@ linkStyle default opacity:0.5
network_enablement_controller --> controller_utils;
network_enablement_controller --> multichain_network_controller;
network_enablement_controller --> network_controller;
network_enablement_controller --> transaction_controller;
notification_services_controller --> base_controller;
notification_services_controller --> controller_utils;
notification_services_controller --> keyring_controller;
Expand Down Expand Up @@ -277,13 +283,17 @@ linkStyle default opacity:0.5
selected_network_controller --> json_rpc_engine;
selected_network_controller --> network_controller;
selected_network_controller --> permission_controller;
shield_controller --> base_controller;
shield_controller --> transaction_controller;
signature_controller --> base_controller;
signature_controller --> controller_utils;
signature_controller --> accounts_controller;
signature_controller --> approval_controller;
signature_controller --> keyring_controller;
signature_controller --> logging_controller;
signature_controller --> network_controller;
subscription_controller --> base_controller;
subscription_controller --> profile_sync_controller;
token_search_discovery_controller --> base_controller;
transaction_controller --> base_controller;
transaction_controller --> controller_utils;
Expand Down
15 changes: 15 additions & 0 deletions packages/rewards-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Initial release of the RewardsController. ([#6493](https://github.com/MetaMask/core/pull/6493))
- Automatically authenticates a user through a silent signature from KeyringController if their EVM address owns a rewards profile.

[Unreleased]: https://github.com/MetaMask/core/
20 changes: 20 additions & 0 deletions packages/rewards-controller/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License

Copyright (c) 2025 MetaMask

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15 changes: 15 additions & 0 deletions packages/rewards-controller/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `@metamask/rewards-controller`

Handles reward claiming, campaign fetching, and reward history

## Installation

`yarn add @metamask/rewards-controller`

or

`npm install @metamask/rewards-controller`

## Contributing

This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
26 changes: 26 additions & 0 deletions packages/rewards-controller/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

const merge = require('deepmerge');
const path = require('path');

const baseConfig = require('../../jest.config.packages');

const displayName = path.basename(__dirname);

module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
});
72 changes: 72 additions & 0 deletions packages/rewards-controller/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "@metamask/rewards-controller",
"version": "0.0.0",
"description": "Handles reward claiming, campaign fetching, and reward history",
"keywords": [
"MetaMask",
"Ethereum"
],
"homepage": "https://github.com/MetaMask/core/tree/main/packages/rewards-controller#readme",
"bugs": {
"url": "https://github.com/MetaMask/core/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/MetaMask/core.git"
},
"license": "MIT",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.cts",
"files": [
"dist/"
],
"scripts": {
"build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/rewards-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/rewards-controller",
"since-latest-release": "../../scripts/since-latest-release.sh",
"publish:preview": "yarn npm publish --tag preview",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/keyring-internal-api": "^8.1.0",
"@metamask/utils": "^11.4.2",
"@solana/addresses": "^2.0.0"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-controller": "^23.0.0",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.2.2"
},
"engines": {
"node": "^18.18 || >=20"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
Loading
Loading