Skip to content

Commit

Permalink
feat(utils): add support for null contract type in getContractType fu…
Browse files Browse the repository at this point in the history
…nction
  • Loading branch information
mmackz committed Jun 11, 2024
1 parent 36ba4f1 commit 5cf124d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/foundation/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export async function getFixedPriceSaleTerms(
export async function getContractType(
client: PublicClient,
contractAddress: Address,
): Promise<'1155' | '721'> {
): Promise<'1155' | '721' | null> {
const abi = SUPPORTS_INTERFACE_ABI
const interfaceIds = {
'1155': '0xd9b67a26', // ERC-1155
Expand All @@ -123,7 +123,7 @@ export async function getContractType(
// eslint-disable-next-line no-empty
} catch {}
}
throw new Error('Invalid contract type')
return null
}

export function formatAmount(amount: FilterOperator | undefined) {
Expand Down

0 comments on commit 5cf124d

Please sign in to comment.