GET
/
listWallets
List User Wallets
curl --request GET \
  --url http://localhost:2400/listWallets \
  --header 'Authorization: Bearer <token>'
[
  {
    "_id": "65f1a...",
    "UserID": "user-123",
    "generatedWalletAddress": "0x1234...",
    "slotName": "My ETH Wallet 1",
    "colortag": "blue",
    "network": "eth",
    "walletType": "generated",
    "createdAt": "2023-03-15T10:00:00.000Z"
  },
  {
    "_id": "65f2b...",
    "UserID": "user-123",
    "generatedWalletAddress": "SoLAddress...",
    "slotName": "My Solana Hot Wallet",
    "colortag": "purple",
    "network": "sol",
    "walletType": "imported",
    "createdAt": "2023-03-16T11:30:00.000Z"
  }
]

Endpoint

GET /listWallets

Description

Fetches a list of all wallets (across different networks like Ethereum, Base, Solana) registered to the currently authenticated user. It retrieves wallet addresses, assigned slot names, network information, and color tags, excluding sensitive private key data.

Authentication

Requires a valid JWT token passed via cookies.

Query Parameters

This endpoint does not require any query parameters.

Success Response (200 OK)

Returns an array of wallet objects.
Example
[
  {
    "_id": "65f1a...", // Internal Wallet ID
    "UserID": "user-123",
    "generatedWalletAddress": "0x1234...",
    "slotName": "My ETH Wallet 1",
    "colortag": "blue",
    "network": "eth",
    "walletType": "generated", // or "imported"
    "createdAt": "2023-03-15T10:00:00.000Z"
  },
  {
    "_id": "65f2b...",
    "UserID": "user-123",
    "generatedWalletAddress": "SoLAddress...",
    "slotName": "My Solana Hot Wallet",
    "colortag": "purple",
    "network": "sol",
    "walletType": "imported",
    "createdAt": "2023-03-16T11:30:00.000Z"
  }
]

Error Response (401 Unauthorized)

Indicates that no valid JWT token was provided or the token is expired.
Example
{
  "error": "No access token provided"
  // or
  // "error": "Token expired", "needsRefresh": true
}

Error Response (500 Internal Server Error)

Indicates a server-side error occurred while fetching the wallets.
Example
{
  "error": "Failed to retrieve wallets"
}

Notes

  • This endpoint is handled by the User server (Port 5000).
  • Retrieves data from the GeneralWalletData collection.
  • Private keys are explicitly excluded from the response for security.
  • The colortag helps differentiate wallets in the UI.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200
application/json

Successful retrieval of user wallets.

The response is of type object[].