Home Reference Source
public class | source

InterfaceBlockchainAddress

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

address: *

public

db: *

public
public

Method Summary

Public Methods
public

async createNewAddress(salt: *, privateKeyWIF: *)

public

decrypt(data: *, password: *): *

public

async deserializeAddress(buffer: *, deserializePrivateKey: boolean): *

public

encrypt(data: *, password: *): *

public
public

Returns a string value of address

public

exportPrivateKey(fileName: *, totalMultiSig: *, requiredMultiSig: *): Promise<any>

public

Export privateKey as string

public

async getPrivateKey(password: *): *

public

importPrivateKey(fileName: *): Promise<void>

Imports privateKey from @param fileName and saves it to local database

public

importPrivateKeyFromString(privateKeyString: *): *

Import a private key from user input

public
public

async loadAddress(): boolean

public

async removeAddress(): *

public

async removePrivateKey(): *

Removes privateKey from database

public

async saveAddress(): *

public

async savePrivateKey(value: *, password: *): *

Save privateKey encrypted to local database

public

async serializeAddress(serializePrivateKey: boolean): *

public

async signMessage(serialization: *, password: *): *

public

async signTransaction(transaction: *, password: *): *

public

toString(): *

Private Methods
private

async _getPrivateKey(password: *): *

private

async _toStringDebug(): *

Public Constructors

public constructor() source

Public Members

public address: * source

public db: * source

public publicKey: * source

public unencodedAddress: * source

Public Methods

public async createNewAddress(salt: *, privateKeyWIF: *) source

Params:

NameTypeAttributeDescription
salt *
privateKeyWIF *

public decrypt(data: *, password: *): * source

Params:

NameTypeAttributeDescription
data *
password *

Return:

*

public async deserializeAddress(buffer: *, deserializePrivateKey: boolean): * source

Params:

NameTypeAttributeDescription
buffer *
deserializePrivateKey boolean
  • optional
  • default: false

Return:

*

public encrypt(data: *, password: *): * source

Params:

NameTypeAttributeDescription
data *

to be encrypted

password *

used for AES encrypt

Return:

*

data encrypted with AES

public async exportAddressPrivateKeyToHex(): * source

Return:

*

public exportAddressToString(): * source

Returns a string value of address

Return:

*

public exportPrivateKey(fileName: *, totalMultiSig: *, requiredMultiSig: *): Promise<any> source

Params:

NameTypeAttributeDescription
fileName *

stores the path for privateKey file

totalMultiSig *

is the number of passwords used to encrypt privateKey

requiredMultiSig *

is the minimum required number of passwords to decrypt privateKey with multiSig

Return:

Promise<any>

public exportPrivateKeyToString(): * source

Export privateKey as string

Return:

*

public async getPrivateKey(password: *): * source

Params:

NameTypeAttributeDescription
password *

Return:

*

public importPrivateKey(fileName: *): Promise<void> source

Imports privateKey from @param fileName and saves it to local database

Params:

NameTypeAttributeDescription
fileName *

is the source file for import

Return:

Promise<void>

public importPrivateKeyFromString(privateKeyString: *): * source

Import a private key from user input

Params:

NameTypeAttributeDescription
privateKeyString *

is the imported text value

Return:

*

public async isPrivateKeyEncrypted(): * source

Return:

*

true if privateKey is encrypted

public async loadAddress(): boolean source

Return:

boolean

public async removeAddress(): * source

Return:

*

public async removePrivateKey(): * source

Removes privateKey from database

Return:

*

database result

public async saveAddress(): * source

Return:

*

public async savePrivateKey(value: *, password: *): * source

Save privateKey encrypted to local database

Params:

NameTypeAttributeDescription
value *

privateKey's value

password *

Encrypt privateKey with AES using password

Return:

*

database response

public async serializeAddress(serializePrivateKey: boolean): * source

Params:

NameTypeAttributeDescription
serializePrivateKey boolean
  • optional
  • default: false

Return:

*

public async signMessage(serialization: *, password: *): * source

Params:

NameTypeAttributeDescription
serialization *
password *

Return:

*

public async signTransaction(transaction: *, password: *): * source

Params:

NameTypeAttributeDescription
transaction *
password *

Return:

*

public toString(): * source

Return:

*

Private Methods

private async _getPrivateKey(password: *): * source

Params:

NameTypeAttributeDescription
password *

is used to decrypt privateKey from database

Return:

*

privateKey's value decrypted

private async _toStringDebug(): * source

Return:

*