1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-12-23 01:29:49 +01:00

fix minting

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
mihaisc 2020-10-27 18:17:18 +02:00
parent 834c9dd142
commit 5b84f07d49
No known key found for this signature in database
GPG Key ID: 4FB0C2329B4C6E29

View File

@ -203,16 +203,16 @@ function usePricing(ddo: DDO): UsePricing {
const {
type,
dtAmount,
oceanAmount,
price,
weightOnDataToken,
swapFee
} = priceOptions
let dtAmount = priceOptions.dtAmount
const isPool = type === 'dynamic'
if (!isPool && !config.fixedRateExchangeAddress) {
Logger.error(`'fixedRateExchangeAddress' not set in ccnfig.`)
Logger.error(`'fixedRateExchangeAddress' not set in config.`)
return
}
@ -222,6 +222,8 @@ function usePricing(ddo: DDO): UsePricing {
setStep(99, 'pool')
try {
//if fixedPrice set dt to max amount
if (!isPool) dtAmount = 1000
await mint(`${dtAmount}`)
// dtAmount for fixed price is set to max
@ -237,7 +239,7 @@ function usePricing(ddo: DDO): UsePricing {
)
.next((step: number) => setStep(step, 'pool'))
: await ocean.fixedRateExchange
.create(dataToken, `${price}`, accountId, `1000`)
.create(dataToken, `${price}`, accountId, '${dtAmount}')
.next((step: number) => setStep(step, 'exchange'))
await sleep(20000)
return tx