mirror of
https://github.com/oceanprotocol/react.git
synced 2025-02-14 21:10:38 +01:00
Merge pull request #166 from oceanprotocol/fix/fixedPrice
fixed price, ocean lib update
This commit is contained in:
commit
0484a86110
6
package-lock.json
generated
6
package-lock.json
generated
@ -1521,9 +1521,9 @@
|
|||||||
"integrity": "sha512-p0oOHXr60hXZuLNsQ/PsOQtCfia79thm7MjPxTrnnBvD+csJoHzARYMB0IFj/KTw6U5vLXODgjJAn8x6QksLwg=="
|
"integrity": "sha512-p0oOHXr60hXZuLNsQ/PsOQtCfia79thm7MjPxTrnnBvD+csJoHzARYMB0IFj/KTw6U5vLXODgjJAn8x6QksLwg=="
|
||||||
},
|
},
|
||||||
"@oceanprotocol/lib": {
|
"@oceanprotocol/lib": {
|
||||||
"version": "0.9.0",
|
"version": "0.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.9.3.tgz",
|
||||||
"integrity": "sha512-BI00ZXTdGXJZNTJhwtqsnXjKtlcl1PXB18e26aCo5g1VT9S19urPLT04k9Zkz4k+3HepSc5QdOu+yo47MS1I7g==",
|
"integrity": "sha512-eUTM5D5AZ1eDfzAYSqML1fELXOTXy0Zj7y8NuSlyN9Ersg7e9G8lIWCAA49pcBNCJ41niG/lpAuIpiUPd2eFpA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@ethereum-navigator/navigator": "^0.5.0",
|
"@ethereum-navigator/navigator": "^0.5.0",
|
||||||
"@oceanprotocol/contracts": "^0.5.7",
|
"@oceanprotocol/contracts": "^0.5.7",
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
"dist/"
|
"dist/"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@oceanprotocol/lib": "^0.9.0",
|
"@oceanprotocol/lib": "^0.9.3",
|
||||||
"axios": "^0.21.0",
|
"axios": "^0.21.0",
|
||||||
"decimal.js": "^10.2.1",
|
"decimal.js": "^10.2.1",
|
||||||
"web3": "^1.3.0",
|
"web3": "^1.3.0",
|
||||||
|
@ -216,16 +216,17 @@ function usePricing(ddo: DDO): UsePricing {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
type,
|
type,
|
||||||
dtAmount,
|
|
||||||
oceanAmount,
|
oceanAmount,
|
||||||
price,
|
price,
|
||||||
weightOnDataToken,
|
weightOnDataToken,
|
||||||
swapFee
|
swapFee
|
||||||
} = priceOptions
|
} = priceOptions
|
||||||
|
|
||||||
|
let { dtAmount } = priceOptions
|
||||||
const isPool = type === 'dynamic'
|
const isPool = type === 'dynamic'
|
||||||
|
|
||||||
if (!isPool && !config.fixedRateExchangeAddress) {
|
if (!isPool && !config.fixedRateExchangeAddress) {
|
||||||
Logger.error(`'fixedRateExchangeAddress' not set in ccnfig.`)
|
Logger.error(`'fixedRateExchangeAddress' not set in config.`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,8 +236,11 @@ function usePricing(ddo: DDO): UsePricing {
|
|||||||
setStep(99, 'pool')
|
setStep(99, 'pool')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// if fixedPrice set dt to max amount
|
||||||
|
if (!isPool) dtAmount = 1000
|
||||||
await mint(`${dtAmount}`)
|
await mint(`${dtAmount}`)
|
||||||
|
|
||||||
|
// dtAmount for fixed price is set to max
|
||||||
const tx = isPool
|
const tx = isPool
|
||||||
? await ocean.pool
|
? await ocean.pool
|
||||||
.create(
|
.create(
|
||||||
|
Loading…
Reference in New Issue
Block a user