Validating Deposits

This section describes how to listen to incoming transactions and decrypting notes.

Transaction Streams 

If your account is receiving transactions, you can use the Transaction Stream API (see here).

async function main(): Promise<void> {
  const config = JSON.parse((await fsAsync.readFile('.ironfish.config.json')).toString());
  const sdk = await IronfishSdk.init(config);
  const client = await sdk.connectRpc();

  const account = '<account incoming view key>';
  const confirmations = <confirmations>;
  const head = <head sequence>;

  const options = {
    account,
    confirmations,
    head,
  };

  const response = await client.wallet.getAccountTransactionsStream(options);
  for await (const content of response.contentStream()) {
    console.log(content);
  }
}

It's recommended to configure confirmations to be greater than 0 if you'd like confidence that a block has been confirmed with a low probability of a reorganization. The default value used in Iron Fish is 2, but you can increase this value for higher confidence.

Join our newsletter and stay up to date with privacy and crypto.

Discover our impactful presence — read our blog.

Use

  • Node App
  • Node CLI
  • Mine
  • Block Explorer
  • Ecosystem

Learn

  • Get Started
  • FAQ
  • Whitepaper
  • Tokenomics

Community

  • Foundation
  • Governance
  • Grants
  • Our Community

Developers

  • Documentation
  • Github
Privacy Policy

|

Media Kit

|

Copyright 2024 Iron Fish.