- Remove executable permissions from configuration files (.editorconfig, .env.example, .gitignore) - Remove executable permissions from documentation files (README.md, LICENSE, SECURITY.md) - Remove executable permissions from web assets (HTML, CSS, JS files) - Remove executable permissions from data files (JSON, SQL, YAML, requirements.txt) - Remove executable permissions from source code files across all apps - Add executable permissions to Python
AITBC Wallet Extension for Firefox
A Firefox browser extension that provides AITBC wallet functionality for interacting with the AITBC Trade Exchange and other dApps.
Differences from Chrome Version
This version is specifically built for Firefox with the following differences:
- Uses Manifest V2 (Firefox still requires V2 for full functionality)
- Uses
browser_actioninstead ofaction(V2 syntax) - Uses
chrome.runtime.connect()for background script communication - Background script uses persistent connections via ports
Installation
Development Installation
- Clone this repository
- Open Firefox and navigate to
about:debugging - Click "This Firefox" in the left sidebar
- Click "Load Temporary Add-on..."
- Select the
manifest.jsonfile from theaitbc-wallet-firefoxfolder
Production Installation
The extension will be published to the Firefox Add-on Store (AMO). Installation instructions will be available once published.
Usage
The usage is identical to the Chrome version:
- 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
Features
- Wallet Management: Create new accounts or import existing private keys
- Secure Storage: Private keys are stored locally in Firefox's storage
- 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
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 Firefox'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
about:debuggingin Firefox - Find "AITBC Wallet" and click "Reload"
- Test your changes
File Structure
aitbc-wallet-firefox/
├── manifest.json # Extension configuration (Manifest V2)
├── background.js # Background script for wallet operations
├── 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
Firefox-Specific Notes
- Firefox requires Manifest V2 for extensions that use content scripts in this manner
- The
browser_actionAPI is used instead of the neweractionAPI - Background scripts use port-based communication for better performance
- Storage APIs use
chrome.storagewhich is compatible with Firefox
Troubleshooting
Extension not loading
- Ensure you're loading the
manifest.jsonfile, not the folder - Check the Browser Console for error messages (
Ctrl+Shift+J)
dApp connection not working
- Refresh the dApp page after installing/updating the extension
- Check that the site is in the
matchespattern in manifest.json - Look for errors in the Browser Console
Permission errors
- Firefox may show additional permission prompts
- Make sure to allow all requested permissions when installing