@oceanprotocol/lib 3.0.0-next.1 → 3.0.0-next.2

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 (96) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/CodeExamples.md +1 -1
  3. package/dist/lib.js +1 -1
  4. package/dist/lib.js.map +1 -1
  5. package/dist/lib.modern.js +1 -1
  6. package/dist/lib.modern.js.map +1 -1
  7. package/dist/lib.module.js +1 -1
  8. package/dist/lib.module.js.map +1 -1
  9. package/dist/lib.umd.js +1 -1
  10. package/dist/lib.umd.js.map +1 -1
  11. package/docs/.nojekyll +1 -0
  12. package/docs/README.md +192 -0
  13. package/docs/classes/Aquarius.md +171 -0
  14. package/docs/classes/Config.md +481 -0
  15. package/docs/classes/ConfigHelper.md +66 -0
  16. package/docs/classes/Datatoken.md +1123 -0
  17. package/docs/classes/DfRewards.md +345 -0
  18. package/docs/classes/DfStrategyV1.md +313 -0
  19. package/docs/classes/Dispenser.md +502 -0
  20. package/docs/classes/FixedRateExchange.md +1068 -0
  21. package/docs/classes/Logger.md +191 -0
  22. package/docs/classes/Nft.md +970 -0
  23. package/docs/classes/NftFactory.md +861 -0
  24. package/docs/classes/Provider.md +628 -0
  25. package/docs/classes/Router.md +645 -0
  26. package/docs/classes/SmartContract.md +193 -0
  27. package/docs/classes/SmartContractWithAddress.md +268 -0
  28. package/docs/classes/VeAllocate.md +372 -0
  29. package/docs/classes/VeFeeDistributor.md +325 -0
  30. package/docs/classes/VeFeeEstimate.md +281 -0
  31. package/docs/classes/VeOcean.md +513 -0
  32. package/docs/enums/LogLevel.md +63 -0
  33. package/docs/interfaces/AbiInput.md +63 -0
  34. package/docs/interfaces/AbiItem.md +107 -0
  35. package/docs/interfaces/AbiOutput.md +52 -0
  36. package/docs/interfaces/Arweave.md +32 -0
  37. package/docs/interfaces/Asset.md +227 -0
  38. package/docs/interfaces/AssetDatatoken.md +60 -0
  39. package/docs/interfaces/AssetLastEvent.md +63 -0
  40. package/docs/interfaces/AssetNft.md +105 -0
  41. package/docs/interfaces/AssetPrice.md +47 -0
  42. package/docs/interfaces/ComputeAlgorithm.md +82 -0
  43. package/docs/interfaces/ComputeAsset.md +56 -0
  44. package/docs/interfaces/ComputeEnvironment.md +173 -0
  45. package/docs/interfaces/ComputeJob.md +140 -0
  46. package/docs/interfaces/ComputeOutput.md +118 -0
  47. package/docs/interfaces/ComputeResult.md +52 -0
  48. package/docs/interfaces/ConsumeMarketFee.md +41 -0
  49. package/docs/interfaces/Credential.md +30 -0
  50. package/docs/interfaces/Credentials.md +30 -0
  51. package/docs/interfaces/DDO.md +137 -0
  52. package/docs/interfaces/DatatokenCreateParams.md +107 -0
  53. package/docs/interfaces/DatatokenRoles.md +30 -0
  54. package/docs/interfaces/DispenserCreationParams.md +63 -0
  55. package/docs/interfaces/DispenserParams.md +52 -0
  56. package/docs/interfaces/DispenserToken.md +85 -0
  57. package/docs/interfaces/DownloadResponse.md +30 -0
  58. package/docs/interfaces/Event.md +73 -0
  59. package/docs/interfaces/FeesInfo.md +74 -0
  60. package/docs/interfaces/FileInfo.md +118 -0
  61. package/docs/interfaces/Files.md +41 -0
  62. package/docs/interfaces/FixedPriceExchange.md +162 -0
  63. package/docs/interfaces/FreCreationParams.md +118 -0
  64. package/docs/interfaces/FreOrderParams.md +85 -0
  65. package/docs/interfaces/GraphqlQuery.md +69 -0
  66. package/docs/interfaces/Ipfs.md +32 -0
  67. package/docs/interfaces/Metadata.md +193 -0
  68. package/docs/interfaces/MetadataAlgorithm.md +69 -0
  69. package/docs/interfaces/MetadataAndTokenURI.md +107 -0
  70. package/docs/interfaces/MetadataProof.md +52 -0
  71. package/docs/interfaces/NftCreateData.md +74 -0
  72. package/docs/interfaces/NftRoles.md +52 -0
  73. package/docs/interfaces/Operation.md +145 -0
  74. package/docs/interfaces/OrderParams.md +52 -0
  75. package/docs/interfaces/PriceAndFees.md +52 -0
  76. package/docs/interfaces/ProviderComputeInitialize.md +41 -0
  77. package/docs/interfaces/ProviderComputeInitializeResults.md +30 -0
  78. package/docs/interfaces/ProviderFees.md +96 -0
  79. package/docs/interfaces/ProviderInitialize.md +52 -0
  80. package/docs/interfaces/PublisherTrustedAlgorithm.md +47 -0
  81. package/docs/interfaces/PublishingMarketFee.md +41 -0
  82. package/docs/interfaces/Purgatory.md +34 -0
  83. package/docs/interfaces/SearchQuery.md +67 -0
  84. package/docs/interfaces/Service.md +138 -0
  85. package/docs/interfaces/ServiceComputeOptions.md +63 -0
  86. package/docs/interfaces/ServiceEndpoint.md +41 -0
  87. package/docs/interfaces/Smartcontract-1.md +58 -0
  88. package/docs/interfaces/Stats.md +47 -0
  89. package/docs/interfaces/Template.md +30 -0
  90. package/docs/interfaces/TokenOrder.md +63 -0
  91. package/docs/interfaces/UrlFile.md +71 -0
  92. package/docs/interfaces/UserCustomParameters.md +7 -0
  93. package/docs/interfaces/ValidateMetadata.md +52 -0
  94. package/docs/modules.md +856 -0
  95. package/package.json +7 -8
  96. package/typedoc.json +4 -0
@@ -0,0 +1,193 @@
1
+ [@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / SmartContract
2
+
3
+ # Class: SmartContract
4
+
5
+ ## Hierarchy
6
+
7
+ - **`SmartContract`**
8
+
9
+ ↳ [`SmartContractWithAddress`](SmartContractWithAddress.md)
10
+
11
+ ↳ [`Datatoken`](Datatoken.md)
12
+
13
+ ↳ [`Nft`](Nft.md)
14
+
15
+ ## Table of contents
16
+
17
+ ### Constructors
18
+
19
+ - [constructor](SmartContract.md#constructor)
20
+
21
+ ### Properties
22
+
23
+ - [abi](SmartContract.md#abi)
24
+ - [config](SmartContract.md#config)
25
+ - [signer](SmartContract.md#signer)
26
+
27
+ ### Methods
28
+
29
+ - [amountToUnits](SmartContract.md#amounttounits)
30
+ - [getContract](SmartContract.md#getcontract)
31
+ - [getDefaultAbi](SmartContract.md#getdefaultabi)
32
+ - [getFairGasPrice](SmartContract.md#getfairgasprice)
33
+ - [unitsToAmount](SmartContract.md#unitstoamount)
34
+
35
+ ## Constructors
36
+
37
+ ### constructor
38
+
39
+ • **new SmartContract**(`signer`, `network?`, `config?`, `abi?`)
40
+
41
+ Instantiate the smart contract.
42
+
43
+ #### Parameters
44
+
45
+ | Name | Type | Description |
46
+ | :------ | :------ | :------ |
47
+ | `signer` | `Signer` | The signer object. |
48
+ | `network?` | `string` \| `number` | Network id or name |
49
+ | `config?` | [`Config`](Config.md) | The configuration object. |
50
+ | `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract |
51
+
52
+ #### Defined in
53
+
54
+ [contracts/SmartContract.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L25)
55
+
56
+ ## Properties
57
+
58
+ ### abi
59
+
60
+ • **abi**: [`AbiItem`](../interfaces/AbiItem.md)[]
61
+
62
+ #### Defined in
63
+
64
+ [contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14)
65
+
66
+ ___
67
+
68
+ ### config
69
+
70
+ • **config**: [`Config`](Config.md)
71
+
72
+ #### Defined in
73
+
74
+ [contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13)
75
+
76
+ ___
77
+
78
+ ### signer
79
+
80
+ • **signer**: `Signer`
81
+
82
+ #### Defined in
83
+
84
+ [contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12)
85
+
86
+ ## Methods
87
+
88
+ ### amountToUnits
89
+
90
+ ▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
91
+
92
+ Converts an amount of tokens to units
93
+
94
+ #### Parameters
95
+
96
+ | Name | Type | Description |
97
+ | :------ | :------ | :------ |
98
+ | `token` | `string` | The token to convert |
99
+ | `amount` | `string` | The amount of tokens to convert |
100
+ | `tokenDecimals?` | `number` | The number of decimals of the token |
101
+
102
+ #### Returns
103
+
104
+ `Promise`<`string`\>
105
+
106
+ - The converted amount in units
107
+
108
+ #### Defined in
109
+
110
+ [contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43)
111
+
112
+ ___
113
+
114
+ ### getContract
115
+
116
+ ▸ `Protected` **getContract**(`address`, `abi?`): `Contract`
117
+
118
+ Returns a contract instance for the given address
119
+
120
+ #### Parameters
121
+
122
+ | Name | Type | Description |
123
+ | :------ | :------ | :------ |
124
+ | `address` | `string` | The address of the contract |
125
+ | `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract |
126
+
127
+ #### Returns
128
+
129
+ `Contract`
130
+
131
+ - The contract instance
132
+
133
+ #### Defined in
134
+
135
+ [contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80)
136
+
137
+ ___
138
+
139
+ ### getDefaultAbi
140
+
141
+ ▸ `Abstract` **getDefaultAbi**(): `any`
142
+
143
+ #### Returns
144
+
145
+ `any`
146
+
147
+ #### Defined in
148
+
149
+ [contracts/SmartContract.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L16)
150
+
151
+ ___
152
+
153
+ ### getFairGasPrice
154
+
155
+ ▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\>
156
+
157
+ Retruns the gas price
158
+
159
+ #### Returns
160
+
161
+ `Promise`<`string`\>
162
+
163
+ - The fair gas price
164
+
165
+ #### Defined in
166
+
167
+ [contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70)
168
+
169
+ ___
170
+
171
+ ### unitsToAmount
172
+
173
+ ▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
174
+
175
+ Converts an amount of units to tokens
176
+
177
+ #### Parameters
178
+
179
+ | Name | Type | Description |
180
+ | :------ | :------ | :------ |
181
+ | `token` | `string` | The token to convert |
182
+ | `amount` | `string` | The amount of units to convert |
183
+ | `tokenDecimals?` | `number` | The number of decimals in the token |
184
+
185
+ #### Returns
186
+
187
+ `Promise`<`string`\>
188
+
189
+ - The converted amount in tokens
190
+
191
+ #### Defined in
192
+
193
+ [contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58)
@@ -0,0 +1,268 @@
1
+ [@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / SmartContractWithAddress
2
+
3
+ # Class: SmartContractWithAddress
4
+
5
+ ## Hierarchy
6
+
7
+ - [`SmartContract`](SmartContract.md)
8
+
9
+ ↳ **`SmartContractWithAddress`**
10
+
11
+ ↳↳ [`Dispenser`](Dispenser.md)
12
+
13
+ ↳↳ [`FixedRateExchange`](FixedRateExchange.md)
14
+
15
+ ↳↳ [`Router`](Router.md)
16
+
17
+ ↳↳ [`NftFactory`](NftFactory.md)
18
+
19
+ ↳↳ [`VeOcean`](VeOcean.md)
20
+
21
+ ↳↳ [`VeFeeDistributor`](VeFeeDistributor.md)
22
+
23
+ ↳↳ [`VeFeeEstimate`](VeFeeEstimate.md)
24
+
25
+ ↳↳ [`VeAllocate`](VeAllocate.md)
26
+
27
+ ↳↳ [`DfRewards`](DfRewards.md)
28
+
29
+ ↳↳ [`DfStrategyV1`](DfStrategyV1.md)
30
+
31
+ ## Table of contents
32
+
33
+ ### Constructors
34
+
35
+ - [constructor](SmartContractWithAddress.md#constructor)
36
+
37
+ ### Properties
38
+
39
+ - [abi](SmartContractWithAddress.md#abi)
40
+ - [address](SmartContractWithAddress.md#address)
41
+ - [config](SmartContractWithAddress.md#config)
42
+ - [contract](SmartContractWithAddress.md#contract)
43
+ - [signer](SmartContractWithAddress.md#signer)
44
+
45
+ ### Methods
46
+
47
+ - [amountToUnits](SmartContractWithAddress.md#amounttounits)
48
+ - [getContract](SmartContractWithAddress.md#getcontract)
49
+ - [getDefaultAbi](SmartContractWithAddress.md#getdefaultabi)
50
+ - [getFairGasPrice](SmartContractWithAddress.md#getfairgasprice)
51
+ - [unitsToAmount](SmartContractWithAddress.md#unitstoamount)
52
+
53
+ ## Constructors
54
+
55
+ ### constructor
56
+
57
+ • **new SmartContractWithAddress**(`address`, `signer`, `network?`, `config?`, `abi?`)
58
+
59
+ Instantiate the smart contract.
60
+
61
+ #### Parameters
62
+
63
+ | Name | Type | Description |
64
+ | :------ | :------ | :------ |
65
+ | `address` | `string` | The address of the contract. |
66
+ | `signer` | `Signer` | The signer object. |
67
+ | `network?` | `string` \| `number` | Network id or name |
68
+ | `config?` | [`Config`](Config.md) | The configuration object. |
69
+ | `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract |
70
+
71
+ #### Overrides
72
+
73
+ [SmartContract](SmartContract.md).[constructor](SmartContract.md#constructor)
74
+
75
+ #### Defined in
76
+
77
+ [contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17)
78
+
79
+ ## Properties
80
+
81
+ ### abi
82
+
83
+ • **abi**: [`AbiItem`](../interfaces/AbiItem.md)[]
84
+
85
+ #### Inherited from
86
+
87
+ [SmartContract](SmartContract.md).[abi](SmartContract.md#abi)
88
+
89
+ #### Defined in
90
+
91
+ [contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14)
92
+
93
+ ___
94
+
95
+ ### address
96
+
97
+ • **address**: `string`
98
+
99
+ #### Defined in
100
+
101
+ [contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6)
102
+
103
+ ___
104
+
105
+ ### config
106
+
107
+ • **config**: [`Config`](Config.md)
108
+
109
+ #### Inherited from
110
+
111
+ [SmartContract](SmartContract.md).[config](SmartContract.md#config)
112
+
113
+ #### Defined in
114
+
115
+ [contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13)
116
+
117
+ ___
118
+
119
+ ### contract
120
+
121
+ • **contract**: `Contract`
122
+
123
+ #### Defined in
124
+
125
+ [contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7)
126
+
127
+ ___
128
+
129
+ ### signer
130
+
131
+ • **signer**: `Signer`
132
+
133
+ #### Inherited from
134
+
135
+ [SmartContract](SmartContract.md).[signer](SmartContract.md#signer)
136
+
137
+ #### Defined in
138
+
139
+ [contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12)
140
+
141
+ ## Methods
142
+
143
+ ### amountToUnits
144
+
145
+ ▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
146
+
147
+ Converts an amount of tokens to units
148
+
149
+ #### Parameters
150
+
151
+ | Name | Type | Description |
152
+ | :------ | :------ | :------ |
153
+ | `token` | `string` | The token to convert |
154
+ | `amount` | `string` | The amount of tokens to convert |
155
+ | `tokenDecimals?` | `number` | The number of decimals of the token |
156
+
157
+ #### Returns
158
+
159
+ `Promise`<`string`\>
160
+
161
+ - The converted amount in units
162
+
163
+ #### Inherited from
164
+
165
+ [SmartContract](SmartContract.md).[amountToUnits](SmartContract.md#amounttounits)
166
+
167
+ #### Defined in
168
+
169
+ [contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43)
170
+
171
+ ___
172
+
173
+ ### getContract
174
+
175
+ ▸ `Protected` **getContract**(`address`, `abi?`): `Contract`
176
+
177
+ Returns a contract instance for the given address
178
+
179
+ #### Parameters
180
+
181
+ | Name | Type | Description |
182
+ | :------ | :------ | :------ |
183
+ | `address` | `string` | The address of the contract |
184
+ | `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract |
185
+
186
+ #### Returns
187
+
188
+ `Contract`
189
+
190
+ - The contract instance
191
+
192
+ #### Inherited from
193
+
194
+ [SmartContract](SmartContract.md).[getContract](SmartContract.md#getcontract)
195
+
196
+ #### Defined in
197
+
198
+ [contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80)
199
+
200
+ ___
201
+
202
+ ### getDefaultAbi
203
+
204
+ ▸ `Abstract` **getDefaultAbi**(): `any`
205
+
206
+ #### Returns
207
+
208
+ `any`
209
+
210
+ #### Inherited from
211
+
212
+ [SmartContract](SmartContract.md).[getDefaultAbi](SmartContract.md#getdefaultabi)
213
+
214
+ #### Defined in
215
+
216
+ [contracts/SmartContract.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L16)
217
+
218
+ ___
219
+
220
+ ### getFairGasPrice
221
+
222
+ ▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\>
223
+
224
+ Retruns the gas price
225
+
226
+ #### Returns
227
+
228
+ `Promise`<`string`\>
229
+
230
+ - The fair gas price
231
+
232
+ #### Inherited from
233
+
234
+ [SmartContract](SmartContract.md).[getFairGasPrice](SmartContract.md#getfairgasprice)
235
+
236
+ #### Defined in
237
+
238
+ [contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70)
239
+
240
+ ___
241
+
242
+ ### unitsToAmount
243
+
244
+ ▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\>
245
+
246
+ Converts an amount of units to tokens
247
+
248
+ #### Parameters
249
+
250
+ | Name | Type | Description |
251
+ | :------ | :------ | :------ |
252
+ | `token` | `string` | The token to convert |
253
+ | `amount` | `string` | The amount of units to convert |
254
+ | `tokenDecimals?` | `number` | The number of decimals in the token |
255
+
256
+ #### Returns
257
+
258
+ `Promise`<`string`\>
259
+
260
+ - The converted amount in tokens
261
+
262
+ #### Inherited from
263
+
264
+ [SmartContract](SmartContract.md).[unitsToAmount](SmartContract.md#unitstoamount)
265
+
266
+ #### Defined in
267
+
268
+ [contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58)