Wallet Link/Unlink (Internal)

Link Your EVM Wallet to Get Started

To proceed with any EVM-based mission, users must first link their EVM wallet. Wallet connection is essential for verifying eligibility and tracking relevant on-chain activity for the mission.


1. Claim EVM-Based Missions

In the missions list or Get mission API, a flag is returned to indicate whether the user has linked their EVM wallet. Use this flag to determine if the user can proceed with the mission flow.

{
  "is_evm_wallet_connected" : false 
}

If the flag is false, users must link their EVM wallet as the first step to process the missions. Use the Link Wallet API to link your EVM wallet.


1.1. Link EVM Wallet

  1. To initiate the connection, prompt the user to link their EVM wallet (e.g., MetaMask) and request them to sign a predefined message. Refer to the Generate Wallet Nonce. The signature and message will be used for authentication. Refer to the Link Wallet API documentation for more details.

API Endpoint:

POST https://loyalty-api-sandbox.mojito.xyz/{tenant}/user/wallet/connect

Path Params:

NameTypeDescriptionRequired
tenantstringTenant slug (e.g., sample-loyalty)Yes

Request Body Params:

NameTypeDescriptionRequired
wallet_addressstringUser wallet address (EVM, SUI, etc)Yes
signaturestringWallet signature to validate authenticityYes
chainstringNetwork chain to login (Defaults to ethereum-mainnet)Yes
messagestringMessage signed to verify the authenticityYes
user_referencestringUnique identifier for the user (e.g., user_<user-reference>)No

Request Body:

{
  "wallet_address": "0x493B58B19CF70D8Edceb6f595755247099AfFEe6",
  "signature": "0x7c86a5d4e9c6fae293f302b5e1f15e5d45388f0a6e973e62b4c5bfe0a9edc1e14c8d6e91478aa229ecb1a6dcbb4cd6c76329a0b6fbd2d2f108c64655a23b12651b",
  "chain": "ethereum-mainnet",
  "message": "loyalty-api-dev.mojito.xyz wants you to sign in with your Ethereum account:\n0x34097e75f9b7ea018504839bfa6fc87a55bad039d423e2e62d761ee7a47d8c09\n\nWelcome to Mojito Inc.. Signing is the only way we can truly know that you are the owner of the wallet you are connecting. Signing is a safe, gas-less transaction that does not in any way give Mojito Inc. permission to perform any transactions with your wallet.\n\nURI: https://api.sui-loyalty.xyz\nVersion: 1\nNonce: e8501cbc\nIssued At: 2025-07-23T18:51:18Z\nRequest ID: 49eaeb7d-066c-442f-ad5e-96f0b2a76ee1",
  "user_reference": "user_123456"
}

Response:

{
  "message": "Wallet connected successfully.",
  "data": {
    "id": "1b342e62-5665-4701-af56-8bc944b88973",
    "user_id": "607e060b-aae0-4fe0-8006-735b16dd86b7",
    "address": "0x493B58B19CF70D8Edceb6f595755247099AfFEe6",
    "wallet_type": "EVM",
    "is_primary": false,
    "is_active": true
  }
}

1.2. Claim the Mission

  • Once connected, the eligible user can claim the EVM-based mission using the Mission Claim API.

1.3. Disconnect Wallet

To disconnect the user's EVM wallet, refer to the EVM Wallet Disconnect API documentation.

API Endpoint:

POST https://loyalty-api-sandbox.mojito.xyz/{tenant}/user/wallet/disconnect

Path Params:

NameTypeDescriptionRequired
tenantstringTenant slug (e.g., sample-loyalty)Yes

Body Param

NameTypeDescriptionRequired
wallet_idstringRequired wallet_id can be referenced from the User Profile APIYes
user_referencestringUnique identifier for the user (e.g., user_<user-reference>)No

Request Body:

{
  "user_reference": "user_607e060b",
  "wallet_id": "1b342e62-5665-4701-af56-8bc944b88973"
}

Response:

{
  "message": "Wallet disconnected successfully"
}