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
Should work
errors with unknown account because wallet isn't copied from web3 instance to contract context.
import { Contract, Web3 } from "web3"; import abi from "./contractabi.json" assert { type: "json" }; (async () => { const web3 = new Web3( "https://rpc2.sepolia.org" ); const account = web3.eth.accounts.wallet .add("Private Key") .get(0); console.log(web3.wallet); const contract = new Contract( abi, "0x7af963cF6D228E564e2A0aA0DdBF06210B38615D", web3 ); //@ts-expect-error const receipt = await contract.methods.store("test") console.log(await receipt.send({from: account?.address})); })();
https://github.com/web3/web3.js/blob/4.x/packages/web3-core/src/web3_context.ts#L131 probably "_wallet" should be copied instead of "wallet" because getter isn't copied here: https://github.com/web3/web3.js/blob/4.x/packages/web3-eth-contract/src/contract.ts#L482
The text was updated successfully, but these errors were encountered:
Muhammad-Altabba
Successfully merging a pull request may close this issue.
Expected behavior
Should work
Actual behavior
errors with unknown account because wallet isn't copied from web3 instance to contract context.
Steps to reproduce the behavior
https://github.com/web3/web3.js/blob/4.x/packages/web3-core/src/web3_context.ts#L131
probably "_wallet" should be copied instead of "wallet" because getter isn't copied here: https://github.com/web3/web3.js/blob/4.x/packages/web3-eth-contract/src/contract.ts#L482
The text was updated successfully, but these errors were encountered: