INNER CODE UNIT · JavaScript

initServices

Adamant-im/adamant-tradebot · app.js:62

async function initServices() {
  try {
    // Watch ADM transactions to receive commands
    if (config.hasAdmPassphrase) {
      const adamantApi = require('./modules/adamantApi');
      const api = adamantApi();
      const txParser = require('./modules/admTxParser');

      if (config.socket) {
        api.initSocket(/** @type {AdamantInitSocketOptions} */ ({
          wsType: /** @type {AdamantWsType} */ (config.ws_type),
          admAddress: /** @type {AdamantAddress} */ (config.address),
          direction: 'incoming',
        }));
        api.socket.on(/** @type {AdamantAnyTransactionHandler} */ (/** @type {ParseAdmTx} */ (txParser)));
      }
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…