Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

## Earn Team
/packages/earn-controller @MetaMask/earn
/packages/chomp-api-service @MetaMask/earn

## Social AI Team
/packages/ai-controllers @MetaMask/social-ai
Expand Down Expand Up @@ -226,3 +227,5 @@
/packages/social-controllers/CHANGELOG.md @MetaMask/social-ai @MetaMask/core-platform
/packages/money-account-controller/package.json @MetaMask/accounts-engineers @MetaMask/core-platform
/packages/money-account-controller/CHANGELOG.md @MetaMask/accounts-engineers @MetaMask/core-platform
/packages/chomp-api-service/package.json @MetaMask/accounts-engineers @MetaMask/core-platform
/packages/chomp-api-service/CHANGELOG.md @MetaMask/accounts-engineers @MetaMask/core-platform
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Each package in this repository has its own README where you can find installati
- [`@metamask/bridge-status-controller`](packages/bridge-status-controller)
- [`@metamask/build-utils`](packages/build-utils)
- [`@metamask/chain-agnostic-permission`](packages/chain-agnostic-permission)
- [`@metamask/chomp-api-service`](packages/chomp-api-service)
- [`@metamask/claims-controller`](packages/claims-controller)
- [`@metamask/client-controller`](packages/client-controller)
- [`@metamask/compliance-controller`](packages/compliance-controller)
Expand Down Expand Up @@ -123,6 +124,7 @@ linkStyle default opacity:0.5
bridge_status_controller(["@metamask/bridge-status-controller"]);
build_utils(["@metamask/build-utils"]);
chain_agnostic_permission(["@metamask/chain-agnostic-permission"]);
chomp_api_service(["@metamask/chomp-api-service"]);
claims_controller(["@metamask/claims-controller"]);
client_controller(["@metamask/client-controller"]);
compliance_controller(["@metamask/compliance-controller"]);
Expand Down Expand Up @@ -274,6 +276,9 @@ linkStyle default opacity:0.5
bridge_status_controller --> transaction_controller;
chain_agnostic_permission --> controller_utils;
chain_agnostic_permission --> permission_controller;
chomp_api_service --> base_data_service;
chomp_api_service --> controller_utils;
chomp_api_service --> messenger;
claims_controller --> base_controller;
claims_controller --> controller_utils;
claims_controller --> keyring_controller;
Expand Down
14 changes: 14 additions & 0 deletions packages/chomp-api-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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

- Add `ChompApiService` ([#8361](https://github.com/MetaMask/core/pull/8413))

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

Copyright (c) 2026 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/chomp-api-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `@metamask/chom-api-service`

Chomp API data service.

## Installation

`yarn add @metamask/chom-api-service`

or

`npm install @metamask/chom-api-service`

## 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/chomp-api-service/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,
},
},
});
76 changes: 76 additions & 0 deletions packages/chomp-api-service/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "@metamask/chomp-api-service",
"version": "0.0.0",
"description": "Data service for the Chomp API",
"keywords": [
"MetaMask",
"Ethereum"
],
"homepage": "https://github.com/MetaMask/core/tree/main/packages/chomp-api-service#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:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/chomp-api-service",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/chomp-api-service",
"since-latest-release": "../../scripts/since-latest-release.sh",
"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/base-data-service": "^0.1.1",
"@metamask/controller-utils": "^11.20.0",
"@metamask/messenger": "^1.1.1",
"@metamask/superstruct": "^3.1.0",
"@metamask/utils": "^11.9.0",
"@tanstack/query-core": "^4.43.0"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^29.5.14",
"deepmerge": "^4.2.2",
"jest": "^29.7.0",
"nock": "^13.3.1",
"ts-jest": "^29.2.5",
"typedoc": "^0.25.13",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
},
"engines": {
"node": "^18.18 || >=20"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* This file is auto generated.
* Do not edit manually.
*/

import type { ChompApiService } from './chomp-api-service';

/**
* Associates an address with a CHOMP profile via POST /v1/auth/address.
*/
export type ChompApiServiceAssociateAddressAction = {
type: `ChompApiService:associateAddress`;
handler: ChompApiService['associateAddress'];
};

/**
* Creates an account upgrade via POST /v1/account-upgrade.
*/
export type ChompApiServiceCreateUpgradeAction = {
type: `ChompApiService:createUpgrade`;
handler: ChompApiService['createUpgrade'];
};

/**
* Fetches the upgrade record for an address via GET /v1/account-upgrade/:address.
*/
export type ChompApiServiceGetUpgradeAction = {
type: `ChompApiService:getUpgrade`;
handler: ChompApiService['getUpgrade'];
};

/**
* Verifies a delegation via POST /v1/intent/verify-delegation.
*/
export type ChompApiServiceVerifyDelegationAction = {
type: `ChompApiService:verifyDelegation`;
handler: ChompApiService['verifyDelegation'];
};

/**
* Submits intents via POST /v1/intent.
*/
export type ChompApiServiceCreateIntentsAction = {
type: `ChompApiService:createIntents`;
handler: ChompApiService['createIntents'];
};

/**
* Fetches intents by address via GET /v1/intent/account/:address.
*/
export type ChompApiServiceGetIntentsByAddressAction = {
type: `ChompApiService:getIntentsByAddress`;
handler: ChompApiService['getIntentsByAddress'];
};

/**
* Creates a withdrawal for card spend flows.
*/
export type ChompApiServiceCreateWithdrawalAction = {
type: `ChompApiService:createWithdrawal`;
handler: ChompApiService['createWithdrawal'];
};

/**
* Union of all ChompApiService action types.
*/
export type ChompApiServiceMethodActions =
| ChompApiServiceAssociateAddressAction
| ChompApiServiceCreateUpgradeAction
| ChompApiServiceGetUpgradeAction
| ChompApiServiceVerifyDelegationAction
| ChompApiServiceCreateIntentsAction
| ChompApiServiceGetIntentsByAddressAction
| ChompApiServiceCreateWithdrawalAction;
Loading
Loading