Wallet
Direct Subclass:
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 |
|
Constructor Summary
Public Constructor | ||
public |
constructor(keyPair: KeyPair): Wallet 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 |
|
|
public |
exportEncrypted(key: Uint8Array | string): Promise<SerialBuffer> |
|
public |
exportPlain(): Uint8Array |
|
public |
lock(key: Uint8Array | string): Promise<void> |
|
public |
relock() |
|
public |
signTransaction(transaction: Transaction): SignatureProof Sign a transaction by the owner of this Wallet. |
|
public |
unlock(key: Uint8Array | string): Promise<void> |
Static Public Methods
Public Constructors
Public Members
public get isLocked: boolean source
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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
o | Wallet |
Return:
boolean |
public exportEncrypted(key: Uint8Array | string): Promise<SerialBuffer> source
Params:
Name | Type | Attribute | Description |
key | Uint8Array | string |
public lock(key: Uint8Array | string): Promise<void> source
Params:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
transaction | Transaction | The transaction to sign. |
public unlock(key: Uint8Array | string): Promise<void> source
Params:
Name | Type | Attribute | Description |
key | Uint8Array | string |
Return:
Promise<void> |