@oceanprotocol/lib 1.1.6 → 2.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.
- package/CHANGELOG.md +48 -16
- package/CodeExamples.md +28 -315
- package/README.md +4 -7
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/src/@types/Asset.d.ts +4 -4
- package/dist/src/@types/Compute.d.ts +1 -1
- package/dist/src/@types/DDO/DDO.d.ts +2 -5
- package/dist/src/@types/{Erc20.d.ts → Datatoken.d.ts} +18 -1
- package/dist/src/@types/Dispenser.d.ts +9 -0
- package/dist/src/@types/FixedPrice.d.ts +24 -0
- package/dist/src/@types/{Erc721.d.ts → NFT.d.ts} +6 -0
- package/dist/src/@types/NFTFactory.d.ts +20 -0
- package/dist/src/@types/Provider.d.ts +8 -0
- package/dist/src/@types/ReturnTypes.d.ts +2 -0
- package/dist/src/@types/Router.d.ts +1 -1
- package/dist/src/@types/index.d.ts +11 -8
- package/dist/src/{models → config}/Config.d.ts +2 -23
- package/dist/src/{utils → config}/ConfigHelper.d.ts +1 -1
- package/dist/src/config/index.d.ts +2 -0
- package/dist/src/contracts/Datatoken.d.ts +232 -0
- package/dist/src/contracts/Dispenser.d.ts +73 -0
- package/dist/src/contracts/FixedRateExchange.d.ts +212 -0
- package/dist/src/contracts/NFT.d.ts +197 -0
- package/dist/src/contracts/NFTFactory.d.ts +144 -0
- package/dist/src/contracts/Router.d.ts +92 -0
- package/dist/src/contracts/SmartContract.d.ts +22 -0
- package/dist/src/contracts/SmartContractWithAddress.d.ts +18 -0
- package/dist/src/contracts/index.d.ts +8 -0
- package/dist/src/index.d.ts +4 -7
- package/dist/src/{aquarius → services}/Aquarius.d.ts +25 -3
- package/dist/src/{provider → services}/Provider.d.ts +5 -13
- package/dist/src/services/index.d.ts +2 -0
- package/dist/src/utils/Constants.d.ts +2 -0
- package/dist/src/utils/ContractUtils.d.ts +14 -8
- package/dist/src/utils/DdoHelpers.d.ts +1 -1
- package/dist/src/utils/FetchHelper.d.ts +1 -4
- package/dist/src/utils/Logger.d.ts +0 -1
- package/dist/src/utils/TokenUtils.d.ts +17 -39
- package/dist/src/utils/index.d.ts +6 -7
- package/dist/test/TestContractHandler.d.ts +4 -4
- package/dist/test/config.d.ts +1 -1
- package/dist/test/unit/{tokens/Datatoken.test.d.ts → Datatoken.test.d.ts} +0 -0
- package/dist/test/unit/{pools/dispenser/Dispenser.test.d.ts → Dispenser.test.d.ts} +0 -0
- package/dist/test/unit/{pools/fixedRate/FixedRateExchange.test.d.ts → FixedRateExchange.test.d.ts} +0 -0
- package/dist/test/unit/{tokens/Nft.test.d.ts → Nft.test.d.ts} +0 -0
- package/dist/test/unit/{factories/NftFactory.test.d.ts → NftFactory.test.d.ts} +0 -0
- package/dist/test/unit/{pools/Router.test.d.ts → Router.test.d.ts} +0 -0
- package/package.json +5 -18
- package/dist/src/@types/Pool.d.ts +0 -45
- package/dist/src/aquarius/index.d.ts +0 -1
- package/dist/src/factories/NFTFactory.d.ts +0 -275
- package/dist/src/factories/index.d.ts +0 -1
- package/dist/src/models/index.d.ts +0 -1
- package/dist/src/pools/Router.d.ts +0 -228
- package/dist/src/pools/balancer/Pool.d.ts +0 -395
- package/dist/src/pools/balancer/index.d.ts +0 -1
- package/dist/src/pools/dispenser/Dispenser.d.ts +0 -145
- package/dist/src/pools/dispenser/index.d.ts +0 -1
- package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +0 -388
- package/dist/src/pools/fixedRate/index.d.ts +0 -1
- package/dist/src/pools/index.d.ts +0 -5
- package/dist/src/pools/ssContracts/SideStaking.d.ts +0 -133
- package/dist/src/pools/ssContracts/index.d.ts +0 -1
- package/dist/src/provider/index.d.ts +0 -1
- package/dist/src/tokens/Datatoken.d.ts +0 -413
- package/dist/src/tokens/NFT.d.ts +0 -354
- package/dist/src/tokens/index.d.ts +0 -2
- package/dist/src/utils/ConversionTypeHelper.d.ts +0 -3
- package/dist/src/utils/PoolHelpers.d.ts +0 -8
- package/dist/test/unit/pools/balancer/Pool.test.d.ts +0 -1
- package/dist/test/unit/pools/ssContracts/SideStaking.test.d.ts +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Web3 from 'web3';
|
|
2
|
+
import { Contract } from 'web3-eth-contract';
|
|
3
|
+
import { AbiItem } from 'web3-utils';
|
|
4
|
+
import { Config } from '../config';
|
|
5
|
+
import { SmartContract } from './SmartContract';
|
|
6
|
+
export declare abstract class SmartContractWithAddress extends SmartContract {
|
|
7
|
+
address: string;
|
|
8
|
+
contract: Contract;
|
|
9
|
+
/**
|
|
10
|
+
* Instantiate the smart contract.
|
|
11
|
+
* @param {string} address Address of the smart contract
|
|
12
|
+
* @param {Web3} web3
|
|
13
|
+
* @param {string | number} network Network id or name
|
|
14
|
+
* @param {Config} config Configutation of the smart contract
|
|
15
|
+
* @param {AbiItem | AbiItem[]} abi ABI of the smart contract
|
|
16
|
+
*/
|
|
17
|
+
constructor(address: string, web3: Web3, network?: string | number, config?: Config, abi?: AbiItem | AbiItem[]);
|
|
18
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
export * from './aquarius';
|
|
2
|
-
export * from './pools';
|
|
3
|
-
export * from './tokens';
|
|
4
|
-
export * from './factories';
|
|
5
|
-
export * from './models';
|
|
6
|
-
export * from './utils';
|
|
7
1
|
export * from './@types';
|
|
8
|
-
export * from './
|
|
2
|
+
export * from './config';
|
|
3
|
+
export * from './contracts';
|
|
4
|
+
export * from './services';
|
|
5
|
+
export * from './utils';
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { Asset, DDO, ValidateMetadata } from '../@types
|
|
1
|
+
import { Asset, DDO, ValidateMetadata } from '../@types';
|
|
2
|
+
export interface SearchQuery {
|
|
3
|
+
from?: number;
|
|
4
|
+
size?: number;
|
|
5
|
+
query: any;
|
|
6
|
+
sort?: {
|
|
7
|
+
[jsonPath: string]: string;
|
|
8
|
+
};
|
|
9
|
+
aggs?: any;
|
|
10
|
+
}
|
|
2
11
|
export declare class Aquarius {
|
|
3
|
-
aquariusURL:
|
|
12
|
+
aquariusURL: string;
|
|
4
13
|
/**
|
|
5
14
|
* Instantiate Aquarius
|
|
6
15
|
* @param {String} aquariusURL
|
|
@@ -28,5 +37,18 @@ export declare class Aquarius {
|
|
|
28
37
|
* @return {Promise<ValidateMetadata>}.
|
|
29
38
|
*/
|
|
30
39
|
validate(ddo: DDO, signal?: AbortSignal): Promise<ValidateMetadata>;
|
|
40
|
+
/**
|
|
41
|
+
* Search over the DDOs using a query.
|
|
42
|
+
* @param {string} did DID of the asset
|
|
43
|
+
* @param {AbortSignal} signal abort signal
|
|
44
|
+
* @return {Promise<QueryResult>}
|
|
45
|
+
*/
|
|
46
|
+
getAssetMetadata(did: string, signal?: AbortSignal): Promise<any>;
|
|
47
|
+
/**
|
|
48
|
+
* Search over the DDOs using a query.
|
|
49
|
+
* @param {SearchQuery} query Query to filter the DDOs.
|
|
50
|
+
* @param {AbortSignal} signal abort signal
|
|
51
|
+
* @return {Promise<QueryResult>}
|
|
52
|
+
*/
|
|
53
|
+
querySearch(query: SearchQuery, signal?: AbortSignal): Promise<any>;
|
|
31
54
|
}
|
|
32
|
-
export default Aquarius;
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import Web3 from 'web3';
|
|
2
|
-
import { FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults } from '../@types
|
|
3
|
-
export interface HttpCallback {
|
|
4
|
-
(httpMethod: string, url: string, body: string, header: any): Promise<any>;
|
|
5
|
-
}
|
|
6
|
-
export interface ServiceEndpoint {
|
|
7
|
-
serviceName: string;
|
|
8
|
-
method: string;
|
|
9
|
-
urlPath: string;
|
|
10
|
-
}
|
|
11
|
-
export interface UserCustomParameters {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}
|
|
2
|
+
import { FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters } from '../@types';
|
|
14
3
|
export declare class Provider {
|
|
15
4
|
/**
|
|
16
5
|
* Returns the provider endpoints
|
|
@@ -149,6 +138,9 @@ export declare class Provider {
|
|
|
149
138
|
* @return {Promise<boolean>} string
|
|
150
139
|
*/
|
|
151
140
|
isValidProvider(url: string, signal?: AbortSignal): Promise<boolean>;
|
|
141
|
+
private noZeroX;
|
|
142
|
+
private zeroXTransformer;
|
|
143
|
+
private inputMatch;
|
|
144
|
+
private getData;
|
|
152
145
|
}
|
|
153
146
|
export declare const ProviderInstance: Provider;
|
|
154
|
-
export default ProviderInstance;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2
2
|
export declare const GASLIMIT_DEFAULT = 1000000;
|
|
3
|
+
export declare const MAX_UINT_256 = "115792089237316195423570985008687907853269984665640564039457584007913129639934";
|
|
4
|
+
export declare const FEE_HISTORY_NOT_SUPPORTED = "Returned error: Method eth_feeHistory not supported.";
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import Web3 from 'web3';
|
|
2
2
|
import { Contract } from 'web3-eth-contract';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Config } from '../config';
|
|
4
|
+
import { TransactionReceipt } from 'web3-core';
|
|
5
5
|
export declare function setContractDefaults(contract: Contract, config: Config): Contract;
|
|
6
|
-
export declare function getFairGasPrice(web3: Web3,
|
|
7
|
-
export declare function getErcCreationParams(ercParams: Erc20CreateParams): any;
|
|
8
|
-
export declare function getFreOrderParams(web3: Web3, freParams: FreOrderParams): Promise<any>;
|
|
9
|
-
export declare function getFreCreationParams(freParams: FreCreationParams): any;
|
|
10
|
-
export declare function getPoolCreationParams(web3: Web3, poolParams: PoolCreationParams): Promise<any>;
|
|
6
|
+
export declare function getFairGasPrice(web3: Web3, gasFeeMultiplier: number): Promise<string>;
|
|
11
7
|
export declare function unitsToAmount(web3: Web3, token: string, amount: string, tokenDecimals?: number): Promise<string>;
|
|
12
8
|
export declare function amountToUnits(web3: Web3, token: string, amount: string, tokenDecimals?: number): Promise<string>;
|
|
13
9
|
/**
|
|
@@ -17,4 +13,14 @@ export declare function amountToUnits(web3: Web3, token: string, amount: string,
|
|
|
17
13
|
* @param {...any[]} args arguments of the function
|
|
18
14
|
* @return {Promise<number>} gas cost of the function
|
|
19
15
|
*/
|
|
20
|
-
export declare function
|
|
16
|
+
export declare function calculateEstimatedGas(from: string, functionToEstimateGas: Function, ...args: any[]): Promise<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Send the transation on chain
|
|
19
|
+
* @param {string} from account that calls the function
|
|
20
|
+
* @param {any} estGas estimated gas for the transaction
|
|
21
|
+
* @param {Web3} web3 web3 objcet
|
|
22
|
+
* @param {Function} functionToSend function that we need to send
|
|
23
|
+
* @param {...any[]} args arguments of the function
|
|
24
|
+
* @return {Promise<any>} transaction receipt
|
|
25
|
+
*/
|
|
26
|
+
export declare function sendTx(from: string, estGas: number, web3: Web3, gasFeeMultiplier: number, functionToSend: Function, ...args: any[]): Promise<TransactionReceipt>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function generateDid(
|
|
1
|
+
export declare function generateDid(nftAddress: string, chainId: number): string;
|
|
2
2
|
export declare function getHash(data: any): string;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { DownloadResponse } from '../@types
|
|
2
|
-
export declare function fetchData(url: string, opts: RequestInit): Promise<Response>;
|
|
1
|
+
import { DownloadResponse } from '../@types';
|
|
3
2
|
export declare function downloadFileBrowser(url: string): Promise<void>;
|
|
4
3
|
export declare function downloadFile(url: string, index?: number): Promise<DownloadResponse>;
|
|
5
|
-
export declare function getData(url: string): Promise<Response>;
|
|
6
|
-
export declare function postData(url: string, payload: BodyInit): Promise<Response>;
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import { Contract } from 'web3-eth-contract';
|
|
2
|
-
import { TransactionReceipt } from 'web3-core';
|
|
3
1
|
import Web3 from 'web3';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @param {String} account
|
|
7
|
-
* @param {String} tokenAddress
|
|
8
|
-
* @param {String} spender
|
|
9
|
-
* @param {String} amount
|
|
10
|
-
* @param {String} force
|
|
11
|
-
* @param {Contract} contractInstance optional contract instance
|
|
12
|
-
* @return {Promise<number>}
|
|
13
|
-
*/
|
|
14
|
-
export declare function estApprove(web3: Web3, account: string, tokenAddress: string, spender: string, amount: string, contractInstance?: Contract): Promise<number>;
|
|
2
|
+
import { Config } from '../config';
|
|
3
|
+
import { ReceiptOrEstimate } from '../@types';
|
|
15
4
|
/**
|
|
16
5
|
* Approve spender to spent amount tokens
|
|
17
6
|
* @param {String} account
|
|
18
7
|
* @param {String} tokenAddress
|
|
19
8
|
* @param {String} spender
|
|
20
|
-
* @param {String} amount amount of ERC20
|
|
9
|
+
* @param {String} amount amount of ERC20 Datatokens (always expressed as wei)
|
|
21
10
|
* @param {boolean} force if true, will overwrite any previous allowence. Else, will check if allowence is enough and will not send a transaction if it's not needed
|
|
22
11
|
* @param {number} tokenDecimals optional number of decimals of the token
|
|
23
12
|
*/
|
|
24
|
-
export declare function approve(web3: Web3, account: string, tokenAddress: string, spender: string, amount: string, force?: boolean, tokenDecimals?: number): Promise<
|
|
13
|
+
export declare function approve<G extends boolean = false>(web3: Web3, config: Config, account: string, tokenAddress: string, spender: string, amount: string, force?: boolean, tokenDecimals?: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
25
14
|
/**
|
|
26
15
|
* Approve spender to spent amount tokens
|
|
27
16
|
* @param {String} account
|
|
@@ -30,29 +19,18 @@ export declare function approve(web3: Web3, account: string, tokenAddress: strin
|
|
|
30
19
|
* @param {String} amount amount of ERC20 tokens (always expressed as wei)
|
|
31
20
|
* @param {boolean} force if true, will overwrite any previous allowence. Else, will check if allowence is enough and will not send a transaction if it's not needed
|
|
32
21
|
*/
|
|
33
|
-
export declare function approveWei(web3: Web3, account: string, tokenAddress: string, spender: string, amount: string, force?: boolean): Promise<
|
|
34
|
-
/**
|
|
35
|
-
* Estimate gas cost for transfer function
|
|
36
|
-
* @param {String} account
|
|
37
|
-
* @param {String} tokenAddress
|
|
38
|
-
* @param {String} recipient
|
|
39
|
-
* @param {String} amount
|
|
40
|
-
* @param {String} force
|
|
41
|
-
* @param {Contract} contractInstance optional contract instance
|
|
42
|
-
* @return {Promise<number>}
|
|
43
|
-
*/
|
|
44
|
-
export declare function estTransfer(web3: Web3, account: string, tokenAddress: string, recipient: string, amount: string, contractInstance?: Contract): Promise<number>;
|
|
22
|
+
export declare function approveWei<G extends boolean = false>(web3: Web3, config: Config, account: string, tokenAddress: string, spender: string, amount: string, force?: boolean, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
45
23
|
/**
|
|
46
24
|
* Moves amount tokens from the caller’s account to recipient.
|
|
47
25
|
* @param {String} account
|
|
48
26
|
* @param {String} tokenAddress
|
|
49
27
|
* @param {String} recipient
|
|
50
|
-
* @param {String} amount amount of ERC20
|
|
28
|
+
* @param {String} amount amount of ERC20 Datatokens (not as wei)
|
|
51
29
|
* @param {String} force if true, will overwrite any previous allowence. Else, will check if allowence is enough and will not send a transaction if it's not needed
|
|
52
30
|
*/
|
|
53
|
-
export declare function transfer(web3: Web3, account: string, tokenAddress: string, recipient: string, amount: string): Promise<
|
|
31
|
+
export declare function transfer<G extends boolean = false>(web3: Web3, config: Config, account: string, tokenAddress: string, recipient: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
54
32
|
/**
|
|
55
|
-
* Get Allowance for any
|
|
33
|
+
* Get Allowance for any Datatoken
|
|
56
34
|
* @param {Web3} web3
|
|
57
35
|
* @param {String } tokenAdress
|
|
58
36
|
* @param {String} account
|
|
@@ -61,24 +39,24 @@ export declare function transfer(web3: Web3, account: string, tokenAddress: stri
|
|
|
61
39
|
*/
|
|
62
40
|
export declare function allowance(web3: Web3, tokenAddress: string, account: string, spender: string, tokenDecimals?: number): Promise<string>;
|
|
63
41
|
/**
|
|
64
|
-
* Get
|
|
42
|
+
* Get balance for any Datatoken
|
|
65
43
|
* @param {Web3} web3
|
|
66
|
-
* @param {String
|
|
67
|
-
* @param {String}
|
|
44
|
+
* @param {String} tokenAdress
|
|
45
|
+
* @param {String} owner
|
|
68
46
|
* @param {String} spender
|
|
47
|
+
* @param {number} tokenDecimals optional number of decimals of the token
|
|
69
48
|
*/
|
|
70
|
-
export declare function
|
|
49
|
+
export declare function balance(web3: Web3, tokenAddress: string, account: string, tokenDecimals?: number): Promise<string>;
|
|
71
50
|
/**
|
|
72
|
-
* Get
|
|
51
|
+
* Get Allowance for any erc20
|
|
73
52
|
* @param {Web3} web3
|
|
74
53
|
* @param {String} tokenAdress
|
|
75
|
-
* @param {String}
|
|
54
|
+
* @param {String} account
|
|
76
55
|
* @param {String} spender
|
|
77
|
-
* @param {number} tokenDecimals optional number of decimals of the token
|
|
78
56
|
*/
|
|
79
|
-
export declare function
|
|
57
|
+
export declare function allowanceWei(web3: Web3, tokenAddress: string, account: string, spender: string, tokenDecimals?: number): Promise<string>;
|
|
80
58
|
/**
|
|
81
|
-
* Get decimals for any
|
|
59
|
+
* Get decimals for any Datatoken
|
|
82
60
|
* @param {Web3} web3
|
|
83
61
|
* @param {String} tokenAdress
|
|
84
62
|
* @return {Promise<number>} Number of decimals of the token
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './DatatokenName';
|
|
1
|
+
export * from './Constants';
|
|
3
2
|
export * from './ContractUtils';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './ConfigHelper';
|
|
3
|
+
export * from './DatatokenName';
|
|
6
4
|
export * from './DdoHelpers';
|
|
7
|
-
export * from './
|
|
5
|
+
export * from './FetchHelper';
|
|
6
|
+
export * from './General';
|
|
7
|
+
export * from './Logger';
|
|
8
|
+
export * from './minAbi';
|
|
8
9
|
export * from './SignatureUtils';
|
|
9
10
|
export * from './TokenUtils';
|
|
10
|
-
export * from './General';
|
|
11
|
-
export * from './PoolHelpers';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import Web3 from 'web3';
|
|
2
2
|
export interface Addresses {
|
|
3
3
|
opfCommunityFeeCollectorAddress: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
erc721TemplateAddress: string;
|
|
4
|
+
datatokenTemplateAddress: string;
|
|
5
|
+
nftTemplateAddress: string;
|
|
7
6
|
oceanAddress: string;
|
|
8
7
|
routerAddress: string;
|
|
9
8
|
sideStakingAddress: string;
|
|
10
9
|
fixedRateAddress: string;
|
|
11
10
|
dispenserAddress: string;
|
|
12
|
-
|
|
11
|
+
nftFactoryAddress: string;
|
|
13
12
|
daiAddress: string;
|
|
14
13
|
usdcAddress: string;
|
|
14
|
+
poolTemplateAddress: string;
|
|
15
15
|
}
|
|
16
16
|
export declare const deployContracts: (web3: Web3, owner: string) => Promise<Addresses>;
|
package/dist/test/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Web3 from 'web3';
|
|
2
2
|
export declare const GAS_PRICE = "3000000000";
|
|
3
3
|
export declare const web3: Web3;
|
|
4
|
-
export declare const getTestConfig: (web3: Web3) => Promise<import("../src").Config>;
|
|
4
|
+
export declare const getTestConfig: (web3: Web3) => Promise<import("../src/config").Config>;
|
|
5
5
|
export declare const getAddresses: () => any;
|
|
File without changes
|
|
File without changes
|
package/dist/test/unit/{pools/fixedRate/FixedRateExchange.test.d.ts → FixedRateExchange.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanprotocol/lib",
|
|
3
3
|
"source": "./src/index.ts",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0-next.0",
|
|
5
5
|
"description": "JavaScript client library for Ocean Protocol",
|
|
6
6
|
"main": "./dist/lib.js",
|
|
7
7
|
"umd:main": "dist/lib.umd.js",
|
|
@@ -27,25 +27,12 @@
|
|
|
27
27
|
"changelog": "auto-changelog -p",
|
|
28
28
|
"prepublishOnly": "npm run build",
|
|
29
29
|
"mocha": "TS_NODE_PROJECT='./test/tsconfig.json' mocha --config=test/.mocharc.json --node-env=test --exit",
|
|
30
|
-
"test:nftfactory": "npm run mocha -- 'test/unit/factories/NftFactory.test.ts'",
|
|
31
|
-
"test:nft": "npm run mocha -- 'test/unit/tokens/Nft.test.ts'",
|
|
32
|
-
"test:datatoken": "npm run mocha -- 'test/unit/tokens/Datatoken.test.ts'",
|
|
33
|
-
"test:router": "npm run mocha -- 'test/unit/pools/Router.test.ts'",
|
|
34
|
-
"test:fixed": "npm run mocha -- 'test/unit/pools/fixedRate/FixedRateExchange.test.ts'",
|
|
35
|
-
"test:ss": "npm run mocha -- 'test/unit/pools/ssContracts/SideStaking.test.ts'",
|
|
36
|
-
"test:pool": "npm run mocha -- 'test/unit/pools/balancer/Pool.test.ts'",
|
|
37
|
-
"test:dispenser": "npm run mocha -- 'test/unit/pools/dispenser/Dispenser.test.ts'",
|
|
38
|
-
"test:publishAll": "npm run mocha -- 'test/integration/PublishFlows.test.ts'",
|
|
39
|
-
"test:examples": "npm run mocha -- 'test/integration/CodeExamples.test.ts'",
|
|
40
|
-
"test:provider": "npm run mocha -- 'test/integration/Provider.test.ts'",
|
|
41
30
|
"test:unit": "npm run mocha -- 'test/unit/**/*.test.ts'",
|
|
42
31
|
"test:unit:cover": "nyc --report-dir coverage/unit --exclude 'src/@types/**/*' npm run test:unit",
|
|
43
32
|
"test:integration": "npm run mocha -- 'test/integration/**/*.test.ts'",
|
|
44
|
-
"test:
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"create:guide:mac": "chmod +x ./scripts/createCodeExamples-mac.sh && ./scripts/createCodeExamples-mac.sh",
|
|
48
|
-
"commit:guide": "chmod +x scripts/commitChanges.sh && scripts/commitChanges.sh"
|
|
33
|
+
"test:integration:cover": "nyc --report-dir coverage/integration --no-clean npm run test:integration",
|
|
34
|
+
"create:guide": "./scripts/createCodeExamples.sh",
|
|
35
|
+
"commit:guide": "./scripts/commitChanges.sh"
|
|
49
36
|
},
|
|
50
37
|
"repository": {
|
|
51
38
|
"type": "git",
|
|
@@ -96,7 +83,7 @@
|
|
|
96
83
|
"nyc": "^15.1.0",
|
|
97
84
|
"ora": "5.4.1",
|
|
98
85
|
"prettier": "^2.7.1",
|
|
99
|
-
"release-it": "^15.
|
|
86
|
+
"release-it": "^15.4.0",
|
|
100
87
|
"source-map-support": "^0.5.19",
|
|
101
88
|
"ts-node": "^10.8.2",
|
|
102
89
|
"ts-node-register": "^1.0.0",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export interface PoolCreationParams {
|
|
2
|
-
ssContract: string;
|
|
3
|
-
baseTokenAddress: string;
|
|
4
|
-
baseTokenSender: string;
|
|
5
|
-
publisherAddress: string;
|
|
6
|
-
marketFeeCollector: string;
|
|
7
|
-
poolTemplateAddress: string;
|
|
8
|
-
rate: string;
|
|
9
|
-
baseTokenDecimals: number;
|
|
10
|
-
vestingAmount: string;
|
|
11
|
-
vestedBlocks: number;
|
|
12
|
-
initialBaseTokenLiquidity: string;
|
|
13
|
-
swapFeeLiquidityProvider: string;
|
|
14
|
-
swapFeeMarketRunner: string;
|
|
15
|
-
}
|
|
16
|
-
export interface CurrentFees {
|
|
17
|
-
tokens: string[];
|
|
18
|
-
amounts: string[];
|
|
19
|
-
}
|
|
20
|
-
export interface TokenInOutMarket {
|
|
21
|
-
tokenIn: string;
|
|
22
|
-
tokenOut: string;
|
|
23
|
-
marketFeeAddress: string;
|
|
24
|
-
tokenInDecimals?: number;
|
|
25
|
-
tokenOutDecimals?: number;
|
|
26
|
-
}
|
|
27
|
-
export interface AmountsInMaxFee {
|
|
28
|
-
tokenAmountIn: string;
|
|
29
|
-
minAmountOut: string;
|
|
30
|
-
swapMarketFee: string;
|
|
31
|
-
maxPrice?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface AmountsOutMaxFee {
|
|
34
|
-
tokenAmountOut: string;
|
|
35
|
-
maxAmountIn: string;
|
|
36
|
-
swapMarketFee: string;
|
|
37
|
-
maxPrice?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface PoolPriceAndFees {
|
|
40
|
-
tokenAmount: string;
|
|
41
|
-
liquidityProviderSwapFeeAmount: string;
|
|
42
|
-
oceanFeeAmount: string;
|
|
43
|
-
publishMarketSwapFeeAmount: string;
|
|
44
|
-
consumeMarketSwapFeeAmount: string;
|
|
45
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Aquarius';
|