Skip to content

accountFromPrivateKey

function accountFromPrivateKey(
privateKey: Uint8Array<ArrayBufferLike>,
type: "SECP256K1" | "BLS",
network: Network,
path?: string): {
address: IAddress;
path: string;
privateKey: Uint8Array;
publicKey: Uint8Array;
type: "SECP256K1" | "BLS";
}

Defined in: packages/iso-filecoin/src/wallet.js:108

Get account from private key

Lotus BLS private key is little endian so you need to reverse the byte order. Use lotusBlsPrivateKeyToBytes to convert.

Parameters

ParameterTypeDescription
privateKeyUint8Array<ArrayBufferLike>
type"SECP256K1" | "BLS"
networkNetwork
path?string

Returns

{
address: IAddress;
path: string;
privateKey: Uint8Array;
publicKey: Uint8Array;
type: "SECP256K1" | "BLS";
}

address

address: IAddress;

path?

optional path: string;

Derivation path - only for HD wallets

privateKey

privateKey: Uint8Array;

Private key - only for RAW and HD wallets

publicKey

publicKey: Uint8Array;

type

type: "SECP256K1" | "BLS";