一个币安 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查看帮助
效果图
Metadata
Release files for nonebot-plugin-binance 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_binance-0.0.9.tar.gz | 41.9 kB | Without provenance | Details for nonebot_plugin_binance-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_binance-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_binance-0.0.9-py3-none-any.whl |
Total release size: 92.3 kB
Release files / nonebot_plugin_binance-0.0.9.tar.gz
| Download URL | nonebot_plugin_binance-0.0.9.tar.gz |
|---|---|
| Size | 41.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dffd920d97a8795b066e35292b5a018892a88eedfe377439c9e02e72b799b81c
|
|
BLAKE2b-256 checksum How to use checksums |
c02fc128937e997d5ae5fcbc78ccd07d943050692bfd8817a41c859cf1b5261d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / nonebot_plugin_binance-0.0.9-py3-none-any.whl
| Download URL | nonebot_plugin_binance-0.0.9-py3-none-any.whl |
|---|---|
| Size | 50.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58b3f9c0b7df64b41e274d6da45de79a480e903eaae4083d43d77ef73ca9fb4b
|
|
BLAKE2b-256 checksum How to use checksums |
b1655cf55f20d67a8b8ed65c6dbb5a5c05d1459bfef66c61f2376230b087059c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for nonebot-plugin-binance 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.