Hi, is there an update going on? Not sure why it doesn’t work and the documentation page is down https://docs.fuel.network/docs/fuels-ts/wallets/test-wallets/#setting-up-test-wallets
This is the code and I am running the local fuel node.
import { NODE_URL } from "../../lib";
import { Provider, Wallet, WalletUnlocked, Signer, CoinQuantity, } from "fuels";
import { generateTestWallet } from '@fuel-ts/account/test-utils';
import { useState } from "react";
import useAsync from "react-use/lib/useAsync";
export const useFaucet = () => {
const [faucetWallet, setFaucetWallet] = useState<WalletUnlocked>();
useAsync(async () => {
if (!faucetWallet) {
const provider = await Provider.create(NODE_URL);
const baseAssetId = provider.getBaseAssetId();
const myWallet: WalletUnlocked = await generateTestWallet(provider, [[10, baseAssetId]]);
const signer = new Signer("0x01");
const balances: CoinQuantity[] = await myWallet.getBalances();
console.log('Local Provider address', signer)
console.log('Local Provider Balances', balances)
setFaucetWallet(myWallet);
}
}, [faucetWallet]);
return {
faucetWallet,
};
};
Error:
Property '#private' in type 'Provider' refers to a different member that cannot be accessed from within type 'Provider'.ts(2345)