Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit 58dc0cc

Browse files
author
Ildar Timerbaev
committed
Added hiveposh query
1 parent 8f65863 commit 58dc0cc

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ecency/sdk",
33
"private": false,
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"type": "module",
66
"license": "MIT",
77
"main": "./dist/ecency-sdk.umd.js",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./queries";
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { queryOptions } from "@tanstack/react-query";
2+
3+
export function getHivePoshLinksQueryOptions(username: string | undefined) {
4+
return queryOptions({
5+
queryKey: ["integrations", "hiveposh", "links", username],
6+
queryFn: async () => {
7+
const response = await fetch(
8+
`https://hiveposh.com/api/v0/linked-accounts/${username}`,
9+
{
10+
headers: {
11+
"Content-Type": "application/json",
12+
},
13+
}
14+
);
15+
const data = await response.json();
16+
17+
return {
18+
twitter: {
19+
username: data.twitter_username,
20+
profile: data.twitter_profile,
21+
},
22+
reddit: {
23+
username: data.reddit_username,
24+
profile: data.reddit_profile,
25+
},
26+
} satisfies Record<
27+
"twitter" | "reddit",
28+
{ username: string; profile: string }
29+
>;
30+
},
31+
});
32+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./get-hiveposh-links-query-options";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from "./3speak";
22
export * from "./hivesigner";
3+
export * from "./hiveposh";

0 commit comments

Comments
 (0)