Skip to content

sign

function sign(
privateKey: Uint8Array<ArrayBufferLike>,
type: "SECP256K1" | "BLS",
data: Uint8Array<ArrayBufferLike>): Signature

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

Sign arbitary bytes similar to lotus wallet sign

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"
dataUint8Array<ArrayBufferLike>

Returns

Signature