Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rmrk-team/ipfs-utils

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rmrk-team/ipfs-utils

IPFS utils for RMRK NFTs

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@rmrk-team/ipfs-utils

npm version


Utilities for working with NFT metadata and media stored on ipfs.

Installation

pnpm install @rmrk-team/ipfs-utils

Usage

import { sanitizeIpfsUrl, DEFAULT_IPFS_GATEWAY_URLS, DEFAULT_IPFS_GATEWAY_KEYS, containsCID } from '@rmrk-team/ipfs-utils';

const ipfsUri = 'ipfs://QmVfpP2WQmmRaGk3VPehKxteTvsG465rJDokY3JiyweHBn';
const sanitizedIpfsUrl = sanitizeIpfsUrl(ipfsUri, DEFAULT_IPFS_GATEWAY_URLS[DEFAULT_IPFS_GATEWAY_KEYS.pinata]);
console.log(sanitizedIpfsUrl); // https://gateway.pinata.cloud/ipfs/QmVfpP2WQmmRaGk3VPehKxteTvsG465rJDokY3JiyweHBn

const { containsCid } = containsCID(sanitizedIpfsUrl);
console.log(containsCid); // true
const nftCollectionMetadata = await fetchIpfsMetadata('ipfs://QmVfpP2WQmmRaGk3VPehKxteTvsG465rJDokY3JiyweHBn');

console.log('nftCollectionMetadata', {
    name: nftCollectionMetadata.name,
    image: nftCollectionMetadata.image,
    description: nftCollectionMetadata.description,
});

License

FAQs

Package last updated on 19 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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