Installations
npm install 1broker-client
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.2.1
NPM Version
5.3.0
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
CoffeeScript (58.71%)
JavaScript (39.81%)
Makefile (1.48%)
Developer
flyingunicorn222
Download Statistics
Total Downloads
132,203
Last Day
25
Last Week
114
Last Month
702
Last Year
6,146
GitHub Statistics
20 Stars
165 Commits
6 Forks
3 Watching
5 Branches
3 Contributors
Bundle Size
861.34 kB
Minified
231.26 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.11.1
Package Id
1broker-client@2.11.1
Unpacked Size
251.27 kB
Size
55.14 kB
File Count
97
NPM Version
5.3.0
Node Version
8.2.1
Total Downloads
Cumulative downloads
Total Downloads
132,203
Last day
-72.2%
25
Compared to previous day
Last week
-46%
114
Compared to previous week
Last month
-12.5%
702
Compared to previous month
Last year
-41.2%
6,146
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
1Broker-client ![Build Status](https://travis-ci.org/flyingunicorn222/1broker-client.png)
####This is a node.js wrapper for 1Broker's API, this package is mainly used and maintaned by @telebroker_bot an incredible bot to open orders and manage trades directly from Telegram !!!
####Join us at 1Broker Trollbox for some trades and trolling, feel free to use the group to ask anything about the bot, this library, 1Broker or even about the markets!
This library implements all 1Broker API methods and also a couple extra features:
- Stop Loss and Take Profit can be specified using % when opening orders
- Stop Loss and Take Profit can be specified as Points when opening orders
- Option to use "MAX", "HALF" or "QUARTER" as leverage, so it will dynamically adjust based on market leverage.
- Market information is cached on details.json allowing quick and smart calculations, for instance:
- How many points you making in your position?
- At what value will a reach that many points?
- How many percent a given difference represents with a given leverage?
- I want to use all those features together when creating a new orders
Telegram bot
All this functionality from this library is available through @telebroker_bot for Telegram, this way you don't have to run commands from your command line, using the bot all the magic is worked out for you and you get some sort of neat REPL which is tons of fun!
I also created a Thread on reddit to speak about it, i'll hopefully keep improving the bot and keeping reddit up to date with the features.
Feel free to contact me there or open a new issue!
Installing
npm install --save 1broker-client
Unfortunately new versions might break backwards compatibility so please make sure you specify a version on your package.json file.
basics
All functions take "callback" as last parameter:
1OneBroker = require( "1broker-client" ) 2 3client = OneBroker( "YOU_API_KEY" ) 4 5client.user.overview( function( error, overview ) { 6 if( error ) return console.error( error ); 7 8 console.log( overview ); 9} );
Functions which need parameters will take them as object, for instance:
1 2client.market.quotes({ 3 symbols: "BTCUSD,GOLD" 4}, function( error, quotes ) { 5 console.log( quotes ); 6}); 7
All methods from API V2 have been implemented
1client.user.details( callback ) 2client.user.overview( callback ) 3client.user.bitcoin_deposit_address( callback ) 4client.user.transaction_log( params, callback ) 5client.user.quota_status( callback ) 6 7client.order.cancel( params, callback ) 8client.order.create( params, callback ) 9client.order.open( callback ) 10 11client.position.open( callback ) 12client.position.edit( params, callback ) 13client.position.close( params, callback ) 14client.position.close_cancel( params, callback ) 15client.position.history( params, callback ) 16 17client.market.categories( callback ) 18client.market.list( params, callback ) 19client.market.details( params, callback ) 20client.market.quotes( params, callback ) 21client.market.bars( params, callback ) 22client.market.ticks( params, callback ) 23
For full API documentation please refer to the Official API
examples
Simple examples are provided on the /examples folder, including the % Stop Loss and Take Profit syntax.
Before running the examples you will need:
-
Api Token ( Create one in Settings )
-
Coffee-Script
npm install coffee-script --global
-
Download the example files
1$ git clone https://github.com/flyingunicorn222/1broker-client.git 2$ cd 1broker-client/ 3$ npm install 4$ cd examples
- Edit .env file and update with your key
1# .env 2KEY=Ac17f4de5...................b69a
Now you can run examples, for instance:
1$coffee long_eurusd.coffee
or
1$coffee short_btcusd.coffee
Examples source code is pretty simple, please go ahead an explore!
===
I'm also developing more extra functions, called "helpers" which will hopefully simplify the implementation of mechanical tasks.
todo
- Simple implementation
- Examples
- Tests
- More Tests
- Extra methods ( long, short, close, reverse, [...] )
- Documentation
- Parameters validation
- Please create an issue if you need something else
contributing
coding
The source code is also pretty simple and self explainatory so feel free to edit and submit a pull request.
At the moment more tests are needed, hopefully using sinon.js so all tests could run offline and without spending coins!
beta testing
Pretty much all features ( and even more ) are available through our bot, some of the more advanced features are still being beta tested if you think you are savy enough for some phun get in touch for some beta action!
reports and requests
Please open an issue!, it will be highly appreciated.
donate
You can donate to support this library and more freebies! a few happy users already donated and shown their love, the helped is much appreciated and needed as a lot of work is being invested on this library!
BTC: 1AsB6GtqUjHrLRXBzA19RMYyD7G9aVARbx
get in touch
Feel free to send me a message on reddit, I'm flyingunicorn222 or open an issue!
thanks to
-
meowgorithm / scarf / warren / flibbr / crypt / earth / cache for the hardcore beta test and support
-
patrick@1broker.com for the awesome support and endless tests and talks
-
Nick ( @Bitpie ) from 1Broker for the support on the 1Broker Trollbox
-
1Broker for the awesome platform, fingers crossed for even more success!
disclaimer
-
Altough this isn't an official 1Broker client, they provided great support and cleared all questions, very kind and great support!
-
The goal of this library is to not only implement all current API methods but also add extra features to help traders all around, most of the extras are on the /helpers folder
-
By default when creating an order this library will use my referral_id, that means I'll receive a small amount of BTC from 1Broker when you create an order! Please keep it this way so i can keep working on improving and keeping the code up to date, thanks to 1Broker for such a deal, without this i wouldn't be able to order late night pizzas.
-
1broker links on this documentation constains my referral link, in case you still don't have an account please use the links provided.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'v2'
Reason
65 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq
- Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq
- Warn: Project is vulnerable to: GHSA-vfrc-7r7c-w9mx
- Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-332q-7ff2-57h2
- Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-hr2v-3952-633q
- Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c
- Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm
- Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm
- Warn: Project is vulnerable to: GHSA-7px7-7xjx-hxm8
- Warn: Project is vulnerable to: GHSA-x5pg-88wf-qq4p
- Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4
- Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3
- Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7
- Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp
Score
1.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More