@nftx/core
Advanced tools
Comparing version 0.10.0 to 0.10.1
{ | ||
"name": "@nftx/core", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/NFTX-project/nftxjs", |
@@ -5,3 +5,3 @@ import { BigNumber } from '@ethersproject/bignumber'; | ||
import type { Asset } from '@nftx/types'; | ||
import { getChainConstant } from '@nftx/utils'; | ||
import { addressEqual, getChainConstant } from '@nftx/utils'; | ||
import { processAssetItems } from '../utils'; | ||
@@ -87,9 +87,13 @@ | ||
items: | ||
data?.account?.holdings?.map((x) => { | ||
const assetAddress = x.token.collection.id; | ||
const tokenId = BigNumber.from(x.token.identifier).toString(); | ||
const quantity = BigNumber.from(x.balance); | ||
data?.account?.holdings | ||
?.filter((x) => | ||
assetAddresses.some((y) => addressEqual(x.token.collection.id, y)) | ||
) | ||
.map((x) => { | ||
const assetAddress = x.token.collection.id; | ||
const tokenId = BigNumber.from(x.token.identifier).toString(); | ||
const quantity = BigNumber.from(x.balance); | ||
return { assetAddress, tokenId, quantity }; | ||
}) ?? [], | ||
return { assetAddress, tokenId, quantity }; | ||
}) ?? [], | ||
}); | ||
@@ -96,0 +100,0 @@ |
import { gql, querySubgraph } from '@nftx/subgraph'; | ||
import config from '@nftx/config'; | ||
import { getChainConstant } from '@nftx/utils'; | ||
import { addressEqual, getChainConstant } from '@nftx/utils'; | ||
import type { Asset } from '@nftx/types'; | ||
@@ -68,6 +68,10 @@ import { processAssetItems } from '../utils'; | ||
network, | ||
items: data.tokens.map((x) => ({ | ||
assetAddress: x.collection.id, | ||
tokenId: x.identifier, | ||
})), | ||
items: data.tokens | ||
.filter((x) => | ||
assetAddresses.some((y) => addressEqual(x.collection.id, y)) | ||
) | ||
.map((x) => ({ | ||
assetAddress: x.collection.id, | ||
tokenId: x.identifier, | ||
})), | ||
}); | ||
@@ -74,0 +78,0 @@ } |
import { BigNumber } from '@ethersproject/bignumber'; | ||
import { gql, querySubgraph } from '@nftx/subgraph'; | ||
import config from '@nftx/config'; | ||
import { getChainConstant } from '@nftx/utils'; | ||
import { addressEqual, getChainConstant } from '@nftx/utils'; | ||
import type { Asset } from '@nftx/types'; | ||
@@ -83,7 +83,11 @@ import { processAssetItems } from '../utils'; | ||
items: | ||
data?.account?.tokens?.map((x) => { | ||
const [assetAddress] = x.id.split('-'); | ||
const tokenId = BigNumber.from(x.identifier).toString(); | ||
return { assetAddress, tokenId }; | ||
}) ?? [], | ||
data?.account?.tokens | ||
?.map((x) => { | ||
const [assetAddress] = x.id.split('-'); | ||
const tokenId = BigNumber.from(x.identifier).toString(); | ||
return { assetAddress, tokenId }; | ||
}) | ||
.filter((x) => | ||
assetAddresses.some((y) => addressEqual(x.assetAddress, y)) | ||
) ?? [], | ||
}); | ||
@@ -90,0 +94,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
308231
10532