hive-react-kit 0.0.27 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +2 -0
- package/dist/components/ActivityHistory.d.ts +7 -0
- package/dist/components/ActivityList.d.ts +15 -0
- package/dist/components/FollowersList.d.ts +8 -0
- package/dist/components/FollowingList.d.ts +8 -0
- package/dist/components/ListOfWitnesses.d.ts +4 -0
- package/dist/components/PostFeedList.d.ts +17 -0
- package/dist/components/ProposalsList.d.ts +4 -0
- package/dist/components/TransactionHistory.d.ts +6 -0
- package/dist/components/UpvoteListModal.d.ts +11 -0
- package/dist/components/VideoCard.d.ts +9 -0
- package/dist/components/VideoDetail.d.ts +17 -0
- package/dist/components/VideoFeed.d.ts +11 -0
- package/dist/components/VideoInfo.d.ts +19 -0
- package/dist/components/VoteSlider.d.ts +7 -0
- package/dist/components/Wallet.d.ts +7 -0
- package/dist/components/WitnessFilters.d.ts +8 -0
- package/dist/components/comments/AddCommentInput.d.ts +10 -0
- package/dist/components/comments/CommentSearchBar.d.ts +8 -0
- package/dist/components/comments/CommentTile.d.ts +16 -0
- package/dist/components/comments/CommentsModal.d.ts +13 -0
- package/dist/components/comments/ReplyModal.d.ts +9 -0
- package/dist/components/common/FavouriteWidget.d.ts +10 -0
- package/dist/components/community/CommunitiesList.d.ts +5 -0
- package/dist/components/community/CommunityAbout.d.ts +5 -0
- package/dist/components/community/CommunityDetail.d.ts +16 -0
- package/dist/components/community/CommunityDetails.d.ts +13 -0
- package/dist/components/community/CommunityMembers.d.ts +6 -0
- package/dist/components/community/CommunityTeam.d.ts +6 -0
- package/dist/components/index.d.ts +25 -0
- package/dist/components/modals/CommentsModal.d.ts +8 -0
- package/dist/components/modals/DescriptionModal.d.ts +8 -0
- package/dist/components/modals/Modal.d.ts +10 -0
- package/dist/components/modals/UpvoteListModal.d.ts +7 -0
- package/dist/components/user/UserAccount.d.ts +14 -0
- package/dist/components/user/UserFollowers.d.ts +6 -0
- package/dist/components/user/UserFollowing.d.ts +6 -0
- package/dist/components/user/UserInfo.d.ts +5 -0
- package/dist/components/user/UserProfilePage.d.ts +16 -0
- package/dist/hooks/CommunityFavouriteProvider.d.ts +5 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-toast.d.ts +52 -0
- package/dist/index.cjs.js +96 -104
- package/dist/index.d.ts +37 -0
- package/dist/index.esm.js +19012 -19032
- package/dist/main.d.ts +1 -0
- package/dist/pages/Index.d.ts +2 -0
- package/dist/pages/NotFound.d.ts +2 -0
- package/dist/pages/UserProfile.d.ts +2 -0
- package/dist/services/activityListService.d.ts +79 -0
- package/dist/services/activityService.d.ts +104 -0
- package/dist/services/apiService.d.ts +51 -0
- package/dist/services/communityService.d.ts +15 -0
- package/dist/services/proposalService.d.ts +9 -0
- package/dist/services/transactionService.d.ts +69 -0
- package/dist/services/userService.d.ts +15 -0
- package/dist/services/witnessService.d.ts +61 -0
- package/dist/store/index.d.ts +2 -0
- package/dist/store/walletStore.d.ts +2 -0
- package/dist/store/witnessStore.d.ts +31 -0
- package/dist/types/activity.d.ts +108 -0
- package/dist/types/activityList.d.ts +46 -0
- package/dist/types/comment.d.ts +19 -0
- package/dist/types/community.d.ts +136 -0
- package/dist/types/graphql.d.ts +28 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/post.d.ts +53 -0
- package/dist/types/proposal.d.ts +35 -0
- package/dist/types/transaction.d.ts +90 -0
- package/dist/types/trending.d.ts +4 -0
- package/dist/types/user.d.ts +135 -0
- package/dist/types/video.d.ts +106 -0
- package/dist/types/wallet.d.ts +17 -0
- package/dist/types/witness.d.ts +57 -0
- package/dist/utils/thumbnail.d.ts +1 -0
- package/package.json +8 -9
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.css";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AccountHistoryItem, ActivityListItem, DirectionFilter, GeneralFilter, RewardFilter } from "@/types/activityList";
|
|
2
|
+
declare class ActivityListService {
|
|
3
|
+
/**
|
|
4
|
+
* Get account history using condenser_api.get_account_history
|
|
5
|
+
* @param username - Hive username
|
|
6
|
+
* @param start - Starting operation index (-1 for most recent)
|
|
7
|
+
* @param limit - Number of operations to fetch
|
|
8
|
+
* @param operationFilterLow - Operation filter low (optional)
|
|
9
|
+
* @param operationFilterHigh - Operation filter high (optional)
|
|
10
|
+
* @returns Promise<AccountHistoryItem[]>
|
|
11
|
+
*/
|
|
12
|
+
getAccountHistory(username: string, start?: number, limit?: number, operationFilterLow?: string, operationFilterHigh?: string): Promise<AccountHistoryItem[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Get the next page of account history for pagination
|
|
15
|
+
* @param username - Hive username
|
|
16
|
+
* @param lastIndex - Last operation index from previous page
|
|
17
|
+
* @param limit - Number of operations to fetch
|
|
18
|
+
* @returns Promise<AccountHistoryItem[]>
|
|
19
|
+
*/
|
|
20
|
+
getNextAccountHistoryPage(username: string, lastIndex: number, limit?: number): Promise<AccountHistoryItem[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Convert account history items to activity list items
|
|
23
|
+
* @param historyItems - Raw account history items
|
|
24
|
+
* @param username - The account we're viewing history for
|
|
25
|
+
* @returns ActivityListItem[]
|
|
26
|
+
*/
|
|
27
|
+
convertToActivityListItems(historyItems: AccountHistoryItem[], username: string): ActivityListItem[];
|
|
28
|
+
/**
|
|
29
|
+
* Parse individual operation and determine activity details
|
|
30
|
+
* @param historyItem - Account history item
|
|
31
|
+
* @param username - The account we're viewing history for
|
|
32
|
+
* @returns Parsed activity data
|
|
33
|
+
*/
|
|
34
|
+
private parseOperation;
|
|
35
|
+
private parseVoteOperation;
|
|
36
|
+
private parseCommentOperation;
|
|
37
|
+
private parseCustomJsonOperation;
|
|
38
|
+
private parseCommentOptionsOperation;
|
|
39
|
+
private parseEffectiveCommentVoteOperation;
|
|
40
|
+
private parseCurationRewardOperation;
|
|
41
|
+
private parseAuthorRewardOperation;
|
|
42
|
+
private parseCommentBenefactorRewardOperation;
|
|
43
|
+
/**
|
|
44
|
+
* Filter activities by direction (in/out)
|
|
45
|
+
* @param activities - Activity list items
|
|
46
|
+
* @param filter - Direction filter
|
|
47
|
+
* @returns Filtered activities
|
|
48
|
+
*/
|
|
49
|
+
filterByDirection(activities: ActivityListItem[], filter: DirectionFilter): ActivityListItem[];
|
|
50
|
+
/**
|
|
51
|
+
* Filter activities by general type
|
|
52
|
+
* @param activities - Activity list items
|
|
53
|
+
* @param filter - General filter
|
|
54
|
+
* @returns Filtered activities
|
|
55
|
+
*/
|
|
56
|
+
filterByGeneralType(activities: ActivityListItem[], filter: GeneralFilter): ActivityListItem[];
|
|
57
|
+
/**
|
|
58
|
+
* Filter activities by reward type
|
|
59
|
+
* @param activities - Activity list items
|
|
60
|
+
* @param filter - Reward filter
|
|
61
|
+
* @returns Filtered activities
|
|
62
|
+
*/
|
|
63
|
+
filterByRewardType(activities: ActivityListItem[], filter: RewardFilter): ActivityListItem[];
|
|
64
|
+
/**
|
|
65
|
+
* Search activities by text
|
|
66
|
+
* @param activities - Activity list items
|
|
67
|
+
* @param searchText - Search text
|
|
68
|
+
* @returns Filtered activities
|
|
69
|
+
*/
|
|
70
|
+
searchActivities(activities: ActivityListItem[], searchText: string): ActivityListItem[];
|
|
71
|
+
/**
|
|
72
|
+
* Get relative time string
|
|
73
|
+
* @param timestamp - ISO timestamp
|
|
74
|
+
* @returns Relative time string
|
|
75
|
+
*/
|
|
76
|
+
getRelativeTime(timestamp: string): string;
|
|
77
|
+
}
|
|
78
|
+
export declare const activityListService: ActivityListService;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ActivityHistoryItem, ActivityDisplayItem } from "@/types/activity";
|
|
2
|
+
declare class ActivityService {
|
|
3
|
+
/**
|
|
4
|
+
* Get activity history for a user (posts, comments, replies)
|
|
5
|
+
* @param username - Hive username
|
|
6
|
+
* @param sortBy - Sort by "posts", "comments", or "replies" (default: "posts")
|
|
7
|
+
* @param limit - Maximum number of items to return (default: 20)
|
|
8
|
+
* @param startAuthor - Starting author for pagination (optional)
|
|
9
|
+
* @param startPermlink - Starting permlink for pagination (optional)
|
|
10
|
+
* @param observer - Observer username for personalized results (optional)
|
|
11
|
+
* @returns Promise<ActivityHistoryItem[]>
|
|
12
|
+
*/
|
|
13
|
+
getActivityHistory(username: string, sortBy?: 'posts' | 'comments' | 'replies', limit?: number, startAuthor?: string | null, startPermlink?: string | null, observer?: string | null): Promise<ActivityHistoryItem[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Get user's posts only
|
|
16
|
+
* @param username - Hive username
|
|
17
|
+
* @param limit - Maximum number of posts to return
|
|
18
|
+
* @returns Promise<ActivityHistoryItem[]>
|
|
19
|
+
*/
|
|
20
|
+
getUserPosts(username: string, limit?: number): Promise<ActivityHistoryItem[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Get user's comments only
|
|
23
|
+
* @param username - Hive username
|
|
24
|
+
* @param limit - Maximum number of comments to return
|
|
25
|
+
* @returns Promise<ActivityHistoryItem[]>
|
|
26
|
+
*/
|
|
27
|
+
getUserComments(username: string, limit?: number): Promise<ActivityHistoryItem[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Get user's replies only
|
|
30
|
+
* @param username - Hive username
|
|
31
|
+
* @param limit - Maximum number of replies to return
|
|
32
|
+
* @returns Promise<ActivityHistoryItem[]>
|
|
33
|
+
*/
|
|
34
|
+
getUserReplies(username: string, limit?: number): Promise<ActivityHistoryItem[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Get all user activity (posts, comments, and replies combined)
|
|
37
|
+
* @param username - Hive username
|
|
38
|
+
* @param limit - Maximum number of items per type
|
|
39
|
+
* @returns Promise<ActivityHistoryItem[]>
|
|
40
|
+
*/
|
|
41
|
+
getAllUserActivity(username: string, limit?: number): Promise<ActivityHistoryItem[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Convert raw activity item to display format
|
|
44
|
+
* @param item - Raw activity history item
|
|
45
|
+
* @returns ActivityDisplayItem
|
|
46
|
+
*/
|
|
47
|
+
convertToDisplayItem(item: ActivityHistoryItem): ActivityDisplayItem;
|
|
48
|
+
/**
|
|
49
|
+
* Format activity timestamp to readable date
|
|
50
|
+
* @param timestamp - Activity timestamp
|
|
51
|
+
* @returns Formatted date string
|
|
52
|
+
*/
|
|
53
|
+
formatTimestamp(timestamp: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Get relative time string (e.g., "2 hours ago")
|
|
56
|
+
* @param timestamp - Activity timestamp
|
|
57
|
+
* @returns Relative time string
|
|
58
|
+
*/
|
|
59
|
+
getRelativeTime(timestamp: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Truncate text to specified length
|
|
62
|
+
* @param text - Text to truncate
|
|
63
|
+
* @param maxLength - Maximum length
|
|
64
|
+
* @returns Truncated text
|
|
65
|
+
*/
|
|
66
|
+
truncateText(text: string, maxLength?: number): string;
|
|
67
|
+
/**
|
|
68
|
+
* Get activity summary statistics
|
|
69
|
+
* @param activities - Array of activities
|
|
70
|
+
* @returns Summary statistics
|
|
71
|
+
*/
|
|
72
|
+
getActivitySummary(activities: ActivityHistoryItem[]): {
|
|
73
|
+
totalActivities: number;
|
|
74
|
+
postsCount: number;
|
|
75
|
+
commentsCount: number;
|
|
76
|
+
totalVotes: number;
|
|
77
|
+
totalPayout: string;
|
|
78
|
+
averageVotes: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Filter activities by category
|
|
82
|
+
* @param activities - Array of activities
|
|
83
|
+
* @param category - Category to filter by
|
|
84
|
+
* @returns Filtered activities
|
|
85
|
+
*/
|
|
86
|
+
filterByCategory(activities: ActivityHistoryItem[], category: string): ActivityHistoryItem[];
|
|
87
|
+
/**
|
|
88
|
+
* Filter activities by date range
|
|
89
|
+
* @param activities - Array of activities
|
|
90
|
+
* @param startDate - Start date
|
|
91
|
+
* @param endDate - End date
|
|
92
|
+
* @returns Filtered activities
|
|
93
|
+
*/
|
|
94
|
+
filterByDateRange(activities: ActivityHistoryItem[], startDate: Date, endDate: Date): ActivityHistoryItem[];
|
|
95
|
+
/**
|
|
96
|
+
* Search activities by text
|
|
97
|
+
* @param activities - Array of activities
|
|
98
|
+
* @param searchText - Text to search for
|
|
99
|
+
* @returns Filtered activities
|
|
100
|
+
*/
|
|
101
|
+
searchActivities(activities: ActivityHistoryItem[], searchText: string): ActivityHistoryItem[];
|
|
102
|
+
}
|
|
103
|
+
export declare const activityService: ActivityService;
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ThreeSpeakVideo, LoginModel, ActiveVote } from "@/types/video";
|
|
2
|
+
import { TrendingTag } from "@/types/trending";
|
|
3
|
+
import { Discussion } from "@/types/comment";
|
|
4
|
+
import { Post, PostSort } from "@/types/post";
|
|
5
|
+
declare const server: {
|
|
6
|
+
domain: string;
|
|
7
|
+
kThreeSpeakApiUrl: string;
|
|
8
|
+
userOwnerThumb: (username: string) => string;
|
|
9
|
+
graphQLServerUrl: string;
|
|
10
|
+
};
|
|
11
|
+
declare class ApiService {
|
|
12
|
+
private readonly commonFields;
|
|
13
|
+
private getGQLFeed;
|
|
14
|
+
handleLogin(result: LoginModel): Promise<Record<string, any>>;
|
|
15
|
+
handleUpvote({ author, permlink, weight, authToken, }: {
|
|
16
|
+
author: string;
|
|
17
|
+
permlink: string;
|
|
18
|
+
weight: number;
|
|
19
|
+
authToken: string;
|
|
20
|
+
}): Promise<Record<string, any>>;
|
|
21
|
+
handleComment({ author, permlink, body, authToken, }: {
|
|
22
|
+
author: string;
|
|
23
|
+
permlink: string;
|
|
24
|
+
body: string;
|
|
25
|
+
authToken: string;
|
|
26
|
+
}): Promise<Record<string, any>>;
|
|
27
|
+
getVideoDetails(username: string, permlink: string): Promise<ThreeSpeakVideo>;
|
|
28
|
+
private fetchFeed;
|
|
29
|
+
getUserVideos(username: string, skip?: number): Promise<ThreeSpeakVideo[]>;
|
|
30
|
+
getHomeVideos(skip?: number): Promise<ThreeSpeakVideo[]>;
|
|
31
|
+
getTrendingVideos(skip?: number): Promise<ThreeSpeakVideo[]>;
|
|
32
|
+
getNewVideos(skip?: number): Promise<ThreeSpeakVideo[]>;
|
|
33
|
+
getFirstUploadsVideos(skip?: number): Promise<ThreeSpeakVideo[]>;
|
|
34
|
+
getCommunityVideos(community: string, skip?: number): Promise<ThreeSpeakVideo[]>;
|
|
35
|
+
getRelatedVideos(username: string, skip?: number): Promise<ThreeSpeakVideo[]>;
|
|
36
|
+
getTaggedVideos(tag: string, skip?: number): Promise<ThreeSpeakVideo[]>;
|
|
37
|
+
getSearchFeed(term: string, skip?: number, lang?: string): Promise<ThreeSpeakVideo[]>;
|
|
38
|
+
getTrendingTags(): Promise<TrendingTag[]>;
|
|
39
|
+
private convertGQLItemsToThreeSpeakVideos;
|
|
40
|
+
getContentStats(author: string, permlink: string): Promise<{
|
|
41
|
+
numOfUpvotes: any;
|
|
42
|
+
numOfComments: any;
|
|
43
|
+
hiveValue: number;
|
|
44
|
+
}>;
|
|
45
|
+
getActiveVotes(author: string, permlink: string): Promise<ActiveVote[]>;
|
|
46
|
+
getCommentsList(author: string, permlink: string): Promise<Discussion[]>;
|
|
47
|
+
getMyVideos(authToken: string): Promise<ThreeSpeakVideo[]>;
|
|
48
|
+
getRankedPosts(sort?: PostSort, tag?: string, observer?: string, limit?: number, start_author?: string, start_permlink?: string): Promise<Post[]>;
|
|
49
|
+
}
|
|
50
|
+
export declare const apiService: ApiService;
|
|
51
|
+
export { server };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CommunityItem, CommunityDetailsResponse, CommunitySubscriber, CommunityActivity } from '../types/community';
|
|
2
|
+
declare class CommunityService {
|
|
3
|
+
private readonly HIVE_API_URL;
|
|
4
|
+
getListOfCommunities(query?: string, limit?: number, last?: string): Promise<CommunityItem[]>;
|
|
5
|
+
getCommunityDetails(communityId: string): Promise<CommunityDetailsResponse>;
|
|
6
|
+
getCommunitySubscribers(communityId: string, limit?: number, last?: string): Promise<CommunitySubscriber[]>;
|
|
7
|
+
getCommunitySubscribersList(communityId: string, limit?: number, last?: string): Promise<CommunitySubscriber[]>;
|
|
8
|
+
getCommunityAccounts(communityId: string): Promise<any[]>;
|
|
9
|
+
getRankedPosts(communityId: string, sort?: string, limit?: number, startAuthor?: string, startPermlink?: string): Promise<any[]>;
|
|
10
|
+
communityIcon(value: string): string;
|
|
11
|
+
userOwnerThumb(value: string): string;
|
|
12
|
+
getCommunityActivities(account: string, limit?: number, lastId?: number): Promise<CommunityActivity[]>;
|
|
13
|
+
}
|
|
14
|
+
export declare const communityService: CommunityService;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Proposal } from '../types/proposal';
|
|
2
|
+
export declare class ProposalService {
|
|
3
|
+
private static instance;
|
|
4
|
+
static getInstance(): ProposalService;
|
|
5
|
+
getProposals(status: string): Promise<Proposal[]>;
|
|
6
|
+
private getActiveProposals;
|
|
7
|
+
private getExpiredProposals;
|
|
8
|
+
}
|
|
9
|
+
export declare const proposalService: ProposalService;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { TransactionHistoryItem, Operation } from "@/types/transaction";
|
|
2
|
+
declare class TransactionService {
|
|
3
|
+
/**
|
|
4
|
+
* Get transaction history for an account
|
|
5
|
+
* @param account - Hive account name
|
|
6
|
+
* @param index - Starting index (-1 for most recent)
|
|
7
|
+
* @param limit - Maximum number of transactions to return (default: 1000)
|
|
8
|
+
* @param start - Start block number (optional)
|
|
9
|
+
* @param stop - Stop block number (optional)
|
|
10
|
+
* @returns Promise<TransactionHistoryItem[]>
|
|
11
|
+
*/
|
|
12
|
+
getTransactionHistory(account: string, index?: number, limit?: number, start?: number | null, stop?: number | null): Promise<TransactionHistoryItem[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Get filtered transaction history by operation type
|
|
15
|
+
* @param account - Hive account name
|
|
16
|
+
* @param operationTypes - Array of operation types to filter by
|
|
17
|
+
* @param limit - Maximum number of transactions to return
|
|
18
|
+
* @returns Promise<TransactionHistoryItem[]>
|
|
19
|
+
*/
|
|
20
|
+
getFilteredTransactionHistory(account: string, operationTypes?: string[], limit?: number): Promise<TransactionHistoryItem[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Get recent transfers for an account
|
|
23
|
+
* @param account - Hive account name
|
|
24
|
+
* @param limit - Maximum number of transfers to return
|
|
25
|
+
* @returns Promise<TransactionHistoryItem[]>
|
|
26
|
+
*/
|
|
27
|
+
getRecentTransfers(account: string, limit?: number): Promise<TransactionHistoryItem[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Get recent votes for an account
|
|
30
|
+
* @param account - Hive account name
|
|
31
|
+
* @param limit - Maximum number of votes to return
|
|
32
|
+
* @returns Promise<TransactionHistoryItem[]>
|
|
33
|
+
*/
|
|
34
|
+
getRecentVotes(account: string, limit?: number): Promise<TransactionHistoryItem[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Get recent comments/posts for an account
|
|
37
|
+
* @param account - Hive account name
|
|
38
|
+
* @param limit - Maximum number of comments to return
|
|
39
|
+
* @returns Promise<TransactionHistoryItem[]>
|
|
40
|
+
*/
|
|
41
|
+
getRecentComments(account: string, limit?: number): Promise<TransactionHistoryItem[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Parse operation data from transaction
|
|
44
|
+
* @param transaction - Transaction history item
|
|
45
|
+
* @returns Parsed operation or null
|
|
46
|
+
*/
|
|
47
|
+
parseOperation(transaction: TransactionHistoryItem): Operation | null;
|
|
48
|
+
/**
|
|
49
|
+
* Format transaction timestamp to readable date
|
|
50
|
+
* @param timestamp - Transaction timestamp
|
|
51
|
+
* @returns Formatted date string
|
|
52
|
+
*/
|
|
53
|
+
formatTimestamp(timestamp: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Get transaction summary statistics
|
|
56
|
+
* @param transactions - Array of transactions
|
|
57
|
+
* @returns Summary statistics
|
|
58
|
+
*/
|
|
59
|
+
getTransactionSummary(transactions: TransactionHistoryItem[]): {
|
|
60
|
+
totalTransactions: number;
|
|
61
|
+
operationCounts: Record<string, number>;
|
|
62
|
+
dateRange: {
|
|
63
|
+
earliest: string;
|
|
64
|
+
latest: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export declare const transactionService: TransactionService;
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Follower, Following, UserProfileResponse, Account } from "@/types/user";
|
|
2
|
+
declare class UserService {
|
|
3
|
+
private readonly HIVE_API_URL;
|
|
4
|
+
getProfile(username: string): Promise<UserProfileResponse>;
|
|
5
|
+
getFollowers(username: string): Promise<Follower[]>;
|
|
6
|
+
getFollowing(username: string): Promise<Following[]>;
|
|
7
|
+
getAccounts(usernames: string[]): Promise<Account[]>;
|
|
8
|
+
getDynamicGlobalProperties(): Promise<any>;
|
|
9
|
+
convertVestingSharesToHive(vestingShares: string): Promise<string>;
|
|
10
|
+
getFeedHistory(): Promise<any>;
|
|
11
|
+
getVoteValue(username: string, weight?: number): Promise<string>;
|
|
12
|
+
userAvatar(username: string): string;
|
|
13
|
+
}
|
|
14
|
+
export declare const userService: UserService;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Witness, WitnessVotesResponse, Account, WitnessVote } from "../types/witness";
|
|
2
|
+
declare class WitnessService {
|
|
3
|
+
/**
|
|
4
|
+
* Get witnesses by vote with pagination
|
|
5
|
+
*/
|
|
6
|
+
getWitnessesByVote(start?: string, limit?: number): Promise<Witness[]>;
|
|
7
|
+
/**
|
|
8
|
+
* Get account details including witness votes
|
|
9
|
+
*/
|
|
10
|
+
getAccount(username: string): Promise<Account | null>;
|
|
11
|
+
/**
|
|
12
|
+
* Get multiple accounts at once
|
|
13
|
+
*/
|
|
14
|
+
getAccounts(usernames: string[]): Promise<Account[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Get witness votes for a specific witness
|
|
17
|
+
*/
|
|
18
|
+
getWitnessVotes(witness: string, start?: string, limit?: number): Promise<WitnessVotesResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Get all witness votes for a witness with pagination
|
|
21
|
+
*/
|
|
22
|
+
getAllWitnessVotes(witness: string): Promise<WitnessVote[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Check if a user has voted for a witness
|
|
25
|
+
*/
|
|
26
|
+
hasUserVotedForWitness(username: string, witness: string): Promise<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* Get user's witness votes
|
|
29
|
+
*/
|
|
30
|
+
getUserWitnessVotes(username: string): Promise<string[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Format votes to millions (MHP)
|
|
33
|
+
*/
|
|
34
|
+
formatVotesToMHP(votes: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Calculate APR from hbd_interest_rate
|
|
37
|
+
*/
|
|
38
|
+
calculateAPR(hbdInterestRate: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* Get version status color based on running_version vs hardfork_version_vote
|
|
41
|
+
*/
|
|
42
|
+
getVersionStatus(runningVersion: string, hardforkVersion: string): 'green' | 'red' | 'grey';
|
|
43
|
+
/**
|
|
44
|
+
* Parse version string to comparable format
|
|
45
|
+
*/
|
|
46
|
+
private parseVersion;
|
|
47
|
+
/**
|
|
48
|
+
* Compare two version arrays
|
|
49
|
+
*/
|
|
50
|
+
private compareVersions;
|
|
51
|
+
/**
|
|
52
|
+
* Get witness description from account metadata
|
|
53
|
+
*/
|
|
54
|
+
getWitnessDescription(account: Account): string;
|
|
55
|
+
/**
|
|
56
|
+
* Format time ago
|
|
57
|
+
*/
|
|
58
|
+
formatTimeAgo(dateString: string): string;
|
|
59
|
+
}
|
|
60
|
+
export declare const witnessService: WitnessService;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Witness, WitnessFilters, WitnessVote, Account } from '../types/witness';
|
|
2
|
+
interface WitnessState {
|
|
3
|
+
witnesses: Witness[];
|
|
4
|
+
witnessVotes: WitnessVote[];
|
|
5
|
+
userWitnessVotes: string[];
|
|
6
|
+
witnessDetails: Map<string, string>;
|
|
7
|
+
witnessAccounts: Map<string, Account>;
|
|
8
|
+
loadingWitnesses: boolean;
|
|
9
|
+
loadingMoreWitnesses: boolean;
|
|
10
|
+
loadingVotes: boolean;
|
|
11
|
+
loadingMoreVotes: boolean;
|
|
12
|
+
loadingUserVotes: boolean;
|
|
13
|
+
error: string | null;
|
|
14
|
+
nextWitnessStart: string;
|
|
15
|
+
nextVotesStart: string;
|
|
16
|
+
hasMoreWitnesses: boolean;
|
|
17
|
+
hasMoreVotes: boolean;
|
|
18
|
+
selectedWitness: string | null;
|
|
19
|
+
filters: WitnessFilters;
|
|
20
|
+
loadWitnesses: (start?: string, limit?: number) => Promise<void>;
|
|
21
|
+
loadMoreWitnesses: () => Promise<void>;
|
|
22
|
+
loadWitnessVotes: (witness: string) => Promise<void>;
|
|
23
|
+
loadMoreVotes: () => Promise<void>;
|
|
24
|
+
loadUserWitnessVotes: (username?: string) => Promise<void>;
|
|
25
|
+
loadWitnessDetails: (owners: string[]) => Promise<void>;
|
|
26
|
+
setFilters: (filters: WitnessFilters) => void;
|
|
27
|
+
setSelectedWitness: (witness: string | null) => void;
|
|
28
|
+
clearVotes: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare const useWitnessStore: import("zustand").UseBoundStore<import("zustand").StoreApi<WitnessState>>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export interface ActivityHistoryItem {
|
|
2
|
+
id: number;
|
|
3
|
+
author: string;
|
|
4
|
+
permlink: string;
|
|
5
|
+
category: string;
|
|
6
|
+
parent_author: string;
|
|
7
|
+
parent_permlink: string;
|
|
8
|
+
title: string;
|
|
9
|
+
body: string;
|
|
10
|
+
json_metadata: string;
|
|
11
|
+
last_update: string;
|
|
12
|
+
created: string;
|
|
13
|
+
active: string;
|
|
14
|
+
last_payout: string;
|
|
15
|
+
depth: number;
|
|
16
|
+
children: number;
|
|
17
|
+
net_rshares: number;
|
|
18
|
+
abs_rshares: number;
|
|
19
|
+
vote_rshares: number;
|
|
20
|
+
children_abs_rshares: number;
|
|
21
|
+
cashout_time: string;
|
|
22
|
+
max_cashout_time: string;
|
|
23
|
+
total_vote_weight: number;
|
|
24
|
+
reward_weight: number;
|
|
25
|
+
total_payout_value: string;
|
|
26
|
+
curator_payout_value: string;
|
|
27
|
+
author_rewards: number;
|
|
28
|
+
net_votes: number;
|
|
29
|
+
root_author: string;
|
|
30
|
+
root_permlink: string;
|
|
31
|
+
max_accepted_payout: string;
|
|
32
|
+
percent_hbd: number;
|
|
33
|
+
allow_replies: boolean;
|
|
34
|
+
allow_votes: boolean;
|
|
35
|
+
allow_curation_rewards: boolean;
|
|
36
|
+
beneficiaries: any[];
|
|
37
|
+
url: string;
|
|
38
|
+
root_title: string;
|
|
39
|
+
pending_payout_value: string;
|
|
40
|
+
total_pending_payout_value: string;
|
|
41
|
+
active_votes: any[];
|
|
42
|
+
replies: string[];
|
|
43
|
+
author_reputation: number;
|
|
44
|
+
promoted: string;
|
|
45
|
+
body_length: number;
|
|
46
|
+
reblogged_by: string[];
|
|
47
|
+
active_votes_count: number;
|
|
48
|
+
author_title: string;
|
|
49
|
+
author_role: string;
|
|
50
|
+
author_about: string;
|
|
51
|
+
author_location: string;
|
|
52
|
+
author_website: string;
|
|
53
|
+
author_cover_image: string;
|
|
54
|
+
author_profile_image: string;
|
|
55
|
+
author_blacklist_description: string;
|
|
56
|
+
author_muted_list_description: string;
|
|
57
|
+
author_reputation_formatted: string;
|
|
58
|
+
author_vests_formatted: string;
|
|
59
|
+
author_balance_formatted: string;
|
|
60
|
+
author_hbd_balance_formatted: string;
|
|
61
|
+
author_savings_hbd_balance_formatted: string;
|
|
62
|
+
author_savings_balance_formatted: string;
|
|
63
|
+
author_vesting_shares_formatted: string;
|
|
64
|
+
author_delegated_vesting_shares_formatted: string;
|
|
65
|
+
author_received_vesting_shares_formatted: string;
|
|
66
|
+
author_vesting_withdraw_rate_formatted: string;
|
|
67
|
+
author_next_vesting_withdrawal_formatted: string;
|
|
68
|
+
author_vesting_withdraw_rate: number;
|
|
69
|
+
author_next_vesting_withdrawal: string;
|
|
70
|
+
author_vesting_shares: string;
|
|
71
|
+
author_delegated_vesting_shares: string;
|
|
72
|
+
author_received_vesting_shares: string;
|
|
73
|
+
author_balance: string;
|
|
74
|
+
author_hbd_balance: string;
|
|
75
|
+
author_savings_hbd_balance: string;
|
|
76
|
+
author_savings_balance: string;
|
|
77
|
+
author_post_count: number;
|
|
78
|
+
author_voting_power: number;
|
|
79
|
+
author_voting_manabar: any;
|
|
80
|
+
author_downvote_manabar: any;
|
|
81
|
+
author_rc_manabar: any;
|
|
82
|
+
}
|
|
83
|
+
export interface ActivityHistoryParams {
|
|
84
|
+
username: string;
|
|
85
|
+
sortBy?: 'posts' | 'comments' | 'replies';
|
|
86
|
+
limit?: number;
|
|
87
|
+
startAuthor?: string;
|
|
88
|
+
startPermlink?: string;
|
|
89
|
+
observer?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface ActivityHistoryResponse {
|
|
92
|
+
result: ActivityHistoryItem[];
|
|
93
|
+
}
|
|
94
|
+
export interface ActivityDisplayItem {
|
|
95
|
+
id: number;
|
|
96
|
+
author: string;
|
|
97
|
+
permlink: string;
|
|
98
|
+
title: string;
|
|
99
|
+
body: string;
|
|
100
|
+
created: string;
|
|
101
|
+
category: string;
|
|
102
|
+
net_votes: number;
|
|
103
|
+
children: number;
|
|
104
|
+
total_payout_value: string;
|
|
105
|
+
pending_payout_value: string;
|
|
106
|
+
url: string;
|
|
107
|
+
type: 'post' | 'comment';
|
|
108
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface AccountHistoryOperation {
|
|
2
|
+
type: string;
|
|
3
|
+
value: any;
|
|
4
|
+
}
|
|
5
|
+
export interface AccountHistoryItem {
|
|
6
|
+
index: number;
|
|
7
|
+
timestamp: string;
|
|
8
|
+
block: number;
|
|
9
|
+
trx_in_block: number;
|
|
10
|
+
op_in_trx: number;
|
|
11
|
+
virtual_op: boolean;
|
|
12
|
+
trx_id: string;
|
|
13
|
+
op: AccountHistoryOperation;
|
|
14
|
+
}
|
|
15
|
+
export interface AccountHistoryResponse {
|
|
16
|
+
id: number;
|
|
17
|
+
jsonrpc: string;
|
|
18
|
+
result: AccountHistoryItem[];
|
|
19
|
+
}
|
|
20
|
+
export interface ActivityListItem {
|
|
21
|
+
id: string;
|
|
22
|
+
type: 'vote' | 'comment' | 'custom_json' | 'comment_options' | 'effective_comment_vote' | 'curation_reward' | 'author_reward' | 'comment_benefactor_reward' | 'other';
|
|
23
|
+
direction: 'in' | 'out';
|
|
24
|
+
timestamp: string;
|
|
25
|
+
block: number;
|
|
26
|
+
description: string;
|
|
27
|
+
details: any;
|
|
28
|
+
index: number;
|
|
29
|
+
author?: string;
|
|
30
|
+
permlink?: string;
|
|
31
|
+
voter?: string;
|
|
32
|
+
weight?: number;
|
|
33
|
+
payout?: string;
|
|
34
|
+
community?: string;
|
|
35
|
+
curator?: string;
|
|
36
|
+
reward?: string;
|
|
37
|
+
hbd_payout?: string;
|
|
38
|
+
hive_payout?: string;
|
|
39
|
+
vesting_payout?: string;
|
|
40
|
+
benefactor?: string;
|
|
41
|
+
parent_author?: string;
|
|
42
|
+
parent_permlink?: string;
|
|
43
|
+
}
|
|
44
|
+
export type DirectionFilter = 'all' | 'in' | 'out';
|
|
45
|
+
export type GeneralFilter = 'all' | 'votes' | 'comments' | 'replies' | 'curation' | 'others';
|
|
46
|
+
export type RewardFilter = 'all' | 'author' | 'curation' | 'benefactor';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Discussion {
|
|
2
|
+
active_votes: any[];
|
|
3
|
+
author: string;
|
|
4
|
+
permlink: string;
|
|
5
|
+
parent_author?: string;
|
|
6
|
+
parent_permlink?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
body?: string;
|
|
9
|
+
created?: string;
|
|
10
|
+
depth?: number;
|
|
11
|
+
children?: number;
|
|
12
|
+
net_votes?: number;
|
|
13
|
+
stats?: {
|
|
14
|
+
total_votes: number;
|
|
15
|
+
};
|
|
16
|
+
json_metadata?: string;
|
|
17
|
+
json_metadata_parsed?: any;
|
|
18
|
+
replies?: string[] | Discussion[];
|
|
19
|
+
}
|