@oceanprotocol/lib 0.20.2 → 1.0.0-next.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 (136) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +1 -1
  3. package/artifacts/ERC721Factory.sol/ERC721Factory.json +1164 -0
  4. package/artifacts/addresses/address.json +21 -0
  5. package/artifacts/communityFee/OPFCommunityFeeCollector.sol/OPFCommunityFeeCollector.json +116 -0
  6. package/artifacts/pools/FactoryRouter.sol/FactoryRouter.json +1086 -0
  7. package/artifacts/pools/balancer/BPool.sol/BPool.json +1744 -0
  8. package/artifacts/pools/dispenser/Dispenser.sol/Dispenser.json +358 -0
  9. package/artifacts/pools/fixedRate/FixedRateExchange.sol/FixedRateExchange.json +917 -0
  10. package/artifacts/pools/ssContracts/SideStaking.sol/SideStaking.json +428 -0
  11. package/artifacts/templates/ERC20Template.sol/ERC20Template.json +1382 -0
  12. package/artifacts/templates/ERC20TemplateEnterprise.sol/ERC20TemplateEnterprise.json +1530 -0
  13. package/artifacts/templates/ERC721Template.sol/ERC721Template.json +1534 -0
  14. package/artifacts/utils/mock/MockERC20.sol/MockERC20.json +302 -0
  15. package/artifacts/utils/mock/MockERC20Decimals.sol/MockERC20Decimals.json +302 -0
  16. package/dist/node/lib.js +1 -1
  17. package/dist/node/lib.js.map +1 -1
  18. package/dist/node/lib.module.js +1 -1
  19. package/dist/node/lib.module.js.map +1 -1
  20. package/dist/node/lib.umd.js +1 -1
  21. package/dist/node/lib.umd.js.map +1 -1
  22. package/dist/node/src/@types/Asset.d.ts +36 -0
  23. package/dist/node/{ocean/interfaces → src/@types}/Compute.d.ts +13 -12
  24. package/dist/node/src/@types/DDO/Credentials.d.ts +8 -0
  25. package/dist/node/src/@types/DDO/DDO.d.ts +15 -0
  26. package/dist/node/src/@types/DDO/Event.d.ts +7 -0
  27. package/dist/node/src/@types/DDO/Metadata.d.ts +38 -0
  28. package/dist/node/src/@types/DDO/Service.d.ts +28 -0
  29. package/dist/node/src/@types/FileMetadata.d.ts +8 -0
  30. package/dist/node/src/@types/Provider.d.ts +15 -0
  31. package/dist/node/src/@types/index.d.ts +8 -0
  32. package/dist/node/src/aquarius/Aquarius.d.ts +10 -0
  33. package/dist/node/src/aquarius/index.d.ts +1 -0
  34. package/dist/node/src/factories/NFTFactory.d.ts +70 -0
  35. package/dist/node/src/factories/index.d.ts +1 -0
  36. package/dist/node/src/index.d.ts +8 -0
  37. package/dist/node/src/interfaces/DispenserInterface.d.ts +7 -0
  38. package/dist/node/src/interfaces/Erc20Interface.d.ts +11 -0
  39. package/dist/node/src/interfaces/FixedRateInterface.d.ts +19 -0
  40. package/dist/node/src/interfaces/PoolInterface.d.ts +36 -0
  41. package/dist/node/src/interfaces/RouterInterface.d.ts +12 -0
  42. package/dist/node/src/interfaces/index.d.ts +5 -0
  43. package/dist/node/{models → src/models}/Config.d.ts +10 -7
  44. package/dist/node/src/models/index.d.ts +1 -0
  45. package/dist/node/src/pools/Router.d.ts +46 -0
  46. package/dist/node/src/pools/balancer/Pool.d.ts +73 -0
  47. package/dist/node/src/pools/balancer/index.d.ts +1 -0
  48. package/dist/node/src/pools/dispenser/Dispenser.d.ts +37 -0
  49. package/dist/node/src/pools/dispenser/index.d.ts +1 -0
  50. package/dist/node/src/pools/fixedRate/FixedRateExchange.d.ts +95 -0
  51. package/dist/node/src/pools/fixedRate/index.d.ts +1 -0
  52. package/dist/node/src/pools/index.d.ts +3 -0
  53. package/dist/node/src/pools/ssContracts/SideStaking.d.ts +28 -0
  54. package/dist/node/src/pools/ssContracts/index.d.ts +1 -0
  55. package/dist/node/src/provider/Provider.d.ts +31 -0
  56. package/dist/node/src/provider/index.d.ts +1 -0
  57. package/dist/node/src/tokens/Datatoken.d.ts +77 -0
  58. package/dist/node/src/tokens/NFT.d.ts +57 -0
  59. package/dist/node/src/tokens/index.d.ts +2 -0
  60. package/dist/node/src/utils/ConfigHelper.d.ts +6 -0
  61. package/dist/node/src/utils/Constants.d.ts +1 -0
  62. package/dist/node/src/utils/ContractParams.d.ts +4 -0
  63. package/dist/node/src/utils/ConversionTypeHelper.d.ts +3 -0
  64. package/dist/node/{utils/Datatokens.d.ts → src/utils/DatatokenName.d.ts} +1 -1
  65. package/dist/node/src/utils/DdoHelpers.d.ts +2 -0
  66. package/dist/node/src/utils/FetchHelper.d.ts +5 -0
  67. package/dist/node/src/utils/GasUtils.d.ts +2 -0
  68. package/dist/node/{utils → src/utils}/Logger.d.ts +0 -0
  69. package/dist/node/src/utils/SignatureUtils.d.ts +8 -0
  70. package/dist/node/src/utils/index.d.ts +9 -0
  71. package/docs/beginners_guide.md +2 -2
  72. package/docs/quickstart_simple.md +2 -2
  73. package/package.json +27 -23
  74. package/dist/node/Instantiable.abstract.d.ts +0 -25
  75. package/dist/node/balancer/OceanPool.d.ts +0 -95
  76. package/dist/node/balancer/Pool.d.ts +0 -56
  77. package/dist/node/balancer/PoolFactory.d.ts +0 -15
  78. package/dist/node/datatokens/ContractEvent.d.ts +0 -19
  79. package/dist/node/datatokens/ContractHandler.d.ts +0 -12
  80. package/dist/node/datatokens/Datatokens.d.ts +0 -44
  81. package/dist/node/datatokens/EventHandler.d.ts +0 -19
  82. package/dist/node/datatokens/Network.d.ts +0 -5
  83. package/dist/node/datatokens/Web3Provider.d.ts +0 -5
  84. package/dist/node/datatokens/contracts/ContractBase.d.ts +0 -27
  85. package/dist/node/ddo/DDO.d.ts +0 -36
  86. package/dist/node/ddo/interfaces/AdditionalInformation.d.ts +0 -16
  87. package/dist/node/ddo/interfaces/Authentication.d.ts +0 -4
  88. package/dist/node/ddo/interfaces/BestPrice.d.ts +0 -10
  89. package/dist/node/ddo/interfaces/Consumable.d.ts +0 -5
  90. package/dist/node/ddo/interfaces/Credentials.d.ts +0 -9
  91. package/dist/node/ddo/interfaces/Curation.d.ts +0 -6
  92. package/dist/node/ddo/interfaces/DataTokenInfo.d.ts +0 -10
  93. package/dist/node/ddo/interfaces/EditableMetadata.d.ts +0 -9
  94. package/dist/node/ddo/interfaces/EditableMetadataLinks.d.ts +0 -5
  95. package/dist/node/ddo/interfaces/Event.d.ts +0 -7
  96. package/dist/node/ddo/interfaces/File.d.ts +0 -13
  97. package/dist/node/ddo/interfaces/Metadata.d.ts +0 -15
  98. package/dist/node/ddo/interfaces/MetadataAlgorithm.d.ts +0 -12
  99. package/dist/node/ddo/interfaces/MetadataMain.d.ts +0 -12
  100. package/dist/node/ddo/interfaces/Proof.d.ts +0 -6
  101. package/dist/node/ddo/interfaces/PublicKey.d.ts +0 -8
  102. package/dist/node/ddo/interfaces/PurgatoryData.d.ts +0 -4
  103. package/dist/node/ddo/interfaces/Service.d.ts +0 -99
  104. package/dist/node/ddo/interfaces/ServicePrices.d.ts +0 -4
  105. package/dist/node/ddo/interfaces/Status.d.ts +0 -5
  106. package/dist/node/ddo/interfaces/index.d.ts +0 -17
  107. package/dist/node/dispenser/Dispenser.d.ts +0 -44
  108. package/dist/node/exchange/FixedRateExchange.d.ts +0 -59
  109. package/dist/node/index.d.ts +0 -1
  110. package/dist/node/lib.d.ts +0 -15
  111. package/dist/node/metadatacache/MetadataCache.d.ts +0 -41
  112. package/dist/node/metadatacache/OnChainMetaData.d.ts +0 -31
  113. package/dist/node/ocean/Account.d.ts +0 -16
  114. package/dist/node/ocean/Accounts.d.ts +0 -9
  115. package/dist/node/ocean/Assets.d.ts +0 -56
  116. package/dist/node/ocean/AssetsCredential.d.ts +0 -6
  117. package/dist/node/ocean/Compute.d.ts +0 -75
  118. package/dist/node/ocean/DID.d.ts +0 -8
  119. package/dist/node/ocean/EventAccessControl.d.ts +0 -9
  120. package/dist/node/ocean/Ocean.d.ts +0 -34
  121. package/dist/node/ocean/OceanAuth.d.ts +0 -15
  122. package/dist/node/ocean/Versions.d.ts +0 -25
  123. package/dist/node/ocean/utils/SignatureUtils.d.ts +0 -13
  124. package/dist/node/ocean/utils/Utils.d.ts +0 -8
  125. package/dist/node/ocean/utils/WebServiceConnector.d.ts +0 -16
  126. package/dist/node/provider/Provider.d.ts +0 -56
  127. package/dist/node/utils/AssetResolverHelper.d.ts +0 -8
  128. package/dist/node/utils/ConfigHelper.d.ts +0 -17
  129. package/dist/node/utils/ContractUtils.d.ts +0 -5
  130. package/dist/node/utils/ConversionTypeHelpers.d.ts +0 -8
  131. package/dist/node/utils/GeneratorHelpers.d.ts +0 -1
  132. package/dist/node/utils/PromiseResolver.d.ts +0 -3
  133. package/dist/node/utils/SubscribableObserver.d.ts +0 -12
  134. package/dist/node/utils/SubscribablePromise.d.ts +0 -14
  135. package/dist/node/utils/Timeout.d.ts +0 -1
  136. package/dist/node/utils/index.d.ts +0 -9
@@ -0,0 +1,95 @@
1
+ import { TransactionReceipt } from 'web3-core';
2
+ import { Contract } from 'web3-eth-contract';
3
+ import { AbiItem } from 'web3-utils/types';
4
+ import Web3 from 'web3';
5
+ export interface FixedPriceExchange {
6
+ active: boolean;
7
+ exchangeOwner: string;
8
+ dataToken: string;
9
+ baseToken: string;
10
+ fixedRate: string;
11
+ dtDecimals: string;
12
+ btDecimals: string;
13
+ dtBalance: string;
14
+ btBalance: string;
15
+ dtSupply: string;
16
+ btSupply: string;
17
+ withMint: boolean;
18
+ allowedSwapper: string;
19
+ exchangeId?: string;
20
+ }
21
+ export interface FeesInfo {
22
+ opfFee: string;
23
+ marketFee: string;
24
+ marketFeeCollector: string;
25
+ marketFeeAvailable: string;
26
+ oceanFeeAvailable: string;
27
+ exchangeId: string;
28
+ }
29
+ export interface FixedPriceSwap {
30
+ exchangeId: string;
31
+ caller: string;
32
+ baseTokenAmount: string;
33
+ dataTokenAmount: string;
34
+ }
35
+ export declare enum FixedRateCreateProgressStep {
36
+ CreatingExchange = 0,
37
+ ApprovingDatatoken = 1
38
+ }
39
+ export declare class FixedRateExchange {
40
+ GASLIMIT_DEFAULT: number;
41
+ oceanAddress: string;
42
+ fixedRateAddress: string;
43
+ fixedRateExchangeAbi: AbiItem | AbiItem[];
44
+ fixedRateContract: Contract;
45
+ web3: Web3;
46
+ contract: Contract;
47
+ startBlock: number;
48
+ ssAbi: AbiItem | AbiItem[];
49
+ constructor(web3: Web3, fixedRateAddress: string, fixedRateExchangeAbi?: AbiItem | AbiItem[], oceanAddress?: string, startBlock?: number);
50
+ amountToUnits(token: string, amount: string): Promise<string>;
51
+ unitsToAmount(token: string, amount: string): Promise<string>;
52
+ generateExchangeId(basetoken: string, dataToken: string, owner: string): Promise<string>;
53
+ estBuyDT(account: string, datatokenAddress: string, dtAmount: string, maxBasetokenAmount: string, contractInstance?: Contract): Promise<number>;
54
+ buyDT(address: string, exchangeId: string, datatokenAmount: string, maxBasetokenAmount: string): Promise<TransactionReceipt>;
55
+ estSellDT(account: string, datatokenAddress: string, dtAmount: string, maxBasetokenAmount: string, contractInstance?: Contract): Promise<number>;
56
+ sellDT(address: string, exchangeId: string, datatokenAmount: string, minBasetokenAmount: string): Promise<TransactionReceipt>;
57
+ getNumberOfExchanges(): Promise<number>;
58
+ estSetRate(account: string, exchangeId: string, newRate: string, contractInstance?: Contract): Promise<number>;
59
+ setRate(address: string, exchangeId: string, newRate: string): Promise<TransactionReceipt>;
60
+ estSetAllowedSwapper(account: string, exchangeId: string, newAllowedSwapper: string, contractInstance?: Contract): Promise<number>;
61
+ setAllowedSwapper(address: string, exchangeId: string, newAllowedSwapper: string): Promise<TransactionReceipt>;
62
+ estActivate(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
63
+ activate(address: string, exchangeId: string): Promise<TransactionReceipt>;
64
+ estDeactivate(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
65
+ deactivate(address: string, exchangeId: string): Promise<TransactionReceipt>;
66
+ getRate(exchangeId: string): Promise<string>;
67
+ getDTSupply(exchangeId: string): Promise<string>;
68
+ getBTSupply(exchangeId: string): Promise<string>;
69
+ getAllowedSwapper(exchangeId: string): Promise<string>;
70
+ getAmountBTIn(exchangeId: string, dataTokenAmount: string): Promise<string>;
71
+ getAmountBTOut(exchangeId: string, dataTokenAmount: string): Promise<string>;
72
+ getExchange(exchangeId: string): Promise<FixedPriceExchange>;
73
+ getFeesInfo(exchangeId: string): Promise<FeesInfo>;
74
+ getExchanges(): Promise<string[]>;
75
+ isActive(exchangeId: string): Promise<boolean>;
76
+ estActivateMint(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
77
+ activateMint(address: string, exchangeId: string): Promise<TransactionReceipt>;
78
+ estDeactivateMint(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
79
+ deactivateMint(address: string, exchangeId: string): Promise<TransactionReceipt>;
80
+ estCollectBT(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
81
+ collectBT(address: string, exchangeId: string): Promise<TransactionReceipt>;
82
+ estCollectDT(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
83
+ collectDT(address: string, exchangeId: string): Promise<TransactionReceipt>;
84
+ estCollectMarketFee(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
85
+ collectMarketFee(address: string, exchangeId: string): Promise<TransactionReceipt>;
86
+ estCollectOceanFee(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
87
+ collectOceanFee(address: string, exchangeId: string): Promise<TransactionReceipt>;
88
+ getOPFCollector(): Promise<string>;
89
+ getRouter(): Promise<string>;
90
+ getExchangeOwner(exchangeId: string): Promise<string>;
91
+ estUpdateMarketFee(account: string, exchangeId: string, newMarketFee: string, contractInstance?: Contract): Promise<number>;
92
+ updateMarketFee(address: string, exchangeId: string, newMarketFee: string): Promise<TransactionReceipt>;
93
+ estUpdateMarketFeeCollector(account: string, exchangeId: string, newMarketFeeCollector: string, contractInstance?: Contract): Promise<number>;
94
+ updateMarketFeeCollector(address: string, exchangeId: string, newMarketFeeCollector: string): Promise<TransactionReceipt>;
95
+ }
@@ -0,0 +1 @@
1
+ export * from './FixedRateExchange';
@@ -0,0 +1,3 @@
1
+ export * from './balancer';
2
+ export * from './dispenser';
3
+ export * from './fixedRate';
@@ -0,0 +1,28 @@
1
+ import Web3 from 'web3';
2
+ import { AbiItem } from 'web3-utils/types';
3
+ import { TransactionReceipt } from 'web3-core';
4
+ import { Contract } from 'web3-eth-contract';
5
+ export declare class SideStaking {
6
+ ssAbi: AbiItem | AbiItem[];
7
+ web3: Web3;
8
+ GASLIMIT_DEFAULT: number;
9
+ constructor(web3: Web3, ssAbi?: AbiItem | AbiItem[]);
10
+ amountToUnits(token: string, amount: string): Promise<string>;
11
+ unitsToAmount(token: string, amount: string): Promise<string>;
12
+ getDataTokenCirculatingSupply(ssAddress: string, datatokenAddress: string): Promise<string>;
13
+ getDataTokenCurrentCirculatingSupply(ssAddress: string, datatokenAddress: string): Promise<string>;
14
+ getPublisherAddress(ssAddress: string, datatokenAddress: string): Promise<string>;
15
+ getBasetoken(ssAddress: string, datatokenAddress: string): Promise<string>;
16
+ getPoolAddress(ssAddress: string, datatokenAddress: string): Promise<string>;
17
+ getBasetokenBalance(ssAddress: string, datatokenAddress: string): Promise<string>;
18
+ getDatatokenBalance(ssAddress: string, datatokenAddress: string): Promise<string>;
19
+ getvestingEndBlock(ssAddress: string, datatokenAddress: string): Promise<string>;
20
+ getvestingAmount(ssAddress: string, datatokenAddress: string): Promise<string>;
21
+ getvestingLastBlock(ssAddress: string, datatokenAddress: string): Promise<string>;
22
+ getvestingAmountSoFar(ssAddress: string, datatokenAddress: string): Promise<string>;
23
+ estGetVesting(account: string, ssAddress: string, datatokenAddress: string, contractInstance?: Contract): Promise<number>;
24
+ getVesting(account: string, ssAddress: string, datatokenAddress: string): Promise<TransactionReceipt>;
25
+ estSetPoolSwapFee(account: string, ssAddress: string, datatokenAddress: string, poolAddress: string, swapFee: number, contractInstance?: Contract): Promise<number>;
26
+ setPoolSwapFee(account: string, ssAddress: string, datatokenAddress: string, poolAddress: string, swapFee: number): Promise<TransactionReceipt>;
27
+ getRouter(ssAddress: string): Promise<string>;
28
+ }
@@ -0,0 +1 @@
1
+ export * from './SideStaking';
@@ -0,0 +1,31 @@
1
+ import Web3 from 'web3';
2
+ import { FileMetadata, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ProviderInitialize } from '../@types/';
3
+ export interface ServiceEndpoint {
4
+ serviceName: string;
5
+ method: string;
6
+ urlPath: string;
7
+ }
8
+ export interface UserCustomParameters {
9
+ [key: string]: any;
10
+ }
11
+ export declare class Provider {
12
+ getEndpoints(providerUri: string): Promise<any>;
13
+ getEndpointURL(servicesEndpoints: ServiceEndpoint[], serviceName: string): ServiceEndpoint;
14
+ getServiceEndpoints(providerEndpoint: string, endpoints: any): Promise<ServiceEndpoint[]>;
15
+ getNonce(providerUri: string, consumerAddress: string, fetchMethod: any, providerEndpoints?: any, serviceEndpoints?: ServiceEndpoint[]): Promise<string>;
16
+ createSignature(web3: Web3, accountId: string, agreementId: string): Promise<string>;
17
+ createHashSignature(web3: Web3, accountId: string, message: string): Promise<string>;
18
+ encrypt(data: any, providerUri: string, postMethod: any): Promise<any>;
19
+ checkDidFiles(did: string, serviceId: number, providerUri: string, fetchMethod: any): Promise<FileMetadata[]>;
20
+ checkFileUrl(url: string, providerUri: string, fetchMethod: any): Promise<FileMetadata[]>;
21
+ initialize(did: string, serviceId: string, fileIndex: number, consumerAddress: string, providerUri: string, getMethod: any, userCustomParameters?: UserCustomParameters, computeEnv?: string): Promise<ProviderInitialize>;
22
+ getDownloadUrl(did: string, accountId: string, serviceId: string, fileIndex: number, transferTxId: string, providerUri: string, web3: Web3, userCustomParameters?: UserCustomParameters): Promise<any>;
23
+ computeStart(providerUri: string, web3: Web3, fetchMethod: any, consumerAddress: string, computeEnv: string, dataset: ComputeAsset, algorithm: ComputeAlgorithm, additionalDatasets?: ComputeAsset[], output?: ComputeOutput): Promise<ComputeJob | ComputeJob[]>;
24
+ computeStop(did: string, consumerAddress: string, jobId: string, providerUri: string, web3: Web3, fetchMethod: any): Promise<ComputeJob | ComputeJob[]>;
25
+ computeStatus(providerUri: string, fetchMethod: any, jobId?: string, did?: string, consumerAddress?: string): Promise<ComputeJob | ComputeJob[]>;
26
+ computeResult(jobId: string, index: number, destination: string, accountId: string, providerUri: string, web3: Web3, fetchMethod: any): Promise<any>;
27
+ computeDelete(did: string, consumerAddress: string, jobId: string, providerUri: string, web3: Web3, fetchMethod: any): Promise<ComputeJob | ComputeJob[]>;
28
+ isValidProvider(url: string, fetchMethod: any): Promise<boolean>;
29
+ }
30
+ export declare const ProviderInstance: Provider;
31
+ export default ProviderInstance;
@@ -0,0 +1 @@
1
+ export * from './Provider';
@@ -0,0 +1,77 @@
1
+ import Web3 from 'web3';
2
+ import { AbiItem } from 'web3-utils';
3
+ import { TransactionReceipt } from 'web3-eth';
4
+ import { Contract } from 'web3-eth-contract';
5
+ import { FreOrderParams, FreCreationParams } from '../interfaces';
6
+ import { Nft } from './NFT';
7
+ interface Roles {
8
+ minter: boolean;
9
+ paymentManager: boolean;
10
+ }
11
+ export interface OrderParams {
12
+ consumer: string;
13
+ serviceIndex: number;
14
+ providerFeeAddress: string;
15
+ providerFeeToken: string;
16
+ providerFeeAmount: string;
17
+ v: string;
18
+ r: string;
19
+ s: string;
20
+ providerData: string;
21
+ }
22
+ export interface DispenserParams {
23
+ maxTokens: string;
24
+ maxBalance: string;
25
+ withMint?: boolean;
26
+ allowedSwapper?: string;
27
+ }
28
+ export declare class Datatoken {
29
+ GASLIMIT_DEFAULT: number;
30
+ factoryAddress: string;
31
+ factoryABI: AbiItem | AbiItem[];
32
+ datatokensAbi: AbiItem | AbiItem[];
33
+ datatokensEnterpriseAbi: AbiItem | AbiItem[];
34
+ web3: Web3;
35
+ startBlock: number;
36
+ nft: Nft;
37
+ constructor(web3: Web3, datatokensAbi?: AbiItem | AbiItem[], datatokensEnterpriseAbi?: AbiItem | AbiItem[], startBlock?: number);
38
+ estGasApprove(dtAddress: string, spender: string, amount: string, address: string, contractInstance?: Contract): Promise<any>;
39
+ approve(dtAddress: string, spender: string, amount: string, address: string): Promise<TransactionReceipt>;
40
+ estGasMint(dtAddress: string, address: string, amount: string, toAddress?: string, contractInstance?: Contract): Promise<any>;
41
+ estGasCreateFixedRate(dtAddress: string, address: string, fixedRateParams: FreCreationParams, contractInstance?: Contract): Promise<any>;
42
+ createFixedRate(dtAddress: string, address: string, fixedRateParams: FreCreationParams): Promise<TransactionReceipt>;
43
+ estGasCreateDispenser(dtAddress: string, address: string, dispenserAddress: string, dispenserParams: DispenserParams, contractInstance?: Contract): Promise<any>;
44
+ createDispenser(dtAddress: string, address: string, dispenserAddress: string, dispenserParams: DispenserParams): Promise<TransactionReceipt>;
45
+ mint(dtAddress: string, address: string, amount: string, toAddress?: string): Promise<TransactionReceipt>;
46
+ estGasAddMinter(dtAddress: string, address: string, minter: string, contractInstance?: Contract): Promise<any>;
47
+ addMinter(dtAddress: string, address: string, minter: string): Promise<TransactionReceipt>;
48
+ estGasRemoveMinter(dtAddress: string, address: string, minter: string, contractInstance?: Contract): Promise<any>;
49
+ removeMinter(dtAddress: string, address: string, minter: string): Promise<TransactionReceipt>;
50
+ estGasAddPaymentManager(dtAddress: string, address: string, paymentManager: string, contractInstance?: Contract): Promise<any>;
51
+ addPaymentManager(dtAddress: string, address: string, paymentManager: string): Promise<TransactionReceipt>;
52
+ estGasRemovePaymentManager(dtAddress: string, address: string, paymentManager: string, contractInstance?: Contract): Promise<any>;
53
+ removePaymentManager(dtAddress: string, address: string, paymentManager: string): Promise<TransactionReceipt>;
54
+ estGasSetPaymentCollector(dtAddress: string, address: string, paymentCollector: string, contractInstance?: Contract): Promise<any>;
55
+ setPaymentCollector(dtAddress: string, address: string, paymentCollector: string): Promise<TransactionReceipt>;
56
+ getPaymentCollector(dtAddress: string): Promise<string>;
57
+ transfer(dtAddress: string, toAddress: string, amount: string, address: string): Promise<TransactionReceipt>;
58
+ estGasTransfer(dtAddress: string, toAddress: string, amount: string, address: string, contractInstance?: Contract): Promise<any>;
59
+ transferWei(dtAddress: string, toAddress: string, amount: string, address: string): Promise<TransactionReceipt>;
60
+ estGasStartOrder(dtAddress: string, address: string, consumer: string, serviceIndex: number, providerFeeAddress: string, providerFeeToken: string, providerFeeAmount: string, v: string, r: string, s: string, providerDatas: string, contractInstance?: Contract): Promise<any>;
61
+ startOrder(dtAddress: string, address: string, consumer: string, serviceIndex: number, providerFeeAddress: string, providerFeeToken: string, providerFeeAmount: string, v: string, r: string, s: string, providerDatas: string): Promise<TransactionReceipt>;
62
+ estGasBuyFromFreAndOrder(dtAddress: string, address: string, orderParams: OrderParams, freParams: FreOrderParams, contractInstance?: Contract): Promise<any>;
63
+ buyFromFreAndOrder(dtAddress: string, address: string, orderParams: OrderParams, freParams: FreOrderParams): Promise<TransactionReceipt>;
64
+ estGasBuyFromDispenserAndOrder(dtAddress: string, address: string, orderParams: OrderParams, dispenserContract: string, contractInstance?: Contract): Promise<any>;
65
+ buyFromDispenserAndOrder(dtAddress: string, address: string, orderParams: OrderParams, dispenserContract: string): Promise<TransactionReceipt>;
66
+ estGasSetData(dtAddress: string, address: string, value: string, contractInstance?: Contract): Promise<any>;
67
+ setData(dtAddress: string, address: string, value: string): Promise<TransactionReceipt>;
68
+ estGasCleanPermissions(dtAddress: string, address: string, contractInstance?: Contract): Promise<any>;
69
+ cleanPermissions(dtAddress: string, address: string): Promise<TransactionReceipt>;
70
+ getDTPermissions(dtAddress: string, address: string): Promise<Roles>;
71
+ getCap(dtAddress: string): Promise<string>;
72
+ getDecimals(dtAddress: string): Promise<string>;
73
+ getNFTAddress(dtAddress: string): Promise<string>;
74
+ isERC20Deployer(dtAddress: string, address: string): Promise<boolean>;
75
+ balance(dataTokenAddress: string, address: string): Promise<string>;
76
+ }
77
+ export {};
@@ -0,0 +1,57 @@
1
+ import Web3 from 'web3';
2
+ import { AbiItem } from 'web3-utils';
3
+ import { TransactionReceipt } from 'web3-eth';
4
+ import { Contract } from 'web3-eth-contract';
5
+ import { MetadataProof } from '../../src/@types';
6
+ interface Roles {
7
+ manager: boolean;
8
+ deployERC20: boolean;
9
+ updateMetadata: boolean;
10
+ store: boolean;
11
+ }
12
+ export declare class Nft {
13
+ GASLIMIT_DEFAULT: number;
14
+ factory721Address: string;
15
+ factory721Abi: AbiItem | AbiItem[];
16
+ nftAbi: AbiItem | AbiItem[];
17
+ web3: Web3;
18
+ startBlock: number;
19
+ constructor(web3: Web3, nftAbi?: AbiItem | AbiItem[], startBlock?: number);
20
+ estGasCreateErc20(nftAddress: string, address: string, minter: string, feeManager: string, mpFeeAddress: string, feeToken: string, feeAmount: string, cap: string, name?: string, symbol?: string, templateIndex?: number, contractInstance?: Contract): Promise<any>;
21
+ createErc20(nftAddress: string, address: string, minter: string, feeManager: string, mpFeeAddress: string, feeToken: string, feeAmount: string, cap: string, name?: string, symbol?: string, templateIndex?: number): Promise<string>;
22
+ estGasAddManager(nftAddress: string, address: string, manager: string, contractInstance?: Contract): Promise<any>;
23
+ addManager(nftAddress: string, address: string, manager: string): Promise<any>;
24
+ estGasRemoveManager(nftAddress: string, address: string, manager: string, contractInstance?: Contract): Promise<any>;
25
+ removeManager(nftAddress: string, address: string, manager: string): Promise<any>;
26
+ estGasAddErc20Deployer(nftAddress: string, address: string, erc20Deployer: string, contractInstance?: Contract): Promise<any>;
27
+ addErc20Deployer(nftAddress: string, address: string, erc20Deployer: string): Promise<TransactionReceipt>;
28
+ estGasRemoveErc20Deployer(nftAddress: string, address: string, erc20Deployer: string, contractInstance?: Contract): Promise<any>;
29
+ removeErc20Deployer(nftAddress: string, address: string, erc20Deployer: string): Promise<TransactionReceipt>;
30
+ estGasAddMetadataUpdater(nftAddress: string, address: string, metadataUpdater: string, contractInstance?: Contract): Promise<any>;
31
+ addMetadataUpdater(nftAddress: string, address: string, metadataUpdater: string): Promise<TransactionReceipt>;
32
+ esGasRemoveMetadataUpdater(nftAddress: string, address: string, metadataUpdater: string, contractInstance?: Contract): Promise<any>;
33
+ removeMetadataUpdater(nftAddress: string, address: string, metadataUpdater: string): Promise<TransactionReceipt>;
34
+ estGasAddStoreUpdater(nftAddress: string, address: string, storeUpdater: string, contractInstance?: Contract): Promise<any>;
35
+ addStoreUpdater(nftAddress: string, address: string, storeUpdater: string): Promise<TransactionReceipt>;
36
+ estGasRemoveStoreUpdater(nftAddress: string, address: string, storeUpdater: string, contractInstance?: Contract): Promise<any>;
37
+ removeStoreUpdater(nftAddress: string, address: string, storeUpdater: string): Promise<TransactionReceipt>;
38
+ estGasCleanPermissions(nftAddress: string, address: string, contractInstance?: Contract): Promise<any>;
39
+ cleanPermissions(nftAddress: string, address: string): Promise<TransactionReceipt>;
40
+ estGasTransferNft(nftAddress: string, nftOwner: string, nftReceiver: string, tokenId: number, contractInstance?: Contract): Promise<any>;
41
+ transferNft(nftAddress: string, nftOwner: string, nftReceiver: string, tokenId?: number): Promise<TransactionReceipt>;
42
+ estGasSafeTransferNft(nftAddress: string, nftOwner: string, nftReceiver: string, tokenId: number, contractInstance?: Contract): Promise<any>;
43
+ safeTransferNft(nftAddress: string, nftOwner: string, nftReceiver: string, tokenId?: number): Promise<TransactionReceipt>;
44
+ estGasSetMetadata(nftAddress: string, metadataUpdater: string, metadataState: number, metaDataDecryptorUrl: string, metaDataDecryptorAddress: string, flags: string, data: string, metadataHash: string, metadataProofs?: MetadataProof[], contractInstance?: Contract): Promise<any>;
45
+ setMetadata(nftAddress: string, address: string, metadataState: number, metaDataDecryptorUrl: string, metaDataDecryptorAddress: string, flags: string, data: string, metadataHash: string, metadataProofs?: MetadataProof[]): Promise<TransactionReceipt>;
46
+ estGasSetMetadataState(nftAddress: string, metadataUpdater: string, metadataState: number, contractInstance?: Contract): Promise<any>;
47
+ setMetadataState(nftAddress: string, address: string, metadataState: number): Promise<TransactionReceipt>;
48
+ estSetTokenURI(nftAddress: string, address: string, data: string): Promise<any>;
49
+ setTokenURI(nftAddress: string, address: string, data: string): Promise<any>;
50
+ getNftOwner(nftAddress: string): Promise<string>;
51
+ getNftPermissions(nftAddress: string, address: string): Promise<Roles>;
52
+ getMetadata(nftAddress: string): Promise<Object>;
53
+ isErc20Deployer(nftAddress: string, address: string): Promise<boolean>;
54
+ getData(nftAddress: string, key: string): Promise<string>;
55
+ getTokenURI(nftAddress: string, id: number): Promise<string>;
56
+ }
57
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './Datatoken';
2
+ export * from './NFT';
@@ -0,0 +1,6 @@
1
+ import Config from '../models/Config';
2
+ export declare const configHelperNetworks: Config[];
3
+ export declare class ConfigHelper {
4
+ getAddressesFromEnv(network: string): Partial<Config>;
5
+ getConfig(network: string | number, infuraProjectId?: string): Config;
6
+ }
@@ -0,0 +1 @@
1
+ export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
@@ -0,0 +1,4 @@
1
+ import { Erc20CreateParams, FreCreationParams, PoolCreationParams } from '../interfaces';
2
+ export declare function getErcCreationParams(ercParams: Erc20CreateParams): any;
3
+ export declare function getFreCreationParams(freParams: FreCreationParams): any;
4
+ export declare function getPoolCreationParams(poolParams: PoolCreationParams): any;
@@ -0,0 +1,3 @@
1
+ export declare const zeroX: (input: string) => string;
2
+ export declare const noZeroX: (input: string) => string;
3
+ export declare function zeroXTransformer(input: string, zeroOutput: boolean): string;
@@ -1,4 +1,4 @@
1
- export declare function generateDatatokenName(wordList?: {
1
+ export declare function generateDtName(wordList?: {
2
2
  nouns: string[];
3
3
  adjectives: string[];
4
4
  }): {
@@ -0,0 +1,2 @@
1
+ export declare function generateDid(erc721Address: string, chainId: number): string;
2
+ export declare function getHash(data: any): string;
@@ -0,0 +1,5 @@
1
+ export declare function fetchData(url: string, opts: RequestInit): Promise<Response>;
2
+ export declare function downloadFile(url: string, destination?: string, index?: number): Promise<string>;
3
+ export declare function getData(url: string): Promise<Response>;
4
+ export declare function postData(url: string, payload: BodyInit): Promise<Response>;
5
+ export declare function crossFetchGeneric(method: string, url: string, body: string, headers: any): Promise<Response>;
@@ -0,0 +1,2 @@
1
+ import Web3 from 'web3';
2
+ export declare function getFairGasPrice(web3: Web3): Promise<string>;
File without changes
@@ -0,0 +1,8 @@
1
+ import Web3 from 'web3';
2
+ export declare function signText(web3: Web3, text: string, publicKey: string, password?: string): Promise<string>;
3
+ export declare function signHash(web3: Web3, message: string, address: string): Promise<{
4
+ v: string;
5
+ r: string;
6
+ s: string;
7
+ }>;
8
+ export declare function signWithHash(web3: Web3, text: string, publicKey: string, password?: string): Promise<string>;
@@ -0,0 +1,9 @@
1
+ export * from './Logger';
2
+ export * from './GasUtils';
3
+ export * from './DatatokenName';
4
+ export * from './ContractParams';
5
+ export * from './FetchHelper';
6
+ export * from './ConfigHelper';
7
+ export * from './DdoHelpers';
8
+ export * from './Constants';
9
+ export * from './SignatureUtils';
@@ -168,8 +168,8 @@ The process of creating and deploying the ERC20 datatokens has been automated by
168
168
  const Web3 = require("web3");
169
169
  const { Ocean, DataTokens } = require("@oceanprotocol/lib");
170
170
 
171
- const factoryABI = require("@oceanprotocol/contracts/artifacts/DTFactory.json").abi;
172
- const datatokensABI = require("@oceanprotocol/contracts/artifacts/DataTokenTemplate.json").abi;
171
+ const { factoryABI } = require("@oceanprotocol/contracts/artifacts/DTFactory.json");
172
+ const { datatokensABI } = require("@oceanprotocol/contracts/artifacts/DataTokenTemplate.json");
173
173
  const { config, contracts, urls } = require("./config");
174
174
 
175
175
  const init = async () => {
@@ -114,8 +114,8 @@ Now open the `index.js` file in your text editor. Enter the following code and s
114
114
  const Web3 = require("web3");
115
115
  const { Ocean, DataTokens } = require("@oceanprotocol/lib");
116
116
 
117
- const factoryABI = require("@oceanprotocol/contracts/artifacts/DTFactory.json").abi;
118
- const datatokensABI = require("@oceanprotocol/contracts/artifacts/DataTokenTemplate.json").abi;
117
+ const { factoryABI } = require("@oceanprotocol/contracts/artifacts/DTFactory.json");
118
+ const { datatokensABI } = require("@oceanprotocol/contracts/artifacts/DataTokenTemplate.json");
119
119
  const { config, contracts, urls } = require("./config");
120
120
 
121
121
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@oceanprotocol/lib",
3
3
  "source": "./src/index.ts",
4
- "version": "0.20.2",
4
+ "version": "1.0.0-next.0",
5
5
  "description": "JavaScript client library for Ocean Protocol",
6
6
  "main": "./dist/node/lib.js",
7
7
  "exports": "./dist/node/lib.js",
8
8
  "module": "./dist/node/lib.module.js",
9
- "typings": "./dist/node/lib.d.ts",
9
+ "typings": "./dist/node/index.d.ts",
10
10
  "umd:main": "dist/node/lib.umd.js",
11
11
  "unpkg": "./dist/node/lib.cjs2.min.js",
12
12
  "scripts": {
@@ -24,7 +24,15 @@
24
24
  "release": "release-it --non-interactive",
25
25
  "changelog": "auto-changelog -p",
26
26
  "prepublishOnly": "npm run build",
27
- "test": "npm run lint && npm run test:unit:cover && npm run test:integration:cover",
27
+ "test:ss": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/pools/ssContracts/SideStaking.test.ts'",
28
+ "test:fixed": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/pools/fixedRate/FixedRateExchange.test.ts'",
29
+ "test:pool": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/pools/balancer/Pool.test.ts'",
30
+ "test:dispenser": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/pools/dispenser/Dispenser.test.ts'",
31
+ "test:dt": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/tokens/Datatoken.test.ts'",
32
+ "test:nftDt": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/Nft.test.ts'",
33
+ "test:factory": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/NftFactory.test.ts'",
34
+ "test:router": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/pools/Router.test.ts'",
35
+ "test:publishAll": "mocha --config=test/integration/.mocharc.json --node-env=test --exit 'test/integration/PublishFlows.test.ts'",
28
36
  "test:unit": "mocha --config=test/unit/.mocharc.json --node-env=test --exit 'test/unit/**/*.test.ts'",
29
37
  "test:unit:cover": "nyc --report-dir coverage/unit npm run test:unit",
30
38
  "test:integration": "mocha --config=test/integration/.mocharc.json --node-env=test --exit 'test/integration/**/*.test.ts'",
@@ -45,27 +53,23 @@
45
53
  "web3": ">=1.3.5"
46
54
  },
47
55
  "dependencies": {
48
- "@ethereum-navigator/navigator": "^0.5.3",
49
- "@oceanprotocol/contracts": "^0.6.9",
56
+ "bignumber.js": "^9.0.2",
50
57
  "cross-fetch": "^3.1.4",
51
58
  "crypto-js": "^4.0.0",
52
59
  "decimal.js": "^10.2.1",
53
60
  "fs": "0.0.1-security",
54
- "lzma": "^2.3.2",
55
- "node-abort-controller": "^2.0.0",
56
61
  "save-file": "^2.3.1",
57
- "uuid": "^8.3.2",
58
- "web3": "^1.6.1",
59
- "web3-core": "^1.5.3",
60
- "web3-eth-contract": "^1.5.2"
62
+ "web3": ">=1.3.5",
63
+ "web3-core": "^1.6.1",
64
+ "web3-eth-contract": "^1.6.1"
61
65
  },
62
66
  "devDependencies": {
63
- "@truffle/hdwallet-provider": "^2.0.0",
64
- "@types/chai": "^4.3.0",
67
+ "@truffle/hdwallet-provider": "^1.5.1",
68
+ "@types/chai": "^4.2.19",
65
69
  "@types/chai-spies": "^1.0.3",
66
- "@types/crypto-js": "^4.1.0",
70
+ "@types/crypto-js": "^4.0.1",
67
71
  "@types/mocha": "^9.0.0",
68
- "@types/node": "^17.0.7",
72
+ "@types/node": "^16.10.3",
69
73
  "@types/node-fetch": "^3.0.3",
70
74
  "@typescript-eslint/eslint-plugin": "^4.33.0",
71
75
  "@typescript-eslint/parser": "^4.33.0",
@@ -78,17 +82,17 @@
78
82
  "eslint-config-prettier": "^8.3.0",
79
83
  "eslint-plugin-prettier": "^4.0.0",
80
84
  "microbundle": "^0.14.2",
81
- "mocha": "^9.1.3",
82
- "mock-local-storage": "^1.1.19",
85
+ "mocha": "^9.1.2",
86
+ "mock-local-storage": "^1.1.17",
83
87
  "nyc": "^15.1.0",
84
88
  "ora": "5.4.1",
85
- "prettier": "^2.5.1",
86
- "release-it": "^14.11.8",
87
- "source-map-support": "^0.5.21",
88
- "ts-node": "^10.4.0",
89
+ "prettier": "^2.3.1",
90
+ "release-it": "^14.12.1",
91
+ "source-map-support": "^0.5.19",
92
+ "ts-node": "^10.0.0",
89
93
  "ts-node-register": "^1.0.0",
90
- "typedoc": "0.22.10",
91
- "typescript": "^4.5.4"
94
+ "typedoc": "0.22.5",
95
+ "typescript": "^4.3.4"
92
96
  },
93
97
  "nyc": {
94
98
  "include": [
@@ -1,25 +0,0 @@
1
- import Web3 from 'web3';
2
- import Config from './models/Config';
3
- import { Logger } from './utils';
4
- import { Ocean } from './ocean/Ocean';
5
- export interface InstantiableConfig {
6
- ocean: Ocean;
7
- config?: Config;
8
- web3?: Web3;
9
- logger?: Logger;
10
- }
11
- export declare function generateIntantiableConfigFromConfig(config: Config): Partial<InstantiableConfig>;
12
- export declare abstract class Instantiable {
13
- protected get ocean(): Ocean;
14
- protected get web3(): Web3;
15
- protected get config(): Config;
16
- protected get logger(): Logger;
17
- protected get instanceConfig(): InstantiableConfig;
18
- static getInstance(...args: any[]): Promise<any>;
19
- protected static setInstanceConfig<T extends Instantiable>(instance: T, { ocean, config, web3, logger }: InstantiableConfig): void;
20
- private _ocean;
21
- private _web3;
22
- private _config;
23
- private _logger;
24
- protected setInstanceConfig(config: InstantiableConfig): void;
25
- }
@@ -1,95 +0,0 @@
1
- import Web3 from 'web3';
2
- import { AbiItem } from 'web3-utils/types';
3
- import { TransactionReceipt } from 'web3-core';
4
- import { Pool } from './Pool';
5
- import { SubscribablePromise, Logger } from '../utils';
6
- import { ConfigHelperConfig } from '../utils/ConfigHelper';
7
- declare type PoolTransactionType = 'swap' | 'join' | 'exit';
8
- export interface PoolDetails {
9
- poolAddress: string;
10
- tokens: string[];
11
- }
12
- export interface PoolShare {
13
- poolAddress: string;
14
- shares: string;
15
- did: string;
16
- }
17
- export interface TokensReceived {
18
- dtAmount: string;
19
- oceanAmount: string;
20
- }
21
- export interface PoolTransaction {
22
- poolAddress: string;
23
- dtAddress: string;
24
- caller: string;
25
- transactionHash: string;
26
- blockNumber: number;
27
- timestamp: number;
28
- tokenIn?: string;
29
- tokenOut?: string;
30
- tokenAmountIn?: string;
31
- tokenAmountOut?: string;
32
- type: PoolTransactionType;
33
- }
34
- export declare enum PoolCreateProgressStep {
35
- CreatingPool = 0,
36
- ApprovingDatatoken = 1,
37
- ApprovingOcean = 2,
38
- SetupPool = 3
39
- }
40
- export declare class OceanPool extends Pool {
41
- oceanAddress: string;
42
- dtAddress: string;
43
- startBlock: number;
44
- constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], poolABI?: AbiItem | AbiItem[], factoryAddress?: string, oceanAddress?: string, config?: ConfigHelperConfig);
45
- create(account: string, dtAddress: string, dtAmount: string, dtWeight: string, oceanAmount: string, fee: string): SubscribablePromise<PoolCreateProgressStep, TransactionReceipt>;
46
- getDTAddress(poolAddress: string): Promise<string>;
47
- getOceanReserve(poolAddress: string): Promise<string>;
48
- getDTReserve(poolAddress: string): Promise<string>;
49
- getMaxBuyQuantity(poolAddress: string, tokenAddress: string): Promise<string>;
50
- getOceanMaxBuyQuantity(poolAddress: string): Promise<string>;
51
- getDTMaxBuyQuantity(poolAddress: string): Promise<string>;
52
- calcInGivenOut(poolAddress: string, tokenInAddress: string, tokenOutAddress: string, tokenOutAmount: string): Promise<string>;
53
- calcOutGivenIn(poolAddress: string, tokenInAddress: string, tokenOutAddress: string, tokenInAmount: string): Promise<string>;
54
- calcPoolOutGivenSingleIn(poolAddress: string, tokenInAddress: string, tokenInAmount: string): Promise<string>;
55
- calcSingleInGivenPoolOut(poolAddress: string, tokenInAddress: string, poolShares: string): Promise<string>;
56
- calcSingleOutGivenPoolIn(poolAddress: string, tokenOutAddress: string, poolShares: string): Promise<string>;
57
- calcPoolInGivenSingleOut(poolAddress: string, tokenOutAddress: string, tokenOutAmount: string): Promise<string>;
58
- getPoolSharesRequiredToRemoveDT(poolAddress: string, dtAmount: string): Promise<string>;
59
- getDTRemovedforPoolShares(poolAddress: string, poolShares: string): Promise<string>;
60
- getPoolSharesRequiredToRemoveOcean(poolAddress: string, oceanAmount: string): Promise<string>;
61
- getOceanRemovedforPoolShares(poolAddress: string, poolShares: string): Promise<string>;
62
- getTokensRemovedforPoolShares(poolAddress: string, poolShares: string): Promise<TokensReceived>;
63
- getDTMaxAddLiquidity(poolAddress: string): Promise<string>;
64
- getOceanMaxAddLiquidity(poolAddress: string): Promise<string>;
65
- getMaxAddLiquidity(poolAddress: string, tokenAddress: string): Promise<string>;
66
- getMaxRemoveLiquidity(poolAddress: string, tokenAddress: string): Promise<string>;
67
- getDTMaxRemoveLiquidity(poolAddress: string): Promise<string>;
68
- getOceanMaxRemoveLiquidity(poolAddress: string): Promise<string>;
69
- buyDT(account: string, poolAddress: string, dtAmountWanted: string, maxOceanAmount: string, maxPrice?: string): Promise<TransactionReceipt>;
70
- buyDTWithExactOcean(account: string, poolAddress: string, minimumdtAmountWanted: string, oceanAmount: string, maxPrice?: string): Promise<TransactionReceipt>;
71
- sellDT(account: string, poolAddress: string, dtAmount: string, oceanAmountWanted: string, maxPrice?: string): Promise<TransactionReceipt>;
72
- addDTLiquidity(account: string, poolAddress: string, amount: string): Promise<TransactionReceipt>;
73
- removeDTLiquidity(account: string, poolAddress: string, amount: string, maximumPoolShares: string): Promise<TransactionReceipt>;
74
- addOceanLiquidity(account: string, poolAddress: string, amount: string): Promise<TransactionReceipt>;
75
- removeOceanLiquidityWithMinimum(account: string, poolAddress: string, poolShares: string, minOcean: string): Promise<TransactionReceipt>;
76
- removeOceanLiquidity(account: string, poolAddress: string, amount: string, maximumPoolShares: string): Promise<TransactionReceipt>;
77
- removePoolLiquidity(account: string, poolAddress: string, poolShares: string, minDT?: string, minOcean?: string): Promise<TransactionReceipt>;
78
- getDTPrice(poolAddress: string): Promise<string>;
79
- searchPoolforDT(dtAddress: string): Promise<string[]>;
80
- getOceanNeeded(poolAddress: string, dtRequired: string): Promise<string>;
81
- getOceanReceived(poolAddress: string, dtAmount: string): Promise<string>;
82
- getDTReceived(poolAddress: string, oceanAmount: string): Promise<string>;
83
- getDTNeeded(poolAddress: string, OceanRequired: string): Promise<string>;
84
- getPoolsbyCreator(account?: string): Promise<PoolDetails[]>;
85
- private getResult;
86
- getPoolSharesByAddress(account: string): Promise<PoolShare[]>;
87
- getPoolDetails(poolAddress: string): Promise<PoolDetails>;
88
- getPoolLogs(poolAddress: string, startBlock?: number, account?: string): Promise<PoolTransaction[]>;
89
- getAllPoolLogs(account: string): Promise<PoolTransaction[]>;
90
- private getEventData;
91
- private computeSlippage;
92
- computeBuySlippage(poolAddress: string, oceanAmount: string): Promise<string>;
93
- computeSellSlippage(poolAddress: string, dtAmount: string): Promise<string>;
94
- }
95
- export {};