mirror of
https://github.com/oceanprotocol/react.git
synced 2024-12-23 01:29:49 +01:00
transferWei
This commit is contained in:
parent
3dc0cf4792
commit
e29bd48716
@ -6,7 +6,7 @@ import { useEffect } from 'react'
|
||||
|
||||
export function ConsumeDdo() {
|
||||
const { accountId, ocean } = useOcean()
|
||||
const { consumeStepText, consume} = useConsume()
|
||||
const { consumeStepText, consume, consumeError} = useConsume()
|
||||
const [did, setDid]=useState<string|undefined>()
|
||||
useEffect(() => {
|
||||
async function init() {
|
||||
@ -30,6 +30,7 @@ export function ConsumeDdo() {
|
||||
<div>DID <input onChange={handleChange}></input></div>
|
||||
<div><button onClick={consumeDid}>Consume did</button></div>
|
||||
<div>{consumeStepText}</div>
|
||||
<div>{consumeError}</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ function useConsume(): UseConsume {
|
||||
setStep(2)
|
||||
const res = JSON.parse(order)
|
||||
Logger.log('order parsed', res)
|
||||
const tokenTransfer = await ocean.datatokens.transfer(
|
||||
const tokenTransfer = await ocean.datatokens.transferWei(
|
||||
res.dataToken,
|
||||
res.to,
|
||||
res.numTokens,
|
||||
@ -66,6 +66,7 @@ function useConsume(): UseConsume {
|
||||
setStep(4)
|
||||
} catch (error) {
|
||||
setConsumeError(error.message)
|
||||
Logger.error(error)
|
||||
} finally {
|
||||
setConsumeStep(undefined)
|
||||
setConsumeStepText(undefined)
|
||||
|
Loading…
Reference in New Issue
Block a user