Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module.exports = {
'error',
{ allow: ['describe', 'expect', 'it'] },
],
// Disable jsdoc/tag-lines rule to allow lines after block descriptions
'jsdoc/tag-lines': 'off',
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v21.7.3
v22.17.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This Snap creates a [DeleGator account](https://github.com/MetaMask/delegation-f
**Prerequisites**

- [MetaMask Flask >= 12.14.2](https://docs.metamask.io/snaps/get-started/install-flask/)
- Nodejs `20.0.0` (specified in `.nvmrc`)
- Nodejs `20.0.0` or > `22.0.0` (specified in `.nvmrc`)
- yarn 3.2.1

### Environment variables
Expand Down
45 changes: 22 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,31 @@
"test": "yarn workspaces foreach --parallel --interlaced --verbose run test"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^3.0.0",
"@lavamoat/preinstall-always-fail": "^2.0.0",
"@metamask/create-release-branch": "^4.1.1",
"@metamask/eslint-config": "^12.1.0",
"@metamask/eslint-config-jest": "^12.1.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"eslint": "^8.45.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "~2.26.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-jsdoc": "^41.1.2",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^6.1.1",
"prettier": "^3.3.3",
"prettier-2": "npm:prettier@^2.8.8",
"prettier-plugin-packagejson": "^2.4.5",
"sharp": "^0.32.6",
"typescript": "^4.7.4"
"@lavamoat/allow-scripts": "3.3.4",
"@lavamoat/preinstall-always-fail": "2.1.1",
"@metamask/create-release-branch": "4.1.3",
"@metamask/eslint-config": "12.2.0",
"@metamask/eslint-config-jest": "12.1.0",
"@metamask/eslint-config-nodejs": "12.1.0",
"@metamask/eslint-config-typescript": "12.1.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-jest": "27.9.0",
"eslint-plugin-jsdoc": "48.11.0",
"eslint-plugin-n": "16.6.2",
"eslint-plugin-prettier": "5.5.1",
"eslint-plugin-promise": "6.6.0",
"prettier": "3.6.2",
"prettier-plugin-packagejson": "2.5.18",
"sharp": "0.32.6",
"typescript": "5.8.3"
},
"packageManager": "yarn@3.2.1",
"engines": {
"node": ">=18.6.0"
"node": "^20 || >=22"
},
"lavamoat": {
"allowScripts": {
Expand Down
2 changes: 2 additions & 0 deletions packages/gator-permissions-snap/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module.exports = {
allow: ['Text'],
},
],
// Disable jsdoc/tag-lines rule to allow lines after block descriptions
'jsdoc/tag-lines': 'off',
},
},

Expand Down
60 changes: 30 additions & 30 deletions packages/gator-permissions-snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,45 +47,45 @@
"test": "jest"
},
"dependencies": {
"@metamask/abi-utils": "^3.0.0",
"@metamask/abi-utils": "3.0.0",
"@metamask/delegation-core": "0.1.0",
"@metamask/delegation-toolkit": "0.10.2",
"@metamask/profile-sync-controller": "^12.0.0",
"@metamask/snaps-sdk": "^6.17.1",
"@metamask/utils": "^11.3.0",
"viem": "^2.21.29",
"zod": "3.24.1"
"@metamask/profile-sync-controller": "21.0.0",
"@metamask/snaps-sdk": "8.1.0",
"@metamask/utils": "11.4.2",
"viem": "2.31.7",
"zod": "3.25.76"
},
"devDependencies": {
"@jest/globals": "^29.5.0",
"@jest/globals": "29.7.0",
"@metamask/7715-permissions-shared": "workspace:*",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/eslint-config": "^14.0.0",
"@metamask/eslint-config-jest": "^14.0.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@metamask/snaps-cli": "^6.6.0",
"@metamask/snaps-jest": "^8.9.0",
"@types/react": "18.2.4",
"@metamask/auto-changelog": "5.0.2",
"@metamask/eslint-config": "12.2.0",
"@metamask/eslint-config-jest": "12.1.0",
"@metamask/eslint-config-nodejs": "12.1.0",
"@metamask/eslint-config-typescript": "12.1.0",
"@metamask/snaps-cli": "8.1.1",
"@metamask/snaps-jest": "9.3.0",
"@types/react": "18.3.23",
"@types/react-dom": "18.2.4",
"dotenv": "16.4.5",
"eslint": "^8.45.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "~2.26.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-jsdoc": "^41.1.2",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^6.1.1",
"ethers": "^5.7.2",
"jest": "^29.5.0",
"rimraf": "^3.0.2",
"ts-jest": "^29.1.0",
"typescript": "^4.7.4"
"dotenv": "17.2.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-jest": "27.9.0",
"eslint-plugin-jsdoc": "48.11.0",
"eslint-plugin-n": "16.6.2",
"eslint-plugin-prettier": "5.5.1",
"eslint-plugin-promise": "6.6.0",
"ethers": "5.8.0",
"jest": "29.7.0",
"rimraf": "6.0.1",
"ts-jest": "29.4.0",
"typescript": "5.8.3"
},
"packageManager": "yarn@3.2.1",
"engines": {
"node": ">=18.6.0"
"node": "^20 || >=22"
},
"publishConfig": {
"access": "public",
Expand Down
1 change: 0 additions & 1 deletion packages/gator-permissions-snap/snap.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ if (!SUPPORTED_CHAINS) {
}

const config: SnapConfig = {
bundler: 'webpack',
input: resolve(__dirname, 'src/index.ts'),
server: {
port: 8082,
Expand Down
4 changes: 2 additions & 2 deletions packages/gator-permissions-snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snap-7715-permissions.git"
},
"source": {
"shasum": "8PGSI83NMAkED4BCqQY6WUB6rSDGmHLx2PavNnyQm0s=",
"shasum": "mvkYJ2VJO4Ofl67bc3nyNfhOfCj8qwh+s2nXBimNYu8=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down Expand Up @@ -35,6 +35,6 @@
"snap_getPreferences": {},
"endowment:page-home": {}
},
"platformVersion": "6.22.0",
"platformVersion": "8.1.0",
"manifestVersion": "0.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export abstract class BaseAccountController {

/**
* Initializes a new BaseAccountController instance.
*
* @param config - The configuration object.
* @param config.snapsProvider - The provider for interacting with snaps.
* @param config.supportedChains - The supported blockchain chains.
Expand All @@ -30,7 +29,6 @@ export abstract class BaseAccountController {

/**
* Validates that the specified chains are supported.
*
* @param supportedChains - The chains to validate.
* @throws If no chains are specified or if any chain is not supported.
*/
Expand All @@ -56,7 +54,6 @@ export abstract class BaseAccountController {

/**
* Asserts that the specified chain ID is supported.
*
* @param chainId - The chain ID to validate.
* @throws If the chain ID is not supported.
*/
Expand All @@ -74,7 +71,6 @@ export abstract class BaseAccountController {

/**
* Creates a provider that handles experimental provider requests.
*
* @param chainId - The chain ID for the provider.
* @returns A provider object with a request method.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { logger } from '@metamask/7715-permissions-shared/utils';
import { type Hex, type Delegation } from '@metamask/delegation-core';
import type { SnapsEthereumProvider, SnapsProvider } from '@metamask/snaps-sdk';

import { getChainMetadata } from '../core/chainMetadata';
import { BaseAccountController } from './baseAccountController';
import type {
AccountController,
AccountOptionsBase,
SignDelegationOptions,
FactoryArgs,
} from './types';
import { getChainMetadata } from '../core/chainMetadata';

/**
* Controls EOA account operations including address retrieval, delegation signing, and balance queries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export class SmartAccountController

/**
* Initializes a new SmartAccountController instance.
*
* @param config - The configuration object.
* @param config.snapsProvider - The provider for interacting with snaps.
* @param config.supportedChains - The supported blockchain chains.
Expand All @@ -70,7 +69,6 @@ export class SmartAccountController

/**
* Retrieves or creates a MetaMaskSmartAccount for the specified chain.
*
* @param options - The account options containing chain ID.
* @returns A Promise resolving to a MetaMaskSmartAccount.
* @throws When the specified chain is not supported.
Expand Down Expand Up @@ -150,7 +148,6 @@ export class SmartAccountController

/**
* Retrieves the account address for the current account.
*
* @param options - The base account options including chainId.
* @returns A promise resolving to the account address as a hex string.
*/
Expand All @@ -173,7 +170,6 @@ export class SmartAccountController

/**
* Retrieves the metadata for deploying a smart account.
*
* @param options - The base account options including chainId.
* @returns A promise resolving to the factory arguments needed for deployment.
*/
Expand All @@ -197,7 +193,6 @@ export class SmartAccountController

/**
* Signs a delegation using the smart account.
*
* @param options - The options for signing including chainId and delegation data.
* @returns A promise resolving to the signed delegation structure.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export class BlockchainTokenMetadataClient implements TokenMetadataClient {

/**
* Fetch the token balance and metadata for a given account and token.
*
* @param args - The parameters for fetching the token balance.
* @param args.chainId - The chain ID to fetch the balance from.
* @param args.assetAddress - The token address to fetch the balance for. If not provided, fetches native token balance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class PriceApiClient {

/**
* Fetch the spot prices for the given token CAIP-19 asset type.
*
* @param caipAssetType - The token CAIP-19 asset type to fetch spot prices for. Defaults to ethereum.
* @param vsCurrency - The currency to fetch the spot prices in. Defaults to USD.
* @returns The spot prices for the given token CAIP-19 asset type.
Expand Down
1 change: 0 additions & 1 deletion packages/gator-permissions-snap/src/clients/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export type TokenBalanceAndMetadata = {
export type TokenMetadataClient = {
/**
* Fetch the token balance and metadata for a given account and token.
*
* @param params - The parameters for fetching the token balance
* @param params.chainId - The chain ID to fetch the balance from
* @param params.assetAddress - The token address to fetch the balance for. If not provided, fetches native token balance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export type PermissionHandlerContentProps = {

/**
* Content wrapping a permission confirmation, including the title and add-more-rules button.
*
* @param options - The params for the content.
* @param options.showAddMoreRulesButton - Whether to show the "Add more rules" button.
* @param options.children - The children of the content.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export class PermissionRequestLifecycleOrchestrator {

/**
* Orchestrates the permission request lifecycle.
*
* @param origin - The origin of the permission request.
* @param permissionRequest - The permission request to orchestrate.
* @param lifecycleHandlers - The lifecycle handlers to call during orchestration.
Expand Down Expand Up @@ -148,7 +147,6 @@ export class PermissionRequestLifecycleOrchestrator {

/**
* Resolves a permission request into a final permission response.
*
* @private
* @template TRequest - Type of permission request
* @template TContext - Type of context for the permission request.
Expand Down
3 changes: 0 additions & 3 deletions packages/gator-permissions-snap/src/core/rules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type { BaseContext, RuleDefinition } from './types';

/**
* Renders a single rule with the provided configuration, context and metadata.
*
* @param options0 - The options object.
* @param options0.rule - The rule definition to render.
* @param options0.context - The current context state.
Expand Down Expand Up @@ -92,7 +91,6 @@ export function renderRule<

/**
* Renders a list of rules the the provided configuration, context and metadata.
*
* @param options0 - The options object.
* @param options0.rules - The array of rule definitions to render.
* @param options0.context - The current context state.
Expand All @@ -116,7 +114,6 @@ export function renderRules<

/**
* Binds the handlers for the provided rules to the user event dispatcher.
*
* @param options0 - The options object.
* @param options0.rules - The array of rule definitions to bind handlers for.
* @param options0.userEventDispatcher - The user event dispatcher to bind handlers to.
Expand Down
Loading
Loading