@oceanprotocol/lib 1.0.0-next.13 → 1.0.0-next.14
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 +7 -0
- 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/FixedPrice.d.ts +7 -1
- package/dist/src/@types/Pool.d.ts +2 -2
- package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +5 -4
- package/dist/src/utils/ContractUtils.d.ts +2 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export interface FreCreationParams {
|
|
|
6
6
|
baseTokenDecimals: number;
|
|
7
7
|
datatokenDecimals: number;
|
|
8
8
|
fixedRate: string;
|
|
9
|
-
marketFee:
|
|
9
|
+
marketFee: string;
|
|
10
10
|
withMint?: boolean;
|
|
11
11
|
allowedConsumer?: string;
|
|
12
12
|
}
|
|
@@ -17,3 +17,9 @@ export interface FreOrderParams {
|
|
|
17
17
|
swapMarketFee: string;
|
|
18
18
|
marketFeeAddress: string;
|
|
19
19
|
}
|
|
20
|
+
export interface PriceAndFees {
|
|
21
|
+
baseTokenAmount: string;
|
|
22
|
+
baseTokenAmountBeforeFee: string;
|
|
23
|
+
oceanFeeAmount: string;
|
|
24
|
+
marketFeeAmount: string;
|
|
25
|
+
}
|
|
@@ -10,8 +10,8 @@ export interface PoolCreationParams {
|
|
|
10
10
|
vestingAmount: string;
|
|
11
11
|
vestedBlocks: number;
|
|
12
12
|
initialBaseTokenLiquidity: string;
|
|
13
|
-
swapFeeLiquidityProvider:
|
|
14
|
-
swapFeeMarketRunner:
|
|
13
|
+
swapFeeLiquidityProvider: string;
|
|
14
|
+
swapFeeMarketRunner: string;
|
|
15
15
|
}
|
|
16
16
|
export interface CurrentFees {
|
|
17
17
|
tokens: string[];
|
|
@@ -3,6 +3,7 @@ import { Contract } from 'web3-eth-contract';
|
|
|
3
3
|
import { AbiItem } from 'web3-utils/types';
|
|
4
4
|
import Web3 from 'web3';
|
|
5
5
|
import { Config } from '../../models/index.js';
|
|
6
|
+
import { PriceAndFees } from '../..';
|
|
6
7
|
export interface FixedPriceExchange {
|
|
7
8
|
active: boolean;
|
|
8
9
|
exchangeOwner: string;
|
|
@@ -195,12 +196,12 @@ export declare class FixedRateExchange {
|
|
|
195
196
|
*/
|
|
196
197
|
getAllowedSwapper(exchangeId: string): Promise<string>;
|
|
197
198
|
/**
|
|
198
|
-
*
|
|
199
|
+
* calcBaseInGivenOutDT - Calculates how many base tokens are needed to get specified amount of datatokens
|
|
199
200
|
* @param {String} exchangeId ExchangeId
|
|
200
|
-
* @param {
|
|
201
|
-
* @return {Promise<
|
|
201
|
+
* @param {string} datatokenAmount Amount of datatokens user wants to buy
|
|
202
|
+
* @return {Promise<PriceAndFees>} how many base tokens are needed and fees
|
|
202
203
|
*/
|
|
203
|
-
|
|
204
|
+
calcBaseInGivenOutDT(exchangeId: string, datatokenAmount: string): Promise<PriceAndFees>;
|
|
204
205
|
/**
|
|
205
206
|
* getBTOut - returns amount in baseToken that user will receive for datatokenAmount sold
|
|
206
207
|
* @param {String} exchangeId ExchangeId
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import Web3 from 'web3';
|
|
2
2
|
import { Contract } from 'web3-eth-contract';
|
|
3
|
-
import { Erc20CreateParams, FreCreationParams, PoolCreationParams } from '../@types';
|
|
3
|
+
import { Erc20CreateParams, FreCreationParams, FreOrderParams, PoolCreationParams } from '../@types';
|
|
4
4
|
import { Config } from '../models';
|
|
5
5
|
export declare function setContractDefaults(contract: Contract, config: Config): Contract;
|
|
6
6
|
export declare function getFairGasPrice(web3: Web3, config: Config): Promise<string>;
|
|
7
7
|
export declare function getErcCreationParams(ercParams: Erc20CreateParams): any;
|
|
8
|
+
export declare function getFreOrderParams(freParams: FreOrderParams): any;
|
|
8
9
|
export declare function getFreCreationParams(freParams: FreCreationParams): any;
|
|
9
10
|
export declare function getPoolCreationParams(poolParams: PoolCreationParams): any;
|
|
10
11
|
export declare function unitsToAmount(web3: Web3, token: string, amount: string): Promise<string>;
|
package/package.json
CHANGED