diff --git a/docs/architecture/building-dapps.md b/docs/architecture/building-dapps.md
index 4ff0c1b698..c5f61ee4c7 100644
--- a/docs/architecture/building-dapps.md
+++ b/docs/architecture/building-dapps.md
@@ -11,15 +11,7 @@ Nevermined ships different [technical components](building-blocks.md) to make th
To facilitate the utilization of Nevermined and the orchestration of all the different components, we provide the following components:
-* The [Nevermined SDK](../nevermined-sdk/intro)
-* The [Nevermined React Components](../react-components/intro)
-
-
-:::info Which one to use
-
-If you are building a **React application** our recommendation is to use the [Nevermined React Components](../react-components/intro), but if not to use the [Nevermined SDK](../nevermined-sdk/intro).
-
-:::
+- The [Nevermined SDK](../nevermined-sdk/intro)
From a developer point of view, the integration of Nevermined is quite straight forward. The usage of the Catalog or the SDK with the usage of any of the existing [Nevermined public environments](../environments/) facilitate the easy development of Decentralized Applications leveraging the Nevermined features.
@@ -29,21 +21,17 @@ From a developer point of view, the integration of Nevermined is quite straight
Nevermined provides the following core features that can be used to build different scenarios or use cases:
-* Access Control - It is a core and cross capability of Nevermined that can be found across all the existing features. It allows to asset creators/providers to define authorization rules that are enforced and validated in a blockchain.
-* Data Sharing - In Nevermined a digital asset can be registered and provide an **access** service. That service allows the download of all the files attached to the asset, when the consumer fulfills all the conditions defined by the asset creator/provider.
-* Remote Computation - It allows to define scenarios where an asset owner enable the execution of an algorithm on top of existing data in a privacy preserving manner.
-* Tokenization - Allows digital assets tokenization via ERC-721 or ERC-1155 NFTs. It includes the modules to facilitate secondary markets and royalties enforcement.
-* Search & Discovery - Exposes the flexibility of querying for digital asset metadata attributes and the events associated with their life-cycle.
-* Provenance - Tracks on-chain all the relevant actions related with the digital assets.
+- Access Control - It is a core and cross capability of Nevermined that can be found across all the existing features. It allows to asset creators/providers to define authorization rules that are enforced and validated in a blockchain.
+- Data Sharing - In Nevermined a digital asset can be registered and provide an **access** service. That service allows the download of all the files attached to the asset, when the consumer fulfills all the conditions defined by the asset creator/provider.
+- Remote Computation - It allows to define scenarios where an asset owner enable the execution of an algorithm on top of existing data in a privacy preserving manner.
+- Tokenization - Allows digital assets tokenization via ERC-721 or ERC-1155 NFTs. It includes the modules to facilitate secondary markets and royalties enforcement.
+- Search & Discovery - Exposes the flexibility of querying for digital asset metadata attributes and the events associated with their life-cycle.
+- Provenance - Tracks on-chain all the relevant actions related with the digital assets.
## Integration
The existence of these features allow application developers to build use cases touching one or many of the above. The best way to do that is using any of the existing libraries provided.
-### Nevermined React Components
-
-The [Nevermined React Components](../react-components/intro) is also a **NPM** library of packaged Nevermined functionalities making easier to add web3 capabilities to any existing **React application**. The Catalog uses the SDK under the hood.
-
### Nevermined SDK
The [Nevermined SDK](../nevermined-sdk/intro) is a **NPM** library of packaged Nevermined functionalities allowing to use all the existing functionalities in any kind of **web or stand-alone** application.
diff --git a/docs/environments/index.mdx b/docs/environments/index.mdx
index 7bad8f71e8..534161c6a6 100644
--- a/docs/environments/index.mdx
+++ b/docs/environments/index.mdx
@@ -6,45 +6,56 @@ description: Nevermined Environments
# Nevermined Public Environments
Nevermined is available in different networks/environments for users to make use of this
-infrastructure without the complexity of deploying Smart Contracts or other components of
-the stack.
+infrastructure without the complexity of deploying Smart Contracts or other components of the stack.
-Existing networks have different characteristics related to the underlying blockchain network being used and whether they are a production or a test environment.
+Existing networks have different characteristics related to the underlying blockchain network being
+used and whether they are a production or a test environment.
## Blockchain networks supported
-Nevermined Smart Contracts are EVM compatible so they can be deployed on any EVM compatible blockchain. Currently we support deployments on:
+Nevermined Smart Contracts are EVM compatible so they can be deployed on any EVM compatible
+blockchain. Currently we support deployments on:
-- **Ethereum**
- **Polygon**
- **Arbitrum**
:::info
-We are planning to augment the list of supported networks. If you need to use Nevermined on any other network, please let us know [through Discord](https://discord.gg/GZju2qScKq).
+We are planning to augment the list of supported networks. If you need to use Nevermined on any
+other network, please let us know [through Discord](https://discord.gg/GZju2qScKq).
:::
## Production and Testing environments
-For each blockchain network we support actively we have Production and Testing deployments. This can help you execute a typical development/testing process and further release into production independently of the blockchain network you use.
+For each blockchain network we support actively we have Production and Testing deployments. This can
+help you execute a typical development/testing process and further release into production
+independently of the blockchain network you use.
## Versions
-We use [Semantic versioning](https://semver.org/) for our Smart Contracts interfaces and Apis. We deploy and mantain multiple versions of the contracts and APIs in these environments for integration with different versions of the stack.
+We use [Semantic versioning](https://semver.org/) for our Smart Contracts interfaces and Apis. We
+deploy and mantain multiple versions of the contracts and APIs in these environments for integration
+with different versions of the stack.
-Generally we **upgrade** Smart Contracts when we implement **patches** and **minor** changes and deploy a new version of the Smart Contracts when we implement **mayor** changes.
+Generally we **upgrade** Smart Contracts when we implement **patches** and **minor** changes and
+deploy a new version of the Smart Contracts when we implement **mayor** changes.
-This means multiple versions of Smart Contracts for the same network and environment, allowing you to integrate either depending on your development lifecycle.
+This means multiple versions of Smart Contracts for the same network and environment, allowing you
+to integrate either depending on your development lifecycle.
## About the tags
-Tags are different contract deployments for the same network & version. Each tag is independent from the others. Generically we use two different tags:
+Tags are different contract deployments for the same network & version. Each tag is independent from
+the others. Generically we use two different tags:
-- `public`: This tag/contracts instane is meant to be used for new integrations, public integrations, etc... It expected to have the latest versions and/or configurations. This is a _shared_ environment. _Probably you need to use these environments._
+- `public`: This tag/contracts instane is meant to be used for new integrations, public
+ integrations, etc... It expected to have the latest versions and/or configurations. This is a
+ _shared_ environment. _Probably you need to use these environments._
-- `common`: This tag/contracts instane is used by more "stable" applications. Each application has its own nevermined stack (`node` + `markeplace-api`).
+- `common`: This tag/contracts instane is used by more "stable" applications. Each application has
+ its own nevermined stack (`node` + `markeplace-api`).
-import DocCardList from '@site/src/components/docCard/docCardList';
+import DocCardList from '@site/src/components/docCard/docCardList'
diff --git a/docs/environments/network-fees.mdx b/docs/environments/network-fees.mdx
index 0e3e5531f7..afe0e0a2b7 100644
--- a/docs/environments/network-fees.mdx
+++ b/docs/environments/network-fees.mdx
@@ -5,22 +5,27 @@ description: Network Fees
# Network Fees
-Nevermined provides the infrastructure to content creators and users to negotiate around their digital assets in a secure a trustless manner. All the software required to make that happen is available under an Open Source License.
-
-To continue to provide this service, the Nevermined Smart Contracts charge a **1 % fee** on all monetary transactions. This fee is included in the distribution of rewards, when an NFT is sold.
+Nevermined provides the infrastructure to content creators and users to negotiate around their
+digital assets in a secure a trustless manner. All the software required to make that happen is
+available under an Open Source License.
+To continue to provide this service, the Nevermined Smart Contracts charge a **1 % fee** on all
+monetary transactions. This fee is included in the distribution of rewards, when an NFT is sold.
:::info
-There is no minimum fee, so if the asset is traded for free, it's not necessary to factor in payment.
+There is no minimum fee, so if the asset is traded for free, it's not necessary to factor in
+payment.
:::
## How to setup the network fees?
-To execute a transaction using the Nevermined Smart Contracts it is necessary to include a comission in the reward payment. This comission goes to the **Nevermined Fee Receiver**.
+To execute a transaction using the Nevermined Smart Contracts it is necessary to include a comission
+in the reward payment. This comission goes to the **Nevermined Fee Receiver**.
-This typically can be done when a content creator defines how payments are distributed during asset registration.
+This typically can be done when a content creator defines how payments are distributed during asset
+registration.
```typescript
// The fee receiver in each network can be fetched from the Nevermined Config Smart Contract
@@ -30,31 +35,25 @@ const feeReceiver = await nevermined.keeper.nvmConfig.getFeeReceiver()
const networkFee = await nevermined.keeper.nvmConfig.getNetworkFee()
const assetPrice = new AssetPrice(
- new Map([
- [creatorAddress, feeReceiver],
- [198, 2] // 99% of the payment goes to the `creatorAddress` and 1% to `feeReceiver`
- ])
+ new Map([
+ [creatorAddress, feeReceiver],
+ [198, 2], // 99% of the payment goes to the `creatorAddress` and 1% to `feeReceiver`
+ ]),
)
// Also network fees can be added with the `addNetworkFees` method
const assetPriceWithFees = new AssetPrice(
- johnDoeAddress,
- BigNumber.from(5),
- zeroAddress
-).addNetworkFees(
- nvmFeeReceiverProd,
- BigNumber.from(networkFee)
-)
+ johnDoeAddress,
+ BigNumber.from(5),
+ zeroAddress,
+).addNetworkFees(nvmFeeReceiverProd, BigNumber.from(networkFee))
// We register a NFT-721 Asset using the payment distribution defined in the `assetRewards` variable
const nftAttributes = NFTAttributes.getNFT721Instance({
- metadata,
- price: assetPrice,
- serviceTypes: ['nft-sales', 'nft-access'],
- nftContractAddress: nftContract.address
+ metadata,
+ price: assetPrice,
+ serviceTypes: ['nft-sales', 'nft-access'],
+ nftContractAddress: nftContract.address,
})
ddo = await nevermined.nfts721.create(nftAttributes, creatorAddress)
-
```
-
-
diff --git a/docs/environments/nvm-dev-envs.md b/docs/environments/nvm-dev-envs.md
index 728d157581..a0731e409c 100644
--- a/docs/environments/nvm-dev-envs.md
+++ b/docs/environments/nvm-dev-envs.md
@@ -5,55 +5,65 @@ description: Nevermined Testnet Environments
# Testnet environments
-Testnet environments are public nevermined environments deployed on public EVM-compatible testnet networks. Typically we use Polygon Mumbai.
-Use [Alchemy's Mumbai Faucet](https://mumbaifaucet.com/) or [Polygon's Mumbai faucet](https://faucet.polygon.technology/) for requesting MATIC.
+Testnet environments are public nevermined environments deployed on public EVM-compatible testnet
+networks. Typically we use Arbitrum Goerli. Arbitrum uses ETH to confirm transactions on the
+Arbitrum network. To get test tokens for the Arbitrum testnet, you first need to use a
+[faucet to obtain Goerli testnet ETH](https://goerlifaucet.com/). Then you can migrate those tokens
+to the Arbitrum Goerli Testnet using the
+[Arbitrum bridge](https://docs.arbitrum.io/getting-started-users).
## Network Fee
-You need to pay a fee to use a Nevermined environment when a payment is being done through the Smart Contracts. This needs to be configured by the content publisher. You can find more information in the [Network Fees section](network-fees.mdx).
+You need to pay a fee to use a Nevermined environment when a payment is being done through the Smart
+Contracts. This needs to be configured by the content publisher. You can find more information in
+the [Network Fees section](network-fees.mdx).
-:::info
+## Arbitrum - Goerli
-The network fee in Nevermined testnets is **1%** and the receiver of that fee is the **0x309039F6A4e876bE0a3FCA8c1e32292358D7f07c** address.
+### Public Arbitrum Goerli deployment (v3)
-:::
+This is a **public** network deployment (`TAG_NAME=public`) of the Nevermined Contracts v3 in the
+Arbitrum Goerli test network. You can use this network if you want to integrate with Nevermined in a
+Arbitrum Testnet.
+The **addresses** of the Nevermined Contracts can be found here:
+https://artifacts.nevermined.network/421613/public/contracts_v3.5.2.json
-## Polygon - Mumbai
-
-### Public Mumbai deployment (v3)
-
-This is a **public** network deployment (`TAG_NAME=public`) of the Nevermined Contracts v3 in the Polygon Mumbai network. You can use this network if you want to integrate with Nevermined in a Polygon Testnet.
-
-The **addresses** of the Nevermined Contracts can be found here: https://artifacts.nevermined.network/80001/public/contracts_v3.0.0.json
-
-The **ABIs of the contracts** to connect via SDK can be download from here: https://artifacts.nevermined.network/80001/public/contracts_v3.0.0.tar.gz
-
-| Environment | Network | Contracts Version | Tag | Component | URL | Comments |
-|-------------|---------|-------------------|-----|-----------|-----|----------|
-| [public-v3-mumbai](https://artifacts.nevermined.network/80001/public/contracts_v3.0.0.json) | Mumbai | 3.0.0 | public | Node | https://node.mumbai.public.nevermined.network | |
-| public-v3-mumbai | Mumbai | - | public | Marketplace API | https://marketplace-api.mumbai.public.nevermined.network | |
+The **ABIs of the contracts** to connect via SDK can be download from here:
+https://artifacts.nevermined.network/421613/public/contracts_v3.5.2.tar.gz
-All the contract events are exposed via [The Graph](https://thegraph.com/). You can find all the `Polygon Mumbai` Nevermined Subgraphs here (search by Nevermined):
+```typescript
+const config: NeverminedOptions = {
+ web3ProviderUri: 'https://goerli-rollup.arbitrum.io/rpc',
+ marketplaceUri: 'https://marketplace-api.goerli.nevermined.app',
+ neverminedNodeUri: 'https://node.goerli.nevermined.app',
+ neverminedNodeAddress: '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc',
+ graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public',
+ artifactsFolder: './artifacts',
+}
+```
-https://thegraph.com/hosted-service
-
-For example for Nevermined Polygon Mumbai:
-
-https://thegraph.com/hosted-service/subgraph/nevermined-io/publicmumbaiv2neverminedtoken
-
-
-## Filecoin - Hyperspace
+## Polygon - Mumbai
-### Public Hyperspace deployment (v3)
+### Public Polygon Mumbai deployment (v3)
-This is a **public** network deployment (`TAG_NAME=public`) of the Nevermined Contracts v3 in the Filecoin Hyperspace network. You can use this network if you want to integrate with Nevermined in a Filecoin FVM Testnet.
+This is a **public** network deployment (`TAG_NAME=public`) of the Nevermined Contracts v3 in the
+Polygon Mumbai test network. You can use this network if you want to integrate with Nevermined in a
+Polygon Testnet.
-The **addresses** of the Nevermined Contracts can be found here: https://artifacts.nevermined.network/3141/public/contracts_v3.0.1.json
+The **addresses** of the Nevermined Contracts can be found here:
+https://artifacts.nevermined.network/80001/public/contracts_v3.5.3.json
-The **ABIs of the contracts** to connect via SDK can be download from here: https://artifacts.nevermined.network/3141/public/contracts_v3.0.1.tar.gz
+The **ABIs of the contracts** to connect via SDK can be download from here:
+https://artifacts.nevermined.network/80001/public/contracts_v3.5.3.tar.gz
-| Environment | Network | Contracts Version | Tag | Component | URL | Comments |
-|-------------|---------|-------------------|-----|-----------|-----|----------|
-| [public-v3-hyperspace](https://artifacts.nevermined.network/3141/public/contracts_v3.0.1.json) | Hyperspace | 3.0.1 | public | Node | - | |
-| public-v3-hyperspace | Hyperspace | - | public | Marketplace API | - | |
+```typescript
+const config: NeverminedOptions = {
+ web3ProviderUri: 'https://rpc-mumbai.matic.today',
+ marketplaceUri: 'https://marketplace-api.mumbai.nevermined.app',
+ neverminedNodeUri: 'https://node.mumbai.nevermined.app/',
+ neverminedNodeAddress: '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc',
+ graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public',
+ artifactsFolder: './artifacts',
+}
+```
diff --git a/docs/environments/nvm-prod-envs.md b/docs/environments/nvm-prod-envs.md
index b38eb65cb4..473a31cfda 100644
--- a/docs/environments/nvm-prod-envs.md
+++ b/docs/environments/nvm-prod-envs.md
@@ -7,39 +7,56 @@ description: Nevermined Production Environments
## Network Fee
-The usage of a Nevermined environment requires to pay a fee when a payment is being done through the Smart Contracts. This needs to be configured by the content publisher. You can find more information in the [Network Fees section](network-fees.mdx).
-
-:::info
-
-The network fee in Nevermined production environments is **1%** and the receiver of that fee is the **0x35aFA2408BB4f479996fafb2bB3A183ec064C265** address.
-
-:::
-
-## Public Polygon environment
-
-- *`public-v2-mumbai`*: Public environment in Polygon. Use this if you want to integrate with Nevermined in Polygon for production.
-
-
-### Version 2.1.0
-
-| Environment | Network | Contracts Version | Tag | Component | URL | Comments |
-|-------------|---------|-------------------|-----|-----------|-----|----------|
-| public-nvm-v2-matic | Polygon Matic | 2.1.0 | public | Node | https://node.matic.public.nevermined.network | |
-| public-nvm-v2-matic | Polygon Matic | 2.1.0 | public | Marketplace API | https://marketplace-api.matic.public.nevermined.network | |
-
-All the contract events are exposed via [The Graph](https://thegraph.com/). You can find all the `Polygon Matic` Nevermined Subgraphs here (search by Nevermined):
-
-https://thegraph.com/hosted-service
-
-For example for Nevermined Polygon Matic:
-
-https://thegraph.com/hosted-service/subgraph/nevermined-io/publicmaticv2neverminedtoken
-
-
-### Version 2.0.5
-
-| Environment | Network | Contracts Version | Tag | Component | URL | Comments |
-|-------------|---------|-------------------|-----|-----------|-----|----------|
-| public-v2-mumbai | Mumbai | 2.0.5 | public | Node | https://node.public.nevermined.network | |
-| public-v2-mumbai | Mumbai | 2.0.5 | public | Marketplace API | https://marketplace-api.public.nevermined.network | |
-| public-v2-mumbai | Mumbai | 2.0.5 | public | GraphNode | https://api.thegraph.com/subgraphs/name/nevermined-io/public | Use with sdk >= 0.21.0 |
+The usage of a Nevermined environment requires to pay a fee when a payment is being done through the
+Smart Contracts. This needs to be configured by the content publisher. You can find more information
+in the [Network Fees section](network-fees.mdx).
+
+## Arbitrum - One
+
+### Public Arbitrum One deployment (v3)
+
+This is a **public** network deployment (`TAG_NAME=public`) of the Nevermined Contracts v3 in the
+Arbitrum One main network. You can use this network if you want to integrate with Nevermined in a
+Arbitrum network.
+
+The **addresses** of the Nevermined Contracts can be found here:
+https://artifacts.nevermined.network/42161/public/contracts_v3.5.3.json
+
+The **ABIs of the contracts** to connect via SDK can be download from here:
+https://artifacts.nevermined.network/42161/public/contracts_v3.5.3.tar.gz
+
+```typescript
+const config: NeverminedOptions = {
+ web3ProviderUri: 'https://arb1.arbitrum.io/rpc',
+ marketplaceUri: 'https://marketplace-api.arbitrum.nevermined.app',
+ neverminedNodeUri: 'https://node.arbitrum.nevermined.app',
+ neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
+ graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public',
+ artifactsFolder: './artifacts',
+}
+```
+
+## Polygon - Matic
+
+### Public Polygon Matic deployment (v3)
+
+This is a **public** network deployment (`TAG_NAME=public`) of the Nevermined Contracts v3 in the
+Polygon Matic main network. You can use this network if you want to integrate with Nevermined in a
+Polygon network.
+
+The **addresses** of the Nevermined Contracts can be found here:
+https://artifacts.nevermined.network/137/public/contracts_v3.5.3.json
+
+The **ABIs of the contracts** to connect via SDK can be download from here:
+https://artifacts.nevermined.network/137/public/contracts_v3.5.3.tar.gz
+
+```typescript
+const config: NeverminedOptions = {
+ web3ProviderUri: 'https://polygon-rpc.com/',
+ marketplaceUri: 'https://marketplace-api.matic.nevermined.app',
+ neverminedNodeUri: 'https://node.matic.nevermined.app',
+ neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
+ graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public',
+ artifactsFolder: './artifacts',
+}
+```
diff --git a/docs/getting-started/users.md b/docs/getting-started/users.md
index 3f6527fc8f..943ab1d8c0 100644
--- a/docs/getting-started/users.md
+++ b/docs/getting-started/users.md
@@ -5,17 +5,14 @@ description: Who can use Nevermined
# Who can use Nevermined
-Nevermined is for teams and organizations that are working with data, AI or Web3/NFT technology.
+Nevermined is for teams and organizations that are working with data, AI or Web3/NFT technology.
That’s a huge amount of people. 😂
-The desire to share data across silos and geographic boundaries is not new for data scientists. The desire to keep AI as open and accessible as possible and to be able to stand on the shoulders of giants, for the common good, is not new.
+The desire to share data across silos and geographic boundaries is not new for data scientists. The desire to keep AI as open and accessible as possible and to be able to stand on the shoulders of giants, for the common good, is not new.
-So any team, organization or individual that sees Data and AI as economic assets, with incentives, IP rights,... can benefit from using Nevermined.
+So any team, organization or individual that sees Data and AI as economic assets, with incentives, IP rights,... can benefit from using Nevermined.
-Currently, Nevermined is geared towards developers and is available in two ways, for different development approaches.
-
-- If you want to use a low-level library, you can use our [SDK](../nevermined-sdk/intro)
-- For apps made in React, we have functionalities available as [React Components](../react-components/intro).
+Currently, Nevermined is geared towards developers and is available through our [SDK](../nevermined-sdk/intro)
We’re also working on packaging our components in SaaS-solutions.
diff --git a/docs/nevermined-sdk/example.md b/docs/nevermined-sdk/example.md
index f6a880b93c..172e197532 100644
--- a/docs/nevermined-sdk/example.md
+++ b/docs/nevermined-sdk/example.md
@@ -4,19 +4,16 @@ sidebar_position: 3
# How to use the SDK?
-## Before to start
-
-If you project is using `React` we recommend to use [Catalog](../react-components/intro.md) to make everything much easier, SDK is the low level of it.
-
## Requirements
Before you start with this demo you require:
-* An extension of [Metamask](https://metamask.io/) installed in your browser
-* [node](https://nodejs.org/en/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) needs to be installed
-* The Nevermined artifacts, you can find the script [here](https://github.com/nevermined-io/create-nevermined-react/blob/main/scripts/download-artifacts.sh). To use the script run `./download-artifacts.sh [VERSION OF THE CONTRACT] [NETWORK]`
+- An extension of [Metamask](https://metamask.io/) installed in your browser
+- [node](https://nodejs.org/en/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) needs to be installed
+- The Nevermined artifacts, you can find the script [here](https://github.com/nevermined-io/create-nevermined-react/blob/main/scripts/download-artifacts.sh). To use the script run `./download-artifacts.sh [VERSION OF THE CONTRACT] [NETWORK]`
## Let's start with the app config file
+
The first file that you need to create is the `config.ts` file which contains all the [options needed](./api-reference/classes/Config.md) to initialize the [Nevermined SDK](./intro.md).
```ts
@@ -24,7 +21,8 @@ import { NeverminedOptions } from '@nevermined-io/sdk'
import { ethers } from 'ethers'
// The web3 endpoint of the blockchain network to connect to, could be an Infura endpoint, Quicknode, or any other web3 provider
-export const web3ProviderUri = process.env.REACT_APP_NODE_URI || 'https://matic-mumbai.chainstacklabs.com'
+export const web3ProviderUri =
+ process.env.REACT_APP_NODE_URI || 'https://matic-mumbai.chainstacklabs.com'
// The url to a Nevermined node. It could be your own if you run a Nevermined Node
export const neverminedNodeUri =
@@ -38,10 +36,12 @@ export const neverminedNodeAddress =
export const marketplaceUri = 'https://marketplace-api.mumbai.public.nevermined.network'
// The url of the The Graph deployment of Nevermined
-const graphHttpUri = process.env.GRAPH_HTTP_URI || 'https://api.thegraph.com/subgraphs/name/nevermined-io/public'
+const graphHttpUri =
+ process.env.GRAPH_HTTP_URI || 'https://api.thegraph.com/subgraphs/name/nevermined-io/public'
-// represent USDC token in mumbai that can be claimed in the faucet https://calibration-faucet.filswan.com/#/dashboard
-export const erc20TokenAddress = process.env.ERC20_TOKEN_ADDRESS || '0xe11a86849d99f524cac3e7a0ec1241828e332c62'
+// represent USDC token in mumbai that can be claimed in the faucet https://calibration-faucet.filswan.com/#/dashboard
+export const erc20TokenAddress =
+ process.env.ERC20_TOKEN_ADDRESS || '0xe11a86849d99f524cac3e7a0ec1241828e332c62'
// The Chain Id of the network where we are connecting
export const acceptedChainId = process.env.REACT_APP_ACCEPTED_CHAIN_ID || '80001' // for Mumbai
@@ -51,7 +51,8 @@ export const rootUri = process.env.REACT_APP_ROOT_URI || 'http://localhost:3445'
export const appConfig: NeverminedOptions = {
//@ts-ignore
- web3ProviderUri: typeof window !== 'undefined' ? window.ethereum : new ethers.providers.JsonRpcProvider(nodeUri),
+ web3ProviderUri:
+ typeof window !== 'undefined' ? window.ethereum : new ethers.providers.JsonRpcProvider(nodeUri),
neverminedNodeUri,
neverminedNodeAddress,
graphHttpUri,
@@ -66,29 +67,35 @@ export const appConfig: NeverminedOptions = {
The example file `src/example/index.tsx` contains all the basic logic to handle a [NFT1155](../architecture/what-can-i-do.md#tokenization-of-assets-via-erc-1155-nfts-aka-nft-sales) as a component. It outlines each functionality and component in detail.
### SingleAsset
+
It shows the content of the ddo object published
```tsx
-const SingleAsset = ({ddo}: {ddo: DDO}) => {
+const SingleAsset = ({ ddo }: { ddo: DDO }) => {
return (
<>
- Asset {ddo.id.slice(0, 10)}...:
+
+ Asset {ddo.id.slice(0, 10)}...:
+
- {JSON.stringify(ddo)}
+
+ {JSON.stringify(ddo)}
+
>
)
}
```
### PublishAsset
+
It renders a button used to publish a new [NFT](../architecture/specs/Spec-NFT.md)
```tsx
-const PublishAsset = ({onPublish, }: {onPublish: () => void }) => {
+const PublishAsset = ({ onPublish }: { onPublish: () => void }) => {
return (
<>
-
+
mint
>
@@ -97,6 +104,7 @@ const PublishAsset = ({onPublish, }: {onPublish: () => void }) => {
```
### loginMetamask
+
We need a function to login to metamask when it isn't yet
```tsx
@@ -107,24 +115,24 @@ const loginMarketplace = async (sdk: Nevermined, account: Account) => {
```
### BuyAsset
+
The `BuyAsset` component will display the button `buy` in order to buy the asset if the wallet account is not a NFT1155 holder. Otherwise, the owner will display a download button to download the NFT asset
```tsx
-const BuyAsset = ({ddo, sdk, account}: {ddo: DDO, sdk: Nevermined, account: Account}) => {
+const BuyAsset = ({ ddo, sdk, account }: { ddo: DDO; sdk: Nevermined; account: Account }) => {
const [ownNFT1155, setOwnNFT1155] = useState(false)
const [isBought, setIsBought] = useState(false)
const [owner, setOwner] = useState('')
-
+
useEffect(() => {
- (async () => {
+ ;(async () => {
const balance = await sdk.nfts1155.balance(ddo.id, account)
- const nftBalance = BigNumber.from(balance).toNumber()
+ const nftBalance = BigNumber.from(balance).toNumber()
setOwnNFT1155(nftBalance > 0)
setOwner(await sdk.assets.owner(ddo.id))
})()
}, [account, isBought])
-
const onBuy = async () => {
await loginMarketplace(sdk, account)
@@ -137,7 +145,7 @@ const BuyAsset = ({ddo, sdk, account}: {ddo: DDO, sdk: Nevermined, account: Acco
BigNumber.from(1),
1155,
)
-
+
setIsBought(Boolean(transferResult))
} catch (error) {
Logger.error(error)
@@ -155,15 +163,15 @@ const BuyAsset = ({ddo, sdk, account}: {ddo: DDO, sdk: Nevermined, account: Acco
return (
{ownNFT1155 ? (
-
+
Download NFT
- ) : (
- owner !== account.getId() ?
-
+ ) : owner !== account.getId() ? (
+
buy
- : The owner cannot buy, please change the account to buy the NFT asset
+ ) : (
+ The owner cannot buy, please change the account to buy the NFT asset
)}
)
@@ -171,10 +179,11 @@ const BuyAsset = ({ddo, sdk, account}: {ddo: DDO, sdk: Nevermined, account: Acco
```
### App
+
The main component of the example, it pulls the rest of the components and also includes the function `onPublish` with the logic to publish a NFT1155 which is transferred as a parameter to the component [PublisAsset](#publishasset)
```tsx
-const App = ({config}: {config: Config }) => {
+const App = ({ config }: { config: Config }) => {
const [sdk, setSdk] = useState({} as Nevermined)
const [account, setAccount] = useState(undefined as Account)
const [ddo, setDDO] = useState({} as DDO)
@@ -182,50 +191,50 @@ const App = ({config}: {config: Config }) => {
const loginMetamask = async () => {
const response = await (window as any)?.ethereum?.request?.({
- method: "eth_requestAccounts",
+ method: 'eth_requestAccounts',
})
-
+
setWalletAddress(ethers.utils.getAddress(response[0]))
}
useEffect(() => {
- (window as any)?.ethereum?.on("accountsChanged", (newAccount: string[]) => {
+ ;(window as any)?.ethereum?.on('accountsChanged', (newAccount: string[]) => {
if (newAccount && newAccount.length > 0) {
- setWalletAddress(
- ethers.utils.getAddress(newAccount[0])
- )
+ setWalletAddress(ethers.utils.getAddress(newAccount[0]))
} else {
- setWalletAddress("")
- console.log("No Account found!")
+ setWalletAddress('')
+ console.log('No Account found!')
}
- })
-
- (async() => {
+ })(async () => {
const provider = new ethers.providers.Web3Provider((window as any).ethereum)
const accounts = await provider.listAccounts()
- setWalletAddress(
- accounts?.length ? ethers.utils.getAddress(accounts[0]) : ""
- )
+ setWalletAddress(accounts?.length ? ethers.utils.getAddress(accounts[0]) : '')
})()
}, [])
useEffect(() => {
- if(walletAddress) {
- (async () => {
+ if (walletAddress) {
+ ;(async () => {
try {
const nvm = await Nevermined.getInstance(config)
const accounts = await nvm.accounts.list()
setAccount(accounts[0])
setSdk(nvm)
- } catch(error) {
+ } catch (error) {
console.log(error)
}
})()
}
}, [walletAddress])
- const publishNFT1155 = async (nodeAddress: string, accountWallet: Account, metadata: MetaData, royaltyAttributes: RoyaltyAttributes, assetPrice: AssetPrice) => {
+ const publishNFT1155 = async (
+ nodeAddress: string,
+ accountWallet: Account,
+ metadata: MetaData,
+ royaltyAttributes: RoyaltyAttributes,
+ assetPrice: AssetPrice,
+ ) => {
const nftAttributes = NFTAttributes.getNFT1155Instance({
metadata,
serviceTypes: ['nft-sales', 'nft-access'],
@@ -235,7 +244,7 @@ const App = ({config}: {config: Config }) => {
preMint: true,
nftContractAddress: sdk.nfts1155.nftContract.address,
providers: [nodeAddress],
- price: assetPrice
+ price: assetPrice,
})
const ddo = await sdk.nfts1155.create(nftAttributes, accountWallet)
@@ -245,9 +254,7 @@ const App = ({config}: {config: Config }) => {
const onPublish = async () => {
try {
- const assetPriceMap = new Map([
- [account.getId(), BigNumber.from(1)]
- ])
+ const assetPriceMap = new Map([[account.getId(), BigNumber.from(1)]])
const assetPrice = new AssetPrice(assetPriceMap)
const royaltyAttributes = {
@@ -265,21 +272,29 @@ const App = ({config}: {config: Config }) => {
const metadata: MetaData = {
main: {
name: '',
- files: [{
- index: 0,
- contentType: 'application/json',
- url: 'https://uploads5.wikiart.org/00268/images/william-holbrook-beard/the-bear-dance-1870.jpg'
- }],
+ files: [
+ {
+ index: 0,
+ contentType: 'application/json',
+ url: 'https://uploads5.wikiart.org/00268/images/william-holbrook-beard/the-bear-dance-1870.jpg',
+ },
+ ],
type: 'dataset',
author: '',
license: '',
dateCreated: new Date().toISOString(),
- }
+ },
}
await loginMarketplace(sdk, account)
-
- const response = await publishNFT1155(config.neverminedNodeAddress, account, metadata, royaltyAttributes, assetPrice)
+
+ const response = await publishNFT1155(
+ config.neverminedNodeAddress,
+ account,
+ metadata,
+ royaltyAttributes,
+ assetPrice,
+ )
setDDO(response as DDO)
} catch (error) {
@@ -290,25 +305,27 @@ const App = ({config}: {config: Config }) => {
return (
)
@@ -566,12 +609,11 @@ export default App
```
## Styling
+
In the path `src/examples/example.module.scss` you will find some styles to improve the UI of the app.
```scss
-@import '~@nevermined-io/styles/lib/cjs/styles/index.scss'
-
-.example {
+@import '~@nevermined-io/styles/lib/cjs/styles/index.scss' .example {
@include component;
&__container {
@@ -597,6 +639,7 @@ In the path `src/examples/example.module.scss` you will find some styles to impr
```
## The index file
+
The `src/indes.tsx` file call the `App` component with the configurations set
```tsx
@@ -607,5 +650,5 @@ import ReactDOM from 'react-dom'
import { appConfig } from './config'
import App from './app'
-ReactDOM.render(, document.getElementById('root') as HTMLElement)
+ReactDOM.render(, document.getElementById('root') as HTMLElement)
```
diff --git a/docs/nevermined-sdk/getting-started.md b/docs/nevermined-sdk/getting-started.md
index 190756e0a1..88ad701182 100644
--- a/docs/nevermined-sdk/getting-started.md
+++ b/docs/nevermined-sdk/getting-started.md
@@ -2,8 +2,7 @@
sidebar_position: 2
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
# Getting Started
@@ -12,88 +11,92 @@ import TabItem from '@theme/TabItem';
- ```bash
- yarn add @nevermined-io/sdk
- ```
+```bash
+yarn add @nevermined-io/sdk
+```
- ```bash
- npm install --save @nevermined-io/sdk
- ```
+```bash
+npm install --save @nevermined-io/sdk
+```
### Connecting to Nevermined
-Under the hood Nevermined has a set of Smart Contracts that allows Asset Providers to tokenize them and specify different access conditions. This creates Service Execution Agreements. Assets could be anything from a JPEG to a music track, from a voting right to a data set.
-
-There are multiple environments of Nevermined available, before connecting you need to decide to which of them you want to connect and download the artifacts of that environment.
-You can find a full list of the environments available in the [Environments section](../environments/).
+Under the hood Nevermined has a set of Smart Contracts that allows Asset Providers to tokenize them
+and specify different access conditions. This creates Service Execution Agreements. Assets could be
+anything from a JPEG to a music track, from a voting right to a data set.
+There are multiple environments of Nevermined available, before connecting you need to decide to
+which of them you want to connect and download the artifacts of that environment. You can find a
+full list of the environments available in the [Environments section](../environments/).
-This will download the artifacts for the latest contracts in _mumbai_ and store them in a folder called `./artifacts`:
+This will download the artifacts for the latest contracts in _arbitrum-goerli_ and store them in a
+folder called `./artifacts`:
```bash
- wget -c https://artifacts.nevermined.network/80001/public/contracts_v3.0.0.tar.gz -O -| tar -xz --one-top-level=./artifacts
- ```
+ wget -c https://artifacts.nevermined.network/421613/public/contracts_v3.5.2.tar.gz -O -| tar -xz --one-top-level=./artifacts
+```
- Next we need to chose the nevermined environment we want to connect to.
+Next we need to chose the nevermined environment we want to connect to.
-
-
- ```typescript
- import { Config } from '@nevermined-io/sdk'
-
- const config: NeverminedOptions = {
- // The web3 endpoint of the blockchain network to connect to, could be an Infura endpoint, Quicknode, or any other web3 provider
- web3ProviderUri: 'https://rpc-mumbai.maticvigil.com',
- // The url of the marketplace api if you connect to one. It could be your own service if you run a Marketplace API
- marketplaceUri: 'https://marketplace-api.mumbai.public.nevermined.network',
- // The url to a Nevermined node. It could be your own if you run a Nevermined Node
- neverminedNodeUri: 'https://node.mumbai.public.nevermined.network',
- // The public address of the above Node
- neverminedNodeAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0',
- marketplaceAuthToken: undefined,
- // Folder where are copied the ABIs of the Nevermined Smart Contracts
- artifactsFolder: './artifacts',
- }
- ```
+
+
+```typescript
+import { Config } from '@nevermined-io/sdk'
+
+const config: NeverminedOptions = {
+ // The web3 endpoint of the blockchain network to connect to, could be an Infura endpoint, Quicknode, or any other web3 provider
+ web3ProviderUri: 'https://goerli-rollup.arbitrum.io/rpc',
+ // The url of the marketplace api if you connect to one. It could be your own service if you run a Marketplace API
+ marketplaceUri: 'https://marketplace-api.goerli.nevermined.app',
+ // The url to a Nevermined node. It could be your own if you run a Nevermined Node
+ neverminedNodeUri: 'https://node.goerli.nevermined.app',
+ // The public address of the above Node
+ neverminedNodeAddress: '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc',
+ // The url to access the nevermined subgraphs required to query for on-chain events
+ graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public',
+ // Folder where are copied the ABIs of the Nevermined Smart Contracts
+ artifactsFolder: './artifacts',
+}
+```
-
-
- ```typescript
- import { Config } from '@nevermined-io/sdk'
-
- const config: NeverminedOptions = {
- // The web3 endpoint of the blockchain network to connect to, could be an Infura endpoint, Quicknode, or any other web3 provider
- web3ProviderUri: 'https://rpc-mainnet.maticvigil.com',
- // The url of the marketplace api if you connect to one. It could be your own service if you run a Marketplace API
- marketplaceUri: 'https://marketplace-api.public.nevermined.network',
- // The url to a Nevermined node. It could be your own if you run a Nevermined Node
- neverminedNodeUri: 'https://node.public.nevermined.network',
- // The public address of the above Node
- neverminedNodeAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0',
- marketplaceAuthToken: '',
- // Folder where are copied the ABIs of the Nevermined Smart Contracts
- artifactsFolder: './artifacts',
- }
- ```
+
+
+```typescript
+import { Config } from '@nevermined-io/sdk'
+
+const config: NeverminedOptions = {
+ // The web3 endpoint of the blockchain network to connect to, could be an Infura endpoint, Quicknode, or any other web3 provider
+ web3ProviderUri: 'https://arb1.arbitrum.io/rpc',
+ // The url of the marketplace api if you connect to one. It could be your own service if you run a Marketplace API
+ marketplaceUri: 'https://marketplace-api.arbitrum.nevermined.app',
+ // The url to a Nevermined node. It could be your own if you run a Nevermined Node
+ neverminedNodeUri: 'https://node.arbitrum.nevermined.app',
+ // The public address of the above Node
+ neverminedNodeAddress: '0x824dbcE5E9C96C5b8ce2A35a25a5ab87eD1D00b1',
+ // The url to access the nevermined subgraphs required to query for on-chain events
+ graphHttpUri: 'https://api.thegraph.com/subgraphs/name/nevermined-io/public',
+ // Folder where are copied the ABIs of the Nevermined Smart Contracts
+ artifactsFolder: './artifacts',
+}
+```
-:::note
-`web3ProviderUri` is an rpc endpoint to connect to the blockchain. You can find public links at [chainlist](https://chainlist.org/)
+:::note `web3ProviderUri` is an rpc endpoint to connect to the blockchain. You can find public links
+at [chainlist](https://chainlist.org/)
`artifactsFolder` is the location of the artifacts that we downloaded in the previous section.
-The other environment config parameteres will be discussed in further sections
-:::
+The other environment config parameters will be discussed in further sections :::
With this in place we have everything we need to connect to nevermined:
@@ -106,10 +109,10 @@ console.log(await nevermined.utils.versions.get())
// {
// sdk: {
// name: 'Sdk-js',
-// version: '1.0.0',
+// version: '2.0.0',
// commit: '9d31ebc27fe6c7c8a573abd283c632e5c70e687c',
// status: 'Working',
-// network: 'mumbai',
-// keeperVersion: '3.0.0',
+// network: 'arbitrum-goerli',
+// keeperVersion: '3.5.2',
// }
```
diff --git a/docs/nevermined-sdk/intro.md b/docs/nevermined-sdk/intro.md
index 4214f8d888..ea3efe6e2d 100644
--- a/docs/nevermined-sdk/intro.md
+++ b/docs/nevermined-sdk/intro.md
@@ -6,11 +6,6 @@ sidebar_position: 1
The Nevermined SDK is a low level library which functions as an intermediate between the client and the different backend services like [Marketplace API](../architecture/marketplace-api/index.md), [Node](../architecture/node/index.md), [Smart Contracts](../architecture/contracts/index.md), etc...
-# When should I use the Nevermined SDK?
-
-You should use Nevermined SDK if your project isn't developed using [React](https://reactjs.org/). If you do use React, we recommend to use [Nevermined React Components](../react-components/intro.md). As we mentioned before, the **SDK** is a low level library and **Catalog** makes developing dApps in React easier.
-
import DocCardList from '@site/src/components/docCard/docCardList';
-
diff --git a/docs/nevermined-sdk/nfts-sdk.md b/docs/nevermined-sdk/nfts-sdk.md
index b4445474cf..59b28a5c09 100644
--- a/docs/nevermined-sdk/nfts-sdk.md
+++ b/docs/nevermined-sdk/nfts-sdk.md
@@ -15,7 +15,7 @@ In a Nevermined network we pre-deploy some NFT implementations but typically you
### Cloning a previously deployed contract
-Via clonning you can make a copy of an already deploy contract bytecode and deploy it again in a new address. This clone will be a copy of the Smart Contract but not of the state of it. The new contract clonned will be owned by the account clonning the contract.
+Via clonning you can make a copy of an already deploy contract bytecode and deploy it again in a new address. This clone will be a copy of the Smart Contract but not of the state of it. The new contract clonned will be owned by the account clonning the contract.
:::tip Clonning saves gas
@@ -30,12 +30,12 @@ Here an example of how you clone a Nevermined ERC-721 contract:
```typescript
const cloneAddress = await nevermined.nfts721.getContract.createClone(
- 'My New NFT 721',
- 'SYM',
- 'http://nft.metadata',
- BigNumber.from(0), // Uncapped
- [], // Add here any address to be added as a NFT operator
- deployerAccount
+ 'My New NFT 721',
+ 'SYM',
+ 'http://nft.metadata',
+ BigNumber.from(0), // Uncapped
+ [], // Add here any address to be added as a NFT operator
+ deployerAccount,
)
```
@@ -46,11 +46,11 @@ Here an example of how you clone a Nevermined ERC-1155 contract:
```typescript
const cloneAddress = await nevermined.nfts1155.getContract.createClone(
- 'My New NFT 1155',
- 'SYM',
- 'http://nft.metadata',
- [], // Add here any address to be added as a NFT operator
- deployerAccount
+ 'My New NFT 1155',
+ 'SYM',
+ 'http://nft.metadata',
+ [], // Add here any address to be added as a NFT operator
+ deployerAccount,
)
```
@@ -129,20 +129,16 @@ Let's say John Doe wants to get 5 USDC:
```typescript
const usdcDecimals = 18
const assetPrice = new AssetPrice(
- johnDoeAddress,
- BigNumber.from(10).pow(usdcDecimals).mul(5),
- usdcERC20Address
+ johnDoeAddress,
+ BigNumber.from(10).pow(usdcDecimals).mul(5),
+ usdcERC20Address,
)
```
In the next example John Doe wants to receive 5 wei of ETH. When the token address provided is the zero address (`0x0000000000000000000000000000000000000000`) Nevermined will use as payment the native token of the network where the Smart Contracts are deployed. It means ETH for Ethereum networks, MATIC for Polygon, etc.
```typescript
-const assetPrice = new AssetPrice(
- johnDoeAddress,
- BigNumber.from(5),
- zeroAddress
-)
+const assetPrice = new AssetPrice(johnDoeAddress, BigNumber.from(5), zeroAddress)
```
In the following example John Doe will split the rewards with the marketplace where is selling his NFT. In this case John Doe will get 90 wei of ETH and the marketplace will get 10 wei of ETH:
@@ -152,20 +148,16 @@ const assetPrice = new AssetPrice(
new Map([
[johnDoeAddress, BigNumber.from(90)],
[marketplaceAddress, BigNumber.from(90)],
- ])
+ ]),
).setTokenAddress(zeroAddress)
```
And finally let's see how to add the network fees. In Nevermined the Smart Contracts charge a fee for any monetary transaction. This fee needs to be added in the assets price object in this way:
```typescript
-const assetPrice = new AssetPrice(
- johnDoeAddress,
- BigNumber.from(5),
- zeroAddress
-).addNetworkFees(
+const assetPrice = new AssetPrice(johnDoeAddress, BigNumber.from(5), zeroAddress).addNetworkFees(
neverminedFeesReceiver,
- BigNumber.from(10000) // 1% fee
+ BigNumber.from(10000), // 1% fee
)
```
@@ -181,7 +173,7 @@ If as a content creator you want to receive royalties in the secondary market, y
const royaltyAttributes = getRoyaltyAttributes(
nevermined,
RoyaltyKind.Standard,
- 10000 // It means 1% royalties
+ 10000, // It means 1% royalties
)
```
@@ -192,7 +184,7 @@ Nevermined supports different kind of royalties schemes where the static scheme
The trading between seller and buyer in a Nevermined ecosystem can be done directly between them in a peer to peer fashion. But to finalize all the transactions both users need to be online to accept the asset transactions. Because of that, it is convenient to delegate some permissions to a Nevermined Node (aka Node). The Node is an element in the Nevermined architecture that facilitates the usage. Nodes can be executed by Nevermined or anyone else and have a limited permissions to trigger some transactions.
During the registration of an asset this permissions can be granted adding a one or many Nodes addresses to the providers option.
-The addition or removal of permissions to a Node or group of Nodes can be done during the registration or afterwards.
+The addition or removal of permissions to a Node or group of Nodes can be done during the registration or afterwards.
### Backing up the metadata in immutable storage
@@ -207,24 +199,18 @@ This option can be achieved by giving the `PublishMetadata` option to the create
As you can see Nevermined is very flexible in the way that allows to configure several options that are convinient depending on different use cases. Let's put all of this together:
-
Registering a Nevermined NFT (ERC-721):
```typescript
-
const nftAttributes = NFTAttributes.getNFT721Instance({
- metadata,
- serviceTypes: ['nft-sales', 'nft-access'],
- nftContractAddress: myERC721Contract.address
+ metadata,
+ serviceTypes: ['nft-sales', 'nft-access'],
+ nftContractAddress: myERC721Contract.address,
})
-const ddo = await nevermined.nfts721.create(
- nftAttributes,
- johnDoeAccount
-)
-
+const ddo = await nevermined.nfts721.create(nftAttributes, johnDoeAccount)
```
@@ -233,32 +219,31 @@ const ddo = await nevermined.nfts721.create(
Registering a Nevermined NFT (ERC-1155):
```typescript
-
const royaltyAttributes = getRoyaltyAttributes(
nevermined,
RoyaltyKind.Standard,
- 100000 // 10% royalties in the secondary market
+ 100000, // 10% royalties in the secondary market
)
const assetAttributes = AssetAttributes.getInstance({
metadata, // Some asset metadata
price: assetPrice, // As we defined before
serviceTypes: ['nft-sales', 'nft-access'],
- providers: [config.neverminedNodeAddress] // The address of the Nevermined Node with permissions to interact with the asset
+ providers: [config.neverminedNodeAddress], // The address of the Nevermined Node with permissions to interact with the asset
})
const nftAttributes = NFTAttributes.getNFT1155Instance({
...assetAttributes,
nftContractAddress: myERC1155Contract, // The address of the NFT Contract attached to the asset
amount: numberEditions,
- royaltyAttributes
-})
+ royaltyAttributes,
+})
const ddo = await nevermined.nfts1155.create(
- nftAttributes,
- johnDoeAccount, // The account of the user registering the asset
- PublishMetadata.IPFS
-)
+ nftAttributes,
+ johnDoeAccount, // The account of the user registering the asset
+ PublishMetadata.IPFS,
+)
```
@@ -278,10 +263,7 @@ If we want to get the metadata we use the resolve method:
const metadata = await nevermined.assets.resolve(ddo.id)
// Here we force to fetch the Metadata from IPFS
-const metadata = await nevermined.assets.resolve(
- ddo.id,
- DIDResolvePolicy.ImmutableFirst
-)
+const metadata = await nevermined.assets.resolve(ddo.id, DIDResolvePolicy.ImmutableFirst)
```
The resolve method accepts an optional parameter in the second position. That is the policy used to resolve the metadata for a DID given. Remember before we spoke about the option of storing the Metadata off-chain and on-chain, with this option we can specify how we prioritize the resolution of the metadata. Depending on the use case that gives us the option to try to resolve that metadata from the immutable data store first (like IPFS), the Metadata API or force only one of these options.
@@ -307,10 +289,10 @@ const details = await nevermined.nfts1155.details(ddo.id)
The `details` method of the NFT apis will provide information about:
-* The mint cap
-* The total supply of the nft
-* The royalties scheme and amount
-* The owner of the NFT contract
+- The mint cap
+- The total supply of the nft
+- The royalties scheme and amount
+- The owner of the NFT contract
## How a buyer can order a NFT
@@ -327,14 +309,13 @@ const agreementId = await nevermined.nfts721.order(ddo.id, buyerAccount)
```typescript
-const numberEditions= BigNumber.from(1) // Higher if we want to purchase more than 1 edition
+const numberEditions = BigNumber.from(1) // Higher if we want to purchase more than 1 edition
const agreementId = await nevermined.nfts1155.order(ddo.id, numberEditions, buyerAccount)
```
-
The order method will return an `agreementId`. This is a unique identifier associated with this purchase transaction. The `agreementId` can be used later to fetch on-chain information about the status of the order.
## The buyer can download some exclusive contents associated with the asset
@@ -345,11 +326,7 @@ If everything went well during the `order` step, the buyer can claim for the NFT
```typescript
-const result = await nevermined.nfts721.claim(
- agreementId,
- publisherAddress,
- buyerAddress
-)
+const result = await nevermined.nfts721.claim(agreementId, publisherAddress, buyerAddress)
```
@@ -357,10 +334,10 @@ const result = await nevermined.nfts721.claim(
```typescript
const result = await nevermined.nfts1155.claim(
- agreementId,
- publisherAddress,
- buyerAddress,
- numberEditions
+ agreementId,
+ publisherAddress,
+ buyerAddress,
+ numberEditions,
)
```
@@ -374,22 +351,14 @@ Because the buyer is now a NFT holder, if the asset has associated some exclusiv
```typescript
-await nevermined.nfts721.access(
- ddo.id,
- user,
- '/tmp/my-files'
-)
+await nevermined.nfts721.access(ddo.id, user, '/tmp/my-files')
```
```typescript
-await nevermined.nfts1155.access(
- ddo.id,
- buyerAccount,
- '/tmp/my-files'
-)
+await nevermined.nfts1155.access(ddo.id, buyerAccount, '/tmp/my-files')
```
@@ -405,19 +374,14 @@ Any user can interact directly with the NFT contracts directly to get contract b
```typescript
-const balance = await nevermined.nfts721.balance(
- johnDoeAddress
-)
+const balance = await nevermined.nfts721.balance(johnDoeAddress)
```
```typescript
-const balance = await nevermined.nfts1155.balance(
- ddo.id,
- johnDoeAddress
-)
+const balance = await nevermined.nfts1155.balance(ddo.id, johnDoeAddress)
```
diff --git a/docs/react-components/_category_.json b/docs/react-components/_category_.json
deleted file mode 100644
index 792c2ce6ff..0000000000
--- a/docs/react-components/_category_.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "label": "Nevermined React Components",
- "position": 2,
- "link": {
- "type": "doc",
- "id": "react-components/intro"
- }
- }
-
\ No newline at end of file
diff --git a/docs/react-components/catalog/API/_category_.json b/docs/react-components/catalog/API/_category_.json
deleted file mode 100644
index 99fc85da76..0000000000
--- a/docs/react-components/catalog/API/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "API Ref.",
- "position": 2,
- "link": {
- "type": "doc",
- "id": "react-components/catalog/API/modules"
- }
-}
\ No newline at end of file
diff --git a/docs/react-components/catalog/API/enums/State.md b/docs/react-components/catalog/API/enums/State.md
deleted file mode 100644
index 11e494fbc0..0000000000
--- a/docs/react-components/catalog/API/enums/State.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Enumeration: State
-
-## Table of contents
-
-### Enumeration Members
-
-- [Confirmed](State.md#confirmed)
-- [Disabled](State.md#disabled)
-- [Unconfirmed](State.md#unconfirmed)
-
-## Enumeration Members
-
-### Confirmed
-
-• **Confirmed** = ``"confirmed"``
-
-Entity created
-
-#### Defined in
-
-[types/index.ts:361](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L361)
-
-___
-
-### Disabled
-
-• **Disabled** = ``"disabled"``
-
-Entity disable or not available
-
-#### Defined in
-
-[types/index.ts:357](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L357)
-
-___
-
-### Unconfirmed
-
-• **Unconfirmed** = ``"unconfirmed"``
-
-Entity not validated yet or incomplete
-
-#### Defined in
-
-[types/index.ts:359](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L359)
diff --git a/docs/react-components/catalog/API/enums/TransferNFTConditionMethod.md b/docs/react-components/catalog/API/enums/TransferNFTConditionMethod.md
deleted file mode 100644
index 43c95610cb..0000000000
--- a/docs/react-components/catalog/API/enums/TransferNFTConditionMethod.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Enumeration: TransferNFTConditionMethod
-
-## Table of contents
-
-### Enumeration Members
-
-- [nft1155](TransferNFTConditionMethod.md#nft1155)
-- [nft721](TransferNFTConditionMethod.md#nft721)
-
-## Enumeration Members
-
-### nft1155
-
-• **nft1155** = ``"transferNftCondition"``
-
-#### Defined in
-
-[types/index.ts:365](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L365)
-
-___
-
-### nft721
-
-• **nft721** = ``"transferNft721Condition"``
-
-#### Defined in
-
-[types/index.ts:366](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L366)
diff --git a/docs/react-components/catalog/API/interfaces/AccountModule.md b/docs/react-components/catalog/API/interfaces/AccountModule.md
deleted file mode 100644
index e76ee33093..0000000000
--- a/docs/react-components/catalog/API/interfaces/AccountModule.md
+++ /dev/null
@@ -1,467 +0,0 @@
-# Interface: AccountModule
-
-AccountModule is exposed by the main context
-under 'account' object
-
-## Table of contents
-
-### Properties
-
-- [generateToken](AccountModule.md#generatetoken)
-- [getAssociatedDatasets](AccountModule.md#getassociateddatasets)
-- [getAssociatedServices](AccountModule.md#getassociatedservices)
-- [getCollection](AccountModule.md#getcollection)
-- [getPublishedSubscriptions](AccountModule.md#getpublishedsubscriptions)
-- [getPublishedSubscriptionsAndDatasets](AccountModule.md#getpublishedsubscriptionsanddatasets)
-- [getPublishedSubscriptionsAndServices](AccountModule.md#getpublishedsubscriptionsandservices)
-- [getPurchasedSubscriptions](AccountModule.md#getpurchasedsubscriptions)
-- [getPurchasedSubscriptionsAndDatasets](AccountModule.md#getpurchasedsubscriptionsanddatasets)
-- [getPurchasedSubscriptionsAndServices](AccountModule.md#getpurchasedsubscriptionsandservices)
-- [getReleases](AccountModule.md#getreleases)
-- [isAssetHolder](AccountModule.md#isassetholder)
-- [isNFT1155Holder](AccountModule.md#isnft1155holder)
-- [isNFT721Holder](AccountModule.md#isnft721holder)
-- [isTokenValid](AccountModule.md#istokenvalid)
-
-## Properties
-
-### generateToken
-
-• **generateToken**: (`__namedParameters`: { `address`: `string` ; `chainId`: `number` ; `message?`: `string` }) => `Promise`<`string`\>
-
-#### Type declaration
-
-▸ (`«destructured»`): `Promise`<`string`\>
-
-Generate a token for authentication in the Marketplace API
-
-##### Parameters
-
-| Name | Type |
-| :------ | :------ |
-| `«destructured»` | `Object` |
-| › `address` | `string` |
-| › `chainId` | `number` |
-| › `message?` | `string` |
-
-##### Returns
-
-`Promise`<`string`\>
-
-The new generated token
-
-#### Defined in
-
-[types/index.ts:515](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L515)
-
-___
-
-### getAssociatedDatasets
-
-• **getAssociatedDatasets**: (`did`: `string`, `searchOptions?`: [`SearchOptions`](SearchOptions.md)) => `Promise`<`QueryResult`\>
-
-#### Type declaration
-
-▸ (`did`, `searchOptions?`): `Promise`<`QueryResult`\>
-
-Get all the datasets associated to a subscription
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | - |
-| `searchOptions?` | [`SearchOptions`](SearchOptions.md) | options for customize result |
-
-##### Returns
-
-`Promise`<`QueryResult`\>
-
-associated datasets to subscriptions
-
-#### Defined in
-
-[types/index.ts:446](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L446)
-
-___
-
-### getAssociatedServices
-
-• **getAssociatedServices**: (`did`: `string`, `searchOptions?`: [`SearchOptions`](SearchOptions.md)) => `Promise`<`QueryResult`\>
-
-#### Type declaration
-
-▸ (`did`, `searchOptions?`): `Promise`<`QueryResult`\>
-
-Get all the services associated a subscription
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | - |
-| `searchOptions?` | [`SearchOptions`](SearchOptions.md) | options for customize result |
-
-##### Returns
-
-`Promise`<`QueryResult`\>
-
-associated services to subscriptions
-
-#### Defined in
-
-[types/index.ts:439](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L439)
-
-___
-
-### getCollection
-
-• **getCollection**: (`address`: `string`) => `Promise`<`string`[]\>
-
-#### Type declaration
-
-▸ (`address`): `Promise`<`string`[]\>
-
-Get the assets bought by the address given
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `address` | `string` | The address which bought the assets returned |
-
-##### Returns
-
-`Promise`<`string`[]\>
-
-List of assets which was bought by the address given as argument
-
-#### Defined in
-
-[types/index.ts:422](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L422)
-
-___
-
-### getPublishedSubscriptions
-
-• **getPublishedSubscriptions**: (`account`: `Account`, `searchOptions?`: [`SearchOptions`](SearchOptions.md)) => `Promise`<`QueryResult`\>
-
-#### Type declaration
-
-▸ (`account`, `searchOptions?`): `Promise`<`QueryResult`\>
-
-Get only published Subscriptions
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `account` | `Account` | - |
-| `searchOptions?` | [`SearchOptions`](SearchOptions.md) | options for customize result |
-
-##### Returns
-
-`Promise`<`QueryResult`\>
-
-published subscriptions
-
-#### Defined in
-
-[types/index.ts:429](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L429)
-
-___
-
-### getPublishedSubscriptionsAndDatasets
-
-• **getPublishedSubscriptionsAndDatasets**: (`account`: `Account`, `searchOptionsSubscriptions?`: [`SearchOptions`](SearchOptions.md), `searchOptionsDatasets?`: [`SearchOptions`](SearchOptions.md)) => `Promise`<[`SubscriptionsAndDatasetsDDOs`](SubscriptionsAndDatasetsDDOs.md)[]\>
-
-#### Type declaration
-
-▸ (`account`, `searchOptionsSubscriptions?`, `searchOptionsDatasets?`): `Promise`<[`SubscriptionsAndDatasetsDDOs`](SubscriptionsAndDatasetsDDOs.md)[]\>
-
-Get all the published subscriptions and datasets associated from the wallet address passed
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `account` | `Account` | Account of the user |
-| `searchOptionsSubscriptions?` | [`SearchOptions`](SearchOptions.md) | options for customize result of Subscriptions |
-| `searchOptionsDatasets?` | [`SearchOptions`](SearchOptions.md) | options for customize result of Datasets |
-
-##### Returns
-
-`Promise`<[`SubscriptionsAndDatasetsDDOs`](SubscriptionsAndDatasetsDDOs.md)[]\>
-
-published subscriptions and its datasets
-
-#### Defined in
-
-[types/index.ts:466](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L466)
-
-___
-
-### getPublishedSubscriptionsAndServices
-
-• **getPublishedSubscriptionsAndServices**: (`account`: `Account`, `searchOptionsSubscriptions?`: [`SearchOptions`](SearchOptions.md), `searchOptionsServices?`: [`SearchOptions`](SearchOptions.md)) => `Promise`<[`SubscriptionsAndServicesDDOs`](SubscriptionsAndServicesDDOs.md)[]\>
-
-#### Type declaration
-
-▸ (`account`, `searchOptionsSubscriptions?`, `searchOptionsServices?`): `Promise`<[`SubscriptionsAndServicesDDOs`](SubscriptionsAndServicesDDOs.md)[]\>
-
-Get all the published subscriptions and services associated from the wallet address passed
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `account` | `Account` | Account of the user |
-| `searchOptionsSubscriptions?` | [`SearchOptions`](SearchOptions.md) | options for customize result of Subscriptions |
-| `searchOptionsServices?` | [`SearchOptions`](SearchOptions.md) | options for customize result of Service |
-
-##### Returns
-
-`Promise`<[`SubscriptionsAndServicesDDOs`](SubscriptionsAndServicesDDOs.md)[]\>
-
-published subscriptions and service
-
-#### Defined in
-
-[types/index.ts:454](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L454)
-
-___
-
-### getPurchasedSubscriptions
-
-• **getPurchasedSubscriptions**: (`account`: `Account`, `searchOptions?`: [`SearchOptions`](SearchOptions.md)) => `Promise`<`QueryResult`\>
-
-#### Type declaration
-
-▸ (`account`, `searchOptions?`): `Promise`<`QueryResult`\>
-
-Get only purchased Subscriptions
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `account` | `Account` | Account of the user |
-| `searchOptions?` | [`SearchOptions`](SearchOptions.md) | options for customize result |
-
-##### Returns
-
-`Promise`<`QueryResult`\>
-
-purchased subscriptions
-
-#### Defined in
-
-[types/index.ts:478](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L478)
-
-___
-
-### getPurchasedSubscriptionsAndDatasets
-
-• **getPurchasedSubscriptionsAndDatasets**: (`account`: `Account`, `searchOptionsSubscriptions?`: [`SearchOptions`](SearchOptions.md), `searchOptionsDatasets?`: [`SearchOptions`](SearchOptions.md)) => `Promise`<[`SubscriptionsAndDatasetsDDOs`](SubscriptionsAndDatasetsDDOs.md)[]\>
-
-#### Type declaration
-
-▸ (`account`, `searchOptionsSubscriptions?`, `searchOptionsDatasets?`): `Promise`<[`SubscriptionsAndDatasetsDDOs`](SubscriptionsAndDatasetsDDOs.md)[]\>
-
-Get all the purchased subscriptions and datasets associated from the wallet address passed
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `account` | `Account` | Account of the user |
-| `searchOptionsSubscriptions?` | [`SearchOptions`](SearchOptions.md) | options for customize result of Subscriptions |
-| `searchOptionsDatasets?` | [`SearchOptions`](SearchOptions.md) | options for customize result of Datasets |
-
-##### Returns
-
-`Promise`<[`SubscriptionsAndDatasetsDDOs`](SubscriptionsAndDatasetsDDOs.md)[]\>
-
-purchased subscriptions and its datasets
-
-#### Defined in
-
-[types/index.ts:501](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L501)
-
-___
-
-### getPurchasedSubscriptionsAndServices
-
-• **getPurchasedSubscriptionsAndServices**: (`account`: `Account`, `searchOptionsSubscriptions?`: [`SearchOptions`](SearchOptions.md), `searchOptionsServices?`: [`SearchOptions`](SearchOptions.md)) => `Promise`<[`SubscriptionsAndServicesDDOs`](SubscriptionsAndServicesDDOs.md)[]\>
-
-#### Type declaration
-
-▸ (`account`, `searchOptionsSubscriptions?`, `searchOptionsServices?`): `Promise`<[`SubscriptionsAndServicesDDOs`](SubscriptionsAndServicesDDOs.md)[]\>
-
-Get all the purchased subscriptions and services associated from the wallet address passed
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `account` | `Account` | Account of the user |
-| `searchOptionsSubscriptions?` | [`SearchOptions`](SearchOptions.md) | options for customize result of Subscriptions |
-| `searchOptionsServices?` | [`SearchOptions`](SearchOptions.md) | options for customize result of Service |
-
-##### Returns
-
-`Promise`<[`SubscriptionsAndServicesDDOs`](SubscriptionsAndServicesDDOs.md)[]\>
-
-purchased subscriptions and services
-
-#### Defined in
-
-[types/index.ts:489](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L489)
-
-___
-
-### getReleases
-
-• **getReleases**: (`address`: `string`) => `Promise`<`string`[]\>
-
-#### Type declaration
-
-▸ (`address`): `Promise`<`string`[]\>
-
-Get all the assets published from the address passed by argument
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `address` | `string` | The address owner of the assets that we want to get |
-
-##### Returns
-
-`Promise`<`string`[]\>
-
-List of assets which was published by the address given
-
-#### Defined in
-
-[types/index.ts:416](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L416)
-
-___
-
-### isAssetHolder
-
-• **isAssetHolder**: (`did`: `string`, `walletAddress`: `string`) => `Promise`<`boolean`\>
-
-#### Type declaration
-
-▸ (`did`, `walletAddress`): `Promise`<`boolean`\>
-
-This method validates if an user is an asset holder.
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | The unique identifier of the asset |
-| `walletAddress` | `string` | The public address of the user |
-
-##### Returns
-
-`Promise`<`boolean`\>
-
-true if the user owns at least one edition of the NFT
-
-#### Defined in
-
-[types/index.ts:538](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L538)
-
-___
-
-### isNFT1155Holder
-
-• **isNFT1155Holder**: (`did`: `string`, `walletAddress`: `string`) => `Promise`<`boolean`\>
-
-#### Type declaration
-
-▸ (`did`, `walletAddress`): `Promise`<`boolean`\>
-
-This method validates if a user is a NFT (ERC-1155 based) holder for a specific `tokenId`.
-For ERC-1155 tokens, we use the DID as tokenId. A user can between zero an multiple editions
-of a NFT (limitted by the NFT cap).
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | The unique identifier of the NFT within a NFT ERC-1155 contract |
-| `walletAddress` | `string` | The public address of the user |
-
-##### Returns
-
-`Promise`<`boolean`\>
-
-true if the user owns at least one edition of the NFT
-
-#### Defined in
-
-[types/index.ts:548](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L548)
-
-___
-
-### isNFT721Holder
-
-• **isNFT721Holder**: (`nftAddress`: `string`, `walletAddress`: `string`) => `Promise`<`boolean`\>
-
-#### Type declaration
-
-▸ (`nftAddress`, `walletAddress`): `Promise`<`boolean`\>
-
-This method validates if a user is a NFT (ERC-721 based) holder for a specific NFT contract address.
-For ERC-721 tokens, we use the DID as tokenId. A user can between zero an multiple editions
-of a NFT (limitted by the NFT cap).
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `nftAddress` | `string` | The contract address of the ERC-721 NFT contract |
-| `walletAddress` | `string` | The public address of the user |
-
-##### Returns
-
-`Promise`<`boolean`\>
-
-true if the user holds the NFT
-
-#### Defined in
-
-[types/index.ts:558](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L558)
-
-___
-
-### isTokenValid
-
-• **isTokenValid**: (`address`: `string`, `chainId`: `number`) => `boolean`
-
-#### Type declaration
-
-▸ (`address`, `chainId`): `boolean`
-
-check if the token for Marketplace API is valid
-
-##### Parameters
-
-| Name | Type |
-| :------ | :------ |
-| `address` | `string` |
-| `chainId` | `number` |
-
-##### Returns
-
-`boolean`
-
-if token is valid it will return true
-
-#### Defined in
-
-[types/index.ts:530](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L530)
diff --git a/docs/react-components/catalog/API/interfaces/AssetFile.md b/docs/react-components/catalog/API/interfaces/AssetFile.md
deleted file mode 100644
index 5e2471ae62..0000000000
--- a/docs/react-components/catalog/API/interfaces/AssetFile.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Interface: AssetFile
-
-The asset file detail
-
-## Indexable
-
-▪ [key: `string`]: `any`
-
-## Table of contents
-
-### Properties
-
-- [label](AssetFile.md#label)
-- [type](AssetFile.md#type)
-
-## Properties
-
-### label
-
-• **label**: `string`
-
-File title
-
-#### Defined in
-
-[types/index.ts:791](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L791)
-
-___
-
-### type
-
-• **type**: `string`
-
-File type: json, txt, etc...
-
-#### Defined in
-
-[types/index.ts:789](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L789)
diff --git a/docs/react-components/catalog/API/interfaces/AssetPublishParams.md b/docs/react-components/catalog/API/interfaces/AssetPublishParams.md
deleted file mode 100644
index f01d085dfd..0000000000
--- a/docs/react-components/catalog/API/interfaces/AssetPublishParams.md
+++ /dev/null
@@ -1,103 +0,0 @@
-# Interface: AssetPublishParams
-
-Asset parameters needed to publish
-
-## Indexable
-
-▪ [key: `string`]: `any`
-
-## Table of contents
-
-### Properties
-
-- [assetFiles](AssetPublishParams.md#assetfiles)
-- [author](AssetPublishParams.md#author)
-- [category](AssetPublishParams.md#category)
-- [description](AssetPublishParams.md#description)
-- [name](AssetPublishParams.md#name)
-- [price](AssetPublishParams.md#price)
-- [type](AssetPublishParams.md#type)
-
-## Properties
-
-### assetFiles
-
-• **assetFiles**: `MetaDataExternalResource`[]
-
-Files to download after buy the asset
-
-#### Defined in
-
-[types/index.ts:811](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L811)
-
-___
-
-### author
-
-• **author**: `string`
-
-Who create the asset
-
-#### Defined in
-
-[types/index.ts:801](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L801)
-
-___
-
-### category
-
-• **category**: `string`
-
-The category that belong the asset
-
-#### Defined in
-
-[types/index.ts:807](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L807)
-
-___
-
-### description
-
-• **description**: `string`
-
-Description about what is the utility of the asset
-
-#### Defined in
-
-[types/index.ts:803](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L803)
-
-___
-
-### name
-
-• **name**: `string`
-
-Name of the asset
-
-#### Defined in
-
-[types/index.ts:799](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L799)
-
-___
-
-### price
-
-• **price**: `string`
-
-Price of the asset
-
-#### Defined in
-
-[types/index.ts:809](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L809)
-
-___
-
-### type
-
-• **type**: `string`
-
-The type of the asset
-
-#### Defined in
-
-[types/index.ts:805](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L805)
diff --git a/docs/react-components/catalog/API/interfaces/AssetPublishProviderState.md b/docs/react-components/catalog/API/interfaces/AssetPublishProviderState.md
deleted file mode 100644
index 87849640a7..0000000000
--- a/docs/react-components/catalog/API/interfaces/AssetPublishProviderState.md
+++ /dev/null
@@ -1,294 +0,0 @@
-# Interface: AssetPublishProviderState
-
-Provider with all the functionalities to publish assets (no-nft, nft721, nft1155)
-
-## Table of contents
-
-### Properties
-
-- [assetMessage](AssetPublishProviderState.md#assetmessage)
-- [assetPublish](AssetPublishProviderState.md#assetpublish)
-- [errorAssetMessage](AssetPublishProviderState.md#errorassetmessage)
-- [handleChange](AssetPublishProviderState.md#handlechange)
-- [isProcessing](AssetPublishProviderState.md#isprocessing)
-- [isPublished](AssetPublishProviderState.md#ispublished)
-- [publishAsset](AssetPublishProviderState.md#publishasset)
-- [publishNFT1155](AssetPublishProviderState.md#publishnft1155)
-- [publishNFT721](AssetPublishProviderState.md#publishnft721)
-- [reset](AssetPublishProviderState.md#reset)
-- [setAssetMessage](AssetPublishProviderState.md#setassetmessage)
-- [setAssetPublish](AssetPublishProviderState.md#setassetpublish)
-- [setErrorAssetMessage](AssetPublishProviderState.md#seterrorassetmessage)
-
-## Properties
-
-### assetMessage
-
-• **assetMessage**: `string`
-
-Handle publish asset message
-
-#### Defined in
-
-[types/index.ts:905](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L905)
-
-___
-
-### assetPublish
-
-• **assetPublish**: [`AssetPublishParams`](AssetPublishParams.md)
-
-All the parameters needed to publish an asset
-
-#### Defined in
-
-[types/index.ts:911](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L911)
-
-___
-
-### errorAssetMessage
-
-• **errorAssetMessage**: `string`
-
-Handle error publish asset message
-
-#### Defined in
-
-[types/index.ts:903](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L903)
-
-___
-
-### handleChange
-
-• **handleChange**: (`value`: `string`, `input`: `string`) => `void`
-
-#### Type declaration
-
-▸ (`value`, `input`): `void`
-
-Update asset parameters when some input changes
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `value` | `string` | Parameter value |
-| `input` | `string` | Input where come the changes which match with the parameters |
-
-##### Returns
-
-`void`
-
-#### Defined in
-
-[types/index.ts:922](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L922)
-
-___
-
-### isProcessing
-
-• **isProcessing**: `boolean`
-
-If the asset is publishing
-
-#### Defined in
-
-[types/index.ts:909](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L909)
-
-___
-
-### isPublished
-
-• **isPublished**: `boolean`
-
-If the asset was published correctly
-
-#### Defined in
-
-[types/index.ts:907](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L907)
-
-___
-
-### publishAsset
-
-• **publishAsset**: (`asset`: { `assetAttributes`: `AssetAttributes` ; `chainId`: `number` ; `cryptoConfig?`: `CryptoConfig` ; `method?`: `EncryptionMethod` ; `onEvent?`: (`next`: `CreateProgressStep`) => `void` ; `password?`: `string` ; `publishMetadata?`: `PublishMetadata` ; `publisher`: `Account` ; `txParameters?`: `TxParameters` }) => `Promise`<`undefined` \| `DDO`\>
-
-#### Type declaration
-
-▸ (`asset`): `Promise`<`undefined` \| `DDO`\>
-
-Nevermined is a network where users register digital assets and attach to
-them services (like data sharing, nfts minting, etc).
-With this method a user can register an asset in Nevermined giving a piece of metadata.
-This will return the DDO created (including the unique identifier of the asset - aka DID).
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `asset` | `Object` | |
-| `asset.assetAttributes` | `AssetAttributes` | The attribute object discribing the asset (metadata, price, encryption method, etc...) |
-| `asset.chainId` | `number` | Network Id |
-| `asset.cryptoConfig?` | `CryptoConfig` | Setting for encrypting asset |
-| `asset.method?` | `EncryptionMethod` | - |
-| `asset.onEvent?` | (`next`: `CreateProgressStep`) => `void` | A callback to handle progress events |
-| `asset.password?` | `string` | Password to encrypt metadata |
-| `asset.publishMetadata?` | `PublishMetadata` | Allows to specify if the metadata should be stored in different backends |
-| `asset.publisher` | `Account` | Account of the publisher |
-| `asset.txParameters?` | `TxParameters` | - |
-
-##### Returns
-
-`Promise`<`undefined` \| `DDO`\>
-
-The DDO object including the asset metadata and the DID
-
-#### Defined in
-
-[types/index.ts:944](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L944)
-
-___
-
-### publishNFT1155
-
-• **publishNFT1155**: (`nft1155`: { `chainId`: `number` ; `cryptoConfig?`: `CryptoConfig` ; `method?`: `EncryptionMethod` ; `nftAttributes`: `NFTAttributes` ; `onEvent?`: (`next`: `CreateProgressStep`) => `void` ; `password?`: `string` ; `publishMetadata?`: `PublishMetadata` ; `publisher`: `Account` ; `txParameters?`: `TxParameters` }) => `Promise`<`undefined` \| `DDO`\>
-
-#### Type declaration
-
-▸ (`nft1155`): `Promise`<`undefined` \| `DDO`\>
-
-In Nevermined is possible to register a digital asset that allow users pay for having a
-NFT (ERC-1155). This typically allows content creators to provide access to exclusive
-contents for NFT holders.
-ERC-1155 NFTs are semi-fungible, meaning that a NFT can have multiple editions.
-
-This method will create a new digital asset associated to a ERC-1155 NFT contract.
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `nft1155` | `Object` | |
-| `nft1155.chainId` | `number` | Network Id |
-| `nft1155.cryptoConfig?` | `CryptoConfig` | Setting for encrypting asset |
-| `nft1155.method?` | `EncryptionMethod` | - |
-| `nft1155.nftAttributes` | `NFTAttributes` | The attribute object discribing the asset (metadata, price, encryption method, etc...) |
-| `nft1155.onEvent?` | (`next`: `CreateProgressStep`) => `void` | A callback to handle progress events |
-| `nft1155.password?` | `string` | Password to encrypt metadata |
-| `nft1155.publishMetadata?` | `PublishMetadata` | Allows to specify if the metadata should be stored in different backends |
-| `nft1155.publisher` | `Account` | Account of the publisher |
-| `nft1155.txParameters?` | `TxParameters` | - |
-
-##### Returns
-
-`Promise`<`undefined` \| `DDO`\>
-
-The DDO object including the asset metadata and the DID
-
-#### Defined in
-
-[types/index.ts:1024](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L1024)
-
-___
-
-### publishNFT721
-
-• **publishNFT721**: (`nft721`: { `chainId`: `number` ; `cryptoConfig?`: `CryptoConfig` ; `method?`: `EncryptionMethod` ; `nftAddress`: `string` ; `nftAttributes`: `NFTAttributes` ; `onEvent?`: (`next`: `CreateProgressStep`) => `void` ; `password?`: `string` ; `publishMetadata?`: `PublishMetadata` ; `publisher`: `Account` ; `txParameters?`: `TxParameters` }) => `Promise`<`undefined` \| `DDO`\>
-
-#### Type declaration
-
-▸ (`nft721`): `Promise`<`undefined` \| `DDO`\>
-
-In Nevermined is possible to register a digital asset that allow users pay for having a
-NFT (ERC-721). This typically allows content creators to provide access to exclusive
-contents for NFT holders.
-It will create a new digital asset associated to a ERC-721 NFT contract
-(given the `nftAddress` parameter)
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `nft721` | `Object` | |
-| `nft721.chainId` | `number` | Network Id |
-| `nft721.cryptoConfig?` | `CryptoConfig` | Setting for encrypting asset |
-| `nft721.method?` | `EncryptionMethod` | - |
-| `nft721.nftAddress` | `string` | NFT721 contract address to load |
-| `nft721.nftAttributes` | `NFTAttributes` | The attribute object discribing the asset (metadata, price, encryption method, etc...) |
-| `nft721.onEvent?` | (`next`: `CreateProgressStep`) => `void` | A callback to handle progress events |
-| `nft721.password?` | `string` | Password to encrypt metadata |
-| `nft721.publishMetadata?` | `PublishMetadata` | Allows to specify if the metadata should be stored in different backends |
-| `nft721.publisher` | `Account` | Account of the publisher |
-| `nft721.txParameters?` | `TxParameters` | - |
-
-##### Returns
-
-`Promise`<`undefined` \| `DDO`\>
-
-The DDO object including the asset metadata and the DID
-
-#### Defined in
-
-[types/index.ts:983](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L983)
-
-___
-
-### reset
-
-• **reset**: (`resetAssetPublish`: [`AssetPublishParams`](AssetPublishParams.md)) => `void`
-
-#### Type declaration
-
-▸ (`resetAssetPublish`): `void`
-
-Reset all the parameters of the asset
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `resetAssetPublish` | [`AssetPublishParams`](AssetPublishParams.md) | Initial parameters used for reset |
-
-##### Returns
-
-`void`
-
-#### Defined in
-
-[types/index.ts:926](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L926)
-
-___
-
-### setAssetMessage
-
-• **setAssetMessage**: `Dispatch`<`SetStateAction`<`string`\>\>
-
-Set asset message
-
-#### Defined in
-
-[types/index.ts:915](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L915)
-
-___
-
-### setAssetPublish
-
-• **setAssetPublish**: `Dispatch`<`SetStateAction`<[`AssetPublishParams`](AssetPublishParams.md)\>\>
-
-Set parameters needed to publish an asset
-
-#### Defined in
-
-[types/index.ts:913](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L913)
-
-___
-
-### setErrorAssetMessage
-
-• **setErrorAssetMessage**: `Dispatch`<`SetStateAction`<`string`\>\>
-
-Set error asset message
-
-#### Defined in
-
-[types/index.ts:917](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L917)
diff --git a/docs/react-components/catalog/API/interfaces/AssetState.md b/docs/react-components/catalog/API/interfaces/AssetState.md
deleted file mode 100644
index b45346e1e7..0000000000
--- a/docs/react-components/catalog/API/interfaces/AssetState.md
+++ /dev/null
@@ -1,73 +0,0 @@
-# Interface: AssetState
-
-Response from "useAsset"
-
-## Table of contents
-
-### Properties
-
-- [ddo](AssetState.md#ddo)
-- [error](AssetState.md#error)
-- [isLoading](AssetState.md#isloading)
-- [metadata](AssetState.md#metadata)
-- [nftDetails](AssetState.md#nftdetails)
-
-## Properties
-
-### ddo
-
-• **ddo**: `DDO`
-
-Asset object
-
-#### Defined in
-
-[types/index.ts:773](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L773)
-
-___
-
-### error
-
-• **error**: `string`
-
-Error message from some operation with asset
-
-#### Defined in
-
-[types/index.ts:777](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L777)
-
-___
-
-### isLoading
-
-• **isLoading**: `boolean`
-
-True if asset object is loaded
-
-#### Defined in
-
-[types/index.ts:779](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L779)
-
-___
-
-### metadata
-
-• **metadata**: `MetaData`
-
-Metada of the asset with the basic information
-
-#### Defined in
-
-[types/index.ts:775](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L775)
-
-___
-
-### nftDetails
-
-• **nftDetails**: [`NFTDetails`](NFTDetails.md)
-
-Details of the asset agreement
-
-#### Defined in
-
-[types/index.ts:781](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L781)
diff --git a/docs/react-components/catalog/API/interfaces/AssetsModule.md b/docs/react-components/catalog/API/interfaces/AssetsModule.md
deleted file mode 100644
index 1e41938b50..0000000000
--- a/docs/react-components/catalog/API/interfaces/AssetsModule.md
+++ /dev/null
@@ -1,352 +0,0 @@
-# Interface: AssetsModule
-
-AssetsModule is exposed by the main context
-under 'assets' object
-
-## Table of contents
-
-### Properties
-
-- [downloadAsset](AssetsModule.md#downloadasset)
-- [downloadNFT](AssetsModule.md#downloadnft)
-- [findOne](AssetsModule.md#findone)
-- [getCustomErc20Token](AssetsModule.md#getcustomerc20token)
-- [nftDetails](AssetsModule.md#nftdetails)
-- [orderAsset](AssetsModule.md#orderasset)
-- [orderNFT1155](AssetsModule.md#ordernft1155)
-- [orderNFT721](AssetsModule.md#ordernft721)
-- [query](AssetsModule.md#query)
-- [transfer](AssetsModule.md#transfer)
-- [uploadAssetToFilecoin](AssetsModule.md#uploadassettofilecoin)
-
-## Properties
-
-### downloadAsset
-
-• **downloadAsset**: (`asset`: { `consumer`: `Account` ; `did`: `string` ; `fileIndex?`: `number` ; `password?`: `string` ; `path?`: `string` }) => `Promise`<`boolean`\>
-
-#### Type declaration
-
-▸ (`asset`): `Promise`<`boolean`\>
-
-Download an asset already ordered and transfered to the buyer,
-if the user is the owner of the asset
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `asset` | `Object` | |
-| `asset.consumer` | `Account` | Account of the consumer |
-| `asset.did` | `string` | id of the NFT (721 & 1155) asset |
-| `asset.fileIndex?` | `number` | The file to download. If not given or is -1 it will download all of them |
-| `asset.password?` | `string` | Password to download a encrypted NFT |
-| `asset.path?` | `string` | Destination of downloaded file |
-
-##### Returns
-
-`Promise`<`boolean`\>
-
-if the NFT is downloaded successfully the method will return a true
-
-#### Defined in
-
-[types/index.ts:678](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L678)
-
-___
-
-### downloadNFT
-
-• **downloadNFT**: (`nft`: { `consumer`: `Account` ; `did`: `string` ; `ercType?`: `ERCType` ; `fileIndex?`: `number` ; `password?`: `string` ; `path?`: `string` }) => `Promise`<`string` \| `boolean`\>
-
-#### Type declaration
-
-▸ (`nft`): `Promise`<`string` \| `boolean`\>
-
-Download a NFT asset already ordered and transfered to the buyer,
-if the user is the owner of the asset
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `nft` | `Object` | |
-| `nft.consumer` | `Account` | Account of the consumer |
-| `nft.did` | `string` | id of the NFT (721 & 1155) asset |
-| `nft.ercType?` | `ERCType` | NFT type. By default 1155 |
-| `nft.fileIndex?` | `number` | The file to download. If not given or is -1 it will download all of them |
-| `nft.password?` | `string` | Password to download a encrypted NFT |
-| `nft.path?` | `string` | Destination of downloaded file |
-
-##### Returns
-
-`Promise`<`string` \| `boolean`\>
-
-if the NFT is downloaded successfully the method will return a true
-
-#### Defined in
-
-[types/index.ts:642](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L642)
-
-___
-
-### findOne
-
-• **findOne**: (`did`: `string`) => `Promise`<`DDO`\>
-
-#### Type declaration
-
-▸ (`did`): `Promise`<`DDO`\>
-
-Get the asset object by the did given
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | id of the asset |
-
-##### Returns
-
-`Promise`<`DDO`\>
-
-#### Defined in
-
-[types/index.ts:570](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L570)
-
-___
-
-### getCustomErc20Token
-
-• **getCustomErc20Token**: (`customErc20TokenAddress`: `string`, `address`: `string`) => `Promise`<[`CustomErc20Token`](CustomErc20Token.md)\>
-
-#### Type declaration
-
-▸ (`customErc20TokenAddress`, `address`): `Promise`<[`CustomErc20Token`](CustomErc20Token.md)\>
-
-Get all the details about a custom erc20 token
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `customErc20TokenAddress` | `string` | The custom token address |
-| `address` | `string` | Wallet address of the user |
-
-##### Returns
-
-`Promise`<[`CustomErc20Token`](CustomErc20Token.md)\>
-
-Custom token details
-
-#### Defined in
-
-[types/index.ts:663](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L663)
-
-___
-
-### nftDetails
-
-• **nftDetails**: (`did`: `string`, `ercType`: `ERCType`) => `Promise`<[`NFTDetails`](NFTDetails.md)\>
-
-#### Type declaration
-
-▸ (`did`, `ercType`): `Promise`<[`NFTDetails`](NFTDetails.md)\>
-
-Get the aggreement details of the NFT asset (owner, nfts supplay, royalties, etc...)
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | id of the NFT (721 & 1155) asset |
-| `ercType` | `ERCType` | NFT asset type which can be 721 or 1155 |
-
-##### Returns
-
-`Promise`<[`NFTDetails`](NFTDetails.md)\>
-
-Agreement details of the NFT asset
-
-#### Defined in
-
-[types/index.ts:603](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L603)
-
-___
-
-### orderAsset
-
-• **orderAsset**: (`did`: `string`, `consumer`: `Account`) => `Promise`<`string`\>
-
-#### Type declaration
-
-▸ (`did`, `consumer`): `Promise`<`string`\>
-
-This method order a asset to allow after transfer to the buyer (the method only order but not transfer)
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | id of the asset |
-| `consumer` | `Account` | Account of the consumer |
-
-##### Returns
-
-`Promise`<`string`\>
-
-In case the order is completed successfully it returns the agreementId
-which is needed to transfer the asset to the buyer
-
-#### Defined in
-
-[types/index.ts:611](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L611)
-
-___
-
-### orderNFT1155
-
-• **orderNFT1155**: (`did`: `string`, `amount`: `BigNumber`, `consumer`: `Account`) => `Promise`<`string`\>
-
-#### Type declaration
-
-▸ (`did`, `amount`, `consumer`): `Promise`<`string`\>
-
-This method order a NFT1155 asset to allow after transfer to the buyer (the method only order but not transfer)
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | id of the NFT1155 asset |
-| `amount` | `BigNumber` | Amount of NFT1155 assets to order |
-| `consumer` | `Account` | Account of the consumer |
-
-##### Returns
-
-`Promise`<`string`\>
-
-In case the order is completed successfully it returns the agreementId
-which is needed to transfer the NFT1155 asset to the buyer
-
-#### Defined in
-
-[types/index.ts:629](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L629)
-
-___
-
-### orderNFT721
-
-• **orderNFT721**: (`did`: `string`, `consumer`: `Account`, `nftTokenAddress`: `string`) => `Promise`<`string`\>
-
-#### Type declaration
-
-▸ (`did`, `consumer`, `nftTokenAddress`): `Promise`<`string`\>
-
-This method order a NFT721 asset to allow after transfer to the buyer (the method only order but not transfer)
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `did` | `string` | id of the NFT721 asset |
-| `consumer` | `Account` | - |
-| `nftTokenAddress` | `string` | - |
-
-##### Returns
-
-`Promise`<`string`\>
-
-In case the order is completed successfully it returns the agreementId
-which is needed to transfer the NFT721 asset to the buyer
-
-#### Defined in
-
-[types/index.ts:620](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L620)
-
-___
-
-### query
-
-• **query**: (`q`: `SearchQuery`) => `Promise`<`QueryResult`\>
-
-#### Type declaration
-
-▸ (`q`): `Promise`<`QueryResult`\>
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `q` | `SearchQuery` | Query to custom the search: order result, filtering, etc... |
-
-##### Returns
-
-`Promise`<`QueryResult`\>
-
-List of assets according with the query given
-
-#### Defined in
-
-[types/index.ts:576](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L576)
-
-___
-
-### transfer
-
-• **transfer**: (`assetInfo`: { `amount`: `number` ; `did`: `string` ; `ercType`: `ERCType` ; `newOwner`: `Account` }) => `Promise`<`boolean`\>
-
-#### Type declaration
-
-▸ (`assetInfo`): `Promise`<`boolean`\>
-
-Transfer the ownership of the asset to other account
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `assetInfo` | `Object` | |
-| `assetInfo.amount` | `number` | The amount of asset to transfer |
-| `assetInfo.did` | `string` | The id of the asset |
-| `assetInfo.ercType` | `ERCType` | NFT asset type which can be 721 or 1155 |
-| `assetInfo.newOwner` | `Account` | Account of the owner |
-
-##### Returns
-
-`Promise`<`boolean`\>
-
-Return true if asset was transferred successfully
-
-#### Defined in
-
-[types/index.ts:586](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L586)
-
-___
-
-### uploadAssetToFilecoin
-
-• **uploadAssetToFilecoin**: (`File`: `File`, `filecoinUrl`: `string`) => `Promise`<`string`\>
-
-#### Type declaration
-
-▸ (`File`, `filecoinUrl`): `Promise`<`string`\>
-
-Upload files to Filecoin
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `File` | `File` | - |
-| `filecoinUrl` | `string` | The url of the Filecoin server |
-
-##### Returns
-
-`Promise`<`string`\>
-
-The url where is located the file already uploaded
-
-#### Defined in
-
-[types/index.ts:697](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L697)
diff --git a/docs/react-components/catalog/API/interfaces/Credentials.md b/docs/react-components/catalog/API/interfaces/Credentials.md
deleted file mode 100644
index c61f38c8fe..0000000000
--- a/docs/react-components/catalog/API/interfaces/Credentials.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Interface: Credentials
-
-## Table of contents
-
-### Properties
-
-- [babySig](Credentials.md#babysig)
-- [buyer](Credentials.md#buyer)
-
-## Properties
-
-### babySig
-
-• **babySig**: `Babysig`
-
-#### Defined in
-
-[types/index.ts:1048](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L1048)
-
-___
-
-### buyer
-
-• **buyer**: `string`
-
-#### Defined in
-
-[types/index.ts:1047](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L1047)
diff --git a/docs/react-components/catalog/API/interfaces/CustomErc20Token.md b/docs/react-components/catalog/API/interfaces/CustomErc20Token.md
deleted file mode 100644
index a6fc366e4b..0000000000
--- a/docs/react-components/catalog/API/interfaces/CustomErc20Token.md
+++ /dev/null
@@ -1,66 +0,0 @@
-# Interface: CustomErc20Token
-
-Custom token detail
-
-## Table of contents
-
-### Properties
-
-- [balance](CustomErc20Token.md#balance)
-- [decimals](CustomErc20Token.md#decimals)
-- [name](CustomErc20Token.md#name)
-- [symbol](CustomErc20Token.md#symbol)
-
-## Properties
-
-### balance
-
-• **balance**: `BigNumber`
-
-Amount of tokens holded by the wallet account
-
-#### Defined in
-
-[types/index.ts:401](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L401)
-
-___
-
-### decimals
-
-• **decimals**: `number`
-
-Decimals of the token
-
-#### Defined in
-
-[types/index.ts:403](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L403)
-
-___
-
-### name
-
-• **name**: `string`
-
-Name of the token
-
-#### Defined in
-
-[types/index.ts:399](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L399)
-
-___
-
-### symbol
-
-• **symbol**: `string`
-
-The nick of the token
-
-**`Example`**
-
-```ts
-Ethereum -> ETH
-```
-
-#### Defined in
-
-[types/index.ts:397](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L397)
diff --git a/docs/react-components/catalog/API/interfaces/FileMetadata.md b/docs/react-components/catalog/API/interfaces/FileMetadata.md
deleted file mode 100644
index 7fca5a9bcc..0000000000
--- a/docs/react-components/catalog/API/interfaces/FileMetadata.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# Interface: FileMetadata
-
-Metadata of the file
-
-## Table of contents
-
-### Properties
-
-- [contentLength](FileMetadata.md#contentlength)
-- [contentType](FileMetadata.md#contenttype)
-- [index](FileMetadata.md#index)
-- [url](FileMetadata.md#url)
-
-## Properties
-
-### contentLength
-
-• **contentLength**: `string`
-
-The size of the content
-
-#### Defined in
-
-[types/index.ts:823](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L823)
-
-___
-
-### contentType
-
-• **contentType**: `string`
-
-Format of the contet file: Json, txt, etc...
-
-#### Defined in
-
-[types/index.ts:819](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L819)
-
-___
-
-### index
-
-• **index**: `number`
-
-Index given to the file once it was created
-
-#### Defined in
-
-[types/index.ts:817](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L817)
-
-___
-
-### url
-
-• **url**: `string`
-
-Url where is located the file
-
-#### Defined in
-
-[types/index.ts:821](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L821)
diff --git a/docs/react-components/catalog/API/interfaces/FulfilledOrders.md b/docs/react-components/catalog/API/interfaces/FulfilledOrders.md
deleted file mode 100644
index 7d692e7af2..0000000000
--- a/docs/react-components/catalog/API/interfaces/FulfilledOrders.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Interface: FulfilledOrders
-
-Events fulfilled
-
-## Table of contents
-
-### Properties
-
-- [\_documentId](FulfilledOrders.md#_documentid)
-
-## Properties
-
-### \_documentId
-
-• **\_documentId**: `string`
-
-Document id of the event
-
-#### Defined in
-
-[types/index.ts:831](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L831)
diff --git a/docs/react-components/catalog/API/interfaces/GenericOutput.md b/docs/react-components/catalog/API/interfaces/GenericOutput.md
deleted file mode 100644
index 1cf82ff285..0000000000
--- a/docs/react-components/catalog/API/interfaces/GenericOutput.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# Interface: GenericOutput
-
-Used as a result data schema of a resolved promise
-
-## Type parameters
-
-| Name |
-| :------ |
-| `T` |
-| `E` |
-
-## Table of contents
-
-### Properties
-
-- [data](GenericOutput.md#data)
-- [error](GenericOutput.md#error)
-- [success](GenericOutput.md#success)
-
-## Properties
-
-### data
-
-• **data**: `T`
-
-Data from the promise
-
-#### Defined in
-
-[types/index.ts:297](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L297)
-
-___
-
-### error
-
-• **error**: `E`
-
-If the promise throw an error
-
-#### Defined in
-
-[types/index.ts:299](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L299)
-
-___
-
-### success
-
-• **success**: `boolean`
-
-If the promise resolve was success
-
-#### Defined in
-
-[types/index.ts:301](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L301)
diff --git a/docs/react-components/catalog/API/interfaces/MarketplaceAPIToken.md b/docs/react-components/catalog/API/interfaces/MarketplaceAPIToken.md
deleted file mode 100644
index 9a072d8ef3..0000000000
--- a/docs/react-components/catalog/API/interfaces/MarketplaceAPIToken.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Interface: MarketplaceAPIToken
-
-Authorization needed to request to Marketplace Api
-
-## Table of contents
-
-### Properties
-
-- [token](MarketplaceAPIToken.md#token)
-
-## Properties
-
-### token
-
-• **token**: `string`
-
-Token generated by Marketplace Api after login
-
-#### Defined in
-
-[types/index.ts:785](https://github.com/nevermined-io/react-components/blob/9c24121/catalog/src/types/index.ts#L785)
diff --git a/docs/react-components/catalog/API/interfaces/NFTDetails.md b/docs/react-components/catalog/API/interfaces/NFTDetails.md
deleted file mode 100644
index 59567e786d..0000000000
--- a/docs/react-components/catalog/API/interfaces/NFTDetails.md
+++ /dev/null
@@ -1,177 +0,0 @@
-# Interface: NFTDetails
-
-Details of the NFT asset agreement
-
-## Table of contents
-
-### Properties
-
-- [blockNumberUpdated](NFTDetails.md#blocknumberupdated)
-- [lastChecksum](NFTDetails.md#lastchecksum)
-- [lastUpdatedBy](NFTDetails.md#lastupdatedby)
-- [mintCap](NFTDetails.md#mintcap)
-- [nftContractAddress](NFTDetails.md#nftcontractaddress)
-- [nftInitialized](NFTDetails.md#nftinitialized)
-- [nftSupply](NFTDetails.md#nftsupply)
-- [nftURI](NFTDetails.md#nfturi)
-- [owner](NFTDetails.md#owner)
-- [providers](NFTDetails.md#providers)
-- [royalties](NFTDetails.md#royalties)
-- [royaltyScheme](NFTDetails.md#royaltyscheme)
-- [url](NFTDetails.md#url)
-
-## Properties
-
-### blockNumberUpdated
-
-• **blockNumberUpdated**: `number`
-
-The block number from blockchain where the asset was updated
-
-#### Defined in
-
-[types/index.ts:336](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L336)
-
-___
-
-### lastChecksum
-
-• **lastChecksum**: `string`
-
-The last checksum generated to verify the sources
-
-#### Defined in
-
-[types/index.ts:330](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L330)
-
-___
-
-### lastUpdatedBy
-
-• **lastUpdatedBy**: `string`
-
-The modification of the asset
-
-#### Defined in
-
-[types/index.ts:334](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L334)
-
-___
-
-### mintCap
-
-• **mintCap**: `BigNumber`
-
-The amount limit of nft which can be minted
-
-#### Defined in
-
-[types/index.ts:348](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L348)
-
-___
-
-### nftContractAddress
-
-• **nftContractAddress**: `string`
-
-Contract NFT address which was created the NFT asset
-
-#### Defined in
-
-[types/index.ts:342](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L342)
-
-___
-
-### nftInitialized
-
-• **nftInitialized**: `string`
-
-When the NFT asset was initialized
-
-#### Defined in
-
-[types/index.ts:344](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L344)
-
-___
-
-### nftSupply
-
-• **nftSupply**: `BigNumber`
-
-The amount of ntfs that are in circulation
-
-#### Defined in
-
-[types/index.ts:340](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L340)
-
-___
-
-### nftURI
-
-• `Optional` **nftURI**: `string`
-
-Uri of the NFT
-
-#### Defined in
-
-[types/index.ts:346](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L346)
-
-___
-
-### owner
-
-• **owner**: `string`
-
-The owner of the asset
-
-#### Defined in
-
-[types/index.ts:328](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L328)
-
-___
-
-### providers
-
-• **providers**: [`string`]
-
-Which services provide the asset
-
-#### Defined in
-
-[types/index.ts:338](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L338)
-
-___
-
-### royalties
-
-• **royalties**: `number`
-
-The rewards that the owner can get for every sale
-
-#### Defined in
-
-[types/index.ts:350](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L350)
-
-___
-
-### royaltyScheme
-
-• **royaltyScheme**: `RoyaltyKind`
-
-Royalty scheme of the NFT asset
-
-#### Defined in
-
-[types/index.ts:352](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L352)
-
-___
-
-### url
-
-• **url**: `string`
-
-Url where is located the asset
-
-#### Defined in
-
-[types/index.ts:332](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L332)
diff --git a/docs/react-components/catalog/API/interfaces/NFTSModule.md b/docs/react-components/catalog/API/interfaces/NFTSModule.md
deleted file mode 100644
index 9adeef37a2..0000000000
--- a/docs/react-components/catalog/API/interfaces/NFTSModule.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# Interface: NFTSModule
-
-## Table of contents
-
-### Properties
-
-- [access](NFTSModule.md#access)
-
-## Properties
-
-### access
-
-• **access**: (`access`: { `buyer`: `Account` ; `chainId`: `number` ; `did`: `string` ; `ercType?`: `ERCType` ; `messageAuth?`: `string` ; `nftAmount`: `BigNumber` ; `nftHolder`: `string` ; `onEvent?`: (`next`: `OrderProgressStep`) => `void` ; `password?`: `string` }) => `Promise`<`string`\>
-
-#### Type declaration
-
-▸ (`access`): `Promise`<`string`\>
-
-Order a NFT asset and transfer and delegate it to the buyer
-
-##### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `access` | `Object` | |
-| `access.buyer` | `Account` | Account of the buyer |
-| `access.chainId` | `number` | - |
-| `access.did` | `string` | Id of the NFT to subscribe |
-| `access.ercType?` | `ERCType` | NFT asset type which can be `721` or `1155` |
-| `access.messageAuth?` | `string` | Message auth in case that the token is expired |
-| `access.nftAmount` | `BigNumber` | The amount of NFT asset to buy |
-| `access.nftHolder` | `string` | The owner of the NFT asset |
-| `access.onEvent?` | (`next`: `OrderProgressStep`) => `void` | - |
-| `access.password?` | `string` | Password to desencrypt metadata |
-
-##### Returns
-
-`Promise`<`string`\>
-
-It is successfully completed will return the `agreementId`
-
-#### Defined in
-
-[types/index.ts:875](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L875)
diff --git a/docs/react-components/catalog/API/interfaces/NeverminedProviderContext.md b/docs/react-components/catalog/API/interfaces/NeverminedProviderContext.md
deleted file mode 100644
index 912aa2b427..0000000000
--- a/docs/react-components/catalog/API/interfaces/NeverminedProviderContext.md
+++ /dev/null
@@ -1,359 +0,0 @@
-# Interface: NeverminedProviderContext
-
-Values returns from the main NVM context
-Can be consumed after wrapping your project with the catalog(see setup steps)
-
-example:
-
-option 1: const { sdk, sdkError, isLoadingSdk, ...others } = useContext(Catalog.NeverminedContext)
-option 2: const { sdk, sdkError, isLoadingSdk, ...others } = Catalog.useNevermined()
-
-## Table of contents
-
-### Properties
-
-- [account](NeverminedProviderContext.md#account)
-- [assets](NeverminedProviderContext.md#assets)
-- [config](NeverminedProviderContext.md#config)
-- [isLoadingSDK](NeverminedProviderContext.md#isloadingsdk)
-- [nfts](NeverminedProviderContext.md#nfts)
-- [sdk](NeverminedProviderContext.md#sdk)
-- [sdkError](NeverminedProviderContext.md#sdkerror)
-- [subscribe](NeverminedProviderContext.md#subscribe)
-- [updateSDK](NeverminedProviderContext.md#updatesdk)
-
-## Properties
-
-### account
-
-• **account**: [`AccountModule`](AccountModule.md)
-
-`account` contains all the functionalities to handle authentications and
-collections belonged to an account
-
-**`Example`**
-
-Authorization example:
-```ts
-const Example = (props: ExampleProps) => {
- const { assets, account, isLoadingSDK } = Catalog.useNevermined();
-
- const buy = async () => {
- (...)
- };
-}
-```
-
-Check NFT1155 holder example
-```ts
-const Example = (props: ExampleProps) => {
- const { account, isLoadingSDK } = Catalog.useNevermined();
- const [ownNFT1155, setOwnNFT1155] = useState(false);
-
- useEffect(() => {
- (async () => {
- const response = await account.isNFT1155Holder(ddo.id, walletAddress);
- setOwnNFT1155(response);
- })()
- }, [walletAddress])
-
-}
-```
-
-#### Defined in
-
-[types/index.ts:224](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L224)
-
-___
-
-### assets
-
-• **assets**: [`AssetsModule`](AssetsModule.md)
-
-`assets` contains all the functionalities to handle assets for example get,
-mint, transfer, order or download asset
-
-**`Example`**
-
-Publish an asset example:
-
-```tsx
-const Example = () => {
- const { isLoadingSDK, sdk, account, assets } = Catalog.useNevermined();
- const [ddo, setDDO] = useState({} as DDO)
-
- const metadata: MetaData = {
- main: {
- name: 'my app',
- files: [{
- index: 0,
- contentType: 'application/json',
- url: 'https://github.com/nevermined-io/docs/blob/master/docs/architecture/specs/metadata/examples/ddo-example.json'
- }],
- type: 'dataset',
- author: 'My company',
- license: '',
- dateCreated: new Date().toISOString(),
- }
- };
-
- const onPublish = async () => {
- try {
- const rewardsRecipients: any[] = [];
- const assetPriceMap = new Map([
- [walletAddress, BigNumber.from(1)]
- ])
- const assetPrice = new AssetPrice(assetPriceMap);
- const royaltyAttributes = {
- royaltyKind: RoyaltyKind.Standard,
- scheme: getRoyaltyScheme(sdk, RoyaltyKind.Standard),
- amount: 0,
- };
-
- const nftAttributes = NFTAttributes.getNFT1155Instance({
- metadata,
- serviceTypes: ['nft-sales-proof', 'nft-access'],
- cap: BigNumber.from(100),
- amount: BigNumber.from(1),
- preMint: true,
- nftContractAddress: token.address,
- price: assetPrice,
- royaltyAttributes
- })
-
- const response = await publishNFT1155({
- nftAttributes,
- });
-
- setDDO(response as DDO);
- } catch (error) {
- console.log('error', error);
- }
- };
-
- return (
- <>
- ...
- >
- );
-};
-```
-
-#### Defined in
-
-[types/index.ts:191](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L191)
-
-___
-
-### config
-
-• **config**: `NeverminedOptions`
-
-Config object used to initialize Nevermined
-
-#### Defined in
-
-[types/index.ts:44](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L44)
-
-___
-
-### isLoadingSDK
-
-• **isLoadingSDK**: `boolean`
-
-True if sdk is loading
-
-#### Defined in
-
-[types/index.ts:46](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/types/index.ts#L46)
-
-___
-
-### nfts
-
-• **nfts**: [`NFTSModule`](NFTSModule.md)
-
-`nfts` contains all the functionalities to handle nfts by payment
-
-**`Example`**
-
-Buy nfts example
-
-```tsx
-const BuyAsset = ({ddo}: {ddo: DDO}) => {
- const { assets, account, isLoadingSDK, nfts, sdk } = Catalog.useNevermined();
- const { walletAddress } = MetaMask.useWallet();
- const [ownNFT1155, setOwnNFT1155] = useState(false);
- const [isBought, setIsBought] = useState(false);
- const [owner, setOwner] = useState('');
-
- useEffect(() => {
- (async () => {
- setOwnNFT1155(await account.isNFT1155Holder(ddo.id, walletAddress));
- setOwner(await sdk.assets.owner(ddo.id))
- })()
- }, [walletAddress, isBought])
-
- const buy = async () => {
- const response = await nfts.access({
- did:ddo.id,
- nftHolder: owner,
- nftAmount: BigNumber.from(1),
- ercType: 1155});
- setIsBought(response);
- };
-
- const download = async () => {
- await assets.downloadNFT({ did: ddo.id });
- };
-
- return (
-
- {ownNFT1155 ? (
-
- ) : (
- owner !== walletAddress ?
-
- : The owner cannot buy, please change the account to buy the NFT asset
- )}
-
- )
- })}
- >
- )
-}
-```
-
-#### Returns
-
-`Object`
-
-Array of events with method `unsubscribe` in order to stop listening specific event
-
-| Name | Type |
-| :------ | :------ |
-| `paymentEvents` | `EventResult`[] |
-
-#### Defined in
-
-[services/subscribe.ts:32](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/services/subscribe.ts#L32)
-
-___
-
-### useSubscribeToTransferEvents
-
-▸ **useSubscribeToTransferEvents**(`nftType?`): `Object`
-
-Subscribe to nft transfer events
-
-**`Example`**
-
-```tsx
-const MyComponent = () => {
- const { transferEvents } = SubscribeService.useSubscribeToTransferEvents();
-
- return (
- <>
- {transferEvents.map((p) => {
- return (
-
-
{p.id}
-
{p._did}
-
{p._agreementId}
-
{p._receivers}
-
- )
- })}
- >
- )
-}
-```
-
-#### Parameters
-
-| Name | Type | Default value |
-| :------ | :------ | :------ |
-| `nftType` | `ERCType` | `1155` |
-
-#### Returns
-
-`Object`
-
-Array of events with method `unsubscribe` in order to stop listening specific event
-
-| Name | Type |
-| :------ | :------ |
-| `transferEvents` | `EventResult`[] |
-
-#### Defined in
-
-[services/subscribe.ts:89](https://github.com/nevermined-io/react-components/blob/6de295e/catalog/src/services/subscribe.ts#L89)
diff --git a/docs/react-components/catalog/README.md b/docs/react-components/catalog/README.md
deleted file mode 100644
index ff071d0449..0000000000
--- a/docs/react-components/catalog/README.md
+++ /dev/null
@@ -1,103 +0,0 @@
----
-sidebar_position: 1
-title: Getting started
-description: Nevermined Catalog
----
-
-This library was generated with [Nx](https://nx.dev).
-
-# 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](https://nodejs.org/) v14 or higher. You can find online instructions about [How to install Node JS](https://nodejs.dev/en/learn/how-to-install-nodejs/).
-
-## How to install ?
-
-```bash
-yarn add @nevermined-io/catalog
-or
-npm install --save @nevermined-io/catalog
-```
-
-## How to integrate ?
-
-```typescript
-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(
-
-
-
-
-
,
- document.getElementById('root') as HTMLElement
-);
-```
-
-## How to use ?
-
-```typescript
-const SingleAsset = () => {
- const did = 'did:nv:f8a00...';
- const assetData: AssetState = AssetService.useAsset(did);
-
- return (
- <>
-
Asset {did}:
-
{JSON.stringify(assetData.ddo)}
- >
- );
-};
-
-```
-
-For a full [example](https://github.com/nevermined-io/components-catalog/tree/main/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](https://github.com/nevermined-io/nvm-tools-actions)
diff --git a/docs/react-components/catalog/_category_.json b/docs/react-components/catalog/_category_.json
deleted file mode 100644
index b9839027f4..0000000000
--- a/docs/react-components/catalog/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "Catalog",
- "position": 7,
- "link": {
- "type": "doc",
- "id": "react-components/catalog/README"
- }
- }
\ No newline at end of file
diff --git a/docs/react-components/demo.md b/docs/react-components/demo.md
deleted file mode 100644
index 9438a7c0d9..0000000000
--- a/docs/react-components/demo.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-sidebar_position: 4
----
-
-import BrowserOnly from '@docusaurus/BrowserOnly';
-import { DemoCatalog } from '@site/src/components/demo';
-
-# Demo
-This demo is based in the code of the [Example](./example.md) section
-
-## Workflow example
-
-The example in the template covers the most commonsly used functionalities to interact with NFT1155.
-
-**Requirements:** The account wallet used for the example must have `Matic` and `USDC`
-
-1. Connect the wallet
-2. Click the `Mint` button, approve the transaction and sign the authorization request in the wallet.
-3. Once the token is minted the `Mint` button will change to `Download NFT`.
-4. Click on `Download NFT` to retrieve the example asset (in this case it is a JSON file)
-5. Change the account in the wallet
-6. Click on the `Buy` button and approve the transaction and sign the authorization request in the wallet
-7. Upon purchasing the token the `Buy` button will change to `Download NFT`
-8. Repeat step 4
-
-*Warning:* The data is not static, once the browser is reloaded the workflow example will restart.
-
-## View
-
-Loading demo...}>
- {()=> }
-
diff --git a/docs/react-components/example.md b/docs/react-components/example.md
deleted file mode 100644
index e2233ab34a..0000000000
--- a/docs/react-components/example.md
+++ /dev/null
@@ -1,598 +0,0 @@
----
-sidebar_position: 3
----
-
-# How to use React Components
-
-## Requirements
-Before you start with this demo you require:
-
-* An extension of [Metamask](https://metamask.io/) installed in your browser
-* [node](https://nodejs.org/en/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) needs to be installed
-
-## How to get the source of this example?
-You can install the example in your local machine and run it without installing anything. Information for how to do this can be found here [here](https://github.com/nevermined-io/create-nevermined-react)
-
-## Let's start with the app config file
-The first file that you need to create is the `config.ts` file which contains all the [options needed](../nevermined-sdk/api-reference/classes/Config.md) to initialize the [Catalog core](./catalog/README.md).
-
-```ts
-import { AuthToken, NeverminedOptions } from '@nevermined-io/catalog'
-import { ethers } from 'ethers'
-
-export const web3ProviderUri = process.env.REACT_APP_NODE_URI || 'https://matic-mumbai.chainstacklabs.com'
-export const nodeAddress =
- process.env.REACT_APP_GATEWAY_ADDRESS || '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc'
-export const neverminedNodeUri =
- process.env.REACT_APP_GATEWAY_URI || 'https://node.mumbai.public.nevermined.network'
-export const acceptedChainId = process.env.REACT_APP_ACCEPTED_CHAIN_ID || '80001' // for Mumbai
-export const rootUri = process.env.REACT_APP_ROOT_URI || 'http://localhost:3445'
-export const marketplaceUri = 'https://marketplace-api.mumbai.public.nevermined.network'
-const graphHttpUri = process.env.GRAPH_HTTP_URI || 'https://api.thegraph.com/subgraphs/name/nevermined-io/public'
-// represent USDC token in mumbai that can be claimed in the faucet https://calibration-faucet.filswan.com/#/dashboard
-export const erc20TokenAddress = process.env.ERC20_TOKEN_ADDRESS || '0xe11a86849d99f524cac3e7a0ec1241828e332c62'
-
-export const appConfig: NeverminedOptions = {
- //@ts-ignore
- web3Provider: typeof window !== 'undefined' ? window.ethereum : new ethers.providers.JsonRpcProvider(nodeUri),
- neverminedNodeUri,
- nodeAddress,
- graphHttpUri,
- marketplaceAuthToken: AuthToken.fetchMarketplaceApiTokenFromLocalStorage().token,
- marketplaceUri,
- artifactsFolder: `${rootUri}/contracts`,
-}
-```
-
-## Setting the networks for web3 providers (optional)
-The next step is setting differents networks for the dapp [polygon](https://polygon.technology/) which does not require this file. However, we have included it in the example as it contains the networks settings for web3 providers.
-
-```ts
-import { Wagmi } from '@nevermined-io/catalog-providers'
-
-const ChainsConfig: Wagmi.Chain[] = [
- Wagmi.chain.polygon,
- Wagmi.chain.polygonMumbai,
- {
- id: 1337,
- name: "Localhost development",
- network: "spree",
- nativeCurrency: {
- name: "Ethereum",
- symbol: "ETH",
- decimals: 18,
- },
- rpcUrls: {
- default: "http://localhost:8545"
- },
- testnet: true
- },
-]
-
-export default ChainConfig
-```
-
-## The example file
-The example file `src/example/index.tsx` contains all the basic logic to handle a [NFT1155](../architecture/what-can-i-do.md#tokenization-of-assets-via-erc-1155-nfts-aka-nft-sales) as a component. It outlines each functionality and component in detail.
-
-### SDKInstance
-This component will check if [sdk](../nevermined-sdk/getting-started.md) is loaded or not and display the status
-
-```tsx
-const SDKInstance = () => {
- const { sdk, isLoadingSDK } = Catalog.useNevermined()
-
- return (
- <>
-
- Is Loading SDK:
- {isLoadingSDK ? 'Yes' : 'No'}
-
-
-
- Is SDK Avaialable:
- {sdk && Object.keys(sdk).length > 0 ? 'Yes' : 'No'}
-
- >
- )
-}
-```
-
-### SingleAsset
-It shows the content of the ddo object published
-
-```tsx
-const SingleAsset = ({ddo}: {ddo: DDO}) => {
-
- return (
- <>
-
- Asset {ddo.id.slice(0, 10)}...:
-
- {JSON.stringify(ddo)}
- >
- )
-}
-```
-
-### PublishAsset
-It renders a button used to publish a new [NFT](../architecture/specs/Spec-NFT.md)
-
-```tsx
-const PublishAsset = ({onPublish}: {onPublish: () => void}) => {
- const { assets } = Catalog.useNevermined()
-
- return (
- <>
-
- mint
-
- >
- )
-}
-```
-
-### BuyAsset
-The `BuyAsset` component will display the button `buy` in order to buy the asset if the wallet account is not a NFT1155 holder. Otherwise, the owner will display a download button to download the NFT asset
-
-```tsx
-const BuyAsset = ({ddo}: {ddo: DDO}) => {
- const { assets, account, isLoadingSDK, nfts, sdk } = Catalog.useNevermined()
- const { walletAddress } = MetaMask.useWallet()
- const [ownNFT1155, setOwnNFT1155] = useState(false)
- const [isBought, setIsBought] = useState(false)
- const [owner, setOwner] = useState('')
-
- useEffect(() => {
- (async () => {
- setOwnNFT1155(await account.isNFT1155Holder(ddo.id, walletAddress))
- setOwner(await sdk.assets.owner(ddo.id))
- })()
- }, [walletAddress, isBought])
-
-const buy = async () => {
- const response = await nfts.access({
- did: ddo.id,
- nftHolder: owner,
- nftAmount: BigNumber.from(1),
- ercType: 1155
- })
- setIsBought(Boolean(response))
- }
-
- const download = async () => {
- await assets.downloadNFT({
- did: ddo.id
- })
- }
-
- return (
-
- {ownNFT1155 ? (
-
- Download NFT
-
- ) : (
- owner !== walletAddress ?
-
- buy
-
- : The owner cannot buy, please change the account to buy the NFT asset
- )}
-
- )
-}
-```
-
-### MMWallet
-An important component for connecting to the wallet. Upon connecting, the app will display the address account. Otherwise it will render a button to connect to it.
-
-```tsx
-const MMWallet = () => {
- const { login, walletAddress, getConnectors } = useWallet()
- return (
-
- Wallet address:
- {walletAddress}
- {!walletAddress && login(getConnectors()[0])}>Connect To MM}
-
- )
-}
-```
-
-
-### App
-The main component of the example, it pulls the rest of the components and also includes the function `onPublish` with the logic to publish a NFT1155 which is transferred as a parameter to the component [PublisAsset](#publishasset)
-
-```tsx
-const App = () => {
- const { isLoadingSDK, sdk } = Catalog.useNevermined()
- const { publishNFT1155 } = AssetService.useAssetPublish()
- const { walletAddress } = useWallet()
- const [ddo, setDDO] = useState({} as DDO)
- const royaltyAttributes = {
- royaltyKind: RoyaltyKind.Standard,
- scheme: getRoyaltyScheme(sdk, RoyaltyKind.Standard),
- amount: 0,
- }
-
- const metadata: MetaData = {
- main: {
- name: '',
- files: [{
- index: 0,
- contentType: 'application/json',
- url: 'https://uploads5.wikiart.org/00268/images/william-holbrook-beard/the-bear-dance-1870.jpg'
- }],
- type: 'dataset',
- author: '',
- license: '',
- dateCreated: new Date().toISOString(),
- }
- }
-
- const onPublish = async () => {
- try {
- const assetPriceMap = new Map([
- [walletAddress, BigNumber.from(1)]
- ])
-
- const assetPrice = new AssetPrice(assetPriceMap)
- const networkFee = await sdk.keeper.nvmConfig.getNetworkFee()
- const feeReceiver = await sdk.keeper.nvmConfig.getFeeReceiver()
-
- assetPrice.addNetworkFees(feeReceiver, BigNumber.from(networkFee))
- assetPrice.setTokenAddress(ERC_TOKEN)
-
- const royaltyAttributes = {
- royaltyKind: RoyaltyKind.Standard,
- scheme: getRoyaltyScheme(sdk, RoyaltyKind.Standard),
- amount: 0,
- }
-
- const nftAttributes = NFTAttributes.getNFT1155Instance({
- metadata,
- serviceTypes: ['nft-sales', 'nft-access'],
- amount: BigNumber.from(1),
- cap: BigNumber.from(100),
- royaltyAttributes,
- preMint: true,
- nftContractAddress: sdk.nfts1155.nftContract.address,
- providers: [config.neverminedNodeAddress],
- price: assetPrice,
- })
-
- const response = await publishNFT1155({
- nftAttributes,
- })
-
- setDDO(response as DDO)
- } catch (error) {
- console.log('error', error)
- }
- }
-
- return (
-
- )
-}
-
-export default App
-```
-
-## Styling
-In the path `src/examples/example.module.scss` you will find some styles to improve the UI of the app.
-
-```scss
-@import '~@nevermined-io/styles/lib/cjs/styles/index.scss'
-
-.example {
- @include component;
-
- &__container {
- padding: 25px 0 0 25px;
- }
-
- &__detail {
- margin-right: 5px;
- }
-
- &__ddo {
- line-height: 16px;
- }
-
- &__buy {
- margin-top: 20px;
- }
-}
-```
-
-## The index file
-The `src/indes.tsx` file call Catalog core, Catalog providers and the exemple component with the configurations set
-
-```tsx
-import '@nevermined-io/styles/lib/esm/styles/globals.scss'
-import '@nevermined-io/styles/lib/esm/index.css'
-import React from 'react'
-import ReactDOM from 'react-dom'
-import { Catalog, AssetService } from '@nevermined-io/catalog'
-import { appConfig } from './config'
-import App from 'examples'
-import { WalletProvider, getClient } from '@nevermined-io/providers'
-import ChainConfig from './chain_config'
-
-
-ReactDOM.render(
-
-
-
-
-
-
-
-
-
,
- document.getElementById('root') as HTMLElement
-)
-```
-
-## Publish and buy encrypted assets with DTP (Data transfer proof)
-
-It is possible to encrypt assets and giving access by password using DTP, using `Catalog` such approach is quite simple, for publish just is needed to set the crypto config and adding the password and the cripto config in the publish method:
-
-```ts
-const nodeInfo = await sdk.services.node.getNeverminedNodeInfo()
-const cryptoConfig = {
- provider_key: nodeInfo['babyjub-public-key'],
- provider_password: password,
- provider_rsa_public: nodeInfo['rsa-public-key'],
- provider_rsa_private: '',
-}
-
-...
-
-const response = await publishNFT1155({
- nftAttributes,
- password,
- cryptoConfig
-})
-```
-
-And to access and download the asset only pass the password is needed:
-
-```ts
-const agreementId = await nfts.access({
- did: ddo.id,
- nftHolder: owner,
- nftAmount: BigNumber.from(1),
- ercType: 1155,
- password,
-})
-
-const result = await assets.downloadNFT({
- did: ddo.id,
- ercType: 1155,
- password
-})
-```
-
diff --git a/docs/react-components/functionalities.md b/docs/react-components/functionalities.md
deleted file mode 100644
index 9ac9f74c75..0000000000
--- a/docs/react-components/functionalities.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-sidebar_position: 2
----
-
-# What can I do with the Nevermined React Components?
-
-The Nevermined React Components simplifies the creation of web3 applications for React developers. With this library the developers will be able to do theses actions with assets, NFT721 and NFT1155:
-
-* [Publish](https://docs.nevermined.io/docs/tutorials/assets#how-to-create-an-nft-erc1155)
-* [Buy](https://docs.nevermined.io/docs/tutorials/assets#how-to-consume-an-nft-erc1155)
-* [Download](https://docs.nevermined.io/docs/tutorials/assets#how-to-consume-an-nft-erc1155)
-* [Transfer](https://docs.nevermined.io/docs/catalog/core/API/interfaces/AssetsModule#transfer)
-* [List assests and NFTs owned](https://docs.nevermined.io/docs/catalog/core/API/modules/AccountService#useaccountreleases)
-* [List assests and NFTs bought](https://docs.nevermined.io/docs/catalog/core/API/modules/AccountService#useaccountcollection)
-* [Get transactions events history](https://docs.nevermined.io/docs/catalog/core/API/modules/EventService#gettransfers)
-* [Get asset register events history](https://docs.nevermined.io/docs/catalog/core/API/modules/EventService#gettransfers)
-* [Subscribe events](https://docs.nevermined.io/docs/catalog/core/API/modules/SubscribeService)
-* [Check if the wallet address is a holder](https://docs.nevermined.io/docs/catalog/core/API/modules/AccountService#useisnft1155holder)
-* [Manage user profiles and user authentications](https://docs.nevermined.io/docs/catalog/core/API/modules/AccountService#useisnft1155holder)
-* [Manage a wallet from different providers](./providers/API/modules.md)
-
-One of Nevermined's and the Catalog's key characteristics is that we are non-custodial. Users retain full ownership of their private keys and credentials. This allows us to achieve complete decentralization, enabling the design and deployment of use cases via the Catalog that support peer to peer interaction between content providers/producers and end users without a central entity.
diff --git a/docs/react-components/intro.md b/docs/react-components/intro.md
deleted file mode 100644
index 6cff72b892..0000000000
--- a/docs/react-components/intro.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-sidebar_position: 1
----
-
-# What are Nevermined React Components?
-
-The Nevermined React Components is a library of packaged Nevermined functions, tools and commands making easier to add web3 capabilities to any existing React application.
-
-Building web3 applications is a challenging and multi-layer process. Building robust scenarios where content and service providers and end users can interact in a secure and trusted way adds another layer of complexity. Nevermined provides a protocol where they can interact and generate value around digital assets, allowing marketplaces or web applications builders to create new use cases built on top of these capabilities.
-
-To provide this level of interaction in a secure and trustless way, there are some levels of integration with the different components of Nevermined. The **Nevermined React Components** outlines this process, covering all basic steps and requirements.
-
-Ultimately, the main goal of Nevermined is to provide the building blocks to create these level of robust applications while eliminating some of the complexity of blockchain.
-
-One of Nevermined's and the React components's key characteristics is that we are non-custodial. Users retain full ownership of their private keys and credentials. This allows us to achieve complete decentralization, enabling the design and deployment of use cases via the Catalog that support peer to peer interaction between content providers/producers and end users without a central entity.
-
-The React components consists of two modules:
-
-### [Catalog](./catalog/README.md)
-
-All the Nevermined functionalities split in the `Catalog provider` and `Services`.
-
-### [Providers](./providers/README.md)
-
-A package facilitating the interaction with Web3 providers like Metamask.
-
-## React Framework
-
-Nevermined is framework-agnostic, but we created this catalog on top of React to facilitate the integration for React builders. The same level of use cases/applications can be delivered in any other framework using the [Nevermined SDK](https://docs.nevermined.io/docs/nevermined-sdk/).
-
-import DocCardList from '@site/src/components/docCard/docCardList';
-
-
diff --git a/docs/react-components/providers/API/_category_.json b/docs/react-components/providers/API/_category_.json
deleted file mode 100644
index b161af2fc8..0000000000
--- a/docs/react-components/providers/API/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "API Ref.",
- "position": 2,
- "link": {
- "type": "doc",
- "id": "react-components/providers/API/modules"
- }
-}
\ No newline at end of file
diff --git a/docs/react-components/providers/API/interfaces/DataStatus.md b/docs/react-components/providers/API/interfaces/DataStatus.md
deleted file mode 100644
index 3629d9a490..0000000000
--- a/docs/react-components/providers/API/interfaces/DataStatus.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Interface: DataStatus
-
-## Table of contents
-
-### Properties
-
-- [message](DataStatus.md#message)
-- [status](DataStatus.md#status)
-
-## Properties
-
-### message
-
-• **message**: `unknown`
-
-#### Defined in
-
-[types.ts:41](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L41)
-
-___
-
-### status
-
-• **status**: [`ProviderStatus`](../enums/ProviderStatus.md)
-
-#### Defined in
-
-[types.ts:42](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L42)
diff --git a/docs/react-components/providers/API/interfaces/WalletProviderState.md b/docs/react-components/providers/API/interfaces/WalletProviderState.md
deleted file mode 100644
index 58f58f20e9..0000000000
--- a/docs/react-components/providers/API/interfaces/WalletProviderState.md
+++ /dev/null
@@ -1,205 +0,0 @@
-# Interface: WalletProviderState
-
-This component is a layer of [Wagmi](https://wagmi.sh/docs/getting-started) and [ConnectKit](https://docs.family.co/connectkit)
-which allow to handle Metamask, WalletConnect and Coinbase without needing to set any config
-
-## Table of contents
-
-### Properties
-
-- [checkIsChainCorrect](WalletProviderState.md#checkischaincorrect)
-- [client](WalletProviderState.md#client)
-- [dataStatus](WalletProviderState.md#datastatus)
-- [getAllAvailableChains](WalletProviderState.md#getallavailablechains)
-- [getConnectors](WalletProviderState.md#getconnectors)
-- [getProvider](WalletProviderState.md#getprovider)
-- [getStatus](WalletProviderState.md#getstatus)
-- [login](WalletProviderState.md#login)
-- [logout](WalletProviderState.md#logout)
-- [walletAddress](WalletProviderState.md#walletaddress)
-
-## Properties
-
-### checkIsChainCorrect
-
-• **checkIsChainCorrect**: () => `boolean`
-
-#### Type declaration
-
-▸ (): `boolean`
-
-If chain is between the available networks supported
-
-##### Returns
-
-`boolean`
-
-#### Defined in
-
-[client.tsx:40](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L40)
-
-___
-
-### client
-
-• **client**: `Client`<`Provider`, `WebSocketProvider`\>
-
-All the wagmi client functionalities
-
-**`See`**
-
-[wagmi](https://wagmi.sh/docs/getting-started)
-
-#### Defined in
-
-[client.tsx:24](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L24)
-
-___
-
-### dataStatus
-
-• **dataStatus**: [`DataStatus`](DataStatus.md)
-
-get data status including message
-
-#### Defined in
-
-[client.tsx:42](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L42)
-
-___
-
-### getAllAvailableChains
-
-• **getAllAvailableChains**: () => `Chain`[]
-
-#### Type declaration
-
-▸ (): `Chain`[]
-
-Get all the available chains
-
-##### Returns
-
-`Chain`[]
-
-#### Defined in
-
-[client.tsx:34](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L34)
-
-___
-
-### getConnectors
-
-• **getConnectors**: () => `Connector`<`any`, `any`, `any`\>[]
-
-#### Type declaration
-
-▸ (): `Connector`<`any`, `any`, `any`\>[]
-
-Get all the connectors available
-
-##### Returns
-
-`Connector`<`any`, `any`, `any`\>[]
-
-#### Defined in
-
-[client.tsx:28](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L28)
-
-___
-
-### getProvider
-
-• **getProvider**: () => `Provider`
-
-#### Type declaration
-
-▸ (): `Provider`
-
-Metamask provider for example web3 or ethers
-
-##### Returns
-
-`Provider`
-
-#### Defined in
-
-[client.tsx:26](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L26)
-
-___
-
-### getStatus
-
-• **getStatus**: () => `undefined` \| ``"connecting"`` \| ``"connected"`` \| ``"reconnecting"`` \| ``"disconnected"``
-
-#### Type declaration
-
-▸ (): `undefined` \| ``"connecting"`` \| ``"connected"`` \| ``"reconnecting"`` \| ``"disconnected"``
-
-Get the status of the wallet
-
-##### Returns
-
-`undefined` \| ``"connecting"`` \| ``"connected"`` \| ``"reconnecting"`` \| ``"disconnected"``
-
-#### Defined in
-
-[client.tsx:32](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L32)
-
-___
-
-### login
-
-• **login**: (`connector`: `Connector`<`any`, `any`, `any`\>) => `void`
-
-#### Type declaration
-
-▸ (`connector`): `void`
-
-Login in Provider
-
-##### Parameters
-
-| Name | Type |
-| :------ | :------ |
-| `connector` | `Connector`<`any`, `any`, `any`\> |
-
-##### Returns
-
-`void`
-
-#### Defined in
-
-[client.tsx:38](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L38)
-
-___
-
-### logout
-
-• **logout**: () => `void`
-
-#### Type declaration
-
-▸ (): `void`
-
-Logout from the wallet
-
-##### Returns
-
-`void`
-
-#### Defined in
-
-[client.tsx:30](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L30)
-
-___
-
-### walletAddress
-
-• **walletAddress**: `string`
-
-The address of the wallet account
-
-#### Defined in
-
-[client.tsx:36](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L36)
diff --git a/docs/react-components/providers/API/modules.md b/docs/react-components/providers/API/modules.md
deleted file mode 100644
index 02a0a8e215..0000000000
--- a/docs/react-components/providers/API/modules.md
+++ /dev/null
@@ -1,205 +0,0 @@
-# @nevermined-io/providers
-
-## Table of contents
-
-### Enumerations
-
-- [ProviderStatus](enums/ProviderStatus.md)
-
-### Interfaces
-
-- [DataStatus](interfaces/DataStatus.md)
-- [WalletProviderState](interfaces/WalletProviderState.md)
-
-### Type Aliases
-
-- [ConnectKitOptions](modules.md#connectkitoptions)
-- [ConnectKitProviderProps](modules.md#connectkitproviderprops)
-
-### Variables
-
-- [WalletContext](modules.md#walletcontext)
-
-### Functions
-
-- [ClientComp](modules.md#clientcomp)
-- [WalletProvider](modules.md#walletprovider)
-- [useWallet](modules.md#usewallet)
-- [zeroX](modules.md#zerox)
-
-## Type Aliases
-
-### ConnectKitOptions
-
-Ƭ **ConnectKitOptions**: `Object`
-
-#### Type declaration
-
-| Name | Type |
-| :------ | :------ |
-| `avoidLayoutShift?` | `boolean` |
-| `bufferPolyfill?` | `boolean` |
-| `customAvatar?` | `React.FC`<`CustomAvatarProps`\> |
-| `disclaimer?` | `ReactNode` \| `string` |
-| `embedGoogleFonts?` | `boolean` |
-| `hideNoWalletCTA?` | `boolean` |
-| `hideQuestionMarkCTA?` | `boolean` |
-| `hideTooltips?` | `boolean` |
-| `initialChainId?` | `number` |
-| `language?` | `Languages` |
-| `reducedMotion?` | `boolean` |
-| `truncateLongENSAddress?` | `boolean` |
-| `walletConnectCTA?` | ``"modal"`` \| ``"link"`` \| ``"both"`` |
-| `walletConnectName?` | `string` |
-
-#### Defined in
-
-[types.ts:4](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L4)
-
-___
-
-### ConnectKitProviderProps
-
-Ƭ **ConnectKitProviderProps**: `Object`
-
-#### Type declaration
-
-| Name | Type |
-| :------ | :------ |
-| `children?` | `React.ReactNode` |
-| `customTheme?` | `CustomTheme` |
-| `mode?` | `Mode` |
-| `options?` | [`ConnectKitOptions`](modules.md#connectkitoptions) |
-| `theme?` | `Theme` |
-
-#### Defined in
-
-[types.ts:21](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L21)
-
-## Variables
-
-### WalletContext
-
-• `Const` **WalletContext**: `Context`<[`WalletProviderState`](interfaces/WalletProviderState.md)\>
-
-#### Defined in
-
-[client.tsx:45](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L45)
-
-## Functions
-
-### ClientComp
-
-▸ **ClientComp**(`«destructured»`): `Element`
-
-#### Parameters
-
-| Name | Type |
-| :------ | :------ |
-| `«destructured»` | `Object` |
-| › `children` | `ReactElement`<`any`, `string` \| `JSXElementConstructor`<`any`\>\> |
-| › `client` | `Client`<`Provider`, `WebSocketProvider`\> |
-| › `connectKitProps?` | [`ConnectKitProviderProps`](modules.md#connectkitproviderprops) |
-| › `correctNetworkId?` | `number` |
-
-#### Returns
-
-`Element`
-
-#### Defined in
-
-[client.tsx:47](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L47)
-
-___
-
-### WalletProvider
-
-▸ **WalletProvider**(`config`): `Element`
-
-This component is a layer of [Wagmi](https://wagmi.sh/react/getting-started) and [ConnectKit](https://docs.family.co/connectkit)
-which allow to handle Metamask, WalletConnect and Coinbase without needing to set any config
-
-**`See`**
-
-[wagmi](https://wagmi.sh/react/getting-started)
-
-**`Example`**
-
-Start wallet provider example:
-
-```tsx
-import React from 'react';
-import ReactDOM from 'react-dom';
-import { Catalog } from '@nevermined-io/catalog';
-import { appConfig } from './config';
-import Example from 'examples';
-import { WalletProvider, getClient } from '@nevermined-io/providers';
-import chainConfig from './chain_config';
-
-ReactDOM.render(
-
-
-
-
-
-
-
,
- document.getElementById('root') as HTMLElement
-);
-```
-
-#### Parameters
-
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `config` | `Object` | |
-| `config.children` | `ReactElement`<`any`, `string` \| `JSXElementConstructor`<`any`\>\> | - |
-| `config.client` | `Client`<`any`, `WebSocketProvider`\> | The wagmi client object |
-| `config.connectKitProps?` | [`ConnectKitProviderProps`](modules.md#connectkitproviderprops) | Parameter to pass the options to customize [ConnectKit](https://docs.family.co/connectkit/customization) |
-| `config.correctNetworkId?` | `number` | Id of the default blockchain network in Hexadecimal. Default the fist chain configured |
-
-#### Returns
-
-`Element`
-
-All the functionalities to handle the wallet in dapp
-
-#### Defined in
-
-[providers.tsx:43](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/providers.tsx#L43)
-
-___
-
-### useWallet
-
-▸ **useWallet**(): [`WalletProviderState`](interfaces/WalletProviderState.md)
-
-#### Returns
-
-[`WalletProviderState`](interfaces/WalletProviderState.md)
-
-#### Defined in
-
-[client.tsx:158](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/client.tsx#L158)
-
-___
-
-### zeroX
-
-▸ **zeroX**(`input?`): `string`
-
-#### Parameters
-
-| Name | Type | Default value |
-| :------ | :------ | :------ |
-| `input` | `string` | `""` |
-
-#### Returns
-
-`string`
-
-#### Defined in
-
-[utils/index.ts:1](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/utils/index.ts#L1)
diff --git a/docs/react-components/providers/README.md b/docs/react-components/providers/README.md
deleted file mode 100644
index 9a34a6a7bf..0000000000
--- a/docs/react-components/providers/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
----
-sidebar_position: 1
-title: Getting started
-description: Nevermined Providers Component API Reference
----
-
-This library was generated with [Nx](https://nx.dev).
-
-# Getting started
-
-The `providers` component exposes a package facilitating the interaction with Web3 providers like Metamask. You can see more about in the [documentation](https://docs.nevermined.io/docs/react-components/intro)
-
-## Providers supported
-
-* Metamask
-* WalletConnect
-* Coinbase Wallet
-
-## Pre-requisites
-
-The Nevermined providers is a package built with React and Typescript.
-It requires [Node JS](https://nodejs.org/) v14 or higher. You can find online instructions about [How to install Node JS](https://nodejs.dev/en/learn/how-to-install-nodejs/).
-
-## How to install ?
-
-```
-yarn add @nevermined-io/providers
-or
-npm install --save @nevermined-io/providers
-```
-
-## How to integrate ?
-
-```typescript
-import { WalletProvider, getClient, useWallet } from "@nevermined-io/providers";
-import App from "app";
-
-ReactDOM.render(
-
-
-
-
-
,
- document.getElementById("root") as HTMLElement
-);
-```
-
-## How to use ?
-
-```typescript
-const ConnectToMetaMask = () => {
- const { login, walletAddress, getConnectors } = useWallet();
-
- return (
- <>
-
{walletAddress}
- {!walletAddress && (
-
- )}
- >
- );
-};
-```
-
-You can find [here a example](https://docs.nevermined.io/docs/react-components/example)
-
-## Running unit tests
-
-Run `nx test:unit provider`
diff --git a/docs/react-components/providers/_category_.json b/docs/react-components/providers/_category_.json
deleted file mode 100644
index 03d336d1bf..0000000000
--- a/docs/react-components/providers/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "Providers",
- "position": 8,
- "link": {
- "type": "doc",
- "id": "react-components/providers/README"
- }
-}
\ No newline at end of file
diff --git a/docs/react-components/providers/enums/ProviderStatus.md b/docs/react-components/providers/enums/ProviderStatus.md
deleted file mode 100644
index d8e9465e1e..0000000000
--- a/docs/react-components/providers/enums/ProviderStatus.md
+++ /dev/null
@@ -1,94 +0,0 @@
-# Enumeration: ProviderStatus
-
-## Table of contents
-
-### Enumeration Members
-
-- [ErrorConnect](ProviderStatus.md#errorconnect)
-- [ErrorDisconnect](ProviderStatus.md#errordisconnect)
-- [ErrorSwitchNetwork](ProviderStatus.md#errorswitchnetwork)
-- [ErrorWalletSign](ProviderStatus.md#errorwalletsign)
-- [SuccessConnect](ProviderStatus.md#successconnect)
-- [SuccessDisconnect](ProviderStatus.md#successdisconnect)
-- [SuccessSwitchNetwork](ProviderStatus.md#successswitchnetwork)
-- [SuccessWalletSign](ProviderStatus.md#successwalletsign)
-
-## Enumeration Members
-
-### ErrorConnect
-
-• **ErrorConnect** = ``"ErrorConnect"``
-
-#### Defined in
-
-[types.ts:31](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L31)
-
-___
-
-### ErrorDisconnect
-
-• **ErrorDisconnect** = ``"ErrorDisconnect"``
-
-#### Defined in
-
-[types.ts:33](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L33)
-
-___
-
-### ErrorSwitchNetwork
-
-• **ErrorSwitchNetwork** = ``"ErrorSwitchNetwork"``
-
-#### Defined in
-
-[types.ts:35](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L35)
-
-___
-
-### ErrorWalletSign
-
-• **ErrorWalletSign** = ``"ErrorWalletSign"``
-
-#### Defined in
-
-[types.ts:37](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L37)
-
-___
-
-### SuccessConnect
-
-• **SuccessConnect** = ``"SuccessConnect"``
-
-#### Defined in
-
-[types.ts:30](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L30)
-
-___
-
-### SuccessDisconnect
-
-• **SuccessDisconnect** = ``"SuccessDisconnect"``
-
-#### Defined in
-
-[types.ts:32](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L32)
-
-___
-
-### SuccessSwitchNetwork
-
-• **SuccessSwitchNetwork** = ``"SuccessSwitchNetwork"``
-
-#### Defined in
-
-[types.ts:34](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L34)
-
-___
-
-### SuccessWalletSign
-
-• **SuccessWalletSign** = ``"SuccessWalletSign"``
-
-#### Defined in
-
-[types.ts:36](https://github.com/nevermined-io/react-components/blob/6de295e/providers/src/types.ts#L36)
diff --git a/docs/tutorials/assets.md b/docs/tutorials/assets.md
index 72a74930fa..e9858d7ef5 100644
--- a/docs/tutorials/assets.md
+++ b/docs/tutorials/assets.md
@@ -3,10 +3,9 @@ sidebar_position: 4
description: Building a DApp using Nevermined frameworks 2
---
-
# How to create and consume your first assets in a React application integrated with Nevermined
-Following with our series, this is going to continue showing how to unblock Nevermined features using [Nevermined Components](https://github.com/nevermined-io/react-components).
+Following with our series, this is going to continue showing how to unblock Nevermined features using our [SDK](../nevermined-sdk/intro).
## Prerequisites
@@ -15,19 +14,17 @@ The tutorial assumes your familiarity with blockchain, and general programming.
### For all the assets type
Import the provider in your index.tsx from the Catalog is needed in order to start to develop.
- *Note that our application is growing and now has some routes in order to handle properly endpoints.*
+_Note that our application is growing and now has some routes in order to handle properly endpoints._
```tsx
-
-
-
-
-
-
-
+
+
+
+
+
+
+
```
@@ -36,7 +33,7 @@ Import the provider in your index.tsx from the Catalog is needed in order to sta
This section will guide you to the creation of your first Nevermined asset.
1. Import the function from the AssetService.
-
+
```typescript
import { AssetService } from '@nevermined-io/catalog'
@@ -91,57 +88,57 @@ const Publisher = () => {
#### The complete example
```tsx
-
const Publisher = () => {
- const { publishAsset, assetPublish, setAssetPublish } = AssetService.useAssetPublish()
- const { isLoadingSDK } = Catalog.useNevermined()
-
- const metadata: MetaData = {
- main: {
- name: '',
- files: [{
- index: 0,
- contentType: 'application/json',
- url: 'https://uploads5.wikiart.org/00268/images/william-holbrook-beard/the-bear-dance-1870.jpg'
- }],
- type: 'dataset',
- author: '',
- license: '',
- dateCreated: new Date().toISOString(),
- }
- }
-
- async function handleOnSubmit() {
- const assetAttributes = AssetAttributes.getInstance({
- metadata,
- })
- const ddo = await publishAsset({
- assetAttributes,
- })
+ const { publishAsset, assetPublish, setAssetPublish } = AssetService.useAssetPublish()
+ const { isLoadingSDK } = Catalog.useNevermined()
+
+ const metadata: MetaData = {
+ main: {
+ name: '',
+ files: [
+ {
+ index: 0,
+ contentType: 'application/json',
+ url: 'https://uploads5.wikiart.org/00268/images/william-holbrook-beard/the-bear-dance-1870.jpg',
+ },
+ ],
+ type: 'dataset',
+ author: '',
+ license: '',
+ dateCreated: new Date().toISOString(),
+ },
+ }
+
+ async function handleOnSubmit() {
+ const assetAttributes = AssetAttributes.getInstance({
+ metadata,
+ })
+ const ddo = await publishAsset({
+ assetAttributes,
+ })
- setDidDeployed(ddo!.id)
- }
+ setDidDeployed(ddo!.id)
+ }
- return (
-
-
-
- )
+ return (
+
+
+
+ )
}
-
```
### How to consume an asset
This section will show how to consume an asset already published using Nevermined.
-1. Create and component that accept as parameter a [ddo](../nevermined-sdk/api-reference/classes/DDO.md) and import from the Catalog all the functionalities needed for this purpose
+1. Create and component that accept as parameter a [ddo](../nevermined-sdk/api-reference/classes/DDO.md) and import from the Catalog all the functionalities needed for this purpose
```ts
import { AssetService } from '@nevermined-io/catalog-core'
-
+
const Consumer = ({ddo}: {ddo: DDO}) => {
const { assets, account, sdk } = Catalog.useNevermined()
@@ -150,8 +147,8 @@ const Consumer = ({ddo}: {ddo: DDO}) => {
```
2. You need to check if you are the owner of the asset, if it is the case you don't need to buy before to consume it
-otherwise you will need to buy first, then in this point you need an `useEffect` that check it every time that the wallet
-changes the account and when the asset is bought in order to avoid buy again
+ otherwise you will need to buy first, then in this point you need an `useEffect` that check it every time that the wallet
+ changes the account and when the asset is bought in order to avoid buy again
```typescript
...
@@ -186,52 +183,52 @@ changes the account and when the asset is bought in order to avoid buy again
#### The complete example
```tsx
-const Consumer = ({ddo}: {ddo: DDO}) => {
- const { assets, account, isLoadingSDK, sdk } = Catalog.useNevermined()
- const { walletAddress } = useWallet()
- const [ownAsset, setOwnAsset] = useState(false)
- const [isBought, setIsBought] = useState(false)
- const [owner, setOwner] = useState('')
-
- useEffect(() => {
- (async () => {
- setOwnAsset(await account.isAssetHolder(ddo.id, walletAddress))
- setOwner(await sdk.assets.owner(ddo.id))
- })()
- }, [walletAddress, isBought])
-
- const buy = async () => {
- const response = await assets.orderAsset(did)
- setIsBought(Boolean(response))
- }
-
- const download = async () => {
- await assets.downloadAsset({ did: ddo.id })
- }
-
- return (
-
- {ownAsset ? (
-
- ) : (
- owner !== walletAddress ?
-
- : The owner cannot buy, please change the account to buy the asset
- )}
-
+ {ownAsset ? (
+
+ ) : owner !== walletAddress ? (
+
+ ) : (
+ The owner cannot buy, please change the account to buy the asset
+ )}
+
+ )
+}
```
:::info
What is an NFT?
-An NFT non-fungible-token is a token that represents the value of any digital asset that lives on the blockchain. Currently there are two major standards ERC721 and ERC1155
+An NFT non-fungible-token is a token that represents the value of any digital asset that lives on the blockchain. Currently there are two major standards ERC721 and ERC1155
:::
@@ -243,9 +240,8 @@ This section will guide you to the creation of your first Nevermined NFT ERC721.
First you need to deploy the contract address of the nft ERC-721, you can use the `cli` for it, [see more here](../cli/using-cli.md#nfts)
-
1. Import the function from the AssetService and the contract NFT token address, also we will need the sdk.
-
+
```typescript
import { AssetService } from '@nevermined-io/catalog-core'
@@ -307,66 +303,67 @@ const Publisher = () => {
```tsx
import { AssetService } from '@nevermined-io/catalog-core'
import { NFTTokenAddress } from './config'
-
-const Publisher = () => {
- const { publishNFT721, assetPublish, setAssetPublish } = AssetService.useAssetPublish()
- const { sdk } = Catalog.useNevermined()
- const metadata: MetaData = {
- main: {
- name: '',
- files: [{
- index: 0,
- contentType: 'application/json',
- url: 'https://uploads5.wikiart.org/00268/images/william-holbrook-beard/the-bear-dance-1870.jpg'
- }],
- type: 'dataset',
- author: '',
- license: '',
- dateCreated: new Date().toISOString(),
- }
- }
-
- const royaltyAttributes = {
- royaltyKind: RoyaltyKind.Standard,
- scheme: getRoyaltyScheme(sdk, RoyaltyKind.Standard),
- amount: 0,
- }
-
- const nftAttributes = NFTAttributes.getNFT721Instance({
- metadata,
- providers: [appConfig.neverminedNodeAddress],
- royaltyAttributes,
+const Publisher = () => {
+ const { publishNFT721, assetPublish, setAssetPublish } = AssetService.useAssetPublish()
+ const { sdk } = Catalog.useNevermined()
+
+ const metadata: MetaData = {
+ main: {
+ name: '',
+ files: [
+ {
+ index: 0,
+ contentType: 'application/json',
+ url: 'https://uploads5.wikiart.org/00268/images/william-holbrook-beard/the-bear-dance-1870.jpg',
+ },
+ ],
+ type: 'dataset',
+ author: '',
+ license: '',
+ dateCreated: new Date().toISOString(),
+ },
+ }
+
+ const royaltyAttributes = {
+ royaltyKind: RoyaltyKind.Standard,
+ scheme: getRoyaltyScheme(sdk, RoyaltyKind.Standard),
+ amount: 0,
+ }
+
+ const nftAttributes = NFTAttributes.getNFT721Instance({
+ metadata,
+ providers: [appConfig.neverminedNodeAddress],
+ royaltyAttributes,
+ })
+
+ async function handleOnSubmit() {
+ const ddo = await publishNFT721({
+ nftAttributes,
})
-
- async function handleOnSubmit() {
- const ddo = await publishNFT721({
- nftAttributes
- })
- setDidDeployed(ddo.id)
- }
-
- return (
-
-
-
- )
+ setDidDeployed(ddo.id)
+ }
+
+ return (
+
+
+
+ )
}
-
```
### How to consume an NFT ERC721
This section will show how to consume an asset already published using Nevermined.
-1. Create and component that accept as parameter a [ddo](../nevermined-sdk/api-reference/classes/DDO.md) and import from the Catalog all the functionalities needed for this purpose
+1. Create and component that accept as parameter a [ddo](../nevermined-sdk/api-reference/classes/DDO.md) and import from the Catalog all the functionalities needed for this purpose
```ts
import { AssetService } from '@nevermined-io/catalog-core'
import { NFTTokenAddress } from './config'
-
+
const Consumer = ({ddo}: {ddo: DDO}) => {
const { assets, account, sdk } = Catalog.useNevermined()
@@ -375,8 +372,8 @@ const Consumer = ({ddo}: {ddo: DDO}) => {
```
2. You need to check if you are the owner of the NFT721, if it is the case you don't need to buy before to consume it
-otherwise you will need to buy first, then in this point you need an `useEffect` that check it every time that the wallet
-changes the account and when the asset is bought in order to avoid buy again
+ otherwise you will need to buy first, then in this point you need an `useEffect` that check it every time that the wallet
+ changes the account and when the asset is bought in order to avoid buy again
```typescript
...
@@ -410,7 +407,7 @@ changes the account and when the asset is bought in order to avoid buy again
}
const download = async () => {
- await assets.downloadNFT({
+ await assets.downloadNFT({
did: ddo.id,
ercType: 721,
})
@@ -420,60 +417,61 @@ changes the account and when the asset is bought in order to avoid buy again
#### The complete example
```tsx
-const Consumer = ({ddo}: {ddo: DDO}) => {
- const { assets, account, isLoadingSDK, nfts, sdk } = Catalog.useNevermined()
- const { walletAddress } = useWallet()
- const [ownNFT721, setOwnNFT721] = useState(false)
- const [isBought, setIsBought] = useState(false)
- const [owner, setOwner] = useState('')
-
- useEffect(() => {
- (async () => {
- setOwnNFT721(await account.isNFT721Holder(ddo.id, walletAddress))
- setOwner(await sdk.nft721.ownerOf(ddo.id))
- })()
- }, [walletAddress, isBought])
-
- const buy = async () => {
- const response = await nfts.access({
- did: ddo.id,
- nftHolder: owner,
- nftAmount: 1,
- ercType: 721
- })
- setIsBought(Boolean(response))
- }
-
- const download = async () => {
- await assets.downloadNFT({
- did: ddo.id,
- ercType: 721,
- })
- }
+const Consumer = ({ ddo }: { ddo: DDO }) => {
+ const { assets, account, isLoadingSDK, nfts, sdk } = Catalog.useNevermined()
+ const { walletAddress } = useWallet()
+ const [ownNFT721, setOwnNFT721] = useState(false)
+ const [isBought, setIsBought] = useState(false)
+ const [owner, setOwner] = useState('')
+
+ useEffect(() => {
+ ;(async () => {
+ setOwnNFT721(await account.isNFT721Holder(ddo.id, walletAddress))
+ setOwner(await sdk.nft721.ownerOf(ddo.id))
+ })()
+ }, [walletAddress, isBought])
+
+ const buy = async () => {
+ const response = await nfts.access({
+ did: ddo.id,
+ nftHolder: owner,
+ nftAmount: 1,
+ ercType: 721,
+ })
+ setIsBought(Boolean(response))
+ }
- return (
-
- {ownNFT721 ? (
-
- ) : (
- owner !== walletAddress ?
-
- : The owner cannot buy, please change the account to buy the NFT asset
- )}
-
+ {ownNFT721 ? (
+
+ ) : owner !== walletAddress ? (
+
+ ) : (
+ The owner cannot buy, please change the account to buy the NFT asset
+ )}
+
+ )
+}
```
### How to create an NFT ERC1155
+
This section will guide you to the creation of your first Nevermined NFT ERC1155 asset.
1. Import the functions from the AssetService and the sdk.
-
+
```typescript
import { AssetService } from '@nevermined-io/catalog-core'
@@ -536,7 +534,7 @@ const Publisher = () => {
#### The complete example
```tsx
-
+
const Publisher = () => {
const { publishAsset, assetPublish, setAssetPublish } = AssetService.useAssetPublish()
const { isLoadingSDK, sdk } = Catalog.useNevermined()
@@ -590,11 +588,11 @@ const Publisher = () => {
This section will show how to consume an NFT1155 already published using Nevermined.
-1. Create and component that accept as parameter a [ddo](../nevermined-sdk/api-reference/classes/DDO.md) and import from the Catalog all the functionalities needed for this purpose
+1. Create and component that accept as parameter a [ddo](../nevermined-sdk/api-reference/classes/DDO.md) and import from the Catalog all the functionalities needed for this purpose
```ts
import { AssetService } from '@nevermined-io/catalog-core'
-
+
const Consumer = ({ddo}: {ddo: DDO}) => {
const { assets, account, sdk } = Catalog.useNevermined()
@@ -603,8 +601,8 @@ const Consumer = ({ddo}: {ddo: DDO}) => {
```
2. You need to check if you are the owner of the NFT1155, if it is the case you don't need to buy before to consume it
-otherwise you will need to buy first, then in this point you need an `useEffect` that check it every time that the wallet
-changes the account and when the NFT1155 is bought in order to avoid buy again
+ otherwise you will need to buy first, then in this point you need an `useEffect` that check it every time that the wallet
+ changes the account and when the NFT1155 is bought in order to avoid buy again
```typescript
...
@@ -628,9 +626,9 @@ changes the account and when the NFT1155 is bought in order to avoid buy again
...
const buy = async () => {
const response = await nfts.access({
- did:ddo.id,
- nftHolder: owner,
- nftAmount: BigNumber(1),
+ did:ddo.id,
+ nftHolder: owner,
+ nftAmount: BigNumber(1),
ercType: 1155,
)
setIsBought(Boolean(response))
@@ -650,7 +648,7 @@ const Consumer = ({ddo}: {ddo: DDO}) => {
const [ownNFT1155, setOwnNF1155] = useState(false)
const [isBought, setIsBought] = useState(false)
const [owner, setOwner] = useState('')
-
+
useEffect(() => {
(async () => {
setOwnNFT1155(await account.isNFT1155Holder(ddo.id, walletAddress))
@@ -660,9 +658,9 @@ const Consumer = ({ddo}: {ddo: DDO}) => {
const buy = async () => {
const response = await nfts.access({
- did:ddo.id,
- nftHolder: owner,
- nftAmount: BigNumber(1),
+ did:ddo.id,
+ nftHolder: owner,
+ nftAmount: BigNumber(1),
ercType: 1155,
)
@@ -690,5 +688,5 @@ const Consumer = ({ddo}: {ddo: DDO}) => {
)}
)
-}
+}
```
diff --git a/docs/tutorials/build-first-react.md b/docs/tutorials/build-first-react.md
index 12cf1a0fb7..d78cf6af60 100644
--- a/docs/tutorials/build-first-react.md
+++ b/docs/tutorials/build-first-react.md
@@ -5,7 +5,7 @@ description: Building a DApp using Nevermined frameworks
# How to build a React application integrated with Nevermined
-The idea of this tutorial is to give a quick go through about using the [Nevermined React Components](https://github.com/nevermined-io/react-components) of React components to support the development of dApps using the Nevermined environment. Nevermined Catalog is a library that provides some React components to make it easier the integration with Nevermined technologies. You can find more info in the [documentation](../react-components/intro.md).
+The idea of this tutorial is to give a quick go through about using the [SDK](../nevermined-sdk/intro) to support the development of dApps using the Nevermined environment.
## Prerequisites
@@ -24,7 +24,7 @@ Instructions for following along locally using your preferred text editor.
5. Run `yarn run start` and open and you will see the progress.

-*Screenshot of the current application status.*
+_Screenshot of the current application status._
### Create your Nevermined dApp
@@ -40,64 +40,72 @@ For the `REACT_APP_NODE_URI` you can connect to a [QuickNode](https://www.quickn
:::
```ts
-import { Config } from '@nevermined-io/nevermined-sdk-js';
+import { Config } from '@nevermined-io/nevermined-sdk-js'
// URL where run the app
-export const serviceUri = process.env.REACT_APP_SERVICE_URI || 'http://localhost:3445';
+export const serviceUri = process.env.REACT_APP_SERVICE_URI || 'http://localhost:3445'
// Ethereum address own by the node.
-export const neverminedNodeAddress = process.env.REACT_APP_GATEWAY_ADDRESS || '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc';
+export const neverminedNodeAddress =
+ process.env.REACT_APP_GATEWAY_ADDRESS || '0x5838B5512cF9f12FE9f2beccB20eb47211F9B0bc'
// Node service
-export const neverminedNodeUri = process.env.REACT_APP_GATEWAY_URI || 'https://node.mumbai.public.nevermined.network';
+export const neverminedNodeUri =
+ process.env.REACT_APP_GATEWAY_URI || 'https://node.mumbai.public.nevermined.network'
// Fauce uri to get some tokens.
-export const faucetUri = process.env.REACT_APPREACT_APP_FAUCET_URI_FAUCET_URI || 'https://faucet.mumbai.public.nevermined.network';
+export const faucetUri =
+ process.env.REACT_APPREACT_APP_FAUCET_URI_FAUCET_URI ||
+ 'https://faucet.mumbai.public.nevermined.network'
// Blockchain node
-export const web3ProviderUri = process.env.REACT_APP_NODE_URI || 'https://matic-mumbai.chainstacklabs.com';
+export const web3ProviderUri =
+ process.env.REACT_APP_NODE_URI || 'https://matic-mumbai.chainstacklabs.com'
// Chain id of your network
-export const acceptedChainId = process.env.REACT_APP_ACCEPTED_CHAIN_ID || '80001'; // for Mumbai
+export const acceptedChainId = process.env.REACT_APP_ACCEPTED_CHAIN_ID || '80001' // for Mumbai
//URL where run the root of the app is. Important to find public folder with abis.
-export const rootUri = process.env.REACT_APP_ROOT_URI || 'http://localhost:3445';
+export const rootUri = process.env.REACT_APP_ROOT_URI || 'http://localhost:3445'
// Marketplace API uri to store metadata.
-export const marketplaceUri = process.env.REACT_APP_MARKETPLACE_URI || 'https://marketplace-api.mumbai.public.nevermined.network';
+export const marketplaceUri =
+ process.env.REACT_APP_MARKETPLACE_URI ||
+ 'https://marketplace-api.mumbai.public.nevermined.network'
export const appConfig: Config = {
//@ts-ignore
- web3Provider: typeof window !== 'undefined' ? window.ethereum : new ethers.providers.JsonRpcProvider(web3ProviderUri),
+ web3Provider:
+ typeof window !== 'undefined'
+ ? window.ethereum
+ : new ethers.providers.JsonRpcProvider(web3ProviderUri),
web3ProviderUri,
neverminedNodeUri,
faucetUri,
verbose: 2,
neverminedNodeAddress,
graphHttpUri: '',
- marketplaceAuthToken: typeof window !== 'undefined' ? AuthToken.fetchMarketplaceApiTokenFromLocalStorage().token : '',
+ marketplaceAuthToken:
+ typeof window !== 'undefined' ? AuthToken.fetchMarketplaceApiTokenFromLocalStorage().token : '',
marketplaceUri,
artifactsFolder: `${rootUri}/contracts`,
-};
-
+}
```
3. Go to `index.tsx` and add the `NeverminedProvider`
```tsx
-import React from 'react';
-import ReactDOM from 'react-dom/client';
-import './index.css';
-import App from './App';
-import reportWebVitals from './reportWebVitals';
-import { Catalog } from '@nevermined-io/catalog';
-import { appConfig } from './config';
-
-const root = ReactDOM.createRoot(
- document.getElementById('root') as HTMLElement
-);
+import React from 'react'
+import ReactDOM from 'react-dom/client'
+import './index.css'
+import App from './App'
+import reportWebVitals from './reportWebVitals'
+import { Catalog } from '@nevermined-io/catalog'
+import { appConfig } from './config'
+
+const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
-
-);
+ ,
+)
-reportWebVitals();
+reportWebVitals()
```
4. After that you will be able to iteract with the Nevermined ecosystem. List did assets deployed updating your `App.tsx`
@@ -107,28 +115,29 @@ import { AssetService } from '@nevermined-io/catalog'
import React, { useEffect, useState } from 'react'
function App() {
-
const response = await assetsModule.query({
query: {
bool: {
- must: [{
- nested: {
- path: ['service'],
- query: {
- "query_string": {
- query: 'NFT*',
- fields: ["service.attributes.main.name"]
+ must: [
+ {
+ nested: {
+ path: ['service'],
+ query: {
+ query_string: {
+ query: 'NFT*',
+ fields: ['service.attributes.main.name'],
+ },
},
},
- }
- }]
- }
+ },
+ ],
+ },
},
offset: 150,
page: 1,
sort: {
- created: 'desc'
- }
+ created: 'desc',
+ },
})
const MultipleAssets = () => {
@@ -136,15 +145,15 @@ function App() {
const [dids, setDids] = useState()
useEffect(() => {
- setDids(result?.results?.map(asset => asset.id))
+ setDids(result?.results?.map((asset) => asset.id))
}, [result])
- const [filterQuery, setQuery] = useState("")
+ const [filterQuery, setQuery] = useState('')
function filterItems(query: string) {
- setQuery(query)
- setDids(result?.results?.map(asset => asset.id)?.filter(item => item.includes(query)))
- }
+ setQuery(query)
+ setDids(result?.results?.map((asset) => asset.id)?.filter((item) => item.includes(query)))
+ }
return (
<>
@@ -159,21 +168,25 @@ function App() {
/>
{!walletAddress ?
- getConnectors().map(c =>
+ getConnectors().map(c =>
)
:
@@ -229,4 +242,3 @@ const Login = () => {
}
export default App;
```
-
diff --git a/docs/tutorials/login-wallet-provider.md b/docs/tutorials/login-wallet-provider.md
index 1d57fbd7d5..aebb8d6045 100644
--- a/docs/tutorials/login-wallet-provider.md
+++ b/docs/tutorials/login-wallet-provider.md
@@ -8,16 +8,17 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Login with Wallet Provider
+
In this tutorial you will learn how you can integrate Wallet Provider from the Catalog in your dapp and implement operations like login and logout
## Requirements
+
For the tutorial you will need:
- A extension of [Metamask](https://metamask.io/) installed in the browser
- [node](https://nodejs.org/en/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) need to be installed
## How to install Catalog Provider
-Firstable to install [Catalog Provider](../react-components/providers/README.md) you just need to run:
@@ -32,71 +33,85 @@ yarn add @nevermined-io/catalog-providers
```bash
npm install --save @nevermined-io/providers
```
+
## Add the wallet provider
+
Now in our app we need to add the Wallet Provider as a parent of all the components that will use functionalities from it. The `WalletProvider` has a prop call `client` where we need to pass the instance of the [Wagmi client](https://wagmi.sh/docs/client), the good news is that we have `getClient` from `@nevermined-io/providers` which will return a client already configured.
Optionally we can pass the `correctNetworkId` which will request to the wallet to change to the set network when the current one is not supported, and `connectKitProps` that includes all the customization option of `ConnectKit`, see options [here](https://docs.family.co/connectkit/customization)
```tsx
-import React from 'react';
-import ReactDOM from 'react-dom';
-import Example from 'examples';
-import { WalletProvider } from '@nevermined-io/providers';
+import React from 'react'
+import ReactDOM from 'react-dom'
+import Example from 'examples'
+import { WalletProvider } from '@nevermined-io/providers'
ReactDOM.render(
-
-
-
-
-
,
- document.getElementById("root") as HTMLElement
-);
+
+
+
+
+
,
+ document.getElementById('root') as HTMLElement,
+)
```
## Add login component
+
Let's create a component that contains a login button for each provider, and other button to logout.
```tsx
const Login = () => {
- const { login, walletAddress, logout, getConnectors} = useWallet()
+ const { login, walletAddress, logout, getConnectors } = useWallet()
return (
)
}
```
+
In this component we have the `login` and `logout` functions and the `walletAddress` state, if `walletAddress` is not empty means that the wallet is connected and will show the address and logout button otherwise will show the button to connect.
How you can see, we also have `getConnectors` which includes all the providers available to connect.
## Config your network (optional)
+
At least that you need to set differents networks for your dapp than [polygon](https://polygon.technology/) chains config is not needed, anyway here we show you how should look the config object.
```ts
@@ -105,24 +120,25 @@ const ChainsConfig: Chain[] = [
Wagmi.chain.polygonMumbai,
{
id: 1337,
- name: "Localhost development",
- network: "spree",
+ name: 'Localhost development',
+ network: 'spree',
nativeCurrency: {
- name: "Ethereum",
- symbol: "ETH",
+ name: 'Ethereum',
+ symbol: 'ETH',
decimals: 18,
},
rpcUrls: {
- default: "http://localhost:8545"
+ default: 'http://localhost:8545',
},
- testnet: true
+ testnet: true,
},
]
-export default ChainConfig;
+export default ChainConfig
```
## Lets put everything together
+
In order to finish we need to call this component inside of the providers, this is the complete example
```tsx
@@ -138,64 +154,73 @@ const ChainsConfig: Chain[] = [
Wagmi.chain.polygonMumbai,
{
id: 1337,
- name: "Localhost development",
- network: "spree",
+ name: 'Localhost development',
+ network: 'spree',
nativeCurrency: {
- name: "Ethereum",
- symbol: "ETH",
+ name: 'Ethereum',
+ symbol: 'ETH',
decimals: 18,
},
rpcUrls: {
- default: "http://localhost:8545"
+ default: 'http://localhost:8545',
},
- testnet: true
+ testnet: true,
},
]
const Login = () => {
- const { login, walletAddress, logout, getConnectors} = useWallet()
+ const { login, walletAddress, logout, getConnectors } = useWallet()
return (
,
- document.getElementById("root") as HTMLElement
-);
+
+
+
+
+
,
+ document.getElementById('root') as HTMLElement,
+)
```
## Demo
-
\ No newline at end of file
+
diff --git a/docs/tutorials/query-assets-catalog.md b/docs/tutorials/query-assets-catalog.md
index 239f1196fd..5423e6b0e7 100644
--- a/docs/tutorials/query-assets-catalog.md
+++ b/docs/tutorials/query-assets-catalog.md
@@ -8,7 +8,11 @@ import QueryAssets from '@site/src/components/queryAssets';
# How to query assets with Catalog
-With Catalog is possible to search specific assets by using the [`query`](../react-components/catalog/API/interfaces/AssetsModule.md#query) method from [`AssetsModule`](../react-components/catalog/API/interfaces/AssetsModule.md). Here there are some examples to show how to use it
+:::caution
+
+Update this section
+
+:::
## Search by asset name
@@ -45,13 +49,13 @@ const QuerySearchByName = (): => {
});
setDdos(response.results || []);
-
+
};
return (
<>
- onSearchByName(e.target.value)}/>
@@ -80,42 +84,47 @@ const QuerySearchByName = (): => {
### Demo
Loading search assets by name...