API Reference

Index

createAuthRequest

CreatesAuthRequest to get the authentication challenge message.

Parameters

Parameter

Type

Description

action

enum

IdAuth: = 0 IdAuthAndVcAuth: = 1

Returns

AuthRequest

createSignData

Creates a message for the user to sign with the wallet.

Convert the message to a JSON string before signing.

Parameters

Parameter

Type

Description

AuthChallenge

AuthChallenge

See details here.

account

string

DID of the signer (user).

Returns

SignData

requestQR

Gets the challenge in the form of a QR code with AuthChallenge.

Parameters

AuthChallenge

Returns

Promise<QrResult> , including the following properties:

Property

Type

Description

id

string

QR code ID.

text

string

Text for generating the QR code.

queryQRResult

Fetches the result of a user scanning the QR code.

The query loops until a result or an error is returned. To stop the query, call cancelQueryQRResult.

Parameters

Property

Type

Description

Required

id

string

QR code ID.

Yes

duration

number

Time interval between two queries, in milliseconds. Default: 1000

No

Returns

Promise<ChallengeResponse>

cancelQueryQRResult

Stops querying the result of a QR code scan.

Parameters

None

Returns

void

Errors

Member

Value

VersionNotSupport

ERR_WRONG_VERSION

TypeNotSupport

ERR_TYPE_NOT_SUPPORTED

ActionNotSupport

ERR_ACTION_NOT_SUPPORTED

UserCanceled

USER_CANCELED

UnknownError

ERR_UNDEFINED

Last updated