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

How can i generate sei adderss from a eth address #170

Open
Aadarsh805 opened this issue Nov 8, 2024 · 0 comments
Open

How can i generate sei adderss from a eth address #170

Aadarsh805 opened this issue Nov 8, 2024 · 0 comments

Comments

@Aadarsh805
Copy link

i am trying to do it using getSeiAddr method

this is the error I am getting

rror: execution reverted (could not decode reason; invalid data length) (action="call", data="0x45564d206164647265737320307845354238653766413232393239413741623039623232324531394461306642303938313935353541206973206e6f74206173736f636961746564", reason=null, transaction={ "data": "0x0c3c20ed000000000000000000000000e5b8e7fa22929a7ab09b222e19da0fb09819555a", "to": "0x0000000000000000000000000000000000001004" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.4)

and this is what I am doing


const createSEIAccount = async (ethPrivateKey, ethAddress) => {

  const { ethers } = require("ethers");

  const seiProvider = new ethers.JsonRpcProvider(
    "https://sei-evm-rpc.publicnode.com"
  ); 
  const seiWallet = new ethers.Wallet(ethPrivateKey, seiProvider);

  // Assuming `ADDRESS_PRECOMPILE_ABI` is the correct ABI to interact with SEI for account creation
  const seiContract = new ethers.Contract(
    "0x0000000000000000000000000000000000001004",
    ADDRESS_PRECOMPILE_ABI,
    seiProvider
  );

  try {
    const seiAddress = await seiContract.getSeiAddr(ethAddress);
    console.log("Sei Address:", seiAddress);
    return seiAddress;
  } catch (error) {
    console.error("Error fetching Sei address:", error);
  }
  return "";
};
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

1 participant