Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@zoralabs/nft-metadata

Package Overview
Dependencies
83
Maintainers
18
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.4 to 1.2.5

dist/utils/gateway-tools.d.ts

5

dist/uri/ipfs.d.ts

@@ -1,4 +0,3 @@

export declare function isIPFS(uri: string): any;
export declare function hasIpfsPrefix(uri: string): boolean;
export declare function getIPFSUrl(uri: string, gateway: string): any;
export declare function isIPFS(uri: string): boolean;
export declare function getIPFSUrl(uri: string, gateway: string): string;
export declare function getPrivateGateway(chainName: string, tokenAddress: string): "https://ipfsgateway.makersplace.com" | "https://ipfs.foundation.app" | "https://zora-prod.mypinata.cloud" | undefined;

17

dist/uri/ipfs.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPrivateGateway = exports.getIPFSUrl = exports.hasIpfsPrefix = exports.isIPFS = void 0;
exports.getPrivateGateway = exports.getIPFSUrl = exports.isIPFS = void 0;
const addresses_1 = require("../utils/addresses");
const gateway_tools_1 = require("../utils/gateway-tools");
const addresses_2 = require("../constants/addresses");
const IPFSGatewayTools = require('@pinata/ipfs-gateway-tools/dist/node');
const gatewayTools = new IPFSGatewayTools();
function isIPFS(uri) {
const result = gatewayTools.containsCID(uri);
// TODO - this lib is not working right so hack for now
return result.containsCid && (uri.includes('/ipfs/') || hasIpfsPrefix(uri));
return !!gateway_tools_1.getCID(uri);
}
exports.isIPFS = isIPFS;
function hasIpfsPrefix(uri) {
return uri.startsWith('ipfs://');
}
exports.hasIpfsPrefix = hasIpfsPrefix;
function getIPFSUrl(uri, gateway) {
if (isIPFS(uri)) {
return gatewayTools.convertToDesiredGateway(uri, gateway);
if (gateway_tools_1.getCID(uri)) {
return gateway_tools_1.convertToDesiredGateway(uri, gateway);
}

@@ -22,0 +15,0 @@ return uri;

{
"name": "@zoralabs/nft-metadata",
"version": "1.2.4",
"version": "1.2.5",
"description": "Generic nft metadata parsers",

@@ -14,3 +14,2 @@ "author": "Zora",

"dependencies": {
"@pinata/ipfs-gateway-tools": "1.1.6",
"@zoralabs/core": "^1.0.7",

@@ -20,2 +19,3 @@ "axios": "^0.22.0",

"cross-fetch": "^3.1.4",
"is-ipfs": "6.0.2",
"node-abort-controller": "^2.0.0"

@@ -22,0 +22,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc