mirror of
https://github.com/oceanprotocol/market.git
synced 2024-09-28 03:58:59 +02:00
output tx id after adding liquidity
This commit is contained in:
parent
8fe4e2c77d
commit
801d69d8f5
@ -10,6 +10,7 @@ import InputElement from '../../../atoms/Input/InputElement'
|
|||||||
import Token from './Token'
|
import Token from './Token'
|
||||||
import { Balance } from './'
|
import { Balance } from './'
|
||||||
import PriceUnit from '../../../atoms/Price/PriceUnit'
|
import PriceUnit from '../../../atoms/Price/PriceUnit'
|
||||||
|
import Alert from '../../../atoms/Alert'
|
||||||
|
|
||||||
export default function Add({
|
export default function Add({
|
||||||
setShowAdd,
|
setShowAdd,
|
||||||
@ -24,6 +25,7 @@ export default function Add({
|
|||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { ocean, accountId, balance } = useOcean()
|
const { ocean, accountId, balance } = useOcean()
|
||||||
const [amount, setAmount] = useState('')
|
const [amount, setAmount] = useState('')
|
||||||
|
const [txId, setTxId] = useState<string>('')
|
||||||
const [isLoading, setIsLoading] = useState<boolean>()
|
const [isLoading, setIsLoading] = useState<boolean>()
|
||||||
|
|
||||||
const newPoolTokens =
|
const newPoolTokens =
|
||||||
@ -45,6 +47,7 @@ export default function Add({
|
|||||||
)
|
)
|
||||||
// TODO: Figure out the result structure, thenreplace `any` return in lib-js
|
// TODO: Figure out the result structure, thenreplace `any` return in lib-js
|
||||||
console.log(result)
|
console.log(result)
|
||||||
|
setTxId(result.transactionHash)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error.message)
|
console.error(error.message)
|
||||||
toast.error(error.message)
|
toast.error(error.message)
|
||||||
@ -95,6 +98,12 @@ export default function Add({
|
|||||||
Supply
|
Supply
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
{txId && (
|
||||||
|
<Alert
|
||||||
|
text={`Liquidity added. Transaction ID: ${txId}`}
|
||||||
|
state="success"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user