```
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
This commit is contained in:
28
extensions/aitbc-wallet/content.js
Normal file
28
extensions/aitbc-wallet/content.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// Content script for AITBC Wallet extension
|
||||
(function() {
|
||||
// Inject the wallet API into the page
|
||||
const script = document.createElement('script');
|
||||
script.src = chrome.runtime.getURL('injected.js');
|
||||
script.onload = function() {
|
||||
this.remove();
|
||||
};
|
||||
(document.head || document.documentElement).appendChild(script);
|
||||
|
||||
// Listen for messages from the injected script
|
||||
window.addEventListener('message', function(event) {
|
||||
// Only accept messages from our own window
|
||||
if (event.source !== window) return;
|
||||
|
||||
if (event.data.type && event.data.type === 'AITBC_WALLET_REQUEST') {
|
||||
// Forward the request to the background script
|
||||
chrome.runtime.sendMessage(event.data, function(response) {
|
||||
// Send the response back to the page
|
||||
window.postMessage({
|
||||
type: 'AITBC_WALLET_RESPONSE',
|
||||
id: event.data.id,
|
||||
response: response
|
||||
}, '*');
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user