auto-commit for 25207a77-d584-496e-ace0-d851f04d5a5c

This commit is contained in:
emergent-agent-e1
2025-10-24 02:50:01 +00:00
parent df5c904339
commit cac3637e68
+11 -1
View File
@@ -3,10 +3,20 @@
* Handles all interactions with the PezkuwiChain blockchain via Polkadot.js
*/
import { ApiPromise, WsProvider } from '@polkadot/api';
import { Platform } from 'react-native';
import { CURRENT_CHAIN_CONFIG, ASSET_IDS } from '../constants/blockchain';
import { Balance, Transaction, Proposal } from '../types';
// Only import Polkadot.js on native platforms (not web) to avoid import.meta issues
let ApiPromise: any = null;
let WsProvider: any = null;
if (Platform.OS !== 'web') {
const polkadotApi = require('@polkadot/api');
ApiPromise = polkadotApi.ApiPromise;
WsProvider = polkadotApi.WsProvider;
}
class BlockchainService {
private api: ApiPromise | null = null;
private provider: WsProvider | null = null;