Skip to main content

Verifying Wallets

The Enjin Platform offers a Wallet verifying process that you can use to verify the authenticity of a user's blockchain address.

tip

If you need to send requests to user wallets, use WalletConnect instead.

What you'll need:

By using wallet verification, you can receive the user's wallet address with 100% certainty that this wallet is owned by the user.

Verify Wallet with the Enjin API

Step 1. Initiate an Account Request

To initiate the account request process, run the following query:

Query:

query RequestAccount{
RequestAccount{
qrCode #Returns a QR code for your user to scan
verificationId #Save this for next step
}
}

Response:

{
"data": {
"RequestAccount": {
"qrCode": "https://platform.canary.enjin.io/qr?s=512&f=png&d=https://platform.canary.enjin.io/proof/MHg3OGFmYWIxYWQxMjk0YzFlZWY4MjdlNmFjNTM1MmJiOTVmNmFmNWJhNmUyNjk5ZGRkOTI3YjAwNmQ3ZDk0MzZjO2Vwc3I6QTIwMTBBSzlM",
"verificationId": "0x78afab1ad1294c1eef827e6ac5352bb95f6af5ba6e2699ddd927b006d7d9436c"
}
}
}

This will generate a linking code from the Enjin Platform, which the user can scan with their Enjin Wallet. The wallet will then send their address to the Enjin Platform, allowing you to retrieve it

Step 2: Verify Account

Once the user has scanned the QR code using the Enjin Wallet, you can retrieve the account using two methods.

Option A: GetWallet

Using GetWallet and passing the verificationId from step 1, you will be able to get any information related to his wallet if the verification process succeeded.

Query:

query GetVerifiedWallet{
GetWallet(verificationId: "0x78afab1ad1294c1eef827e6ac5352bb95f6af5ba6e2699ddd927b006d7d9436c"){ #Set the verificationId from the RequestAccount response
account{
address
}
balances{
free
}
}
}

Response: If user has verified

{
"data": {
"GetWallet": {
"account": {
"address": "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f" //The address of the verified account
},
"balances": {
"free": "86010842630734264894" // The amount of free ENJ in the verified account - ~86.0108 ENJ
}
}
}
}
Balances Format

API balances fields are formatted as u128 number type.
to get decimal value, divide the value by 10^18.

Response: If user has not verified

{
"data": {
"GetWallet": null
}
}

Option B: GetAccountVerified

This query can be used to fetch the status of the verification, while you are showing the QR code to the player, for example, when the query returns "verified": true you could hide the QR code and proceed with your onboarding workflow.

Query:

query GetAccountVerified{
GetAccountVerified(verificationId: "0x78afab1ad1294c1eef827e6ac5352bb95f6af5ba6e2699ddd927b006d7d9436c"){ #Set the verificationId from the RequestAccount response
verified
account{
publicKey
address
}
}
}

Response: If user has verified

{
"data": {
"GetAccountVerified": {
"verified": true,
"account": {
"publicKey": "0x5a6aae294416f3e875d9a8975658905002cfd3e5e64105d76296c4b0adbfd77e", //The public key of the verified account
"address": "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f" //The address of the verified account
}
}
}
}

Response: If user has not verified

{
"data": {
"GetAccountVerified": {
"verified": false,
"address": null
}
}
}

Verify Flow Diagram

Explore More Arguments

For a comprehensive view of all available arguments for queries and mutations, please refer to our API Reference. This resource will guide you on how to use the GraphiQL Playground to explore the full structure and functionality of our API.