Closed reese-1eco closed 1 year ago
test contract information
Is there anything else I can do to fix the problem? If it is possible to give a guide, I will try to solve it.
It appears to be an issue related to #108
The issue seems to be linked to using ethers. You should still be able to use web3 library to access the contract and we will investigate a fix for ethers.js asap.
we are still investigating this and trying to find a solution. In any case please update to the latest version of the SDK (v0.4.0 should be released later today). Thanks for reporting.
Thank you for providing information. I will check after installing sdk version 0.4.0.
@abretonc7s What is the best way to use smart contract's transfer api with metamask-sdk version 0.5.3? Would it be better to use web3.js over ethers.js?
Is there any way to use the Ethereum provider API? If there is a document on how to control a smart contract with the Ethereum provider API, please let me know the url.
thank you
We are still working on integrating new hooks to handle smart contracts but in the meantime using web3js is probably the best way for now.
@abretonc7s thank you I will also try to use web3.js. Is there a recommended web3.js version or example? Please share if possible. I'm currently developing a dapp for mobile with react native.
Please see this example
const account = await sdk?.connect();
console.log('account', account);
let web3 = new Web3(sdk?.getProvider() as any);
const accounts = await web3.eth.requestAccounts();
console.log('accounts', accounts);
await web3.eth.personal.sign(
web3.utils.utf8ToHex('this is a test'),
accounts[0],
undefined as any,
);
};
Closing the issue for now, feel free to open another one if you need additional support.
Describe the bug
To Reproduce Steps to reproduce the behaviour:
Expected behaviour expect to be able to read information normally and use contract abi.
Screenshots
Provide environment information
Additional context