diff --git a/new-lamassu-admin/src/pages/Accounting/Accounting.js b/new-lamassu-admin/src/pages/Accounting/Accounting.js
index bd141bcb..0d46d450 100644
--- a/new-lamassu-admin/src/pages/Accounting/Accounting.js
+++ b/new-lamassu-admin/src/pages/Accounting/Accounting.js
@@ -1,5 +1,6 @@
import { useQuery } from '@apollo/react-hooks'
import { makeStyles } from '@material-ui/core/styles'
+import BigNumber from 'bignumber.js'
import gql from 'graphql-tag'
import * as R from 'ramda'
import React, { useContext } from 'react'
@@ -26,7 +27,7 @@ const GET_OPERATOR_BY_USERNAME = gql`
cryptoBalances
machines
joined
- assetValue
+ assets
preferredFiatCurrency
contactInfo {
name
@@ -169,23 +170,31 @@ const Accounting = () => {
}
]
+ const hedgingReserve = BigNumber(
+ R.reduce(
+ (acc, value) => acc.plus(value),
+ BigNumber(0),
+ R.values(operatorData?.assets.values.hedgedContracts) ?? []
+ ) ?? 0
+ ).toNumber()
+
+ console.log(opData)
+
return (
!loading && (
<>
Fiat balance history
>
diff --git a/new-lamassu-admin/src/pages/Assets/Assets.js b/new-lamassu-admin/src/pages/Assets/Assets.js
index aa982f6e..6a2f8e8c 100644
--- a/new-lamassu-admin/src/pages/Assets/Assets.js
+++ b/new-lamassu-admin/src/pages/Assets/Assets.js
@@ -30,7 +30,7 @@ const GET_OPERATOR_BY_USERNAME = gql`
cryptoBalances
machines
joined
- assetValue
+ assets
preferredFiatCurrency
contactInfo {
name
@@ -147,8 +147,7 @@ const Assets = () => {
{
id: 'fiatBalance',
display: 'Fiat balance',
- amount:
- operatorData?.fiatBalances[operatorData?.preferredFiatCurrency] ?? 0,
+ amount: operatorData?.assets.total ?? 0,
currency: R.toUpper(operatorData?.preferredFiatCurrency ?? ''),
class: 'Available balance'
},
@@ -156,7 +155,7 @@ const Assets = () => {
id: 'hedgingReserve',
display: 'Hedging reserve',
amount:
- operatorData?.fiatBalances[operatorData?.preferredFiatCurrency] ?? 0,
+ -R.sum(R.values(operatorData?.assets.values.hedgedContracts)) ?? 0,
currency: R.toUpper(operatorData?.preferredFiatCurrency ?? ''),
class: 'Available balance',
direction: 'out'
@@ -167,7 +166,7 @@ const Assets = () => {
{
id: 'hedgedWalletAssets',
display: 'Hedged wallet assets',
- amount: 0,
+ amount: R.sum(R.values(operatorData?.assets.values.hedgedContracts)) ?? 0,
currency: R.toUpper(operatorData?.preferredFiatCurrency ?? ''),
class: 'Wallet assets',
direction: 'in'
@@ -175,7 +174,7 @@ const Assets = () => {
{
id: 'unhedgedWalletAssets',
display: 'Unhedged wallet assets',
- amount: 0,
+ amount: R.sum(R.values(operatorData?.assets.values.unhedgedFiat)) ?? 0,
currency: R.toUpper(operatorData?.preferredFiatCurrency ?? ''),
class: 'Wallet assets',
direction: 'in'
@@ -193,21 +192,22 @@ const Assets = () => {
{
id: 'hedgingReserve',
display: 'Hedging reserve',
- amount: 0,
+ amount:
+ -R.sum(R.values(operatorData?.assets.values.hedgedContracts)) ?? 0,
currency: R.toUpper(operatorData?.preferredFiatCurrency ?? ''),
direction: 'out'
},
{
id: 'hedgedWalletAssets',
display: 'Market value of hedged wallet assets',
- amount: 0,
+ amount: R.sum(R.values(operatorData?.assets.values.hedgedContracts)) ?? 0,
currency: R.toUpper(operatorData?.preferredFiatCurrency ?? ''),
direction: 'in'
},
{
id: 'unhedgedWalletAssets',
display: 'Unhedged wallet assets',
- amount: 0,
+ amount: R.sum(R.values(operatorData?.assets.values.unhedgedFiat)) ?? 0,
currency: R.toUpper(operatorData?.preferredFiatCurrency ?? ''),
direction: 'in'
}
diff --git a/new-lamassu-admin/src/pages/Wizard/Wizard.js b/new-lamassu-admin/src/pages/Wizard/Wizard.js
index b9ee1bb6..fe68d1bf 100644
--- a/new-lamassu-admin/src/pages/Wizard/Wizard.js
+++ b/new-lamassu-admin/src/pages/Wizard/Wizard.js
@@ -2,6 +2,7 @@ import { useQuery } from '@apollo/react-hooks'
import { makeStyles, Dialog, DialogContent } from '@material-ui/core'
import classnames from 'classnames'
import gql from 'graphql-tag'
+import * as R from 'ramda'
import React, { useState, useContext } from 'react'
import { useHistory } from 'react-router-dom'
@@ -52,6 +53,18 @@ const Wizard = ({ fromAuthRegister }) => {
const [footerExp, setFooterExp] = useState(false)
+ const getSteps = STEPS => {
+ const buildTarget = process.env.REACT_APP_BUILD_TARGET
+ if (buildTarget === 'PAZUZ') {
+ return R.filter(step => step.id !== 'wallet' && step.id !== 'twilio')(
+ STEPS
+ )
+ }
+ return STEPS
+ }
+
+ const steps = getSteps(STEPS)
+
if (loading) {
return <>>
}
@@ -78,7 +91,7 @@ const Wizard = ({ fromAuthRegister }) => {
}
const doContinue = () => {
- if (step >= STEPS.length - 1) {
+ if (step >= steps.length - 1) {
setOpen(false)
history.push('/')
}
@@ -89,7 +102,7 @@ const Wizard = ({ fromAuthRegister }) => {
setStep(nextStep)
}
- const current = STEPS[step]
+ const current = steps[step]
return (