一个币安(Binance)插件,提供行情、交易、资产查询和实时价格预警功能。
Project description
一个币安 NoneBot2 插件
📖 介绍
通过集成币安官方 API,为用户提供行情查询、K线图表、资产管理、实盘交易及价格监控等功能。
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-binance
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-binance
pdm
pdm add nonebot-plugin-binance
poetry
poetry add nonebot-plugin-binance
conda
conda install nonebot-plugin-binance
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_binance"]
⚙️ 配置
必填配置
在 nonebot2 项目的.env文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| binance_master_key | 是 | 无 | 用于加密用户API的主密钥 |
可选配置
在 nonebot2 项目的.env文件中添加下表中的可选配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| binance_api_proxy | 否 | 无 | 币安API的代理URL,如果您的服务器无法直接访问币安,请设置此项 |
| binance_renderer_proxy | 否 | 无 | 用于下载图片、字体等渲染资源的代理,如果服务器访问Github等网络不稳定,请设置此项 |
| binance_ws_proxy | 否 | 无 | 币安WebSocket的代理URL,如果需要的话 |
🎉 使用
主密钥
可以使用以下代码生成:
from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())
指令表
使用bn help查看帮助
效果图
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_binance-0.0.7.tar.gz.
File metadata
- Download URL: nonebot_plugin_binance-0.0.7.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
229cb8e395ed6e9dfba1627db31059448e1d38702245dd4b46c83586afdc5db4
|
|
| MD5 |
4f2e647a60f89c4e1ab5eae04379c9fd
|
|
| BLAKE2b-256 |
000c36e718bf51712866bfd4b19d0308a80cbc50f33b475e8ba6bb0ddea80b31
|
File details
Details for the file nonebot_plugin_binance-0.0.7-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_binance-0.0.7-py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
306679b1370bbe917155a91af5a9c3839f38aff4c5a6b383855c9e6c93013365
|
|
| MD5 |
0742aee073fe4fe342a4540c26713596
|
|
| BLAKE2b-256 |
33238378f5cee3d647f521d5ec140d022582ae5bed56ed1c0f1bd932fba3d126
|