1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-11-22 09:47:06 +01:00

update to new ocean.js

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
mihaisc 2020-10-26 16:36:35 +02:00
parent 3c4ef7677a
commit 9791450b48
No known key found for this signature in database
GPG Key ID: 4FB0C2329B4C6E29
4 changed files with 7 additions and 5 deletions

6
package-lock.json generated
View File

@ -1521,9 +1521,9 @@
"integrity": "sha512-p0oOHXr60hXZuLNsQ/PsOQtCfia79thm7MjPxTrnnBvD+csJoHzARYMB0IFj/KTw6U5vLXODgjJAn8x6QksLwg=="
},
"@oceanprotocol/lib": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.8.0.tgz",
"integrity": "sha512-FZALOw3LMAPo2US+YjJv5Fkz7IDS9m89PZzF7uKZKYT8V3xB/m0PV91vV1pEPC0eVWk3Sl1IXyT0L3ASFEUjvg==",
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.9.0.tgz",
"integrity": "sha512-BI00ZXTdGXJZNTJhwtqsnXjKtlcl1PXB18e26aCo5g1VT9S19urPLT04k9Zkz4k+3HepSc5QdOu+yo47MS1I7g==",
"requires": {
"@ethereum-navigator/navigator": "^0.5.0",
"@oceanprotocol/contracts": "^0.5.7",

View File

@ -25,7 +25,7 @@
"dist/"
],
"dependencies": {
"@oceanprotocol/lib": "^0.8.1",
"@oceanprotocol/lib": "^0.9.0",
"axios": "^0.21.0",
"decimal.js": "^10.2.1",
"web3": "^1.3.0",

View File

@ -1,6 +1,7 @@
export interface PriceOptions {
price: number
dtAmount: number
oceanAmount: number
type: 'fixed' | 'dynamic' | string
weightOnDataToken: string
swapFee: string

View File

@ -201,7 +201,7 @@ function usePricing(ddo: DDO): UsePricing {
): Promise<TransactionReceipt | void> {
if (!ocean || !accountId || !dtSymbol) return
const { type, dtAmount, price, weightOnDataToken, swapFee } = priceOptions
const { type, dtAmount,oceanAmount, price, weightOnDataToken, swapFee } = priceOptions
const isPool = type === 'dynamic'
if (!isPool && !config.fixedRateExchangeAddress) {
@ -224,6 +224,7 @@ function usePricing(ddo: DDO): UsePricing {
dataToken,
`${dtAmount}`,
weightOnDataToken,
`${oceanAmount}`,
swapFee
)
.next((step: number) => setStep(step, 'pool'))