Comments (2)
The reason for causing this issue is because of the deployer or the provider has 0 tokens at first. Hence I think to fix it is to use generateTestWallet
. However currently, the importation doesn't work forum.
P.S. The current fuel dApp in Typescript SDK uses local node.
import { NODE_URL } from "../../lib";
import { Provider, Wallet, WalletUnlocked, Signer } from "fuels";
import { useState } from "react";
import useAsync from "react-use/lib/useAsync";
// import { generateTestWallet } from '@fuel-ts/account/test-utils';
export const useFaucet = () => {
const [faucetWallet, setFaucetWallet] = useState<WalletUnlocked>();
useAsync(async () => {
if (!faucetWallet) {
const provider = await Provider.create(NODE_URL);
const wallet = Wallet.fromPrivateKey("0x01", provider);
const signer = new Signer("0x01");
const balances: CoinQuantity[] = await wallet.getBalances();
console.log('Local Provider address', signer)
setFaucetWallet(wallet);
}
}, [faucetWallet]);
return {
faucetWallet,
};
};
from fuels-ts.
@arboleya, I am not sure about this, but we can only change the error message by explaining that the expected action wasn't possible due to insufficient coins.
from fuels-ts.
Related Issues (20)
- Remove some choices from the `create-fuels` CLI
- Add network info for `mainnet`
- Create changeset PR only if `master` version will be updated
- No storage provided HOT 7
- Use Next.js v14 resources in `create fuels` template HOT 6
- Add new workflow step to validate previous release HOT 1
- Stop Overring User Input Max Fee On `ContractFactory.deployContract` Method
- Add `UNKNOWN` error code and `rawError` property to `FuelError`
- Consider reviewing GH Issue templates HOT 1
- Fix transaction summary with contract calls HOT 1
- Implement contract call script decoding
- Implement `VoidCoder`
- Upgrade to `fuel-core` @ `0.29.0`
- Upgrade to `fuel-core` @ `0.30.0`
- Stop skipping e2es for draft PRs
- Fix Flakey top-UI wallet integration test
- Don't run `create-fuels` e2e test on forks
- No TS declarations shipped for `@fuel-ts/account/test-utils`
- `VecCoder` unable to decode an empty vector
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuels-ts.