Skip to content
Merged
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: 0 additions & 3 deletions packages/common/src/adapters/accessConditionsFromSDK.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { full } from '@audius/sdk'
import {
instanceOfTipGate,
instanceOfFollowGate,
instanceOfPurchaseGate,
instanceOfTokenGate,
Expand All @@ -16,8 +15,6 @@ export const accessConditionsFromSDK = (
return { follow_user_id: input.followUserId }
} else if (instanceOfPurchaseGate(input)) {
return { usdc_purchase: input.usdcPurchase }
} else if (instanceOfTipGate(input)) {
return { tip_user_id: input.tipUserId }
} else if (instanceOfTokenGate(input)) {
return {
token_gate: {
Expand Down
5 changes: 0 additions & 5 deletions packages/common/src/adapters/accessConditionsToSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { TrackMetadata } from '@audius/sdk'
import {
AccessConditions,
isContentFollowGated,
isContentTipGated,
isContentTokenGated,
isContentUSDCPurchaseGated
} from '~/models'
Expand All @@ -26,10 +25,6 @@ export const accessConditionsToSDK = (
tokenAmount: input.token_gate.token_amount
}
}
} else if (isContentTipGated(input)) {
return {
tipUserId: input.tip_user_id
}
} else {
throw new Error(
`Unsupported access conditions type: ${JSON.stringify(input)}`
Expand Down
2 changes: 0 additions & 2 deletions packages/common/src/adapters/audioTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const audioTransactionFromSdk = (
purchase_coinbase: TransactionType.PURCHASE,
purchase_unknown: TransactionType.PURCHASE,
'purchase unknown': TransactionType.PURCHASE,
tip: TransactionType.TIP,
user_reward: TransactionType.CHALLENGE_REWARD,
trending_reward: TransactionType.TRENDING_REWARD,
transfer: TransactionType.TRANSFER
Expand Down Expand Up @@ -48,7 +47,6 @@ export const audioTransactionFromSdk = (
balance: tx.balance,
metadata: undefined
}
case TransactionType.TIP:
case TransactionType.TRANSFER:
return {
signature: tx.signature,
Expand Down
1 change: 0 additions & 1 deletion packages/common/src/adapters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export * from './playlistLibrary'
export * from './remix'
export * from './repost'
export * from './search'
export * from './tip'
export * from './track'
export * from './trending'
export * from './user'
Expand Down
74 changes: 0 additions & 74 deletions packages/common/src/adapters/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,32 +112,6 @@ export const notificationFromSDK = (
...formatBaseNotification(notification)
}
}
case 'tip_send': {
const data = notification.actions[0].data
const amount = data.amount
const receiverUserId = HashId.parse(data.receiverUserId)
return {
type: NotificationType.TipSend,
entityId: receiverUserId,
entityType: Entity.User,
amount: amount!.toString() as StringWei,
...formatBaseNotification(notification)
}
}
case 'tip_receive': {
const data = notification.actions[0].data
const amount = data.amount
const senderUserId = HashId.parse(data.senderUserId)
return {
type: NotificationType.TipReceive,
entityId: senderUserId,
amount: amount!.toString() as StringWei,
entityType: Entity.User,
tipTxSignature: data.tipTxSignature,
reactionValue: data.reactionValue,
...formatBaseNotification(notification)
}
}
case 'track_added_to_purchased_album': {
let trackId = 0
let playlistId = 0
Expand Down Expand Up @@ -188,38 +162,6 @@ export const notificationFromSDK = (
...formatBaseNotification(notification)
}
}
case 'supporter_rank_up': {
const data = notification.actions[0].data
const senderUserId = HashId.parse(data.senderUserId)
return {
type: NotificationType.SupporterRankUp,
entityId: senderUserId,
rank: data.rank,
entityType: Entity.User,
...formatBaseNotification(notification)
}
}
case 'supporting_rank_up': {
const data = notification.actions[0].data
const receiverUserId = HashId.parse(data.receiverUserId)
return {
type: NotificationType.SupportingRankUp,
entityId: receiverUserId,
rank: data.rank,
entityType: Entity.User,
...formatBaseNotification(notification)
}
}
case 'supporter_dethroned': {
const data = notification.actions[0].data
return {
type: NotificationType.SupporterDethroned,
entityType: Entity.User,
entityId: HashId.parse(data.senderUserId),
supportedUserId: HashId.parse(data.receiverUserId),
...formatBaseNotification(notification)
}
}
case 'challenge_reward': {
const data = notification.actions[0].data
const challengeId = data.challengeId as ChallengeRewardID
Expand Down Expand Up @@ -421,22 +363,6 @@ export const notificationFromSDK = (
...formatBaseNotification(notification)
}
}
case 'reaction': {
const data = notification.actions[0].data
return {
type: NotificationType.Reaction,
entityId: HashId.parse(data.receiverUserId),
entityType: Entity.User,
reactionValue: data.reactionValue,
reactionType: data.reactionType,
reactedToEntity: {
tx_signature: data.reactedTo,
amount: data.tipAmount as StringWei,
tip_sender_id: HashId.parse(data.senderUserId)
},
...formatBaseNotification(notification)
}
}
case 'repost_of_repost': {
let entityId = 0
let entityType = Entity.Track
Expand Down
30 changes: 0 additions & 30 deletions packages/common/src/adapters/tip.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/common/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ export * from './tan-query/purchases/usePurchasersCount'
export * from './tan-query/purchases/useSalesAggregate'

// Reactions
export * from './tan-query/reactions/useReaction'
export * from './tan-query/reactions/useWriteReaction'
export * from './tan-query/reactions/types'
export * from './tan-query/reactions/utils'

Expand Down Expand Up @@ -120,9 +118,6 @@ export * from './tan-query/users/useMutualFollowers'
export * from './tan-query/users/useMutedUsers'
export * from './tan-query/users/useRelatedArtists'
export * from './tan-query/users/useSuggestedArtists'
export * from './tan-query/users/useSupporter'
export * from './tan-query/users/useSupporters'
export * from './tan-query/users/useSupportedUsers'
export * from './tan-query/users/useTopArtists'
export * from './tan-query/users/useTopArtistsInGenre'
export * from './tan-query/users/useUserAlbums'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ describe('getCollectionsBatcher', () => {
isAvailable: true,
ercWallet: '',
splWallet: '',
supporterCount: 0,
supportingCount: 0,
totalAudioBalance: 0,
wallet: '',
balance: '0',
Expand All @@ -106,7 +104,12 @@ describe('getCollectionsBatcher', () => {
profilePictureCids: undefined,
profilePictureLegacy: undefined,
playlistLibrary: undefined,
allowAiAttribution: false
allowAiAttribution: false,
supporterCount: 0,
supportingCount: 0,
artistCoinBadge: undefined,
splUsdcWallet: undefined,
hasCollectibles: false
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ describe('getTracksBatcher', () => {
isAvailable: true,
ercWallet: '',
splWallet: '',
supporterCount: 0,
supportingCount: 0,
totalAudioBalance: 0,
wallet: '',
balance: '0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ describe('getUsersBatcher', () => {
doesCurrentUserFollow: false,
currentUserFolloweeFollowCount: 0,
ercWallet: '',
supporterCount: 0,
supportingCount: 0,
coverPhotoLegacy: undefined,
profilePictureLegacy: undefined,
coverPhotoCids: undefined,
Expand Down
96 changes: 0 additions & 96 deletions packages/common/src/api/tan-query/batchers/getReactionsBatcher.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { useLineupQuery } from './useLineupQuery'

const DEFAULT_PAGE_SIZE = 10

type GateCondition = 'ungated' | 'usdc_purchase' | 'follow' | 'tip' | 'token'
type GateCondition = 'ungated' | 'usdc_purchase' | 'follow' | 'token'

type UseExclusiveTracksArgs = {
userId: ID | null | undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,6 @@ const collectEntityIds = (notifications: Notification[]): EntityIds => {
if (type === NotificationType.TrendingPlaylist) {
collectionIds.add(notification.entityId)
}
if (
type === NotificationType.TipSend ||
type === NotificationType.TipReceive ||
type === NotificationType.SupporterRankUp ||
type === NotificationType.SupportingRankUp ||
type === NotificationType.Reaction
) {
userIds.add(notification.entityId)
}
if (
type === NotificationType.AddTrackToPlaylist ||
type === NotificationType.TrackAddedToPurchasedAlbum
Expand All @@ -123,9 +114,6 @@ const collectEntityIds = (notifications: Notification[]): EntityIds => {
userIds.add(notification.playlistOwnerId)
collectionIds.add(notification.playlistId)
}
if (type === NotificationType.SupporterDethroned) {
userIds.add(notification.supportedUserId).add(notification.entityId)
}
if (type === NotificationType.Tastemaker) {
userIds.add(notification.userId)
trackIds.add(notification.entityId)
Expand Down
Loading