How to use the @colony/purser-core/normalizers.multipleOfTwoHexValueNormalizer function in @colony/purser-core

To help you get started, we’ve selected a few @colony/purser-core 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 JoinColony / purser / modules / node_modules / @colony / purser-trezor / staticMethods.js View on Github external
{
      /*
       * Path needs to be sent in as an derivation path array
       */
      address_n: fromString(
        derivationPathNormalizer(derivationPath),
        true,
      ).toPathArray(),
      /*
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      gas_price: multipleOfTwoHexValueNormalizer(gasPrice.toString(16)),
      /*
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      gas_limit: multipleOfTwoHexValueNormalizer(gasLimit.toString(16)),
      chain_id: chainId,
      /*
       * Nonces needs to be sent in as a hex string, and to be padded as a multiple of two.
       * Eg: '3' to be '03', `12c` to be `012c`
       *
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
github JoinColony / purser / modules / node_modules / @colony / purser-ledger / staticMethods.js View on Github external
*/
          r: hexSequenceNormalizer(
            multipleOfTwoHexValueNormalizer(String(SIGNATURE.R)),
          ),
          s: hexSequenceNormalizer(
            multipleOfTwoHexValueNormalizer(String(SIGNATURE.S)),
          ),
          v: hexSequenceNormalizer(
            /*
             * @TODO Add `bigNumber` `toHexString` wrapper method
             *
             * Flow confuses bigNumber's `toString` with the String object
             * prototype `toString` method
             */
            /* $FlowFixMe */
            multipleOfTwoHexValueNormalizer(chainId.toString(16)),
          ),
        },
        to ? { to: addressNormalizer(to) } : {},
      ),
      getChainDefinition(chainId),
    );
    /*
     * Sign the transaction object via your Ledger Wallet
     *
     * We also warn the user here, since the device will need confirmation, but only in dev mode.
     */
    warning(messages.userSignInteractionWarning);
    const {
      r: rSignatureComponent,
      s: sSignatureComponent,
      v: recoveryParameter,
github JoinColony / purser / modules / node_modules / @colony / purser-trezor / staticMethods.js View on Github external
* prototype `toString` method
       */
      /* $FlowFixMe */
      gas_limit: multipleOfTwoHexValueNormalizer(gasLimit.toString(16)),
      chain_id: chainId,
      /*
       * Nonces needs to be sent in as a hex string, and to be padded as a multiple of two.
       * Eg: '3' to be '03', `12c` to be `012c`
       *
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      nonce: multipleOfTwoHexValueNormalizer(nonce.toString(16)),
      /*
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      value: multipleOfTwoHexValueNormalizer(value.toString(16)),
      /*
       * Trezor service requires the prefix from the input data to be stripped
       */
      data: hexSequenceNormalizer(inputData, false),
    },
    /*
     * Only send (and normalize) the destingation address if one was
     * provided in the initial transaction object.
github JoinColony / purser / modules / node_modules / @colony / purser-trezor / staticMethods.js View on Github external
*
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      nonce: multipleOfTwoHexValueNormalizer(nonce.toString(16)),
      /*
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      value: multipleOfTwoHexValueNormalizer(value.toString(16)),
      /*
       * Trezor service requires the prefix from the input data to be stripped
       */
      data: hexSequenceNormalizer(inputData, false),
    },
    /*
     * Only send (and normalize) the destingation address if one was
     * provided in the initial transaction object.
     *
     * Trezor service requires the prefix from the address to be stripped
     */
    to ? { to: addressNormalizer(to, false) } : {},
  );
  /*
   * We need to catch the cancelled error since it's part of a normal user workflow
   */
github JoinColony / purser / modules / node_modules / @colony / purser-trezor / staticMethods.js View on Github external
/*
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      gas_price: multipleOfTwoHexValueNormalizer(gasPrice.toString(16)),
      /*
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      gas_limit: multipleOfTwoHexValueNormalizer(gasLimit.toString(16)),
      chain_id: chainId,
      /*
       * Nonces needs to be sent in as a hex string, and to be padded as a multiple of two.
       * Eg: '3' to be '03', `12c` to be `012c`
       *
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
       * prototype `toString` method
       */
      /* $FlowFixMe */
      nonce: multipleOfTwoHexValueNormalizer(nonce.toString(16)),
      /*
       * @TODO Add `bigNumber` `toHexString` wrapper method
       *
       * Flow confuses bigNumber's `toString` with the String object
github JoinColony / purser / modules / node_modules / @colony / purser-ledger / staticMethods.js View on Github external
* Flow confuses bigNumber's `toString` with the String object
             * prototype `toString` method
             */
            /* $FlowFixMe */
            multipleOfTwoHexValueNormalizer(value.toString(16)),
          ),
          data: hexSequenceNormalizer(inputData),
          /*
           * The transaction object needs to be seeded with the (R) and (S) signature components with
           * empty data, and the Reco(V)ery param as the chain id (all, im hex string format).
           *
           * See this issue for context:
           * https://github.com/LedgerHQ/ledgerjs/issues/43
           */
          r: hexSequenceNormalizer(
            multipleOfTwoHexValueNormalizer(String(SIGNATURE.R)),
          ),
          s: hexSequenceNormalizer(
            multipleOfTwoHexValueNormalizer(String(SIGNATURE.S)),
          ),
          v: hexSequenceNormalizer(
            /*
             * @TODO Add `bigNumber` `toHexString` wrapper method
             *
             * Flow confuses bigNumber's `toString` with the String object
             * prototype `toString` method
             */
            /* $FlowFixMe */
            multipleOfTwoHexValueNormalizer(chainId.toString(16)),
          ),
        },
        to ? { to: addressNormalizer(to) } : {},
github JoinColony / purser / modules / node_modules / @colony / purser-trezor / staticMethods.js View on Github external
*
         * Flow confuses bigNumber's `toString` with the String object
         * prototype `toString` method
         */
        /* $FlowFixMe */
        multipleOfTwoHexValueNormalizer(gasPrice.toString(16)),
      ),
      gasLimit: hexSequenceNormalizer(
        /*
         * @TODO Add `bigNumber` `toHexString` wrapper method
         *
         * Flow confuses bigNumber's `toString` with the String object
         * prototype `toString` method
         */
        /* $FlowFixMe */
        multipleOfTwoHexValueNormalizer(gasLimit.toString(16)),
      ),
      /*
       * Nonces needs to be sent in as a hex string, and to be padded as a multiple of two.
       * Eg: '3' to be '03', `12c` to be `012c`
       */
      nonce: hexSequenceNormalizer(
        /*
         * @TODO Add `bigNumber` `toHexString` wrapper method
         *
         * Flow confuses bigNumber's `toString` with the String object
         * prototype `toString` method
         */
        /* $FlowFixMe */
        multipleOfTwoHexValueNormalizer(nonce.toString(16)),
      ),
      value: hexSequenceNormalizer(
github JoinColony / purser / modules / node_modules / @colony / purser-trezor / staticMethods.js View on Github external
* Flow confuses bigNumber's `toString` with the String object
         * prototype `toString` method
         */
        /* $FlowFixMe */
        multipleOfTwoHexValueNormalizer(value.toString(16)),
      ),
      data: hexSequenceNormalizer(inputData),
      /*
       * The transaction object needs to be seeded with the (R) and (S) signature components with
       * empty data, and the Reco(V)ery param as the chain id (all, im hex string format).
       *
       * See this issue for context:
       * https://github.com/LedgerHQ/ledgerjs/issues/43
       */
      r: hexSequenceNormalizer(
        multipleOfTwoHexValueNormalizer(String(SIGNATURE.R)),
      ),
      s: hexSequenceNormalizer(
        multipleOfTwoHexValueNormalizer(String(SIGNATURE.S)),
      ),
      v: hexSequenceNormalizer(
        /*
         * @TODO Add `bigNumber` `toHexString` wrapper method
         *
         * Flow confuses bigNumber's `toString` with the String object
         * prototype `toString` method
         */
        /* $FlowFixMe */
        multipleOfTwoHexValueNormalizer(chainId.toString(16)),
      ),
    },
    getChainDefinition(chainId),