Skip to content

Commit

Permalink
Merge pull request #2716 from tallycash/bsc-support-NFTs
Browse files Browse the repository at this point in the history
  • Loading branch information
hyphenized authored Dec 6, 2022
2 parents 26f72cf + ab99f68 commit 81d4487
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions background/lib/simple-hash_update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import { HexString } from "../types"
import logger from "./logger"
import { sameEVMAddress } from "./utils"

type SupportedChain = "polygon" | "arbitrum" | "optimism" | "ethereum" | "bsc"

type SimpleHashNFTModel = {
nft_id: string
token_id: string | null
name: string | null
description: string | null
contract_address: string
chain: "polygon" | "arbitrum" | "optimism" | "ethereum"
chain: SupportedChain
external_url: string | null
image_url: string | null
previews?: {
Expand Down Expand Up @@ -41,7 +43,7 @@ type SimpleHashCollectionModel = {
id: string
name: string | null
image_url: string | null
chain: "polygon" | "arbitrum" | "optimism" | "ethereum"
chain: SupportedChain
distinct_nfts_owned: number | null
distinct_owner_count: number | null
distinct_nft_count: number | null
Expand Down Expand Up @@ -71,6 +73,7 @@ const CHAIN_ID_TO_NAME = {
137: "polygon",
42161: "arbitrum",
43114: "avalanche",
56: "bsc",
}

const SIMPLE_HASH_CHAIN_TO_ID = {
Expand All @@ -79,6 +82,7 @@ const SIMPLE_HASH_CHAIN_TO_ID = {
polygon: 137,
arbitrum: 42161,
avalanche: 43114,
bsc: 56,
}

function isGalxeAchievement(url: string | null | undefined) {
Expand Down
3 changes: 3 additions & 0 deletions background/nfts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
OPTIMISM,
ARBITRUM_ONE,
AVALANCHE,
BINANCE_SMART_CHAIN,
} from "./constants"
import { EVMNetwork } from "./networks"
// Networks that are not added to this struct will
Expand All @@ -16,6 +17,7 @@ export const CHAIN_ID_TO_NFT_METADATA_PROVIDER: {
[OPTIMISM.chainID]: ["simplehash"],
[ARBITRUM_ONE.chainID]: ["simplehash"],
[AVALANCHE.chainID]: ["simplehash"],
[BINANCE_SMART_CHAIN.chainID]: ["simplehash"],
}

export const NFT_PROVIDER_TO_CHAIN = {
Expand All @@ -26,6 +28,7 @@ export const NFT_PROVIDER_TO_CHAIN = {
OPTIMISM.chainID,
ARBITRUM_ONE.chainID,
AVALANCHE.chainID,
BINANCE_SMART_CHAIN.chainID,
],
}

Expand Down

0 comments on commit 81d4487

Please sign in to comment.