mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-06-12 10:01:19 +00:00
auto-commit for 25207a77-d584-496e-ace0-d851f04d5a5c
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user