Is it required to have Eth on balance to get a response from the node using simulate function?

I have tried to call simulate function and faced error “Error: not enough resources to fit the target:” when I have attached just generated seed phrase

import { Provider, Wallet } from "fuels";

const mn = Mnemonic.generate();
const seed = Mnemonic.mnemonicToSeed(mn);

 const wallet = Wallet.fromSeed(seed, "", new Provider(NODE_URL));
 const tokenContract = TokenAbi__factory.connect(b.assetId, wallet);
 tokenContract.functions.already_minted(b256Address).simulate()

But after I have minted some ETH for new address this error disappeared.

Is there any way to check contract state without providing any signature ?

23 Likes

thanks for your info

1 Like

You can call a contract method without adding signatures by calling .get() method. This method executes a dryRun transaction without adding signatures.

import { Provider, Wallet } from "fuels";

const mn = Mnemonic.generate();
const seed = Mnemonic.mnemonicToSeed(mn);

 const wallet = Wallet.fromSeed(seed, "", new Provider(NODE_URL));
 const tokenContract = TokenAbi__factory.connect(b.assetId, wallet);
 tokenContract.functions.already_minted(b256Address).get()
2 Likes

but anyway I need to create new wallet instance?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.