bigblocks
Version:
Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React
127 lines (126 loc) • 3.71 kB
JavaScript
// Social protocol utilities
// These are placeholders for actual social protocol functionality
export const SocialActions = {
async followUser(targetUserId) {
console.log("Following user:", targetUserId);
// This would integrate with actual social protocol
return {
type: "follow",
content: targetUserId,
contentType: "text/plain",
app: "bigblocks",
};
},
async unfollowUser(targetUserId) {
console.log("Unfollowing user:", targetUserId);
// This would integrate with actual social protocol
return {
type: "unfollow",
content: targetUserId,
contentType: "text/plain",
app: "bigblocks",
};
},
async createPost(content) {
console.log("Creating post:", content);
// This would integrate with actual social protocol
if (typeof content === "string") {
return {
type: "post",
content,
contentType: "text/plain",
app: "bigblocks",
};
}
return content;
},
// Add aliases for different naming conventions
async follow(targetUserId) {
return this.followUser(targetUserId);
},
async unfollow(targetUserId) {
return this.unfollowUser(targetUserId);
},
async post(content) {
return this.createPost(content);
},
async reply(content, parentId) {
console.log("Creating reply:", content, "to:", parentId);
if (typeof content === "string") {
return {
type: "reply",
content,
contentType: "text/plain",
context: {
type: "tx",
value: parentId,
},
app: "bigblocks",
};
}
return {
...content,
type: "reply",
context: {
type: "tx",
value: parentId,
},
};
},
async like(postId, emoji = "👍") {
console.log("Liking post:", postId, "with:", emoji);
return {
type: "like",
content: emoji,
contentType: "text/plain",
context: {
type: "tx",
value: postId,
},
app: "bigblocks",
};
},
async unlike(postId) {
console.log("Unliking post:", postId);
return {
type: "unlike",
context: {
type: "tx",
value: postId,
},
app: "bigblocks",
};
},
async message(params) {
console.log("Creating message:", params);
return {
type: "message",
content: params.content,
contentType: "text/plain",
context: params.recipient
? { type: "bapID", value: params.recipient }
: params.channel
? { type: "channel", value: params.channel }
: undefined,
app: params.app || "bigblocks",
};
},
async friend(bapId) {
console.log("Creating friend request:", bapId);
return {
type: "friend",
content: bapId,
contentType: "text/plain",
app: "bigblocks",
};
},
async acceptFriend(bapId) {
console.log("Accepting friend request:", bapId);
return {
type: "friend",
content: `accept:${bapId}`,
contentType: "text/plain",
app: "bigblocks",
};
},
};