New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nftx/utils

Package Overview
Dependencies
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nftx/utils - npm Package Compare versions

Comparing version 0.4.5 to 0.5.0

dist/ts/assets/fetchCollectionMetadata.d.ts

11

CHANGELOG.md

@@ -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;

20

dist/es/utils.js

@@ -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;

10

package.json
{
"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 */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc