@nftx/utils
Advanced tools
Comparing version 0.4.5 to 0.5.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.5.0](https://github.com/NFTX-project/nftxjs/compare/v0.4.5...v0.5.0) (2023-02-02) | ||
### Features | ||
* **@nftx/utils:** fetch collection metadata method ([acf4c1c](https://github.com/NFTX-project/nftxjs/commit/acf4c1cef76520421fae3e332f72507245528567)) | ||
## [0.4.5](https://github.com/NFTX-project/nftxjs/compare/v0.4.4...v0.4.5) (2023-02-02) | ||
@@ -8,0 +19,0 @@ |
@@ -579,2 +579,20 @@ 'use strict'; | ||
/** Fetches metadata about a specific collection */ | ||
const fetchCollectionMetadata = async args => { | ||
const { | ||
address | ||
} = args; | ||
const uri = `https://eth-mainnet.g.alchemy.com/nft/v2/_nKylYxzcktTyMooyowPh7s5UfAsENKZ/getContractMetadata?contractAddress=${address}`; | ||
const response = await fetch(uri); | ||
if (!response.ok) { | ||
throw new Error(await response.text()); | ||
} | ||
const data = await response.json(); | ||
return data.contractMetadata; | ||
}; | ||
var fetchCollectionMetadata$1 = fetchCollectionMetadata; | ||
/** Returns whether a given address is for the CryptoPunk collection */ | ||
@@ -1721,2 +1739,3 @@ | ||
exports.fetchBlockNumberByTimestamp = fetchBlockNumberByTimestamp; | ||
exports.fetchCollectionMetadata = fetchCollectionMetadata$1; | ||
exports.fetchMaxInventoryWithdraw = fetchMaxInventoryWithdraw; | ||
@@ -1723,0 +1742,0 @@ exports.fetchMerkleLeaves = fetchMerkleLeaves; |
@@ -547,2 +547,20 @@ import { Network, MULTICALL, CRYPTOPUNKS, CRYPTOKITTIES, NFTX_INVENTORY_STAKING, NFTX_LP_STAKING, NFTX_UNSTAKING_INVENTORY_ZAP, WETH_TOKEN } from '@nftx/constants'; | ||
/** Fetches metadata about a specific collection */ | ||
const fetchCollectionMetadata = async args => { | ||
const { | ||
address | ||
} = args; | ||
const uri = `https://eth-mainnet.g.alchemy.com/nft/v2/_nKylYxzcktTyMooyowPh7s5UfAsENKZ/getContractMetadata?contractAddress=${address}`; | ||
const response = await fetch(uri); | ||
if (!response.ok) { | ||
throw new Error(await response.text()); | ||
} | ||
const data = await response.json(); | ||
return data.contractMetadata; | ||
}; | ||
var fetchCollectionMetadata$1 = fetchCollectionMetadata; | ||
/** Returns whether a given address is for the CryptoPunk collection */ | ||
@@ -1679,2 +1697,2 @@ | ||
export { MulticallContract$1 as MulticallContract, addressEqual$1 as addressEqual, adjustPosition$1 as adjustPosition, balanceOf$1 as balanceOf, calculateVaultApr$1 as calculateVaultApr, checkEligible, doesVaultHaveRandomSwapFee, doesVaultHaveTargetSwapFee, fetchAssetMetadata$1 as fetchAssetMetadata, fetchBlockNumberByTimestamp, fetchMaxInventoryWithdraw, fetchMerkleLeaves, fetchMerkleReference, fetchReservesForToken$1 as fetchReservesForToken, fetchReservesForTokens$1 as fetchReservesForTokens, fetchUserTimelock$1 as fetchUserTimelock, fetchUserVaultBalance, fetchUserVaultBalances, fetchXTokenShare$1 as fetchXTokenShare, fetchXTokenShares$1 as fetchXTokenShares, fromEthersNumber$1 as fromEthersNumber, getChainConstant$1 as getChainConstant, getContract$1 as getContract, isCryptoKitty, isCryptoPunk, isMerkleVault$1 as isMerkleVault, isNonstandard721, isVaultSwappable, matchVault, parseLogEvent$1 as parseLogEvent, parseLogEvents$1 as parseLogEvents, processTokens, requiresProcessing, searchVaults, toEthersNumber$1 as toEthersNumber, totalSupply$1 as totalSupply }; | ||
export { MulticallContract$1 as MulticallContract, addressEqual$1 as addressEqual, adjustPosition$1 as adjustPosition, balanceOf$1 as balanceOf, calculateVaultApr$1 as calculateVaultApr, checkEligible, doesVaultHaveRandomSwapFee, doesVaultHaveTargetSwapFee, fetchAssetMetadata$1 as fetchAssetMetadata, fetchBlockNumberByTimestamp, fetchCollectionMetadata$1 as fetchCollectionMetadata, fetchMaxInventoryWithdraw, fetchMerkleLeaves, fetchMerkleReference, fetchReservesForToken$1 as fetchReservesForToken, fetchReservesForTokens$1 as fetchReservesForTokens, fetchUserTimelock$1 as fetchUserTimelock, fetchUserVaultBalance, fetchUserVaultBalances, fetchXTokenShare$1 as fetchXTokenShare, fetchXTokenShares$1 as fetchXTokenShares, fromEthersNumber$1 as fromEthersNumber, getChainConstant$1 as getChainConstant, getContract$1 as getContract, isCryptoKitty, isCryptoPunk, isMerkleVault$1 as isMerkleVault, isNonstandard721, isVaultSwappable, matchVault, parseLogEvent$1 as parseLogEvent, parseLogEvents$1 as parseLogEvents, processTokens, requiresProcessing, searchVaults, toEthersNumber$1 as toEthersNumber, totalSupply$1 as totalSupply }; |
export { default as fetchAssetMetadata } from './fetchAssetMetadata'; | ||
export { default as fetchCollectionMetadata, type CollectionMetadata, type CollectionsMetadataResponse, } from './fetchCollectionMetadata'; | ||
/** Returns whether a given address is for the CryptoPunk collection */ | ||
@@ -3,0 +4,0 @@ export declare const isCryptoPunk: (address: string) => boolean; |
{ | ||
"name": "@nftx/utils", | ||
"version": "0.4.5", | ||
"version": "0.5.0", | ||
"description": "", | ||
@@ -50,6 +50,6 @@ "homepage": "https://github.com/NFTX-project/nftxjs", | ||
"dependencies": { | ||
"@nftx/config": "^0.4.5", | ||
"@nftx/constants": "^0.4.5", | ||
"@nftx/subgraph": "^0.4.5", | ||
"@nftx/types": "^0.4.4", | ||
"@nftx/config": "^0.5.0", | ||
"@nftx/constants": "^0.5.0", | ||
"@nftx/subgraph": "^0.5.0", | ||
"@nftx/types": "^0.5.0", | ||
"keccak256": "^1.0.6", | ||
@@ -56,0 +56,0 @@ "merkletreejs": "^0.2.32" |
@@ -5,2 +5,7 @@ import { CRYPTOKITTIES, CRYPTOPUNKS } from '@nftx/constants'; | ||
export { default as fetchAssetMetadata } from './fetchAssetMetadata'; | ||
export { | ||
default as fetchCollectionMetadata, | ||
type CollectionMetadata, | ||
type CollectionsMetadataResponse, | ||
} from './fetchCollectionMetadata'; | ||
@@ -7,0 +12,0 @@ /** Returns whether a given address is for the CryptoPunk collection */ |
182373
91
5534
10
+ Added@nftx/config@0.5.0(transitive)
+ Added@nftx/constants@0.5.0(transitive)
+ Added@nftx/subgraph@0.5.0(transitive)
+ Added@nftx/types@0.5.0(transitive)
- Removed@nftx/config@0.4.5(transitive)
- Removed@nftx/constants@0.4.5(transitive)
- Removed@nftx/subgraph@0.4.5(transitive)
- Removed@nftx/types@0.4.4(transitive)
Updated@nftx/config@^0.5.0
Updated@nftx/constants@^0.5.0
Updated@nftx/subgraph@^0.5.0
Updated@nftx/types@^0.5.0