• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

The transaction history made to the address via the Electrum Testnet wallet is not displayed

Moussa by Moussa
May 31, 2025
in Bitcoin
0
The transaction history made to the address via the Electrum Testnet wallet is not displayed
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


I am new to this business, so I apologize for such a possibly basic and stupid question, I tried to find any information, but I couldn’t.

Related articles

Eric Trump responds to Justin Sun’s WLFI Lawsuit with Banana Jab

Eric Trump responds to Justin Sun’s WLFI Lawsuit with Banana Jab

April 23, 2026
Bitcoin Has Likely Found Bottom—3 Indicators Make $100,000 Seem Much Nearer

Bitcoin Has Likely Found Bottom—3 Indicators Make $100,000 Seem Much Nearer

April 23, 2026

I made a number of transfers to the address shown in the following example.

1

I also have these transfers in my history, and they are marked as successful. For reference, I made a transfer from my wallet to the address that is linked to my\wallet.

2

I also have a connection to the test network.

3

In the wallet, as shown, everything is there, everything is fine, but when you try to check the information of my address, there is nothing there.

Here I checked the address through a special site.

4


I wrote a small program to check the history of the address, balance, but nothing is displayed there.

Connecting to Electrum server...
Successfully connected to Electrum server.
Address: tb1qc7j5j80s02gupl0qa3svg5kr99smjdq9a7yezd
ScriptHash: bb72dcabbea723d56aa49cd29575e53aaabf832f9dbdb45f251b56e187ce915a
Raw history response: []
Fetching transaction history...
Found 0 transactions.
Total balance for tb1qc7j5j80s02gupl0qa3svg5kr99smjdq9a7yezd: 0 satoshis (0 BTC)
Current block height: 900621
Disconnected from Electrum server.

Here is the code of the program itself:

import * as bitcoin from 'bitcoinjs-lib';
import { ElectrumClient, ElectrumClientEvents } from '@electrum-cash/network';

const ELECTRUM_HOST = 'blackie.c3-soft.com';
const ADDRESS = 'tb1qc7j5j80s02gupl0qa3svg5kr99smjdq9a7yezd';
const NETWORK = bitcoin.networks.testnet;

function addressToElectrumScriptHash(address: string, network: bitcoin.Network): string | null {
  try {
    const outputScript = bitcoin.address.toOutputScript(address, network);
    const hash = bitcoin.crypto.sha256(outputScript);
    return Buffer.from(hash.reverse()).toString('hex');
  } catch (e) {
    console.error(`Failed to convert address ${address} to scripthash: ${e.message}`);
    return null;
  }
}

async function debugScripthashHistory(client: ElectrumClient<ElectrumClientEvents>, scriptHash: string) {
  try {
    const history = await client.request('blockchain.scripthash.get_history', scriptHash);
    console.log('Raw history response:', JSON.stringify(history, null, 2));
  } catch (error) {
    console.error('Error fetching raw history:', error.message);
  }
}

async function checkAddress() {
  const client = new ElectrumClient(
    'Address Checker',
    '1.4.1',
    ELECTRUM_HOST,
  );

  try {
    console.log('Connecting to Electrum server...');
    await client.connect();
    console.log('Successfully connected to Electrum server.');

    const scriptHash = addressToElectrumScriptHash(ADDRESS, NETWORK);
    if (!scriptHash) {
      console.error('Failed to generate scripthash for address.');
      return;
    }
    console.log(`Address: ${ADDRESS}`);
    console.log(`ScriptHash: ${scriptHash}`);
    await debugScripthashHistory(client, scriptHash);

    console.log('Fetching transaction history...');
    const historyResult = await client.request('blockchain.scripthash.get_history', scriptHash);
    if (historyResult instanceof Error) {
      console.error(`Error fetching history: ${historyResult.message}`);
      return;
    }
    if (!Array.isArray(historyResult)) {
      console.error('Unexpected history response:', historyResult);
      return;
    }

    const history = historyResult as { tx_hash: string; height: number }[];
    console.log(`Found ${history.length} transactions.`);

    let totalBalance = 0;
    for (const tx of history) {
      const txHash = tx.tx_hash;
      console.log(`Processing transaction: ${txHash} (Block height: ${tx.height})`);

      const txDataResult = await client.request('blockchain.transaction.get', txHash, true);
      if (txDataResult instanceof Error) {
        console.error(`Error fetching transaction ${txHash}: ${txDataResult.message}`);
        continue;
      }
      if (!txDataResult || typeof txDataResult !== 'object') {
        console.error(`Invalid transaction data for ${txHash}`);
        continue;
      }

      const txData = txDataResult as { vout: { value: string; scriptPubKey: { hex: string } }[] };
      const outputScriptHex = bitcoin.address.toOutputScript(ADDRESS, NETWORK).toString('hex');

      for (const vout of txData.vout) {
        if (vout.scriptPubKey.hex === outputScriptHex) {
          const amount = Math.round(parseFloat(vout.value) * 1e8); // Конвертация BTC в сатоши
          totalBalance += amount;
          console.log(`Found output to address: ${amount} satoshis`);
        }
      }
    }

    console.log(`Total balance for ${ADDRESS}: ${totalBalance} satoshis (${totalBalance / 1e8} BTC)`);

    const blockHeightResponse = await client.request('blockchain.headers.subscribe');
    if (blockHeightResponse && typeof blockHeightResponse === 'object' && 'height' in blockHeightResponse) {
      console.log(`Current block height: ${blockHeightResponse.height}`);
    }

  } catch (error) {
    console.error('Error during address check:', error.message);
  } finally {
    try {
      await client.disconnect();
      console.log('Disconnected from Electrum server.');
    } catch (e) {
      console.error('Error during disconnection:', e.message);
    }
  }
}

checkAddress().catch(console.error);



Source link

Share76Tweet47

Related Posts

Eric Trump responds to Justin Sun’s WLFI Lawsuit with Banana Jab

Eric Trump responds to Justin Sun’s WLFI Lawsuit with Banana Jab

by Moussa
April 23, 2026
0

World Liberty Financial is under fire after Tron founder Justin Sun filed a federal lawsuit alleging fraud, breach of contract,...

Bitcoin Has Likely Found Bottom—3 Indicators Make $100,000 Seem Much Nearer

Bitcoin Has Likely Found Bottom—3 Indicators Make $100,000 Seem Much Nearer

by Moussa
April 23, 2026
0

Trusted Editorial content, reviewed by leading industry experts and seasoned editors. Ad Disclosure Bitcoin (BTC) has started to recover back...

How High Will The Price Be If Ripple Captures 50% Of SWIFT?

How High Will The Price Be If Ripple Captures 50% Of SWIFT?

by Moussa
April 23, 2026
0

The conversation around XRP’s long-term price potential has always gravitated toward one question: what happens when Ripple’s infrastructure meets global...

Pantera Capital Urges Satsuma To Dump All Bitcoin As Shares Collapse 99%

Pantera Capital Urges Satsuma To Dump All Bitcoin As Shares Collapse 99%

by Moussa
April 23, 2026
0

Pantera Capital is urging Satsuma Technology to liquidate its remaining bitcoin holdings and return capital to shareholders after a steep...

CLARITY Act Gains New Urgency as More Than 100 Crypto Organizations Urge Senate Action

CLARITY Act Gains New Urgency as More Than 100 Crypto Organizations Urge Senate Action

by Moussa
April 23, 2026
0

Key Takeaways: Over 100 organizations back CLARITY Act, pushing faster U.S. crypto legislation. Coinbase, Ripple, and Circle among signatories warning...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1/4"][vc_wp_categories]
[/vc_column][vc_column width="1/4"][vc_wp_tagcloud taxonomy="post_tag"][/vc_column][vc_column width="1/4"]

Newsletter

[vc_raw_html]JTNDcCUzRSUzQ2RpdiUyMGNsYXNzJTNEJTIydG5wJTIwdG5wLXN1YnNjcmlwdGlvbiUyMiUzRSUwQSUzQ2Zvcm0lMjBtZXRob2QlM0QlMjJwb3N0JTIyJTIwYWN0aW9uJTNEJTIyaHR0cHMlM0ElMkYlMkZhcHByb3gub3JnJTJGJTNGbmElM0RzJTIyJTNFJTBBJTBBJTNDaW5wdXQlMjB0eXBlJTNEJTIyaGlkZGVuJTIyJTIwbmFtZSUzRCUyMm5sYW5nJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1maXJzdG5hbWUlMjIlM0UlM0NsYWJlbCUyMGZvciUzRCUyMnRucC0xJTIyJTNFRmlyc3QlMjBuYW1lJTIwb3IlMjBmdWxsJTIwbmFtZSUzQyUyRmxhYm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yUyRmZvcm0lM0UlMEElM0MlMkZkaXYlM0UlM0NiciUyRiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News