1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-07-01 06:11:43 +02:00

Merge pull request #40 from oceanprotocol/fix/provider-options

dynamic loading of provider packages
This commit is contained in:
Matthias Kretschmann 2020-07-31 13:14:31 +02:00 committed by GitHub
commit 31f0d57872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,4 @@
import WalletConnectProvider from '@walletconnect/web3-provider'
import Torus from '@toruslabs/torus-embed'
import loadable from '@loadable/component'
import { appConfig } from '../../app.config'
const { infuraProjectId, network, oceanConfig } = appConfig
@ -12,23 +11,28 @@ const web3ModalTheme = {
hover: 'var(--brand-grey-dimmed)'
}
const WalletConnectProvider = loadable(
() => import('@walletconnect/web3-provider') as any
)
const Torus = loadable(() => import('@toruslabs/torus-embed') as any)
const providerOptions = {
walletconnect: {
package: WalletConnectProvider,
options: {
infuraId: infuraProjectId
}
},
torus: {
package: Torus,
options: {
networkParams: {
host: oceanConfig.url // optional
// chainId: 1337, // optional
// networkId: 1337 // optional
}
}
}
// torus: {
// package: Torus,
// options: {
// networkParams: {
// host: oceanConfig.url // optional
// // chainId: 1337, // optional
// // networkId: 1337 // optional
// }
// }
// }
}
export const web3ModalOpts = {