New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tbc-lib-js

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tbc-lib-js - npm Package Compare versions

Comparing version 1.0.20 to 1.0.21

4

index.js

@@ -16,4 +16,4 @@ 'use strict'

}
tbc.versionGuard(globalThis._bsv)
globalThis._bsv = tbc.version
tbc.versionGuard(globalThis._tbc)
globalThis._tbc = tbc.version

@@ -20,0 +20,0 @@ // crypto

@@ -15,5 +15,5 @@ 'use strict'

var bsvErrors = require('./errors')
var errors = bsvErrors
var hdErrors = bsvErrors.HDPublicKey
var tbcErrors = require('./errors')
var errors = tbcErrors
var hdErrors = tbcErrors.HDPublicKey
var assert = require('assert')

@@ -31,3 +31,3 @@

*/
function HDPublicKey (arg) {
function HDPublicKey(arg) {
if (arg instanceof HDPublicKey) {

@@ -427,3 +427,3 @@ return arg

*/
HDPublicKey.prototype.toObject = HDPublicKey.prototype.toJSON = function toObject () {
HDPublicKey.prototype.toObject = HDPublicKey.prototype.toJSON = function toObject() {
return {

@@ -430,0 +430,0 @@ network: Network.get(this._buffers.version.readUInt32BE(0)).name,

@@ -14,5 +14,5 @@ 'use strict'

*/
function Network () {}
function Network() { }
Network.prototype.toString = function toString () {
Network.prototype.toString = function toString() {
return this.name

@@ -29,3 +29,3 @@ }

*/
function get (arg, keys) {
function get(arg, keys) {
if (~networks.indexOf(arg)) {

@@ -57,3 +57,3 @@ return arg

*/
function cashAddrPrefixToArray (cashAddrPrefix) {
function cashAddrPrefixToArray(cashAddrPrefix) {
var result = []

@@ -83,3 +83,3 @@ for (var i = 0; i < cashAddrPrefix.length; i++) {

*/
function addNetwork (data) {
function addNetwork(data) {
var network = new Network()

@@ -128,3 +128,3 @@

function indexNetworkBy (network, keys) {
function indexNetworkBy(network, keys) {
for (var i = 0; i < keys.length; i++) {

@@ -139,3 +139,3 @@ var key = keys[i]

function unindexNetworkBy (network, values) {
function unindexNetworkBy(network, values) {
for (var index = 0; index < values.length; index++) {

@@ -155,3 +155,3 @@ var value = values[index]

*/
function removeNetwork (network) {
function removeNetwork(network) {
for (var i = 0; i < networks.length; i++) {

@@ -173,3 +173,3 @@ if (networks[i] === network) {

var dnsSeeds = [
'seed.bitcoinsv.org',
'seed.tbcdev.org',
'seed.bitcoinunlimited.info'

@@ -197,5 +197,5 @@ ]

NETWORK_MAGIC: networkMagic.stn,
DNS_SEEDS: ['stn-seed.bitcoinsv.io'],
DNS_SEEDS: ['stn-seed.tbcdev.io'],
PREFIX: 'stn',
CASHADDRPREFIX: 'bsvstn'
CASHADDRPREFIX: 'tbcstn'
}

@@ -354,3 +354,3 @@

*/
function enableRegtest () {
function enableRegtest() {
testnet.regtestEnabled = true

@@ -364,3 +364,3 @@ }

*/
function disableRegtest () {
function disableRegtest() {
testnet.regtestEnabled = false

@@ -373,3 +373,3 @@ }

*/
function enableStn () {
function enableStn() {
testnet.stnEnabled = true

@@ -383,3 +383,3 @@ }

*/
function disableStn () {
function disableStn() {
testnet.stnEnabled = false

@@ -386,0 +386,0 @@ }

@@ -33,3 +33,3 @@ 'use strict'

*/
function Transaction (serialized) {
function Transaction(serialized) {
if (!(this instanceof Transaction)) {

@@ -137,3 +137,3 @@ return new Transaction(serialized)

if (this.version >= 10) {
return Hash.sha256sha256(this.newTxHeader().toBuffer())
return Hash.sha256sha256(this.newTxHeader().toBuffer())
}

@@ -178,4 +178,2 @@ return Hash.sha256sha256(this.toBuffer())

if (serializationError) {
serializationError.message += ' - For more information please see: ' +
'https://bsv.io/api/lib/transaction#serialization-checks'
throw serializationError

@@ -347,3 +345,3 @@ }

Transaction.prototype.toObject = Transaction.prototype.toJSON = function toObject () {
Transaction.prototype.toObject = Transaction.prototype.toJSON = function toObject() {
var inputs = []

@@ -381,3 +379,3 @@ this.inputs.forEach(function (input) {

Transaction.prototype.fromObject = function fromObject (arg) {
Transaction.prototype.fromObject = function fromObject(arg) {
$.checkArgument(_.isObject(arg) || arg instanceof Transaction)

@@ -1152,3 +1150,3 @@ var self = this

var hashData = Hash.sha256ripemd160(privKey.publicKey.toBuffer())
_.each(this.inputs, function forEachInput (input, index) {
_.each(this.inputs, function forEachInput(input, index) {
_.each(input.getSignatures(transaction, privKey, index, sigtype, hashData), function (signature) {

@@ -1155,0 +1153,0 @@ results.push(signature)

{
"name": "tbc-lib-js",
"version": "1.0.20",
"version": "1.0.21",
"description": "A library for tbc functionality",

@@ -5,0 +5,0 @@ "author": "Austin <austinwang149@gmail.com>",

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