mirror of
https://github.com/oceanprotocol/react.git
synced 2025-01-20 18:01:45 +01:00
update specs
This commit is contained in:
parent
74b39256d6
commit
70d394d470
@ -53,18 +53,18 @@ Then within your component use the provided hooks to interact with Ocean's funct
|
||||
|
||||
```tsx
|
||||
import React from 'react'
|
||||
import { useOcean, OceanConfig, useConsume } from '@oceanprotocol/react'
|
||||
import { useOcean, useConsume } from '@oceanprotocol/react'
|
||||
|
||||
export default function MyComponent() {
|
||||
// Initialize, get existing, or reinitialize Ocean
|
||||
const { ocean, account } = useOcean(oceanConfig)
|
||||
const { ocean, account } = useOcean()
|
||||
|
||||
// consume asset
|
||||
const { consumeAsset, isLoading, step } = useConsume(ocean)
|
||||
const { consume, isLoading, step } = useConsume()
|
||||
|
||||
async function handleClick() {
|
||||
const ddo = 'did:op:0x000000000'
|
||||
await consumeAsset(ddo, account)
|
||||
await consume(ddo)
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -3,8 +3,7 @@ import React, {
|
||||
useContext,
|
||||
useState,
|
||||
useEffect,
|
||||
createContext,
|
||||
FunctionComponent
|
||||
createContext
|
||||
} from 'react'
|
||||
import { Ocean, Config } from '@oceanprotocol/squid'
|
||||
import Balance from '@oceanprotocol/squid/dist/node/models/Balance'
|
||||
|
Loading…
Reference in New Issue
Block a user