mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 01:34:57 +01:00
add method refactor
This commit is contained in:
parent
baa61b3481
commit
231fdbb7fe
@ -59,14 +59,13 @@ export default function Add({
|
|||||||
async function handleAddLiquidity() {
|
async function handleAddLiquidity() {
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
|
|
||||||
const addMethod =
|
|
||||||
coin === 'OCEAN'
|
|
||||||
? ocean.pool.addOceanLiquidity
|
|
||||||
: ocean.pool.addDTLiquidity
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await addMethod(accountId, poolAddress, amount)
|
const result =
|
||||||
setTxId(result.transactionHash)
|
coin === 'OCEAN'
|
||||||
|
? await ocean.pool.addOceanLiquidity(accountId, poolAddress, amount)
|
||||||
|
: await ocean.pool.addDTLiquidity(accountId, poolAddress, amount)
|
||||||
|
|
||||||
|
setTxId(result?.transactionHash)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error.message)
|
console.error(error.message)
|
||||||
toast.error(error.message)
|
toast.error(error.message)
|
||||||
|
Loading…
Reference in New Issue
Block a user