Skip to content

Commit

Permalink
fix: simple hash
Browse files Browse the repository at this point in the history
fix: simplehash
  • Loading branch information
guanbinrui committed Nov 26, 2024
1 parent 8ee2435 commit f741a30
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
5 changes: 1 addition & 4 deletions packages/web3-providers/src/SimpleHash/apis/EVM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import {
createNextIndicator,
NetworkPluginID,
} from '@masknet/shared-base'
import {
type NonFungibleAsset,
type NonFungibleCollection,
} from '@masknet/web3-shared-base'
import { type NonFungibleAsset, type NonFungibleCollection } from '@masknet/web3-shared-base'
import { ChainId, SchemaType, isValidChainId, isValidAddress } from '@masknet/web3-shared-evm'
import {
fetchFromSimpleHash,
Expand Down
14 changes: 7 additions & 7 deletions packages/web3-providers/src/SimpleHash/apis/Solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SimpleHashAPI_Solana implements NonFungibleTokenAPI.Provider<ChainId, Sche

async getAssetsByCollectionId(
collectionId: string,
{ chainId = ChainId.Mainnet, indicator, }: BaseHubOptions<ChainId> = {},
{ chainId = ChainId.Mainnet, indicator }: BaseHubOptions<ChainId> = {},
skipScoreCheck = false,
) {
const chain = resolveChain(NetworkPluginID.PLUGIN_SOLANA, chainId)
Expand All @@ -94,9 +94,9 @@ class SimpleHashAPI_Solana implements NonFungibleTokenAPI.Provider<ChainId, Sche
})

const response = await fetchFromSimpleHash<{ next_cursor: string; nfts: SimpleHash.Asset[] }>(path)
const assets = response.nfts.map((x) => createSolanaNonFungibleAsset(x, skipScoreCheck)).filter(Boolean) as Array<
NonFungibleAsset<ChainId, SchemaType>
>
const assets = response.nfts
.map((x) => createSolanaNonFungibleAsset(x, skipScoreCheck))
.filter(Boolean) as Array<NonFungibleAsset<ChainId, SchemaType>>

return createPageable(
assets,
Expand All @@ -122,9 +122,9 @@ class SimpleHashAPI_Solana implements NonFungibleTokenAPI.Provider<ChainId, Sche

const response = await fetchFromSimpleHash<{ next_cursor: string; nfts: SimpleHash.Asset[] }>(path)

const assets = response.nfts.map((x) => createSolanaNonFungibleAsset(x, skipScoreCheck)).filter(Boolean) as Array<
NonFungibleAsset<ChainId, SchemaType>
>
const assets = response.nfts
.map((x) => createSolanaNonFungibleAsset(x, skipScoreCheck))
.filter(Boolean) as Array<NonFungibleAsset<ChainId, SchemaType>>

return createPageable(
assets,
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-providers/src/types/SimpleHash.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type BigNumber } from 'bignumber.js'

export namespace SimpleHash {
interface FloorPrice {
export interface FloorPrice {
marketplace_id: LiteralUnion<'blur' | 'looksrare' | 'opensea' | 'x2y2'>
marketplace_name: LiteralUnion<'Blur' | 'LooksRare' | 'OpenSea' | 'X2Y2'>
value: number
Expand Down

0 comments on commit f741a30

Please sign in to comment.