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:
parent
13145409fe
commit
6311d59cbb
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user