Constructor
new Wallet(settingsopt) → {Wallet}
Create an instance of a
Wallet.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
settings |
Object
|
<optional>
|
{}
|
Configure the wallet.
Properties
Name |
Type |
Attributes |
Default |
Description |
verbosity |
Number
|
<optional>
|
2
|
One of: 0 (none), 1 (error), 2 (warning), 3 (notice), 4 (debug), 5 (audit) |
key |
Object
|
<optional>
|
|
Key to restore from.
Properties
Name |
Type |
Attributes |
Description |
seed |
String
|
<optional>
|
Mnemonic seed for a restored wallet. |
|
|
Properties:
Name |
Type |
Description |
id |
String
|
Unique identifier for this Wallet. |
- Source:
-
Returns:
Instance of the wallet.
-
Type
-
Wallet
Methods
(async) _createCrowdfund(fund)
Create a crowdfunding transaction.
Parameters:
Name |
Type |
Description |
fund |
Object
|
|
- Source:
-
Generate
Script for reclaiming funds commited to a
Swap.
Parameters:
Name |
Type |
Description |
redeemScript |
*
|
|
- Source:
-
Parameters:
Name |
Type |
Description |
redeemScript |
*
|
|
secret |
*
|
|
- Source:
-
_load(settings)
Initialize the wallet, including keys and addresses.
Parameters:
Name |
Type |
Description |
settings |
Object
|
Settings to load. |
- Source:
-
(async) _sign(tx)
Signs a transaction with the keyring.
Parameters:
Name |
Type |
Description |
tx |
BcoinTX
|
|
- Source:
-
(async) createPricedOrder(order)
Create a priced order.
Parameters:
Name |
Type |
Description |
order |
Object
|
Properties
Name |
Type |
Description |
asset |
Object
|
|
amount |
Object
|
|
|
- Source:
-
getAddressForScript(script)
Returns a bech32 address for the provided
Script.
Parameters:
Name |
Type |
Description |
script |
Script
|
|
- Source:
-
getAddressFromRedeemScript(redeemScript)
Generate a BitcoinAddress for the supplied BitcoinScript.
Parameters:
Name |
Type |
Description |
redeemScript |
BitcoinScript
|
|
- Source:
-
loadKey(keypair) → {Wallet}
Import a key to the wallet.
Parameters:
Name |
Type |
Description |
keypair |
Object
|
Keypair.
Properties
Name |
Type |
Attributes |
Description |
public |
Buffer
|
|
Public key. |
private |
Buffer
|
<optional>
|
Private key. |
|
- Source:
-
Returns:
Instance of the Wallet.
-
Type
-
Wallet
publicKeyFromString(input)
Create a public key from a string.
Parameters:
Name |
Type |
Description |
input |
String
|
Hex-encoded string to create key from. |
- Source:
-
start()
Start the wallet, including listening for transactions.
- Source:
-
(static) createSeed(passphrase) → {FabricSeed}
Create a new seed phrase.
Parameters:
Name |
Type |
Description |
passphrase |
String
|
BIP 39 passphrase for key derivation. |
- Source:
-
Returns:
The seed object.
-
Type
-
FabricSeed
(static) fromSeed(seed) → {Wallet}
Create a new
Wallet from a seed object.
Parameters:
Name |
Type |
Description |
seed |
FabricSeed
|
Fabric seed. |
- Source:
-
Returns:
Instance of the wallet.
-
Type
-
Wallet