LogoLogo
Duo SDK
  • Introduction
  • Overview
  • Code Stack
  • HOW TO
    • Silent Shard Duo SDK Example
      • Admin
      • Server Node
      • Client Node
        • React-Native
          • Installing Silent Shard Duo RN SDK
          • Quick start
          • Error handling
          • Hooks
            • useECDSAKeyGen
            • useECDSASignGen
            • useECDSAKeyRefresh
          • Functions
            • keyGenECDSA
            • signGenECDSA
            • keyRefreshECDSA
          • Classes
            • ECDSAP1PartyKeys class
            • ECDSAP1KeyshareV2 class
  • ADVANCED SETUP
    • Low Level API
      • Key Generation
      • Sign
      • Key Rotation
    • MPC + Account Abstraction Kits
      • Biconomy Smart Accounts
        • Quick Start
        • Using the CLI version
        • Experience this in a Biconomy x SL powered DApp
      • Stackup Account Abstraction SDK
        • Quick Start
        • Using the CLI version
        • Experience it in a Stackup x SL powered DApp
      • Resources
        • Structure of the repository
        • Integration and Hosting
  • REFERENCE
    • MetaMask Snap
    • Contact Us
Powered by GitBook
On this page
  • Import
  • Usage
  • Returns
  • isLoading: boolean
  • keyshare: ECDSAP1KeyshareV2 | undefined
  • error: DuoSDKError | undefined | unknow
  • keyRefresh: (params: { userToken: string, partyKey: ECDSAP1PartyKeys, keyshare: ECDSAP1KeyshareV2 }) => void
  • asyncKeyRefresh: (params: { userToken: string, partyKey: ECDSAP1PartyKeys, keyshare: ECDSAP1KeyshareV2 }) => Promise<ECDSAP1KeyshareV2>
  1. HOW TO
  2. Silent Shard Duo SDK Example
  3. Client Node
  4. React-Native
  5. Hooks

useECDSAKeyRefresh

Hook for refreshing ECDSA keyshare.

Import

import { useECDSAKeyRefresh } from '@silencelaboratories/react-native-duo-sdk';

Usage

const { 
  isLoading, 
  keyshare, 
  error,
  keyRefresh,
  asyncKeyRefresh
} = useECDSAKeyRefresh();

keyRefresh({
  userToken,
  partyKey,
  keyshare
})

Returns

isLoading: boolean

  • Indicates if the keyshare refresh is in progress.

keyshare: ECDSAP1KeyshareV2 | undefined

  • The refreshed keyshare.

  • The old keyshare would be replaced with the new keyshare. With the same keyId.

  • The old keyshare would be invalidated.

error: DuoSDKError | undefined | unknow

  • The error object if the keyshare refresh fails.

keyRefresh: (params: { userToken: string, partyKey: ECDSAP1PartyKeys, keyshare: ECDSAP1KeyshareV2 }) => void

  • userToken: string

    • The user JWT token.

  • partyKey: ECDSAP1PartyKeys

    • The party key object.

  • keyshare: ECDSAP1KeyshareV2

    • The keyshare to be refreshed.

  • The function to refresh the keyshare.

asyncKeyRefresh: (params: { userToken: string, partyKey: ECDSAP1PartyKeys, keyshare: ECDSAP1KeyshareV2 }) => Promise<ECDSAP1KeyshareV2>

  • similar to keyRefresh but returns a promise which can be awaited.

Last updated 1 year ago