LogoLogo
  • Sign Protocol
    • Introduction
    • FAQ
  • For Hackers
    • Getting Started
  • For Builders
    • Getting Started
      • Fundamentals
      • Tutorials
        • Building a Simple Notary Platform
          • Schema Creation
          • Attestation Creation
          • Querying Attestations
          • Parsing Attestation Data
        • Delegate Attestation Creation
          • Express Backend
          • Solidity
      • Examples
        • Attestation Discord Bot
        • KYC-Gated Smart Contract Access Control
    • Supported Networks
    • Sign Developer Platform
    • Advanced Topics
      • Cross Chain Attestations
      • Hybrid Attestations
      • Schema Hooks
        • Tutorial: Checking Attestation Data
          • Schema Creation
          • Schema Hook
          • Creating an Attestation (Solidity)
      • ZK Attestations
        • Compile a Circuit
        • Create a Schema Hook
    • Querying Data
      • NPM SDK
        • Usage & Examples
      • REST APIs
        • Schemas
        • Attestations
      • GraphQL
        • Schemas
        • Attestations
    • Writing Data
      • NPM SDK
        • Installation
        • Usage
          • Schemas
          • Attestations
        • Examples
        • Changelog
      • Smart Contract
        • EVM
          • Interfaces
            • ISP
            • ISPHook
            • IVersionable
          • Data Models
            • Schema
            • Attestation
            • DataLocation
  • For Thinkers
    • A Future Of Verifiable Trust
    • Effective Attestations
    • Incentive-Aligned Public Good
    • Glossary
      • Attestations
      • Schema
      • Schema Registry
      • Attestation Repository
  • Case Study
    • EthSign
    • KYC-Gated Contract Calls
    • Proof of Audit
    • Developer Onchain Reputation
    • Onboarding Web2 Data
Powered by GitBook
LogoLogo

Copyright Sign 2021-2024

On this page
  • Installation
  • Creating an Index Service Client

Was this helpful?

  1. For Builders
  2. Querying Data

NPM SDK

PreviousQuerying DataNextUsage & Examples

Last updated 10 months ago

Was this helpful?

Installation

Install the package to use the Sign Protocol SDK in your frontend or Node backend projects.

Creating an Index Service Client

new IndexService(env);

Parameters

Name
Type
Description

env

testnet, mainnet

Whether the indexing service should be querying testnets or mainnets.

Example

async function getSchemaListFromIndexService() {
  const indexService = new IndexService("testnet");
  const res = await indexService.querySchemaList({ page: 1 });
}

async function getSchemaFromIndexService() {
  const indexService = new IndexService("testnet");
  const res = await indexService.querySchema("onchain_evm_80001_0x1");
}

async function getAttestationListFromIndexService() {
  const indexService = new IndexService("testnet");
  const res = await indexService.queryAttestationList({ page: 1 });
}

async function getAttestationFromIndexService() {
  const indexService = new IndexService("testnet");
  const res = await indexService.queryAttestation("onchain_evm_80001_0x1");
}
@ethsign/sp-sdk