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
  • Constructors
  • Methods
  1. Build
  2. Developer tools
  3. Haven1 SDK
  4. @haven1/sdk-api-client

Class: SdkModule

The SdkModule class provides methods to interact with the SDK API. It handles operations related to notifications, OTP submission, guardian transactions, and identity details.

PreviousClass: AuthModuleNext@haven1/blockchain-sdk

Last updated 4 months ago

Constructors

new SdkModule()

new SdkModule(config): SdkModule

Creates a new instance of the SdkModule.

Parameters

config

Config

The configuration object containing the SDK API URL.

Returns

SdkModule

Defined in

Methods

getClient()

getClient(): undefined | Client<paths, `${string}/${string}`>

Retrieves the OpenAPI client instance for making requests.

Returns

undefined | Client<paths, `${string}/${string}`>

The API client instance, or undefined if not initialized.

Defined in


getIdentityDetail()

getIdentityDetail(filters?): undefined | Promise<FetchResponse<{}, { params: { query: { filters: undefined | string; }; }; }, `${string}/${string}`>>

Retrieves current signed in user identity details with optional filters.

Parameters

filters?

string

Optional filters for fetching identity details.

Returns

undefined | Promise<FetchResponse<{}, { params: { query: { filters: undefined | string; }; }; }, `${string}/${string}`>>

The server response for the identity details, or undefined if the client is not initialized.

Defined in


getIdentityReferral()

getIdentityReferral(): undefined | Promise<FetchResponse<{}, undefined | FetchOptions<{}>, `${string}/${string}`>>

Fetches the identity referral information.

Returns

undefined | Promise<FetchResponse<{}, undefined | FetchOptions<{}>, `${string}/${string}`>>

A promise that resolves to the identity referral information.

Defined in


getNotifications()

getNotifications(limit, offset, filters): undefined | Promise<FetchResponse<{}, { params: { query: { filters: Record<string, never>; limit: string; offset: string; }; }; }, `${string}/${string}`>>

Fetches a list of notifications with optional filters, limit, and offset.

Parameters

limit

number

The maximum number of notifications to fetch.

offset

number

The number of notifications to skip for pagination.

filters

Record<string, string[]>

A record AppName and TxType of filters to apply.

Returns

undefined | Promise<FetchResponse<{}, { params: { query: { filters: Record<string, never>; limit: string; offset: string; }; }; }, `${string}/${string}`>>

The server response for the notifications, or undefined if the client is not initialized.

Defined in


guardianTransaction()

guardianTransaction(chainId, data, from, to, nonce, value): undefined | Promise<FetchResponse<{}, { body: { chainId: string; data: string; from: string; nonce: string; to: string; value: string; }; }, `${string}/${string}`>>

Submits a transaction for checking guardian requirements.

Parameters

chainId

string

The chain ID of the transaction.

data

string

The transaction data.

from

string

The sender's address.

to

string

The recipient's address.

nonce

string

The transaction nonce.

value

string

The transaction value.

Returns

undefined | Promise<FetchResponse<{}, { body: { chainId: string; data: string; from: string; nonce: string; to: string; value: string; }; }, `${string}/${string}`>>

The server response for guardian requirements, or undefined if the client is not initialized.

Defined in


submitOTP()

submitOTP(address, hash, otp): undefined | Promise<FetchResponse<{}, { body: { address: string; hash: string; otp: string; }; }, `${string}/${string}`>>

Submits a one-time password (OTP) for verification.

Parameters

address

string

The user's address.

hash

string

The tx hash of the OTP.

otp

string

The OTP to be submitted.

Returns

undefined | Promise<FetchResponse<{}, { body: { address: string; hash: string; otp: string; }; }, `${string}/${string}`>>

The server response for the OTP submission, or undefined if the client is not initialized.

Defined in

🧰
🛠️
🔌
module/sdk.ts:19
module/sdk.ts:34
module/sdk.ts:117
module/sdk.ts:132
module/sdk.ts:46
module/sdk.ts:91
module/sdk.ts:70