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

@dfns/lib-bitcoinjs

Package Overview
Dependencies
Maintainers
11
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfns/lib-bitcoinjs - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

6

index.d.ts
/// <reference types="node" />
import { DfnsApiClient } from '@dfns/sdk';
import { Psbt, SignerAsync } from 'bitcoinjs-lib';
import { Network, Psbt, SignerAsync } from 'bitcoinjs-lib';
export type DfnsWalletOptions = {

@@ -18,1 +18,5 @@ walletId: string;

}
export declare const litecoin: {
mainnet: Network;
testnet: Network;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DfnsWallet = void 0;
exports.litecoin = exports.DfnsWallet = void 0;
const sdk_1 = require("@dfns/sdk");
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
const compatibleNetworks = ['Bitcoin', 'BitcoinTestnet3', 'Litecoin', 'LitecoinTestnet'];
const assertSigned = (res) => {

@@ -26,4 +27,4 @@ if (res.status === 'Failed') {

}
if (res.network !== 'Bitcoin' && res.network !== 'BitcoinTestnet3') {
throw new sdk_1.DfnsError(-1, 'wallet is not bound to Bitcoin or BitcoinTestnet3', { walletId, network: res.network });
if (!compatibleNetworks.includes(res.network)) {
throw new sdk_1.DfnsError(-1, 'wallet is not bound to a Bitcoin compatible network', { walletId, network: res.network });
}

@@ -62,1 +63,26 @@ return new DfnsWallet(res, options);

exports.DfnsWallet = DfnsWallet;
/// Litecoin networks
exports.litecoin = {
mainnet: {
messagePrefix: '\x19Litecoin Signed Message:\n',
bech32: 'ltc',
bip32: {
public: 0x019da462,
private: 0x019d9cfe,
},
pubKeyHash: 0x30,
scriptHash: 0x32,
wif: 0xb0,
},
testnet: {
messagePrefix: '\x19Litecoin Signed Message:\n',
bech32: 'tltc',
bip32: {
public: 0x043587cf,
private: 0x04358394,
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef,
},
};

2

package.json
{
"name": "@dfns/lib-bitcoinjs",
"version": "0.3.1",
"version": "0.3.2",
"main": "./index.js",
"type": "commonjs"
}
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