npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

catalog-core-iurii-fork

v0.0.18

Published

--- sidebar_position: 1 title: Getting started description: Nevermined Catalog Core ---

Downloads

3

Readme


sidebar_position: 1 title: Getting started description: Nevermined Catalog Core

Getting started

Catalog core includes all the Nevermined functionalities splitted in the Catalog provider and Services.

Catalog provider

Catalog provider loads the Nevermined sdk in the context of a React application and provides some parametes and objects to handle it:

  • account - contains all the functionalities to handle authentications and collections belonged to an account
  • assets - contains all the functionalities to handle assets for example get, mint, transfer, order or download asset
  • subscribe - contains all the functionalities to handle events
  • subscription - contains all the functionalities to handle asset subscritions by payment

Services

The Services includes custom react hooks and providers to cover specific scenarios avoiding to the developer thinking in the logic to implement it and make possible for them focus just in the view in a react application. Currently the services is splitted in 4 groups:

  • AccountService - custom hooks and provider to handle user accounts and profiles
  • AssetService - custom hooks to handle assets
  • EventService - custom hooks to operate with events
  • SubscribeService - custom hooks to handle event listeners

Pre-requisites

The Nevermined Components Catalog is a package built with React and Typescript. It requires Node JS v14 or higher. You can find online instructions about How to install Node JS.

How to install ?

yarn add @nevermined-io/catalog-core
or
npm install --save @nevermined-io/catalog-core

How to integrate ?

import { Catalog, AssetService } from '@nevermined-io/components-catalog';
import App from 'app';
import { ethers } from 'ethers'
import { Config } from '@nevermined-io/nevermined-sdk-js';

const appConfig: Config = {
  web3Provider: typeof window !== 'undefined' ? window.ethereum : new ethers.providers.JsonRpcProvider(nodeUri),
  web3ProviderUri,
  neverminedNodeUri,
  neverminedNodeAddress
  faucetUri,
  verbose,
  secretStoreUri,
  graphHttpUri,
  marketplaceAuthToken,
  marketplaceUri,
  artifactsFolder
};

ReactDOM.render(
  <div>
    <Catalog.NeverminedProvider config={appConfig}>
      <App />
    </Catalog.NeverminedProvider>
  </div>,
  document.getElementById('root') as HTMLElement
);

How to use ?

const SingleAsset = () => {
  const did = 'did:nv:f8a00...';
  const assetData: AssetState = AssetService.useAsset(did);

  return (
    <>
      <div>Asset {did}:</div>
      <div>{JSON.stringify(assetData.ddo)}</div>
    </>
  );
};

For a full example.