Hi, wanted to test out generateTestWallet, but it seems that it doesn’t work even if added into index.d.ts.
import { generateTestWallet } from '@fuel-ts/account/test-utils';
or
import { generateTestWallet } from 'fuels';
Tried to fix it, but still doesn’t work:
node_modules/@fuel-ts/account/dist/index.d.ts
import './test-utils.js';
import './configs.js';
export * from './account';
export * from './wallet';
export * from './hdwallet';
export * from './mnemonic';
export * from './wordlists';
export * from './signer';
export * from './wallet-manager';
export * from './predicate';
export * from './providers';
export * from './connectors';
export * from './test-utils'; // added but doesn't work
//# sourceMappingURL=index.d.ts.map
Error Message:
Module '"fuels"' has no exported member 'generateTestWallet'.ts(2305)
Hi @eesheng I’ve responded to the related issue you raised here
For the use case you have presented generateTestWallet would not be appropriate. We are moving away from generateTestWallet in favour of more explicit resource management through launchTestNode , you can read more here
Given you want to instantiate a wallet in the browser though I recommend you follow this guide
@eesheng I’d just like to re-iterate that it seems for your use case generateTestWallet is not appropriate, as it primarily for unit tests. Also, we are going to be deprecating that utility in short order in favour of launchTestNode
Let say I generate a new wallet const unlockedWallet: WalletUnlocked = Wallet.generate();, do I still need to connect to a provider?
More than likely any wallet you generate you will want to interact with the chain, and thus that would require connecting to a provider, which can be passed in as a parameter to the generate function.
How do you add faucets to our locally instantiated wallets? Not the connected provider
I’m not sure I understand the question, if you would like to send testnet assets to a generated wallet then you can send it to that wallet’s address.