Skip to content

A project for Copperx org to help them build a stablecoin bank and control everything using a Telegram Bot ( Search CopperxPay on Telegram )

Notifications You must be signed in to change notification settings

dodaa08/copperx-payout-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copperx Payout Telegram Bot

Overview

The Copperx Payout Telegram Bot (CopperxPay) allows users to manage USDC transactions directly through Telegram without visiting the Copperx web app. The bot integrates with the Copperx Payout API to facilitate deposits, withdrawals, and transfers.

Features

  • Authentication & Account Management: Secure login with Copperx credentials and KYC status checks.
  • Wallet Management: View balances, set default wallets, and check transaction history.
  • Fund Transfers: Send funds to email addresses, wallet addresses, or bank accounts.
  • Deposit Notifications: Real-time notifications for new deposits via Pusher.
  • Interactive UI: Command-based interaction with inline keyboards and natural language support.

Tech Stack

  • Backend: TypeScript/Node.js
  • API Integration: Copperx Payout API
  • Real-time Notifications: Pusher
  • Hosting: Render

Folder Structure

backend/
│
├── build/             # Compiled production code
├── dist/              # Distribution folder
├── node_modules/      # Node.js dependencies
├── .env               # Environment variables
├── .gitignore         # Git ignore file
├── nodemon.json       # Nodemon configuration
├── package.json       # Node.js package configuration
├── package-lock.json  # Lock file
├── tsconfig.json      # TypeScript configuration
└── src/               # Main TypeScript code

Installation

  1. Clone the repository:
git clone https://github.com/your-repo/copperx-payout-bot.git
  1. Install dependencies:
npm install
  1. Create a .env file in the root folder and add your environment variables:
COPPERX_API_KEY=your_api_key
PUSHER_KEY=your_pusher_key
PUSHER_CLUSTER=ap1
TELEGRAM_BOT_TOKEN=your_telegram_token
  1. Run the bot in development mode:
npm run dev

API Endpoints

Authentication

  • /api/auth/email-otp/request: Request OTP
  • /api/auth/email-otp/authenticate: Authenticate with OTP
  • /api/auth/me: User profile

Wallet Management

  • /api/wallets: Get wallets
  • /api/wallets/balances: Get balances
  • /api/wallets/default: Set default wallet
  • /api/transfers: Transaction history

Fund Transfers

  • /api/transfers/send: Email transfer
  • /api/transfers/wallet-withdraw: Wallet transfer
  • /api/transfers/offramp: Bank withdrawal
  • /api/transfers/send-batch: Bulk transfers

Deposit Notifications

  • /api/notifications/auth: Authenticate for Pusher

Security Considerations

  • Secure handling of user credentials and sensitive information
  • Proper error handling and user feedback
  • Session management and token refresh mechanism
git push render master

Contributing

  1. Fork the repository.
  2. Create a feature branch:
git checkout -b feature-name
  1. Commit your changes:
git commit -m "Add new feature"
  1. Push to the branch:
git push origin feature-name
  1. Open a pull request.

License

MIT License

Contact

About

A project for Copperx org to help them build a stablecoin bank and control everything using a Telegram Bot ( Search CopperxPay on Telegram )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published