How to use the ambrosus-node-contracts.constants.ATLAS function in ambrosus-node-contracts

To help you get started, we’ve selected a few ambrosus-node-contracts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ambrosus / ambrosus-nop / test / actions / retire_action.js View on Github external
it('continue retirement and shows continue dialog for ATLAS with bundles', async () => {
    onboardMock.rolesWrapper.onboardedRole.resolves(constants.ATLAS),
    onboardMock.atlasStakeWrapper.isShelteringAny.resolves(true),
    atlasModeModelMock.getMode.resolves({mode:'retire'}),
    continueAtlasRetirementDialogStub.resolves({continueConfirmation: true});
    expect(await retireActionCall()).to.be.true;
    expect(retirementContinueDialogStub).to.be.calledOnce;
  });
github ambrosus / ambrosus-nop / test / actions / retire_action.js View on Github external
it('immediately returns false if confirmation was negative for ATLAS without bundles', async () => {
    onboardMock.rolesWrapper.onboardedRole.resolves(constants.ATLAS),
    confirmRetirementDialogStub.resolves({retirementConfirmation: false});
    expect(await retireActionCall()).to.be.false;
    expect(onboardMock.retire).to.be.not.called;
  });
github ambrosus / ambrosus-nop / src / builder.js View on Github external
objects.actions = {
      [messages.actions.changeUrl]: prepareAction(changeUrlAction(
        objects.stateModel,
        objects.rolesWrapper,
        objects.nectarWarningDialog,
        objects.askForNodeUrlDialog,
        objects.changeUrlConfirmationDialog,
        objects.changeUrlSuccessfulDialog),
      [constants.ATLAS, constants.HERMES]
      ),
      [messages.actions.payouts]: prepareAction(payoutAction(
        objects.payoutsActions,
        objects.availablePayoutDialog,
        objects.confirmPayoutWithdrawalDialog,
        objects.withdrawalSuccessfulDialog),
      [constants.ATLAS]
      ),
      [messages.actions.retire]: prepareAction(retireAction(
        objects.atlasModeModel,
        objects.onboardActions,
        objects.confirmRetirementDialog,
        objects.retirementSuccessfulDialog,
        objects.continueAtlasRetirementDialog,
        objects.retirementStartSuccessfulDialog,
        objects.retirementContinueDialog,
        objects.retirementStopDialog,
        objects.genericErrorDialog
      )),
      [messages.actions.quit]: prepareAction(quitAction())
    };

    objects.selectActionPhase = selectActionPhase(
github ambrosus / ambrosus-nop / src / menu_actions / retire_action.js View on Github external
const isAtlasWithBundles = async (onboardActions) => {
  const role = await onboardActions.rolesWrapper.onboardedRole(onboardActions.rolesWrapper.defaultAddress);
  if (role === constants.ATLAS) {
    return await onboardActions.atlasStakeWrapper.isShelteringAny(onboardActions.atlasStakeWrapper.defaultAddress);
  }
  return false;
};
github ambrosus / ambrosus-nop / src / consts.js View on Github external
/*
Copyright: Ambrosus Inc.
Email: tech@ambrosus.com

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.
*/

import {constants} from 'ambrosus-node-contracts';

export const APOLLO_CODE = constants.APOLLO;
export const HERMES_CODE = constants.HERMES;
export const ATLAS_CODE = constants.ATLAS;
export const NO_ROLE_CODE = constants.NONE;

export const ATLAS_1_STAKE = constants.ATLAS1_STAKE;
export const ATLAS_2_STAKE = constants.ATLAS2_STAKE;
export const ATLAS_3_STAKE = constants.ATLAS3_STAKE;

export const APOLLO = 'Apollo';
export const HERMES = 'Hermes';
export const ATLAS_1 = 'Atlas Zeta';
export const ATLAS_2 = 'Atlas Sigma';
export const ATLAS_3 = 'Atlas Omega';