Skip to content

Commit

Permalink
Remove chain ID from notifs payload as it is no longer needed (#6223)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchung authored Oct 23, 2024
1 parent 05e1427 commit 43ce5f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
16 changes: 6 additions & 10 deletions src/notifications/settings/firebase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { NOTIFICATIONS_API_KEY } from 'react-native-dotenv';
import { logger, RainbowError } from '@/logger';
import { supportedNotificationsChainIds } from '@/chains';
import {
GlobalNotificationTopics,
GlobalNotificationTopicType,
Expand Down Expand Up @@ -138,15 +137,12 @@ export const publishWalletSettings = async ({

const parseWalletSettings = (walletSettings: WalletNotificationSettings[]): NotificationSubscriptionWalletsType[] => {
const enabledWalletSettings = walletSettings.filter(setting => setting.enabled);
return enabledWalletSettings.flatMap(setting => {
return enabledWalletSettings.map(setting => {
const topics = Object.keys(setting.topics).filter(topic => !!setting.topics[topic]);
return supportedNotificationsChainIds.map(chainId => {
return {
type: setting.type,
chain_id: chainId,
address: setting.address.toLowerCase(),
transaction_action_types: topics,
};
});
return {
type: setting.type,
address: setting.address.toLowerCase(),
transaction_action_types: topics,
};
});
};
1 change: 0 additions & 1 deletion src/notifications/settings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export type GlobalNotificationTopics = {

export type NotificationSubscriptionWalletsType = {
type: WalletNotificationRelationshipType;
chain_id: number;
address: string;
transaction_action_types: WalletNotificationTopicType[];
};
Expand Down

0 comments on commit 43ce5f4

Please sign in to comment.