Home Reference Source Test
public class | source

Wallet

Direct Subclass:

MultiSigWallet

Static Method Summary

Static Public Methods
public static

Create a new Wallet.

public static

async loadEncrypted(buf: Uint8Array | string, key: Uint8Array | string): Promise<Wallet>

public static

loadPlain(buf: Uint8Array | string): Wallet

Constructor Summary

Public Constructor
public

Create a new Wallet object.

Member Summary

Public Members
public get

The address of the Wallet owner.

public get

isLocked: boolean

public get
public get

The public key of the Wallet owner

Method Summary

Public Methods
public

createTransaction(recipient: Address, value: number, fee: number, validityStartHeight: number): Transaction

Create a Transaction that is signed by the owner of this Wallet.

public

equals(o: Wallet): boolean

public

exportEncrypted(key: Uint8Array | string): Promise<SerialBuffer>

public

exportPlain(): Uint8Array

public

lock(key: Uint8Array | string): Promise<void>

public

relock()

public

Sign a transaction by the owner of this Wallet.

public

unlock(key: Uint8Array | string): Promise<void>

Static Public Methods

public static generate(): Wallet source

Create a new Wallet.

Return:

Wallet

Newly created Wallet.

public static async loadEncrypted(buf: Uint8Array | string, key: Uint8Array | string): Promise<Wallet> source

Params:

NameTypeAttributeDescription
buf Uint8Array | string
key Uint8Array | string

Return:

Promise<Wallet>

public static loadPlain(buf: Uint8Array | string): Wallet source

Params:

NameTypeAttributeDescription
buf Uint8Array | string

Return:

Wallet

Public Constructors

public constructor(keyPair: KeyPair): Wallet source

Create a new Wallet object.

Params:

NameTypeAttributeDescription
keyPair KeyPair

KeyPair owning this Wallet.

Return:

Wallet

A newly generated Wallet.

Public Members

public get address: Address source

The address of the Wallet owner.

public get isLocked: boolean source

public get keyPair: KeyPair source

public get publicKey: PublicKey source

The public key of the Wallet owner

Public Methods

public createTransaction(recipient: Address, value: number, fee: number, validityStartHeight: number): Transaction source

Create a Transaction that is signed by the owner of this Wallet.

Params:

NameTypeAttributeDescription
recipient Address

Address of the transaction receiver

value number

Number of Satoshis to send.

fee number

Number of Satoshis to donate to the Miner.

validityStartHeight number

The validityStartHeight for the transaction.

Return:

Transaction

A prepared and signed Transaction object. This still has to be sent to the network.

public equals(o: Wallet): boolean source

Params:

NameTypeAttributeDescription
o Wallet

Return:

boolean

public exportEncrypted(key: Uint8Array | string): Promise<SerialBuffer> source

Params:

NameTypeAttributeDescription
key Uint8Array | string

Return:

Promise<SerialBuffer>

public exportPlain(): Uint8Array source

Return:

Uint8Array

public lock(key: Uint8Array | string): Promise<void> source

Params:

NameTypeAttributeDescription
key Uint8Array | string

Return:

Promise<void>

public relock() source

public signTransaction(transaction: Transaction): SignatureProof source

Sign a transaction by the owner of this Wallet.

Params:

NameTypeAttributeDescription
transaction Transaction

The transaction to sign.

Return:

SignatureProof

A signature proof for this transaction.

public unlock(key: Uint8Array | string): Promise<void> source

Params:

NameTypeAttributeDescription
key Uint8Array | string

Return:

Promise<void>