@oceanprotocol/lib 1.0.0-next.9 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +408 -1
  2. package/CodeExamples.md +929 -0
  3. package/README.md +12 -80
  4. package/dist/lib.js +1 -1
  5. package/dist/lib.js.map +1 -1
  6. package/dist/lib.modern.js +1 -1
  7. package/dist/lib.modern.js.map +1 -1
  8. package/dist/lib.module.js +1 -1
  9. package/dist/lib.module.js.map +1 -1
  10. package/dist/lib.umd.js +1 -1
  11. package/dist/lib.umd.js.map +1 -1
  12. package/dist/src/@types/Asset.d.ts +83 -0
  13. package/dist/src/@types/Compute.d.ts +18 -1
  14. package/dist/src/@types/DDO/DDO.d.ts +43 -0
  15. package/dist/src/@types/DDO/Event.d.ts +20 -0
  16. package/dist/src/@types/DDO/Metadata.d.ts +92 -0
  17. package/dist/src/@types/DDO/Service.d.ts +72 -6
  18. package/dist/src/{interfaces/DispenserInterface.d.ts → @types/Dispenser.d.ts} +0 -0
  19. package/dist/src/@types/Erc20.d.ts +21 -0
  20. package/dist/src/{interfaces/Erc721Interface.d.ts → @types/Erc721.d.ts} +2 -2
  21. package/dist/src/@types/File.d.ts +23 -0
  22. package/dist/src/@types/FileInfo.d.ts +38 -0
  23. package/dist/src/{interfaces/FixedRateInterface.d.ts → @types/FixedPrice.d.ts} +7 -1
  24. package/dist/src/{interfaces/PoolInterface.d.ts → @types/Pool.d.ts} +11 -2
  25. package/dist/src/@types/Provider.d.ts +9 -0
  26. package/dist/src/@types/Router.d.ts +59 -0
  27. package/dist/src/@types/index.d.ts +8 -1
  28. package/dist/src/aquarius/Aquarius.d.ts +23 -1
  29. package/dist/src/factories/NFTFactory.d.ts +222 -14
  30. package/dist/src/index.d.ts +1 -1
  31. package/dist/src/models/Config.d.ts +128 -0
  32. package/dist/src/pools/Router.d.ts +189 -8
  33. package/dist/src/pools/balancer/Pool.d.ts +354 -29
  34. package/dist/src/pools/dispenser/Dispenser.d.ts +109 -2
  35. package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +309 -17
  36. package/dist/src/pools/index.d.ts +2 -0
  37. package/dist/src/pools/ssContracts/SideStaking.d.ts +110 -7
  38. package/dist/src/provider/Provider.d.ts +127 -8
  39. package/dist/src/tokens/Datatoken.d.ts +347 -8
  40. package/dist/src/tokens/NFT.d.ts +297 -5
  41. package/dist/src/utils/ContractUtils.d.ts +13 -4
  42. package/dist/src/utils/DatatokenName.d.ts +4 -0
  43. package/dist/src/utils/General.d.ts +4 -0
  44. package/dist/src/utils/PoolHelpers.d.ts +8 -0
  45. package/dist/src/utils/SignatureUtils.d.ts +0 -2
  46. package/dist/src/utils/TokenUtils.d.ts +82 -3
  47. package/dist/src/utils/index.d.ts +2 -0
  48. package/dist/test/TestContractHandler.d.ts +8 -36
  49. package/dist/test/config.d.ts +5 -0
  50. package/dist/test/{unit/NftFactory.test.d.ts → integration/CodeExamples.test.d.ts} +0 -0
  51. package/dist/test/unit/factories/NftFactory.test.d.ts +1 -0
  52. package/package.json +42 -37
  53. package/dist/src/@types/FileMetadata.d.ts +0 -9
  54. package/dist/src/interfaces/Erc20Interface.d.ts +0 -11
  55. package/dist/src/interfaces/RouterInterface.d.ts +0 -12
  56. package/dist/src/interfaces/index.d.ts +0 -5
  57. package/dist/test/integration/config.d.ts +0 -3
  58. package/dist/test/unit/config.d.ts +0 -3
  59. package/docs/beginners_guide.md +0 -338
  60. package/docs/get-test-OCEAN.md +0 -24
  61. package/docs/overview.md +0 -394
  62. package/docs/quickstart_marketplace.md +0 -423
  63. package/docs/quickstart_simple.md +0 -272
  64. package/docs/services.md +0 -94
  65. package/docs/wallets.md +0 -98
package/README.md CHANGED
@@ -13,27 +13,18 @@
13
13
 
14
14
  With ocean.js, you can:
15
15
 
16
- - **Publish** data services: downloadable files or compute-to-data.
17
- Ocean creates a new [ERC20](https://github.com/ethereum/EIPs/blob/7f4f0377730f5fc266824084188cc17cf246932e/EIPS/eip-20.md)
18
- datatoken for each dataset / data service.
19
- - **Mint** datatokens for the service
20
- - **Sell** datatokens via an OCEAN-datatoken Balancer pool (for auto price discovery), or for a fixed price
21
- - **Stake** OCEAN on datatoken pools
22
- - **Consume** datatokens, to access the service
23
- - **Transfer** datatokens to another owner, and **all other ERC20 actions**
24
- using [web3.js](https://web3js.readthedocs.io/en/v1.2.9/web3-eth-contract.html) etc.
16
+ - **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).
17
+ - **Sell** datatokens via an OCEAN-datatoken Balancer pool (for auto price discovery), or for a fixed price. Sell data NFTs.
18
+ - **Stake OCEAN** on datatoken pools
19
+ - **Transfer** data NFTs & datatokens to another owner, and **all other ERC721 & ERC20 actions** using [web3.js](https://web3js.readthedocs.io/en/v1.2.9/web3-eth-contract.html) etc.
25
20
 
26
21
  ocean.js is part of the [Ocean Protocol](https://oceanprotocol.com) toolset.
27
22
 
28
- This is in alpha state and you can expect running into problems. If you run into them, please open up a [new issue](https://github.com/oceanprotocol/ocean.js/issues/new?assignees=&labels=bug&template=bug_report.md&title=).
23
+ This is in alpha state. If you run into problems, please open up a [new issue](https://github.com/oceanprotocol/ocean.js/issues/new?assignees=&labels=bug&template=bug_report.md&title=).
29
24
 
30
25
  - [📚 Prerequisites](#-prerequisites)
31
26
  - [🏗 Installation](#-installation)
32
- - [🏄 Quickstart](#-quickstart)
33
- - [Beginners Guide](#beginners-guide)
34
- - [Simple Flow](#simple-flow)
35
- - [Marketplace Flow](#marketplace-flow)
36
- - [📖 Learn More](#learn-more)
27
+ - [📖 Learn More](#-learn-more)
37
28
  - [🦑 Development](#-development)
38
29
  - [✨ Code Style](#-code-style)
39
30
  - [👩‍🔬 Testing](#-testing)
@@ -51,77 +42,18 @@ This is in alpha state and you can expect running into problems. If you run into
51
42
  - Docker ([Managed as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/))
52
43
  - A Unix based operating system (Mac or Linux)
53
44
 
54
- ### Note
55
-
56
- Any function that uses `getPastEvents()` will only work on Eth (see: <https://github.com/oceanprotocol/ocean.js/issues/741>). This includes:
57
-
58
- - searchPoolforDT()
59
- - getPoolsbyCreator()
60
- - getPoolSharesByAddress()
61
- - getAllPoolLogs()
62
- - getPreviousValidOrders()
63
- - searchforDT()
64
- - getExchangesbyCreator()
65
- - getExchangeSwaps()
66
- - getAllExchangesSwaps()
67
-
68
45
  ## 🏗 Installation
69
46
 
70
47
  ```bash
71
48
  npm install @oceanprotocol/lib
72
49
  ```
73
-
74
- ## 🏄 Quickstart
75
-
76
- ```ts
77
- import { Ocean, Config, ConfigHelper, Logger } from '@oceanprotocol/lib'
78
-
79
- const defaultConfig: Config = new ConfigHelper().getConfig(
80
- 'rinkeby',
81
- 'YOUR_INFURA_PROJECT_ID'
82
- )
83
-
84
- const config = {
85
- ...defaultConfig,
86
- metadataCacheUri: 'https://your-metadata-cache.com',
87
- providerUri: 'https://your-provider.com'
88
- }
89
-
90
- async function init() {
91
- const ocean = await Ocean.getInstance(config)
92
- return ocean
93
- }
94
- ```
95
-
96
- ### Beginners Guide
97
-
98
- This introduction is aimed at developers who are completely new to blockchain, no coding experience is required.
99
-
100
- [Go to beginners guide](docs/beginners_guide.md)
101
-
102
- ### Simple Flow
103
-
104
- This stripped-down flow shows the essence of Ocean. Just downloading, no metadata.
105
-
106
- [Go to simple flow](docs/quickstart_simple.md)
107
-
108
- ### Marketplace Flow
109
-
110
- This batteries-included flow includes metadata, multiple services for one datatoken, and compute-to-data.
111
-
112
- [Go to marketplace flow](docs/quickstart_marketplace.md)
113
-
114
50
  ### 📖 Learn more
115
51
 
116
- - [Get test OCEAN](docs/get-test-OCEAN.md) - from rinkeby
117
- - [Understand config parameters](docs/parameters.md) - envvars vs files
118
- - [Learn about off-chain services](docs/services.md) - Ocean Provider for data services, Aquarius metadata store
119
- - [Learn about wallets](docs/wallets.md) - on generating, storing, and accessing private keys
120
- - [Get an overview of ocean.js](docs/overview.md) - key modules and functions
121
-
122
- If you have any difficulties with the quickstarts, or if you have further questions about how to use ocean.js please reach out to us on [Discord](https://discord.gg/TnXjkR5).
123
-
124
- 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=).
52
+ - Checkout our [code examples](CodeExamples.md) to see how you can use ocean.js.
53
+ - Refer to the [Ocean Protocol documentation](https://docs.oceanprotocol.com/) for more guides and tutorials.
54
+ - Visit the [Ocean Protocol website](https://docs.oceanprotocol.com/) for general information about Ocean Protocol.
55
+ - 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).
56
+ - 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=).
125
57
 
126
58
  ## 🦑 Development
127
59
 
@@ -243,7 +175,7 @@ Further releases afterwards can be done with `npm run release` again and selecti
243
175
  ## 🏛 License
244
176
 
245
177
  ```
246
- Copyright ((C)) 2021 Ocean Protocol Foundation
178
+ Copyright ((C)) 2022 Ocean Protocol Foundation
247
179
 
248
180
  Licensed under the Apache License, Version 2.0 (the "License");
249
181
  you may not use this file except in compliance with the License.