用于vexbi.com的python api客户端库
vexbi的Python项目详细描述
用于Vexbiapi的python库。请阅读 关于如何开始使用 应用程序编程接口。
要求
- Python2.7.0+
- 吉特1.7.0+
开始
安装依赖项:
pip install -r requirements.txt
用法
#创建订单
/v2/订单
^{str1}$*发布*
摘要:创建买卖订单。描述:创建卖出/买入 命令。
参数
Name | Located in | Description | Required | Schem a |
---|---|---|---|---|
marke t | formData | Unique market id. It’s always in the form of xxxyyy, where xxx is the base currency code, yyy is the quote currency code, e.g. ‘btcusd’. All available markets can be found at /api/v2/mark ets. | Yes | strin g |
side | formData | Either ‘sell’ or ‘buy’. | Yes | strin g |
volum e | formData | The amount user want to sell/buy. An order could be partially executed, e.g. an order sell 5 btc can be matched with a buy 3 btc order, left 2 btc to be sold; in this case the order’s volume would be ‘5.0’, its remaining_v olume would be ‘2.0’, its executed volume is ‘3.0’. | Yes | strin g |
price | formData | Price for each unit. e.g. If you want to sell/buy 1 btc at 3000 usd, the price is ‘3000.0’ | No | strin g |
ord_ type | formData | The type of order, can be ^{tt1}$ or ^{tt2}$ | No (defaults to ^{tt2}$ | strin g |
响应
Code | Description |
---|---|
201 | Create a Sell/Buy order. |
#删除订单
/v2/订购/删除
^{str1}$*发布*
摘要:取消订单。说明:取消订单。
参数
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
id | formData | Unique order id. | Yes | integer |
响应
Code | Description |
---|---|
201 | Cancel an order. |
#全部清除
/v2/命令/清除
^{str1}$*发布*
摘要:取消我的所有订单。说明:取消所有我的 命令。
参数
Name | Located in | Description | Required | Schem a |
---|---|---|---|---|
side | formData | If present, only sell orders (asks) or buy orders (bids) will be canncelled. | No | strin g |
响应
Code | Description |
---|---|
201 | Cancel all my orders. |
#获得订单
/v2/订单
^{str1}$*获取*
摘要:获取订单,结果将分页。描述:获取 你的命令,结果是分页。
参数
Name | Located in | Description | Required | Schem a |
---|---|---|---|---|
marke t | query | Unique market id. It’s always in the form of xxxyyy, where xxx is the base currency code, yyy is the quote currency code, e.g. ‘btcusd’. All available markets can be found at /api/v2/mark ets. | Yes | strin g |
state | query | Filter order by state, default to ‘wait’ (active orders). | No | strin g |
limit | query | Limit the number of returned orders, default to 100. | No | integ er |
page | query | Specify the page of paginated results. | No | integ er |
order _by | query | If set, returned orders will be sorted in specific order, default to ‘asc’. | No | strin g |
响应
Code | Description |
---|---|
200 | Get your orders, results is paginated. |
#获取订单
/v2/顺序
^{str1}$*获取*
摘要:获取指定顺序的信息。描述:获取 指定顺序的信息。
参数
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
id | query | Unique order id. | Yes | integer |
#获取帐户信息
/v2/成员/me
^{str1}$*获取*
摘要:获取您的个人资料和帐户信息。描述:获取 你的个人资料和帐户信息。
响应
Code | Description |
---|---|
200 | Get your profile and accounts info. |
#获取可用市场
/v2/市场
^{str1}$*获取*
摘要:获取所有可用市场。
描述:获取所有可用市场。
响应
Code | Description |
---|---|
200 | Get all available markets. |
#票务
/v2/票务
^{str1}$*获取*
摘要:获取所有市场的股票代码。描述:获取 所有市场。
响应
Code | Description |
---|---|
200 | Get ticker of all markets. |
#交易
/v2/交易
^{str1}$*获取*
摘要:获取市场上最近的交易,每个交易仅包括在内 一次。交易按反向创建顺序排序。描述:获取 最近市场上的交易,每笔交易只包括一次。交易是 按相反的创建顺序排序。
参数
Name | Located in | Description | Required | Schem a |
---|---|---|---|---|
marke t | query | Unique market id. It’s always in the form of xxxyyy, where xxx is the base currency code, yyy is the quote currency code, e.g. ‘btcusd’. All available markets can be found at /api/v2/mark ets. | Yes | strin g |
limit | query | Limit the number of returned trades. Default to 50. | No | integ er |
times tamp | query | An integer represents the seconds elapsed since Unix epoch. If set, only trades executed before the time will be returned. | No | integ er |
from | query | Trade id. If set, only trades created after the trade will be returned. | No | integ er |
to | query | Trade id. If set, only trades created before the trade will be returned. | No | integ er |
order _by | query | If set, returned trades will be sorted in specific order, default to ‘desc’. | No | strin g |
响应
Code | Description |
---|---|
200 | Get recent trades on market, each trade is included only once. Trades are sorted in reverse creation order. |
#我的交易
/v2/交易/我的
^{str1}$*获取*
摘要:获取已执行的交易。交易按相反顺序排序 创建顺序。说明:获取已执行的交易。交易是 按相反的创建顺序排序。
参数。
Name | Located in | Description | Required | Schem a |
---|---|---|---|---|
marke t | query | Unique market id. It’s always in the form of xxxyyy, where xxx is the base currency code, yyy is the quote currency code, e.g. ‘btcusd’. All available markets can be found at /api/v2/mark ets. | Yes | strin g |
limit | query | Limit the number of returned trades. Default to 50. | No | integ er |
times tamp | query | An integer represents the seconds elapsed since Unix epoch. If set, only trades executed before the time will be returned. | No | integ er |
from | query | Trade id. If set, only trades created after the trade will be returned. | No | integ er |
to | query | Trade id. If set, only trades created before the trade will be returned. | No | integ er |
order _by | query | If set, returned trades will be sorted in specific order, default to ‘desc’. | No | strin g |
响应
Code | Description |
---|---|
200 | Get your executed trades. Trades are sorted in reverse creation order. |
测试
只需克隆repo,像在开发中一样安装依赖项 然后运行nose2或python setup.py test
贡献
- 分叉(https://github.com/vexbiexchange/python-api-client/fork)
- 创建功能分支(git checkout -bmy-new-feature)
- 提交更改(git commit -am 'Add some feature')
- 推到分支(git push origin my-new-feature)
- 创建新的拉取请求