Skip to content

How to get account from private key #498

Discussion options

You must be logged in to vote

import your pk and you can get your accountAddress from account!

    const privateKey = new Ed25519PrivateKey(
      import.meta.env.VITE_SECRET_KEY,
    );
    
    const account = await Account.fromPrivateKey({ privateKey });

    const accountAddress = account.accountAddress.toString();

    console.log("Account Address:", accountAddress);
    ```
    

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Cryptain-Harlock
Comment options

Answer selected by Cryptain-Harlock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants