Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

frontblock

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frontblock - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

Utils.d.ts

4

FrontblockLib.d.ts

@@ -5,4 +5,3 @@ import { SubscriptionResponse, ErrorResponse, SuccessResponse } from "frontblock-generic/Service";

import { Payment, PaymentService } from "./PaymentService";
import { DollarValueProvider, FrontblockConf } from "./Types";
export declare const CryptocompareDollarValueProvider: DollarValueProvider;
import { FrontblockConf } from "./Types";
export declare class Frontblock implements PaymentService, FrontblockApi {

@@ -16,3 +15,2 @@ private subscriptionUIDs;

private conf;
private io;
private socket;

@@ -19,0 +17,0 @@ constructor(conf: FrontblockConf);

@@ -6,15 +6,6 @@ "use strict";

const Types_1 = require("./Types");
const Utils_1 = require("./Utils");
const bsock = require('bsock');
const fetch = require("node-fetch");
const uuid = require("uuid/v4");
exports.CryptocompareDollarValueProvider = async (coins) => {
const ret = new Map();
const request = await fetch("https://min-api.cryptocompare.com/data/pricemultifull?fsyms=" + coins.join(",") + "&tsyms=USD");
const result = await request.json();
const values = result["RAW"];
Types_1.CoinList.forEach(coin => {
ret.set(coin, values[coin]["USD"]["PRICE"]);
});
return ret;
};
class Frontblock {

@@ -26,5 +17,4 @@ constructor(conf) {

this.dollarValues = new Map();
this.dollarValueProvider = exports.CryptocompareDollarValueProvider;
this.dollarValueProvider = Utils_1.CryptocompareDollarValueProvider;
this.apikey = "";
this.io = bsock.createServer();
this.conf = conf;

@@ -194,6 +184,9 @@ if (conf.apiKey != null)

async unsubscribe(apikey, uid) {
const res = await this.socket.call('unsubscribe', apikey, uid);
return Service_1.parseResponse(res);
const r = await this.socket.call('unsubscribe', apikey, uid);
const res = Service_1.parseResponse(r);
if (res instanceof Service_1.SuccessResponse)
this.socket.unhook(uid);
return res;
}
}
exports.Frontblock = Frontblock;
{
"name": "frontblock",
"version": "0.0.4",
"version": "0.0.5",
"description": "frontblock shop-side library ",

@@ -17,5 +17,7 @@ "scripts": {

"@types/node": "^11.13.10",
"bitcoinjs-lib": "^5.0.4",
"bsock": "^0.1.9",
"express": "^4.16.4",
"frontblock-generic": "latest",
"hdkey": "^1.1.1",
"log4js": "^4.2.0",

@@ -22,0 +24,0 @@ "minimist": "^1.2.0",

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