1
1
import { toast } from "react-toastify" ;
2
2
import { Fuel , FuelWalletConnector , FuelWalletLocked } from "@fuel-wallet/sdk" ;
3
- import { Provider , Wallet } from "fuels" ;
3
+ import { Provider , Wallet , WalletUnlocked } from "fuels" ;
4
4
import { makeAutoObservable } from "mobx" ;
5
5
import { Nullable } from "tsdef" ;
6
6
@@ -12,7 +12,7 @@ import { TOKENS_BY_ASSET_ID } from "./constants";
12
12
13
13
export class WalletManager {
14
14
public address : Nullable < string > = null ;
15
- public wallet : Nullable < FuelWalletLocked > = null ;
15
+ public wallet : Nullable < FuelWalletLocked | WalletUnlocked > = null ;
16
16
public privateKey : Nullable < string > = null ;
17
17
18
18
private fuel = new Fuel ( {
@@ -55,9 +55,9 @@ export class WalletManager {
55
55
connectByPrivateKey = async ( privateKey : string , provider : Provider ) : Promise < void > => {
56
56
const wallet = Wallet . fromPrivateKey ( privateKey , provider ) ;
57
57
58
- const address = wallet . address . toString ( ) ;
59
- this . address = address ;
58
+ this . address = wallet . address . toString ( ) ;
60
59
this . privateKey = privateKey ;
60
+ this . wallet = wallet ;
61
61
} ;
62
62
63
63
addAsset = async ( assetId : string ) => {
0 commit comments