Skip to content

Commit 2aa6f62

Browse files
authored
Merge pull request #9 from compolabs/fix/private-key-auth-fuel
Fix private key auth for fuel
2 parents ab8794e + eb2eea5 commit 2aa6f62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/blockchain/fuel/WalletManager.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { toast } from "react-toastify";
22
import { Fuel, FuelWalletConnector, FuelWalletLocked } from "@fuel-wallet/sdk";
3-
import { Provider, Wallet } from "fuels";
3+
import { Provider, Wallet, WalletUnlocked } from "fuels";
44
import { makeAutoObservable } from "mobx";
55
import { Nullable } from "tsdef";
66

@@ -12,7 +12,7 @@ import { TOKENS_BY_ASSET_ID } from "./constants";
1212

1313
export class WalletManager {
1414
public address: Nullable<string> = null;
15-
public wallet: Nullable<FuelWalletLocked> = null;
15+
public wallet: Nullable<FuelWalletLocked | WalletUnlocked> = null;
1616
public privateKey: Nullable<string> = null;
1717

1818
private fuel = new Fuel({
@@ -55,9 +55,9 @@ export class WalletManager {
5555
connectByPrivateKey = async (privateKey: string, provider: Provider): Promise<void> => {
5656
const wallet = Wallet.fromPrivateKey(privateKey, provider);
5757

58-
const address = wallet.address.toString();
59-
this.address = address;
58+
this.address = wallet.address.toString();
6059
this.privateKey = privateKey;
60+
this.wallet = wallet;
6161
};
6262

6363
addAsset = async (assetId: string) => {

0 commit comments

Comments
 (0)