Skip to content

Commit

Permalink
feat(search): make progress on search type
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Apr 28, 2022
1 parent 110dfe6 commit 3eb3321
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/blockchain-wallet-v4/src/network/api/nfts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
ExplorerGatewayNftCollectionType,
ExplorerGatewaySearchType,
NftAsset,
OfferEventsType,
OpenSeaOrder,
Expand Down Expand Up @@ -47,9 +48,13 @@ export default ({ apiUrl, get, openSeaApi, post }) => {
})
}

const searchNfts = (slug: string): ExplorerGatewayNftCollectionType[] => {
return get({
endPoint: `/collection/search?query=${slug}`,
const searchNfts = (query: string): ExplorerGatewaySearchType => {
return post({
contentType: 'application/json',
data: {
query
},
endPoint: `/search`,
ignoreQueryParams: true,
url: `${explorerUrl}`
})
Expand Down
13 changes: 13 additions & 0 deletions packages/blockchain-wallet-v4/src/network/api/nfts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,3 +901,16 @@ export interface OpenSeaOrder {
target: string
v: number
}

export type ExplorerGatewaySearchType = {
assets: {
collection_slug: string
contract_address: string
id: string
image_original_url: string
image_preview_url: string
image_thumbnail_url: string
image_url: string
name: string
}[]
}

0 comments on commit 3eb3321

Please sign in to comment.