1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-16 02:04:54 +01:00

output tx id after adding liquidity

This commit is contained in:
Matthias Kretschmann 2020-08-28 17:24:59 +02:00
parent 8fe4e2c77d
commit 801d69d8f5
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -10,6 +10,7 @@ import InputElement from '../../../atoms/Input/InputElement'
import Token from './Token'
import { Balance } from './'
import PriceUnit from '../../../atoms/Price/PriceUnit'
import Alert from '../../../atoms/Alert'
export default function Add({
setShowAdd,
@ -24,6 +25,7 @@ export default function Add({
}): ReactElement {
const { ocean, accountId, balance } = useOcean()
const [amount, setAmount] = useState('')
const [txId, setTxId] = useState<string>('')
const [isLoading, setIsLoading] = useState<boolean>()
const newPoolTokens =
@ -45,6 +47,7 @@ export default function Add({
)
// TODO: Figure out the result structure, thenreplace `any` return in lib-js
console.log(result)
setTxId(result.transactionHash)
} catch (error) {
console.error(error.message)
toast.error(error.message)
@ -95,6 +98,12 @@ export default function Add({
Supply
</Button>
)}
{txId && (
<Alert
text={`Liquidity added. Transaction ID: ${txId}`}
state="success"
/>
)}
</div>
</div>
)