@oceanprotocol/lib 1.0.0-next.1 → 1.0.0-next.13

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 (103) hide show
  1. package/CHANGELOG.md +111 -1
  2. package/dist/lib.js +1 -1
  3. package/dist/lib.js.map +1 -1
  4. package/dist/lib.modern.js +1 -1
  5. package/dist/lib.modern.js.map +1 -1
  6. package/dist/lib.module.js +1 -1
  7. package/dist/lib.module.js.map +1 -1
  8. package/dist/lib.umd.js +1 -1
  9. package/dist/lib.umd.js.map +1 -1
  10. package/dist/src/@types/Asset.d.ts +119 -0
  11. package/dist/src/{src/@types → @types}/Compute.d.ts +17 -0
  12. package/dist/src/{src/@types → @types}/DDO/Credentials.d.ts +0 -0
  13. package/dist/src/@types/DDO/DDO.d.ts +58 -0
  14. package/dist/src/@types/DDO/Event.d.ts +27 -0
  15. package/dist/src/@types/DDO/Metadata.d.ts +126 -0
  16. package/dist/src/@types/DDO/Service.d.ts +124 -0
  17. package/dist/src/{src/interfaces/DispenserInterface.d.ts → @types/Dispenser.d.ts} +0 -0
  18. package/dist/src/@types/DownloadResponse.d.ts +4 -0
  19. package/dist/src/{src/interfaces/Erc20Interface.d.ts → @types/Erc20.d.ts} +0 -0
  20. package/dist/src/@types/Erc721.d.ts +12 -0
  21. package/dist/src/@types/FileMetadata.d.ts +38 -0
  22. package/dist/src/{src/interfaces/FixedRateInterface.d.ts → @types/FixedPrice.d.ts} +1 -1
  23. package/dist/src/{src/interfaces/PoolInterface.d.ts → @types/Pool.d.ts} +4 -4
  24. package/dist/src/{src/@types → @types}/Provider.d.ts +3 -2
  25. package/dist/src/@types/Router.d.ts +59 -0
  26. package/dist/src/{src/@types → @types}/index.d.ts +6 -0
  27. package/dist/src/aquarius/Aquarius.d.ts +32 -0
  28. package/dist/src/{src/aquarius → aquarius}/index.d.ts +0 -0
  29. package/dist/src/factories/NFTFactory.d.ts +273 -0
  30. package/dist/src/{src/factories → factories}/index.d.ts +0 -0
  31. package/dist/src/{src/index.d.ts → index.d.ts} +0 -1
  32. package/dist/src/models/Config.d.ts +166 -0
  33. package/dist/src/{src/models → models}/index.d.ts +0 -0
  34. package/dist/src/pools/Router.d.ts +229 -0
  35. package/dist/src/pools/balancer/Pool.d.ts +365 -0
  36. package/dist/src/{src/pools → pools}/balancer/index.d.ts +0 -0
  37. package/dist/src/pools/dispenser/Dispenser.d.ts +146 -0
  38. package/dist/src/{src/pools → pools}/dispenser/index.d.ts +0 -0
  39. package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +375 -0
  40. package/dist/src/{src/pools → pools}/fixedRate/index.d.ts +0 -0
  41. package/dist/src/{src/pools → pools}/index.d.ts +0 -0
  42. package/dist/src/pools/ssContracts/SideStaking.d.ts +132 -0
  43. package/dist/src/{src/pools → pools}/ssContracts/index.d.ts +0 -0
  44. package/dist/src/provider/Provider.d.ts +147 -0
  45. package/dist/src/{src/provider → provider}/index.d.ts +0 -0
  46. package/dist/src/tokens/Datatoken.d.ts +362 -0
  47. package/dist/src/tokens/NFT.d.ts +355 -0
  48. package/dist/src/{src/tokens → tokens}/index.d.ts +0 -0
  49. package/dist/src/{src/utils → utils}/ConfigHelper.d.ts +1 -1
  50. package/dist/src/{src/utils → utils}/Constants.d.ts +1 -0
  51. package/dist/src/utils/ContractUtils.d.ts +11 -0
  52. package/dist/src/{src/utils → utils}/ConversionTypeHelper.d.ts +0 -0
  53. package/dist/src/utils/DatatokenName.d.ts +11 -0
  54. package/dist/src/{src/utils → utils}/DdoHelpers.d.ts +0 -0
  55. package/dist/src/{src/utils → utils}/FetchHelper.d.ts +3 -2
  56. package/dist/src/utils/General.d.ts +4 -0
  57. package/dist/src/{src/utils → utils}/Logger.d.ts +0 -0
  58. package/dist/src/{src/utils → utils}/SignatureUtils.d.ts +0 -0
  59. package/dist/src/utils/TokenUtils.d.ts +39 -0
  60. package/dist/src/{src/utils → utils}/index.d.ts +3 -2
  61. package/dist/src/utils/minAbi.d.ts +2 -0
  62. package/dist/{src/test → test}/TestContractHandler.d.ts +0 -0
  63. package/dist/{src/test → test}/integration/ComputeFlow.test.d.ts +0 -0
  64. package/dist/{src/test → test}/integration/Provider.test.d.ts +0 -0
  65. package/dist/{src/test → test}/integration/PublishFlows.test.d.ts +0 -0
  66. package/dist/{src/test → test}/integration/SimplePublishConsumeFlow.test.d.ts +0 -0
  67. package/dist/{src/test → test}/integration/config.d.ts +0 -0
  68. package/dist/{src/test → test}/unit/NftFactory.test.d.ts +0 -0
  69. package/dist/{src/test → test}/unit/config.d.ts +0 -0
  70. package/dist/{src/test → test}/unit/pools/Router.test.d.ts +0 -0
  71. package/dist/{src/test → test}/unit/pools/balancer/Pool.test.d.ts +0 -0
  72. package/dist/{src/test → test}/unit/pools/dispenser/Dispenser.test.d.ts +0 -0
  73. package/dist/{src/test → test}/unit/pools/fixedRate/FixedRateExchange.test.d.ts +0 -0
  74. package/dist/{src/test → test}/unit/pools/ssContracts/SideStaking.test.d.ts +0 -0
  75. package/dist/{src/test → test}/unit/tokens/Datatoken.test.d.ts +0 -0
  76. package/dist/{src/test → test}/unit/tokens/Nft.test.d.ts +0 -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 +23 -22
  82. package/dist/src/src/@types/Asset.d.ts +0 -36
  83. package/dist/src/src/@types/DDO/DDO.d.ts +0 -15
  84. package/dist/src/src/@types/DDO/Event.d.ts +0 -7
  85. package/dist/src/src/@types/DDO/Metadata.d.ts +0 -38
  86. package/dist/src/src/@types/DDO/Service.d.ts +0 -28
  87. package/dist/src/src/@types/FileMetadata.d.ts +0 -8
  88. package/dist/src/src/aquarius/Aquarius.d.ts +0 -10
  89. package/dist/src/src/factories/NFTFactory.d.ts +0 -70
  90. package/dist/src/src/interfaces/RouterInterface.d.ts +0 -12
  91. package/dist/src/src/interfaces/index.d.ts +0 -5
  92. package/dist/src/src/models/Config.d.ts +0 -34
  93. package/dist/src/src/pools/Router.d.ts +0 -46
  94. package/dist/src/src/pools/balancer/Pool.d.ts +0 -73
  95. package/dist/src/src/pools/dispenser/Dispenser.d.ts +0 -37
  96. package/dist/src/src/pools/fixedRate/FixedRateExchange.d.ts +0 -95
  97. package/dist/src/src/pools/ssContracts/SideStaking.d.ts +0 -28
  98. package/dist/src/src/provider/Provider.d.ts +0 -31
  99. package/dist/src/src/tokens/Datatoken.d.ts +0 -77
  100. package/dist/src/src/tokens/NFT.d.ts +0 -57
  101. package/dist/src/src/utils/ContractParams.d.ts +0 -4
  102. package/dist/src/src/utils/DatatokenName.d.ts +0 -7
  103. package/dist/src/src/utils/GasUtils.d.ts +0 -2
@@ -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 createNftWithErc20 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
+ estGasCreateNftWithErc20(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams): Promise<any>;
205
+ /**
206
+ * @dev createNftWithErc20
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
+ createNftWithErc20(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams): Promise<TransactionReceipt>;
214
+ /**
215
+ * Estimate gas cost for createNftErc20WithPool 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
+ estGasCreateNftErc20WithPool(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, poolParams: PoolCreationParams): Promise<any>;
223
+ /**
224
+ * @dev createNftErc20WithPool
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
+ createNftErc20WithPool(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, poolParams: PoolCreationParams): Promise<TransactionReceipt>;
234
+ /** Estimate gas cost for createNftErc20WithFixedRate 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
+ estGasCreateNftErc20WithFixedRate(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, freParams: FreCreationParams): Promise<any>;
242
+ /**
243
+ * @dev createNftErc20WithFixedRate
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
+ createNftErc20WithFixedRate(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, freParams: FreCreationParams): Promise<TransactionReceipt>;
253
+ /** Estimate gas cost for createNftErc20WithFixedRate 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
+ estGasCreateNftErc20WithDispenser(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, dispenserParams: DispenserCreationParams): Promise<any>;
261
+ /**
262
+ * @dev createNftErc20WithDispenser
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
+ createNftErc20WithDispenser(address: string, nftCreateData: NftCreateData, ercParams: Erc20CreateParams, dispenserParams: DispenserCreationParams): Promise<TransactionReceipt>;
272
+ }
273
+ export {};
File without changes
@@ -5,4 +5,3 @@ export * from './models';
5
5
  export * from './utils';
6
6
  export * from './@types';
7
7
  export * from './provider';
8
- export * from './interfaces';
@@ -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;
File without changes
@@ -0,0 +1,229 @@
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 { Operation } from '../@types/Router';
6
+ import { Config } from '../models/index.js';
7
+ /**
8
+ * Provides an interface for FactoryRouter contract
9
+ */
10
+ export declare class Router {
11
+ GASLIMIT_DEFAULT: number;
12
+ routerAddress: string;
13
+ RouterAbi: AbiItem | AbiItem[];
14
+ web3: Web3;
15
+ config: Config;
16
+ router: Contract;
17
+ /**
18
+ * Instantiate Router.
19
+ * @param {String} routerAddress
20
+ * @param {AbiItem | AbiItem[]} Router
21
+ * @param {Web3} web3
22
+ */
23
+ constructor(routerAddress: string, web3: Web3, RouterAbi?: AbiItem | AbiItem[], config?: Config);
24
+ /**
25
+ * Estimate gas cost for buyDTBatch method
26
+ * @param {String} address
27
+ * @param {Operation} operations Operations objects array
28
+ * @return {Promise<TransactionReceipt>} Transaction receipt
29
+ */
30
+ estGasBuyDTBatch(address: string, operations: Operation[]): Promise<any>;
31
+ /**
32
+ * BuyDTBatch
33
+ * @param {String} address
34
+ * @param {Operation} operations Operations objects array
35
+ * @return {Promise<TransactionReceipt>} Transaction receipt
36
+ */
37
+ buyDTBatch(address: string, operations: Operation[]): Promise<TransactionReceipt>;
38
+ /** Check if a token is on ocean tokens list, if true opfFee is ZERO in pools with that token/DT
39
+ * @return {Promise<boolean>} true if is on the list.
40
+ */
41
+ isOceanTokens(address: string): Promise<boolean>;
42
+ /** Check if an address is a side staking contract.
43
+ * @return {Promise<boolean>} true if is a SS contract
44
+ */
45
+ isSideStaking(address: string): Promise<boolean>;
46
+ /** Check if an address is a Fixed Rate contract.
47
+ * @return {Promise<boolean>} true if is a Fixed Rate contract
48
+ */
49
+ isFixedPrice(address: string): Promise<boolean>;
50
+ /** Get Router Owner
51
+ * @return {Promise<string>} Router Owner address
52
+ */
53
+ getOwner(): Promise<string>;
54
+ /** Get NFT Factory address
55
+ * @return {Promise<string>} NFT Factory address
56
+ */
57
+ getNFTFactory(): Promise<string>;
58
+ /** Check if an address is a pool template contract.
59
+ * @return {Promise<boolean>} true if is a Template
60
+ */
61
+ isPoolTemplate(address: string): Promise<boolean>;
62
+ /**
63
+ * Estimate gas cost for addOceanToken
64
+ * @param {String} address
65
+ * @param {String} tokenAddress token address we want to add
66
+ * @param {Contract} routerContract optional contract instance
67
+ * @return {Promise<any>}
68
+ */
69
+ estGasAddOceanToken(address: string, tokenAddress: string, contractInstance?: Contract): Promise<any>;
70
+ /**
71
+ * Add a new token to oceanTokens list, pools with baseToken in this list have NO opf Fee
72
+ * @param {String} address caller address
73
+ * @param {String} tokenAddress token address to add
74
+ * @return {Promise<TransactionReceipt>}
75
+ */
76
+ addOceanToken(address: string, tokenAddress: string): Promise<TransactionReceipt>;
77
+ /**
78
+ * Estimate gas cost for removeOceanToken
79
+ * @param {String} address caller address
80
+ * @param {String} tokenAddress token address we want to add
81
+ * @param {Contract} routerContract optional contract instance
82
+ * @return {Promise<any>}
83
+ */
84
+ estGasRemoveOceanToken(address: string, tokenAddress: string, contractInstance?: Contract): Promise<any>;
85
+ /**
86
+ * Remove a token from oceanTokens list, pools without baseToken in this list have a opf Fee
87
+ * @param {String} address
88
+ * @param {String} tokenAddress address to remove
89
+ * @return {Promise<TransactionReceipt>}
90
+ */
91
+ removeOceanToken(address: string, tokenAddress: string): Promise<TransactionReceipt>;
92
+ /**
93
+ * Estimate gas cost for addSSContract method
94
+ * @param {String} address
95
+ * @param {String} tokenAddress contract address to add
96
+ * @return {Promise<TransactionReceipt>}
97
+ */
98
+ estGasAddSSContract(address: string, tokenAddress: string): Promise<any>;
99
+ /**
100
+ * Add a new contract to ssContract list, after is added, can be used when deploying a new pool
101
+ * @param {String} address
102
+ * @param {String} tokenAddress contract address to add
103
+ * @return {Promise<TransactionReceipt>}
104
+ */
105
+ addSSContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
106
+ /**
107
+ * Estimate gas cost for removeSSContract method
108
+ * @param {String} address caller address
109
+ * @param {String} tokenAddress contract address to add
110
+ * @return {Promise<TransactionReceipt>}
111
+ */
112
+ estGasRemoveSSContract(address: string, tokenAddress: string): Promise<any>;
113
+ /**
114
+ * Removes a new contract from ssContract list
115
+ * @param {String} address caller address
116
+ * @param {String} tokenAddress contract address to removed
117
+ * @return {Promise<TransactionReceipt>}
118
+ */
119
+ removeSSContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
120
+ /**
121
+ * Estimate gas cost for addFixedRateContract method
122
+ * @param {String} address
123
+ * @param {String} tokenAddress contract address to add
124
+ * @return {Promise<TransactionReceipt>}
125
+ */
126
+ estGasAddFixedRateContract(address: string, tokenAddress: string): Promise<any>;
127
+ /**
128
+ * Add a new contract to fixedRate list, after is added, can be used when deploying a new pool
129
+ * @param {String} address
130
+ * @param {String} tokenAddress contract address to add
131
+ * @return {Promise<TransactionReceipt>}
132
+ */
133
+ addFixedRateContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
134
+ /**
135
+ * Estimate gas cost for addFixedRateContract method
136
+ * @param {String} address
137
+ * @param {String} tokenAddress contract address to add
138
+ * @return {Promise<TransactionReceipt>}
139
+ */
140
+ estGasRemoveFixedRateContract(address: string, tokenAddress: string): Promise<any>;
141
+ /**
142
+ * Removes a contract from fixedRate list
143
+ * @param {String} address
144
+ * @param {String} tokenAddress contract address to add
145
+ * @return {Promise<TransactionReceipt>}
146
+ */
147
+ removeFixedRateContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
148
+ /**
149
+ * Estimate gas cost for addDispenserContract method
150
+ * @param {String} address
151
+ * @param {String} tokenAddress contract address to add
152
+ * @return {Promise<TransactionReceipt>}
153
+ */
154
+ estGasAddDispenserContract(address: string, tokenAddress: string): Promise<any>;
155
+ /**
156
+ * Add a new contract to dispenser list, after is added, can be used when deploying a new pool
157
+ * @param {String} address
158
+ * @param {String} tokenAddress contract address to add
159
+ * @return {Promise<TransactionReceipt>}
160
+ */
161
+ addDispenserContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
162
+ /**
163
+ * Estimate gas cost for addDispenserContract method
164
+ * @param {String} address
165
+ * @param {String} tokenAddress contract address to add
166
+ * @return {Promise<TransactionReceipt>}
167
+ */
168
+ estGasRemoveDispenserContract(address: string, tokenAddress: string): Promise<any>;
169
+ /**
170
+ * Add a new contract to dispenser list, after is added, can be used when deploying a new pool
171
+ * @param {String} address
172
+ * @param {String} tokenAddress contract address to add
173
+ * @return {Promise<TransactionReceipt>}
174
+ */
175
+ removeDispenserContract(address: string, tokenAddress: string): Promise<TransactionReceipt>;
176
+ /** Get OPF Fee per token
177
+ * @return {Promise<number>} OPC fee for a specific baseToken
178
+ */
179
+ getOPCFee(baseToken: string): Promise<number>;
180
+ /** Get Current OPF Fee
181
+ * @return {Promise<number>} OPF fee
182
+ */
183
+ getCurrentOPCFee(): Promise<number>;
184
+ /**
185
+ * Estimate gas cost for updateOPFFee method
186
+ * @param {String} address
187
+ * @param {String} newFee new OPF Fee
188
+ * @return {Promise<TransactionReceipt>}
189
+ */
190
+ estGasUpdateOPCFee(address: string, newSwapOceanFee: number, newSwapNonOceanFee: number, newConsumeFee: number, newProviderFee: number): Promise<any>;
191
+ /**
192
+ * Add a new contract to fixedRate list, after is added, can be used when deploying a new pool
193
+ * @param {String} address
194
+ * @param {number} newSwapOceanFee Amount charged for swapping with ocean approved tokens
195
+ * @param {number} newSwapNonOceanFee Amount charged for swapping with non ocean approved tokens
196
+ * @param {number} newConsumeFee Amount charged from consumeFees
197
+ * @param {number} newProviderFee Amount charged for providerFees
198
+ * @return {Promise<TransactionReceipt>}
199
+ */
200
+ updateOPCFee(address: string, newSwapOceanFee: number, newSwapNonOceanFee: number, newConsumeFee: number, newProviderFee: number): Promise<TransactionReceipt>;
201
+ /**
202
+ * Estimate gas cost for addPoolTemplate method
203
+ * @param {String} address
204
+ * @param {String} templateAddress template address to add
205
+ * @return {Promise<TransactionReceipt>}
206
+ */
207
+ estGasAddPoolTemplate(address: string, templateAddress: string): Promise<any>;
208
+ /**
209
+ * Add a new template to poolTemplates mapping, after template is added,it can be used
210
+ * @param {String} address
211
+ * @param {String} templateAddress template address to add
212
+ * @return {Promise<TransactionReceipt>}
213
+ */
214
+ addPoolTemplate(address: string, templateAddress: string): Promise<TransactionReceipt>;
215
+ /**
216
+ * Estimate gas cost for removePoolTemplate method
217
+ * @param {String} address
218
+ * @param {String} templateAddress template address to remove
219
+ * @return {Promise<TransactionReceipt>}
220
+ */
221
+ estGasRemovePoolTemplate(address: string, templateAddress: string): Promise<any>;
222
+ /**
223
+ * Remove template from poolTemplates mapping, after template is removed,it can be used anymore
224
+ * @param {String} address
225
+ * @param {String} templateAddress template address to remove
226
+ * @return {Promise<TransactionReceipt>}
227
+ */
228
+ removePoolTemplate(address: string, templateAddress: string): Promise<TransactionReceipt>;
229
+ }