From 5e30fa49d1c00a98a1086d0adf69d9c67335da4e Mon Sep 17 00:00:00 2001 From: Tomas Corellano Date: Sat, 5 Dec 2015 22:18:11 -0300 Subject: [PATCH 1/4] Remove ironrouter and client views --- bitfinex-api-tests.js | 5 ----- client/authenticate.html | 14 -------------- client/authenticate.js | 30 ------------------------------ client/dashboard.js | 0 client/router.js | 2 -- package.js | 15 ++++----------- 6 files changed, 4 insertions(+), 62 deletions(-) delete mode 100644 bitfinex-api-tests.js delete mode 100644 client/authenticate.html delete mode 100644 client/authenticate.js delete mode 100644 client/dashboard.js delete mode 100644 client/router.js diff --git a/bitfinex-api-tests.js b/bitfinex-api-tests.js deleted file mode 100644 index c5623d8..0000000 --- a/bitfinex-api-tests.js +++ /dev/null @@ -1,5 +0,0 @@ -// Write your tests here! -// Here is an example. -Tinytest.add('example', function (test) { - test.equal(true, true); -}); diff --git a/client/authenticate.html b/client/authenticate.html deleted file mode 100644 index 0121bf0..0000000 --- a/client/authenticate.html +++ /dev/null @@ -1,14 +0,0 @@ - - \ No newline at end of file diff --git a/client/authenticate.js b/client/authenticate.js deleted file mode 100644 index f85ab64..0000000 --- a/client/authenticate.js +++ /dev/null @@ -1,30 +0,0 @@ -var cb = function(error, result){ - if (error){ - console.log(error); - } - else { - Session.set('authenticated', true); - Router.go('dashboard'); - } -}; - -Template.authenticate.events({ - "submit form": function (event) { - event.preventDefault(); - // This function is called when the new task form is submitted - var key = event.target.api_key.value; - var secret = event.target.api_secret.value; - Meteor.call('bfx_auth', key, secret, cb); - // Clear form - event.target.api_key.value = ""; - event.target.api_secret.value = ""; - } -}); -//Template.registerHelper('mySession', function(input){ -// return Session.get(input); -//}); -Template.authenticate.helpers({ - authenticated: function () { - return Session.get("authenticated"); - } -}); \ No newline at end of file diff --git a/client/dashboard.js b/client/dashboard.js deleted file mode 100644 index e69de29..0000000 diff --git a/client/router.js b/client/router.js deleted file mode 100644 index 112bdd2..0000000 --- a/client/router.js +++ /dev/null @@ -1,2 +0,0 @@ - Router.route('/authenticate'); - Router.route('/dashboard'); \ No newline at end of file diff --git a/package.js b/package.js index b53766c..c7f6cce 100644 --- a/package.js +++ b/package.js @@ -1,10 +1,10 @@ Package.describe({ - name: 'mjr:bitfinex-api', + name: 'nevtep:bitfinex-api', version: '0.0.1', // Brief, one-line summary of the package. - summary: 'A simple wrapper that allows one to interact with bitfinex', + summary: 'A simple wrapper that allows one to interact with bitfinex, without dependency of iron router', // URL to the Git repository containing the source code for this package. - git: 'https://github.com/joshuarossi/bitfinex_api.git', + git: 'https://github.com/nevtep/bitfinex_api.git', // By default, Meteor will default to using README.md for documentation. // To avoid submitting documentation, set this field to null. documentation: 'README.md' @@ -12,15 +12,8 @@ Package.describe({ Package.onUse(function(api) { api.use(['http', 'mongo', 'livedata', 'meteor'], ['server']); - api.use(['templating', 'iron:router@1.0.9', 'meteor-platform']); + api.use(['meteor-platform']); api.versionsFrom('1.1.0.2'); api.addFiles(['bitfinex-api.js', 'server/methods.js'], 'server'); - api.addFiles(['client/authenticate.html', 'client/authenticate.js','client/router.js'], 'client'); api.export(['bitfinex', 'Bitfinex'], 'server'); }); - -Package.onTest(function(api) { - api.use('tinytest'); - api.use('mjr:bitfinex-api'); - api.addFiles('bitfinex-api-tests.js'); -}); \ No newline at end of file From dd4cd1ba5bbf0c889db19afb09bc8e0a1193f81e Mon Sep 17 00:00:00 2001 From: Tomas Corellano Date: Sat, 12 Dec 2015 07:28:39 -0300 Subject: [PATCH 2/4] Add crypto reference --- .versions | 117 +++++++++++++++++++++++++----------------------- bitfinex-api.js | 2 + 2 files changed, 62 insertions(+), 57 deletions(-) diff --git a/.versions b/.versions index 55fde45..65da0f8 100644 --- a/.versions +++ b/.versions @@ -1,57 +1,60 @@ -autoupdate@1.2.1 -base64@1.0.3 -binary-heap@1.0.3 -blaze@2.1.2 -blaze-tools@1.0.3 -boilerplate-generator@1.0.3 -callback-hook@1.0.3 -check@1.0.5 -ddp@1.1.0 -deps@1.0.7 -ejson@1.0.6 -fastclick@1.0.3 -geojson-utils@1.0.3 -html-tools@1.0.4 -htmljs@1.0.4 -http@1.1.0 -id-map@1.0.3 -iron:controller@1.0.8 -iron:core@1.0.8 -iron:dynamic-template@1.0.8 -iron:layout@1.0.8 -iron:location@1.0.9 -iron:middleware-stack@1.0.9 -iron:router@1.0.9 -iron:url@1.0.9 -jquery@1.11.3_2 -json@1.0.3 -launch-screen@1.0.2 -livedata@1.0.13 -local-test:mjr:bitfinex-api@0.0.1 -logging@1.0.7 -meteor@1.1.6 -meteor-platform@1.2.2 -minifiers@1.1.5 -minimongo@1.0.8 -mjr:bitfinex-api@0.0.1 -mobile-status-bar@1.0.3 -mongo@1.1.0 -observe-sequence@1.0.6 -ordered-dict@1.0.3 -random@1.0.3 -reactive-dict@1.1.0 -reactive-var@1.0.5 -reload@1.1.3 -retry@1.0.3 -routepolicy@1.0.5 -session@1.1.0 -spacebars@1.0.6 -spacebars-compiler@1.0.6 -templating@1.1.1 -tinytest@1.0.5 -tracker@1.0.7 -ui@1.0.6 -underscore@1.0.3 -url@1.0.4 -webapp@1.2.0 -webapp-hashing@1.0.3 +autoupdate@1.2.4 +babel-compiler@5.8.24_1 +babel-runtime@0.1.4 +base64@1.0.4 +binary-heap@1.0.4 +blaze@2.1.3 +blaze-tools@1.0.4 +boilerplate-generator@1.0.4 +caching-compiler@1.0.0 +caching-html-compiler@1.0.2 +callback-hook@1.0.4 +check@1.1.0 +ddp@1.2.2 +ddp-client@1.2.1 +ddp-common@1.2.2 +ddp-server@1.2.2 +deps@1.0.9 +diff-sequence@1.0.1 +ecmascript@0.1.6 +ecmascript-runtime@0.2.6 +ejson@1.0.7 +fastclick@1.0.7 +geojson-utils@1.0.4 +html-tools@1.0.5 +htmljs@1.0.5 +http@1.1.1 +id-map@1.0.4 +jquery@1.11.4 +launch-screen@1.0.4 +livedata@1.0.15 +logging@1.0.8 +meteor@1.1.10 +meteor-platform@1.2.3 +minifiers@1.1.7 +minimongo@1.0.10 +mobile-status-bar@1.0.6 +mongo@1.1.3 +mongo-id@1.0.1 +nevtep:bitfinex-api@0.0.1 +npm-mongo@1.4.39_1 +observe-sequence@1.0.7 +ordered-dict@1.0.4 +promise@0.5.1 +random@1.0.5 +reactive-dict@1.1.3 +reactive-var@1.0.6 +reload@1.1.4 +retry@1.0.4 +routepolicy@1.0.6 +session@1.1.1 +spacebars@1.0.7 +spacebars-compiler@1.0.7 +templating@1.1.5 +templating-tools@1.0.0 +tracker@1.0.9 +ui@1.0.8 +underscore@1.0.4 +url@1.0.5 +webapp@1.2.3 +webapp-hashing@1.0.5 diff --git a/bitfinex-api.js b/bitfinex-api.js index 80c8f3f..9d6a7a0 100644 --- a/bitfinex-api.js +++ b/bitfinex-api.js @@ -1,3 +1,5 @@ +crypto = Npm.require('crypto') + Bitfinex = function () { var _this = this; // Collections used to manage Bitfinex updating data From 00b2381551e29dba5843c2b1301ecdf2ad40a0a2 Mon Sep 17 00:00:00 2001 From: Tomas Corellano Date: Sat, 12 Dec 2015 07:31:45 -0300 Subject: [PATCH 3/4] updated version --- package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.js b/package.js index c7f6cce..4766511 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'nevtep:bitfinex-api', - version: '0.0.1', + version: '0.0.2', // Brief, one-line summary of the package. summary: 'A simple wrapper that allows one to interact with bitfinex, without dependency of iron router', // URL to the Git repository containing the source code for this package. From 4ccc2d69cf85de29219aaada51c8a606146828ee Mon Sep 17 00:00:00 2001 From: Tomas Corellano Date: Sat, 9 Jan 2016 02:48:58 -0300 Subject: [PATCH 4/4] Add withdraw method --- .versions | 2 +- bitfinex-api.js | 11 ++++++++++- package.js | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.versions b/.versions index 65da0f8..df045d1 100644 --- a/.versions +++ b/.versions @@ -36,7 +36,7 @@ minimongo@1.0.10 mobile-status-bar@1.0.6 mongo@1.1.3 mongo-id@1.0.1 -nevtep:bitfinex-api@0.0.1 +nevtep:bitfinex-api@0.0.2 npm-mongo@1.4.39_1 observe-sequence@1.0.7 ordered-dict@1.0.4 diff --git a/bitfinex-api.js b/bitfinex-api.js index 9d6a7a0..663cda7 100644 --- a/bitfinex-api.js +++ b/bitfinex-api.js @@ -260,7 +260,7 @@ Bitfinex = function () { params['until'] = until; } if (limit){ - params['until'] = until; + params['limit'] = limit; } if (wallet && ["trading", "exchange", "deposit"].indexOf(wallet) != -1){ params['wallet'] = wallet; @@ -365,6 +365,15 @@ Bitfinex = function () { var result = _this.makeAuthenticatedRequest(endpoint, {}); return result.data; }; + this.makeWithdrawal = function(type, wallet, amount, params) { + var endpoint = '/withdrawal'; + params.withdraw_type = type; + params.walletselected = wallet; + params.amount = amount; + var result = _this.makeAuthenticatedRequest(endpoint, params); + return result.data; + } + }; bitfinex = new Bitfinex(); console.log('You now have an instance of the bitfinex API object available'); \ No newline at end of file diff --git a/package.js b/package.js index 4766511..8339377 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'nevtep:bitfinex-api', - version: '0.0.2', + version: '0.0.3', // Brief, one-line summary of the package. summary: 'A simple wrapper that allows one to interact with bitfinex, without dependency of iron router', // URL to the Git repository containing the source code for this package.