authenticate

Requests authentication using the NEP-20 authentication challenge payload.

Parameters

1. payload (required)

AuthenticationChallengePayload

type AuthenticationChallengePayload = {
  action: "Authentication";
  grant_type: "Signature";
  allowed_algorithms: ["ECDSA-P256"];
  domain: string;
  networks: Network[];
  nonce: string;
  timestamp: number;
};

Returns

Promise<AuthenticationResponsePayload>

type AuthenticationResponsePayload = {
  algorithm: "ECDSA-P256";
  network: Network;
  pubkey: ECPoint;
  address: Address;
  nonce: string;
  timestamp: number;
  signature: Base64Encoded;
};

Errors

Code
Name
Description

10001

UNSUPPORTED

Authentication is not supported by the wallet.

10002

INVALID

The challenge payload is invalid.

10005

TIMEOUT

The authentication request timed out.

10006

CANCELED

The user rejected the authentication request.

Example

Request

Response

最后更新于