Guides
Dash CoreDash PlatformDash.orgDash User DocsLog In

Usage (Core)

🚧

New site!

All content has been migrated to docs.dash.org. You will be automatically redirected momentarily.

Usage: new DAPIClient(options)
Description: This method creates a new DAPIClient instance.

Parameters:

parameterstyperequired[def value]Description
optionsObject
options.dapiAddressProviderDAPIAddressProviderno[ListDAPIAddressProvider]Allow to override the default dapiAddressProvider (do not allow seeds or dapiAddresses params)
options.seedsstring[]no[seeds]Allow to override default seeds (to connect to specific node)
options.networkstringno[=evonet]Allow to setup the network to be used (livenet, testnet, evonet,..)
options.timeoutnumberno[=2000]Used to specify the timeout time in milliseconds.
options.retriesnumberno[=3]Used to specify the number of retries before aborting and erroring a request.
options.baseBanTimenumberno[=6000]

Returns : DAPIClient instance.

const DAPIClient = require('@dashevo/dapi-client');
const client = new DAPIClient({
  timeout: 5000,
  retries: 3,
  network: 'livenet'
});

Notes:

  • Accessing the SimplifiedMasternodeListDAPIAddressProvider (or its overwrote instance), can be accessed via client.dapiAddressProvider.