@oceanprotocol/lib 1.0.0-next.9 → 1.0.0
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.
- package/CHANGELOG.md +390 -1
- package/CodeExamples.md +918 -0
- package/README.md +12 -80
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/src/@types/Asset.d.ts +83 -0
- package/dist/src/@types/Compute.d.ts +18 -1
- package/dist/src/@types/DDO/DDO.d.ts +43 -0
- package/dist/src/@types/DDO/Event.d.ts +20 -0
- package/dist/src/@types/DDO/Metadata.d.ts +92 -0
- package/dist/src/@types/DDO/Service.d.ts +72 -6
- package/dist/src/{interfaces/DispenserInterface.d.ts → @types/Dispenser.d.ts} +0 -0
- package/dist/src/@types/Erc20.d.ts +21 -0
- package/dist/src/{interfaces/Erc721Interface.d.ts → @types/Erc721.d.ts} +2 -2
- package/dist/src/@types/FileMetadata.d.ts +29 -0
- package/dist/src/{interfaces/FixedRateInterface.d.ts → @types/FixedPrice.d.ts} +7 -1
- package/dist/src/{interfaces/PoolInterface.d.ts → @types/Pool.d.ts} +11 -2
- package/dist/src/@types/Provider.d.ts +9 -0
- package/dist/src/@types/Router.d.ts +59 -0
- package/dist/src/@types/index.d.ts +6 -0
- package/dist/src/aquarius/Aquarius.d.ts +23 -1
- package/dist/src/factories/NFTFactory.d.ts +222 -14
- package/dist/src/index.d.ts +1 -1
- package/dist/src/models/Config.d.ts +128 -0
- package/dist/src/pools/Router.d.ts +189 -8
- package/dist/src/pools/balancer/Pool.d.ts +354 -29
- package/dist/src/pools/dispenser/Dispenser.d.ts +109 -2
- package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +309 -17
- package/dist/src/pools/index.d.ts +2 -0
- package/dist/src/pools/ssContracts/SideStaking.d.ts +110 -7
- package/dist/src/provider/Provider.d.ts +125 -6
- package/dist/src/tokens/Datatoken.d.ts +347 -8
- package/dist/src/tokens/NFT.d.ts +297 -5
- package/dist/src/utils/ContractUtils.d.ts +13 -4
- package/dist/src/utils/DatatokenName.d.ts +4 -0
- package/dist/src/utils/General.d.ts +4 -0
- package/dist/src/utils/PoolHelpers.d.ts +8 -0
- package/dist/src/utils/SignatureUtils.d.ts +0 -2
- package/dist/src/utils/TokenUtils.d.ts +65 -3
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/test/TestContractHandler.d.ts +8 -36
- package/dist/test/config.d.ts +5 -0
- package/dist/test/{unit/NftFactory.test.d.ts → integration/CodeExamples.test.d.ts} +0 -0
- package/dist/test/unit/factories/NftFactory.test.d.ts +1 -0
- package/package.json +37 -32
- package/dist/src/interfaces/Erc20Interface.d.ts +0 -11
- package/dist/src/interfaces/RouterInterface.d.ts +0 -12
- package/dist/src/interfaces/index.d.ts +0 -5
- package/dist/test/integration/config.d.ts +0 -3
- package/dist/test/unit/config.d.ts +0 -3
- package/docs/beginners_guide.md +0 -338
- package/docs/get-test-OCEAN.md +0 -24
- package/docs/overview.md +0 -394
- package/docs/quickstart_marketplace.md +0 -423
- package/docs/quickstart_simple.md +0 -272
- package/docs/services.md +0 -94
- 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
|
-
|
|
18
|
-
|
|
19
|
-
- **
|
|
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
|
|
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
|
-
- [
|
|
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
|
-
- [
|
|
117
|
-
- [
|
|
118
|
-
- [
|
|
119
|
-
-
|
|
120
|
-
-
|
|
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))
|
|
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.
|