1broker-client 中文文档教程

发布于 7年前 浏览 30 项目主页 更新于 3年前

1Broker-client Build Status

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!

这个库实现了所有 1Broker API 方法以及一些额外的特性:

Telegram bot

这个库中的所有这些功能都可以通过 @telebroker_bot 用于 Telegram,这样您就不必从你的命令行,使用机器人,所有的魔法都为你解决了,你会得到一些非常有趣的整洁的 REPL!

我还创建了一个 reddit 上的线程 来谈论它,我希望继续改进bot 并让 reddit 保持最新的功能。

请随时联系我或打开一个新问题

Installing

npm install --save 1broker-client

不幸的是新版本可能会倒退 兼容性,所以请确保您在 package.json 上指定了一个版本 文件。

basics

所有函数都将“回调”作为最后一个参数:

OneBroker = require( "1broker-client" )

client = OneBroker( "YOU_API_KEY" )

client.user.overview( function( error, overview ) {
  if( error ) return console.error( error );

  console.log( overview );
} );

需要参数的函数将把它们作为对象,例如:

client.market.quotes({
  symbols: "BTCUSD,GOLD"
}, function( error, quotes ) {
  console.log( quotes );
});

API V2 的所有方法都已实现

client.user.details( callback )
client.user.overview( callback )
client.user.bitcoin_deposit_address( callback )
client.user.transaction_log( params, callback )
client.user.quota_status( callback )

client.order.cancel( params, callback )
client.order.create( params, callback )
client.order.open( callback )

client.position.open( callback )
client.position.edit( params, callback )
client.position.close( params, callback )
client.position.close_cancel( params, callback )
client.position.history( params, callback )

client.market.categories( callback )
client.market.list( params, callback )
client.market.details( params, callback )
client.market.quotes( params, callback )
client.market.bars( params, callback )
client.market.ticks( params, callback )

For full API文档请参考官方API

examples

简单/examples 文件夹中提供了示例,包括 % 止损和获利语法。

在运行示例之前,您需要:

$ git clone https://github.com/flyingunicorn222/1broker-client.git
$ cd 1broker-client/
$ npm install
$ cd examples
# .env
KEY=Ac17f4de5...................b69a

现在您可以运行示例,例如:

$coffee long_eurusd.coffee

或者

$coffee short_btcusd.coffee

示例源代码很简单,请 继续探索吧!

===

我也在开发更多额外的功能,称为 "helpers" 这将 希望简化机械任务的实施。

todo

  • [x] Simple implementation
  • [x] Examples
  • [x] Tests
  • [ ] More Tests
  • [ ] Extra methods ( long, short, close, reverse, […] )
  • [ ] Documentation
  • [ ] Parameters validation
  • [ ] Please create an issue if you need something else

contributing

coding

源代码也很简单,不言自明所以随意 编辑并提交拉取请求。

目前需要更多的测试,希望使用 sinon.js 这样所有的测试都可以离线运行并且不需要花费硬币!

beta 测试

几乎所有功能(甚至更多)都可以通过我们的bot 获得,一些更高级的功能仍在测试中 如果您认为自己足够聪明,可以进行一些测试,请联系我们!

报告和请求

请打开一个问题!,我们将不胜感激。

捐赠

您可以捐赠以支持这个图书馆和更多免费赠品! 一些快乐的用户已经捐赠并表达了他们的爱,非常感谢和需要帮助,因为这个图书馆正在投入大量工作!

比特币: 1AsB6GtqUjHrLRXBzA19RMYyD7G9aVARbx

谢谢! 欢迎

get in touch

在 reddit 上给我发消息,我是 flyingunicorn222 或者开个issue!

thanks to

  • .com/user / warren / flibbr / crypt / earth / cache 用于硬核 beta 测试和支持

  • patrick@1broker.com 提供出色的支持和无尽的测试,并与

  • 来自 1Broker 的 Nick (@Bitpie) 讨论 1Broker Trollbox

  • 1Broker 是一个很棒的平台,为取得更大的成功而祈祷!

disclaimer

  • 虽然这不是官方 1Broker 客户端,但他们提供了很好的支持并解决了所有问题,非常友好和强大的支持!

  • 这个库的目标不仅是实现所有当前的 API 方法,而且还添加额外的功能来帮助周围的交易者,大部分额外功能都在 /helpers 文件夹中

  • 默认情况下,在创建订单时,这个库将使用我的 referral_id, 这意味着我将从 1Broker 收到少量 BTC 当您创建订单时! 请保持这种方式,以便我可以继续改进代码并使代码保持最新,感谢 1Broker 的交易, 没有这个,我将无法订购深夜披萨。

  • 本文档中的 1broker 链接包含我的推荐链接,如果您还没有帐户,请使用提供的链接。

1Broker-client Build Status

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:

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:

OneBroker = require( "1broker-client" )

client = OneBroker( "YOU_API_KEY" )

client.user.overview( function( error, overview ) {
  if( error ) return console.error( error );

  console.log( overview );
} );

Functions which need parameters will take them as object, for instance:

client.market.quotes({
  symbols: "BTCUSD,GOLD"
}, function( error, quotes ) {
  console.log( quotes );
});

All methods from API V2 have been implemented

client.user.details( callback )
client.user.overview( callback )
client.user.bitcoin_deposit_address( callback )
client.user.transaction_log( params, callback )
client.user.quota_status( callback )

client.order.cancel( params, callback )
client.order.create( params, callback )
client.order.open( callback )

client.position.open( callback )
client.position.edit( params, callback )
client.position.close( params, callback )
client.position.close_cancel( params, callback )
client.position.history( params, callback )

client.market.categories( callback )
client.market.list( params, callback )
client.market.details( params, callback )
client.market.quotes( params, callback )
client.market.bars( params, callback )
client.market.ticks( params, callback )

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:

$ git clone https://github.com/flyingunicorn222/1broker-client.git
$ cd 1broker-client/
$ npm install
$ cd examples
# .env
KEY=Ac17f4de5...................b69a

Now you can run examples, for instance:

$coffee long_eurusd.coffee

or

$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

  • [x] Simple implementation
  • [x] Examples
  • [x] 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

Thanks!

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.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文