How to use the @liquality/crypto.base58.decode function in @liquality/crypto

To help you get started, we’ve selected a few @liquality/crypto 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 / bitcoin-bitcore-rpc-provider / lib / BitcoinBitcoreRpcProvider.js View on Github external
createScript (address) {
    address = addressToString(address)
    const type = base58.decode(address).toString('hex').substring(0, 2).toUpperCase()
    const pubKeyHash = addressToPubKeyHash(address)
    if (type === networks.bitcoin_testnet.pubKeyHash) {
      return [
        '76', // OP_DUP
        'a9', // OP_HASH160
        '14', // data size to be pushed
        pubKeyHash, // 
        '88', // OP_EQUALVERIFY
        'ac' // OP_CHECKSIG
      ].join('')
    } else if (type === networks.bitcoin_testnet.scriptHash) {
      return [
        'a9', // OP_HASH160
        '14', // data size to be pushed
        pubKeyHash, // 
        '87' // OP_EQUAL
github liquality / chainabstractionlayer / packages / bitcoin-ledger-provider / lib / BitcoinLedgerProvider.js View on Github external
createScript (address) {
    address = addressToString(address)

    const type = base58.decode(address).toString('hex').substring(0, 2).toUpperCase()
    const pubKeyHash = addressToPubKeyHash(address)
    if (type === this._network.pubKeyHash) {
      return [
        '76', // OP_DUP
        'a9', // OP_HASH160
        '14', // data size to be pushed
        pubKeyHash, // 
        '88', // OP_EQUALVERIFY
        'ac' // OP_CHECKSIG
      ].join('')
    } else if (type === this._network.scriptHash) {
      return [
        'a9', // OP_HASH160
        '14', // data size to be pushed
        pubKeyHash, // 
        '87' // OP_EQUAL

@liquality/crypto

[![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

Similar packages