Hide Tokens

Hide Token

The Kigo API allows users to toggle the visibility of tokens in their wallet by hiding or revealing them. Hiding a token provides better organization, while allowing users to maintain access to the token when needed.

Prerequisites

Before performing the hide action on a token, ensure that the necessary user-level session token has been obtained. This token is required to authenticate API requests and can be acquired by following the User Client Level Authentication.

Steps to Implement

  1. Hiding or Revealing a Token

    • Purpose: The hide action toggles the visibility of a token in the user's wallet. When hidden, the token is removed from the visible collection but remains accessible.
    • Usage: The application should only present the hide or reveal option based on the token's current visibility status. This is determined by checking the is_hidden flag in the token’s metadata.
  2. Determining If a Token Can Be Hidden

    • Flag: The is_hidden flag in the token’s metadata indicates whether a token is currently hidden or visible.
    • UI Consideration: If is_hidden is true, the option to hide should not be displayed. Similarly, if is_hidden is false, the option to reveal should not be shown.
  3. Accessing Hidden Tokens

    • Hidden Token Retrieval: Users can access a list of hidden tokens through the gallery endpoint. Refer to the View Tokens in Walletfor details on how to retrieve hidden tokens.

API Call

To toggle the visibility of a token, use the API endpoint that updates the token’s is_hidden status. This action allows a token to be hidden or revealed as needed. Refer to the Archive token.for details.

Key Considerations

  1. Visibility Management: Hiding a token does not delete it; the token remains in the user's account and can be revealed again if needed.
  2. User Experience: Ensure that the UI accurately reflects the current visibility of the token and provides the appropriate hide or reveal options accordingly.

Example Workflow

  1. User decides to hide or reveal a token: The user selects a token from their wallet that they wish to either hide or reveal.
  2. The application checks the token’s is_hidden flag: If the flag is false, the hide option is presented; if true, the reveal option is shown.
  3. Toggle token visibility: The application makes the Archive token.. The token's visibility is updated in the user's wallet.
  4. Access hidden tokens: Users can retrieve a list of hidden tokens using the gallery endpoint, as detailed in the View Tokens in Wallet.