@oceanprotocol/lib 0.20.2 → 1.0.0-next.11

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 (152) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +1 -1
  3. package/dist/lib.js +2 -0
  4. package/dist/lib.js.map +1 -0
  5. package/dist/lib.modern.js +2 -0
  6. package/dist/lib.modern.js.map +1 -0
  7. package/dist/lib.module.js +2 -0
  8. package/dist/lib.module.js.map +1 -0
  9. package/dist/lib.umd.js +2 -0
  10. package/dist/lib.umd.js.map +1 -0
  11. package/dist/src/@types/Asset.d.ts +119 -0
  12. package/dist/{node/ocean/interfaces → src/@types}/Compute.d.ts +13 -12
  13. package/dist/src/@types/DDO/Credentials.d.ts +8 -0
  14. package/dist/src/@types/DDO/DDO.d.ts +58 -0
  15. package/dist/src/@types/DDO/Event.d.ts +27 -0
  16. package/dist/src/@types/DDO/Metadata.d.ts +126 -0
  17. package/dist/src/@types/DDO/Service.d.ts +124 -0
  18. package/dist/src/@types/Dispenser.d.ts +7 -0
  19. package/dist/src/@types/DownloadResponse.d.ts +4 -0
  20. package/dist/src/@types/Erc20.d.ts +11 -0
  21. package/dist/src/@types/Erc721.d.ts +12 -0
  22. package/dist/src/@types/FileMetadata.d.ts +38 -0
  23. package/dist/src/@types/FixedPrice.d.ts +19 -0
  24. package/dist/src/@types/Pool.d.ts +36 -0
  25. package/dist/src/@types/Provider.d.ts +16 -0
  26. package/dist/src/@types/Router.d.ts +59 -0
  27. package/dist/src/@types/index.d.ts +14 -0
  28. package/dist/src/aquarius/Aquarius.d.ts +36 -0
  29. package/dist/src/aquarius/index.d.ts +1 -0
  30. package/dist/src/factories/NFTFactory.d.ts +273 -0
  31. package/dist/src/factories/index.d.ts +1 -0
  32. package/dist/src/index.d.ts +7 -0
  33. package/dist/src/models/Config.d.ts +166 -0
  34. package/dist/src/models/index.d.ts +1 -0
  35. package/dist/src/pools/Router.d.ts +229 -0
  36. package/dist/src/pools/balancer/Pool.d.ts +408 -0
  37. package/dist/src/pools/balancer/index.d.ts +1 -0
  38. package/dist/src/pools/dispenser/Dispenser.d.ts +146 -0
  39. package/dist/src/pools/dispenser/index.d.ts +1 -0
  40. package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +375 -0
  41. package/dist/src/pools/fixedRate/index.d.ts +1 -0
  42. package/dist/src/pools/index.d.ts +3 -0
  43. package/dist/src/pools/ssContracts/SideStaking.d.ts +132 -0
  44. package/dist/src/pools/ssContracts/index.d.ts +1 -0
  45. package/dist/src/provider/Provider.d.ts +142 -0
  46. package/dist/src/provider/index.d.ts +1 -0
  47. package/dist/src/tokens/Datatoken.d.ts +362 -0
  48. package/dist/src/tokens/NFT.d.ts +355 -0
  49. package/dist/src/tokens/index.d.ts +2 -0
  50. package/dist/src/utils/ConfigHelper.d.ts +6 -0
  51. package/dist/src/utils/Constants.d.ts +2 -0
  52. package/dist/src/utils/ContractUtils.d.ts +11 -0
  53. package/dist/src/utils/ConversionTypeHelper.d.ts +3 -0
  54. package/dist/src/utils/DatatokenName.d.ts +11 -0
  55. package/dist/src/utils/DdoHelpers.d.ts +2 -0
  56. package/dist/src/utils/FetchHelper.d.ts +6 -0
  57. package/dist/{node → src}/utils/Logger.d.ts +0 -0
  58. package/dist/src/utils/SignatureUtils.d.ts +8 -0
  59. package/dist/src/utils/TokenUtils.d.ts +39 -0
  60. package/dist/src/utils/index.d.ts +9 -0
  61. package/dist/src/utils/minAbi.d.ts +2 -0
  62. package/dist/test/TestContractHandler.d.ts +44 -0
  63. package/dist/test/integration/ComputeFlow.test.d.ts +1 -0
  64. package/dist/test/integration/Provider.test.d.ts +1 -0
  65. package/dist/test/integration/PublishFlows.test.d.ts +1 -0
  66. package/dist/test/integration/SimplePublishConsumeFlow.test.d.ts +1 -0
  67. package/dist/test/integration/config.d.ts +3 -0
  68. package/dist/test/unit/NftFactory.test.d.ts +1 -0
  69. package/dist/test/unit/config.d.ts +3 -0
  70. package/dist/test/unit/pools/Router.test.d.ts +1 -0
  71. package/dist/test/unit/pools/balancer/Pool.test.d.ts +1 -0
  72. package/dist/test/unit/pools/dispenser/Dispenser.test.d.ts +1 -0
  73. package/dist/test/unit/pools/fixedRate/FixedRateExchange.test.d.ts +1 -0
  74. package/dist/test/unit/pools/ssContracts/SideStaking.test.d.ts +1 -0
  75. package/dist/test/unit/tokens/Datatoken.test.d.ts +1 -0
  76. package/dist/test/unit/tokens/Nft.test.d.ts +1 -0
  77. package/docs/beginners_guide.md +4 -4
  78. package/docs/overview.md +100 -9
  79. package/docs/quickstart_marketplace.md +34 -33
  80. package/docs/quickstart_simple.md +18 -16
  81. package/package.json +41 -33
  82. package/dist/node/Instantiable.abstract.d.ts +0 -25
  83. package/dist/node/balancer/OceanPool.d.ts +0 -95
  84. package/dist/node/balancer/Pool.d.ts +0 -56
  85. package/dist/node/balancer/PoolFactory.d.ts +0 -15
  86. package/dist/node/datatokens/ContractEvent.d.ts +0 -19
  87. package/dist/node/datatokens/ContractHandler.d.ts +0 -12
  88. package/dist/node/datatokens/Datatokens.d.ts +0 -44
  89. package/dist/node/datatokens/EventHandler.d.ts +0 -19
  90. package/dist/node/datatokens/Network.d.ts +0 -5
  91. package/dist/node/datatokens/Web3Provider.d.ts +0 -5
  92. package/dist/node/datatokens/contracts/ContractBase.d.ts +0 -27
  93. package/dist/node/ddo/DDO.d.ts +0 -36
  94. package/dist/node/ddo/interfaces/AdditionalInformation.d.ts +0 -16
  95. package/dist/node/ddo/interfaces/Authentication.d.ts +0 -4
  96. package/dist/node/ddo/interfaces/BestPrice.d.ts +0 -10
  97. package/dist/node/ddo/interfaces/Consumable.d.ts +0 -5
  98. package/dist/node/ddo/interfaces/Credentials.d.ts +0 -9
  99. package/dist/node/ddo/interfaces/Curation.d.ts +0 -6
  100. package/dist/node/ddo/interfaces/DataTokenInfo.d.ts +0 -10
  101. package/dist/node/ddo/interfaces/EditableMetadata.d.ts +0 -9
  102. package/dist/node/ddo/interfaces/EditableMetadataLinks.d.ts +0 -5
  103. package/dist/node/ddo/interfaces/Event.d.ts +0 -7
  104. package/dist/node/ddo/interfaces/File.d.ts +0 -13
  105. package/dist/node/ddo/interfaces/Metadata.d.ts +0 -15
  106. package/dist/node/ddo/interfaces/MetadataAlgorithm.d.ts +0 -12
  107. package/dist/node/ddo/interfaces/MetadataMain.d.ts +0 -12
  108. package/dist/node/ddo/interfaces/Proof.d.ts +0 -6
  109. package/dist/node/ddo/interfaces/PublicKey.d.ts +0 -8
  110. package/dist/node/ddo/interfaces/PurgatoryData.d.ts +0 -4
  111. package/dist/node/ddo/interfaces/Service.d.ts +0 -99
  112. package/dist/node/ddo/interfaces/ServicePrices.d.ts +0 -4
  113. package/dist/node/ddo/interfaces/Status.d.ts +0 -5
  114. package/dist/node/ddo/interfaces/index.d.ts +0 -17
  115. package/dist/node/dispenser/Dispenser.d.ts +0 -44
  116. package/dist/node/exchange/FixedRateExchange.d.ts +0 -59
  117. package/dist/node/index.d.ts +0 -1
  118. package/dist/node/lib.d.ts +0 -15
  119. package/dist/node/lib.js +0 -2
  120. package/dist/node/lib.js.map +0 -1
  121. package/dist/node/lib.module.js +0 -2
  122. package/dist/node/lib.module.js.map +0 -1
  123. package/dist/node/lib.umd.js +0 -2
  124. package/dist/node/lib.umd.js.map +0 -1
  125. package/dist/node/metadatacache/MetadataCache.d.ts +0 -41
  126. package/dist/node/metadatacache/OnChainMetaData.d.ts +0 -31
  127. package/dist/node/models/Config.d.ts +0 -31
  128. package/dist/node/ocean/Account.d.ts +0 -16
  129. package/dist/node/ocean/Accounts.d.ts +0 -9
  130. package/dist/node/ocean/Assets.d.ts +0 -56
  131. package/dist/node/ocean/AssetsCredential.d.ts +0 -6
  132. package/dist/node/ocean/Compute.d.ts +0 -75
  133. package/dist/node/ocean/DID.d.ts +0 -8
  134. package/dist/node/ocean/EventAccessControl.d.ts +0 -9
  135. package/dist/node/ocean/Ocean.d.ts +0 -34
  136. package/dist/node/ocean/OceanAuth.d.ts +0 -15
  137. package/dist/node/ocean/Versions.d.ts +0 -25
  138. package/dist/node/ocean/utils/SignatureUtils.d.ts +0 -13
  139. package/dist/node/ocean/utils/Utils.d.ts +0 -8
  140. package/dist/node/ocean/utils/WebServiceConnector.d.ts +0 -16
  141. package/dist/node/provider/Provider.d.ts +0 -56
  142. package/dist/node/utils/AssetResolverHelper.d.ts +0 -8
  143. package/dist/node/utils/ConfigHelper.d.ts +0 -17
  144. package/dist/node/utils/ContractUtils.d.ts +0 -5
  145. package/dist/node/utils/ConversionTypeHelpers.d.ts +0 -8
  146. package/dist/node/utils/Datatokens.d.ts +0 -7
  147. package/dist/node/utils/GeneratorHelpers.d.ts +0 -1
  148. package/dist/node/utils/PromiseResolver.d.ts +0 -3
  149. package/dist/node/utils/SubscribableObserver.d.ts +0 -12
  150. package/dist/node/utils/SubscribablePromise.d.ts +0 -14
  151. package/dist/node/utils/Timeout.d.ts +0 -1
  152. package/dist/node/utils/index.d.ts +0 -9
@@ -0,0 +1,59 @@
1
+ export interface Operation {
2
+ /**
3
+ * used only for FixedRate or Dispenser, but needs to be filled even for pool
4
+ * @type {string}
5
+ */
6
+ exchangeIds: string;
7
+ /**
8
+ * pool Address
9
+ * @type {string}
10
+ */
11
+ source: string;
12
+ /**
13
+ * operation:
14
+ * 0 - swapExactAmountIn
15
+ * 1 - swapExactAmountOut
16
+ * 2 - FixedRateExchange
17
+ * 3 - Dispenser
18
+ * @type {number}
19
+ */
20
+ operation: number;
21
+ /**
22
+ * token in address
23
+ * @type {string}
24
+ */
25
+ tokenIn: string;
26
+ /**
27
+ * when swapExactAmountIn is EXACT amount IN
28
+ * expressed in Wei
29
+ * @type {string | number}
30
+ */
31
+ amountsIn: string | number;
32
+ /**
33
+ * token out address
34
+ * @type {string}
35
+ */
36
+ tokenOut: string;
37
+ /**
38
+ * when swapExactAmountIn is MIN amount OUT
39
+ * expressed in Wei
40
+ * @type {string | number}
41
+ */
42
+ amountsOut: string | number;
43
+ /**
44
+ * max price (only for pools)
45
+ * expressed in Wei
46
+ * @type {string | number}
47
+ */
48
+ maxPrice: string | number;
49
+ /**
50
+ * swap fee amount
51
+ * @type {string}
52
+ */
53
+ swapMarketFee: string;
54
+ /**
55
+ * market fee address to receive fees
56
+ * @type {string}
57
+ */
58
+ marketFeeAddress: string;
59
+ }
@@ -0,0 +1,14 @@
1
+ export * from './DDO/DDO';
2
+ export * from './Asset';
3
+ export * from './DDO/Service';
4
+ export * from './DDO/Credentials';
5
+ export * from './DDO/Metadata';
6
+ export * from './FileMetadata';
7
+ export * from './Compute';
8
+ export * from './Provider';
9
+ export * from './FixedPrice';
10
+ export * from './Pool';
11
+ export * from './Erc20';
12
+ export * from './Erc721';
13
+ export * from './Dispenser';
14
+ export * from './Router';
@@ -0,0 +1,36 @@
1
+ import { Asset, DDO, ValidateMetadata } from '../@types/';
2
+ export declare class Aquarius {
3
+ aquariusURL: any;
4
+ /**
5
+ * Instantiate Aquarius
6
+ * @param {String} aquariusURL
7
+ */
8
+ constructor(aquariusURL: string);
9
+ /** Resolves a DID
10
+ * @param {string} did
11
+ * @param {AbortSignal} signal abort signal
12
+ * @return {Promise<Asset>} Asset
13
+ */
14
+ resolve(did: string, signal?: AbortSignal): Promise<Asset>;
15
+ /**
16
+ * Simple blocking sleep function
17
+ */
18
+ sleep(ms: number): Promise<unknown>;
19
+ /**
20
+ * Blocks until Aqua will cache the did (or the update for that did) or timeouts
21
+
22
+ * @param {string} did DID of the asset.
23
+ * @param {string} txid used when the did exists and we expect an update with that txid.
24
+ * @param {AbortSignal} signal abort signal
25
+ * @return {Promise<DDO>} DDO of the asset.
26
+ */
27
+ waitForAqua(did: string, txid?: string, signal?: AbortSignal): Promise<Asset>;
28
+ /**
29
+ * Validate DDO content
30
+ * @param {DDO} ddo DID Descriptor Object content.
31
+ * @param {AbortSignal} signal abort signal
32
+ * @return {Promise<ValidateMetadata>}.
33
+ */
34
+ validate(ddo: DDO, signal?: AbortSignal): Promise<ValidateMetadata>;
35
+ }
36
+ export default Aquarius;
@@ -0,0 +1 @@
1
+ export * from './Aquarius';
@@ -0,0 +1,273 @@
1
+ import { Contract } from 'web3-eth-contract';
2
+ import Web3 from 'web3';
3
+ import { TransactionReceipt } from 'web3-core';
4
+ import { AbiItem } from 'web3-utils';
5
+ import { Config } from '../models/index.js';
6
+ import { ProviderFees, FreCreationParams, Erc20CreateParams, PoolCreationParams, DispenserCreationParams } from '../@types/index.js';
7
+ interface Template {
8
+ templateAddress: string;
9
+ isActive: boolean;
10
+ }
11
+ export interface TokenOrder {
12
+ tokenAddress: string;
13
+ consumer: string;
14
+ serviceIndex: number;
15
+ _providerFees: ProviderFees;
16
+ }
17
+ export interface NftCreateData {
18
+ name: string;
19
+ symbol: string;
20
+ templateIndex: number;
21
+ tokenURI: string;
22
+ }
23
+ /**
24
+ * Provides an interface for NFT Factory contract
25
+ */
26
+ export declare class NftFactory {
27
+ GASLIMIT_DEFAULT: number;
28
+ factory721Address: string;
29
+ factory721Abi: AbiItem | AbiItem[];
30
+ web3: Web3;
31
+ config: Config;
32
+ factory721: Contract;
33
+ /**
34
+ * Instantiate Datatokens.
35
+ * @param {String} factory721Address
36
+ * @param {AbiItem | AbiItem[]} factory721ABI
37
+ * @param {Web3} web3
38
+ */
39
+ constructor(factory721Address: string, web3: Web3, factory721Abi?: AbiItem | AbiItem[], config?: Config);
40
+ /**
41
+ * Get estimated gas cost for deployERC721Contract value
42
+ * @param {String} address
43
+ * @param {String} nftData
44
+ * @return {Promise<string>} NFT datatoken address
45
+ */
46
+ estGasCreateNFT(address: string, nftData: NftCreateData): Promise<string>;
47
+ /**
48
+ * Create new NFT
49
+ * @param {String} address
50
+ * @param {NFTCreateData} nftData
51
+ * @return {Promise<string>} NFT datatoken address
52
+ */
53
+ createNFT(address: string, nftData: NftCreateData): Promise<string>;
54
+ /** Get Current NFT Count (NFT created)
55
+ * @return {Promise<number>} Number of NFT created from this factory
56
+ */
57
+ getCurrentNFTCount(): Promise<number>;
58
+ /** Get Current Datatoken Count
59
+ * @return {Promise<number>} Number of DTs created from this factory
60
+ */
61
+ getCurrentTokenCount(): Promise<number>;
62
+ /** Get Factory Owner
63
+ * @return {Promise<string>} Factory Owner address
64
+ */
65
+ getOwner(): Promise<string>;
66
+ /** Get Current NFT Template Count
67
+ * @return {Promise<number>} Number of NFT Template added to this factory
68
+ */
69
+ getCurrentNFTTemplateCount(): Promise<number>;
70
+ /** Get Current Template Datatoken (ERC20) Count
71
+ * @return {Promise<number>} Number of ERC20 Template added to this factory
72
+ */
73
+ getCurrentTokenTemplateCount(): Promise<number>;
74
+ /** Get NFT Template
75
+ * @param {Number} index Template index
76
+ * @return {Promise<Template>} Number of Template added to this factory
77
+ */
78
+ getNFTTemplate(index: number): Promise<Template>;
79
+ /** Get Datatoken(erc20) Template
80
+ * @param {Number} index Template index
81
+ * @return {Promise<Template>} DT Template info
82
+ */
83
+ getTokenTemplate(index: number): Promise<Template>;
84
+ /** Check if ERC20 is deployed from the factory
85
+ * @param {String} datatoken Datatoken address we want to check
86
+ * @return {Promise<Boolean>} return true if deployed from this factory
87
+ */
88
+ checkDatatoken(datatoken: string): Promise<Boolean>;
89
+ /** Check if NFT is deployed from the factory
90
+ * @param {String} nftAddress nftAddress address we want to check
91
+ * @return {Promise<String>} return address(0) if it's not, or the nftAddress if true
92
+ */
93
+ checkNFT(nftAddress: string): Promise<String>;
94
+ /**
95
+ * Estimate gas cost for add721TokenTemplate method
96
+ * @param {String} address
97
+ * @param {String} templateAddress template address to add
98
+ * @return {Promise<TransactionReceipt>}
99
+ */
100
+ estGasAddNFTTemplate(address: string, templateAddress: string): Promise<any>;
101
+ /**
102
+ * Add a new erc721 token template - only factory Owner
103
+ * @param {String} address
104
+ * @param {String} templateAddress template address to add
105
+ * @return {Promise<TransactionReceipt>}
106
+ */
107
+ addNFTTemplate(address: string, templateAddress: string): Promise<TransactionReceipt>;
108
+ /**
109
+ * Estimate gas cost for disable721TokenTemplate method
110
+ * @param {String} address
111
+ * @param {Number} templateIndex index of the template we want to disable
112
+ * @return {Promise<TransactionReceipt>} current token template count
113
+ */
114
+ estGasDisableNFTTemplate(address: string, templateIndex: number): Promise<any>;
115
+ /**
116
+ * Disable token template - only factory Owner
117
+ * @param {String} address
118
+ * @param {Number} templateIndex index of the template we want to disable
119
+ * @return {Promise<TransactionReceipt>} current token template count
120
+ */
121
+ disableNFTTemplate(address: string, templateIndex: number): Promise<TransactionReceipt>;
122
+ /**
123
+ * Reactivate a previously disabled token template - only factory Owner
124
+ * @param {String} address
125
+ * @param {Number} templateIndex index of the template we want to reactivate
126
+ * @return {Promise<TransactionReceipt>} current token template count
127
+ */
128
+ estGasReactivateNFTTemplate(address: string, templateIndex: number): Promise<any>;
129
+ /**
130
+ * Reactivate a previously disabled token template - only factory Owner
131
+ * @param {String} address
132
+ * @param {Number} templateIndex index of the template we want to reactivate
133
+ * @return {Promise<TransactionReceipt>} current token template count
134
+ */
135
+ reactivateNFTTemplate(address: string, templateIndex: number): Promise<TransactionReceipt>;
136
+ /**
137
+ * Estimate gas cost for addTokenTemplate method
138
+ * @param {String} address
139
+ * @param {String} templateAddress template address to add
140
+ * @return {Promise<TransactionReceipt>}
141
+ */
142
+ estGasAddTokenTemplate(address: string, templateAddress: string): Promise<any>;
143
+ /**
144
+ * Add a new erc721 token template - only factory Owner
145
+ * @param {String} address
146
+ * @param {String} templateAddress template address to add
147
+ * @return {Promise<TransactionReceipt>}
148
+ */
149
+ addTokenTemplate(address: string, templateAddress: string): Promise<TransactionReceipt>;
150
+ /**
151
+ * Estimate gas cost for disableTokenTemplate method
152
+ * @param {String} address
153
+ * @param {Number} templateIndex index of the template we want to disable
154
+ * @return {Promise<TransactionReceipt>} current token template count
155
+ */
156
+ estGasDisableTokenTemplate(address: string, templateIndex: number): Promise<any>;
157
+ /**
158
+ * Disable token template - only factory Owner
159
+ * @param {String} address
160
+ * @param {Number} templateIndex index of the template we want to disable
161
+ * @return {Promise<TransactionReceipt>} current token template count
162
+ */
163
+ disableTokenTemplate(address: string, templateIndex: number): Promise<TransactionReceipt>;
164
+ /**
165
+ * Estimate gas cost for reactivateTokenTemplate method
166
+ * @param {String} address
167
+ * @param {Number} templateIndex index of the template we want to reactivate
168
+ * @return {Promise<TransactionReceipt>} current token template count
169
+ */
170
+ estGasReactivateTokenTemplate(address: string, templateIndex: number): Promise<any>;
171
+ /**
172
+ * Reactivate a previously disabled token template - only factory Owner
173
+ * @param {String} address
174
+ * @param {Number} templateIndex index of the template we want to reactivate
175
+ * @return {Promise<TransactionReceipt>} current token template count
176
+ */
177
+ reactivateTokenTemplate(address: string, templateIndex: number): Promise<TransactionReceipt>;
178
+ /** Estimate gas cost for startMultipleTokenOrder method
179
+ * @param address Caller address
180
+ * @param orders an array of struct tokenOrder
181
+ * @return {Promise<TransactionReceipt>} transaction receipt
182
+ */
183
+ estGasStartMultipleTokenOrder(address: string, orders: TokenOrder[]): Promise<any>;
184
+ /**
185
+ * @dev startMultipleTokenOrder
186
+ * Used as a proxy to order multiple services
187
+ * Users can have inifinite approvals for fees for factory instead of having one approval/ erc20 contract
188
+ * Requires previous approval of all :
189
+ * - consumeFeeTokens
190
+ * - publishMarketFeeTokens
191
+ * - erc20 datatokens
192
+ * @param address Caller address
193
+ * @param orders an array of struct tokenOrder
194
+ * @return {Promise<TransactionReceipt>} transaction receipt
195
+ */
196
+ startMultipleTokenOrder(address: string, orders: TokenOrder[]): Promise<TransactionReceipt>;
197
+ /**
198
+ * Estimate gas cost for createNftWithErc method
199
+ * @param address Caller address
200
+ * @param _NftCreateData input data for nft creation
201
+ * @param _ErcCreateData input data for erc20 creation
202
+ * @return {Promise<TransactionReceipt>} transaction receipt
203
+ */
204
+ estGasCreateNftWithErc(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams): Promise<any>;
205
+ /**
206
+ * @dev createNftWithErc
207
+ * Creates a new NFT, then a ERC20,all in one call
208
+ * @param address Caller address
209
+ * @param _NftCreateData input data for nft creation
210
+ * @param _ErcCreateData input data for erc20 creation
211
+ * @return {Promise<TransactionReceipt>} transaction receipt
212
+ */
213
+ createNftWithErc(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams): Promise<TransactionReceipt>;
214
+ /**
215
+ * Estimate gas cost for createNftErcWithPool method
216
+ * @param address Caller address
217
+ * @param nftCreateData input data for NFT Creation
218
+ * @param ercParams input data for ERC20 Creation
219
+ * @param poolParams input data for Pool Creation
220
+ * @return {Promise<TransactionReceipt>} transaction receipt
221
+ */
222
+ estGasCreateNftErcWithPool(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, poolParams: PoolCreationParams): Promise<any>;
223
+ /**
224
+ * @dev createNftErcWithPool
225
+ * Creates a new NFT, then a ERC20, then a Pool, all in one call
226
+ * Use this carefully, because if Pool creation fails, you are still going to pay a lot of gas
227
+ * @param address Caller address
228
+ * @param nftCreateData input data for NFT Creation
229
+ * @param ercParams input data for ERC20 Creation
230
+ * @param poolParams input data for Pool Creation
231
+ * @return {Promise<TransactionReceipt>} transaction receipt
232
+ */
233
+ createNftErcWithPool(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, poolParams: PoolCreationParams): Promise<TransactionReceipt>;
234
+ /** Estimate gas cost for createNftErcWithFixedRate method
235
+ * @param address Caller address
236
+ * @param nftCreateData input data for NFT Creation
237
+ * @param ercParams input data for ERC20 Creation
238
+ * @param freParams input data for FixedRate Creation
239
+ * @return {Promise<TransactionReceipt>} transaction receipt
240
+ */
241
+ estGasCreateNftErcWithFixedRate(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, freParams: FreCreationParams): Promise<any>;
242
+ /**
243
+ * @dev createNftErcWithFixedRate
244
+ * Creates a new NFT, then a ERC20, then a FixedRateExchange, all in one call
245
+ * Use this carefully, because if Fixed Rate creation fails, you are still going to pay a lot of gas
246
+ * @param address Caller address
247
+ * @param nftCreateData input data for NFT Creation
248
+ * @param ercParams input data for ERC20 Creation
249
+ * @param freParams input data for FixedRate Creation
250
+ * @return {Promise<TransactionReceipt>} transaction receipt
251
+ */
252
+ createNftErcWithFixedRate(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, freParams: FreCreationParams): Promise<TransactionReceipt>;
253
+ /** Estimate gas cost for createNftErcWithFixedRate method
254
+ * @param address Caller address
255
+ * @param nftCreateData input data for NFT Creation
256
+ * @param ercParams input data for ERC20 Creation
257
+ * @param dispenserParams input data for Dispenser Creation
258
+ * @return {Promise<TransactionReceipt>} transaction receipt
259
+ */
260
+ estGasCreateNftErcWithDispenser(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, dispenserParams: DispenserCreationParams): Promise<any>;
261
+ /**
262
+ * @dev createNftErcWithDispenser
263
+ * Creates a new NFT, then a ERC20, then a Dispenser, all in one call
264
+ * Use this carefully, because if Dispenser creation fails, you are still going to pay a lot of gas
265
+ * @param address Caller address
266
+ * @param nftCreateData input data for NFT Creation
267
+ * @param ercParams input data for ERC20 Creation
268
+ * @param dispenserParams input data for Dispenser Creation
269
+ * @return {Promise<TransactionReceipt>} transaction receipt
270
+ */
271
+ createNftErcWithDispenser(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, dispenserParams: DispenserCreationParams): Promise<TransactionReceipt>;
272
+ }
273
+ export {};
@@ -0,0 +1 @@
1
+ export * from './NFTFactory';
@@ -0,0 +1,7 @@
1
+ export * from './pools';
2
+ export * from './tokens';
3
+ export * from './factories';
4
+ export * from './models';
5
+ export * from './utils';
6
+ export * from './@types';
7
+ export * from './provider';
@@ -0,0 +1,166 @@
1
+ import { LogLevel } from '../utils/Logger';
2
+ import { AbiItem } from 'web3-utils/types';
3
+ export declare class Config {
4
+ /**
5
+ * Ethereum node URL.
6
+ * @type {string}
7
+ */
8
+ nodeUri?: string;
9
+ /**
10
+ * Address of Provider.
11
+ * @type {string}
12
+ */
13
+ providerAddress?: string;
14
+ /**
15
+ * Metadata Store URL.
16
+ * @type {string}
17
+ */
18
+ metadataCacheUri?: string;
19
+ /**
20
+ * Provider URL.
21
+ * @type {string}
22
+ */
23
+ providerUri?: string;
24
+ /**
25
+ * Web3 Provider.
26
+ * @type {any}
27
+ */
28
+ web3Provider?: any;
29
+ /**
30
+ * Ocean Token address
31
+ * @type {string}
32
+ */
33
+ oceanTokenAddress?: string;
34
+ /**
35
+ * Factory address
36
+ * @type {string}
37
+ */
38
+ erc721FactoryAddress?: string;
39
+ /**
40
+ * Factory ABI
41
+ * @type {string}
42
+ */
43
+ erc721FFactoryABI?: AbiItem | AbiItem[];
44
+ /**
45
+ * datatokens ABI
46
+ * @type {string}
47
+ */
48
+ datatokensABI?: AbiItem | AbiItem[];
49
+ /**
50
+ * Pool Template address
51
+ * @type {string}
52
+ */
53
+ poolTemplateAddress?: string;
54
+ /**
55
+ * Pool Factory ABI
56
+ * @type {string}
57
+ */
58
+ poolFactoryABI?: AbiItem | AbiItem[];
59
+ /**
60
+ * Pool ABI
61
+ * @type {string}
62
+ */
63
+ poolABI?: AbiItem | AbiItem[];
64
+ /**
65
+ * FixedRateExchangeAddress
66
+ * @type {string}
67
+ */
68
+ fixedRateExchangeAddress?: string;
69
+ /**
70
+ * FixedRateExchangeAddressABI
71
+ * @type {any}
72
+ */
73
+ fixedRateExchangeAddressABI?: AbiItem | AbiItem[];
74
+ /**
75
+ * DispenserAddress
76
+ * @type {string}
77
+ */
78
+ dispenserAddress?: string;
79
+ /**
80
+ * DispenserABI
81
+ * @type {any}
82
+ */
83
+ dispenserABI?: AbiItem | AbiItem[];
84
+ /**
85
+ * OPFCommunityFeeCollector
86
+ * @type {string}
87
+ */
88
+ opfCommunityFeeCollector?: string;
89
+ /**
90
+ * SideStaking address
91
+ * @type {string}
92
+ */
93
+ sideStakingAddress?: string;
94
+ /**
95
+ * block number of the deployment
96
+ * @type {number}
97
+ */
98
+ startBlock?: number;
99
+ /**
100
+ * Log level.
101
+ * @type {boolean | LogLevel}
102
+ */
103
+ verbose?: boolean | LogLevel;
104
+ /**
105
+ * Message shown when the user creates its own token.
106
+ * @type {string}
107
+ */
108
+ authMessage?: string;
109
+ /**
110
+ * Token expiration time in ms.
111
+ * @type {number}
112
+ */
113
+ authTokenExpiration?: number;
114
+ /**
115
+ * Parity config
116
+ * @type {string}
117
+ */
118
+ parityUri?: string;
119
+ threshold?: number;
120
+ /**
121
+ * Chain ID
122
+ * @type {number}
123
+ */
124
+ chainId: number;
125
+ /**
126
+ * Network name ex: mainnet, rinkeby, polygon
127
+ * @type {string}
128
+ */
129
+ network: string;
130
+ /**
131
+ * Url of the relevant subgraph instance ex: https://subgraph.mainnet.oceanprotocol.com
132
+ * @type {string}
133
+ */
134
+ subgraphUri: string;
135
+ /**
136
+ * Url of the blockchain exporer ex: https://etherscan.io
137
+ * @type {string}
138
+ */
139
+ explorerUri: string;
140
+ /**
141
+ * Ocean toke symbol on the chain, it's used just for convenience to reduce number of calls
142
+ * @type {string}
143
+ */
144
+ oceanTokenSymbol: string;
145
+ /**
146
+ * Specify the transaction Block Timeout
147
+ * @type {number}
148
+ */
149
+ transactionBlockTimeout: number;
150
+ /**
151
+ * Specify the transaction Confirmation Blocks
152
+ * @type {number}
153
+ */
154
+ transactionConfirmationBlocks: number;
155
+ /**
156
+ * Specify the transaction Polling Blocks Timeout
157
+ * @type {number}
158
+ */
159
+ transactionPollingTimeout: number;
160
+ /**
161
+ * Specify the multiplier for the gas fee
162
+ * @type {number}
163
+ */
164
+ gasFeeMultiplier: number;
165
+ }
166
+ export default Config;
@@ -0,0 +1 @@
1
+ export * from './Config';