Function accountFromPrivateKey
accountFromPrivateKey( privateKey: Uint8Array<ArrayBufferLike>, type: "SECP256K1" | "BLS", network: Network, path?: string,): { address: IAddress; path?: string; privateKey: Uint8Array; publicKey: Uint8Array; type: "SECP256K1" | "BLS";} Parameters
- privateKey: Uint8Array<ArrayBufferLike>
- type: "SECP256K1" | "BLS"
- network: Network
Optional
path: string
Returns {
address: IAddress;
path?: string;
privateKey: Uint8Array;
publicKey: Uint8Array;
type: "SECP256K1" | "BLS";
}
Optional
path?: string
privateKey: Uint8Array
publicKey: 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.