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

fix: worker env #1048

Merged
merged 2 commits into from
Oct 1, 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
10 changes: 3 additions & 7 deletions apps/web/src/components/Home/OpenActions/Zora/ZoraNft.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import CollectOutline from '@components/Common/Icons/CollectOutline'
import UserPreview from '@components/Common/UserPreview'
import Modal from '@components/UIElements/Modal'
import { LENSTUBE_ADDRESS } from '@lenstube/constants'
import {
getZoraChainIsMainnet,
trimLensHandle,
useZoraNft
} from '@lenstube/generic'
import { LENSTUBE_ADDRESS, ZORA_MAINNET_CHAINS } from '@lenstube/constants'
import { trimLensHandle, useZoraNft } from '@lenstube/generic'
import type { Profile } from '@lenstube/lens'
import type { BasicNftMetadata } from '@lenstube/lens/custom-types'
import { getShortHandTime } from '@lib/formatTime'
Expand Down Expand Up @@ -38,7 +34,7 @@ const ZoraNft: FC<Props> = ({ nftMetadata, sharedBy, postedAt }) => {
return null
}

const network = getZoraChainIsMainnet(chain) ? '' : 'testnet.'
const network = ZORA_MAINNET_CHAINS.includes(chain) ? '' : 'testnet.'
const zoraLink = `https://${network}zora.co/collect/${chain}:${address}${
token ? `/${token}` : ''
}?referrer=${LENSTUBE_ADDRESS}`
Expand Down
3 changes: 3 additions & 0 deletions packages/constants/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,6 @@ export const ALLOWED_HEX_CHARACTERS = [
'E',
'F'
]

// open actions
export const ZORA_MAINNET_CHAINS = ['eth', 'oeth', 'base', 'zora']
5 changes: 0 additions & 5 deletions packages/helpers/generic/functions/getZoraChainIsMainnet.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/helpers/generic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export * from './functions/getSignature'
export * from './functions/getThumbnailUrl'
export * from './functions/getURLs'
export * from './functions/getZoraChainInfo'
export * from './functions/getZoraChainIsMainnet'
export * from './functions/imageCdn'
export * from './functions/isWatchable'
export * from './functions/omitKey'
Expand Down
7 changes: 5 additions & 2 deletions packages/workers/nfts/src/handlers/getZoraNft.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { WorkerRequest } from '../types'
import { getZoraChainIsMainnet } from '@lenstube/generic'

const ZORA_MAINNET_CHAINS = ['eth', 'oeth', 'base', 'zora']

export default async (request: WorkerRequest) => {
const { chain, address, token } = request.query
Expand All @@ -14,7 +15,9 @@ export default async (request: WorkerRequest) => {
}

try {
const network = getZoraChainIsMainnet(chain as string) ? '' : 'testnet.'
const network = ZORA_MAINNET_CHAINS.includes(chain as string)
? ''
: 'testnet.'
const zoraResponse = await fetch(
`https://${network}zora.co/api/personalize/collection/${chain}:${address}/${
token || ''
Expand Down
Loading