bepusdt 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,73 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Unit test / coverage reports
35
+ htmlcov/
36
+ .tox/
37
+ .nox/
38
+ .coverage
39
+ .coverage.*
40
+ .cache
41
+ nosetests.xml
42
+ coverage.xml
43
+ *.cover
44
+ *.py,cover
45
+ .hypothesis/
46
+ .pytest_cache/
47
+
48
+ # Virtual environments
49
+ venv/
50
+ env/
51
+ ENV/
52
+ env.bak/
53
+ venv.bak/
54
+
55
+ # IDEs
56
+ .vscode/
57
+ .idea/
58
+ *.swp
59
+ *.swo
60
+ *~
61
+
62
+ # OS
63
+ .DS_Store
64
+ Thumbs.db
65
+
66
+ # Version file
67
+ bepusdt/_version.py
68
+
69
+ # Internal docs (not for public)
70
+ IMPORTANT_NOTES.md
71
+ CONTRIBUTING.md
72
+ Makefile
73
+ .github/
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0] - 2024-12-23
9
+
10
+ ### Added
11
+ - 新增 `query_order()` 方法,支持查询订单状态
12
+ - 新增查询订单示例代码 `examples/query_order_example.py`
13
+ - 新增 `_get()` 内部方法支持 GET 请求
14
+
15
+ ### Changed
16
+ - 更新 README 文档,添加查询订单使用说明
17
+
18
+ ## [0.1.0] - 2024-12-23
19
+
20
+ ### Added
21
+ - 初始版本发布
22
+ - 支持创建支付订单(USDT/TRX/USDC)
23
+ - 支持 10+ 区块链网络
24
+ - 自动签名验证
25
+ - 完整的类型提示
26
+ - 订单取消功能
27
+ - 回调签名验证
28
+ - 自定义汇率支持
29
+ - Flask 和 FastAPI 集成示例
30
+
31
+ ### Fixed
32
+ - 修复 redirect_url 必需参数问题
33
+ - 修复 amount 参数类型导致的签名错误
34
+ - 优化签名算法,正确处理空值
35
+
36
+ [0.2.0]: https://github.com/luoyanglang/bepusdt-python-sdk/releases/tag/v0.2.0
37
+ [0.1.0]: https://github.com/luoyanglang/bepusdt-python-sdk/releases/tag/v0.1.0
bepusdt-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BEpusdt Python SDK Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include bepusdt *.py
4
+ prune tests
5
+ prune examples
bepusdt-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,179 @@
1
+ Metadata-Version: 2.4
2
+ Name: bepusdt
3
+ Version: 0.2.0
4
+ Summary: BEpusdt 支付网关 Python SDK - 支持 USDT/TRX/USDC 多链支付
5
+ Home-page: https://github.com/luoyanglang/bepusdt-python-sdk
6
+ Author: luoyanglang
7
+ Author-email: luoyanglang <luoyanglang@users.noreply.github.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/luoyanglang/bepusdt-python-sdk
10
+ Project-URL: Documentation, https://github.com/luoyanglang/bepusdt-python-sdk#readme
11
+ Project-URL: Repository, https://github.com/luoyanglang/bepusdt-python-sdk
12
+ Project-URL: Issues, https://github.com/luoyanglang/bepusdt-python-sdk/issues
13
+ Keywords: bepusdt,payment,usdt,trx,cryptocurrency,blockchain
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.7
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Requires-Python: >=3.7
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: requests>=2.25.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
31
+ Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
32
+ Requires-Dist: black>=22.0.0; extra == "dev"
33
+ Requires-Dist: flake8>=4.0.0; extra == "dev"
34
+ Requires-Dist: mypy>=0.950; extra == "dev"
35
+ Dynamic: author
36
+ Dynamic: home-page
37
+ Dynamic: license-file
38
+ Dynamic: requires-python
39
+
40
+ **❗️声明:本 SDK 为 BEpusdt 支付网关的非官方 Python 客户端库,仅供学习研究使用。使用本项目请遵守当地法律法规,任何违法违规使用产生的后果由使用者自行承担。**
41
+
42
+ ---
43
+
44
+ # BEpusdt Python SDK
45
+
46
+ <p align="center">
47
+ <a href="https://pypi.org/project/bepusdt/"><img src="https://badge.fury.io/py/bepusdt.svg" alt="PyPI version"></a>
48
+ <a href="https://pypi.org/project/bepusdt/"><img src="https://img.shields.io/pypi/pyversions/bepusdt.svg" alt="Python Support"></a>
49
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
50
+ <a href="https://github.com/v03413/bepusdt"><img src="https://img.shields.io/badge/BEpusdt-v1.22+-blue" alt="BEpusdt"></a>
51
+ </p>
52
+
53
+ ## 🪧 介绍
54
+
55
+ BEpusdt 支付网关的 Python SDK,让 Python 开发者能够快速集成 USDT/TRX/USDC 加密货币支付功能。
56
+
57
+ ## ✨ 特性
58
+
59
+ - 🎯 **简单易用** - 几行代码即可集成
60
+ - 🔐 **自动签名** - 内置签名生成和验证
61
+ - 🌐 **多链支持** - 支持 10+ 区块链网络
62
+ - 💰 **多币种** - USDT、USDC、TRX
63
+ - 📝 **类型提示** - 完整的 IDE 智能提示
64
+ - ✅ **生产就绪** - 经过真实环境测试
65
+ - 🔄 **完全兼容** - 完整支持 BEpusdt API
66
+
67
+ ## 🌟 支持的网络
68
+
69
+ ### USDT
70
+ 🔥 主流网络:Tron (TRC20) · Ethereum (ERC20) · BSC (BEP20) · Polygon
71
+ ⚡ 其他网络:Arbitrum · Solana · Aptos · X-Layer · Plasma
72
+
73
+ ### USDC
74
+ 🔥 主流网络:Tron (TRC20) · Ethereum (ERC20) · BSC (BEP20) · Polygon
75
+ ⚡ 其他网络:Arbitrum · Solana · Aptos · X-Layer · Base
76
+
77
+ ### 其他
78
+ 💎 TRX (Tron)
79
+
80
+ ## 📦 安装
81
+
82
+ ```bash
83
+ pip install bepusdt
84
+ ```
85
+
86
+ ## 🚀 快速开始
87
+
88
+ ```python
89
+ from bepusdt import BEpusdtClient, TradeType
90
+
91
+ # 初始化客户端
92
+ client = BEpusdtClient(
93
+ api_url="https://your-bepusdt-server.com",
94
+ api_token="your-api-token"
95
+ )
96
+
97
+ # 创建订单
98
+ order = client.create_order(
99
+ order_id="ORDER_001",
100
+ amount=10.0,
101
+ notify_url="https://your-domain.com/notify",
102
+ trade_type=TradeType.USDT_TRC20
103
+ )
104
+
105
+ print(f"💰 支付金额: {order.actual_amount} USDT")
106
+ print(f"📍 收款地址: {order.token}")
107
+ print(f"🔗 支付链接: {order.payment_url}")
108
+ ```
109
+
110
+ ## 📖 文档
111
+
112
+ - 📚 [完整文档](./docs/README.md)
113
+ - 📖 [API 参考](./docs/api.md)
114
+ - 💡 [使用示例](./docs/examples.md)
115
+ - ❓ [常见问题](./docs/faq.md)
116
+
117
+ ## 🔧 核心功能
118
+
119
+ ### 创建订单
120
+
121
+ ```python
122
+ order = client.create_order(
123
+ order_id="ORDER_001",
124
+ amount=10.0,
125
+ notify_url="https://your-domain.com/notify",
126
+ redirect_url="https://your-domain.com/success",
127
+ trade_type=TradeType.USDT_TRC20
128
+ )
129
+ ```
130
+
131
+ ### 查询订单
132
+
133
+ ```python
134
+ order = client.query_order(trade_id="xxx")
135
+ if order.status == OrderStatus.SUCCESS:
136
+ print("✅ 支付成功")
137
+ ```
138
+
139
+ ### 验证回调
140
+
141
+ ```python
142
+ @app.route('/notify', methods=['POST'])
143
+ def notify():
144
+ data = request.get_json()
145
+ if client.verify_callback(data):
146
+ # 处理支付成功
147
+ return "ok", 200
148
+ return "fail", 400
149
+ ```
150
+
151
+ ## 🏝️ 交流反馈
152
+
153
+ - 💬 Telegram: [@luoyanglang](https://t.me/luoyanglang)
154
+ - 📝 [提交 Issue](https://github.com/luoyanglang/bepusdt-python-sdk/issues)
155
+ - 🔗 [BEpusdt 官方群组](https://t.me/BEpusdtChat)
156
+
157
+ ## 🙏 感谢
158
+
159
+ - [BEpusdt](https://github.com/v03413/bepusdt) - 优秀的 USDT 支付网关
160
+ - [Epusdt](https://github.com/assimon/epusdt) - BEpusdt 的前身
161
+
162
+ ## 🔗 相关链接
163
+
164
+ - 🏠 [BEpusdt 官方](https://github.com/v03413/bepusdt)
165
+ - 📦 [PyPI 页面](https://pypi.org/project/bepusdt/)
166
+ - 💻 [GitHub 仓库](https://github.com/luoyanglang/bepusdt-python-sdk)
167
+ - 📋 [更新日志](./CHANGELOG.md)
168
+
169
+ ## 📄 许可证
170
+
171
+ [MIT License](LICENSE)
172
+
173
+ ## 📢 声明
174
+
175
+ 本项目仅供学习研究使用,使用过程中请遵守当地法律法规,任何违法违规使用产生的后果由使用者自行承担。
176
+
177
+ ---
178
+
179
+ Made with ❤️ for BEpusdt community
@@ -0,0 +1,140 @@
1
+ **❗️声明:本 SDK 为 BEpusdt 支付网关的非官方 Python 客户端库,仅供学习研究使用。使用本项目请遵守当地法律法规,任何违法违规使用产生的后果由使用者自行承担。**
2
+
3
+ ---
4
+
5
+ # BEpusdt Python SDK
6
+
7
+ <p align="center">
8
+ <a href="https://pypi.org/project/bepusdt/"><img src="https://badge.fury.io/py/bepusdt.svg" alt="PyPI version"></a>
9
+ <a href="https://pypi.org/project/bepusdt/"><img src="https://img.shields.io/pypi/pyversions/bepusdt.svg" alt="Python Support"></a>
10
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
11
+ <a href="https://github.com/v03413/bepusdt"><img src="https://img.shields.io/badge/BEpusdt-v1.22+-blue" alt="BEpusdt"></a>
12
+ </p>
13
+
14
+ ## 🪧 介绍
15
+
16
+ BEpusdt 支付网关的 Python SDK,让 Python 开发者能够快速集成 USDT/TRX/USDC 加密货币支付功能。
17
+
18
+ ## ✨ 特性
19
+
20
+ - 🎯 **简单易用** - 几行代码即可集成
21
+ - 🔐 **自动签名** - 内置签名生成和验证
22
+ - 🌐 **多链支持** - 支持 10+ 区块链网络
23
+ - 💰 **多币种** - USDT、USDC、TRX
24
+ - 📝 **类型提示** - 完整的 IDE 智能提示
25
+ - ✅ **生产就绪** - 经过真实环境测试
26
+ - 🔄 **完全兼容** - 完整支持 BEpusdt API
27
+
28
+ ## 🌟 支持的网络
29
+
30
+ ### USDT
31
+ 🔥 主流网络:Tron (TRC20) · Ethereum (ERC20) · BSC (BEP20) · Polygon
32
+ ⚡ 其他网络:Arbitrum · Solana · Aptos · X-Layer · Plasma
33
+
34
+ ### USDC
35
+ 🔥 主流网络:Tron (TRC20) · Ethereum (ERC20) · BSC (BEP20) · Polygon
36
+ ⚡ 其他网络:Arbitrum · Solana · Aptos · X-Layer · Base
37
+
38
+ ### 其他
39
+ 💎 TRX (Tron)
40
+
41
+ ## 📦 安装
42
+
43
+ ```bash
44
+ pip install bepusdt
45
+ ```
46
+
47
+ ## 🚀 快速开始
48
+
49
+ ```python
50
+ from bepusdt import BEpusdtClient, TradeType
51
+
52
+ # 初始化客户端
53
+ client = BEpusdtClient(
54
+ api_url="https://your-bepusdt-server.com",
55
+ api_token="your-api-token"
56
+ )
57
+
58
+ # 创建订单
59
+ order = client.create_order(
60
+ order_id="ORDER_001",
61
+ amount=10.0,
62
+ notify_url="https://your-domain.com/notify",
63
+ trade_type=TradeType.USDT_TRC20
64
+ )
65
+
66
+ print(f"💰 支付金额: {order.actual_amount} USDT")
67
+ print(f"📍 收款地址: {order.token}")
68
+ print(f"🔗 支付链接: {order.payment_url}")
69
+ ```
70
+
71
+ ## 📖 文档
72
+
73
+ - 📚 [完整文档](./docs/README.md)
74
+ - 📖 [API 参考](./docs/api.md)
75
+ - 💡 [使用示例](./docs/examples.md)
76
+ - ❓ [常见问题](./docs/faq.md)
77
+
78
+ ## 🔧 核心功能
79
+
80
+ ### 创建订单
81
+
82
+ ```python
83
+ order = client.create_order(
84
+ order_id="ORDER_001",
85
+ amount=10.0,
86
+ notify_url="https://your-domain.com/notify",
87
+ redirect_url="https://your-domain.com/success",
88
+ trade_type=TradeType.USDT_TRC20
89
+ )
90
+ ```
91
+
92
+ ### 查询订单
93
+
94
+ ```python
95
+ order = client.query_order(trade_id="xxx")
96
+ if order.status == OrderStatus.SUCCESS:
97
+ print("✅ 支付成功")
98
+ ```
99
+
100
+ ### 验证回调
101
+
102
+ ```python
103
+ @app.route('/notify', methods=['POST'])
104
+ def notify():
105
+ data = request.get_json()
106
+ if client.verify_callback(data):
107
+ # 处理支付成功
108
+ return "ok", 200
109
+ return "fail", 400
110
+ ```
111
+
112
+ ## 🏝️ 交流反馈
113
+
114
+ - 💬 Telegram: [@luoyanglang](https://t.me/luoyanglang)
115
+ - 📝 [提交 Issue](https://github.com/luoyanglang/bepusdt-python-sdk/issues)
116
+ - 🔗 [BEpusdt 官方群组](https://t.me/BEpusdtChat)
117
+
118
+ ## 🙏 感谢
119
+
120
+ - [BEpusdt](https://github.com/v03413/bepusdt) - 优秀的 USDT 支付网关
121
+ - [Epusdt](https://github.com/assimon/epusdt) - BEpusdt 的前身
122
+
123
+ ## 🔗 相关链接
124
+
125
+ - 🏠 [BEpusdt 官方](https://github.com/v03413/bepusdt)
126
+ - 📦 [PyPI 页面](https://pypi.org/project/bepusdt/)
127
+ - 💻 [GitHub 仓库](https://github.com/luoyanglang/bepusdt-python-sdk)
128
+ - 📋 [更新日志](./CHANGELOG.md)
129
+
130
+ ## 📄 许可证
131
+
132
+ [MIT License](LICENSE)
133
+
134
+ ## 📢 声明
135
+
136
+ 本项目仅供学习研究使用,使用过程中请遵守当地法律法规,任何违法违规使用产生的后果由使用者自行承担。
137
+
138
+ ---
139
+
140
+ Made with ❤️ for BEpusdt community
@@ -0,0 +1,8 @@
1
+ """BEpusdt Python SDK - USDT/TRX/USDC 支付网关客户端"""
2
+
3
+ from .client import BEpusdtClient
4
+ from .exceptions import BEpusdtError, SignatureError, APIError
5
+ from .models import Order, OrderStatus, TradeType
6
+
7
+ __version__ = "0.2.0"
8
+ __all__ = ["BEpusdtClient", "BEpusdtError", "SignatureError", "APIError", "Order", "OrderStatus", "TradeType"]