avalancheUtils-HelperFunctions

Module: Utils-HelperFunctions

Index

Functions

Functions

NodeIDStringToBuffer

NodeIDStringToBuffer(pk: string): Buffer

Defined in src/utils/helperfunctions.ts:68

Takes a nodeID string and produces a nodeID Buffer.

Parameters:

Name Type Description
pk string A string for the nodeID.

Returns: Buffer


UnixNow

UnixNow(): BN

Defined in src/utils/helperfunctions.ts:28

Function providing the current UNIX time using a BN.

Returns: BN


bufferToNodeIDString

bufferToNodeIDString(pk: Buffer): string

Defined in src/utils/helperfunctions.ts:59

Takes a nodeID buffer and produces a nodeID string with prefix.

Parameters:

Name Type Description
pk Buffer A Buffer for the nodeID.

Returns: string


bufferToPrivateKeyString

bufferToPrivateKeyString(pk: Buffer): string

Defined in src/utils/helperfunctions.ts:37

Takes a private key buffer and produces a private key string with prefix.

Parameters:

Name Type Description
pk Buffer A Buffer for the private key.

Returns: string


getPreferredHRP

getPreferredHRP(networkID: number): any

Defined in src/utils/helperfunctions.ts:16

Parameters:

Name Type Default
networkID number undefined

Returns: any


privateKeyStringToBuffer

privateKeyStringToBuffer(pk: string): Buffer

Defined in src/utils/helperfunctions.ts:46

Takes a private key string and produces a private key Buffer.

Parameters:

Name Type Description
pk string A string for the private key.

Returns: Buffer