Skip to content

Commit bad2145

Browse files
committed
Update to allow for new instantiating
1 parent 4e215ba commit bad2145

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/modules/select/wallets/authereum.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Authereum from "authereum"
22
import authereumIcon from "../wallet-icons/authereum.png"
33

4-
import { networkToId } from "../../../utilities"
4+
import { networkName } from "../../../utilities"
55

66
function authereum(options) {
77
if (!options || typeof options !== "object") {
@@ -10,26 +10,31 @@ function authereum(options) {
1010
)
1111
}
1212

13-
const { network } = options
13+
const { networkId } = options
1414

15-
if (!network || typeof network !== "string") {
15+
if (!networkId || typeof networkId !== "number") {
1616
throw new Error(
17-
"A network of type string is required to initialize fortmatic module"
17+
"A networkId of type number is required to initialize fortmatic module"
1818
)
1919
}
2020

2121
return {
2222
name: "Authereum",
2323
iconSrc: authereumIcon,
2424
wallet: () => {
25-
const authereum = new Authereum(network)
25+
const authereum = new Authereum({
26+
networkName: networkName(networkId),
27+
disableNotifications: true
28+
})
29+
2630
const provider = authereum.getProvider()
2731

2832
return {
2933
provider,
3034
interface: {
3135
name: "Authereum",
3236
connect: () => provider.enable(),
37+
disconnect: () => authereum.logout(),
3338
loading: () =>
3439
new Promise(resolve => {
3540
authereum.on("openPopup", resolve)
@@ -38,7 +43,7 @@ function authereum(options) {
3843
get: () => authereum.getAccountAddress()
3944
},
4045
network: {
41-
get: () => Promise.resolve(networkToId(network))
46+
get: () => Promise.resolve(networkId)
4247
},
4348
balance: {
4449
get: async () => {

0 commit comments

Comments
 (0)