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

Move more addresses to the known contracts list #74

Merged
merged 1 commit into from
May 18, 2021
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
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 +1,3 @@
export const CRYPTOKITTIES = "0x06012c8cf97BEaD5deAe237070F9587f8E7A266d"
export const CRYPTOPUNKS = "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb"
export const CRYPTOVOXELS = "0x79986aF15539de2db9A5086382daEdA917A9CF0C"