@oceanprotocol/lib 3.0.4 → 3.1.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +10 -0
  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 +148 -148
  11. package/dist/src/@types/Compute.d.ts +71 -71
  12. package/dist/src/@types/Contracts.d.ts +26 -26
  13. package/dist/src/@types/DDO/ConsumerParameter.d.ts +37 -37
  14. package/dist/src/@types/DDO/Credentials.d.ts +8 -8
  15. package/dist/src/@types/DDO/DDO.d.ts +55 -55
  16. package/dist/src/@types/DDO/Event.d.ts +27 -27
  17. package/dist/src/@types/DDO/Metadata.d.ts +141 -141
  18. package/dist/src/@types/DDO/Service.d.ts +100 -100
  19. package/dist/src/@types/Datatoken.d.ts +38 -38
  20. package/dist/src/@types/Dispenser.d.ts +16 -16
  21. package/dist/src/@types/DownloadResponse.d.ts +4 -4
  22. package/dist/src/@types/File.d.ts +89 -89
  23. package/dist/src/@types/FileInfo.d.ts +43 -43
  24. package/dist/src/@types/FixedPrice.d.ts +51 -51
  25. package/dist/src/@types/NFT.d.ts +18 -18
  26. package/dist/src/@types/NFTFactory.d.ts +20 -20
  27. package/dist/src/@types/Provider.d.ts +33 -33
  28. package/dist/src/@types/ReturnTypes.d.ts +3 -3
  29. package/dist/src/@types/Router.d.ts +59 -59
  30. package/dist/src/@types/index.d.ts +20 -20
  31. package/dist/src/config/Config.d.ts +153 -153
  32. package/dist/src/config/ConfigHelper.d.ts +12 -12
  33. package/dist/src/config/index.d.ts +2 -2
  34. package/dist/src/contracts/Datatoken.d.ts +278 -260
  35. package/dist/src/contracts/Dispenser.d.ts +73 -73
  36. package/dist/src/contracts/FixedRateExchange.d.ts +209 -209
  37. package/dist/src/contracts/NFT.d.ts +220 -220
  38. package/dist/src/contracts/NFTFactory.d.ts +165 -165
  39. package/dist/src/contracts/Router.d.ts +107 -107
  40. package/dist/src/contracts/SmartContract.d.ts +45 -45
  41. package/dist/src/contracts/SmartContractWithAddress.d.ts +17 -17
  42. package/dist/src/contracts/df/DfRewards.d.ts +31 -31
  43. package/dist/src/contracts/df/DfStrategyV1.d.ts +21 -21
  44. package/dist/src/contracts/index.d.ts +14 -14
  45. package/dist/src/contracts/ve/VeAllocate.d.ts +38 -38
  46. package/dist/src/contracts/ve/VeFeeDistributor.d.ts +29 -29
  47. package/dist/src/contracts/ve/VeFeeEstimate.d.ts +14 -14
  48. package/dist/src/contracts/ve/VeOcean.d.ts +68 -68
  49. package/dist/src/index.d.ts +5 -5
  50. package/dist/src/services/Aquarius.d.ts +53 -53
  51. package/dist/src/services/Provider.d.ts +197 -197
  52. package/dist/src/services/index.d.ts +2 -2
  53. package/dist/src/utils/Constants.d.ts +4 -4
  54. package/dist/src/utils/ContractUtils.d.ts +46 -46
  55. package/dist/src/utils/DatatokenName.d.ts +14 -14
  56. package/dist/src/utils/DdoHelpers.d.ts +13 -13
  57. package/dist/src/utils/FetchHelper.d.ts +14 -14
  58. package/dist/src/utils/General.d.ts +5 -5
  59. package/dist/src/utils/Logger.d.ts +19 -19
  60. package/dist/src/utils/OrderUtils.d.ts +17 -0
  61. package/dist/src/utils/ProviderErrors.d.ts +1 -1
  62. package/dist/src/utils/SignatureUtils.d.ts +12 -12
  63. package/dist/src/utils/TokenUtils.d.ts +70 -70
  64. package/dist/src/utils/index.d.ts +12 -11
  65. package/dist/src/utils/minAbi.d.ts +38 -38
  66. package/dist/test/config.d.ts +19 -19
  67. package/dist/test/integration/CodeExamples.test.d.ts +1 -1
  68. package/dist/test/integration/ComputeExamples.test.d.ts +1 -1
  69. package/dist/test/integration/ComputeFlow.test.d.ts +1 -1
  70. package/dist/test/integration/Provider.test.d.ts +1 -1
  71. package/dist/test/integration/PublishEditConsume.test.d.ts +1 -1
  72. package/dist/test/integration/PublishFlows.test.d.ts +1 -1
  73. package/dist/test/integration/helpers.d.ts +7 -7
  74. package/dist/test/unit/DFRewards.test.d.ts +1 -1
  75. package/dist/test/unit/Datatoken.test.d.ts +1 -1
  76. package/dist/test/unit/Dispenser.test.d.ts +1 -1
  77. package/dist/test/unit/FixedRateExchange.test.d.ts +1 -1
  78. package/dist/test/unit/Nft.test.d.ts +1 -1
  79. package/dist/test/unit/NftFactory.test.d.ts +1 -1
  80. package/dist/test/unit/Router.test.d.ts +1 -1
  81. package/dist/test/unit/veOcean.test.d.ts +1 -1
  82. package/package.json +5 -5
@@ -1,165 +1,165 @@
1
- import { BigNumber } from 'ethers';
2
- import { AbiItem, FreCreationParams, DatatokenCreateParams, DispenserCreationParams, NftCreateData, Template, TokenOrder, ReceiptOrEstimate } from '../@types';
3
- import { SmartContractWithAddress } from './SmartContractWithAddress';
4
- /**
5
- * Provides an interface for NFT Factory contract
6
- */
7
- export declare class NftFactory extends SmartContractWithAddress {
8
- getDefaultAbi(): AbiItem[];
9
- /**
10
- * Create new data NFT
11
- * @param {NFTCreateData} nftData The data needed to create an NFT.
12
- * @param {Boolean} [estimateGas] if True, return gas estimate
13
- * @return {Promise<string|BigNumber>} The transaction hash or the gas estimate.
14
- */
15
- createNFT<G extends boolean = false>(nftData: NftCreateData, estimateGas?: G): Promise<G extends false ? string : BigNumber>;
16
- /**
17
- * Get Current NFT Count (NFT created)
18
- * @return {Promise<number>} Number of NFT created from this factory
19
- */
20
- getCurrentNFTCount(): Promise<number>;
21
- /**
22
- * Get Current Datatoken Count
23
- * @return {Promise<number>} Number of DTs created from this factory
24
- */
25
- getCurrentTokenCount(): Promise<number>;
26
- /**
27
- * Get Factory Owner
28
- * @return {Promise<string>} Factory Owner address
29
- */
30
- getOwner(): Promise<string>;
31
- /**
32
- * Get Current NFT Template Count
33
- * @return {Promise<number>} Number of NFT Template added to this factory
34
- */
35
- getCurrentNFTTemplateCount(): Promise<number>;
36
- /**
37
- * Get Current Template Datatoken (ERC20) Count
38
- * @return {Promise<number>} Number of Datatoken Template added to this factory
39
- */
40
- getCurrentTokenTemplateCount(): Promise<number>;
41
- /**
42
- * Get NFT Template
43
- * @param {number} index Template index
44
- * @return {Promise<Template>} Number of Template added to this factory
45
- */
46
- getNFTTemplate(index: number): Promise<Template>;
47
- /**
48
- * Get Datatoken (ERC20) Template
49
- * @param {number} index Template index
50
- * @return {Promise<Template>} DT Template info
51
- */
52
- getTokenTemplate(index: number): Promise<Template>;
53
- /**
54
- * Check if Datatoken is deployed from the factory
55
- * @param {String} datatoken Datatoken address to check
56
- * @return {Promise<Boolean>} return true if deployed from this factory
57
- */
58
- checkDatatoken(datatoken: string): Promise<Boolean>;
59
- /**
60
- * Check if NFT is deployed from the factory
61
- * @param {String} nftAddress nftAddress address to check
62
- * @return {Promise<String>} return address(0) if it's not, or the nftAddress if true
63
- */
64
- checkNFT(nftAddress: string): Promise<String>;
65
- /**
66
- * Add a new NFT token template - only factory Owner
67
- * @param {String} address caller address
68
- * @param {String} templateAddress template address to add
69
- * @param {Boolean} [estimateGas] if True, return gas estimate
70
- * @return {Promise<ReceiptOrEstimate>}
71
- */
72
- addNFTTemplate<G extends boolean = false>(address: string, templateAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
73
- /**
74
- * Disable token template - only factory Owner
75
- * @param {String} address
76
- * @param {Number} templateIndex index of the template we want to disable
77
- * @param {Boolean} estimateGas if True, return gas estimate
78
- * @return {Promise<ReceiptOrEstimate>} current token template count
79
- */
80
- disableNFTTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
81
- /**
82
- * Reactivate a previously disabled token template - only factory Owner
83
- * @param {String} address
84
- * @param {Number} templateIndex index of the template we want to reactivate
85
- * @param {Boolean} estimateGas if True, return gas estimate
86
- * @return {Promise<ReceiptOrEstimate>} current token template count
87
- */
88
- reactivateNFTTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
89
- /**
90
- * Add a new NFT token template - only factory Owner
91
- * @param {String} address caller address
92
- * @param {String} templateAddress template address to add
93
- * @param {Boolean} estimateGas if True, return gas estimate
94
- * @return {Promise<ReceiptOrEstimate>}
95
- */
96
- addTokenTemplate<G extends boolean = false>(address: string, templateAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
97
- /**
98
- * Disable token template - only factory Owner
99
- * @param {String} address caller address
100
- * @param {Number} templateIndex index of the template we want to disable
101
- * @param {Boolean} estimateGas if True, return gas estimate
102
- * @return {Promise<ReceiptOrEstimate>} current token template count
103
- */
104
- disableTokenTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
105
- /**
106
- * Reactivate a previously disabled token template - only factory Owner
107
- * @param {String} address caller address
108
- * @param {Number} templateIndex index of the template we want to reactivate
109
- * @param {Boolean} estimateGas if True, return gas estimate
110
- * @return {Promise<ReceiptOrEstimate>} current token template count
111
- */
112
- reactivateTokenTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
113
- /**
114
- * Used as a proxy to order multiple services
115
- * Users can have inifinite approvals for fees for factory instead of having one approval/ Datatoken contract
116
- * Requires previous approval of all :
117
- * - consumeFeeTokens
118
- * - publishMarketFeeTokens
119
- * - ERC20 Datatokens
120
- * @param {TokenOrder[]} orders array of of orders
121
- * @param {Boolean} [estimateGas] if True, return gas estimate
122
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
123
- */
124
- startMultipleTokenOrder<G extends boolean = false>(orders: TokenOrder[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
125
- /**
126
- * Creates a new NFT, then a datatoken,all in one call
127
- * @param {NftCreateData} nftCreateData - The data required to create an NFT.
128
- * @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
129
- * @param {boolean} [estimateGas] - Whether to return only estimate gas or not.
130
- * @return {Promise<ReceiptOrEstimate>} transaction receipt
131
- */
132
- createNftWithDatatoken<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
133
- /**
134
- * Creates an NFT with a datatoken with a fixed rate all in one call.
135
- * be aware if Fixed Rate creation fails, you are still going to pay a lot of gas
136
- * @param {NftCreateData} nftCreateData - The data required to create an NFT.
137
- * @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
138
- * @param {FreCreationParams} freParams - The parameters required to create a fixed-rate exchange contract.
139
- * @param {boolean} [estimateGas] - Whether to return only estimate gas or not.
140
- * @returns {Promis<ReceiptOrEstimate<G>>}
141
- */
142
- createNftWithDatatokenWithFixedRate<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, freParams: FreCreationParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
143
- /**
144
- * Creates an NFT with a datatoken with a dispenser in one call.
145
- * Be aware if Fixed Rate creation fails, you are still going to pay a lot of gas
146
- * @param {NftCreateData} nftCreateData - The data required to create an NFT.
147
- * @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
148
- * @param {DispenserCreationParams} dispenserParams - The parameters required to create a dispenser contract.
149
- * @param {boolean} [estimateGas] - Whether to estimate gas or not.
150
- * @returns {Promis<ReceiptOrEstimate<G>>}
151
- */
152
- createNftWithDatatokenWithDispenser<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, dispenserParams: DispenserCreationParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
153
- /**
154
- * Gets the parameters required to create an ERC20 token.
155
- * @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
156
- * @returns {Promise<any>}
157
- */
158
- private getErcCreationParams;
159
- /**
160
- * Gets the parameters required to create a fixed-rate exchange contract.
161
- * @param {FreCreationParams} freParams - The parameters required to create a fixed-rate exchange contract.
162
- * @returns {Promise<any> }
163
- */
164
- private getFreCreationParams;
165
- }
1
+ import { BigNumber } from 'ethers';
2
+ import { AbiItem, FreCreationParams, DatatokenCreateParams, DispenserCreationParams, NftCreateData, Template, TokenOrder, ReceiptOrEstimate } from '../@types';
3
+ import { SmartContractWithAddress } from './SmartContractWithAddress';
4
+ /**
5
+ * Provides an interface for NFT Factory contract
6
+ */
7
+ export declare class NftFactory extends SmartContractWithAddress {
8
+ getDefaultAbi(): AbiItem[];
9
+ /**
10
+ * Create new data NFT
11
+ * @param {NFTCreateData} nftData The data needed to create an NFT.
12
+ * @param {Boolean} [estimateGas] if True, return gas estimate
13
+ * @return {Promise<string|BigNumber>} The transaction hash or the gas estimate.
14
+ */
15
+ createNFT<G extends boolean = false>(nftData: NftCreateData, estimateGas?: G): Promise<G extends false ? string : BigNumber>;
16
+ /**
17
+ * Get Current NFT Count (NFT created)
18
+ * @return {Promise<number>} Number of NFT created from this factory
19
+ */
20
+ getCurrentNFTCount(): Promise<number>;
21
+ /**
22
+ * Get Current Datatoken Count
23
+ * @return {Promise<number>} Number of DTs created from this factory
24
+ */
25
+ getCurrentTokenCount(): Promise<number>;
26
+ /**
27
+ * Get Factory Owner
28
+ * @return {Promise<string>} Factory Owner address
29
+ */
30
+ getOwner(): Promise<string>;
31
+ /**
32
+ * Get Current NFT Template Count
33
+ * @return {Promise<number>} Number of NFT Template added to this factory
34
+ */
35
+ getCurrentNFTTemplateCount(): Promise<number>;
36
+ /**
37
+ * Get Current Template Datatoken (ERC20) Count
38
+ * @return {Promise<number>} Number of Datatoken Template added to this factory
39
+ */
40
+ getCurrentTokenTemplateCount(): Promise<number>;
41
+ /**
42
+ * Get NFT Template
43
+ * @param {number} index Template index
44
+ * @return {Promise<Template>} Number of Template added to this factory
45
+ */
46
+ getNFTTemplate(index: number): Promise<Template>;
47
+ /**
48
+ * Get Datatoken (ERC20) Template
49
+ * @param {number} index Template index
50
+ * @return {Promise<Template>} DT Template info
51
+ */
52
+ getTokenTemplate(index: number): Promise<Template>;
53
+ /**
54
+ * Check if Datatoken is deployed from the factory
55
+ * @param {String} datatoken Datatoken address to check
56
+ * @return {Promise<Boolean>} return true if deployed from this factory
57
+ */
58
+ checkDatatoken(datatoken: string): Promise<Boolean>;
59
+ /**
60
+ * Check if NFT is deployed from the factory
61
+ * @param {String} nftAddress nftAddress address to check
62
+ * @return {Promise<String>} return address(0) if it's not, or the nftAddress if true
63
+ */
64
+ checkNFT(nftAddress: string): Promise<String>;
65
+ /**
66
+ * Add a new NFT token template - only factory Owner
67
+ * @param {String} address caller address
68
+ * @param {String} templateAddress template address to add
69
+ * @param {Boolean} [estimateGas] if True, return gas estimate
70
+ * @return {Promise<ReceiptOrEstimate>}
71
+ */
72
+ addNFTTemplate<G extends boolean = false>(address: string, templateAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
73
+ /**
74
+ * Disable token template - only factory Owner
75
+ * @param {String} address
76
+ * @param {Number} templateIndex index of the template we want to disable
77
+ * @param {Boolean} estimateGas if True, return gas estimate
78
+ * @return {Promise<ReceiptOrEstimate>} current token template count
79
+ */
80
+ disableNFTTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
81
+ /**
82
+ * Reactivate a previously disabled token template - only factory Owner
83
+ * @param {String} address
84
+ * @param {Number} templateIndex index of the template we want to reactivate
85
+ * @param {Boolean} estimateGas if True, return gas estimate
86
+ * @return {Promise<ReceiptOrEstimate>} current token template count
87
+ */
88
+ reactivateNFTTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
89
+ /**
90
+ * Add a new NFT token template - only factory Owner
91
+ * @param {String} address caller address
92
+ * @param {String} templateAddress template address to add
93
+ * @param {Boolean} estimateGas if True, return gas estimate
94
+ * @return {Promise<ReceiptOrEstimate>}
95
+ */
96
+ addTokenTemplate<G extends boolean = false>(address: string, templateAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
97
+ /**
98
+ * Disable token template - only factory Owner
99
+ * @param {String} address caller address
100
+ * @param {Number} templateIndex index of the template we want to disable
101
+ * @param {Boolean} estimateGas if True, return gas estimate
102
+ * @return {Promise<ReceiptOrEstimate>} current token template count
103
+ */
104
+ disableTokenTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
105
+ /**
106
+ * Reactivate a previously disabled token template - only factory Owner
107
+ * @param {String} address caller address
108
+ * @param {Number} templateIndex index of the template we want to reactivate
109
+ * @param {Boolean} estimateGas if True, return gas estimate
110
+ * @return {Promise<ReceiptOrEstimate>} current token template count
111
+ */
112
+ reactivateTokenTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
113
+ /**
114
+ * Used as a proxy to order multiple services
115
+ * Users can have inifinite approvals for fees for factory instead of having one approval/ Datatoken contract
116
+ * Requires previous approval of all :
117
+ * - consumeFeeTokens
118
+ * - publishMarketFeeTokens
119
+ * - ERC20 Datatokens
120
+ * @param {TokenOrder[]} orders array of of orders
121
+ * @param {Boolean} [estimateGas] if True, return gas estimate
122
+ * @return {Promise<ReceiptOrEstimate>} transaction receipt
123
+ */
124
+ startMultipleTokenOrder<G extends boolean = false>(orders: TokenOrder[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
125
+ /**
126
+ * Creates a new NFT, then a datatoken,all in one call
127
+ * @param {NftCreateData} nftCreateData - The data required to create an NFT.
128
+ * @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
129
+ * @param {boolean} [estimateGas] - Whether to return only estimate gas or not.
130
+ * @return {Promise<ReceiptOrEstimate>} transaction receipt
131
+ */
132
+ createNftWithDatatoken<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
133
+ /**
134
+ * Creates an NFT with a datatoken with a fixed rate all in one call.
135
+ * be aware if Fixed Rate creation fails, you are still going to pay a lot of gas
136
+ * @param {NftCreateData} nftCreateData - The data required to create an NFT.
137
+ * @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
138
+ * @param {FreCreationParams} freParams - The parameters required to create a fixed-rate exchange contract.
139
+ * @param {boolean} [estimateGas] - Whether to return only estimate gas or not.
140
+ * @returns {Promis<ReceiptOrEstimate<G>>}
141
+ */
142
+ createNftWithDatatokenWithFixedRate<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, freParams: FreCreationParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
143
+ /**
144
+ * Creates an NFT with a datatoken with a dispenser in one call.
145
+ * Be aware if Fixed Rate creation fails, you are still going to pay a lot of gas
146
+ * @param {NftCreateData} nftCreateData - The data required to create an NFT.
147
+ * @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
148
+ * @param {DispenserCreationParams} dispenserParams - The parameters required to create a dispenser contract.
149
+ * @param {boolean} [estimateGas] - Whether to estimate gas or not.
150
+ * @returns {Promis<ReceiptOrEstimate<G>>}
151
+ */
152
+ createNftWithDatatokenWithDispenser<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, dispenserParams: DispenserCreationParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
153
+ /**
154
+ * Gets the parameters required to create an ERC20 token.
155
+ * @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
156
+ * @returns {Promise<any>}
157
+ */
158
+ private getErcCreationParams;
159
+ /**
160
+ * Gets the parameters required to create a fixed-rate exchange contract.
161
+ * @param {FreCreationParams} freParams - The parameters required to create a fixed-rate exchange contract.
162
+ * @returns {Promise<any> }
163
+ */
164
+ private getFreCreationParams;
165
+ }
@@ -1,107 +1,107 @@
1
- import { Operation, ReceiptOrEstimate, AbiItem } from '../@types';
2
- import { SmartContractWithAddress } from './SmartContractWithAddress';
3
- /**
4
- * Provides an interface for FactoryRouter contract
5
- */
6
- export declare class Router extends SmartContractWithAddress {
7
- getDefaultAbi(): AbiItem[];
8
- /**
9
- * * Buys a batch of datatokens.
10
- * one single call to buy multiple DT for multiple assets.
11
- * require tokenIn approvals for router from user. (except for dispenser operations)
12
- * @param {Operation[]} operations - The operations to execute.
13
- * @param {boolean} [estimateGas=false] - Whether to return only the estimate gas or not.
14
- * @return {Promise<ReceiptOrEstimate>} Transaction receipt
15
- */
16
- buyDatatokenBatch<G extends boolean = false>(operations: Operation[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
17
- /**
18
- * Checks if a token is on approved tokens list,
19
- * if true opfFee is lower in pools with that token/DT
20
- * @param {string} address - The address of the token to check.
21
- * @return {Promise<boolean>} true if is on the list.
22
- */
23
- isApprovedToken(address: string): Promise<boolean>;
24
- /**
25
- * Check if an address is a Fixed Rate contract.
26
- * @param {string} address - The address of the fixed rate exchange to check.
27
- * @return {Promise<boolean>} true if is a Fixed Rate contract
28
- */
29
- isFixedPrice(address: string): Promise<boolean>;
30
- /**
31
- * Get Router Owner
32
- * @return {Promise<string>} Router Owner address
33
- */
34
- getOwner(): Promise<string>;
35
- /**
36
- * Get NFT Factory address
37
- * @return {Promise<string>} NFT Factory address
38
- */
39
- getNFTFactory(): Promise<string>;
40
- /**
41
- * Adds a token to the list of tokens with reduced fees
42
- * @param {String} address caller address
43
- * @param {String} tokenAddress token address to add
44
- * @param {Boolean} [estimateGas] if True, return gas estimate
45
- * @return {Promise<ReceiptOrEstimate>}
46
- */
47
- addApprovedToken<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
48
- /**
49
- * Removes a token if exists from the list of tokens with reduced fees
50
- * @param {String} address caller address
51
- * @param {String} tokenAddress token address to remove
52
- * @param {Boolean} [estimateGas] if True, return gas estimate
53
- * @return {Promise<ReceiptOrEstimate>}
54
- */
55
- removeApprovedToken<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
56
- /**
57
- * Adds an address to the list of fixed rate contracts
58
- * @param {String} address caller address
59
- * @param {String} tokenAddress contract address to add
60
- * @param {Boolean} [estimateGas] if True, return gas estimate
61
- * @return {Promise<ReceiptOrEstimate>}
62
- */
63
- addFixedRateContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
64
- /**
65
- * Removes an address from the list of fixed rate contracts
66
- * @param {String} address caller address
67
- * @param {String} tokenAddress contract address to add
68
- * @param {Boolean} [estimateGas] if True, return gas estimate
69
- * @return {Promise<ReceiptOrEstimate>}
70
- */
71
- removeFixedRateContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
72
- /**
73
- * Adds an address to the list of dispensers
74
- * @param {String} address caller address
75
- * @param {String} tokenAddress contract address to add
76
- * @param {Boolean} estimateGas if True, return gas estimate
77
- * @return {Promise<ReceiptOrEstimate>}
78
- */
79
- addDispenserContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
80
- /**
81
- * Removes an address from the list of dispensers
82
- * @param {String} address caller address
83
- * @param {String} tokenAddress address Contract to be removed
84
- * @param {Boolean} estimateGas if True, return gas estimate
85
- * @return {Promise<ReceiptOrEstimate>}
86
- */
87
- removeDispenserContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
88
- /** Get OPF Fee per token
89
- * @return {Promise<number>} OPC fee for a specific baseToken
90
- */
91
- getOPCFee(baseToken: string): Promise<number>;
92
- /** Get Current OPF Fee
93
- * @return {Promise<number>} OPF fee
94
- */
95
- getCurrentOPCFee(): Promise<number>;
96
- /**
97
- * Updates OP Community Fees
98
- * @param {String} address caller address
99
- * @param {number} newSwapOceanFee Amount charged for swapping with ocean approved tokens
100
- * @param {number} newSwapNonOceanFee Amount charged for swapping with non ocean approved tokens
101
- * @param {number} newConsumeFee Amount charged from consumeFees
102
- * @param {number} newProviderFee Amount charged for providerFees
103
- * @param {Boolean} estimateGas if True, return gas estimate
104
- * @return {Promise<ReceiptOrEstimate>}
105
- */
106
- updateOPCFee<G extends boolean = false>(address: string, newSwapOceanFee: number, newSwapNonOceanFee: number, newConsumeFee: number, newProviderFee: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
107
- }
1
+ import { Operation, ReceiptOrEstimate, AbiItem } from '../@types';
2
+ import { SmartContractWithAddress } from './SmartContractWithAddress';
3
+ /**
4
+ * Provides an interface for FactoryRouter contract
5
+ */
6
+ export declare class Router extends SmartContractWithAddress {
7
+ getDefaultAbi(): AbiItem[];
8
+ /**
9
+ * * Buys a batch of datatokens.
10
+ * one single call to buy multiple DT for multiple assets.
11
+ * require tokenIn approvals for router from user. (except for dispenser operations)
12
+ * @param {Operation[]} operations - The operations to execute.
13
+ * @param {boolean} [estimateGas=false] - Whether to return only the estimate gas or not.
14
+ * @return {Promise<ReceiptOrEstimate>} Transaction receipt
15
+ */
16
+ buyDatatokenBatch<G extends boolean = false>(operations: Operation[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
17
+ /**
18
+ * Checks if a token is on approved tokens list,
19
+ * if true opfFee is lower in pools with that token/DT
20
+ * @param {string} address - The address of the token to check.
21
+ * @return {Promise<boolean>} true if is on the list.
22
+ */
23
+ isApprovedToken(address: string): Promise<boolean>;
24
+ /**
25
+ * Check if an address is a Fixed Rate contract.
26
+ * @param {string} address - The address of the fixed rate exchange to check.
27
+ * @return {Promise<boolean>} true if is a Fixed Rate contract
28
+ */
29
+ isFixedPrice(address: string): Promise<boolean>;
30
+ /**
31
+ * Get Router Owner
32
+ * @return {Promise<string>} Router Owner address
33
+ */
34
+ getOwner(): Promise<string>;
35
+ /**
36
+ * Get NFT Factory address
37
+ * @return {Promise<string>} NFT Factory address
38
+ */
39
+ getNFTFactory(): Promise<string>;
40
+ /**
41
+ * Adds a token to the list of tokens with reduced fees
42
+ * @param {String} address caller address
43
+ * @param {String} tokenAddress token address to add
44
+ * @param {Boolean} [estimateGas] if True, return gas estimate
45
+ * @return {Promise<ReceiptOrEstimate>}
46
+ */
47
+ addApprovedToken<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
48
+ /**
49
+ * Removes a token if exists from the list of tokens with reduced fees
50
+ * @param {String} address caller address
51
+ * @param {String} tokenAddress token address to remove
52
+ * @param {Boolean} [estimateGas] if True, return gas estimate
53
+ * @return {Promise<ReceiptOrEstimate>}
54
+ */
55
+ removeApprovedToken<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
56
+ /**
57
+ * Adds an address to the list of fixed rate contracts
58
+ * @param {String} address caller address
59
+ * @param {String} tokenAddress contract address to add
60
+ * @param {Boolean} [estimateGas] if True, return gas estimate
61
+ * @return {Promise<ReceiptOrEstimate>}
62
+ */
63
+ addFixedRateContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
64
+ /**
65
+ * Removes an address from the list of fixed rate contracts
66
+ * @param {String} address caller address
67
+ * @param {String} tokenAddress contract address to add
68
+ * @param {Boolean} [estimateGas] if True, return gas estimate
69
+ * @return {Promise<ReceiptOrEstimate>}
70
+ */
71
+ removeFixedRateContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
72
+ /**
73
+ * Adds an address to the list of dispensers
74
+ * @param {String} address caller address
75
+ * @param {String} tokenAddress contract address to add
76
+ * @param {Boolean} estimateGas if True, return gas estimate
77
+ * @return {Promise<ReceiptOrEstimate>}
78
+ */
79
+ addDispenserContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
80
+ /**
81
+ * Removes an address from the list of dispensers
82
+ * @param {String} address caller address
83
+ * @param {String} tokenAddress address Contract to be removed
84
+ * @param {Boolean} estimateGas if True, return gas estimate
85
+ * @return {Promise<ReceiptOrEstimate>}
86
+ */
87
+ removeDispenserContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
88
+ /** Get OPF Fee per token
89
+ * @return {Promise<number>} OPC fee for a specific baseToken
90
+ */
91
+ getOPCFee(baseToken: string): Promise<number>;
92
+ /** Get Current OPF Fee
93
+ * @return {Promise<number>} OPF fee
94
+ */
95
+ getCurrentOPCFee(): Promise<number>;
96
+ /**
97
+ * Updates OP Community Fees
98
+ * @param {String} address caller address
99
+ * @param {number} newSwapOceanFee Amount charged for swapping with ocean approved tokens
100
+ * @param {number} newSwapNonOceanFee Amount charged for swapping with non ocean approved tokens
101
+ * @param {number} newConsumeFee Amount charged from consumeFees
102
+ * @param {number} newProviderFee Amount charged for providerFees
103
+ * @param {Boolean} estimateGas if True, return gas estimate
104
+ * @return {Promise<ReceiptOrEstimate>}
105
+ */
106
+ updateOPCFee<G extends boolean = false>(address: string, newSwapOceanFee: number, newSwapNonOceanFee: number, newConsumeFee: number, newProviderFee: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
107
+ }
@@ -1,45 +1,45 @@
1
- import { Signer, Contract } from 'ethers';
2
- import { AbiItem } from '../@types';
3
- import { Config } from '../config';
4
- export declare abstract class SmartContract {
5
- signer: Signer;
6
- config: Config;
7
- abi: AbiItem[];
8
- abstract getDefaultAbi(): any;
9
- /**
10
- * Instantiate the smart contract.
11
- * @param {Signer} signer The signer object.
12
- * @param {string | number} [network] Network id or name
13
- * @param {Config} [config] The configuration object.
14
- * @param {AbiItem[]} [abi] ABI array of the smart contract
15
- */
16
- constructor(signer: Signer, network?: string | number, config?: Config, abi?: AbiItem[]);
17
- /**
18
- * Converts an amount of tokens to units
19
- * @param {string} token - The token to convert
20
- * @param {string} amount - The amount of tokens to convert
21
- * @param {number} [tokenDecimals] - The number of decimals of the token
22
- * @returns {Promise<string>} - The converted amount in units
23
- */
24
- protected amountToUnits(token: string, amount: string, tokenDecimals?: number): Promise<string>;
25
- /**
26
- * Converts an amount of units to tokens
27
- * @param {string} token - The token to convert
28
- * @param {string} amount - The amount of units to convert
29
- * @param {number} [tokenDecimals] - The number of decimals in the token
30
- * @returns {Promise<string>} - The converted amount in tokens
31
- */
32
- protected unitsToAmount(token: string, amount: string, tokenDecimals?: number): Promise<string>;
33
- /**
34
- * Retruns the gas price
35
- * @returns {Promise<string>} - The fair gas price
36
- */
37
- protected getFairGasPrice(): Promise<string>;
38
- /**
39
- * Returns a contract instance for the given address
40
- * @param {string} address - The address of the contract
41
- * @param {AbiItem[]} [abi] - The ABI of the contract
42
- * @returns {Contract} - The contract instance
43
- */
44
- protected getContract(address: string, abi?: AbiItem[]): Contract;
45
- }
1
+ import { Signer, Contract } from 'ethers';
2
+ import { AbiItem } from '../@types';
3
+ import { Config } from '../config';
4
+ export declare abstract class SmartContract {
5
+ signer: Signer;
6
+ config: Config;
7
+ abi: AbiItem[];
8
+ abstract getDefaultAbi(): any;
9
+ /**
10
+ * Instantiate the smart contract.
11
+ * @param {Signer} signer The signer object.
12
+ * @param {string | number} [network] Network id or name
13
+ * @param {Config} [config] The configuration object.
14
+ * @param {AbiItem[]} [abi] ABI array of the smart contract
15
+ */
16
+ constructor(signer: Signer, network?: string | number, config?: Config, abi?: AbiItem[]);
17
+ /**
18
+ * Converts an amount of tokens to units
19
+ * @param {string} token - The token to convert
20
+ * @param {string} amount - The amount of tokens to convert
21
+ * @param {number} [tokenDecimals] - The number of decimals of the token
22
+ * @returns {Promise<string>} - The converted amount in units
23
+ */
24
+ protected amountToUnits(token: string, amount: string, tokenDecimals?: number): Promise<string>;
25
+ /**
26
+ * Converts an amount of units to tokens
27
+ * @param {string} token - The token to convert
28
+ * @param {string} amount - The amount of units to convert
29
+ * @param {number} [tokenDecimals] - The number of decimals in the token
30
+ * @returns {Promise<string>} - The converted amount in tokens
31
+ */
32
+ protected unitsToAmount(token: string, amount: string, tokenDecimals?: number): Promise<string>;
33
+ /**
34
+ * Retruns the gas price
35
+ * @returns {Promise<string>} - The fair gas price
36
+ */
37
+ protected getFairGasPrice(): Promise<string>;
38
+ /**
39
+ * Returns a contract instance for the given address
40
+ * @param {string} address - The address of the contract
41
+ * @param {AbiItem[]} [abi] - The ABI of the contract
42
+ * @returns {Contract} - The contract instance
43
+ */
44
+ protected getContract(address: string, abi?: AbiItem[]): Contract;
45
+ }