We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I get this message Failed to fetch gas estimate for try tx.send(password: password)
Failed to fetch gas estimate
try tx.send(password: password)
public func sendTokenSync(to toAddress: String, contractAddress: String, amount: String, password: String, gasPrice: String?) throws -> String { if access == .viewOnly { throw WalletError.notAllowedAccess } guard let myAddress = address, let myEthereumAddress = EthereumAddress(myAddress), let toEthereumAddress = EthereumAddress(toAddress), let erc20ContractAddress = EthereumAddress(contractAddress), let contract = web3Instance.contract(Web3.Utils.erc20ABI, at: erc20ContractAddress, abiVersion: 2) else { throw WalletError.invalidAddress } guard let decimals = try? decimalsForToken(contractAddress: contractAddress) else { throw WalletError.unexpectedResult } var options = TransactionOptions.defaultOptions options.value = Web3.Utils.parseToBigUInt(amount, decimals: decimals) options.from = myEthereumAddress if let gasPrice = gasPrice, let wei = Web3.Utils.parseToBigUInt(gasPrice, units: .eth) { options.gasLimit = .manual(defaultGasLimitForTokenTransfer) options.gasPrice = .manual(wei) } guard let tx = contract.write("transfer", parameters: [toEthereumAddress, options.value] as [AnyObject], extraData: Data(), transactionOptions: options) else { throw WalletError.unexpectedResult } let txResult = try tx.send(password: password) return txResult.hash }
same for automatic gasLimit and gasPrice
The text was updated successfully, but these errors were encountered:
SOLVED. It works after I remove options.value = ....
Sorry, something went wrong.
No branches or pull requests
I get this message
Failed to fetch gas estimate
fortry tx.send(password: password)
same for automatic gasLimit and gasPrice
The text was updated successfully, but these errors were encountered: