1
0
mirror of https://github.com/oceanprotocol/react.git synced 2025-01-24 01:03:30 +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 {
price?: number
tokensToMint: number
type: 'simple' | 'advanced' | string
type: 'fixed' | 'dynamic' | string
weightOnDataToken: string
liquidityProviderFee: string
}

View File

@ -150,7 +150,7 @@ function usePublish(): UsePublish {
dataTokenAddress: string
) {
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)
const pool = await ocean.pool.createDTPool(
accountId,
@ -161,7 +161,7 @@ function usePublish(): UsePublish {
)
break
}
case 'simple': {
case 'fixed': {
const fixedPriceExchange = await ocean.fixedRateExchange.create(
dataTokenAddress,
priceOptions.price.toString(),