Visão Geral
REST API
WebSocket RPC Server
Exemplos de Código em JavaScript
Obtendo Todos os Amigos
import { createRpcClient, createWebSocketsTransport } from '@dcl/rpc/dist/client';
import { FriendshipsServiceDefinition } from './protobuff-types/decentraland/social/friendships/friendships.gen';
const socialClientRpcUrl = 'wss://social.decentraland.org'; // Substitua pela URL real
const webSocketsTransport = createWebSocketsTransport(socialClientRpcUrl);
const service = loadService(FriendshipsServiceDefinition, webSocketsTransport);
const response = service.getFriends(Payload.create({ synapseToken }));
for await (const friends of response) {
processErrors(friends);
const userList = friends.users?.users ?? [];
// Processar a lista de amigos
}Obtendo Amigos em Comum
Atualizado