Get Address

The getAddress method allows you to retrieve the Ethereum address associated with the current ParabolAccount instance. This address represents the account that will be used for transactions and interactions with the Parabol protocol.

Usage

import { ParabolAccount, SupportedChainIds } from "@parabolfi/core";
 
async function getParabolAccountAddress() {
  const privateKey = "0x..."; // Your private key
  const chainId = SupportedChainIds.ZKSYNC;
 
  const account = await ParabolAccount.fromPrivateKey({
    privateKey,
    chainId,
  });
 
  const address = account.getAddress();
  console.log("account address:", address);
}

Returns

  • Address - The Ethereum address associated with the ParabolAccount instance.

Notes

  • The returned address is derived from the private key used to create the ParabolAccount instance.
  • This method is synchronous and does not involve any blockchain interactions.
  • The address is in the standard Ethereum format (42 characters long, starting with ‘0x’).