How to use @liquality/client - 5 common examples

To help you get started, we’ve selected a few @liquality/client 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 / liquality-swap / .travis / liquality.io.testnet.config.js View on Github external
import Client from '@liquality/client'

const footerVersion = `${process.env.REACT_APP_TRAVIS_COMMIT || 'dev'}+${Client.version}`

export default {
  assets: {
    eth: {
      rpc: {
        url: 'https://rinkeby.infura.io/v3/3bbb5ebeb45e4b2b9a35261f272fb611'
      },
      network: 'rinkeby'
    },
    btc: {
      api: {
        url: 'https://blockstream.info/testnet/api'
      },
      feeNumberOfBlocks: 2,
      network: 'bitcoin_testnet'
    },
github liquality / liquality-swap / src / services / chainClient.js View on Github external
function createERC20Client (asset, wallet) {
  const assetConfig = config.assets[asset]
  const erc20Client = new Client()
  erc20Client.addProvider(new EthereumRpcProvider(
    assetConfig.rpc.url
  ))
  if (wallet === 'metamask') {
    erc20Client.addProvider(new EthereumMetaMaskProvider(web3.currentProvider, EthereumNetworks[assetConfig.network]))
  } else if (wallet === 'ethereum_ledger') {
    erc20Client.addProvider(new EthereumLedgerProvider({network: EthereumNetworks[assetConfig.network]}))
  }
  erc20Client.addProvider(new EthereumErc20Provider(assetConfig.contractAddress))
  erc20Client.addProvider(new EthereumErc20SwapProvider())
  return erc20Client
}
github liquality / liquality-swap / src / services / chainClient.js View on Github external
function createEthClient (asset, wallet) {
  const ethConfig = config.assets.eth
  const ethClient = new Client()
  ethClient.addProvider(new EthereumRpcProvider(
    ethConfig.rpc.url
  ))
  if (wallet === 'metamask') {
    ethClient.addProvider(new EthereumMetaMaskProvider(web3.currentProvider, EthereumNetworks[ethConfig.network]))
  } else if (wallet === 'ethereum_ledger') {
    ethClient.addProvider(new EthereumLedgerProvider({network: EthereumNetworks[ethConfig.network]}))
  }
  ethClient.addProvider(new EthereumSwapProvider())
  return ethClient
}
github liquality / liquality-swap / src / services / chainClient.js View on Github external
function createBtcClient (asset, wallet) {
  const btcConfig = config.assets.btc

  const btcClient = new Client()
  if (wallet && wallet.includes('bitcoin_ledger')) {
    let addressType
    if (wallet === 'bitcoin_ledger_legacy') {
      addressType = 'legacy'
    } else if (wallet === 'bitcoin_ledger_nagive_segwit') {
      addressType = 'bech32'
    }
    const ledger = new BitcoinLedgerProvider({network: BitcoinNetworks[btcConfig.network]}, addressType)

    if (window.useWebBle || localStorage.useWebBle) {
      ledger.useWebBle()
    }
    btcClient.addProvider(getBitcoinDataProvider(btcConfig))
    btcClient.addProvider(ledger)
    btcClient.addProvider(new BitcoinSwapProvider({network: BitcoinNetworks[btcConfig.network]}, btcConfig.swapMode))
  } else if (wallet === 'bitcoin_node') {
github liquality / liquality-swap / .travis / liquality.io.mainnet.config.js View on Github external
import Client from '@liquality/client'

const footerVersion = `${process.env.REACT_APP_TRAVIS_COMMIT || 'dev'}+${Client.version}`

export default {
  assets: {
    eth: {
      rpc: {
        url: 'https://mainnet.infura.io/v3/3bbb5ebeb45e4b2b9a35261f272fb611'
      },
      network: 'mainnet'
    },
    btc: {
      api: {
        url: 'https://blockstream.info/api'
      },
      feeNumberOfBlocks: 2,
      network: 'bitcoin'
    },

@liquality/client

Query different blockchains with account management using a single and simple interface.

MIT
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis

Popular @liquality/client functions

Similar packages