@liquality/bitcoin-networks
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -1,2 +0,2 @@ | ||
(()=>{"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})(); | ||
(()=>{"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})(); | ||
//# 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; | ||
} | ||
@@ -18,10 +10,2 @@ declare const 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 }; | ||
export { BitcoinNetworks }; |
103
lib/index.ts
import { networks, Network as BitcoinJsLibNetwork } from 'bitcoinjs-lib' | ||
import { Network } from '@liquality/types' | ||
// Used for non-reusable peculiarities | ||
export enum ProtocolType { | ||
Bitcoin, | ||
BitcoinCash | ||
} | ||
export interface BitcoinNetwork extends Network, BitcoinJsLibNetwork {} | ||
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, | ||
@@ -33,6 +15,2 @@ coinType: '0', | ||
name: 'bitcoin_testnet', | ||
protocolType: ProtocolType.Bitcoin, | ||
feeBumpCapable: true, | ||
segwitCapable: true, | ||
usePSBT: true, | ||
...networks.testnet, | ||
@@ -45,6 +23,2 @@ coinType: '1', | ||
name: 'bitcoin_regtest', | ||
protocolType: ProtocolType.Bitcoin, | ||
feeBumpCapable: true, | ||
segwitCapable: true, | ||
usePSBT: true, | ||
...networks.regtest, | ||
@@ -61,75 +35,2 @@ coinType: '1', | ||
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 } | ||
export { BitcoinNetworks } |
{ | ||
"name": "@liquality/bitcoin-networks", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "", | ||
@@ -23,3 +23,3 @@ "module": "dist/index.js", | ||
"@babel/runtime": "^7.12.1", | ||
"@liquality/types": "^1.6.2", | ||
"@liquality/types": "^1.6.3", | ||
"bitcoinjs-lib": "^5.2.0" | ||
@@ -39,3 +39,3 @@ }, | ||
"sideEffects": false, | ||
"gitHead": "e8928f28e88d8b8733e41fec7f336bdb61b3bc1b" | ||
"gitHead": "6d81f0f452eb4bc855b42c11168f54b3ab52574f" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8650
41
Updated@liquality/types@^1.6.3