Transaction Status Tracking in Mobile Crypto Wallet

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Transaction Status Tracking in Mobile Crypto Wallet
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing Transaction Status Tracking in Mobile Crypto Wallet

Transaction sent — and user watches "Pending" status for the next 10 minutes. Normal for blockchain, but abnormal — not to receive notification when transaction confirmed or failed. Transaction status tracking — real-time task with multiple levels: blockchain polling, WebSocket connection, push notification on final status.

Transaction Lifecycle

Ethereum transaction goes through states: submitted → pending (mempool) → confirmed (1 confirmation) → finalized (12+ confirmations) → failed (reverted / dropped).

Bitcoin: mempool → 1 confirmation → 6 confirmations (finalized).

Solana — significantly faster: slots ~400ms, processed → confirmed → finalized in seconds.

On client need to show current state and confirmation count.

Status Retrieval Strategies

Polling via node RPC. Simplest option — check transaction status every N seconds:

// iOS — polling ETH transaction status via JSON-RPC
func pollTransactionStatus(txHash: String) async throws -> TransactionStatus {
    let params: [AnyEncodable] = [txHash, false]
    let receipt = try await ethClient.call(method: "eth_getTransactionReceipt", params: params)

    if receipt == nil {
        return .pending // Still in mempool
    }

    let confirmations = try await getConfirmationsCount(txHash: txHash)
    return confirmations >= requiredConfirmations ? .confirmed : .confirmingWith(count: confirmations)
}

Polling every 3–5 seconds when screen open — normal. In background — only via silent push or WebSocket.

WebSocket subscription via Alchemy / Infura / QuickNode. More efficient approach:

// Backend — event subscription via Alchemy WebSocket
const { createAlchemyWeb3 } = require("@alch/alchemy-web3");
const web3 = createAlchemyWeb3(process.env.ALCHEMY_WS_URL);

async function watchTransaction(txHash, userId) {
    const subscription = web3.eth.subscribe('newBlockHeaders');

    subscription.on('data', async (blockHeader) => {
        const receipt = await web3.eth.getTransactionReceipt(txHash);
        if (receipt) {
            subscription.unsubscribe();
            await updateTransactionStatus(txHash, receipt.status ? 'confirmed' : 'failed');
            await sendPushNotification(userId, txHash, receipt.status);
        }
    });
}

Alchemy and Infura also provide webhooks for transaction confirmation — backend doesn't maintain constant WS connection.

Mobile Client: Real-Time UI

On client — WebSocket connection to own backend for real-time status:

// Android — transaction status subscription via WebSocket
class TransactionStatusSocket(
    private val token: String,
    private val okHttpClient: OkHttpClient
) {
    fun subscribe(txHash: String): Flow<TransactionStatus> = callbackFlow {
        val ws = okHttpClient.newWebSocket(
            Request.Builder()
                .url("wss://api.yourwallet.app/ws/tx/$txHash")
                .header("Authorization", "Bearer $token")
                .build(),
            object : WebSocketListener() {
                override fun onMessage(webSocket: WebSocket, text: String) {
                    val status = json.decodeFromString<TransactionStatusUpdate>(text)
                    trySend(status.status)
                    if (status.isFinal) close()
                }
                override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
                    close(t)
                }
            }
        )
        awaitClose { ws.close(1000, "Subscription ended") }
    }
}

Confirmation Progress Indicator

For ETH — display progress to 12 confirmations:

struct ConfirmationProgressView: View {
    let current: Int
    let required: Int = 12

    var body: some View {
        VStack(alignment: .leading, spacing: 4) {
            ProgressView(value: Double(min(current, required)), total: Double(required))
                .tint(current >= required ? .green : .orange)
            Text("\(current)/\(required) confirmations")
                .font(.caption)
                .foregroundColor(.secondary)
        }
    }
}

Transaction design in different statuses:

  • pending — animated spinner, yellow accent
  • confirming — progress bar with confirmation count
  • confirmed — green checkmark, animation
  • failed — red, error reason if available (revert reason from receipt)

Push Notifications on Status Change

On final status — push to user:

{
  "title": "Transaction confirmed",
  "body": "0.05 ETH sent to 0x742d...3B8C",
  "data": {
    "screen": "transaction_detail",
    "tx_hash": "0xabc123...",
    "status": "confirmed"
  }
}

For failed transaction — separate template with description if known (revert reason or "dropped from mempool").

Handling Dropped Transactions

Transaction can "disappear" from mempool if gas price too low. After 15–30 minutes without confirmation — transaction considered dropped. Need to detect:

suspend fun checkDroppedTransactions() {
    val pendingTxs = transactionDao.getPendingOlderThan(minutes = 20)
    pendingTxs.forEach { tx ->
        val receipt = ethClient.getTransactionReceipt(tx.hash)
        if (receipt == null) {
            transactionDao.updateStatus(tx.hash, TransactionStatus.DROPPED)
            pushService.notifyUser(tx.userId, "Transaction didn't make it into a block", tx.hash)
        }
    }
}

Timeline

Implementing transaction status tracking with WebSocket real-time updates, confirmation progress indicator, push on final status, and handling dropped transactions — 6–10 working days.