1.12.2 • Published 8 months ago

@nevermined-io/catalog v1.12.2

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

sidebar_position: 1 title: Getting started

description: Nevermined Catalog

This library was generated with Nx.

Getting started

Catalog 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 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
or
npm install --save @nevermined-io/catalog

How to integrate ?

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

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.

Running tests

Run:

  • unit tests: nx test:unit catalog
  • integration tests: nx test:integrations catalog
  • subgraph integration tests: nx test:subgraph catalog

NOTE: to run integration and subgraph tests you need to run first nvm-tools-actions

1.12.2

8 months ago

1.12.0

8 months ago

1.8.1

10 months ago

1.8.0

10 months ago

1.9.0-rc0

10 months ago

1.11.0

8 months ago

1.12.0-rc0

8 months ago

1.9.1

10 months ago

1.7.3

10 months ago

1.9.0

10 months ago

1.7.2

10 months ago

2.0.0-rc0

8 months ago

1.10.0

8 months ago

1.6.4

11 months ago

1.4.6

12 months ago

1.3.7

12 months ago

1.6.3

11 months ago

1.4.5

12 months ago

1.3.6

1 year ago

1.7.1

11 months ago

1.6.2

12 months ago

1.4.4

12 months ago

1.7.0

11 months ago

1.6.1

12 months ago

1.4.3

12 months ago

1.6.0

12 months ago

1.4.2

12 months ago

1.5.0

12 months ago

1.4.1

12 months ago

1.4.0

12 months ago

1.6.0-rc0

12 months ago

1.6.6

11 months ago

1.6.5

11 months ago

1.3.8

12 months ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.3.5

1 year ago

1.1.7

1 year ago

1.3.4

1 year ago

1.1.6

1 year ago

1.3.3

1 year ago

1.1.5

1 year ago

1.3.2

1 year ago

1.1.4

1 year ago

1.3.1

1 year ago

1.1.3

1 year ago

1.3.0

1 year ago

1.1.2

1 year ago

1.1.10

1 year ago

1.0.0

1 year ago