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
1 change: 1 addition & 0 deletions packages/notification-services-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Note, however, that the versions specified in the client's `package.json` always "win", and you are expected to keep them up to date so as not to break controller and service intercommunication.
- Modified background push utilities to handle more edgecases and not throw errors ([#7275](https://github.com/MetaMask/core/pull/7275))
- Bump `@metamask/controller-utils` from `^11.16.0` to `^11.18.0` ([#7534](https://github.com/MetaMask/core/pull/7534), [#7583](https://github.com/MetaMask/core/pull/7583))
- Move Notifications networks metadata to backend ([#7840](https://github.com/MetaMask/core/pull/7840))

### Fixed

Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions packages/notification-services-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
"default": "./dist/NotificationServicesController/index.cjs"
}
},
"./notification-services/ui": {
"import": {
"types": "./dist/NotificationServicesController/ui/index.d.mts",
"default": "./dist/NotificationServicesController/ui/index.mjs"
},
"require": {
"types": "./dist/NotificationServicesController/ui/index.d.cts",
"default": "./dist/NotificationServicesController/ui/index.cjs"
}
},
"./notification-services/mocks": {
"import": {
"types": "./dist/NotificationServicesController/mocks/index.d.mts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,3 @@ export const NOTIFICATION_API_TRIGGER_TYPES_SET: Set<string> = new Set([
TRIGGER_TYPES.ERC1155_RECEIVED,
TRIGGER_TYPES.PLATFORM,
]);

export const NOTIFICATION_CHAINS_ID = {
ETHEREUM: '1',
OPTIMISM: '10',
BSC: '56',
BASE: '8453',
POLYGON: '137',
ARBITRUM: '42161',
AVALANCHE: '43114',
LINEA: '59144',
SEI: '1329',
} as const;

// Kept as SCREAMING_SNAKE_CASE for backwards compatibility
// eslint-disable-next-line @typescript-eslint/naming-convention
export type NOTIFICATION_CHAINS_IDS =
(typeof NOTIFICATION_CHAINS_ID)[keyof typeof NOTIFICATION_CHAINS_ID];
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ export * from './processors';
export * as Constants from './constants';
export * from './constants';
export * as Mocks from './mocks';
export * as UI from './ui';
export * from '../shared';
export { isVersionInBounds } from './utils/isVersionInBounds';
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ export function createMockNotificationEthSent(): NormalisedAPINotification {
tx_hash:
'0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'eth_sent',
network_fee: {
Expand Down Expand Up @@ -58,6 +66,14 @@ export function createMockNotificationEthReceived(): NormalisedAPINotification {
tx_hash:
'0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'eth_received',
network_fee: {
Expand Down Expand Up @@ -96,6 +112,14 @@ export function createMockNotificationERC20Sent(): NormalisedAPINotification {
tx_hash:
'0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'erc20_sent',
network_fee: {
Expand Down Expand Up @@ -140,6 +164,14 @@ export function createMockNotificationERC20Received(): NormalisedAPINotification
tx_hash:
'0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'erc20_received',
network_fee: {
Expand Down Expand Up @@ -182,6 +214,14 @@ export function createMockNotificationERC721Sent(): NormalisedAPINotification {
block_timestamp: '1700043467',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
to: '0xf47f628fe3bd2595e9ab384bfffc3859b448e451',
nft: {
Expand Down Expand Up @@ -229,6 +269,14 @@ export function createMockNotificationERC721Received(): NormalisedAPINotificatio
block_timestamp: '1699980623',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
to: '0xba7f3daa8adfdad686574406ab9bd5d2f0a49d2e',
nft: {
Expand Down Expand Up @@ -276,6 +324,14 @@ export function createMockNotificationERC1155Sent(): NormalisedAPINotification {
block_timestamp: '1700510003',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',
nft: {
Expand Down Expand Up @@ -323,6 +379,14 @@ export function createMockNotificationERC1155Received(): NormalisedAPINotificati
block_timestamp: '1700510003',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',
nft: {
Expand Down Expand Up @@ -370,6 +434,14 @@ export function createMockNotificationMetaMaskSwapsCompleted(): NormalisedAPINot
block_timestamp: '1697637275',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'metamask_swap_completed',
rate: '1558.27',
Expand Down Expand Up @@ -423,6 +495,14 @@ export function createMockNotificationRocketPoolStakeCompleted(): NormalisedAPIN
block_timestamp: '1700145059',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'rocketpool_stake_completed',
stake_in: {
Expand Down Expand Up @@ -475,6 +555,14 @@ export function createMockNotificationRocketPoolUnStakeCompleted(): NormalisedAP
block_timestamp: '1697718011',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'rocketpool_unstake_completed',
stake_in: {
Expand Down Expand Up @@ -527,6 +615,14 @@ export function createMockNotificationLidoStakeCompleted(): NormalisedAPINotific
block_timestamp: '1698961091',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'lido_stake_completed',
stake_in: {
Expand Down Expand Up @@ -579,6 +675,14 @@ export function createMockNotificationLidoWithdrawalRequested(): NormalisedAPINo
block_timestamp: '1697638415',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'lido_withdrawal_requested',
stake_in: {
Expand Down Expand Up @@ -631,6 +735,14 @@ export function createMockNotificationLidoWithdrawalCompleted(): NormalisedAPINo
block_timestamp: '1697643851',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'lido_withdrawal_completed',
stake_in: {
Expand Down Expand Up @@ -683,6 +795,14 @@ export function createMockNotificationLidoReadyToBeWithdrawn(): NormalisedAPINot
block_timestamp: '1697643851',
chain_id: 1,
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
network: {
name: 'Ethereum',
native_symbol: 'ETH',
block_explorer: {
url: 'https://etherscan.io',
name: 'Etherscan',
},
},
data: {
kind: 'lido_stake_ready_to_be_withdrawn',
request_id: '123456789',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export type Data_ERC20Sent = components['schemas']['Data_ERC20Sent'];
export type Data_ERC20Received = components['schemas']['Data_ERC20Received'];
export type Data_ERC721Sent = components['schemas']['Data_ERC721Sent'];
export type Data_ERC721Received = components['schemas']['Data_ERC721Received'];
export type NetworkMetadata = components['schemas']['NetworkMetadata'];
export type BlockExplorer = components['schemas']['BlockExplorer'];

type Notification = components['schemas']['NotificationOutputV3'][number];
type PlatformNotification = Extract<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export type components = {
/** @example 0x881D40237659C251811CEC9c364ef91dC08D300C */
tx_hash: string;
address: string;
network?: components['schemas']['NetworkMetadata'];
data?:
| components['schemas']['Data_MetamaskSwapCompleted']
| components['schemas']['Data_LidoStakeReadyToBeWithdrawn']
Expand Down Expand Up @@ -376,6 +377,28 @@ export type components = {
/** Format: decimal */
usd: string;
};
BlockExplorer: {
/**
* Format: uri
* @example https://etherscan.io
*/
url: string;
/** @example Etherscan */
name: string;
};
NetworkMetadata: {
/**
* @description Human-readable network name
* @example Ethereum
*/
name: string;
/**
* @description Native token symbol
* @example ETH
*/
native_symbol: string;
block_explorer: components['schemas']['BlockExplorer'];
};
};
responses: never;
parameters: never;
Expand Down
Loading
Loading