ChatterPay is a Wallet for WhatsApp that integrates AI and Account Abstraction, enabling any user to use blockchain easily and securely without technical knowledge. This repository contains the Internet Computer backend implementation using Motoko.
Components:
- Landing Page (product, source code)
- User Dashboard Website (product, source code)
- Backend API (this Repo)
- Smart Contracts (source code)
- Data Indexing (Subgraph) (source code)
- Bot AI Admin Dashboard Website (product)
- Bot AI (Chatizalo) (product)
This repository contains the Internet Computer backend implementation using Motoko, providing a decentralized backend infrastructure for ChatterPay.
Built With:
- Platform: Internet Computer
- Language: Motoko
- Development Framework: DFX
- Interface Description: Candid
1. Install Requirements:
2. Clone repository:
git clone https://github.com/P4-Games/ChatterPay-ICP-Backend
cd ChatterPay-ICP-Backend
3. Install DFX:
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
4. Start Local Network:
dfx start --background
5. Deploy Canisters:
dfx deploy
The backend will be available at the provided canister URLs.
src/
:types.mo
: Shared type definitionstransactions/
: Transaction management canisterusers/
: User management canisterblockchains/
: Blockchain configuration canistertokens/
: Token management canisternfts/
: NFT management canisterlast_processed_blocks/
: Block processing tracking canister
dfx.json
: Project configuration file.gitignore
: Git ignore configurationREADME.md
: This file
The backend is composed of several specialized canisters:
-
TransactionStorage:
- Manages transaction records
- Tracks transaction status and history
- Provides transaction querying capabilities
-
UserStorage:
- Handles user profiles and authentication
- Manages wallet associations
- Phone number to wallet mapping
-
BlockchainStorage:
- Stores blockchain configurations
- Manages smart contract addresses
- Handles network-specific settings
-
TokenStorage:
- Manages token information
- Tracks token metadata
- Chain-specific token configurations
-
NFTStorage:
- Handles NFT minting and management
- Stores NFT metadata
- Manages NFT ownership and transfers
-
LastProcessedBlockStorage:
- Tracks blockchain synchronization
- Manages processing checkpoints
- Network-specific block tracking
Each canister exposes its API through Candid interfaces. Here are the main endpoints for each canister:
addTransaction
: Create a new transaction recordgetTransaction
: Retrieve transaction by IDgetTransactionsByWallet
: Get transactions for a specific walletgetAllTransactions
: List all transactions
createUser
: Register a new usergetUser
: Retrieve user informationgetWalletByPhoneNumber
: Get wallet address by phone numberupdateUser
: Update user information
createNFT
: Mint a new NFTgetNFT
: Retrieve NFT informationgetNFTsByWallet
: Get NFTs owned by a walletupdateNFTMetadata
: Update NFT metadata
For complete API documentation, deploy the canisters and visit the Candid interface.
To start development:
- Start local network:
dfx start --background
- Deploy canisters:
dfx deploy
- Test the API:
dfx canister call <canister_name> <method_name> '(<arguments>)'
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.