h-iranshahi/blockchain-based-wallet
Composer 安装命令:
composer require h-iranshahi/blockchain-based-wallet
包简介
A wallet management package based on blockchain
README 文档
README
Overview
The Wallet package provides a robust API for managing user wallets within the application. It enables users to perform operations such as checking balances, depositing and withdrawing funds, and transferring money between users. The package leverages blockchain technology to ensure the integrity and traceability of transactions.
Installation
To integrate the Wallet package into your Laravel project, follow these steps:
1. Install the Package via Composer
Install the Wallet package by running the following command in your Laravel project’s root directory:
composer require h-iranshahi/blockchain-based-wallet
Features
- User Authentication: All operations require user authentication via Laravel Sanctum.
- Wallet Operations:
- Balance Inquiry: Retrieve current wallet balance and transaction history.
- Deposits: Add funds to wallets with transaction logging.
- Withdrawals: Withdraw funds, with logging of all transactions.
- Transfers: Transfer funds between users, with validation and logging.
- Blockchain Integration: Records all transactions on the blockchain for security and transparency.
- Event Broadcasting: Notifies upon transaction creation for additional processing.
API Routes
Base URL
All API routes are prefixed with /api and require authentication.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/wallet/balance |
Get current balance and transaction history. |
| POST | /api/wallet/deposit |
Deposit funds into the wallet. |
| POST | /api/wallet/withdraw |
Withdraw funds from the wallet. |
| POST | /api/wallet/transfer |
Transfer funds between users. |
| GET | /blockchain/validate |
Validate the integrity of the blockchain. |
Blockchain Integration
- Transaction Recording: All transactions (deposit, withdrawal, transfer) are logged in the blockchain.
- Security and Transparency: Ensures the integrity and traceability of all wallet operations.
Testing
The package includes tests in the WalletControllerTest class, covering:
- Required fields validation for transfers.
- Error handling for insufficient funds.
- Successful transaction verification and balance updates.
- Testing invalid recipient IDs and amounts.
Conclusion
The Wallet package offers a secure and efficient method for users to manage their wallets, ensuring that all transactions are recorded transparently using blockchain technology.
License
This project is licensed under the MIT License.
h-iranshahi/blockchain-based-wallet 适用场景与选型建议
h-iranshahi/blockchain-based-wallet 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 11 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 h-iranshahi/blockchain-based-wallet 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 h-iranshahi/blockchain-based-wallet 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-06