Skip to content

Details: the method eth_sendTransaction is not available Version: [email protected] #1452

Answered by mikefuntico
0xSirloin asked this question in Question
Discussion options

You must be logged in to vote

You need to pass account to writeContract derived as:

import { privateKeyToAccount } from 'viem/accounts'


const account = privateKeyToAccount(PRIVATE_KEY)

const hash = await client.writeContract({
    abi,
    address: contractAddress,
    functionName: 'rebalance',
    args: [someargs],
    account,
  })

and not just an address. After that it will work as intended.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@0xSirloin
Comment options

Comment options

You must be logged in to vote
2 replies
@0xSirloin
Comment options

@joaofranciscoguarda
Comment options

Comment options

You must be logged in to vote
1 reply
@fadeevab
Comment options

Answer selected by 0xSirloin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants