How to use @liquality/debug - 4 common examples

To help you get started, we’ve selected a few @liquality/debug 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 liquality / chainabstractionlayer / packages / metamask-provider / lib / MetaMaskProvider.js View on Github external
import { isFunction } from 'lodash'

import WalletProvider from '@liquality/wallet-provider'
import { formatEthResponse } from '@liquality/ethereum-utils'
import { WalletError } from '@liquality/errors'
import Debug from '@liquality/debug'

import { version } from '../package.json'

const debug = Debug('metamask')

export default class MetaMaskProvider extends WalletProvider {
  constructor (metamaskProvider, network) {
    super(network)

    if (!isFunction(metamaskProvider.sendAsync)) {
      throw new Error('Invalid MetaMask Provider')
    }

    this._metamaskProvider = metamaskProvider
    this._network = network
  }

  async metamask (method, ...params) {
    if (global.window) {
      await global.window.ethereum.enable() // Ensure access to MetaMask is granted
github liquality / chainabstractionlayer / packages / jsonrpc-provider / lib / JsonRpcProvider.js View on Github external
import axios from 'axios'
import JSONBigInt from 'json-bigint'
import { get, has } from 'lodash'

import Provider from '@liquality/provider'
import Debug from '@liquality/debug'
import { NodeError, RpcError } from '@liquality/errors'

import { version } from '../package.json'

const debug = Debug('jsonrpc')

const { parse } = JSONBigInt({ storeAsString: true, strict: true })

export default class JsonRpcProvider extends Provider {
  constructor (uri, username, password) {
    super()

    this._uri = uri

    this._axios = axios.create({
      baseURL: uri,
      responseType: 'text',
      transformResponse: undefined, // https://github.com/axios/axios/issues/907,
      validateStatus: (status) => true
    })
github liquality / chainabstractionlayer / packages / ledger-provider / lib / LedgerProvider.js View on Github external
import WalletProvider from '@liquality/wallet-provider'
import { WalletError } from '@liquality/errors'
import Debug from '@liquality/debug'

import getTransport from './LedgerNodeTransport'
import { version } from '../package.json'

const debug = Debug('ledger')

export default class LedgerProvider extends WalletProvider {
  static getTransport (config = { useWebBle: false }) {
    return getTransport(config)
  }

  static isSupported (config) {
    return getTransport(config).isSupported()
  }

  constructor (App, baseDerivationPath, network, ledgerScrambleKey) {
    super(network)

    this._App = App
    this._baseDerivationPath = baseDerivationPath
    this._network = network
github liquality / chainabstractionlayer / packages / ledger-provider / lib / LedgerProvider.js View on Github external
import WalletProvider from '@liquality/wallet-provider'
import { WalletError } from '@liquality/errors'
import Debug from '@liquality/debug'

import getTransport from './LedgerNodeTransport'
import { version } from '../package.json'

const debug = Debug('ledger')

export default class LedgerProvider extends WalletProvider {
  static getTransport (config = { useWebBle: false, useU2F: false }) {
    return getTransport(config)
  }

  static isSupported (config) {
    return getTransport(config).isSupported()
  }

  constructor (App, baseDerivationPath, network, ledgerScrambleKey) {
    super(network)

    this._App = App
    this._baseDerivationPath = baseDerivationPath
    this._network = network

@liquality/debug

[![Build Status](https://travis-ci.com/liquality/chainabstractionlayer.svg?branch=master)](https://travis-ci.com/liquality/chainabstractionlayer) [![Coverage Status](https://coveralls.io/repos/github/liquality/chainabstractionlayer/badge.svg?branch=master

MIT
Latest version published 2 years ago

Package Health Score

52 / 100
Full package analysis

Popular @liquality/debug functions

Similar packages