1
0
mirror of https://github.com/oceanprotocol/react.git synced 2025-02-14 21:10:38 +01:00

updated price type

This commit is contained in:
mihaisc 2020-09-07 15:19:40 +03:00
parent 13145409fe
commit 6311d59cbb
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
export interface PriceOptions { export interface PriceOptions {
price?: number price?: number
tokensToMint: number tokensToMint: number
type: 'simple' | 'advanced' | string type: 'fixed' | 'dynamic' | string
weightOnDataToken: string weightOnDataToken: string
liquidityProviderFee: string liquidityProviderFee: string
} }

View File

@ -150,7 +150,7 @@ function usePublish(): UsePublish {
dataTokenAddress: string dataTokenAddress: string
) { ) {
switch (priceOptions.type) { switch (priceOptions.type) {
case 'advanced': { case 'dynamic': {
// weight is hardcoded at 9 (90%) and publisher fee at 0.03(this was a random value set by me) // weight is hardcoded at 9 (90%) and publisher fee at 0.03(this was a random value set by me)
const pool = await ocean.pool.createDTPool( const pool = await ocean.pool.createDTPool(
accountId, accountId,
@ -161,7 +161,7 @@ function usePublish(): UsePublish {
) )
break break
} }
case 'simple': { case 'fixed': {
const fixedPriceExchange = await ocean.fixedRateExchange.create( const fixedPriceExchange = await ocean.fixedRateExchange.create(
dataTokenAddress, dataTokenAddress,
priceOptions.price.toString(), priceOptions.price.toString(),