mirror of
https://github.com/oceanprotocol/react.git
synced 2025-01-24 01:03:30 +01:00
parent
ef3963c9b0
commit
e4e2d13bd6
@ -14,13 +14,8 @@ Wrap your whole app with the `OceanProvider`:
|
|||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import React, { ReactNode } from 'react'
|
import React, { ReactNode } from 'react'
|
||||||
import { OceanProvider, Config } from '@oceanprotocol/react'
|
import { OceanProvider } from '@oceanprotocol/react'
|
||||||
|
import { ConfigHelper } from '@oceanprotocol/lib'
|
||||||
const config: Config = {
|
|
||||||
nodeUri: '',
|
|
||||||
metadataStoreUri: '',
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
const web3ModalOpts = {
|
const web3ModalOpts = {
|
||||||
network: 'mainnet', // optional
|
network: 'mainnet', // optional
|
||||||
@ -33,10 +28,15 @@ export default function MyApp({
|
|||||||
}: {
|
}: {
|
||||||
children: ReactNode
|
children: ReactNode
|
||||||
}): ReactNode {
|
}): ReactNode {
|
||||||
|
const oceanInitialConfig = new ConfigHelper().getConfig(
|
||||||
|
'mainnet',
|
||||||
|
'INFURA_PROJECT_ID'
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OceanProvider config={config} web3ModalOpts={web3ModalOpts}>
|
<OceanProvider initialConfig={config} web3ModalOpts={web3ModalOpts}>
|
||||||
<h1>My App</h1>
|
<h1>My App</h1>
|
||||||
{children}
|
{children}
|
||||||
</OceanProvider>
|
</OceanProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user