Skip to content

Commit

Permalink
Move more addresses to the known contracts list (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpierre authored May 18, 2021
1 parent 9784bd1 commit 7bf6035
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/fetchers/shared/cryptokitties.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { Address, NftMetadata } from "../../types"

import { CRYPTOKITTIES } from "../../known-contracts"
import { addressesEqual } from "../../utils"

const CRYPTOKITTIES_CONTRACT = "0x06012c8cf97BEaD5deAe237070F9587f8E7A266d"

export async function cryptoKittiesMetadata(id: string): Promise<NftMetadata> {
const res = await fetch(`https://api.cryptokitties.co/v3/kitties/${id}`)
const data = (await res.json()) as {
Expand All @@ -19,5 +18,5 @@ export async function cryptoKittiesMetadata(id: string): Promise<NftMetadata> {
}

export function isCryptoKitties(contractAddress: Address): boolean {
return addressesEqual(contractAddress, CRYPTOKITTIES_CONTRACT)
return addressesEqual(contractAddress, CRYPTOKITTIES)
}
5 changes: 2 additions & 3 deletions src/fetchers/shared/cryptopunks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Address, NftMetadata } from "../../types"

import { addressesEqual } from "../../utils"

const CRYPTOPUNKS_CONTRACT = "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb"
import { CRYPTOPUNKS } from "../../known-contracts"

const CRYPTOPUNKS_DESCRIPTION = `
10,000 unique collectible characters with proof of ownership stored on the
Expand All @@ -20,5 +19,5 @@ export function cryptoPunksMetadata(index: string): NftMetadata {
}

export function isCryptoPunks(contractAddress: Address): boolean {
return addressesEqual(contractAddress, CRYPTOPUNKS_CONTRACT)
return addressesEqual(contractAddress, CRYPTOPUNKS)
}
2 changes: 2 additions & 0 deletions src/known-contracts.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const CRYPTOKITTIES = "0x06012c8cf97BEaD5deAe237070F9587f8E7A266d"
export const CRYPTOPUNKS = "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb"
export const CRYPTOVOXELS = "0x79986aF15539de2db9A5086382daEdA917A9CF0C"
export const DECENTRALAND_ESTATE = "0x959e104E1a4dB6317fA58F8295F586e1A978c297"
export const DECENTRALAND_PARCEL = "0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d"

0 comments on commit 7bf6035

Please sign in to comment.