We're using metamask on our frontend code, and it is working on other chains.
this is the code, which works fine for all other chains like arbitrum and eth:
if (window.ethereum) {
try {
const web3 = new Web3(window.ethereum);
await window.ethereum.request({ method: "eth_requestAccounts" }); // Request account access
const accounts = await web3.eth.getAccounts();
const fromAddress = accounts[0];
Hi Lokesh, I'm from the same team who posted this thread. I tried this package and still doesn't work, this package has too many warnings and is too complex to use compared to achieving similar functionality with other chains. Do you have react or JS code which is working currently or has worked in the recent past? Or any other approach I should try and yes I did try the different RPCs
Also, pls note the address "- Invalid address error for "0xdc........" occurs when you use the RPC's which doesn't support 0x conversion.
How to validate?-
RPC address prefixed with "e" should be the right one to convert the address from xdc to 0x. For example -- erpc.apothem.network for testnet
Thanks for the reply Lokesh. Was curious if you can consult for like an hour, I think it should be more than enough to solve my problem. Let me know what you would charge. This will save my time too.
Hi Lokesh, I'm from the same team who posted this thread. I tried this package and still doesn't work, this package has too many warnings and is too complex to use compared to achieving similar functionality with other chains. Do you have react or JS code which is working currently or has worked in the recent past? Or any other approach I should try and yes I did try the different RPCs
For further actions, you may consider blocking this person and/or reporting abuse
What's address of your RPC server ?
We're using metamask on our frontend code, and it is working on other chains.
this is the code, which works fine for all other chains like arbitrum and eth:
if (window.ethereum) {
try {
const web3 = new Web3(window.ethereum);
await window.ethereum.request({ method: "eth_requestAccounts" }); // Request account access
const accounts = await web3.eth.getAccounts();
const fromAddress = accounts[0];
};
const pinJobDetailsToIPFS = async (jobDetails) => {
const url = api.pinata.cloud/pinning/pinJSONTo...;
const headers = {
"Content-Type": "application/json",
pinata_api_key: pinataApiKey,
pinata_secret_api_key: pinataSecretApiKey,
};
};
We're using metamask on our frontend code, and it is working on other chains. Other chains do not require us to,
Do you have sample frontend code to call a writefunction on xdc, that would help?
Try this RPC's
erpc.apothem.network Or publicnexus.xdcchain.xyz/apothem-0...
tried but error not resolved and the 2nd link is not even working
Hi team, any update on my query above??
Hi Lokesh, I'm from the same team who posted this thread. I tried this package and still doesn't work, this package has too many warnings and is too complex to use compared to achieving similar functionality with other chains. Do you have react or JS code which is working currently or has worked in the recent past? Or any other approach I should try and yes I did try the different RPCs
Interesting!, that package has been helpful for quite number of dapps. Neverthless, we will address your feedback, thanks for raising that.
Meanwhile, have you tried XDCPay chrome extension to transact with your contract. If not, can you try that out and share your feedback here?
List of active RPC's, you can get it from chainlist.org/?search=xdc
Also, pls note the address "- Invalid address error for "0xdc........" occurs when you use the RPC's which doesn't support 0x conversion.
How to validate?-
RPC address prefixed with "e" should be the right one to convert the address from xdc to 0x. For example -- erpc.apothem.network for testnet
and erpc.xinfin.network for mainnet.
Try this out and let us know your feedback..
Thanks for the reply Lokesh. Was curious if you can consult for like an hour, I think it should be more than enough to solve my problem. Let me know what you would charge. This will save my time too.
Thanks so much for your help guys, I figured it. I had to just modify the transaction to use the legacy transaction format instead of EIP-1559
Try this NPM package -> npmjs.com/package/react-solidity-xdc3
Which has a boilerplate for you to kick-start the dapp development on XDC. Also note that, you may have to change the RPC URl's that's mentioned below
Hi Lokesh, I'm from the same team who posted this thread. I tried this package and still doesn't work, this package has too many warnings and is too complex to use compared to achieving similar functionality with other chains. Do you have react or JS code which is working currently or has worked in the recent past? Or any other approach I should try and yes I did try the different RPCs