Class BlockinChallenge<T>

Type Parameters

Hierarchy (view full)

Implements

Constructors

Properties

address: string

The user's address

allowReuseOfBitBadgesSignIn?: boolean

Whether to allow reuse of BitBadges sign in

The chain of the address

cosmosAddress: string

The converted Cosmos address of params.address. This can be used as the unique identifier for the user (e.g. avoid duplicate sign ins from equivalent 0x and cosmos1 addresses).

message: string

The corresponding message that was signed to obtain the signature.

options?: VerifyChallengeOptions
otherSignIns?: {
    discord?: {
        discriminator?: string;
        id: string;
        username: string;
    };
    github?: {
        id: string;
        username: string;
    };
    google?: {
        id: string;
        username: string;
    };
    twitter?: {
        id: string;
        username: string;
    };
}

Other sign-ins that were requested

Type declaration

  • Optional discord?: {
        discriminator?: string;
        id: string;
        username: string;
    }
    • Optional discriminator?: string
    • id: string
    • username: string
  • Optional github?: {
        id: string;
        username: string;
    }
    • id: string
    • username: string
  • Optional google?: {
        id: string;
        username: string;
    }
    • id: string
    • username: string
  • Optional twitter?: {
        id: string;
        username: string;
    }
    • id: string
    • username: string

The converted params for the message

publicKey?: string

Some chains require the public key as well to verify signatures

secretsPresentations?: SecretsProof<T>[]

Derived data integrity proofs for any secrets requested.

signature?: string

The signature of the message.

verificationResponse?: {
    errorMessage?: string;
    success: boolean;
}

Verification response

Type declaration

  • Optional errorMessage?: string
  • success: boolean

Methods

  • Compares this object's fields to another object's fields for equality. Equality is determined by comparing the JSON representations of the objects.

    If normalizeNumberTypes is true, then all number types will be compared as strings (i.e. "1n" === "1" === 1). Else, they will be compared as their native types (i.e. 1n !== 1 !== "1").

    Type Parameters

    Parameters

    • other: undefined | null | CustomType<U>
    • Optional normalizeNumberTypes: boolean

    Returns boolean

  • Verify function with all features (including asset ownership verification). This requires a call to the BitBadges API.

    Sets verificationResponse to the response from the API.

    Parameters

    Returns Promise<boolean>

  • Verifies the asset ownership requirements only. This requires a call to the BitBadges API.

    Does not set verificationResponse.

    Parameters

    Returns Promise<boolean>

  • Verify function with all offline features (no asset ownership verification). This does not require a call to the BitBadges API.

    Sets verificationResponse to the response.

    Parameters

    • options: VerifyChallengeOptions

    Returns Promise<boolean>

  • Verifies the secrets proofs only. This does not require a call to the BitBadges API. Does not set verificationResponse.

    Note this only verifies the signatures / validity of the proofs. You are responsible for checking the contents of the proofs.

    Returns Promise<boolean>

  • Verifies the signature only. This does not require a call to the BitBadges API. Does not set verificationResponse.

    Returns Promise<boolean>