New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bituriparser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bituriparser

A parser for bitcoin URI strings

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

bitUriParser

A parser for bitcoin URI strings

Supports formats like PrivateKey, Address, Paymail, Bip21, Bip272, Bip275, Bip282

Released under "OPEN BSV-SPECIFIC LICENSE"

Install

NodeJS

    npm i --save bituriparser

Browser

    <script src="https://cdn.jsdelivr.net/npm/bituriparser@latest/bitUriParser.browserified.js"></script>

Use

    var bitUriParser = require("bituriparser");

    var bitUri = "bitcoin:1FMif2XbHJx5L2x6QWYKyWEWPpxJC1ipXw?sv=&amount=0.00123456&label=PayMe";
    var txRequestObject = await bitUriParser.parse(bitUri);

Output Format

{
    type: "string - URI type",
    outputs: [{
        script: "Hex Script 1",
        satoshis: 10000
    }, {
        script: "Hex Script 2",
        satoshis: 20000
    }],
    inputs: [{
        txid: "thxid of input 1",
        vout: 0,
        satoshis: 25561,
        scriptSig: "signature for this input"
    }, {
        txid: "thxid of input 2",
        vout: 5,
        satoshis: 562771,
        scriptSig: "signature for the input"
    }],
    memo: "Human Readable Message",
    isBSV: true, // If false, warn user about BTC protocol
    peer: "empty if not P2P protocol - peer if the payment should be sent to peer",
    peerProtocol: "empty if not P2P protocol - otherwise the name of the protocol, like 'bip270'"
}

Note

  • The library doesn't support BIP72 links. It will treat all BIP72 links as BIP272 links.

EXAMPLES

See examples.md

FAQs

Package last updated on 27 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts