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
-
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.
-
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
istrue
, the option to hide should not be displayed. Similarly, ifis_hidden
isfalse
, the option to reveal should not be shown.
- Flag: The
-
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
- Visibility Management: Hiding a token does not delete it; the token remains in the user's account and can be revealed again if needed.
- 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
- User decides to hide or reveal a token: The user selects a token from their wallet that they wish to either hide or reveal.
- The application checks the token’s
is_hidden
flag: If the flag isfalse
, the hide option is presented; iftrue
, the reveal option is shown. - Toggle token visibility: The application makes the Archive token.. The token's visibility is updated in the user's wallet.
- Access hidden tokens: Users can retrieve a list of hidden tokens using the gallery endpoint, as detailed in the View Tokens in Wallet.
Updated 8 months ago