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

coinkraal-api-interface

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coinkraal-api-interface - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

interface/coin-market-cap.js

17

agent.js

@@ -10,2 +10,3 @@

this.apiRoot = apiRoot;
this.superagent = superagentPromise(_superagent, global.Promise);

@@ -16,3 +17,3 @@

this.superagent
.del(`${apiRoot}${url}`)
.del(getApi(url))
.use(tokenHandler)

@@ -23,3 +24,3 @@ .end(errorHandler)

this.superagent
.get(`${apiRoot}${url}`)
.get(getApi(url))
.use(tokenHandler)

@@ -30,3 +31,3 @@ .end(errorHandler)

this.superagent
.get(`${apiRoot}${url}`)
.get(getApi(url))
.use(tokenHandler)

@@ -37,3 +38,3 @@ .end(errorHandler)

this.superagent
.put(`${apiRoot}${url}`, body)
.put(getApi(url), body)
.use(tokenHandler)

@@ -44,3 +45,3 @@ .end(errorHandler)

this.superagent
.post(`${apiRoot}${url}`, body)
.post(getApi(url), body)
.use(tokenHandler)

@@ -57,4 +58,10 @@ .end(errorHandler)

getApi(api) {
if(api.indexOf('http') == -1)
return `${this.apiRoot}${api}`;
return api;
}
}
module.exports = Agent;
var Agent = require('./agent')
var Auth = require('./interface/auth')
var Coin = require('./interface/coin')
var CoinMarketCap = require('./interface/coin-market-cap')
var CryptoCompare = require('./interface/crypto-compare')
var Sale = require('./interface/sale')
var Social = require('./interface/social')
var Transaction = require('./interface/transaction')
var User = require('./interface/user')

@@ -12,2 +20,9 @@ class Api {

this.Auth = new Auth(agent);
this.Coin = new Coin(agent);
this.CoinMarketCap = new CoinMarketCap(agent);
this.CryptoCompare = new CryptoCompare(agent);
this.Sale = new Sale(agent);
this.Social = new Social(agent);
this.Transaction = new Transaction(agent);
this.User = new User(agent);
}

@@ -14,0 +29,0 @@ }

let PortfolioChartService = require('./services/portfolio-chart/portfolio-chart-service');
let Api = require('./api');
module.exports = PortfolioChartService;
module.exports = Api;

@@ -11,7 +11,7 @@

googleLogin(googleTokenId) {
return this.agent.requests.post('/auth/signin/google', { token: googleTokenId })
return this.agent.requests.post('/auth/signin/google', { token: googleTokenId });
}
facebookLogin(accessToken, email, userID, name, picture) {
return this.agent.requests.post('/auth/signin/facebook', { accessToken: accessToken, email: email, userId: userID, name: name, picture: picture })
return this.agent.requests.post('/auth/signin/facebook', { accessToken: accessToken, email: email, userId: userID, name: name, picture: picture });
}

@@ -18,0 +18,0 @@

@@ -5,5 +5,5 @@

describe('Auth()', function () {
describe('Auth', function () {
it('googleLogin - valid url', function (done) {
it('googleLogin()', function (done) {

@@ -28,3 +28,3 @@ //Given:

it('facebookLogin - valid url', function (done) {
it('facebookLogin()', function (done) {

@@ -31,0 +31,0 @@ //Given:

{
"name": "coinkraal-api-interface",
"version": "0.1.0",
"version": "0.2.0",
"description": "Api Interface for CoinKraal Applications",

@@ -5,0 +5,0 @@ "main": "index.js",

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