getAddress
getAddress
returns the EOA address of the Signer.
This method must be called after authenticate
. Otherwise, this method will throw an error with the message Not Authenticated
.
Usage
ts
import { createFireblocksSigner } from "./fireblocks";
const fireblocksSigner = await createFireblocksSigner();
const address = await fireblocksSigner.getAddress();
ts
import { FireblocksSigner } from "@alchemy/aa-signers/fireblocks";
import { ChainId } from "@fireblocks/fireblocks-web3-provider";
export const createFireblocksSigner = async () => {
const fireblocksSigner = new FireblocksSigner({
privateKey: process.env.FIREBLOCKS_API_PRIVATE_KEY_PATH!,
apiKey: process.env.FIREBLOCKS_API_KEY!,
vaultAccountIds: process.env.FIREBLOCKS_VAULT_ACCOUNT_IDS,
chainId: ChainId.SEPOLIA,
});
await fireblocksSigner.authenticate();
return fireblocksSigner;
};
Returns
Promise<Address>
A Promise
containing the address of the Signer.