@lightprotocol/stateless.js - v0.22.1-alpha.1
    Preparing search index...

    Class Rpc

    Hierarchy

    • Connection
      • Rpc

    Implements

    Index

    Constructors

    • Parameters

      • endpoint: string
      • compressionApiEndpoint: string
      • proverEndpoint: string
      • Optionalconfig: ConnectionConfig

      Returns Rpc

    Properties

    compressionApiEndpoint: string
    proverEndpoint: string
    allStateTreeInfos: TreeInfo[] | null = null
    lastStateTreeFetchTime: number | null = null
    CACHE_TTL: number = ...
    fetchPromise: Promise<TreeInfo[]> | null = null

    Methods

    • Ensure that the Compression Indexer has already indexed the transaction

      Parameters

      • slot: number

      Returns Promise<boolean>

    • Parameters

      • hashes: BN[] = []

        Array of BN254 hashes.

      • newAddresses: BN[] = []

        Array of BN254 new addresses.

      Returns Promise<ValidityProofWithContext>

      validity proof with context

      use getValidityProofV0 instead.

      Fetch the latest validity proof for (1) compressed accounts specified by an array of account hashes. (2) new unique addresses specified by an array of addresses.

      Validity proofs prove the presence of compressed accounts in state trees and the non-existence of addresses in address trees, respectively. They enable verification without recomputing the merkle proof path, thus lowering verification and data costs.

    • Fetch the latest validity proof for (1) compressed accounts specified by an array of account hashes. (2) new unique addresses specified by an array of addresses.

      Validity proofs prove the presence of compressed accounts in state trees and the non-existence of addresses in address trees, respectively. They enable verification without recomputing the merkle proof path, thus lowering verification and data costs.

      Parameters

      • hashes: HashWithTree[] = []

        Array of { hash: BN254, tree: PublicKey, queue: PublicKey }.

      • newAddresses: AddressWithTree[] = []

        Array of { address: BN254, tree: PublicKey, queue: PublicKey }.

      Returns Promise<ValidityProofWithContext>

      validity proof with context