@celo/utils"packages/sdk/utils/src/signatureUtils"

Module: "packages/sdk/utils/src/signatureUtils"

Index

References

Functions

Object literals

References

NativeSigner

NativeSigner:


POP_SIZE

POP_SIZE:


Signature

Signature:


Signer

Signer:


serializeSignature

serializeSignature:

Functions

LocalSigner

LocalSigner(privateKey: string): Signer

Defined in packages/sdk/utils/src/signatureUtils.ts:61

Parameters:

Name Type
privateKey string

Returns: Signer


addressToPublicKey

addressToPublicKey(signer: string, signFn: function): Promise‹string›

Defined in packages/sdk/utils/src/signatureUtils.ts:35

Parameters:

signer: string

signFn: function

▸ (message: string, signer: string): Promise‹string›

Parameters:

Name Type
message string
signer string

Returns: Promise‹string›


guessSigner

guessSigner(message: string, signature: string): string

Defined in packages/sdk/utils/src/signatureUtils.ts:203

Parameters:

Name Type
message string
signature string

Returns: string


hashMessage

hashMessage(message: string): string

Defined in packages/sdk/utils/src/signatureUtils.ts:31

Parameters:

Name Type
message string

Returns: string


hashMessageWithPrefix

hashMessageWithPrefix(message: string): string

Defined in packages/sdk/utils/src/signatureUtils.ts:26

Parameters:

Name Type
message string

Returns: string


parseSignature

parseSignature(message: string, signature: string, signer: string): object

Defined in packages/sdk/utils/src/signatureUtils.ts:115

Parameters:

Name Type
message string
signature string
signer string

Returns: object

  • r: string

  • s: string

  • v: number


parseSignatureWithoutPrefix

parseSignatureWithoutPrefix(messageHash: string, signature: string, signer: string): object

Defined in packages/sdk/utils/src/signatureUtils.ts:119

Parameters:

Name Type
messageHash string
signature string
signer string

Returns: object

  • r: string

  • s: string

  • v: number


recoverEIP712TypedDataSignerRsv

recoverEIP712TypedDataSignerRsv(typedData: EIP712TypedData, signature: string): string

Defined in packages/sdk/utils/src/signatureUtils.ts:160

Recover signer from RSV-serialized signature over signed typed data.

Parameters:

Name Type Description
typedData EIP712TypedData EIP712 typed data
signature string RSV signature of signed type data by signer

Returns: string

string signer, or throws error if parsing fails


recoverEIP712TypedDataSignerVrs

recoverEIP712TypedDataSignerVrs(typedData: EIP712TypedData, signature: string): string

Defined in packages/sdk/utils/src/signatureUtils.ts:173

Recover signer from VRS-serialized signature over signed typed data.

Parameters:

Name Type Description
typedData EIP712TypedData EIP712 typed data
signature string VRS signature of signed type data by signer

Returns: string

string signer, or throws error if parsing fails


signMessage

signMessage(message: string, privateKey: string, address: string): object

Defined in packages/sdk/utils/src/signatureUtils.ts:80

Parameters:

Name Type
message string
privateKey string
address string

Returns: object

  • r: any = ethjsutil.bufferToHex(r)

  • s: any = ethjsutil.bufferToHex(s)

  • v: any


signMessageWithoutPrefix

signMessageWithoutPrefix(messageHash: string, privateKey: string, address: string): object

Defined in packages/sdk/utils/src/signatureUtils.ts:88

Parameters:

Name Type
messageHash string
privateKey string
address string

Returns: object

  • r: any = ethjsutil.bufferToHex(r)

  • s: any = ethjsutil.bufferToHex(s)

  • v: any


signedMessageToPublicKey

signedMessageToPublicKey(message: string, v: number, r: string, s: string): string

Defined in packages/sdk/utils/src/signatureUtils.ts:70

Parameters:

Name Type
message string
v number
r string
s string

Returns: string


verifyEIP712TypedDataSigner

verifyEIP712TypedDataSigner(typedData: EIP712TypedData, signature: string, signer: string): boolean

Defined in packages/sdk/utils/src/signatureUtils.ts:186

Parameters:

Name Type Description
typedData EIP712TypedData EIP712 typed data
signature string VRS or SRV signature of typedData by signer
signer string address to verify signed the typedData

Returns: boolean

boolean, true if signer is a possible signer of signature


verifySignature

verifySignature(message: string, signature: string, signer: string): boolean

Defined in packages/sdk/utils/src/signatureUtils.ts:106

Parameters:

Name Type
message string
signature string
signer string

Returns: boolean

Object literals

Const SignatureUtils

SignatureUtils: object

Defined in packages/sdk/utils/src/signatureUtils.ts:250

LocalSigner

LocalSigner: LocalSigner

Defined in packages/sdk/utils/src/signatureUtils.ts:252

NativeSigner

NativeSigner: NativeSigner

Defined in packages/sdk/utils/src/signatureUtils.ts:251

parseSignature

parseSignature: parseSignature

Defined in packages/sdk/utils/src/signatureUtils.ts:255

parseSignatureWithoutPrefix

parseSignatureWithoutPrefix: parseSignatureWithoutPrefix

Defined in packages/sdk/utils/src/signatureUtils.ts:256

recoverEIP712TypedDataSignerRsv

recoverEIP712TypedDataSignerRsv: recoverEIP712TypedDataSignerRsv

Defined in packages/sdk/utils/src/signatureUtils.ts:258

recoverEIP712TypedDataSignerVrs

recoverEIP712TypedDataSignerVrs: recoverEIP712TypedDataSignerVrs

Defined in packages/sdk/utils/src/signatureUtils.ts:259

serializeSignature

serializeSignature: serializeSignature

Defined in packages/sdk/utils/src/signatureUtils.ts:257

signMessage

signMessage: signMessage

Defined in packages/sdk/utils/src/signatureUtils.ts:253

signMessageWithoutPrefix

signMessageWithoutPrefix: signMessageWithoutPrefix

Defined in packages/sdk/utils/src/signatureUtils.ts:254

verifyEIP712TypedDataSigner

verifyEIP712TypedDataSigner: verifyEIP712TypedDataSigner

Defined in packages/sdk/utils/src/signatureUtils.ts:260