Haven1
  • Get started
    • 🧑‍🚀Welcome Havenauts!
    • 📄Haven1 Litepaper
    • 🧮H1 Tokenomics
  • Foundations of Haven1
    • 📐Architecture & network design
    • 🔐Network-level security
    • 📚Haven1 Core protocols
    • 💱Best in class liquidity
    • 👮Network Guardians: Firewall on Haven1
    • 🌉hBridge: Intro to Haven1 Bridge
  • Learn
    • 💵What does Haven1 solve?
    • 💡Haven1: Use Cases
    • 📚Understanding GoQuorum
    • 🔤Haven1 Blockchain basics
    • 🛂KYC policies on Haven1 blockchain
    • Security at Haven1
    • 🔓What is esH1?
    • ⚖️Dispute resolution mechanism
    • 🛣️Haven1 Roadmap
    • 🖥️Haven1 is EVM compatible
  • Products
    • 🔃hSwap - Spot DEX on Haven1
    • 📍hsETH on Haven1
    • Earn on Haven1
    • 🛡️2FA Wallet Shield
    • 🧊Haven1 block explorer
    • 🏛️Governance & veH1
    • 🆔hPassport - Key to Haven1
      • Advantages of having ID verification at a network level
      • Understanding the ID Verification Process
    • 💼Vesting esH1 - Converting esH1 to H1
    • 📍Staking H1 & esH1 - Earning rewards on your H1 holdings
      • Flexible Staking
      • Locked Staking
  • hPerpetuals - Perps DEX on Haven1
  • Haven1 Guides
    • 🔗Quick links
    • ✅Haven1 onboarding Guide
      • 🪪KYC Guide
      • Business KYC(KYB) Guide
    • Adding multiple wallets to a hPassport
    • 🌉Simple Bridging Guide on Haven1 network
    • 🏠Haven1 Portal - Your Gateway into Haven1
    • 🔑2FA Set up Guide
    • 🤑Haven1 Airdrop: Claim Process and Strategies
    • Claim Process Walkthrough on Team Finance
    • 📄Contract Addresses
  • Build
    • 📖Getting started
    • 🌐Haven1 Network information
    • 🍦Novel developer benefits on Haven1
    • 📑High level guide for secure deployment
    • ⚙️Detailed deployment Guide
    • 🧰Developer tools
      • 👛Haven1 Gnosis Safe wallet
      • 🛠️Haven1 SDK
        • 🔌@haven1/sdk-api-client
          • Class: Haven1SDK
          • Class: AuthModule
          • Class: SdkModule
        • ⛓️@haven1/blockchain-sdk
          • Contracts
        • 🧰@haven1/wagmi-sdk
          • Constant Module
            • Variable: haven1Devnet
            • Variable: haven1Testnet
            • Variable: H1
          • Contract Module
            • ProofOfIdentity
            • ProofOfIdentityV2
            • NativeAppFee
          • Utility Module
            • bigIntMax
            • formatBigint
            • bigintFromDecimals
          • Hook Module
            • useWatch
            • useBalance
            • useApproveERC20
            • useContractWrite
        • ⚛️@haven1/react-sdk
          • useHaven1SDK
          • useAuth
          • useIdentity
          • useNotifications
          • useOTP
          • useSignIn
        • 📜Use cases & Examples
          • Adding the Notification Component to Your React UI
          • Check Proof of Identity (POI) Status
      • Oracles on Haven1
      • Subgraph on Haven1
      • Haven1 block explorer
      • Web3 libraries and tools
    • Development frameworks
    • 🔐Using hPassport in Your dApps
      • Integrating hPassport into Your dApp
      • Implementing Identity Checks in Smart Contracts
        • Country codes
      • Sample Application - Country ID
      • Sample Application - Composable verification level
      • Sample Application - User type
      • Repository Information
    • ⛽Application fees
      • FeeContract.sol
      • Example FeeContract Interactions
      • Case Studies
    • 👷Builders grants program
  • Additional resources
    • 📚Haven1 terminology
  • Quick Links
    • Website
    • Twitter
    • Blog
    • Telegram
    • Customer Support
Powered by GitBook
On this page
  • Function: useIdentity()
  • Parameters
  • Returns
  • Defined in
  1. Build
  2. Developer tools
  3. Haven1 SDK
  4. @haven1/react-sdk

useIdentity

Function: useIdentity()

useIdentity(enabled?, filters?): object

Custom hook to fetch identity details and referral information using the Haven1 SDK.

Parameters

enabled?

boolean

Optional boolean to enable or disable the queries.

filters?

string[]

Optional array of filters to apply to the identity query.

Returns

object

identity

identity: UseQueryResult<undefined | FetchResponse<{ parameters: { cookie: undefined; header: undefined; path: undefined; query: { filters: string; }; }; requestBody: undefined; responses: { 200: { content: { application/json: { address: string; countryCode: null | string; countryOfResidence: null | string; createdAt: string; email: string; emailVerified: boolean; id: number; idIssuingCountry: null | string; name: null | string; nationality: null | string; proofOfLiveliness: null | boolean; referralCode: string; referredById: null | number; region: null | string; updatedAt: string; }; multipart/form-data: { address: string; countryCode: null | string; countryOfResidence: null | string; createdAt: string; email: string; emailVerified: boolean; id: number; idIssuingCountry: null | string; name: null | string; nationality: null | string; proofOfLiveliness: null | boolean; referralCode: string; referredById: null | number; region: null | string; updatedAt: string; }; text/plain: { address: string; countryCode: null | string; countryOfResidence: null | string; createdAt: string; email: string; emailVerified: boolean; id: number; idIssuingCountry: null | string; name: null | string; nationality: null | string; proofOfLiveliness: null | boolean; referralCode: string; referredById: null | number; region: null | string; updatedAt: string; }; }; headers: {}; }; 404: { content: { application/json: { error: string; }; multipart/form-data: { error: string; }; text/plain: { error: string; }; }; headers: {}; }; 500: { content: { application/json: { message: unknown; status: string; }; multipart/form-data: { message: unknown; status: string; }; text/plain: { message: unknown; status: string; }; }; headers: {}; }; }; }, { params: { query: { filters: undefined | string; }; }; }, `${string}/${string}`>, Error>

Query for fetching identity details.

referral

referral: UseQueryResult<undefined | FetchResponse<{ parameters: { cookie: undefined; header: undefined; path: undefined; query: undefined; }; requestBody: undefined; responses: { 200: { content: { application/json: { referralCode: string; unverified: { referredUsers: number; referredUsersLast7Days: number; }; verified: { referredUsers: number; referredUsersLast7Days: number; }; }; multipart/form-data: { referralCode: string; unverified: { referredUsers: number; referredUsersLast7Days: number; }; verified: { referredUsers: number; referredUsersLast7Days: number; }; }; text/plain: { referralCode: string; unverified: { referredUsers: number; referredUsersLast7Days: number; }; verified: { referredUsers: number; referredUsersLast7Days: number; }; }; }; headers: {}; }; 404: { content: { application/json: { error: string; }; multipart/form-data: { error: string; }; text/plain: { error: string; }; }; headers: {}; }; 500: { content: { application/json: { message: unknown; status: string; }; multipart/form-data: { message: unknown; status: string; }; text/plain: { message: unknown; status: string; }; }; headers: {}; }; }; }, undefined | FetchOptions<{ parameters: { cookie: undefined; header: undefined; path: undefined; query: undefined; }; requestBody: undefined; responses: { 200: { content: { application/json: { referralCode: ...; unverified: ...; verified: ...; }; multipart/form-data: { referralCode: ...; unverified: ...; verified: ...; }; text/plain: { referralCode: ...; unverified: ...; verified: ...; }; }; headers: {}; }; 404: { content: { application/json: { error: ...; }; multipart/form-data: { error: ...; }; text/plain: { error: ...; }; }; headers: {}; }; 500: { content: { application/json: { message: ...; status: ...; }; multipart/form-data: { message: ...; status: ...; }; text/plain: { message: ...; status: ...; }; }; headers: {}; }; }; }>, `${string}/${string}`>, Error>

Query for fetching identity referral information.

Defined in

PrevioususeAuthNextuseNotifications

Last updated 4 months ago

🧰
🛠️
⚛️
packages/react/src/api/hook/useIdentity.ts:8