GDEX: Watchlist & Social
Manage a per-user watchlist and interact with the social layer around each
token (comments and bullish/bearish sentiment votes).
When to Use
- Letting a user pin tokens for quick access
- Reading or posting comments on a token's page
- Voting bullish / bearish on a token
Prerequisites
@gdexsdk/gdex-skill installed
- Authenticated via shared API key or wallet sign-in — see
gdex-authentication
- For write operations: a session-key authentication context (
userId and
encrypted data payload) or a managed-custody token, depending on
backend deployment
Backend Endpoints
| Method |
Path |
Purpose |
GET |
/v1/watch_list |
Get the user's watchlist |
POST |
/v1/change_watch_list |
Add or remove a token from the watchlist |
GET |
/v1/comments |
Get comments for a token |
POST |
/v1/add_comment |
Post a comment |
POST |
/v1/vote_sentiment |
Cast a bullish/bearish sentiment vote |
SDK Usage
import { GdexSkill, buildWatchListComputedData } from '@gdexsdk/gdex-skill';
const skill = new GdexSkill();
skill.loginWithApiKey(process.env.GDEX_API_KEY!);
// Watchlist (managed custody — backend decodes computedData)
const list = await skill.getWatchList({ userId: '0xWallet', data: encryptedSessionKey });
// Structured shape — SDK builds computedData internally
await skill.changeWatchList({
tokenAddress: '0xToken',
chainId: 8453,
action: 'add',
managed: {
apiKey: process.env.GDEX_API_KEY!,
walletAddress: '0xWallet',
sessionPrivateKey: '0x…',
userId: '0xWallet',
},
});
// Or raw shape — caller pre-built computedData
await skill.changeWatchList({
computedData: buildWatchListComputedData({
apiKey: process.env.GDEX_API_KEY!,
walletAddress: '0xWallet',
sessionPrivateKey: '0x…',
userId: '0xWallet',
tokenAddress: '0xToken',
chainId: '8453',
isAdded: true,
}),
chainId: 8453,
});
// Comments (plain JSON)
const comments = await skill.getComments({ tokenAddress: '0xToken', chain: 8453 });
await skill.addComment({
tokenAddress: '0xToken',
chain: 8453,
message: 'Looking strong on the 4h',
userId: '0xWallet',
data: encryptedSessionKey,
});
// Sentiment (plain JSON)
await skill.voteSentiment({
tokenAddress: '0xToken',
chain: 8453,
sentiment: 'bullish',
userId: '0xWallet',
data: encryptedSessionKey,
});
Notes
change_watch_list uses managed-custody encrypted computedData:
ABI ['watch_list', [tokenAddress, chainId, isAdded, nonce]],
sig message watch_list-${userId}-${data}.
add_comment and vote_sentiment use plain JSON with the standard
session header for auth — they do NOT go through serverDecryptData.
- Watchlist entries are scoped to
(userId, chain, tokenAddress).
- Sentiment votes are deduplicated per
(userId, tokenAddress) — re-voting
updates the existing vote.
- Comment moderation policies (rate limits, profanity filters) are enforced
server-side; expect API errors when limits are hit.
1---2name: gdex-watchlist-social3description: Watchlist, comments, and sentiment voting — social community features around individual tokens4---56# GDEX: Watchlist & Social78Manage a per-user watchlist and interact with the social layer around each9token (comments and bullish/bearish sentiment votes).1011## When to Use1213- Letting a user pin tokens for quick access14- Reading or posting comments on a token's page15- Voting bullish / bearish on a token1617## Prerequisites1819- `@gdexsdk/gdex-skill` installed20- Authenticated via shared API key or wallet sign-in — see21 **gdex-authentication**22- For write operations: a session-key authentication context (`userId` and23 encrypted `data` payload) or a managed-custody token, depending on24 backend deployment2526## Backend Endpoints2728| Method | Path | Purpose |29|--------|------|---------|30| `GET` | `/v1/watch_list` | Get the user's watchlist |31| `POST` | `/v1/change_watch_list` | Add or remove a token from the watchlist |32| `GET` | `/v1/comments` | Get comments for a token |33| `POST` | `/v1/add_comment` | Post a comment |34| `POST` | `/v1/vote_sentiment` | Cast a bullish/bearish sentiment vote |3536## SDK Usage3738```typescript39import { GdexSkill, buildWatchListComputedData } from '@gdexsdk/gdex-skill';4041const skill = new GdexSkill();42skill.loginWithApiKey(process.env.GDEX_API_KEY!);4344// Watchlist (managed custody — backend decodes computedData)45const list = await skill.getWatchList({ userId: '0xWallet', data: encryptedSessionKey });4647// Structured shape — SDK builds computedData internally48await skill.changeWatchList({49 tokenAddress: '0xToken',50 chainId: 8453,51 action: 'add',52 managed: {53 apiKey: process.env.GDEX_API_KEY!,54 walletAddress: '0xWallet',55 sessionPrivateKey: '0x…',56 userId: '0xWallet',57 },58});5960// Or raw shape — caller pre-built computedData61await skill.changeWatchList({62 computedData: buildWatchListComputedData({63 apiKey: process.env.GDEX_API_KEY!,64 walletAddress: '0xWallet',65 sessionPrivateKey: '0x…',66 userId: '0xWallet',67 tokenAddress: '0xToken',68 chainId: '8453',69 isAdded: true,70 }),71 chainId: 8453,72});7374// Comments (plain JSON)75const comments = await skill.getComments({ tokenAddress: '0xToken', chain: 8453 });76await skill.addComment({77 tokenAddress: '0xToken',78 chain: 8453,79 message: 'Looking strong on the 4h',80 userId: '0xWallet',81 data: encryptedSessionKey,82});8384// Sentiment (plain JSON)85await skill.voteSentiment({86 tokenAddress: '0xToken',87 chain: 8453,88 sentiment: 'bullish',89 userId: '0xWallet',90 data: encryptedSessionKey,91});92```9394## Notes9596- `change_watch_list` uses managed-custody **encrypted `computedData`**:97 ABI `['watch_list', [tokenAddress, chainId, isAdded, nonce]]`,98 sig message `watch_list-${userId}-${data}`.99- `add_comment` and `vote_sentiment` use **plain JSON** with the standard100 session header for auth — they do NOT go through `serverDecryptData`.101- Watchlist entries are scoped to `(userId, chain, tokenAddress)`.102- Sentiment votes are deduplicated per `(userId, tokenAddress)` — re-voting103 updates the existing vote.104- Comment moderation policies (rate limits, profanity filters) are enforced105 server-side; expect API errors when limits are hit.