Skip to content
New issue

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

method eth_sendTransaction does not exist/is not available error #113

Open
nick70007 opened this issue Mar 7, 2022 · 2 comments
Open

method eth_sendTransaction does not exist/is not available error #113

nick70007 opened this issue Mar 7, 2022 · 2 comments

Comments

@nick70007
Copy link

nick70007 commented Mar 7, 2022

In my Swift UI App i am trying to send transaction but everytime i get this error as:

method eth_sendTransaction does not exist/is not available error

Here is my code anippet:

     let web3 = Web3(rpcURL: "https://ropsten.infura.io/v3/4cca371cb77c4935bdb1a1381b2ffbe2")
    guard let walletAddress = getAddress(hex: session.walletInfo!.accounts[0]) else { return }
    guard let contractAddress = getAddress(hex: Constants.contractAddress) else { return }
    
    firstly {
        web3.eth.getTransactionCount(address: walletAddress, block: .latest)
    }.then { nonce in
        return EthereumTransaction(nonce: nonce,
                                     gasPrice: nil,
                                     gas: nil,
                                     from: walletAddress,
                                     to: contractAddress,
                                     value: try! EthereumQuantity.string("0x0"),
                                     data: try! EthereumData.string(self.mintTransactionHash)).promise
    }.then { tx in
        web3.eth.sendTransaction(transaction: tx)
    }.done { hash in
        self.transactionHash = hash.hex()
        self.isTransactionSend = true
        self.saveNFtItem()
        Defaults[.transactionHash] = self.transactionHash
    }.catch { error in
        print("Transaction Failed:- \(error.localizedDescription)")
        self.transactionFailed("Transaction Failed",false)
    }
@ceobitch
Copy link

ceobitch commented Jun 6, 2022

Same here

@ceobitch
Copy link

ceobitch commented Jun 6, 2022

@nick70007 Did you find a soultion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants