Dashcore Lib primitives#

All Dashcore lib primitives are exposed via the Core namespace.

const Dash = require('dash');
const {
  Core: {
    Block,
    Transaction,
    Address,
    // ...
  }
} = Dash;

Transaction#

The Transaction primitive allows creating and manipulating transactions. It also allows signing transactions with a private key.
Supports fee control and input/output access (which allows passing a specific script).

const { Transaction } = Dash.Core;
const tx = new Transaction(txProps)

Access the Transaction documentation on dashpay/dashcore-lib

Address#

Standardized representation of a Dash Address. Address can be instantiated from a String, PrivateKey, PublicKey, HDPrivateKey or HdPublicKey.
Pay-to-script-hash (P2SH) multi-signature addresses from an array of PublicKeys are also supported.

const { Address } = Dash.Core;

Access the Address documentation on dashpay/dashcore-lib

Block#

Given a binary representation of the block as input, the Block class allows you to have a deserialized representation of a Block or its header. It also allows validating the transactions in the block against the header merkle root.

The block’s transactions can also be explored by iterating over elements in array (block.transactions).

const { Block } = Dash.Core;

Access the Block documentation on dashpay/dashcore-lib

UnspentOutput#

Representation of an UnspentOutput (also called UTXO as in Unspent Transaction Output).
Mostly useful in association with a Transaction and for Scripts.

const { UnspentOutput } = Dash.Core.Transaction;

Access the UnspentOutput documentation on dashpay/dashcore-lib

HDPublicKey#

Hierarchical Deterministic (HD) version of the PublicKey.
Used internally by Wallet-lib and for exchange between peers (DashPay)

const { HDPublicKey } = Dash.Core;`

Access the HDKeys documentation on dashpay/dashcore-lib

HDPrivateKey#

Hierarchical Deterministic (HD) version of the PrivateKey.
Used internally by Wallet-lib.

const { HDPrivateKey } = Dash.Core;

Access the HDKeys documentation on dashpay/dashcore-lib

PublicKey#

const { PublicKey } = Dash.Core;

Access the PublicKey documentation on dashpay/dashcore-lib

PrivateKey#

const { PrivateKey } = Dash.Core;

Access the PrivateKey documentation on dashpay/dashcore-lib

Mnemonic#

Implementation of BIP39 Mnemonic code for generative deterministic keys.
Generates a random mnemonic with the chosen language, validates a mnemonic or returns the associated HDPrivateKey.

const { Mnemonic } = Dash.Core;

Access the Mnemonic documentation on dashpay/dashcore-lib

Network#

A representation of the internal parameters relative to the selected network. By default, all primitives works with ‘livenet’.

const { Network } = Dash.Core;

Access the Network documentation on dashpay/dashcore-lib

Script#

const { Script } = Dash.Core.Transaction;

Access the Script documentation on dashpay/dashcore-lib

Input#

const { Input } = Dash.Core.Transaction;

Access the Transaction documentation on dashpay/dashcore-lib

Output#

const { Output } = Dash.Core.Transaction;

Access the Transaction documentation on dashpay/dashcore-lib