Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pusher #519

Merged
merged 1 commit into from
Jul 31, 2023
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
77 changes: 0 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"node-cache": "^5.1.2",
"ora": "^5.4.1",
"pg": "^8.11.1",
"pusher": "^5.1.3",
"type-graphql": "^1.2.0-rc.1"
},
"devDependencies": {
Expand Down
46 changes: 0 additions & 46 deletions src/common/pusher.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ const config: ProcessorConfig = {
redisDb: process.env.REDIS_DB ? parseInt(process.env.REDIS_DB, 10) : 0,
redisSupportsTls: process.env.REDIS_SUPPORTS_TLS === 'true',
redisPort: process.env.REDIS_PORT ? parseInt(process.env.REDIS_PORT, 10) : 6379,
pusher: {
appId: process.env.PUSHER_APP_ID,
key: process.env.PUSHER_APP_KEY,
secret: process.env.PUSHER_APP_SECRET,
cluster: process.env.PUSHER_APP_CLUSTER,
},
marketplaceUrl: process.env.MARKETPLACE_URL || 'https://beta.nft.io',
shouldFetchAccounts: process.env.FETCH_ACCOUNTS !== 'false',
sentryDsn: process.env.SENTRY_DSN,
Expand Down
8 changes: 1 addition & 7 deletions src/mappings/marketplace/events/auction_finalized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import {
import { CommonContext } from '../../types/contexts'
import { Event } from '../../../types/generated/support'
import { CollectionService } from '../../../services'
import { Pusher } from '../../../common/pusher'
import { safeJson } from '../../../common/tools'
import { getBestListing } from '../../util/entities'

function getEventData(ctx: CommonContext, event: Event) {
Expand Down Expand Up @@ -98,7 +96,7 @@ export async function auctionFinalized(
}),
})

const eventData: [EventModel, AccountTokenEvent] | undefined = [
return [
event,
new AccountTokenEvent({
id: item.event.id,
Expand All @@ -108,8 +106,4 @@ export async function auctionFinalized(
event,
}),
]

await Pusher.getInstance().trigger('marketplace', 'auctionFinalized', safeJson(eventData))

return eventData
}
8 changes: 1 addition & 7 deletions src/mappings/marketplace/events/bid_placed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { CommonContext } from '../../types/contexts'
import { Event } from '../../../types/generated/support'
import { CollectionService } from '../../../services'
import { getBestListing, getOrCreateAccount } from '../../util/entities'
import { Pusher } from '../../../common/pusher'
import { safeJson } from '../../../common/tools'

function getEventData(ctx: CommonContext, event: Event) {
const data = new MarketplaceBidPlacedEvent(ctx, event)
Expand Down Expand Up @@ -90,7 +88,7 @@ export async function bidPlaced(
}),
})

const eventData: [EventModel, AccountTokenEvent] | undefined = [
return [
event,
new AccountTokenEvent({
id: item.event.id,
Expand All @@ -99,8 +97,4 @@ export async function bidPlaced(
event,
}),
]

await Pusher.getInstance().trigger('marketplace', 'bidPlaced', safeJson(eventData))

return eventData
}
8 changes: 1 addition & 7 deletions src/mappings/marketplace/events/listing_cancelled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import {
import { Event } from '../../../types/generated/support'
import { CollectionService } from '../../../services'
import { CommonContext } from '../../types/contexts'
import { Pusher } from '../../../common/pusher'
import { safeJson } from '../../../common/tools'
import { getBestListing } from '../../util/entities'

function getEventData(ctx: CommonContext, event: Event) {
Expand Down Expand Up @@ -79,7 +77,7 @@ export async function listingCancelled(
}),
})

const eventData: [EventModel, AccountTokenEvent] | undefined = [
return [
event,
new AccountTokenEvent({
id: item.event.id,
Expand All @@ -88,8 +86,4 @@ export async function listingCancelled(
event,
}),
]

await Pusher.getInstance().trigger('marketplace', 'listingCancelled', safeJson(eventData))

return eventData
}
8 changes: 1 addition & 7 deletions src/mappings/marketplace/events/listing_created.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { Event } from '../../../types/generated/support'
import { CollectionService } from '../../../services'
import { CommonContext } from '../../types/contexts'
import { getOrCreateAccount } from '../../util/entities'
import { Pusher } from '../../../common/pusher'
import { safeJson } from '../../../common/tools'

function getEventData(ctx: CommonContext, event: Event) {
const data = new MarketplaceListingCreatedEvent(ctx, event)
Expand Down Expand Up @@ -119,12 +117,8 @@ export async function listingCreated(
}),
})

const eventData: [EventModel, AccountTokenEvent] | undefined = [
return [
event,
new AccountTokenEvent({ id: item.event.id, token: new Token({ id: makeAssetId.id }), from: listing.seller, event }),
]

await Pusher.getInstance().trigger('marketplace', 'listingCreated', safeJson(eventData))

return eventData
}
8 changes: 1 addition & 7 deletions src/mappings/marketplace/events/listing_filled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {
import { Event } from '../../../types/generated/support'
import { CollectionService } from '../../../services'
import { CommonContext } from '../../types/contexts'
import { Pusher } from '../../../common/pusher'
import { safeJson } from '../../../common/tools'
import { getBestListing } from '../../util/entities'

function getEventData(ctx: CommonContext, event: Event) {
Expand Down Expand Up @@ -107,7 +105,7 @@ export async function listingFilled(
}),
})

const eventData: [EventModel, AccountTokenEvent] | undefined = [
return [
event,
new AccountTokenEvent({
id: item.event.id,
Expand All @@ -117,8 +115,4 @@ export async function listingFilled(
event,
}),
]

await Pusher.getInstance().trigger('marketplace', 'listingFilled', safeJson(eventData))

return eventData
}
2 changes: 0 additions & 2 deletions src/types/custom/processorConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { SubstrateProcessor } from '@subsquid/substrate-processor'
import Queue from 'bull'

type Parameters<T> = T extends (...args: infer T) => any ? T : never

Expand All @@ -23,7 +22,6 @@ export interface ProcessorConfig {
redisDb: number
redisSupportsTls: boolean
redisPort: number
pusher: any
marketplaceUrl: string
shouldFetchAccounts: boolean
sentryDsn?: string
Expand Down