diff --git a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (1).png b/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (1).png
deleted file mode 100644
index c99a54ac..00000000
Binary files a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (1).png and /dev/null differ
diff --git a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (2).png b/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (2).png
deleted file mode 100644
index c99a54ac..00000000
Binary files a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (2).png and /dev/null differ
diff --git a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (3).png b/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (3).png
deleted file mode 100644
index c99a54ac..00000000
Binary files a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (3).png and /dev/null differ
diff --git a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2).png b/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2).png
deleted file mode 100644
index c99a54ac..00000000
Binary files a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2).png and /dev/null differ
diff --git a/.gitbook/assets/whats-a-wallet (1).gif b/.gitbook/assets/show-wallet.gif
similarity index 100%
rename from .gitbook/assets/whats-a-wallet (1).gif
rename to .gitbook/assets/show-wallet.gif
diff --git a/README.md b/README.md
index 90b71a4d..2dffe2e3 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
---
description: Help for wherever you are on your Ocean Protocol journey.
-cover: .gitbook/assets/cover/contribute (1) (1).png
+cover: .gitbook/assets/cover/contribute (1).png
coverY: 0
layout: landing
---
diff --git a/SUMMARY.md b/SUMMARY.md
index a6efa9d1..6dd1a693 100644
--- a/SUMMARY.md
+++ b/SUMMARY.md
@@ -55,12 +55,13 @@
* [Install](developers/ocean.py/install.md)
* [Publish flow](developers/ocean.py/publish-flow.md)
* [Consume flow](developers/ocean.py/consume-flow.md)
- * [Ocean Libraries](developers/ocean-libraries/README.md)
- * [Configuration](developers/using-ocean-libraries/configuration.md)
- * [Creating a data NFT](developers/using-ocean-libraries/creating-datanft.md)
- * [Publish with Fixed Pricing](developers/using-ocean-libraries/create-datatoken-with-fixed-pricing.md)
- * [Mint Datatokens](developers/using-ocean-libraries/mint-datatoken.md)
- * [Update Metadata](developers/using-ocean-libraries/update-metadata.md)
+ * [Ocean.js](developers/ocean.js/README.md)
+ * [Configuration](developers/ocean.js/configuration.md)
+ * [Creating a data NFT](developers/ocean.js/creating-datanft.md)
+ * [Publish](developers/ocean.js/publish.md)
+ * [Mint Datatokens](developers/ocean.js/mint-datatoken.md)
+ * [Update Metadata](developers/ocean.js/update-metadata.md)
+ * [Remove Asset](developers/ocean.js/remove-asset.md)
* [Compute to data](developers/compute-to-data/README.md)
* [Architecture](developers/compute-to-data/compute-to-data-architecture.md)
* [Datasets & Algorithms](developers/compute-to-data/compute-to-data-datasets-algorithms.md)
diff --git a/developers/README.md b/developers/README.md
index 7095e61e..dae5e57f 100644
--- a/developers/README.md
+++ b/developers/README.md
@@ -15,7 +15,7 @@ Congratulations on making it this far! If you've arrived here, you're ready to e
With Ocean, crypto wallets transform into magical data wallets, where your data can roam freely and securely. Crypto exchanges? Well, they've taken on a new role as data marketplaces, where you can showcase and trade your valuable data treasures. And hold on tight because DAOs are here to create epic data co-ops, where collaboration and innovation reign supreme! 🤝
-But hold on tight, because we have even more in store for you! With Ocean Protocol, you gain access to a treasure trove of tools that will unlock your data scientist superpowers and allow you to unleash your creativity. Whether you're a Python aficionado or a JavaScript maestro, we have you covered with [ocean.py](ocean.py/) and [ocean.js](ocean-libraries/) libraries. So, get ready to dive into the depths of data innovation and create the next groundbreaking dAapp (that's a decentralized App, by the way) using [ocean.js's](ocean-libraries/) powerful capabilities or unleash your skills with [ocean.py](ocean.py/). It's time to shake up the data world like never before! 🌐🚀
+But hold on tight, because we have even more in store for you! With Ocean Protocol, you gain access to a treasure trove of tools that will unlock your data scientist superpowers and allow you to unleash your creativity. Whether you're a Python aficionado or a JavaScript maestro, we have you covered with [ocean.py](ocean.py/) and [ocean.js](broken-reference) libraries. So, get ready to dive into the depths of data innovation and create the next groundbreaking dAapp (that's a decentralized App, by the way) using [ocean.js's](broken-reference) powerful capabilities or unleash your skills with [ocean.py](ocean.py/). It's time to shake up the data world like never before! 🌐🚀
diff --git a/developers/architecture.md b/developers/architecture.md
index 0c76857b..c0faed55 100644
--- a/developers/architecture.md
+++ b/developers/architecture.md
@@ -21,9 +21,9 @@ Above the smart contracts, you'll find essential [libraries](architecture.md#lib
#### Libraries
-These libraries include [Ocean.js](ocean-libraries/), a JavaScript library, and [Ocean.py](ocean.py/), a Python library. They serve as powerful tools for developers, enabling integration and interaction with the protocol.
+These libraries include [Ocean.js](broken-reference), a JavaScript library, and [Ocean.py](ocean.py/), a Python library. They serve as powerful tools for developers, enabling integration and interaction with the protocol.
-1. [Ocean.js](ocean-libraries/): Ocean.js is a JavaScript library that serves as a powerful tool for developers looking to integrate their applications with the Ocean Protocol ecosystem. Designed to facilitate interaction with the protocol, Ocean.js provides a comprehensive set of functionalities, including data tokenization, asset management, and smart contract interaction. Ocean.js simplifies the process of implementing data access controls, building data marketplaces, and exploring data sets within a decentralized environment.
+1. [Ocean.js](broken-reference): Ocean.js is a JavaScript library that serves as a powerful tool for developers looking to integrate their applications with the Ocean Protocol ecosystem. Designed to facilitate interaction with the protocol, Ocean.js provides a comprehensive set of functionalities, including data tokenization, asset management, and smart contract interaction. Ocean.js simplifies the process of implementing data access controls, building data marketplaces, and exploring data sets within a decentralized environment.
2. [Ocean.py](ocean.py/): Ocean.py is a Python library that empowers developers to integrate their applications with the Ocean Protocol ecosystem. With its rich set of functionalities, Ocean.py provides a comprehensive toolkit for interacting with the protocol. Developers and [data scientists](../data-science/) can leverage Ocean.py to perform a wide range of tasks, including data tokenization, asset management, and smart contract interactions. This library serves as a bridge between Python and the decentralized world of Ocean Protocol, enabling you to harness the power of decentralized data.
#### Middleware components
diff --git a/developers/ocean-libraries/README.md b/developers/ocean-libraries/README.md
deleted file mode 100644
index de467b31..00000000
--- a/developers/ocean-libraries/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# Using Ocean Libraries
-
-Ocean Protocol officially supports two client libraries:
-
-* ocean.js
-* ocean.py
-
-| ocean.js | ocean.py |
-| -------------------------------------------------------------- | -------------------------------------------------------------- |
-| Written in Javascript | Written in Python |
-| [Source code](https://github.com/oceanprotocol/ocean.js) | [Source code](https://github.com/oceanprotocol/ocean.py) |
-| [Releases](https://github.com/oceanprotocol/ocean.js/releases) | [Releases](https://github.com/oceanprotocol/ocean.py/releases) |
-
-The tutorials in this section will guide you how to setup the required configuration and interact with Ocean Protocol's smart contracts, Aquarius and Provider using the supported libraries.
-
-Watch our **Ocean.py Playlist of video tutorials** here:
-
-{% embed url="https://www.youtube.com/playlist?list=PL_dn0wVs9kWoM-PMVt78Gkb7BFwlE_njK" %}
diff --git a/developers/ocean.js/README.md b/developers/ocean.js/README.md
new file mode 100644
index 00000000..228109ce
--- /dev/null
+++ b/developers/ocean.js/README.md
@@ -0,0 +1,15 @@
+---
+description: >-
+ JavaScript library to privately & securely publish, exchange, and consume
+ data.
+---
+
+# Ocean.js
+
+With ocean.js, you can:
+
+* **Publish** data services: downloadable files or compute-to-data. Create an ERC721 **data NFT** for each service, and ERC20 **datatoken** for access (1.0 datatokens to access).
+* **Sell** datatokens for a fixed price. Sell data NFTs.
+* **Transfer** data NFTs & datatokens.
+
+Ocean.js is part of the [Ocean Protocol](https://oceanprotocol.com) toolset.
diff --git a/developers/using-ocean-libraries/configuration.md b/developers/ocean.js/configuration.md
similarity index 57%
rename from developers/using-ocean-libraries/configuration.md
rename to developers/ocean.js/configuration.md
index fcd8edfa..c5cde6a8 100644
--- a/developers/using-ocean-libraries/configuration.md
+++ b/developers/ocean.js/configuration.md
@@ -28,7 +28,7 @@ In the working directory create a `.env` file. The content of this file will sto
| Variable name | Description | Required |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| **OCEAN\_NETWORK** | Name of the network where the Ocean Protocol's smart contracts are deployed. | Yes |
-| **OCEAN\_NETWORK\_URL** | The URL of the Ethereum node (along with API key for non-local networks) | Yes |
+| **OCEAN\_NETWORK\_URL** | The URL of the Ethereum node (along with API key for non-local networks)\*\* | Yes |
| **PRIVATE\_KEY** | The private key of the account which you want to use. A private key is made up of 64 hex characters. Make sure you have sufficient balance to pay for the transaction fees. | Yes |
| **AQUARIUS\_URL** | The URL of the Aquarius. This value is needed when reading an asset from off-chain store. | No |
| **PROVIDER\_URL** | The URL of the Provider. This value is needed when publishing a new asset or update an existing asset. | No |
@@ -52,7 +52,7 @@ PRIVATE_KEY=
# Optional environment variables
AQUARIUS_URL=https://v4.aquarius.oceanprotocol.com/
-PROVIDER_URL=https://v4.provider.mainnet.oceanprotocol.com
+PROVIDER_URL=https://v4.provider.oceanprotocol.com
```
{% endcode %}
{% endtab %}
@@ -69,7 +69,7 @@ PRIVATE_KEY=
# Optional environment variables
AQUARIUS_URL=https://v4.aquarius.oceanprotocol.com/
-PROVIDER_URL=https://v4.provider.polygon.oceanprotocol.com
+PROVIDER_URL=https://v4.provider.oceanprotocol.com
```
{% endcode %}
{% endtab %}
@@ -90,122 +90,102 @@ PRIVATE_KEY=0xc594c6e5def4bab63ac29eed19a134c130388f74f019bc74b8f4389df2837a58
{% endtab %}
{% endtabs %}
-_NOTE: If using ocean.py, additionally specify **ADDRESS\_FILE** variable in the `.env` file. Copy the content of this_ [_link_](https://github.com/oceanprotocol/contracts/blob/v4main/addresses/address.json) _locally and set the **ADDRESS\_FILE** so that its value is a correct file path._
+Replace `` with the appropriate values. \*\*You can see all the networks configuration on Oceanjs' [config helper](https://github.com/oceanprotocol/ocean.js/blob/main/src/config/ConfigHelper.ts#L42).
### Setup dependencies
-In this step the required dependencies will be installed.
+In this step all required dependencies will be installed.
+
+### Installation & Usage
+
+Let's install Oceanjs library into your current project by running:
{% tabs %}
-{% tab title="ocean.js" %}
+{% tab title="Terminal" %}
```bash
npm init
-npm install @oceanprotocol/lib@latest dotenv web3 @truffle/hdwallet-provider
-```
-{% endtab %}
-
-{% tab title="ocean.py" %}
-```bash
-python3 -m venv venv
-source venv/bin/activate
-pip install wheel
-
-# Install Ocean library. Allow pre-releases to get the latest v4 version.
-pip install ocean-lib
+npm i @oceanprotocol/lib@3.0.0-next.5 dotenv crypto-js ethers@5.7.4 @truffle/hdwallet-provider
```
{% endtab %}
{% endtabs %}
### Create a configuration file
-A configuration file will read the content of the `.env` file and initialize the required configuration objects which will be used in the further tutorials. The below scripts creates a Web3 wallet instance and a Ocean's configuration object.
+A configuration file will read the content of the `.env` file and initialize the required configuration objects which will be used in the further tutorials. The below scripts creates a Web3 wallet instance and an Ocean's configuration object.
Create the configuration file in the working directory i.e. at the same path where the `.env` is located.
{% tabs %}
-{% tab title="ocean.js" %}
+{% tab title="config.js" %}
{% code title="config.js" %}
```javascript
-// Import dependencies
require('dotenv').config();
-const HDWalletProvider = require('@truffle/hdwallet-provider');
-const fs = require('fs');
-const { homedir } = require('os');
-const { ConfigHelper } = require('@oceanprotocol/lib');
+const { Aquarius, ZERO_ADDRESS, ConfigHelper, configHelperNetworks } = require('@oceanprotocol/lib');
+const { providers } = require('ethers')
+const ethers = require('ethers');
+async function oceanConfig(){
-// Get configuration for the given network
-let oceanConfig = new ConfigHelper().getConfig(process.env.OCEAN_NETWORK);
+ // Get configuration for the given network
+ const provider = new providers.JsonRpcProvider(
+ process.env.OCEAN_NETWORK_URL || configHelperNetworks[1].nodeUri
+ )
-// If using local development environment, read the addresses from local file.
-// The local deployment address file can be generated using barge.
-if (process.env.OCEAN_NETWORK === 'development') {
- const addressData = JSON.parse(
- fs.readFileSync(
- process.env.ADDRESS_FILE
- || `${homedir}/.ocean/ocean-contracts/artifacts/address.json`,
- 'utf8'
- )
+ const ethersProvider = new ethers.Wallet(
+ process.env.PRIVATE_KEY,
+ provider
);
- const addresses = addressData[process.env.OCEAN_NETWORK];
+
+ const publisherAccount = await ethersProvider.provider.getSigner(ethersProvider.address);
+ const consumerAccount = publisherAccount
+ const stakerAccount = publisherAccount
+
+ let oceanConfig = new ConfigHelper().getConfig(
+ parseInt(String((await provider.getSigner(0).provider.getNetwork()).chainId))
+ )
+ const aquarius = new Aquarius(oceanConfig?.metadataCacheUri)
+
+ // If using local development environment, read the addresses from local file.
+ // The local deployment address file can be generated using barge.
+ if (process.env.OCEAN_NETWORK === 'development') {
+ const addresses = JSON.parse(
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
+ fs.readFileSync(
+ process.env.ADDRESS_FILE ||
+ `${homedir}/.ocean/ocean-contracts/artifacts/address.json`,
+ 'utf8'
+ )
+ ).development
+
+ oceanConfig = {
+ ...oceanConfig,
+ oceanTokenAddress: addresses.Ocean,
+ poolTemplateAddress: addresses.poolTemplate,
+ fixedRateExchangeAddress: addresses.FixedPrice,
+ dispenserAddress: addresses.Dispenser,
+ nftFactoryAddress: addresses.ERC721Factory,
+ sideStakingAddress: addresses.Staking,
+ opfCommunityFeeCollector: addresses.OPFCommunityFeeCollector
+ };
+ }
oceanConfig = {
...oceanConfig,
- oceanTokenAddress: addresses.Ocean,
- poolTemplateAddress: addresses.poolTemplate,
- fixedRateExchangeAddress: addresses.FixedPrice,
- dispenserAddress: addresses.Dispenser,
- erc721FactoryAddress: addresses.ERC721Factory,
- sideStakingAddress: addresses.Staking,
- opfCommunityFeeCollector: addresses.OPFCommunityFeeCollector
+ publisherAccount: publisherAccount,
+ consumerAccount: consumerAccount,
+ stakerAccount: stakerAccount,
+ aquarius: aquarius,
+ ethersProvider: ethersProvider,
};
-}
-oceanConfig = {
- ...oceanConfig,
- nodeUri: process.env.OCEAN_NETWORK_URL,
- // Set optional properties - Provider URL and Aquarius URL
- metadataCacheUri: process.env.AQUARIUS_URL || oceanConfig.metadataCacheUri,
- providerUri: process.env.PROVIDER_URL || oceanConfig.providerUri
+ return oceanConfig
};
-const web3Provider = new HDWalletProvider(
- process.env.PRIVATE_KEY,
- oceanConfig.nodeUri
-);
-
module.exports = {
- web3Provider,
oceanConfig
-};
-```
-{% endcode %}
-{% endtab %}
-
-{% tab title="ocean.py" %}
-{% code title="config.py" %}
-```python
-import os
-from dotenv import load_dotenv
-from ocean_lib.example_config import get_config_dict
-from ocean_lib.web3_internal.utils import connect_to_network
-from ocean_lib.ocean.ocean import Ocean
-
-load_dotenv()
-
-# Create Ocean instance
-network_name = os.getenv("OCEAN_NETWORK")
-connect_to_network(network_name)
-
-config = get_config_dict(network_name)
-ocean = Ocean(config)
-
-from brownie.network import accounts
-accounts.clear()
-user_private_key = os.getenv('PRIVATE_KEY')
-wallet = accounts.add(user_private_key)
+}
```
{% endcode %}
{% endtab %}
{% endtabs %}
-Now, all the dependencies are ready and you can proceed with interacting with Ocean infrastructure using Ocean libraries.
+Now you have set up the necessary files and configurations to interact with Ocean Protocol's smart contracts using ocean.js. You can proceed with further tutorials or development using these configurations.
diff --git a/developers/ocean.js/creating-datanft.md b/developers/ocean.js/creating-datanft.md
new file mode 100644
index 00000000..856edfc3
--- /dev/null
+++ b/developers/ocean.js/creating-datanft.md
@@ -0,0 +1,78 @@
+# Creating a data NFT
+
+This tutorial guides you through the process of creating your own data NFT using Ocean libraries. To know more about data NFT please refer [this page](../../core-concepts/datanft-and-datatoken.md).
+
+#### Prerequisites
+
+* [Obtain an API key](configuration.md)
+* [Set up the .env file](configuration.md)
+* [Install the dependencies](configuration.md)
+* [Create a configuration file](configuration.md)
+
+#### Create a script to deploy dataNFT
+
+The provided script demonstrates how to create a data NFT using Oceanjs.
+
+First, create a new file in the working directory, alongside the `config.js` and `.env` files. Name it `create_dataNFT.js` (or any appropriate name). Then, copy the following code into the new created file:
+
+{% tabs %}
+{% tab title="create_dataNFT.js" %}
+{% code title="create_dataNFT.js" %}
+```javascript
+// Note: Make sure .env file and config.js are created and setup correctly
+const { oceanConfig } = require('./config.js');
+const { ZERO_ADDRESS, NftFactory } = require ('@oceanprotocol/lib');
+
+// Deinfe a function which will create a dataNFT using Ocean.js library
+const createDataNFT = async () => {
+ let config = await oceanConfig();
+ // Create a NFTFactory
+ const factory = new NftFactory(config.nftFactoryAddress, config.publisherAccount);
+
+ const publisherAccount = await config.publisherAccount.getAddress();
+
+ // Define dataNFT parameters
+ const nftParams = {
+ name: '72120Bundle',
+ symbol: '72Bundle',
+ // Optional parameters
+ templateIndex: 1,
+ tokenURI: 'https://example.com',
+ transferable: true,
+ owner: publisherAccount
+ };
+
+ const bundleNFT = await factory.createNFT(nftParams);
+
+ const trxReceipt = await bundleNFT.wait()
+
+ return {
+ trxReceipt
+ };
+};
+
+// Call the create createDataNFT() function
+createDataNFT()
+ .then(({ nftAddress }) => {
+ console.log(`DataNft address ${nftAddress}`);
+ process.exit();
+ })
+ .catch((err) => {
+ console.error(err);
+ process.exit(1);
+ });
+```
+{% endcode %}
+
+Run script:
+
+```bash
+node create_dataNFT.js
+```
+{% endtab %}
+{% endtabs %}
+
+* Checkout our [code examples](https://github.com/oceanprotocol/ocean.js/blob/main/CodeExamples.md#L0-L1) or [compute to data examples](https://github.com/oceanprotocol/ocean.js/blob/main/ComputeExamples.md#L417) to see how you can use ocean.js.
+* If you have any difficulties or if you have further questions about how to use ocean.js please reach out to us on [Discord](https://discord.gg/TnXjkR5).
+* If you notice any bugs or issues with ocean.js please [open an issue on github](https://github.com/oceanprotocol/ocean.js/issues/new?assignees=\&labels=bug\&template=bug\_report.md\&title=).
+* Visit the [Ocean Protocol website](https://docs.oceanprotocol.com/) for general information about Ocean Protocol.
diff --git a/developers/ocean.js/mint-datatoken.md b/developers/ocean.js/mint-datatoken.md
new file mode 100644
index 00000000..dd9a839f
--- /dev/null
+++ b/developers/ocean.js/mint-datatoken.md
@@ -0,0 +1,85 @@
+# Mint Datatokens
+
+This tutorial guides you through the process of minting datatokens and sending them to a receiver address. The tutorial assumes that you already have the address of the datatoken contract which is owned by you.
+
+#### Prerequisites
+
+* [Obtain an API key](broken-reference)
+* [Set up the .env file](broken-reference)
+* [Install the dependencies](broken-reference)
+* [Create a configuration file](configuration.md)
+
+#### Create a script to mint datatokens
+
+Create a new file in the same working directory where configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
+
+{% tabs %}
+{% tab title="mint_datatoken.js" %}
+{% code title="mint_datatoken.js" %}
+```javascript
+// Note: Make sure .env file and config.js are created and setup correctly
+const { oceanConfig } = require('./config.js');
+const { amountToUnits } = require ('@oceanprotocol/lib');
+const ethers = require('ethers');
+
+// Define a function createFRE()
+const createMINT = async () => {
+
+ let config = await oceanConfig();
+ const publisher = config.publisherAccount
+ const publisherAccount = await config.publisherAccount.getAddress()
+
+ const minAbi = [
+ {
+ constant: false,
+ inputs: [
+ { name: 'to', type: 'address' },
+ { name: 'value', type: 'uint256' }
+ ],
+ name: 'mint',
+ outputs: [{ name: '', type: 'bool' }],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function'
+ }
+ ]
+
+ const tokenContract = new ethers.Contract(config.oceanTokenAddress, minAbi, publisher)
+ const estGasPublisher = await tokenContract.estimateGas.mint(
+ publisherAccount,
+ amountToUnits(null, null, '1000', 18)
+ )
+ const trxReceipt = await sendTx(
+ estGasPublisher,
+ publisher,
+ 1,
+ tokenContract.mint,
+ publisherAccount,
+ amountToUnits(null, null, '1000', 18)
+ )
+
+ return {
+ trxReceipt
+ };
+};
+
+// Call the createFRE() function
+createMINT()
+ .then(({ trxReceipt }) => {
+ console.log(`TX Receipt ${trxReceipt}`);
+ process.exit(1);
+ })
+ .catch((err) => {
+ console.error(err);
+ process.exit(1);
+ });
+```
+{% endcode %}
+
+**Execute script**
+
+```
+node mint_datatoken.js
+```
+{% endtab %}
+{% endtabs %}
diff --git a/developers/ocean.js/publish.md b/developers/ocean.js/publish.md
new file mode 100644
index 00000000..5d2e2e0f
--- /dev/null
+++ b/developers/ocean.js/publish.md
@@ -0,0 +1,190 @@
+# Publish
+
+This tutorial guides you through the process of creating your own data NFT and a datatoken using Ocean libraries. To know more about data NFTs and datatokens please refer [this page](../datanft-and-datatoken.md). Ocean Protocol supports different pricing schemes which can be set while publishing an asset. Please refer [this page](../asset-pricing.md) for more details on pricing schemes.
+
+#### Prerequisites
+
+* [Obtain an API key](broken-reference)
+* [Set up the .env file](broken-reference)
+* [Install the dependencies](broken-reference)
+* [Create a configuration file](configuration.md)
+
+#### Create a script to deploy a data NFT and datatoken with the price schema you chose.
+
+Create a new file in the same working directory where configuration file (`config.js`) and `.env` files are present, and copy the code as listed below.
+
+{% hint style="info" %}
+**Fees**: The code snippets below define fees related parameters. Please refer [fees page ](../../core-concepts/fees.md)for more details
+{% endhint %}
+
+The code utilizes methods such as `NftFactory` and `Datatoken` from the Ocean libraries to enable you to interact with the Ocean Protocol and perform various operations related to data NFTs and datatokens.
+
+The `createFRE()` performs the following:
+
+1. Creates a web3 instance with [Web3](https://web3js.readthedocs.io/en/v1.10.0/).
+2. Retrieves the accounts from the web3 instance and sets the publisher.
+3. Defines parameters for the data NFT, including name, symbol, template index, token URI, transferability, and owner.
+4. Defines parameters for the datatoken, including name, symbol, template index, cap, fee amount, payment collector address, fee token address, minter, and multi-party fee address.
+5. Defines parameters for the price schema, including the fixed rate address, base token address, owner, market fee collector, base token decimals, datatoken decimals, fixed rate, market fee, and optional parameters.
+6. Uses the NftFactory to create a data NFT and datatoken with the fixed rate exchange, using the specified parameters.
+7. Retrieves the addresses of the data NFT and datatoken from the result.
+8. Returns the data NFT and datatoken addresses.
+
+{% tabs %}
+{% tab title="create_datatoken_with_fre.js" %}
+{% code title="create_datatoken_with_fre.js" %}
+```javascript
+// Note: Make sure .env file and config.js are created and setup correctly
+const { oceanConfig } = require('./config.js');
+const { ZERO_ADDRESS, NftFactory } = require ('@oceanprotocol/lib');
+
+// Define a function createFRE()
+const createFRE = async () => {
+
+ const FRE_NFT_NAME = 'Datatoken 2'
+ const FRE_NFT_SYMBOL = 'DT2'
+
+ let config = await oceanConfig();
+
+ // Create a NFTFactory
+ const factory = new NftFactory(config.nftFactoryAddress, config.publisherAccount);
+
+ const nftParams = {
+ name: FRE_NFT_NAME,
+ symbol: FRE_NFT_SYMBOL,
+ templateIndex: 1,
+ tokenURI: '',
+ transferable: true,
+ owner: await config.publisherAccount.getAddress()
+ }
+
+ const datatokenParams = {
+ templateIndex: 1,
+ cap: '100000',
+ feeAmount: '0',
+ paymentCollector: ZERO_ADDRESS,
+ feeToken: ZERO_ADDRESS,
+ minter: await config.publisherAccount.getAddress(),
+ mpFeeAddress: ZERO_ADDRESS
+ }
+
+ const freParams = {
+ fixedRateAddress: config.fixedRateExchangeAddress,
+ baseTokenAddress: config.oceanTokenAddress,
+ owner: await config.publisherAccount.getAddress(),
+ marketFeeCollector: await config.publisherAccount.getAddress(),
+ baseTokenDecimals: 18,
+ datatokenDecimals: 18,
+ fixedRate: '1',
+ marketFee: '0.001',
+ allowedConsumer: ZERO_ADDRESS,
+ withMint: true
+ }
+
+ const bundleNFT = await factory.createNftWithDatatokenWithFixedRate(
+ nftParams,
+ datatokenParams,
+ freParams
+ )
+
+ const trxReceipt = await bundleNFT.wait()
+
+ return {
+ trxReceipt
+ };
+};
+
+// Call the createFRE() function
+createFRE()
+ .then(({ trxReceipt }) => {
+ console.log(`TX Receipt ${trxReceipt}`);
+ process.exit(1);
+ })
+ .catch((err) => {
+ console.error(err);
+ process.exit(1);
+ });
+```
+{% endcode %}
+
+Execute script
+
+```
+node create_datatoken_with_fre.js
+```
+{% endtab %}
+
+{% tab title="create_datatoken_with_free.js" %}
+{% code title="create_datatoken_with_free.js" %}
+```javascript
+// Note: Make sure .env file and config.js are created and setup correctly
+const { oceanConfig } = require('./config.js');
+const { ZERO_ADDRESS, NftFactory } = require ('@oceanprotocol/lib');
+
+// Define a function createFRE()
+const createFRE = async () => {
+
+ const DISP_NFT_NAME = 'Datatoken 3'
+ const DISP_NFT_SYMBOL = 'DT3'
+
+ let config = await oceanConfig();
+
+ // Create a NFTFactory
+ const factory = new NftFactory(config.nftFactoryAddress, config.publisherAccount);
+
+ const nftParams = {
+ name: DISP_NFT_NAME,
+ symbol: DISP_NFT_SYMBOL,
+ templateIndex: 1,
+ tokenURI: '',
+ transferable: true,
+ owner: await config.publisherAccount.getAddress()
+ }
+
+ const datatokenParams = {
+ templateIndex: 1,
+ cap: '100000',
+ feeAmount: '0',
+ paymentCollector: ZERO_ADDRESS,
+ feeToken: ZERO_ADDRESS,
+ minter: await config.publisherAccount.getAddress(),
+ mpFeeAddress: ZERO_ADDRESS
+ }
+
+ const dispenserParams = {
+ dispenserAddress: config.dispenserAddress,
+ maxTokens: '1',
+ maxBalance: '1',
+ withMint: true,
+ allowedSwapper: ZERO_ADDRESS
+ }
+
+ const bundleNFT = await factory.createNftWithDatatokenWithDispenser(
+ nftParams,
+ datatokenParams,
+ dispenserParams
+ )
+
+ const trxReceipt = await bundleNFT.wait()
+
+ return {
+ trxReceipt
+ };
+};
+
+// Call the createFRE() function
+createDispenser()
+ .then(({ trxReceipt }) => {
+ console.log(`TX Receipt ${trxReceipt}`);
+ process.exit(1);
+ })
+ .catch((err) => {
+ console.error(err);
+ process.exit(1);
+ });
+```
+{% endcode %}
+{% endtab %}
+{% endtabs %}
+
+By utilizing these dependencies and configuration settings, the script can leverage the functionalities provided by the Ocean libraries and interact with the Ocean Protocol ecosystem effectively.
diff --git a/developers/ocean.js/remove-asset.md b/developers/ocean.js/remove-asset.md
new file mode 100644
index 00000000..1d9fe696
--- /dev/null
+++ b/developers/ocean.js/remove-asset.md
@@ -0,0 +1,2 @@
+# Remove Asset
+
diff --git a/developers/using-ocean-libraries/update-metadata.md b/developers/ocean.js/update-metadata.md
similarity index 86%
rename from developers/using-ocean-libraries/update-metadata.md
rename to developers/ocean.js/update-metadata.md
index 4dd2cf2c..3e07cd61 100644
--- a/developers/using-ocean-libraries/update-metadata.md
+++ b/developers/ocean.js/update-metadata.md
@@ -1,13 +1,13 @@
# Update Metadata
-This tutorial will guide you to update an existing asset published on-chain using Ocean libraries. The tutorial assumes that you already have the `did` of the asset which needs to be updated. In this tutorial, we will update the name, description, tags of the data NFT. Please refer [the page on DDO](../ddo-specification.md) to know more about additional the fields which can be updated.
+This tutorial will guide you to update an existing asset published on-chain using Ocean libraries. The tutorial assumes that you already have the `did` of the asset which needs to be updated. In this tutorial, we will update the name, description, tags of the data NFT. Please refer [the page on DDO](../../core-concepts/did-ddo.md) to know more about additional the fields which can be updated.
#### Prerequisites
-* [Obtain an API key](configuration.md#obtaining-api-key-for-ethereum-node-provider)
-* [Set up the .env file](configuration.md#create-a-.env-file)
-* [Install the dependencies](configuration.md#setup-dependencies)
-* [Create a configuration file](configuration.md#create-a-configuration-file)
+* [Obtain an API key](broken-reference)
+* [Set up the .env file](broken-reference)
+* [Install the dependencies](broken-reference)
+* [Create a configuration file](configuration.md)
{% hint style="info" %}
The variable **AQUARIUS\_URL** and **PROVIDER\_URL** should be set correctly in `.env` file
diff --git a/developers/using-ocean-libraries/create-datatoken-with-fixed-pricing.md b/developers/using-ocean-libraries/create-datatoken-with-fixed-pricing.md
deleted file mode 100644
index 61d75388..00000000
--- a/developers/using-ocean-libraries/create-datatoken-with-fixed-pricing.md
+++ /dev/null
@@ -1,179 +0,0 @@
-# Publish with Fixed Pricing
-
-This tutorial guides you through the process of creating your own data NFT and a datatoken with fixed pricing, using Ocean libraries. To know more about data NFTs and datatokens please refer [this page](../datanft-and-datatoken.md). Ocean Protocol supports different pricing schemes which can be set while publishing an asset. Please refer [this page](../asset-pricing.md) for more details on pricing schemes.
-
-#### Prerequisites
-
-* [Obtain an API key](configuration.md#obtaining-api-key-for-ethereum-node-provider)
-* [Set up the .env file](configuration.md#create-a-.env-file)
-* [Install the dependencies](configuration.md#setup-dependencies)
-* [Create a configuration file](configuration.md#create-a-configuration-file)
-
-#### Create a script to deploy data NFT and datatoken with fixed pricing.
-
-Create a new file in the same working directory where configuration file (`config.py`/`config.js`) and `.env` files are present, and copy the code as listed below.
-
-{% hint style="info" %}
-**Fees**: The code snippets below define fees related parameters. Please refer [fees page ](../fees.md)for more details
-{% endhint %}
-
-{% tabs %}
-{% tab title="ocean.js" %}
-{% code title="create_datatoken_with_fre.js" %}
-```javascript
-// Import dependencies
-const { NftFactory, Datatoken } = require('@oceanprotocol/lib');
-const Web3 = require('web3');
-const { web3Provider, oceanConfig } = require('./config');
-
-// Create a web3 instance
-const web3 = new Web3(web3Provider);
-
-// Define a function createFRE()
-const createFRE = async () => {
- const Factory = new NftFactory(oceanConfig.erc721FactoryAddress, web3);
-
- // Get accounts from web3 instance
- const accounts = await web3.eth.getAccounts();
- const publisherAccount = accounts[0];
-
- // data NFT parameters: name, symbol, templateIndex, etc.
- const nftParams = {
- name: '72120Bundle',
- symbol: '72Bundle',
- templateIndex: 1,
- tokenURI: 'https://example.com',
- transferable: true,
- owner: publisherAccount
- };
-
- // datatoken parameters: name, symbol, templateIndex, etc.
- const erc20Params = {
- name: "Sample datatoken",
- symbol: "SDT",
- templateIndex: 1,
- cap: '100000',
- feeAmount: '0',
- // paymentCollector is the address
- paymentCollector: '0x0000000000000000000000000000000000000000',
- feeToken: '0x0000000000000000000000000000000000000000',
- minter: publisherAccount,
- mpFeeAddress: '0x0000000000000000000000000000000000000000'
- };
-
- const fixedPriceParams = {
- fixedRateAddress: oceanConfig.fixedRateExchangeAddress,
- baseTokenAddress: oceanConfig.oceanTokenAddress,
- owner: publisherAccount,
- marketFeeCollector: publisherAccount,
- baseTokenDecimals: 18,
- datatokenDecimals: 18,
- fixedRate: '100',
- marketFee: '0',
- // Optional parameters
- // allowedConsumer: publisherAccount, // only account that consume the exhchange
- withMint: false // add FixedPriced contract as minter if withMint == true
- }
-
- // Create data NFT and a datatoken with Fixed Rate exchange
- const result = await Factory.createNftErc20WithFixedRate(
- publisherAccount,
- nftParams,
- erc20Params,
- fixedPriceParams
- );
-
- // Get the data NFT address and datatoken address from the result
- const erc721Address = result.events.NFTCreated.returnValues[0];
- const datatokenAddress = result.events.TokenCreated.returnValues[0];
-
- return {
- erc721Address,
- datatokenAddress
- };
-};
-
-// Call the createFRE() function
-createFRE()
- .then(({ erc721Address, datatokenAddress }) => {
- console.log(`DataNft address ${erc721Address}`);
- console.log(`Datatoken address ${datatokenAddress}`);
- process.exit(1);
-
- })
- .catch((err) => {
- console.error(err);
- process.exit(1);
- });
-```
-{% endcode %}
-
-Execute script
-
-```
-node create_datatoken_with_fre.js
-```
-{% endtab %}
-
-{% tab title="ocean.py" %}
-{% code title="create_datatoken_with_fre.py" %}
-```python
-# Note: Ensure that .env and config.py are correctly setup
-from config import web3_wallet, ocean
-
-data_nft = ocean.create_data_nft(
- name="NFTToken1",
- symbol="NFT1",
- from_wallet=web3_wallet,
- # Optional parameters
- token_uri="https://example.com",
- template_index=1,
- transferable=True,
- owner=web3_wallet.address,
-)
-print(f"Created dataNFT. Its address is {data_nft.address}")
-
-# replace the addresses here
-fee_manager = "0x0000000000000000000000000000000000000000"
-publish_market_order_fee_address = "0x0000000000000000000000000000000000000000"
-publish_market_order_fee_token = "0x0000000000000000000000000000000000000000"
-minter = web3_wallet.address
-
-# replace the fee amount
-publish_market_order_fee_amount = 0
-
-datatoken = data_nft.create_datatoken(
- name="Datatoken 1",
- symbol="DT1",
- datatoken_cap="100000",
- from_wallet=web3_wallet,
- # Ootional parameters below
- template_index=1,
- fee_manager=fee_manager,
- publish_market_order_fee_token=publish_market_order_fee_token,
- publish_market_order_fee_amount=publish_market_order_fee_amount,
- minter=minter,
- publish_market_order_fee_address=publish_market_order_fee_address,
-)
-print(f"Created datatoken. Its address is {datatoken.address}")
-
-
-exchange_id = ocean.create_fixed_rate(
- datatoken=datatoken,
- base_token=ocean.OCEAN_token,
- amount=ocean.to_wei(100),
- from_wallet=web3_wallet,
-)
-
-print(f"Created fixed rate exchange with ID {exchange_id.hex()}")
-
-```
-{% endcode %}
-
-**Execute script**
-
-```
-python create_datatoken_with_fre.py
-```
-{% endtab %}
-{% endtabs %}
diff --git a/developers/using-ocean-libraries/creating-datanft.md b/developers/using-ocean-libraries/creating-datanft.md
deleted file mode 100644
index 16bfd573..00000000
--- a/developers/using-ocean-libraries/creating-datanft.md
+++ /dev/null
@@ -1,106 +0,0 @@
-# Creating a data NFT
-
-This tutorial guides you through the process of creating your own data NFT using Ocean libraries. To know more about data NFT please refer [this page](../datanft-and-datatoken.md).
-
-#### Prerequisites
-
-* [Obtain an API key](configuration.md#obtaining-api-key-for-ethereum-node-provider)
-* [Set up the .env file](configuration.md#create-a-.env-file)
-* [Install the dependencies](configuration.md#setup-dependencies)
-* [Create a configuration file](configuration.md#create-a-configuration-file)
-
-#### Create a script to deploy dataNFT
-
-Create a new file in the same working directory where configuration file (`config.py`/`config.js`) and `.env` files are present, and copy the code as listed below.
-
-{% tabs %}
-{% tab title="ocean.js" %}
-{% code title="create_dataNFT.js" %}
-```javascript
-// Import dependencies
-const { NftFactory } = require('@oceanprotocol/lib');
-const Web3 = require('web3');
-
-// Note: Make sure .env file and config.js are created and setup correctly
-const { web3Provider, oceanConfig } = require('./config');
-
-const web3 = new Web3(web3Provider);
-
-// Deinfe a function which will create a dataNFT using Ocean.js library
-const createDataNFT = async () => {
-
- // Create a NFTFactory
- const Factory = new NftFactory(oceanConfig.erc721FactoryAddress, web3);
-
- const accounts = await web3.eth.getAccounts();
- const publisherAccount = accounts[0];
-
- // Define dataNFT parameters
- const nftParams = {
- name: '72120Bundle',
- symbol: '72Bundle',
- // Optional parameters
- templateIndex: 1,
- tokenURI: 'https://example.com',
- transferable: true,
- owner: publisherAccount
- };
-
- // Call a Factory.createNFT(...) which will create a new dataNFT
- const erc721Address = await Factory.createNFT(
- publisherAccount,
- nftParams
- );
-
- return {
- erc721Address
- };
-};
-
-// Call the create createDataNFT() function
-createDataNFT()
- .then(({ erc721Address }) => {
- console.log(`DataNft address ${erc721Address}`);
- process.exit();
- })
- .catch((err) => {
- console.error(err);
- process.exit(1);
- });
-```
-{% endcode %}
-
-Executing script
-
-```bash
-node create_dataNFT.js
-```
-{% endtab %}
-
-{% tab title="ocean.py" %}
-{% code title="create_dataNFT.py" %}
-```python
-# Note: Ensure that .env and config.py are correctly setup
-from config import web3_wallet, ocean
-
-data_nft = ocean.create_data_nft(
- name="NFTToken1",
- symbol="NFT1",
- from_wallet=web3_wallet,
- # Optional parameters
- token_uri="https://example.com",
- template_index=1,
- transferable=True,
- owner=web3_wallet.address,
-)
-print(f"Created dataNFT. Its address is {data_nft.address}")
-```
-{% endcode %}
-
-Executing script
-
-```bash
-python create_dataNFT.py
-```
-{% endtab %}
-{% endtabs %}
diff --git a/developers/using-ocean-libraries/mint-datatoken.md b/developers/using-ocean-libraries/mint-datatoken.md
deleted file mode 100644
index 0f0c17d0..00000000
--- a/developers/using-ocean-libraries/mint-datatoken.md
+++ /dev/null
@@ -1,117 +0,0 @@
-# Mint Datatokens
-
-This tutorial guides you through the process of minting datatokens and sending them to a receiver address. The tutorial assumes that you already have the address of the datatoken contract which is owned by you.
-
-#### Prerequisites
-
-* [Obtain an API key](configuration.md#obtaining-api-key-for-ethereum-node-provider)
-* [Set up the .env file](configuration.md#create-a-.env-file)
-* [Install the dependencies](configuration.md#setup-dependencies)
-* [Create a configuration file](configuration.md#create-a-configuration-file)
-
-#### Create a script to mint datatokens
-
-Create a new file in the same working directory where configuration file (`config.py`/`config.js`) and `.env` files are present, and copy the code as listed below.
-
-{% tabs %}
-{% tab title="ocean.js" %}
-{% code title="mint_datatoken.js" %}
-```javascript
-// Import dependencies
-const { NftFactory, Datatoken } = require('@oceanprotocol/lib');
-const Web3 = require('web3');
-const { web3Provider, oceanConfig } = require('./config');
-
-// Create a web3 instance
-const web3 = new Web3(web3Provider);
-
-// Change this
-const datatokenAddress = "0xD3542e5F56655fb818F9118CE219e1D10751BC82"
-const receiverAddress = "0xBE5449a6A97aD46c8558A3356267Ee5D2731ab5e"
-
-// Create a function which will take `datatokenAddress` and `receiverAddress` as parameters
-const mintDatatoken = async (datatokenAddress, receiverAddress) => {
- const accounts = await web3.eth.getAccounts();
- const publisherAccount = accounts[0];
-
- // Create datatoken instance
- const datatoken = new Datatoken(web3);
-
- // Get current datatoken balance of receiver
- let receiverBalance = await datatoken.balance(
- datatokenAddress,
- receiverAddress
- );
- console.log(`Receiver balance before mint: ${receiverBalance}`);
-
- // Mint datatoken
- await datatoken.mint(
- datatokenAddress,
- publisherAccount,
- '1',
- receiverAddress
- );
-
- // Get new datatoken balance of receiver
- receiverBalance = await datatoken.balance(
- datatokenAddress,
- receiverAddress
- );
- console.log(`Receiver balance after mint: ${receiverBalance}`);
-};
-
-// Call mintDatatoken(...) function defined above
-mintDatatoken(datatokenAddress, receiverAddress)
- .then(() => {
- process.exit((err) => {
- console.error(err);
- process.exit(1);
- });
- })
- .catch((err) => {
- console.error(err);
- process.exit(1);
- });
-```
-{% endcode %}
-
-**Execute script**
-
-```
-node mint_datatoken.js
-```
-{% endtab %}
-
-{% tab title="ocean.py" %}
-{% code title="mint_datatoken.py" %}
-```python
-# Note: Ensure that .env and config.py are correctly setup
-from config import web3_wallet, ocean
-
-# Change this
-datatoken_address = "0xD3542e5F56655fb818F9118CE219e1D10751BC82"
-receiver_address = "0xBE5449a6A97aD46c8558A3356267Ee5D2731ab5e"
-
-datatoken = ocean.get_datatoken(datatoken_address)
-
-print(f"Balance before mint: {datatoken.balanceOf(receiver_address)}")
-
-# Mint datatokens
-datatoken.mint(
- account_address=receiver_address,
- value=ocean.to_wei("1"),
- from_wallet=web3_wallet,
-)
-
-print(f"Balance after mint: {datatoken.balanceOf(receiver_address)}")
-nt_d
-```
-{% endcode %}
-
-**Execute script**
-
-```
-python mint_datatoken.py
-```
-{% endtab %}
-{% endtabs %}
diff --git a/discover/explore.md b/discover/explore.md
index fbcc36d9..e3d93b8f 100644
--- a/discover/explore.md
+++ b/discover/explore.md
@@ -74,7 +74,7 @@ The following guides will help you get started with buying and selling data:
Manage datatokens and data NFTs for use in DeFi
Ocean makes it easy to publish data services (deploy ERC721 data NFTs and ERC20 datatokens), and to consume data services (spend datatokens). Crypto wallets, exchanges, and DAOs become data wallets, exchanges, and DAOs.
-Use Ocean [JavaScript](../developers/ocean-libraries/) or [Python](../developers/ocean.py/) drivers to manage data NFTs and datatokens:
+Use Ocean [JavaScript](broken-reference) or [Python](../developers/ocean.py/) drivers to manage data NFTs and datatokens:
Ocean-based apps make data assets on-ramps and off-ramps easy for end users. Ocean smart contracts and libraries make this easy for developers. The data itself does not need to be on-chain, just the access control.
diff --git a/discover/wallets.md b/discover/wallets.md
index e78c9e3a..55d21a75 100644
--- a/discover/wallets.md
+++ b/discover/wallets.md
@@ -6,7 +6,7 @@ description: Fundamental knowledge of using ERC-20 crypto wallets.
Ocean Protocol users require an ERC-20 compatible wallet to manage their OCEAN and ETH tokens. In this guide, we will provide some recommendations for different wallet options.
-
+
### What is a wallet?
diff --git a/user-guides/remove-liquidity-using-etherscan.md b/user-guides/remove-liquidity-using-etherscan.md
index 14b0f0df..73ebd643 100644
--- a/user-guides/remove-liquidity-using-etherscan.md
+++ b/user-guides/remove-liquidity-using-etherscan.md
@@ -14,7 +14,7 @@ Liquidity pools and dynamic pricing used to be supported in previous versions of
4\. Go to field `20. balanceOf` and insert your ETH address. This will retrieve your pool share token balance in wei.
-
+
5\. Copy this number as later you will use it as the `poolAmountIn` parameter.