Home Reference Source
public class | source

MainBlockchainWallet

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

addresses: *[]

public
public

db: *

public

emitter: *

public

Method Summary

Public Methods
public

async createNewAddress(salt: *): *

public

async createNewAddressPrivateKey(salt: *): *

public

async deleteAddress(address: *): {"result": *, "message": string}

public

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

public

async encryptAddress(addressString: *, newPassword: *, oldPassword: *): Promise<*>

public

async exportAddressToJSON(address: *): *

Export the Private Key from an Address

public

exportWallet(filePath: *): Promise<any>

Export wallet addresses array

public

getAddress(address: *): *

Finding stringAddress or address

public

getAddressPic(address: *): string

public

async getFirstAddress(): *

public

getUnencodedAddress(address: *): *

public

async importAddressFromJSON(inputData: *): {"result": *, "message": *}

import an Address from a PrivateKey/WIF

public

async importAddressFromString(addressString: *): *

public

importWallet(filePath: *): Promise<any>

Import an wallet address array from a binary file

public

async isAddressEncrypted(address: *): *

public
public

async loadWallet()

public

async removeAddresses(): *

public

async saveWallet(): *

public

async serialize(serializePrivateKey: boolean): *

public

async validatePassword(address: *, password: *): Promise<*>

Private Methods
private

async _insertAddress(blockchainAddress: *): boolean

private

async _justCreateNewAddress(salt: *, emptyAddress: *): *

Public Constructors

public constructor() source

Public Members

public addresses: *[] source

public blockchain: * source

public db: * source

public emitter: * source

public walletFileName: string source

Public Methods

public async createNewAddress(salt: *): * source

Params:

NameTypeAttributeDescription
salt *

Return:

*

public async createNewAddressPrivateKey(salt: *): * source

Params:

NameTypeAttributeDescription
salt *

Return:

*

public async deleteAddress(address: *): {"result": *, "message": string} source

Params:

NameTypeAttributeDescription
address *

Return:

{"result": *, "message": string}

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

Params:

NameTypeAttributeDescription
buffer *
deserializePrivateKey boolean
  • optional
  • default: false

Return:

boolean

public async encryptAddress(addressString: *, newPassword: *, oldPassword: *): Promise<*> source

Params:

NameTypeAttributeDescription
addressString *
newPassword *
oldPassword *

Return:

Promise<*>

public async exportAddressToJSON(address: *): * source

Export the Private Key from an Address

Params:

NameTypeAttributeDescription
address *

Return:

*

privateKeyWIF as Hex

public exportWallet(filePath: *): Promise<any> source

Export wallet addresses array

Params:

NameTypeAttributeDescription
filePath *

is the binary file for storing addresses

Return:

Promise<any>

public getAddress(address: *): * source

Finding stringAddress or address

Params:

NameTypeAttributeDescription
address *

Return:

*

public getAddressPic(address: *): string source

Params:

NameTypeAttributeDescription
address *

Return:

string

public async getFirstAddress(): * source

Return:

*

the mining address which will receive rewards

public getUnencodedAddress(address: *): * source

Params:

NameTypeAttributeDescription
address *

Return:

*

public async importAddressFromJSON(inputData: *): {"result": *, "message": *} source

import an Address from a PrivateKey/WIF

Params:

NameTypeAttributeDescription
inputData *

is JSON or String

Return:

{"result": *, "message": *}

public async importAddressFromString(addressString: *): * source

Params:

NameTypeAttributeDescription
addressString *

Return:

*

public importWallet(filePath: *): Promise<any> source

Import an wallet address array from a binary file

Params:

NameTypeAttributeDescription
filePath *

is the binary file path

Return:

Promise<any>

public async isAddressEncrypted(address: *): * source

Params:

NameTypeAttributeDescription
address *

Return:

*

true if privateKey of address is encrypted

public async loadAddresses(): boolean source

Return:

boolean

public async loadWallet() source

public async removeAddresses(): * source

Return:

*

public async saveWallet(): * source

Return:

*

public async serialize(serializePrivateKey: boolean): * source

Params:

NameTypeAttributeDescription
serializePrivateKey boolean
  • optional
  • default: false

Return:

*

public async validatePassword(address: *, password: *): Promise<*> source

Params:

NameTypeAttributeDescription
address *
password *

Return:

Promise<*>

true if address's password is @param password

Private Methods

private async _insertAddress(blockchainAddress: *): boolean source

Params:

NameTypeAttributeDescription
blockchainAddress *

Return:

boolean

private async _justCreateNewAddress(salt: *, emptyAddress: *): * source

Params:

NameTypeAttributeDescription
salt *
emptyAddress *

Return:

*