Labyrinth
WhitepaperResearchGet Private Access
  • 🔭Labyrinth Overview
    • Introduction
    • Why Labyrinth?
    • Who can use Labyrinth?
    • Reward and Fee in Labyrinth
    • Compliance
  • ⭐Use Labyrinth web App
    • How to use the Labyrinth app?
  • 📦Labyrinth SDK
    • ❓What is Labyrinth SDK?
    • ⚒️Quickstart
      • Setup Environment
      • Initialization
      • Private Transactions
      • Balance And Transaction History
      • Protocol Integration
    • 1️⃣Getting Started
    • 🔐Shielded Account
    • 📈Transaction
    • ▶️Initializing SDK
    • 💰Balances And History
    • 📤Sending Transaction
    • 🔌Integrating with DeFi Protocols
    • Labyrinth fee structure
  • Compliance Solution
    • Overview of Compliance
    • How Compliance Works
  • 💻CLI
    • ▶️Running SeDe CLI
  • Technical Implementation
    • Cryptographic Primitives
    • Shielded Account
    • Shielded Address
    • Account Abstraction
    • 🔵Core Architecture
      • 💵Note
      • 🌲Merkle Tree
      • 🔀JoinSplits
      • 🛡️Shielded Transaction
    • 🔄Protocol Interoperability
  • Resource and support
    • Roadmap
    • FAQs
    • Whitepaper
    • Selective De-Anonymization Compliance Paper
  • Contact and socials
    • Labyrinth Website
    • Twitter
    • Discord
    • Contact Us
Powered by GitBook
On this page
  • Balance
  • Transaction History
  1. Labyrinth SDK

Balances And History

Balance

Reading balances using an instance of SDK is simply calling getBalances() method of it.

const balances = await zkfi.getBalances();

The resulting balances in this case is a mapping of asset id to amount of that asset. E.g.

// balances (assetId -> amount)
{
    65537: 5000n,
    65538: 4n, 
    65539: 10203n,
    .
    .
    .
}

Transaction History

Reading the transaction history of a user is also as simple as calling getHistory() method:

const txHistory = await zkfi.getHistory();

The txHistory is a list of history items with multiple fields:

  • hash: The transaction hash identifying the transaction.

  • action: A string denoting the type of transaction like deposit, withdraw, receive, etc.

  • assets: The assets involved in the transaction.

  • timestamp: The timestamp of the transaction.

PreviousInitializing SDKNextSending Transaction

Last updated 1 year ago

📦
💰