1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

dynamic loading of provider packages

This commit is contained in:
Matthias Kretschmann 2020-07-31 12:53:08 +02:00
parent b9838ddf6e
commit 2bf5c1a8cd
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -1,5 +1,4 @@
import WalletConnectProvider from '@walletconnect/web3-provider' import loadable from '@loadable/component'
import Torus from '@toruslabs/torus-embed'
import { appConfig } from '../../app.config' import { appConfig } from '../../app.config'
const { infuraProjectId, network, oceanConfig } = appConfig const { infuraProjectId, network, oceanConfig } = appConfig
@ -12,23 +11,28 @@ const web3ModalTheme = {
hover: 'var(--brand-grey-dimmed)' hover: 'var(--brand-grey-dimmed)'
} }
const WalletConnectProvider = loadable(() =>
import('@walletconnect/web3-provider')
)
const Torus = loadable(() => import('@toruslabs/torus-embed'))
const providerOptions = { const providerOptions = {
walletconnect: { walletconnect: {
package: WalletConnectProvider, package: WalletConnectProvider,
options: { options: {
infuraId: infuraProjectId 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 = { export const web3ModalOpts = {