Home Reference Source
public class | source

InterfaceBlockchainAddressHelper

Static Method Summary

Static Public Methods
public static

askForPassword(message: *): *

public static

generateAddress(salt: *, privateKeyWIF: *): {"address": *, "addressWIF": *, "unencodedAddress": *, "publicKey": *, "privateKey": *}

public static

generateAddressWIF(address: *, showDebug: *, toBase: boolean): *

public static

address is usually a Base string and it coins Version+Checksum+Address

public static

signMessage(msg: *, privateKey: *): *

public static

validatePrivateKeyWIF(privateKeyWIF: *): {result: boolean, privateKey: *}

it returns the validity of PrivateKey

public static

verifySignedData(msg: *, signature: *, pubKey: *): *

Static Private Methods
private static

_calculateChecksum(privateKeyAndVersion: *, showDebug: *): *

private static

_generateAddressFromPublicKey(publicKey: *, showDebug: *): {"unencodedAddress": *, "addressWIF": *, "address": *}

private static

_generatePrivateKey(salt: *, showDebug: *): *

private static

_generatePrivateKeyAdvanced(salt: *, showDebug: *, privateKeyWIF: *): {"privateKeyWIF": *, "privateKey": *}

private static

_generatePublicKey(privateKeyWIF: *, showDebug: *): {result, privateKey}|*

generate PublicKey from PrivateKeyWIF

private static

_generateUnencodedAddressFromPublicKey(publicKey: *, showDebug: *): *

private static

_validateAddressWIF(addressWIF: *): {result: boolean, address: *}

it returns the validity of PrivateKey

Constructor Summary

Public Constructor
public

Static Public Methods

public static askForPassword(message: *): * source

Params:

NameTypeAttributeDescription
message *

Return:

*

public static generateAddress(salt: *, privateKeyWIF: *): {"address": *, "addressWIF": *, "unencodedAddress": *, "publicKey": *, "privateKey": *} source

Params:

NameTypeAttributeDescription
salt *
privateKeyWIF *

Return:

{"address": *, "addressWIF": *, "unencodedAddress": *, "publicKey": *, "privateKey": *}

public static generateAddressWIF(address: *, showDebug: *, toBase: boolean): * source

Params:

NameTypeAttributeDescription
address *
showDebug *
toBase boolean
  • optional
  • default: false

Return:

*

public static getUnencodedAddressFromWIF(address: *): * source

address is usually a Base string and it coins Version+Checksum+Address

Params:

NameTypeAttributeDescription
address *

Return:

*

public static signMessage(msg: *, privateKey: *): * source

Params:

NameTypeAttributeDescription
msg *
privateKey *

Return:

*

public static validatePrivateKeyWIF(privateKeyWIF: *): {result: boolean, privateKey: *} source

it returns the validity of PrivateKey

and in case privateKey is a WIF, it returns the private key without WIF

Params:

NameTypeAttributeDescription
privateKeyWIF *

Return:

{result: boolean, privateKey: *}

public static verifySignedData(msg: *, signature: *, pubKey: *): * source

Params:

NameTypeAttributeDescription
msg *
signature *
pubKey *

Return:

*

Static Private Methods

private static _calculateChecksum(privateKeyAndVersion: *, showDebug: *): * source

Params:

NameTypeAttributeDescription
privateKeyAndVersion *
showDebug *

Return:

*

private static _generateAddressFromPublicKey(publicKey: *, showDebug: *): {"unencodedAddress": *, "addressWIF": *, "address": *} source

Params:

NameTypeAttributeDescription
publicKey *
showDebug *

Return:

{"unencodedAddress": *, "addressWIF": *, "address": *}

private static _generatePrivateKey(salt: *, showDebug: *): * source

Params:

NameTypeAttributeDescription
salt *
showDebug *

Return:

*

private static _generatePrivateKeyAdvanced(salt: *, showDebug: *, privateKeyWIF: *): {"privateKeyWIF": *, "privateKey": *} source

Params:

NameTypeAttributeDescription
salt *
showDebug *
privateKeyWIF *

Return:

{"privateKeyWIF": *, "privateKey": *}

private static _generatePublicKey(privateKeyWIF: *, showDebug: *): {result, privateKey}|* source

generate PublicKey from PrivateKeyWIF

Params:

NameTypeAttributeDescription
privateKeyWIF *
showDebug *

Return:

{result, privateKey}|*

private static _generateUnencodedAddressFromPublicKey(publicKey: *, showDebug: *): * source

Params:

NameTypeAttributeDescription
publicKey *
showDebug *

Return:

*

private static _validateAddressWIF(addressWIF: *): {result: boolean, address: *} source

it returns the validity of PrivateKey

and in case privateKey is a WIF, it returns the private key without WIF

Params:

NameTypeAttributeDescription
addressWIF *

Return:

{result: boolean, address: *}

Public Constructors

public constructor() source