Socket
Socket
Sign inDemoInstall

@liquality/bitcoin-networks

Package Overview
Dependencies
Maintainers
5
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liquality/bitcoin-networks - npm Package Compare versions

Comparing version 1.1.9 to 1.2.0

2

dist/index.js

@@ -1,2 +0,2 @@

(()=>{"use strict";var t={175:function(t,e,i){var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.BitcoinNetworks=void 0;var r=i(264),o={bitcoin:n(n({name:"bitcoin"},r.networks.bitcoin),{coinType:"0",isTestnet:!1}),bitcoin_testnet:n(n({name:"bitcoin_testnet"},r.networks.testnet),{coinType:"1",isTestnet:!0}),bitcoin_regtest:n(n({name:"bitcoin_regtest"},r.networks.regtest),{coinType:"1",isTestnet:!0})};e.BitcoinNetworks=o},264:t=>{t.exports=require("bitcoinjs-lib")}},e={},i=function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}(175);module.exports=i})();
(()=>{"use strict";var e={175:function(e,t,i){var s=this&&this.__assign||function(){return(s=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BitcoinCashNetworks=t.BitcoinNetworks=t.ProtocolType=void 0;var o,n=i(264);!function(e){e[e.Bitcoin=0]="Bitcoin",e[e.BitcoinCash=1]="BitcoinCash"}(o=t.ProtocolType||(t.ProtocolType={}));var c={bitcoin:s(s({name:"bitcoin",protocolType:o.Bitcoin,feeBumpCapable:!0,segwitCapable:!0,usePSBT:!0},n.networks.bitcoin),{coinType:"0",isTestnet:!1}),bitcoin_testnet:s(s({name:"bitcoin_testnet",protocolType:o.Bitcoin,feeBumpCapable:!0,segwitCapable:!0,usePSBT:!0},n.networks.testnet),{coinType:"1",isTestnet:!0}),bitcoin_regtest:s(s({name:"bitcoin_regtest",protocolType:o.Bitcoin,feeBumpCapable:!0,segwitCapable:!0,usePSBT:!0},n.networks.regtest),{coinType:"1",isTestnet:!0})};t.BitcoinNetworks=c;var a={bitcoin_cash:{name:"bitcoin_cash",protocolType:o.BitcoinCash,prefix:"bitcoincash",feeBumpCapable:!1,segwitCapable:!1,usePSBT:!1,messagePrefix:"Bitcoin Signed Message:\n",bech32:"",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128,coinType:"145",isTestnet:!1},bitcoin_cash_testnet:{name:"bitcoin_cash_testnet",protocolType:o.BitcoinCash,prefix:"bchtest",feeBumpCapable:!1,segwitCapable:!1,usePSBT:!1,messagePrefix:"Bitcoin Signed Message:\n",bech32:"",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239,coinType:"146",isTestnet:!0},bitcoin_cash_regtest:{name:"bitcoin_cash_regtest",protocolType:o.BitcoinCash,prefix:"bchreg",feeBumpCapable:!1,segwitCapable:!1,usePSBT:!1,messagePrefix:"Bitcoin Signed Message:\n",bech32:"",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239,coinType:"146",isTestnet:!0}};t.BitcoinCashNetworks=a},264:e=>{e.exports=require("bitcoinjs-lib")}},t={},i=function i(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}(175);module.exports=i})();
//# sourceMappingURL=index.js.map
import { Network as BitcoinJsLibNetwork } from 'bitcoinjs-lib';
import { Network } from '@liquality/types';
export declare enum ProtocolType {
Bitcoin = 0,
BitcoinCash = 1
}
export interface BitcoinNetwork extends Network, BitcoinJsLibNetwork {
protocolType: ProtocolType;
segwitCapable: boolean;
feeBumpCapable: boolean;
usePSBT: boolean;
}

@@ -10,2 +18,10 @@ declare const BitcoinNetworks: {

};
export { BitcoinNetworks };
export interface BitcoinCashNetwork extends BitcoinNetwork {
prefix: string;
}
declare const BitcoinCashNetworks: {
bitcoin_cash: BitcoinCashNetwork;
bitcoin_cash_testnet: BitcoinCashNetwork;
bitcoin_cash_regtest: BitcoinCashNetwork;
};
export { BitcoinNetworks, BitcoinCashNetworks };
import { networks, Network as BitcoinJsLibNetwork } from 'bitcoinjs-lib'
import { Network } from '@liquality/types'
export interface BitcoinNetwork extends Network, BitcoinJsLibNetwork {}
// Used for non-reusable peculiarities
export enum ProtocolType {
Bitcoin,
BitcoinCash
}
export interface BitcoinNetwork extends Network, BitcoinJsLibNetwork {
protocolType: ProtocolType
segwitCapable: boolean
feeBumpCapable: boolean
// When true, the newer BitcoinJS API is used
// This should be false if the signature is created
// differently than Bitcoin
usePSBT: boolean
}
const bitcoin: BitcoinNetwork = {
name: 'bitcoin',
protocolType: ProtocolType.Bitcoin,
feeBumpCapable: true,
segwitCapable: true,
usePSBT: true,
...networks.bitcoin,

@@ -15,2 +33,6 @@ coinType: '0',

name: 'bitcoin_testnet',
protocolType: ProtocolType.Bitcoin,
feeBumpCapable: true,
segwitCapable: true,
usePSBT: true,
...networks.testnet,

@@ -23,2 +45,6 @@ coinType: '1',

name: 'bitcoin_regtest',
protocolType: ProtocolType.Bitcoin,
feeBumpCapable: true,
segwitCapable: true,
usePSBT: true,
...networks.regtest,

@@ -35,2 +61,75 @@ coinType: '1',

export { BitcoinNetworks }
export interface BitcoinCashNetwork extends BitcoinNetwork {
prefix: string
}
const bitcoin_cash: BitcoinCashNetwork = {
name: 'bitcoin_cash',
protocolType: ProtocolType.BitcoinCash,
prefix: 'bitcoincash',
feeBumpCapable: false,
segwitCapable: false,
usePSBT: false,
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: '',
bip32: {
// Networks.mainnet.xpubkey
public: 0x0488b21e,
// Networks.mainnet.xprivkey
private: 0x0488ade4
},
pubKeyHash: 0x00,
scriptHash: 0x05,
// Networks.mainnet.privatekey
wif: 0x80,
coinType: '145',
isTestnet: false
}
const bitcoin_cash_testnet: BitcoinCashNetwork = {
name: 'bitcoin_cash_testnet',
protocolType: ProtocolType.BitcoinCash,
prefix: 'bchtest',
feeBumpCapable: false,
segwitCapable: false,
usePSBT: false,
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: '',
bip32: {
public: 0x043587cf,
private: 0x04358394
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef,
coinType: '146',
isTestnet: true
}
const bitcoin_cash_regtest: BitcoinCashNetwork = {
name: 'bitcoin_cash_regtest',
protocolType: ProtocolType.BitcoinCash,
prefix: 'bchreg',
feeBumpCapable: false,
segwitCapable: false,
usePSBT: false,
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: '',
bip32: {
public: 0x043587cf,
private: 0x04358394
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef,
coinType: '146',
isTestnet: true
}
const BitcoinCashNetworks = {
bitcoin_cash,
bitcoin_cash_testnet,
bitcoin_cash_regtest
}
export { BitcoinNetworks, BitcoinCashNetworks }
{
"name": "@liquality/bitcoin-networks",
"version": "1.1.9",
"version": "1.2.0",
"description": "",

@@ -23,3 +23,3 @@ "module": "dist/index.js",

"@babel/runtime": "^7.12.1",
"@liquality/types": "^1.1.9",
"@liquality/types": "^1.2.0",
"bitcoinjs-lib": "^5.2.0"

@@ -39,3 +39,3 @@ },

"sideEffects": false,
"gitHead": "d061d92af771dd515a796890f016b12e19274386"
"gitHead": "2d92bbbc1d04d1624957f7288fff339d11ca6f80"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc