Function accountFromPrivateKey
- accountFromPrivateKey(
privateKey: Uint8Array,
type: "SECP256K1" | "BLS",
network: Network,
path?: string,
): {
address: AddressSecp256k1 | AddressBLS;
path: undefined | string;
privateKey: Uint8Array;
pubKey: Uint8Array;
type: "SECP256K1" | "BLS";
} Parameters
- privateKey: Uint8Array
- type: "SECP256K1" | "BLS"
- network: Network
Optional
path: string
Returns {
address: AddressSecp256k1 | AddressBLS;
path: undefined | string;
privateKey: Uint8Array;
pubKey: Uint8Array;
type: "SECP256K1" | "BLS";
}
Get account from private key
Lotus BLS private key is little endian so you need to reverse the byte order. Use
lotusBlsPrivateKeyToBytes
to convert.