1
1
import Authereum from "authereum"
2
2
import authereumIcon from "../wallet-icons/authereum.png"
3
3
4
- import { networkToId } from "../../../utilities"
4
+ import { networkName } from "../../../utilities"
5
5
6
6
function authereum ( options ) {
7
7
if ( ! options || typeof options !== "object" ) {
@@ -10,26 +10,31 @@ function authereum(options) {
10
10
)
11
11
}
12
12
13
- const { network } = options
13
+ const { networkId } = options
14
14
15
- if ( ! network || typeof network !== "string " ) {
15
+ if ( ! networkId || typeof networkId !== "number " ) {
16
16
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"
18
18
)
19
19
}
20
20
21
21
return {
22
22
name : "Authereum" ,
23
23
iconSrc : authereumIcon ,
24
24
wallet : ( ) => {
25
- const authereum = new Authereum ( network )
25
+ const authereum = new Authereum ( {
26
+ networkName : networkName ( networkId ) ,
27
+ disableNotifications : true
28
+ } )
29
+
26
30
const provider = authereum . getProvider ( )
27
31
28
32
return {
29
33
provider,
30
34
interface : {
31
35
name : "Authereum" ,
32
36
connect : ( ) => provider . enable ( ) ,
37
+ disconnect : ( ) => authereum . logout ( ) ,
33
38
loading : ( ) =>
34
39
new Promise ( resolve => {
35
40
authereum . on ( "openPopup" , resolve )
@@ -38,7 +43,7 @@ function authereum(options) {
38
43
get : ( ) => authereum . getAccountAddress ( )
39
44
} ,
40
45
network : {
41
- get : ( ) => Promise . resolve ( networkToId ( network ) )
46
+ get : ( ) => Promise . resolve ( networkId )
42
47
} ,
43
48
balance : {
44
49
get : async ( ) => {
0 commit comments