Skip to content

Commit

Permalink
fix: Use new type
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Apr 3, 2024
1 parent f911d1b commit 75e4f9c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/adapters/handlers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
WearableCategory,
} from '@dcl/schemas'
import { Params } from '../../logic/http/params'
import { AssetsNetworks } from '../../types'

export const getItemsParams = (params: Params) => {
const maxPrice = params.getString('maxPrice')
Expand Down Expand Up @@ -47,7 +48,7 @@ export const getItemsParams = (params: Params) => {
),
contractAddresses: params.getList('contractAddress'),
itemId: params.getString('itemId'),
network: params.getValue<Network.MATIC | Network.ETHEREUM>('network', {
network: params.getValue<AssetsNetworks>('network', {
[Network.MATIC]: Network.MATIC,
[Network.ETHEREUM]: Network.ETHEREUM,
}),
Expand Down
3 changes: 2 additions & 1 deletion src/logic/contracts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChainId, Contract, Network, NFTCategory } from '@dcl/schemas'
import { ISubgraphComponent } from '@well-known-components/thegraph-component'
import { FragmentItemType, ItemFragment } from '../ports/items/types'
import { AssetsNetworks } from '../types'

const MAX_RESULTS = 1000

Expand All @@ -20,7 +21,7 @@ const getCollectionsQuery = (page: number) => `

export async function getCollectionsContracts(
subgraph: ISubgraphComponent,
network: Network.MATIC | Network.ETHEREUM,
network: AssetsNetworks,
chainId: ChainId
): Promise<Contract[]> {
let page = 0
Expand Down
4 changes: 2 additions & 2 deletions src/ports/collections/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import {
Collection,
CollectionFilters,
CollectionSortBy,
Network,
} from '@dcl/schemas'
import { getMarketplaceContracts } from '../../logic/contracts'
import { AssetsNetworks } from '../../types'
import { SortDirection } from '../merger/types'
import { CollectionFragment } from './types'

export const COLLECTION_DEFAULT_SORT_BY = CollectionSortBy.NAME

export function fromCollectionFragment(
fragment: CollectionFragment,
network: Network.MATIC | Network.ETHEREUM,
network: AssetsNetworks,
chainId: ChainId
): Collection {
const collection: Collection = {
Expand Down
4 changes: 2 additions & 2 deletions src/ports/orders/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
ChainId,
ListingStatus,
Network,
Order,
OrderFilters,
OrderSortBy,
} from '@dcl/schemas'
import { AssetsNetworks } from '../../types'
import { OrderFragment } from './types'

export const ORDER_DEFAULT_SORT_BY = OrderSortBy.RECENTLY_LISTED
Expand Down Expand Up @@ -210,7 +210,7 @@ export const getOrdersQuery = (

export function fromOrderFragment(
fragment: OrderFragment,
network: Network.MATIC | Network.ETHEREUM,
network: AssetsNetworks,
chainId: ChainId
): Order {
const issuedId = fragment.nft.issuedId
Expand Down

0 comments on commit 75e4f9c

Please sign in to comment.