DAPI-Client

Classes

DAPIClient
CoreMethodsFacade
PlatformMethodsFacade
SimplifiedMasternodeListProvider

Functions

broadcastTransactionFactory(grpcTransport)broadcastTransaction
generateToAddressFactory(jsonRpcTransport)generateToAddress
getBestBlockHashFactory(jsonRpcTransport)getBestBlockHash
getBlockByHashFactory(grpcTransport)getBlockByHash
getBlockByHeightFactory(grpcTransport)getBlockByHeight
getBlockHashFactory(jsonRpcTransport)getBlockHash
getMnListDiffFactory(jsonRpcTransport)getMnListDiff
getStatusFactory(grpcTransport)getStatus
subscribeToTransactionsWithProofsFactory(grpcTransport)subscribeToTransactionsWithProofs

Typedefs

DAPIClientOptions : DAPIClientOptions
BroadcastTransactionOptions : object
subscribeToTransactionsWithProofsOptions : object

DAPIClient

Kind: global class

new DAPIClient([options])

ParamType
[options]DAPIClientOptions

CoreMethodsFacade

Kind: global class

new CoreMethodsFacade(jsonRpcTransport, grpcTransport)

ParamType
jsonRpcTransportJsonRpcTransport
grpcTransportGrpcTransport

PlatformMethodsFacade

Kind: global class

new PlatformMethodsFacade(grpcTransport)

ParamType
grpcTransportGrpcTransport

SimplifiedMasternodeListProvider

Kind: global class

new SimplifiedMasternodeListProvider(jsonRpcTransport, [options])

ParamTypeDefaultDescription
jsonRpcTransportJsonRpcTransportJsonRpcTransport instance
[options]objectOptions
[options.updateInterval]number60000
[options.network]string

simplifiedMasternodeListProvider.getSimplifiedMNList() ⇒ Promise.<SimplifiedMNList>

Returns simplified masternode list

Kind: instance method of SimplifiedMasternodeListProvider

broadcastTransactionFactory(grpcTransport) ⇒ broadcastTransaction

Kind: global function

ParamType
grpcTransportGrpcTransport

broadcastTransactionFactory~broadcastTransaction ⇒ string

Broadcast Transaction

Kind: inner typedef of broadcastTransactionFactory

ParamType
transactionBuffer
[options]DAPIClientOptions | BroadcastTransactionOptions

generateToAddressFactory(jsonRpcTransport) ⇒ generateToAddress

Kind: global function

ParamType
jsonRpcTransportJsonRpcTransport

generateToAddressFactory~generateToAddress ⇒ Promise.<Array.<string>>

ONLY FOR TESTING PURPOSES WITH REGTEST. WILL NOT WORK ON TESTNET/LIVENET.

Kind: inner typedef of generateToAddressFactory
Returns: Promise.<Array.<string>> - - block hashes

ParamTypeDescription
blocksNumbernumberNumber of blocks to generate
addressstringThe address that will receive the newly generated Dash
[options]DAPIClientOptions

getBestBlockHashFactory(jsonRpcTransport) ⇒ getBestBlockHash

Kind: global function

ParamType
jsonRpcTransportJsonRpcTransport

getBestBlockHashFactory~getBestBlockHash ⇒ Promise.<string>

Returns block hash of chaintip

Kind: inner typedef of getBestBlockHashFactory

ParamType
[options]DAPIClientOptions

getBlockByHashFactory(grpcTransport) ⇒ getBlockByHash

Kind: global function

ParamType
grpcTransportGrpcTransport

getBlockByHashFactory~getBlockByHash ⇒ Promise.<(null|Buffer)>

Get block by hash

Kind: inner typedef of getBlockByHashFactory

ParamType
hashstring
[options]DAPIClientOptions

getBlockByHeightFactory(grpcTransport) ⇒ getBlockByHeight

Kind: global function

ParamType
grpcTransportGrpcTransport

getBlockByHeightFactory~getBlockByHeight ⇒ Promise.<(null|Buffer)>

Get block by height

Kind: inner typedef of getBlockByHeightFactory

ParamType
heightnumber
[options]DAPIClientOptions

getBlockHashFactory(jsonRpcTransport) ⇒ getBlockHash

Kind: global function

ParamType
jsonRpcTransportJsonRpcTransport

getBlockHashFactory~getBlockHash ⇒ Promise.<string>

Returns block hash for the given height

Kind: inner typedef of getBlockHashFactory
Returns: Promise.<string> - - block hash

ParamType
heightnumber
[options]DAPIClientOptions

getMnListDiffFactory(jsonRpcTransport) ⇒ getMnListDiff

Kind: global function

ParamType
jsonRpcTransportJsonRpcTransport

getMnListDiffFactory~getMnListDiff ⇒ Promise.<object>

Get deterministic masternodelist diff

Kind: inner typedef of getMnListDiffFactory

ParamTypeDescription
baseBlockHashstringhash or height of start block
blockHashstringhash or height of end block
[options]DAPIClientOptions

getStatusFactory(grpcTransport) ⇒ getStatus

Kind: global function

ParamType
grpcTransportGrpcTransport

getStatusFactory~getStatus ⇒ Promise.<object>

Get Core chain status

Kind: inner typedef of getStatusFactory

ParamType
[options]DAPIClientOptions

subscribeToTransactionsWithProofsFactory(grpcTransport) ⇒ subscribeToTransactionsWithProofs

Kind: global function

ParamType
grpcTransportGrpcTransport

subscribeToTransactionsWithProofsFactory~subscribeToTransactionsWithProofs ⇒ EventEmitter | !grpc.web.ClientReadableStream.<!TransactionsWithProofsResponse>

Kind: inner typedef of subscribeToTransactionsWithProofsFactory

ParamTypeDescription
bloomFilterobject
bloomFilter.vDataUint8Array | ArrayThe filter itself is simply a bit field of arbitrary byte-aligned size. The maximum size is 36,000 bytes.
bloomFilter.nHashFuncsnumberThe number of hash functions to use in this filter. The maximum value allowed in this field is 50.
bloomFilter.nTweaknumberA random value to add to the seed value in the hash function used by the bloom filter.
bloomFilter.nFlagsnumberA set of flags that control how matched items are added to the filter.
[options]DAPIClientOptions | subscribeToTransactionsWithProofsOptions

DAPIClientOptions : DAPIClientOptions

Kind: global typedef
Properties

NameTypeDefault
[dapiAddressProvider]DAPIAddressProvider
[dapiAddresses]Array.<(RawDAPIAddress|DAPIAddress|string)>
[seeds]Array.<(RawDAPIAddress|DAPIAddress|string)>
[dapiAddressesWhiteList]Array.<(RawDAPIAddress|DAPIAddress|string)>
[network]string | Network"testnet"
[timeout]number2000
[retries]number3
[baseBanTime]number60000
[throwDeadlineExceeded]boolean

BroadcastTransactionOptions : object

Kind: global typedef
Properties

NameTypeDefault
[allowHighFees]booleanfalse
[bypassLimits]booleanfalse

subscribeToTransactionsWithProofsOptions : object

Kind: global typedef
Properties

NameTypeDefaultDescription
[fromBlockHash]stringSpecifies block hash to start syncing from
[fromBlockHeight]numberSpecifies block height to start syncing from
[count]number0Number of blocks to sync, if set to 0 syncing is continuously sends new data as well