getAccount

Used to get the account address under this RelayApp, ensuring unique user identity under each RelayApp. Different RelayApps will have different account addresses, reflecting the independent identity of users in each application.

circle-info
  • generateSignature and verifySignature rely on the BTC address returned by default from getAccount for signing and verifying user identity.

  • encrypt and decrypt rely on the ECC public key returned by getAccount(type: 1) for data encryption and decryption.

  • The two key systems are respectively applicable to identity verification and data encryption scenarios, and developers can call as needed.

Request Parameters

Parameter Name
Type
Required
Description

type

String

No

Request type. Defaults to returning BTC address; if 1 is passed, returns ECC public key (Base64 encoded).

Response Parameters

Parameter Name
Type
Description

result

String

Returned account address or public key.

Call Example

example.js
let payload = {
  type: "1"
};

const response = await relayx.getAccount(payload);
if (response.code === 200) {
  console.log("RelayApp account:", response.result);
}