feat: add market stats endpoint, wallet integration, and browser wallet link - Update devnet genesis timestamp to 1767000206 - Add market statistics endpoint with 24h volume, price change, and payment counts - Add wallet balance and info API endpoints in exchange router - Remove unused SessionDep dependencies from exchange endpoints - Integrate real AITBC wallet extension connection in trade-exchange UI - Add market data fetching with API fallback for price and volume display - Add cache-busting query
3.3 KiB
3.3 KiB
AITBC Browser Wallet Extension
A browser extension that provides AITBC wallet functionality for interacting with the AITBC Trade Exchange and other dApps.
Features
- Wallet Management: Create new accounts or import existing private keys
- Secure Storage: Private keys are stored locally in the browser
- dApp Integration: Connect to AITBC Trade Exchange and other supported dApps
- Transaction Signing: Sign transactions and messages securely
- Balance Tracking: View your AITBC token balance
Installation
Development Installation
- Clone this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked"
- Select the
aitbc-walletfolder
Production Installation
The extension will be published to the Chrome Web Store. Installation instructions will be available once published.
Usage
Connecting to the Exchange
- Install the AITBC Wallet extension
- Navigate to https://aitbc.bubuit.net/Exchange
- Toggle the switch from "Demo Mode" to "Real Mode"
- Click "Connect AITBC Wallet"
- Approve the connection request in the popup
Managing Accounts
- Click the AITBC Wallet icon in your browser toolbar
- Use "Create New Account" to generate a new wallet
- Use "Import Private Key" to restore an existing wallet
- Important: Save your private key securely! It cannot be recovered if lost.
API Reference
The extension injects a window.aitbcWallet object into supported dApps with the following methods:
aitbcWallet.connect()
Connect the dApp to the wallet.
const response = await aitbcWallet.connect();
console.log(response.address); // User's AITBC address
aitbcWallet.getAccount()
Get the current account address.
const address = await aitbcWallet.getAccount();
aitbcWallet.getBalance(address)
Get the AITBC balance for an address.
const balance = await aitbcWallet.getBalance('aitbc1...');
console.log(balance.amount); // Balance in AITBC
aitbcWallet.sendTransaction(to, amount, data)
Send AITBC tokens to another address.
const tx = await aitbcWallet.sendTransaction('aitbc1...', 100);
console.log(tx.hash); // Transaction hash
aitbcWallet.signMessage(message)
Sign a message with the private key.
const signature = await aitbcWallet.signMessage('Hello AITBC!');
Security Considerations
- Private keys are stored locally in Chrome's storage
- Always verify you're on the correct domain before connecting
- Never share your private key with anyone
- Keep your browser and extension updated
Development
To modify the extension:
- Make changes to the source files
- Go to
chrome://extensions/ - Click the refresh button on the AITBC Wallet card
- Test your changes
File Structure
aitbc-wallet/
├── manifest.json # Extension configuration
├── content.js # Content script for dApp communication
├── injected.js # Script injected into dApps
├── popup.html # Extension popup UI
├── popup.js # Popup logic
├── icons/ # Extension icons
└── README.md # This file
Support
For issues or feature requests, please create an issue in the repository.