From e896d707fdc543fd80ea70e82258ee881e7189db Mon Sep 17 00:00:00 2001 From: "mariacarmina.cretu" Date: Wed, 7 Jun 2023 13:09:44 +0000 Subject: [PATCH] GITBOOK-430: change request with no subject merged in GitBook --- ...ute (1).png => contribute (1) (1) (2).png} | Bin .../{image (4).png => image (3) (1).png} | Bin ...e-liquidity-2 (1) (1) (2) (1) (2) (1).png} | Bin ...e-liquidity-2 (1) (1) (2) (1) (2) (2).png} | Bin ....gif => show-me-the-money (1) (1) (2).gif} | Bin README.md | 2 +- SUMMARY.md | 7 +- .../fractional-ownership.md | 0 developers/ocean.py/datatoken-interface.md | 2 + developers/ocean.py/ocean-assets.md | 2 + developers/ocean.py/ocean-compute.md | 2 + developers/ocean.py/technical-details.md | 246 ++++++++++++++---- 12 files changed, 204 insertions(+), 57 deletions(-) rename .gitbook/assets/cover/{contribute (1).png => contribute (1) (1) (2).png} (100%) rename .gitbook/assets/{image (4).png => image (3) (1).png} (100%) rename .gitbook/assets/liquidity/{remove-liquidity-2 (1) (1) (2) (1).png => remove-liquidity-2 (1) (1) (2) (1) (2) (1).png} (100%) rename .gitbook/assets/liquidity/{remove-liquidity-2 (1) (1) (2) (2).png => remove-liquidity-2 (1) (1) (2) (1) (2) (2).png} (100%) rename .gitbook/assets/{show-me-the-money (1).gif => show-me-the-money (1) (1) (2).gif} (100%) rename developers/{datanft-and-datatoken => contracts}/fractional-ownership.md (100%) create mode 100644 developers/ocean.py/datatoken-interface.md create mode 100644 developers/ocean.py/ocean-assets.md create mode 100644 developers/ocean.py/ocean-compute.md diff --git a/.gitbook/assets/cover/contribute (1).png b/.gitbook/assets/cover/contribute (1) (1) (2).png similarity index 100% rename from .gitbook/assets/cover/contribute (1).png rename to .gitbook/assets/cover/contribute (1) (1) (2).png diff --git a/.gitbook/assets/image (4).png b/.gitbook/assets/image (3) (1).png similarity index 100% rename from .gitbook/assets/image (4).png rename to .gitbook/assets/image (3) (1).png 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) (2) (1).png similarity index 100% rename from .gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (1).png rename to .gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (1) (2) (1).png diff --git a/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (2).png b/.gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (1) (2) (2).png similarity index 100% rename from .gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (2).png rename to .gitbook/assets/liquidity/remove-liquidity-2 (1) (1) (2) (1) (2) (2).png diff --git a/.gitbook/assets/show-me-the-money (1).gif b/.gitbook/assets/show-me-the-money (1) (1) (2).gif similarity index 100% rename from .gitbook/assets/show-me-the-money (1).gif rename to .gitbook/assets/show-me-the-money (1) (1) (2).gif diff --git a/README.md b/README.md index a9af2aa5..7455de33 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).png +cover: .gitbook/assets/cover/contribute (1) (1) (2).png coverY: 0 layout: landing --- diff --git a/SUMMARY.md b/SUMMARY.md index 13bd805f..eddf3f63 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -41,7 +41,7 @@ * [Asset Pricing](developers/asset-pricing.md) * [Fees](developers/fees.md) * [Metadata](developers/contracts/metadata.md) - * [Fractional Ownership](developers/datanft-and-datatoken/fractional-ownership.md) + * [Fractional Ownership](developers/contracts/fractional-ownership.md) * [Community Monetization](developers/community-monetization.md) * [Identifiers & Metadata](developers/Identifiers-Metadata.md) * [DDO Specification](developers/ddo-specification.md) @@ -66,7 +66,10 @@ * [Publish flow](developers/ocean.py/publish-flow.md) * [Consume flow](developers/ocean.py/consume-flow.md) * [Compute flow](developers/ocean.py/compute-flow.md) - * [Technical Details](developers/ocean.py/technical-details.md) + * [Ocean Instance](developers/ocean.py/technical-details.md) + * [Ocean Assets](developers/ocean.py/ocean-assets.md) + * [Ocean Compute](developers/ocean.py/ocean-compute.md) + * [Datatoken Interface](developers/ocean.py/datatoken-interface.md) * [Ocean.js](developers/ocean.js/README.md) * [Configuration](developers/ocean.js/configuration.md) * [Creating a data NFT](developers/ocean.js/creating-datanft.md) diff --git a/developers/datanft-and-datatoken/fractional-ownership.md b/developers/contracts/fractional-ownership.md similarity index 100% rename from developers/datanft-and-datatoken/fractional-ownership.md rename to developers/contracts/fractional-ownership.md diff --git a/developers/ocean.py/datatoken-interface.md b/developers/ocean.py/datatoken-interface.md new file mode 100644 index 00000000..fde45138 --- /dev/null +++ b/developers/ocean.py/datatoken-interface.md @@ -0,0 +1,2 @@ +# Datatoken Interface + diff --git a/developers/ocean.py/ocean-assets.md b/developers/ocean.py/ocean-assets.md new file mode 100644 index 00000000..8b25c093 --- /dev/null +++ b/developers/ocean.py/ocean-assets.md @@ -0,0 +1,2 @@ +# Ocean Assets + diff --git a/developers/ocean.py/ocean-compute.md b/developers/ocean.py/ocean-compute.md new file mode 100644 index 00000000..4029143f --- /dev/null +++ b/developers/ocean.py/ocean-compute.md @@ -0,0 +1,2 @@ +# Ocean Compute + diff --git a/developers/ocean.py/technical-details.md b/developers/ocean.py/technical-details.md index 641ea43f..e1216cb2 100644 --- a/developers/ocean.py/technical-details.md +++ b/developers/ocean.py/technical-details.md @@ -2,13 +2,11 @@ description: Technical details about most used ocean.py functions --- -# Technical Details +# Ocean Instance At the beginning of most flows, we create an `ocean` object, which is an instance of class [`Ocean`](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py). It exposes useful information, including the following. -### Ocean Instance - -#### constructor +### Constructor * **\_\_init\_\_**(`self`, `config_dict: Dict`, `data_provider: Optional[Type] = None`) @@ -94,9 +92,9 @@ class Ocean: -#### config getter +### Config Getter -**config**(`self`) -> `dict` +* **config**(`self`) -> `dict` It is a helper method for retrieving the user's configuration for ocean.py.\ It can be called only by Ocean object and returns a python dictionary. @@ -124,15 +122,27 @@ Configuration fields as dictionary. -OCEAN token: +### OCEAN Token Address -
- -ocean.OCEAN_address -> str +* **OCEAN\_address**(`self`) -> `str` It is a helper method for retrieving the OCEAN's token address.\ It can be called only by Ocean object and returns the address as a `string`. +**Returns** + +`str` + +OCEAN token address for that network. + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL100C1-L103C52) + +
+ +Source code + ```python @property @enforce_types @@ -157,13 +167,28 @@ def get_ocean_token_address(config_dict: dict) -> str:
-
+### OCEAN Token Object -ocean.OCEAN_token or ocean.OCEAN -> Datatoken +* **OCEAN\_token**(`self`) -> `DatatokenBase` +* **OCEAN**(`self`) -> `DatatokenBase` as alias for the above option It is a helper method for retrieving the OCEAN token object (Datatoken class).\ It can be called within Ocean class and returns the OCEAN Datatoken. +**Returns** + +`DatatokenBase` + +OCEAN token as `DatatokenBase` object. + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL105C1-L113C32) + +
+ +Source code + ```python @property @enforce_types @@ -178,15 +203,27 @@ It can be called within Ocean class and returns the OCEAN Datatoken.
-Ocean smart contracts: +### Data NFT Factory -
- -ocean.data_nft_factory -> DataNFTFactoryContract +* **data\_nft\_factory**(`self`) -> `DataNFTFactoryContract` It is a property for getting `Data NFT Factory` object for the singleton smart contract.\ It can be called within Ocean class and returns the `DataNFTFactoryContract` instance. +**Returns** + +`DataNFTFactoryContract` + +Data NFT Factory contract object which access all the functionalities available from smart contracts in Python. + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL117C1-L120C80) + +
+ +Source code + {% code overflow="wrap" %} ```python @property @@ -198,14 +235,28 @@ It can be called within Ocean class and returns the `DataNFTFactoryContract` ins
-
+### Dispenser -ocean.dispenser -> Dispenser +* **dispenser**(`self`) -> `Dispenser` `Dispenser` is represented by a faucet for free data.\ It is a property for getting `Dispenser` object for the singleton smart contract.\ It can be called within Ocean class and returns the `Dispenser` instance. +**Returns** + +`Dispenser` + +Dispenser contract object which access all the functionalities available from smart contracts in Python. + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL122C1-L125C63) + +
+ +Source code + ```python @property @enforce_types @@ -215,14 +266,28 @@ It can be called within Ocean class and returns the `Dispenser` instance.
-
+### Fixed Rate Exchange -ocean.fixed_rate_exchange -> FixedRateExchange +* **fixed\_rate\_exchange**(`self`) -> `FixedRateExchange` Exchange is used for priced data.\ It is a property for getting `FixedRateExchange` object for the singleton smart contract.\ It can be called within Ocean class and returns the `FixedRateExchange` instance. +**Returns** + +`FixedRateExchange` + +Fixed Rate Exchange contract object which access all the functionalities available from smart contracts in Python. + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL127C1-L130C72) + +
+ +Source code + ```python @property @enforce_types @@ -232,14 +297,30 @@ It can be called within Ocean class and returns the `FixedRateExchange` instance
-Simple getters: +### NFT Token Getter + +* **get\_nft\_token**(`self`, `token_adress: str`) -> `DataNFT` + +It is a getter for a specific data NFT object based on its checksumed address.\ +It can be called within Ocean class which returns the `DataNFT` instance based on string `token_address` specified as parameter. + +**Parameters** + +* `token_address` - string checksumed address of the NFT token that you are searching for. + +**Returns** + +`DataNFT` + +Data NFT object which access all the functionalities available for ERC721 template in Python. + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL139C5-L145C51)
-ocean.get_nft_token(self, token_address: str) -> DataNFT - -It is a getter for a specific data NFT object based on its checksumed address.\ -It can be called within Ocean class with a string `token_address` as parameter which returns the `DataNFT` instance. +Source code ```python @enforce_types @@ -253,13 +334,31 @@ It can be called within Ocean class with a string `token_address` as parameter w
-
+### Datatoken Getter -ocean.get_datatoken(self, token_address: str) -> DatatokenBase +* **get\_datatoken**(`self`, `token_address: str`) -> `DatatokenBase` It is a getter for a specific `datatoken` object based on its checksumed address.\ It can be called within Ocean class with a string `token_address` as parameter which returns the `DatatokenBase` instance depending on datatoken's template index. +**Parameters** + +* `token_address` - string checksumed address of the datatoken that you are searching for. + +**Returns** + +`DatatokenBase` + +Datatoken object which access all the functionalities available for ERC20 templates in Python. + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL147C5-L153C67) + +
+ +Source code + ```python @enforce_types def get_datatoken(self, token_address: str) -> DatatokenBase: @@ -273,20 +372,33 @@ It can be called within Ocean class with a string `token_address` as parameter w
-
+### User Orders Getter -ocean.get_user_orders(self, address: str, datatoken: str) +* **get\_user\_orders**(`self`, `address: str`, `datatoken: str`) -> `List[AttributeDict]` Returns the list of orders that were made by a certain user on a specific datatoken. -As parameters: - -1. `address` - ETH wallet address of that user -2. `datatoken` - datatoken address - -\ It can be called within Ocean class. +**Parameters** + +* `address` - wallet address of that user +* `datatoken` - datatoken address + +**Returns** + +`List[AttributeDict]` + +List of all the orders on that `datatoken` done by the specified `user`. + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL157C5-L173C23) + +
+ +Source code + {% code overflow="wrap" %} ```python @enforce_types @@ -313,19 +425,31 @@ It can be called within Ocean class.
-Provider fees: +### Provider Fees -
- -ocean.retrieve_provider_fees( self, ddo: DDO, access_service: Service, publisher_wallet ) -> dict: +* **retrieve\_provider\_fees**( `self`, `ddo: DDO`, `access_service: Service`, `publisher_wallet` ) -> `dict` Calls Provider to compute provider fees as dictionary for access service. -As parameters: +**Parameters** -1. `ddo` - the data asset which has the DDO object -2. `access_service` - Service instance for the service that needs the provider fees -3. `publisher_wallet` - Wallet instance of the user that wants to retrieve the provider fees +* `ddo` - the data asset which has the DDO object +* `access_service` - Service instance for the service that needs the provider fees +* `publisher_wallet` - Wallet instance of the user that wants to retrieve the provider fees + +**Returns** + +`dict` + +A dictionary which contains the following keys (`providerFeeAddress`, `providerFeeToken`, `providerFeeAmount`, `providerData`, `v`, `r`, `s`, `validUntil`). + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL177C4-L189C1) + +
+ +Source code {% code overflow="wrap" %} ```python @@ -346,19 +470,33 @@ As parameters:
-
+### Compute Provider Fees -ocean.retrieve_provider_fees_for_compute( self, datasets: List[ComputeInput], algorithm_data: Union[ComputeInput, AlgorithmMetadata], consumer_address: str, compute_environment: str, valid_until: int, ) -> dict: +* **retrieve\_provider\_fees\_for\_compute**(`self`, `datasets: List[ComputeInput]`, `algorithm_data: Union[ComputeInput, AlgorithmMetadata]`, `consumer_address: str`, `compute_environment: str`, `valid_until: int`) -> `dict` Calls Provider to generate provider fees as dictionary for compute service. -As parameters: +**Parameters** -1. `datasets` - list of `ComputeInput` which contains the data assets -2. `algorithm_data` - necessary data for algorithm and it can be either a `ComputeInput` object, either just the algorithm metadata, `AlgorithmMetadata` -3. `consumer_address` - address of the compute consumer wallet which is requesting the provider fees -4. `compute_environment` - id provided from the compute environment as `string` -5. `valid_until` - timestamp in UNIX miliseconds for the duration of provider fees for the compute service. +* `datasets` - list of `ComputeInput` which contains the data assets +* `algorithm_data` - necessary data for algorithm and it can be either a `ComputeInput` object, either just the algorithm metadata, `AlgorithmMetadata` +* `consumer_address` - address of the compute consumer wallet which is requesting the provider fees +* `compute_environment` - id provided from the compute environment as `string` +* `valid_until` - timestamp in UNIX miliseconds for the duration of provider fees for the compute service. + +**Returns** + +`dict` + +A dictionary which contains the following keys (`providerFeeAddress`, `providerFeeToken`, `providerFeeAmount`, `providerData`, `v`, `r`, `s`, `validUntil`). + +**Defined in** + +[ocean/ocean.py](https://github.com/oceanprotocol/ocean.py/blob/main/ocean\_lib/ocean/ocean.py#LL190C4-L210C1) + +
+ +Source code {% code overflow="wrap" %} ```python @@ -387,7 +525,7 @@ As parameters:
-### Ocean Assets +#### Ocean Assets
@@ -1237,7 +1375,7 @@ Return value is a tuple composed of list of datasets and algorithm data (if exis
-### Ocean Compute +#### Ocean Compute
@@ -1547,7 +1685,7 @@ A list of objects containing information about each compute environment. For eac
-### Datatoken Interface +#### Datatoken Interface Dispenser utils: