@ecency/sdk 1.5.0 → 1.5.1
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/browser/index.d.ts +160 -23
- package/dist/browser/index.js +657 -31
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +691 -30
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +657 -31
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -714,12 +714,14 @@ function parseAccounts(rawAccounts) {
|
|
|
714
714
|
// src/modules/accounts/queries/get-accounts-query-options.ts
|
|
715
715
|
function getAccountsQueryOptions(usernames) {
|
|
716
716
|
return queryOptions({
|
|
717
|
-
queryKey: ["accounts", "
|
|
717
|
+
queryKey: ["accounts", "list", ...usernames],
|
|
718
|
+
enabled: usernames.length > 0,
|
|
718
719
|
queryFn: async () => {
|
|
719
|
-
const response = await CONFIG.hiveClient.database.getAccounts(
|
|
720
|
+
const response = await CONFIG.hiveClient.database.getAccounts(
|
|
721
|
+
usernames
|
|
722
|
+
);
|
|
720
723
|
return parseAccounts(response);
|
|
721
|
-
}
|
|
722
|
-
enabled: usernames.length > 0
|
|
724
|
+
}
|
|
723
725
|
});
|
|
724
726
|
}
|
|
725
727
|
function getFollowCountQueryOptions(username) {
|
|
@@ -990,6 +992,22 @@ function getAccountPendingRecoveryQueryOptions(username) {
|
|
|
990
992
|
)
|
|
991
993
|
});
|
|
992
994
|
}
|
|
995
|
+
function getAccountReputationsQueryOptions(query, limit = 50) {
|
|
996
|
+
return queryOptions({
|
|
997
|
+
queryKey: ["accounts", "reputations", query, limit],
|
|
998
|
+
enabled: !!query,
|
|
999
|
+
queryFn: async () => {
|
|
1000
|
+
if (!query) {
|
|
1001
|
+
return [];
|
|
1002
|
+
}
|
|
1003
|
+
return CONFIG.hiveClient.call(
|
|
1004
|
+
"condenser_api",
|
|
1005
|
+
"get_account_reputations",
|
|
1006
|
+
[query, limit]
|
|
1007
|
+
);
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
993
1011
|
var ops = utils.operationOrders;
|
|
994
1012
|
var ACCOUNT_OPERATION_GROUPS = {
|
|
995
1013
|
transfers: [
|
|
@@ -1306,6 +1324,26 @@ function getEntryActiveVotesQueryOptions(entry) {
|
|
|
1306
1324
|
enabled: !!entry
|
|
1307
1325
|
});
|
|
1308
1326
|
}
|
|
1327
|
+
function getContentQueryOptions(author, permlink) {
|
|
1328
|
+
return queryOptions({
|
|
1329
|
+
queryKey: ["posts", "content", author, permlink],
|
|
1330
|
+
enabled: !!author && !!permlink,
|
|
1331
|
+
queryFn: async () => CONFIG.hiveClient.call("condenser_api", "get_content", [
|
|
1332
|
+
author,
|
|
1333
|
+
permlink
|
|
1334
|
+
])
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
function getContentRepliesQueryOptions(author, permlink) {
|
|
1338
|
+
return queryOptions({
|
|
1339
|
+
queryKey: ["posts", "content-replies", author, permlink],
|
|
1340
|
+
enabled: !!author && !!permlink,
|
|
1341
|
+
queryFn: async () => CONFIG.hiveClient.call("condenser_api", "get_content_replies", {
|
|
1342
|
+
author,
|
|
1343
|
+
permlink
|
|
1344
|
+
})
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1309
1347
|
function getPostHeaderQueryOptions(author, permlink) {
|
|
1310
1348
|
return queryOptions({
|
|
1311
1349
|
queryKey: ["posts", "post-header", author, permlink],
|
|
@@ -1367,6 +1405,212 @@ function getPostQueryOptions(author, permlink, observer = "", num) {
|
|
|
1367
1405
|
enabled: !!author && !!permlink && permlink.trim() !== "" && permlink.trim() !== "undefined"
|
|
1368
1406
|
});
|
|
1369
1407
|
}
|
|
1408
|
+
|
|
1409
|
+
// src/modules/bridge/requests.ts
|
|
1410
|
+
function bridgeApiCall(endpoint, params) {
|
|
1411
|
+
return CONFIG.hiveClient.call("bridge", endpoint, params);
|
|
1412
|
+
}
|
|
1413
|
+
async function resolvePost(post, observer, num) {
|
|
1414
|
+
const { json_metadata: json } = post;
|
|
1415
|
+
if (json?.original_author && json?.original_permlink && json.tags?.[0] === "cross-post") {
|
|
1416
|
+
try {
|
|
1417
|
+
const resp = await getPost(
|
|
1418
|
+
json.original_author,
|
|
1419
|
+
json.original_permlink,
|
|
1420
|
+
observer,
|
|
1421
|
+
num
|
|
1422
|
+
);
|
|
1423
|
+
if (resp) {
|
|
1424
|
+
return {
|
|
1425
|
+
...post,
|
|
1426
|
+
original_entry: resp,
|
|
1427
|
+
num
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
return post;
|
|
1431
|
+
} catch {
|
|
1432
|
+
return post;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
return { ...post, num };
|
|
1436
|
+
}
|
|
1437
|
+
async function resolvePosts(posts, observer) {
|
|
1438
|
+
const validatedPosts = posts.map(validateEntry);
|
|
1439
|
+
const resolved = await Promise.all(validatedPosts.map((p) => resolvePost(p, observer)));
|
|
1440
|
+
return filterDmcaEntry(resolved);
|
|
1441
|
+
}
|
|
1442
|
+
async function getPostsRanked(sort, start_author = "", start_permlink = "", limit = 20, tag = "", observer = "") {
|
|
1443
|
+
const resp = await bridgeApiCall("get_ranked_posts", {
|
|
1444
|
+
sort,
|
|
1445
|
+
start_author,
|
|
1446
|
+
start_permlink,
|
|
1447
|
+
limit,
|
|
1448
|
+
tag,
|
|
1449
|
+
observer
|
|
1450
|
+
});
|
|
1451
|
+
if (resp) {
|
|
1452
|
+
return resolvePosts(resp, observer);
|
|
1453
|
+
}
|
|
1454
|
+
return resp;
|
|
1455
|
+
}
|
|
1456
|
+
async function getAccountPosts(sort, account, start_author = "", start_permlink = "", limit = 20, observer = "") {
|
|
1457
|
+
if (CONFIG.dmcaAccounts.includes(account)) {
|
|
1458
|
+
return [];
|
|
1459
|
+
}
|
|
1460
|
+
const resp = await bridgeApiCall("get_account_posts", {
|
|
1461
|
+
sort,
|
|
1462
|
+
account,
|
|
1463
|
+
start_author,
|
|
1464
|
+
start_permlink,
|
|
1465
|
+
limit,
|
|
1466
|
+
observer
|
|
1467
|
+
});
|
|
1468
|
+
if (resp) {
|
|
1469
|
+
return resolvePosts(resp, observer);
|
|
1470
|
+
}
|
|
1471
|
+
return resp;
|
|
1472
|
+
}
|
|
1473
|
+
function validateEntry(entry) {
|
|
1474
|
+
const newEntry = {
|
|
1475
|
+
...entry,
|
|
1476
|
+
active_votes: Array.isArray(entry.active_votes) ? [...entry.active_votes] : [],
|
|
1477
|
+
beneficiaries: Array.isArray(entry.beneficiaries) ? [...entry.beneficiaries] : [],
|
|
1478
|
+
blacklists: Array.isArray(entry.blacklists) ? [...entry.blacklists] : [],
|
|
1479
|
+
replies: Array.isArray(entry.replies) ? [...entry.replies] : [],
|
|
1480
|
+
stats: entry.stats ? { ...entry.stats } : null
|
|
1481
|
+
};
|
|
1482
|
+
const requiredStringProps = [
|
|
1483
|
+
"author",
|
|
1484
|
+
"title",
|
|
1485
|
+
"body",
|
|
1486
|
+
"created",
|
|
1487
|
+
"category",
|
|
1488
|
+
"permlink",
|
|
1489
|
+
"url",
|
|
1490
|
+
"updated"
|
|
1491
|
+
];
|
|
1492
|
+
for (const prop of requiredStringProps) {
|
|
1493
|
+
if (newEntry[prop] == null) {
|
|
1494
|
+
newEntry[prop] = "";
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
if (newEntry.author_reputation == null) {
|
|
1498
|
+
newEntry.author_reputation = 0;
|
|
1499
|
+
}
|
|
1500
|
+
if (newEntry.children == null) {
|
|
1501
|
+
newEntry.children = 0;
|
|
1502
|
+
}
|
|
1503
|
+
if (newEntry.depth == null) {
|
|
1504
|
+
newEntry.depth = 0;
|
|
1505
|
+
}
|
|
1506
|
+
if (newEntry.net_rshares == null) {
|
|
1507
|
+
newEntry.net_rshares = 0;
|
|
1508
|
+
}
|
|
1509
|
+
if (newEntry.payout == null) {
|
|
1510
|
+
newEntry.payout = 0;
|
|
1511
|
+
}
|
|
1512
|
+
if (newEntry.percent_hbd == null) {
|
|
1513
|
+
newEntry.percent_hbd = 0;
|
|
1514
|
+
}
|
|
1515
|
+
if (!newEntry.stats) {
|
|
1516
|
+
newEntry.stats = {
|
|
1517
|
+
flag_weight: 0,
|
|
1518
|
+
gray: false,
|
|
1519
|
+
hide: false,
|
|
1520
|
+
total_votes: 0
|
|
1521
|
+
};
|
|
1522
|
+
}
|
|
1523
|
+
if (newEntry.author_payout_value == null) {
|
|
1524
|
+
newEntry.author_payout_value = "0.000 HBD";
|
|
1525
|
+
}
|
|
1526
|
+
if (newEntry.curator_payout_value == null) {
|
|
1527
|
+
newEntry.curator_payout_value = "0.000 HBD";
|
|
1528
|
+
}
|
|
1529
|
+
if (newEntry.max_accepted_payout == null) {
|
|
1530
|
+
newEntry.max_accepted_payout = "1000000.000 HBD";
|
|
1531
|
+
}
|
|
1532
|
+
if (newEntry.payout_at == null) {
|
|
1533
|
+
newEntry.payout_at = "";
|
|
1534
|
+
}
|
|
1535
|
+
if (newEntry.pending_payout_value == null) {
|
|
1536
|
+
newEntry.pending_payout_value = "0.000 HBD";
|
|
1537
|
+
}
|
|
1538
|
+
if (newEntry.promoted == null) {
|
|
1539
|
+
newEntry.promoted = "0.000 HBD";
|
|
1540
|
+
}
|
|
1541
|
+
if (newEntry.is_paidout == null) {
|
|
1542
|
+
newEntry.is_paidout = false;
|
|
1543
|
+
}
|
|
1544
|
+
return newEntry;
|
|
1545
|
+
}
|
|
1546
|
+
async function getPost(author = "", permlink = "", observer = "", num) {
|
|
1547
|
+
const resp = await bridgeApiCall("get_post", {
|
|
1548
|
+
author,
|
|
1549
|
+
permlink,
|
|
1550
|
+
observer
|
|
1551
|
+
});
|
|
1552
|
+
if (resp) {
|
|
1553
|
+
const validatedEntry = validateEntry(resp);
|
|
1554
|
+
const post = await resolvePost(validatedEntry, observer, num);
|
|
1555
|
+
return filterDmcaEntry(post);
|
|
1556
|
+
}
|
|
1557
|
+
return void 0;
|
|
1558
|
+
}
|
|
1559
|
+
async function getPostHeader(author = "", permlink = "") {
|
|
1560
|
+
const resp = await bridgeApiCall("get_post_header", {
|
|
1561
|
+
author,
|
|
1562
|
+
permlink
|
|
1563
|
+
});
|
|
1564
|
+
return resp ? validateEntry(resp) : resp;
|
|
1565
|
+
}
|
|
1566
|
+
async function getDiscussion(author, permlink, observer) {
|
|
1567
|
+
const resp = await bridgeApiCall("get_discussion", {
|
|
1568
|
+
author,
|
|
1569
|
+
permlink,
|
|
1570
|
+
observer: observer || author
|
|
1571
|
+
});
|
|
1572
|
+
if (resp) {
|
|
1573
|
+
const validatedResp = {};
|
|
1574
|
+
for (const [key, entry] of Object.entries(resp)) {
|
|
1575
|
+
validatedResp[key] = validateEntry(entry);
|
|
1576
|
+
}
|
|
1577
|
+
return validatedResp;
|
|
1578
|
+
}
|
|
1579
|
+
return resp;
|
|
1580
|
+
}
|
|
1581
|
+
async function getCommunity(name, observer = "") {
|
|
1582
|
+
return bridgeApiCall("get_community", { name, observer });
|
|
1583
|
+
}
|
|
1584
|
+
async function getCommunities(last = "", limit = 100, query, sort = "rank", observer = "") {
|
|
1585
|
+
return bridgeApiCall("list_communities", {
|
|
1586
|
+
last,
|
|
1587
|
+
limit,
|
|
1588
|
+
query,
|
|
1589
|
+
sort,
|
|
1590
|
+
observer
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
async function normalizePost(post) {
|
|
1594
|
+
const resp = await bridgeApiCall("normalize_post", { post });
|
|
1595
|
+
return resp ? validateEntry(resp) : resp;
|
|
1596
|
+
}
|
|
1597
|
+
async function getSubscriptions(account) {
|
|
1598
|
+
return bridgeApiCall("list_all_subscriptions", { account });
|
|
1599
|
+
}
|
|
1600
|
+
async function getSubscribers(community) {
|
|
1601
|
+
return bridgeApiCall("list_subscribers", { community });
|
|
1602
|
+
}
|
|
1603
|
+
async function getRelationshipBetweenAccounts(follower, following) {
|
|
1604
|
+
return bridgeApiCall("get_relationship_between_accounts", [
|
|
1605
|
+
follower,
|
|
1606
|
+
following
|
|
1607
|
+
]);
|
|
1608
|
+
}
|
|
1609
|
+
async function getProfiles(accounts, observer) {
|
|
1610
|
+
return bridgeApiCall("get_profiles", { accounts, observer });
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
// src/modules/posts/queries/get-discussions-query-options.ts
|
|
1370
1614
|
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
1371
1615
|
SortOrder2["trending"] = "trending";
|
|
1372
1616
|
SortOrder2["author_reputation"] = "author_reputation";
|
|
@@ -1464,6 +1708,13 @@ function getDiscussionsQueryOptions(entry, order = "created" /* created */, enab
|
|
|
1464
1708
|
select: (data) => sortDiscussions(entry, data, order)
|
|
1465
1709
|
});
|
|
1466
1710
|
}
|
|
1711
|
+
function getDiscussionQueryOptions(author, permlink, observer, enabled = true) {
|
|
1712
|
+
return queryOptions({
|
|
1713
|
+
queryKey: ["posts", "discussion", author, permlink, observer || author],
|
|
1714
|
+
enabled: enabled && !!author && !!permlink,
|
|
1715
|
+
queryFn: async () => getDiscussion(author, permlink, observer)
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1467
1718
|
function getAccountPostsInfiniteQueryOptions(username, filter = "posts", limit = 20, observer = "", enabled = true) {
|
|
1468
1719
|
return infiniteQueryOptions({
|
|
1469
1720
|
queryKey: ["posts", "account-posts", username ?? "", filter, limit, observer],
|
|
@@ -1513,6 +1764,35 @@ function getAccountPostsInfiniteQueryOptions(username, filter = "posts", limit =
|
|
|
1513
1764
|
}
|
|
1514
1765
|
});
|
|
1515
1766
|
}
|
|
1767
|
+
function getAccountPostsQueryOptions(username, filter = "posts", start_author = "", start_permlink = "", limit = 20, observer = "", enabled = true) {
|
|
1768
|
+
return queryOptions({
|
|
1769
|
+
queryKey: [
|
|
1770
|
+
"posts",
|
|
1771
|
+
"account-posts-page",
|
|
1772
|
+
username ?? "",
|
|
1773
|
+
filter,
|
|
1774
|
+
start_author,
|
|
1775
|
+
start_permlink,
|
|
1776
|
+
limit,
|
|
1777
|
+
observer
|
|
1778
|
+
],
|
|
1779
|
+
enabled: !!username && enabled,
|
|
1780
|
+
queryFn: async () => {
|
|
1781
|
+
if (!username) {
|
|
1782
|
+
return [];
|
|
1783
|
+
}
|
|
1784
|
+
const response = await getAccountPosts(
|
|
1785
|
+
filter,
|
|
1786
|
+
username,
|
|
1787
|
+
start_author,
|
|
1788
|
+
start_permlink,
|
|
1789
|
+
limit,
|
|
1790
|
+
observer
|
|
1791
|
+
);
|
|
1792
|
+
return filterDmcaEntry(response ?? []);
|
|
1793
|
+
}
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1516
1796
|
function getPostsRankedInfiniteQueryOptions(sort, tag, limit = 20, observer = "", enabled = true, _options = {}) {
|
|
1517
1797
|
return infiniteQueryOptions({
|
|
1518
1798
|
queryKey: ["posts", "posts-ranked", sort, tag, limit, observer],
|
|
@@ -1560,6 +1840,36 @@ function getPostsRankedInfiniteQueryOptions(sort, tag, limit = 20, observer = ""
|
|
|
1560
1840
|
}
|
|
1561
1841
|
});
|
|
1562
1842
|
}
|
|
1843
|
+
function getPostsRankedQueryOptions(sort, start_author = "", start_permlink = "", limit = 20, tag = "", observer = "", enabled = true) {
|
|
1844
|
+
return queryOptions({
|
|
1845
|
+
queryKey: [
|
|
1846
|
+
"posts",
|
|
1847
|
+
"posts-ranked-page",
|
|
1848
|
+
sort,
|
|
1849
|
+
start_author,
|
|
1850
|
+
start_permlink,
|
|
1851
|
+
limit,
|
|
1852
|
+
tag,
|
|
1853
|
+
observer
|
|
1854
|
+
],
|
|
1855
|
+
enabled,
|
|
1856
|
+
queryFn: async () => {
|
|
1857
|
+
let sanitizedTag = tag;
|
|
1858
|
+
if (CONFIG.dmcaTagRegexes.some((regex) => regex.test(tag))) {
|
|
1859
|
+
sanitizedTag = "";
|
|
1860
|
+
}
|
|
1861
|
+
const response = await getPostsRanked(
|
|
1862
|
+
sort,
|
|
1863
|
+
start_author,
|
|
1864
|
+
start_permlink,
|
|
1865
|
+
limit,
|
|
1866
|
+
sanitizedTag,
|
|
1867
|
+
observer
|
|
1868
|
+
);
|
|
1869
|
+
return filterDmcaEntry(response ?? []);
|
|
1870
|
+
}
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1563
1873
|
function getReblogsQueryOptions(username, activeUsername, limit = 200) {
|
|
1564
1874
|
return queryOptions({
|
|
1565
1875
|
queryKey: ["posts", "reblogs", username ?? "", limit],
|
|
@@ -1797,8 +2107,8 @@ function toEntryArray(x) {
|
|
|
1797
2107
|
return Array.isArray(x) ? x : [];
|
|
1798
2108
|
}
|
|
1799
2109
|
async function getVisibleFirstLevelThreadItems(container) {
|
|
1800
|
-
const
|
|
1801
|
-
const discussionItemsRaw = await CONFIG.queryClient.fetchQuery(
|
|
2110
|
+
const queryOptions86 = getDiscussionsQueryOptions(container, "created" /* created */, true);
|
|
2111
|
+
const discussionItemsRaw = await CONFIG.queryClient.fetchQuery(queryOptions86);
|
|
1802
2112
|
const discussionItems = toEntryArray(discussionItemsRaw);
|
|
1803
2113
|
if (discussionItems.length <= 1) {
|
|
1804
2114
|
return [];
|
|
@@ -2007,6 +2317,18 @@ function getWavesTrendingTagsQueryOptions(host, hours = 24) {
|
|
|
2007
2317
|
}
|
|
2008
2318
|
});
|
|
2009
2319
|
}
|
|
2320
|
+
function getNormalizePostQueryOptions(post, enabled = true) {
|
|
2321
|
+
return queryOptions({
|
|
2322
|
+
queryKey: [
|
|
2323
|
+
"posts",
|
|
2324
|
+
"normalize",
|
|
2325
|
+
post?.author ?? "",
|
|
2326
|
+
post?.permlink ?? ""
|
|
2327
|
+
],
|
|
2328
|
+
enabled: enabled && !!post,
|
|
2329
|
+
queryFn: async () => normalizePost(post)
|
|
2330
|
+
});
|
|
2331
|
+
}
|
|
2010
2332
|
|
|
2011
2333
|
// src/modules/accounts/queries/get-account-vote-history-infinite-query-options.ts
|
|
2012
2334
|
function isEntry(x) {
|
|
@@ -2057,6 +2379,13 @@ function getAccountVoteHistoryInfiniteQueryOptions(username, options) {
|
|
|
2057
2379
|
})
|
|
2058
2380
|
});
|
|
2059
2381
|
}
|
|
2382
|
+
function getProfilesQueryOptions(accounts, observer, enabled = true) {
|
|
2383
|
+
return queryOptions({
|
|
2384
|
+
queryKey: ["accounts", "profiles", accounts, observer ?? ""],
|
|
2385
|
+
enabled: enabled && accounts.length > 0,
|
|
2386
|
+
queryFn: async () => getProfiles(accounts, observer)
|
|
2387
|
+
});
|
|
2388
|
+
}
|
|
2060
2389
|
|
|
2061
2390
|
// src/modules/accounts/mutations/use-account-update.ts
|
|
2062
2391
|
function useAccountUpdate(username, accessToken, auth) {
|
|
@@ -2510,6 +2839,152 @@ function useAccountRevokeKey(username, options) {
|
|
|
2510
2839
|
...options
|
|
2511
2840
|
});
|
|
2512
2841
|
}
|
|
2842
|
+
|
|
2843
|
+
// src/modules/accounts/utils/account-power.ts
|
|
2844
|
+
var HIVE_VOTING_MANA_REGENERATION_SECONDS = 5 * 60 * 60 * 24;
|
|
2845
|
+
function vestsToRshares(vests, votingPowerValue, votePerc) {
|
|
2846
|
+
const vestingShares = vests * 1e6;
|
|
2847
|
+
const power = votingPowerValue * votePerc / 1e4 / 50 + 1;
|
|
2848
|
+
return power * vestingShares / 1e4;
|
|
2849
|
+
}
|
|
2850
|
+
function toDhiveAccountForVotingMana(account) {
|
|
2851
|
+
return {
|
|
2852
|
+
id: 0,
|
|
2853
|
+
name: account.name,
|
|
2854
|
+
owner: account.owner,
|
|
2855
|
+
active: account.active,
|
|
2856
|
+
posting: account.posting,
|
|
2857
|
+
memo_key: account.memo_key,
|
|
2858
|
+
json_metadata: account.json_metadata,
|
|
2859
|
+
posting_json_metadata: account.posting_json_metadata,
|
|
2860
|
+
proxy: account.proxy ?? "",
|
|
2861
|
+
last_owner_update: "",
|
|
2862
|
+
last_account_update: "",
|
|
2863
|
+
created: account.created,
|
|
2864
|
+
mined: false,
|
|
2865
|
+
owner_challenged: false,
|
|
2866
|
+
active_challenged: false,
|
|
2867
|
+
last_owner_proved: "",
|
|
2868
|
+
last_active_proved: "",
|
|
2869
|
+
recovery_account: account.recovery_account ?? "",
|
|
2870
|
+
reset_account: "",
|
|
2871
|
+
last_account_recovery: "",
|
|
2872
|
+
comment_count: 0,
|
|
2873
|
+
lifetime_vote_count: 0,
|
|
2874
|
+
post_count: account.post_count,
|
|
2875
|
+
can_vote: true,
|
|
2876
|
+
voting_power: account.voting_power,
|
|
2877
|
+
last_vote_time: account.last_vote_time,
|
|
2878
|
+
voting_manabar: account.voting_manabar,
|
|
2879
|
+
balance: account.balance,
|
|
2880
|
+
savings_balance: account.savings_balance,
|
|
2881
|
+
hbd_balance: account.hbd_balance,
|
|
2882
|
+
hbd_seconds: "0",
|
|
2883
|
+
hbd_seconds_last_update: "",
|
|
2884
|
+
hbd_last_interest_payment: "",
|
|
2885
|
+
savings_hbd_balance: account.savings_hbd_balance,
|
|
2886
|
+
savings_hbd_seconds: account.savings_hbd_seconds,
|
|
2887
|
+
savings_hbd_seconds_last_update: account.savings_hbd_seconds_last_update,
|
|
2888
|
+
savings_hbd_last_interest_payment: account.savings_hbd_last_interest_payment,
|
|
2889
|
+
savings_withdraw_requests: 0,
|
|
2890
|
+
reward_hbd_balance: account.reward_hbd_balance,
|
|
2891
|
+
reward_hive_balance: account.reward_hive_balance,
|
|
2892
|
+
reward_vesting_balance: account.reward_vesting_balance,
|
|
2893
|
+
reward_vesting_hive: account.reward_vesting_hive,
|
|
2894
|
+
curation_rewards: 0,
|
|
2895
|
+
posting_rewards: 0,
|
|
2896
|
+
vesting_shares: account.vesting_shares,
|
|
2897
|
+
delegated_vesting_shares: account.delegated_vesting_shares,
|
|
2898
|
+
received_vesting_shares: account.received_vesting_shares,
|
|
2899
|
+
vesting_withdraw_rate: account.vesting_withdraw_rate,
|
|
2900
|
+
next_vesting_withdrawal: account.next_vesting_withdrawal,
|
|
2901
|
+
withdrawn: account.withdrawn,
|
|
2902
|
+
to_withdraw: account.to_withdraw,
|
|
2903
|
+
withdraw_routes: 0,
|
|
2904
|
+
proxied_vsf_votes: account.proxied_vsf_votes ?? [],
|
|
2905
|
+
witnesses_voted_for: 0,
|
|
2906
|
+
average_bandwidth: 0,
|
|
2907
|
+
lifetime_bandwidth: 0,
|
|
2908
|
+
last_bandwidth_update: "",
|
|
2909
|
+
average_market_bandwidth: 0,
|
|
2910
|
+
lifetime_market_bandwidth: 0,
|
|
2911
|
+
last_market_bandwidth_update: "",
|
|
2912
|
+
last_post: account.last_post,
|
|
2913
|
+
last_root_post: ""
|
|
2914
|
+
};
|
|
2915
|
+
}
|
|
2916
|
+
function votingPower(account) {
|
|
2917
|
+
const calc = CONFIG.hiveClient.rc.calculateVPMana(
|
|
2918
|
+
toDhiveAccountForVotingMana(account)
|
|
2919
|
+
);
|
|
2920
|
+
return calc.percentage / 100;
|
|
2921
|
+
}
|
|
2922
|
+
function powerRechargeTime(power) {
|
|
2923
|
+
if (!Number.isFinite(power)) {
|
|
2924
|
+
throw new TypeError("Voting power must be a finite number");
|
|
2925
|
+
}
|
|
2926
|
+
if (power < 0 || power > 100) {
|
|
2927
|
+
throw new RangeError("Voting power must be between 0 and 100");
|
|
2928
|
+
}
|
|
2929
|
+
const missingPower = 100 - power;
|
|
2930
|
+
return missingPower * 100 * HIVE_VOTING_MANA_REGENERATION_SECONDS / 1e4;
|
|
2931
|
+
}
|
|
2932
|
+
function downVotingPower(account) {
|
|
2933
|
+
const totalShares = parseFloat(account.vesting_shares) + parseFloat(account.received_vesting_shares) - parseFloat(account.delegated_vesting_shares);
|
|
2934
|
+
const elapsed = Math.floor(Date.now() / 1e3) - account.downvote_manabar.last_update_time;
|
|
2935
|
+
const maxMana = totalShares * 1e6 / 4;
|
|
2936
|
+
if (maxMana <= 0) {
|
|
2937
|
+
return 0;
|
|
2938
|
+
}
|
|
2939
|
+
let currentMana = parseFloat(account.downvote_manabar.current_mana.toString()) + elapsed * maxMana / HIVE_VOTING_MANA_REGENERATION_SECONDS;
|
|
2940
|
+
if (currentMana > maxMana) {
|
|
2941
|
+
currentMana = maxMana;
|
|
2942
|
+
}
|
|
2943
|
+
const currentManaPerc = currentMana * 100 / maxMana;
|
|
2944
|
+
if (isNaN(currentManaPerc)) {
|
|
2945
|
+
return 0;
|
|
2946
|
+
}
|
|
2947
|
+
if (currentManaPerc > 100) {
|
|
2948
|
+
return 100;
|
|
2949
|
+
}
|
|
2950
|
+
return currentManaPerc;
|
|
2951
|
+
}
|
|
2952
|
+
function rcPower(account) {
|
|
2953
|
+
const calc = CONFIG.hiveClient.rc.calculateRCMana(account);
|
|
2954
|
+
return calc.percentage / 100;
|
|
2955
|
+
}
|
|
2956
|
+
function votingValue(account, dynamicProps, votingPowerValue, weight = 1e4) {
|
|
2957
|
+
if (!Number.isFinite(votingPowerValue) || !Number.isFinite(weight)) {
|
|
2958
|
+
return 0;
|
|
2959
|
+
}
|
|
2960
|
+
const { fundRecentClaims, fundRewardBalance, base, quote } = dynamicProps;
|
|
2961
|
+
if (!Number.isFinite(fundRecentClaims) || !Number.isFinite(fundRewardBalance) || !Number.isFinite(base) || !Number.isFinite(quote)) {
|
|
2962
|
+
return 0;
|
|
2963
|
+
}
|
|
2964
|
+
if (fundRecentClaims === 0 || quote === 0) {
|
|
2965
|
+
return 0;
|
|
2966
|
+
}
|
|
2967
|
+
let totalVests = 0;
|
|
2968
|
+
try {
|
|
2969
|
+
const vesting = parseAsset(account.vesting_shares).amount;
|
|
2970
|
+
const received = parseAsset(account.received_vesting_shares).amount;
|
|
2971
|
+
const delegated = parseAsset(account.delegated_vesting_shares).amount;
|
|
2972
|
+
if (![vesting, received, delegated].every(Number.isFinite)) {
|
|
2973
|
+
return 0;
|
|
2974
|
+
}
|
|
2975
|
+
totalVests = vesting + received - delegated;
|
|
2976
|
+
} catch {
|
|
2977
|
+
return 0;
|
|
2978
|
+
}
|
|
2979
|
+
if (!Number.isFinite(totalVests)) {
|
|
2980
|
+
return 0;
|
|
2981
|
+
}
|
|
2982
|
+
const rShares = vestsToRshares(totalVests, votingPowerValue, weight);
|
|
2983
|
+
if (!Number.isFinite(rShares)) {
|
|
2984
|
+
return 0;
|
|
2985
|
+
}
|
|
2986
|
+
return rShares / fundRecentClaims * fundRewardBalance * (base / quote);
|
|
2987
|
+
}
|
|
2513
2988
|
function useSignOperationByKey(username) {
|
|
2514
2989
|
return useMutation({
|
|
2515
2990
|
mutationKey: ["operations", "sign", username],
|
|
@@ -2667,6 +3142,33 @@ function useRemoveFragment(username, fragmentId, code) {
|
|
|
2667
3142
|
});
|
|
2668
3143
|
}
|
|
2669
3144
|
|
|
3145
|
+
// src/modules/posts/utils/validate-post-creating.ts
|
|
3146
|
+
var DEFAULT_VALIDATE_POST_DELAYS = [3e3, 3e3, 3e3];
|
|
3147
|
+
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
3148
|
+
async function getContent(author, permlink) {
|
|
3149
|
+
return CONFIG.hiveClient.call("condenser_api", "get_content", [
|
|
3150
|
+
author,
|
|
3151
|
+
permlink
|
|
3152
|
+
]);
|
|
3153
|
+
}
|
|
3154
|
+
async function validatePostCreating(author, permlink, attempts = 0, options) {
|
|
3155
|
+
const delays = options?.delays ?? DEFAULT_VALIDATE_POST_DELAYS;
|
|
3156
|
+
let response;
|
|
3157
|
+
try {
|
|
3158
|
+
response = await getContent(author, permlink);
|
|
3159
|
+
} catch (e) {
|
|
3160
|
+
response = void 0;
|
|
3161
|
+
}
|
|
3162
|
+
if (response || attempts >= delays.length) {
|
|
3163
|
+
return;
|
|
3164
|
+
}
|
|
3165
|
+
const waitMs = delays[attempts];
|
|
3166
|
+
if (waitMs > 0) {
|
|
3167
|
+
await delay(waitMs);
|
|
3168
|
+
}
|
|
3169
|
+
return validatePostCreating(author, permlink, attempts + 1, options);
|
|
3170
|
+
}
|
|
3171
|
+
|
|
2670
3172
|
// src/modules/analytics/mutations/index.ts
|
|
2671
3173
|
var mutations_exports = {};
|
|
2672
3174
|
__export(mutations_exports, {
|
|
@@ -3055,6 +3557,13 @@ function getCommunityContextQueryOptions(username, communityName) {
|
|
|
3055
3557
|
}
|
|
3056
3558
|
});
|
|
3057
3559
|
}
|
|
3560
|
+
function getCommunityQueryOptions(name, observer = "", enabled = true) {
|
|
3561
|
+
return queryOptions({
|
|
3562
|
+
queryKey: ["community", "single", name, observer],
|
|
3563
|
+
enabled: enabled && !!name,
|
|
3564
|
+
queryFn: async () => getCommunity(name ?? "", observer)
|
|
3565
|
+
});
|
|
3566
|
+
}
|
|
3058
3567
|
function getCommunitySubscribersQueryOptions(communityName) {
|
|
3059
3568
|
return queryOptions({
|
|
3060
3569
|
queryKey: ["communities", "subscribers", communityName],
|
|
@@ -3497,6 +4006,25 @@ function getOutgoingRcDelegationsInfiniteQueryOptions(username, limit = 100) {
|
|
|
3497
4006
|
getNextPageParam: (lastPage) => lastPage.length === limit ? lastPage[lastPage.length - 1].to : null
|
|
3498
4007
|
});
|
|
3499
4008
|
}
|
|
4009
|
+
function getIncomingRcQueryOptions(username) {
|
|
4010
|
+
return queryOptions({
|
|
4011
|
+
queryKey: ["wallet", "incoming-rc", username],
|
|
4012
|
+
enabled: !!username,
|
|
4013
|
+
queryFn: async () => {
|
|
4014
|
+
if (!username) {
|
|
4015
|
+
throw new Error("[SDK][Wallet] - Missing username for incoming RC");
|
|
4016
|
+
}
|
|
4017
|
+
const fetchApi = getBoundFetch();
|
|
4018
|
+
const response = await fetchApi(
|
|
4019
|
+
`${CONFIG.privateApiHost}/private-api/received-rc/${username}`
|
|
4020
|
+
);
|
|
4021
|
+
if (!response.ok) {
|
|
4022
|
+
throw new Error(`Failed to fetch incoming RC: ${response.status}`);
|
|
4023
|
+
}
|
|
4024
|
+
return response.json();
|
|
4025
|
+
}
|
|
4026
|
+
});
|
|
4027
|
+
}
|
|
3500
4028
|
function getReceivedVestingSharesQueryOptions(username) {
|
|
3501
4029
|
return queryOptions({
|
|
3502
4030
|
queryKey: ["wallet", "received-vesting-shares", username],
|
|
@@ -3541,15 +4069,15 @@ function getMarketStatisticsQueryOptions() {
|
|
|
3541
4069
|
});
|
|
3542
4070
|
}
|
|
3543
4071
|
function getMarketHistoryQueryOptions(seconds, startDate, endDate) {
|
|
3544
|
-
const
|
|
4072
|
+
const formatDate2 = (date) => {
|
|
3545
4073
|
return date.toISOString().replace(/\.\d{3}Z$/, "");
|
|
3546
4074
|
};
|
|
3547
4075
|
return queryOptions({
|
|
3548
4076
|
queryKey: ["market", "history", seconds, startDate.getTime(), endDate.getTime()],
|
|
3549
4077
|
queryFn: () => CONFIG.hiveClient.call("condenser_api", "get_market_history", [
|
|
3550
4078
|
seconds,
|
|
3551
|
-
|
|
3552
|
-
|
|
4079
|
+
formatDate2(startDate),
|
|
4080
|
+
formatDate2(endDate)
|
|
3553
4081
|
])
|
|
3554
4082
|
});
|
|
3555
4083
|
}
|
|
@@ -3564,13 +4092,13 @@ function getHiveHbdStatsQueryOptions() {
|
|
|
3564
4092
|
);
|
|
3565
4093
|
const now = /* @__PURE__ */ new Date();
|
|
3566
4094
|
const oneDayAgo = new Date(now.getTime() - 864e5);
|
|
3567
|
-
const
|
|
4095
|
+
const formatDate2 = (date) => {
|
|
3568
4096
|
return date.toISOString().replace(/\.\d{3}Z$/, "");
|
|
3569
4097
|
};
|
|
3570
4098
|
const dayChange = await CONFIG.hiveClient.call(
|
|
3571
4099
|
"condenser_api",
|
|
3572
4100
|
"get_market_history",
|
|
3573
|
-
[86400,
|
|
4101
|
+
[86400, formatDate2(oneDayAgo), formatDate2(now)]
|
|
3574
4102
|
);
|
|
3575
4103
|
const result = {
|
|
3576
4104
|
price: +stats.latest,
|
|
@@ -3599,6 +4127,21 @@ function getMarketDataQueryOptions(coin, vsCurrency, fromTs, toTs) {
|
|
|
3599
4127
|
}
|
|
3600
4128
|
});
|
|
3601
4129
|
}
|
|
4130
|
+
function formatDate(date) {
|
|
4131
|
+
return date.toISOString().replace(/\.\d{3}Z$/, "");
|
|
4132
|
+
}
|
|
4133
|
+
function getTradeHistoryQueryOptions(limit = 1e3, startDate, endDate) {
|
|
4134
|
+
const end = endDate ?? /* @__PURE__ */ new Date();
|
|
4135
|
+
const start = startDate ?? new Date(end.getTime() - 10 * 60 * 60 * 1e3);
|
|
4136
|
+
return queryOptions({
|
|
4137
|
+
queryKey: ["market", "trade-history", limit, start.getTime(), end.getTime()],
|
|
4138
|
+
queryFn: () => CONFIG.hiveClient.call("condenser_api", "get_trade_history", [
|
|
4139
|
+
formatDate(start),
|
|
4140
|
+
formatDate(end),
|
|
4141
|
+
limit
|
|
4142
|
+
])
|
|
4143
|
+
});
|
|
4144
|
+
}
|
|
3602
4145
|
|
|
3603
4146
|
// src/modules/market/requests.ts
|
|
3604
4147
|
async function parseJsonResponse(response) {
|
|
@@ -3909,6 +4452,89 @@ function getSearchPathQueryOptions(q) {
|
|
|
3909
4452
|
}
|
|
3910
4453
|
});
|
|
3911
4454
|
}
|
|
4455
|
+
|
|
4456
|
+
// src/modules/search/requests.ts
|
|
4457
|
+
async function parseJsonResponse2(response) {
|
|
4458
|
+
const parseBody = async () => {
|
|
4459
|
+
try {
|
|
4460
|
+
return await response.json();
|
|
4461
|
+
} catch {
|
|
4462
|
+
try {
|
|
4463
|
+
return await response.text();
|
|
4464
|
+
} catch {
|
|
4465
|
+
return void 0;
|
|
4466
|
+
}
|
|
4467
|
+
}
|
|
4468
|
+
};
|
|
4469
|
+
const data = await parseBody();
|
|
4470
|
+
if (!response.ok) {
|
|
4471
|
+
const error = new Error(`Request failed with status ${response.status}`);
|
|
4472
|
+
error.status = response.status;
|
|
4473
|
+
error.data = data;
|
|
4474
|
+
throw error;
|
|
4475
|
+
}
|
|
4476
|
+
if (data === void 0) {
|
|
4477
|
+
throw new Error("Response body was empty or invalid JSON");
|
|
4478
|
+
}
|
|
4479
|
+
return data;
|
|
4480
|
+
}
|
|
4481
|
+
async function search(q, sort, hideLow, since, scroll_id, votes) {
|
|
4482
|
+
const data = { q, sort, hide_low: hideLow };
|
|
4483
|
+
if (since) {
|
|
4484
|
+
data.since = since;
|
|
4485
|
+
}
|
|
4486
|
+
if (scroll_id) {
|
|
4487
|
+
data.scroll_id = scroll_id;
|
|
4488
|
+
}
|
|
4489
|
+
if (votes) {
|
|
4490
|
+
data.votes = votes;
|
|
4491
|
+
}
|
|
4492
|
+
const fetchApi = getBoundFetch();
|
|
4493
|
+
const response = await fetchApi(CONFIG.privateApiHost + "/search-api/search", {
|
|
4494
|
+
method: "POST",
|
|
4495
|
+
headers: {
|
|
4496
|
+
"Content-Type": "application/json"
|
|
4497
|
+
},
|
|
4498
|
+
body: JSON.stringify(data)
|
|
4499
|
+
});
|
|
4500
|
+
return parseJsonResponse2(response);
|
|
4501
|
+
}
|
|
4502
|
+
async function searchAccount(q = "", limit = 20, random = 1) {
|
|
4503
|
+
const data = { q, limit, random };
|
|
4504
|
+
const fetchApi = getBoundFetch();
|
|
4505
|
+
const response = await fetchApi(CONFIG.privateApiHost + "/search-api/search-account", {
|
|
4506
|
+
method: "POST",
|
|
4507
|
+
headers: {
|
|
4508
|
+
"Content-Type": "application/json"
|
|
4509
|
+
},
|
|
4510
|
+
body: JSON.stringify(data)
|
|
4511
|
+
});
|
|
4512
|
+
return parseJsonResponse2(response);
|
|
4513
|
+
}
|
|
4514
|
+
async function searchTag(q = "", limit = 20, random = 0) {
|
|
4515
|
+
const data = { q, limit, random };
|
|
4516
|
+
const fetchApi = getBoundFetch();
|
|
4517
|
+
const response = await fetchApi(CONFIG.privateApiHost + "/search-api/search-tag", {
|
|
4518
|
+
method: "POST",
|
|
4519
|
+
headers: {
|
|
4520
|
+
"Content-Type": "application/json"
|
|
4521
|
+
},
|
|
4522
|
+
body: JSON.stringify(data)
|
|
4523
|
+
});
|
|
4524
|
+
return parseJsonResponse2(response);
|
|
4525
|
+
}
|
|
4526
|
+
async function searchPath(q) {
|
|
4527
|
+
const fetchApi = getBoundFetch();
|
|
4528
|
+
const response = await fetchApi(CONFIG.privateApiHost + "/search-api/search-path", {
|
|
4529
|
+
method: "POST",
|
|
4530
|
+
headers: {
|
|
4531
|
+
"Content-Type": "application/json"
|
|
4532
|
+
},
|
|
4533
|
+
body: JSON.stringify({ q })
|
|
4534
|
+
});
|
|
4535
|
+
const data = await parseJsonResponse2(response);
|
|
4536
|
+
return data?.length > 0 ? data : [q];
|
|
4537
|
+
}
|
|
3912
4538
|
function getBoostPlusPricesQueryOptions(accessToken) {
|
|
3913
4539
|
return queryOptions({
|
|
3914
4540
|
queryKey: ["promotions", "boost-plus-prices"],
|
|
@@ -3980,7 +4606,7 @@ function getBoostPlusAccountPricesQueryOptions(account, accessToken) {
|
|
|
3980
4606
|
}
|
|
3981
4607
|
|
|
3982
4608
|
// src/modules/private-api/requests.ts
|
|
3983
|
-
async function
|
|
4609
|
+
async function parseJsonResponse3(response) {
|
|
3984
4610
|
if (!response.ok) {
|
|
3985
4611
|
let errorData = void 0;
|
|
3986
4612
|
try {
|
|
@@ -4004,7 +4630,7 @@ async function signUp(username, email, referral) {
|
|
|
4004
4630
|
},
|
|
4005
4631
|
body: JSON.stringify({ username, email, referral })
|
|
4006
4632
|
});
|
|
4007
|
-
const data = await
|
|
4633
|
+
const data = await parseJsonResponse3(response);
|
|
4008
4634
|
return { status: response.status, data };
|
|
4009
4635
|
}
|
|
4010
4636
|
async function subscribeEmail(email) {
|
|
@@ -4016,7 +4642,7 @@ async function subscribeEmail(email) {
|
|
|
4016
4642
|
},
|
|
4017
4643
|
body: JSON.stringify({ email })
|
|
4018
4644
|
});
|
|
4019
|
-
const data = await
|
|
4645
|
+
const data = await parseJsonResponse3(response);
|
|
4020
4646
|
return { status: response.status, data };
|
|
4021
4647
|
}
|
|
4022
4648
|
async function usrActivity(code, ty, bl = "", tx = "") {
|
|
@@ -4035,7 +4661,7 @@ async function usrActivity(code, ty, bl = "", tx = "") {
|
|
|
4035
4661
|
},
|
|
4036
4662
|
body: JSON.stringify(params)
|
|
4037
4663
|
});
|
|
4038
|
-
await
|
|
4664
|
+
await parseJsonResponse3(response);
|
|
4039
4665
|
}
|
|
4040
4666
|
async function getNotifications(code, filter, since = null, user = null) {
|
|
4041
4667
|
const data = {
|
|
@@ -4058,7 +4684,7 @@ async function getNotifications(code, filter, since = null, user = null) {
|
|
|
4058
4684
|
},
|
|
4059
4685
|
body: JSON.stringify(data)
|
|
4060
4686
|
});
|
|
4061
|
-
return
|
|
4687
|
+
return parseJsonResponse3(response);
|
|
4062
4688
|
}
|
|
4063
4689
|
async function saveNotificationSetting(code, username, system, allows_notify, notify_types, token) {
|
|
4064
4690
|
const data = {
|
|
@@ -4077,7 +4703,7 @@ async function saveNotificationSetting(code, username, system, allows_notify, no
|
|
|
4077
4703
|
},
|
|
4078
4704
|
body: JSON.stringify(data)
|
|
4079
4705
|
});
|
|
4080
|
-
return
|
|
4706
|
+
return parseJsonResponse3(response);
|
|
4081
4707
|
}
|
|
4082
4708
|
async function getNotificationSetting(code, username, token) {
|
|
4083
4709
|
const data = { code, username, token };
|
|
@@ -4089,7 +4715,7 @@ async function getNotificationSetting(code, username, token) {
|
|
|
4089
4715
|
},
|
|
4090
4716
|
body: JSON.stringify(data)
|
|
4091
4717
|
});
|
|
4092
|
-
return
|
|
4718
|
+
return parseJsonResponse3(response);
|
|
4093
4719
|
}
|
|
4094
4720
|
async function markNotifications(code, id) {
|
|
4095
4721
|
const data = {
|
|
@@ -4106,7 +4732,7 @@ async function markNotifications(code, id) {
|
|
|
4106
4732
|
},
|
|
4107
4733
|
body: JSON.stringify(data)
|
|
4108
4734
|
});
|
|
4109
|
-
return
|
|
4735
|
+
return parseJsonResponse3(response);
|
|
4110
4736
|
}
|
|
4111
4737
|
async function addImage(code, url) {
|
|
4112
4738
|
const data = { code, url };
|
|
@@ -4118,7 +4744,7 @@ async function addImage(code, url) {
|
|
|
4118
4744
|
},
|
|
4119
4745
|
body: JSON.stringify(data)
|
|
4120
4746
|
});
|
|
4121
|
-
return
|
|
4747
|
+
return parseJsonResponse3(response);
|
|
4122
4748
|
}
|
|
4123
4749
|
async function uploadImage(file, token, signal) {
|
|
4124
4750
|
const fetchApi = getBoundFetch();
|
|
@@ -4129,7 +4755,7 @@ async function uploadImage(file, token, signal) {
|
|
|
4129
4755
|
body: formData,
|
|
4130
4756
|
signal
|
|
4131
4757
|
});
|
|
4132
|
-
return
|
|
4758
|
+
return parseJsonResponse3(response);
|
|
4133
4759
|
}
|
|
4134
4760
|
async function deleteImage(code, imageId) {
|
|
4135
4761
|
const data = { code, id: imageId };
|
|
@@ -4141,7 +4767,7 @@ async function deleteImage(code, imageId) {
|
|
|
4141
4767
|
},
|
|
4142
4768
|
body: JSON.stringify(data)
|
|
4143
4769
|
});
|
|
4144
|
-
return
|
|
4770
|
+
return parseJsonResponse3(response);
|
|
4145
4771
|
}
|
|
4146
4772
|
async function addDraft(code, title, body, tags, meta) {
|
|
4147
4773
|
const data = { code, title, body, tags, meta };
|
|
@@ -4153,7 +4779,7 @@ async function addDraft(code, title, body, tags, meta) {
|
|
|
4153
4779
|
},
|
|
4154
4780
|
body: JSON.stringify(data)
|
|
4155
4781
|
});
|
|
4156
|
-
return
|
|
4782
|
+
return parseJsonResponse3(response);
|
|
4157
4783
|
}
|
|
4158
4784
|
async function updateDraft(code, draftId, title, body, tags, meta) {
|
|
4159
4785
|
const data = { code, id: draftId, title, body, tags, meta };
|
|
@@ -4165,7 +4791,7 @@ async function updateDraft(code, draftId, title, body, tags, meta) {
|
|
|
4165
4791
|
},
|
|
4166
4792
|
body: JSON.stringify(data)
|
|
4167
4793
|
});
|
|
4168
|
-
return
|
|
4794
|
+
return parseJsonResponse3(response);
|
|
4169
4795
|
}
|
|
4170
4796
|
async function deleteDraft(code, draftId) {
|
|
4171
4797
|
const data = { code, id: draftId };
|
|
@@ -4177,7 +4803,7 @@ async function deleteDraft(code, draftId) {
|
|
|
4177
4803
|
},
|
|
4178
4804
|
body: JSON.stringify(data)
|
|
4179
4805
|
});
|
|
4180
|
-
return
|
|
4806
|
+
return parseJsonResponse3(response);
|
|
4181
4807
|
}
|
|
4182
4808
|
async function addSchedule(code, permlink, title, body, meta, options, schedule, reblog) {
|
|
4183
4809
|
const data = {
|
|
@@ -4200,7 +4826,7 @@ async function addSchedule(code, permlink, title, body, meta, options, schedule,
|
|
|
4200
4826
|
},
|
|
4201
4827
|
body: JSON.stringify(data)
|
|
4202
4828
|
});
|
|
4203
|
-
return
|
|
4829
|
+
return parseJsonResponse3(response);
|
|
4204
4830
|
}
|
|
4205
4831
|
async function deleteSchedule(code, id) {
|
|
4206
4832
|
const data = { code, id };
|
|
@@ -4212,7 +4838,7 @@ async function deleteSchedule(code, id) {
|
|
|
4212
4838
|
},
|
|
4213
4839
|
body: JSON.stringify(data)
|
|
4214
4840
|
});
|
|
4215
|
-
return
|
|
4841
|
+
return parseJsonResponse3(response);
|
|
4216
4842
|
}
|
|
4217
4843
|
async function moveSchedule(code, id) {
|
|
4218
4844
|
const data = { code, id };
|
|
@@ -4224,7 +4850,7 @@ async function moveSchedule(code, id) {
|
|
|
4224
4850
|
},
|
|
4225
4851
|
body: JSON.stringify(data)
|
|
4226
4852
|
});
|
|
4227
|
-
return
|
|
4853
|
+
return parseJsonResponse3(response);
|
|
4228
4854
|
}
|
|
4229
4855
|
async function getPromotedPost(code, author, permlink) {
|
|
4230
4856
|
const data = { code, author, permlink };
|
|
@@ -4236,7 +4862,7 @@ async function getPromotedPost(code, author, permlink) {
|
|
|
4236
4862
|
},
|
|
4237
4863
|
body: JSON.stringify(data)
|
|
4238
4864
|
});
|
|
4239
|
-
return
|
|
4865
|
+
return parseJsonResponse3(response);
|
|
4240
4866
|
}
|
|
4241
4867
|
async function onboardEmail(username, email, friend) {
|
|
4242
4868
|
const dataBody = {
|
|
@@ -4255,7 +4881,7 @@ async function onboardEmail(username, email, friend) {
|
|
|
4255
4881
|
body: JSON.stringify(dataBody)
|
|
4256
4882
|
}
|
|
4257
4883
|
);
|
|
4258
|
-
return
|
|
4884
|
+
return parseJsonResponse3(response);
|
|
4259
4885
|
}
|
|
4260
4886
|
|
|
4261
4887
|
// src/modules/auth/requests.ts
|
|
@@ -4284,6 +4910,6 @@ async function hsTokenRenew(code) {
|
|
|
4284
4910
|
return data;
|
|
4285
4911
|
}
|
|
4286
4912
|
|
|
4287
|
-
export { ACCOUNT_OPERATION_GROUPS, ALL_ACCOUNT_OPERATIONS, ALL_NOTIFY_TYPES, CONFIG, ConfigManager, mutations_exports as EcencyAnalytics, EcencyQueriesManager, HiveSignerIntegration, keychain_exports as Keychain, NaiMap, NotificationFilter, NotificationViewType, NotifyTypes, ROLES, SortOrder, Symbol2 as Symbol, ThreeSpeakIntegration, addDraft, addImage, addSchedule, broadcastJson, buildProfileMetadata, checkUsernameWalletsPendingQueryOptions, decodeObj, dedupeAndSortKeyAuths, deleteDraft, deleteImage, deleteSchedule, encodeObj, extractAccountProfile, getAccessToken, getAccountFullQueryOptions, getAccountNotificationsInfiniteQueryOptions, getAccountPendingRecoveryQueryOptions, getAccountPostsInfiniteQueryOptions, getAccountRcQueryOptions, getAccountRecoveriesQueryOptions, getAccountSubscriptionsQueryOptions, getAccountVoteHistoryInfiniteQueryOptions, getAccountsQueryOptions, getActiveAccountBookmarksQueryOptions, getActiveAccountFavouritesQueryOptions, getAnnouncementsQueryOptions, getBoostPlusAccountPricesQueryOptions, getBoostPlusPricesQueryOptions, getBotsQueryOptions, getBoundFetch, getChainPropertiesQueryOptions, getCollateralizedConversionRequestsQueryOptions, getCommentHistoryQueryOptions, getCommunitiesQueryOptions, getCommunityContextQueryOptions, getCommunityPermissions, getCommunitySubscribersQueryOptions, getCommunityType, getControversialRisingInfiniteQueryOptions, getConversionRequestsQueryOptions, getCurrencyRate, getCurrencyRates, getCurrencyTokenRate, getDeletedEntryQueryOptions, getDiscoverCurationQueryOptions, getDiscoverLeaderboardQueryOptions, getDiscussionsQueryOptions, getDraftsQueryOptions, getDynamicPropsQueryOptions, getEntryActiveVotesQueryOptions, getFollowCountQueryOptions, getFollowingQueryOptions, getFragmentsQueryOptions, getFriendsInfiniteQueryOptions, getGalleryImagesQueryOptions, getGameStatusCheckQueryOptions, getHiveHbdStatsQueryOptions, getHivePoshLinksQueryOptions, getImagesQueryOptions, getLoginType, getMarketData, getMarketDataQueryOptions, getMarketHistoryQueryOptions, getMarketStatisticsQueryOptions, getMutedUsersQueryOptions, getNotificationSetting, getNotifications, getNotificationsInfiniteQueryOptions, getNotificationsSettingsQueryOptions, getNotificationsUnreadCountQueryOptions, getOpenOrdersQueryOptions, getOrderBookQueryOptions, getOutgoingRcDelegationsInfiniteQueryOptions, getPageStatsQueryOptions, getPointsQueryOptions, getPostHeaderQueryOptions, getPostQueryOptions, getPostTipsQueryOptions, getPostingKey, getPostsRankedInfiniteQueryOptions, getPromotePriceQueryOptions, getPromotedPost, getPromotedPostsQuery, getProposalQueryOptions, getProposalVotesInfiniteQueryOptions, getProposalsQueryOptions, getQueryClient, getRcStatsQueryOptions, getReblogsQueryOptions, getReceivedVestingSharesQueryOptions, getReferralsInfiniteQueryOptions, getReferralsStatsQueryOptions, getRefreshToken, getRelationshipBetweenAccountsQueryOptions, getRewardedCommunitiesQueryOptions, getSavingsWithdrawFromQueryOptions, getSchedulesQueryOptions, getSearchAccountQueryOptions, getSearchAccountsByUsernameQueryOptions, getSearchApiInfiniteQueryOptions, getSearchFriendsQueryOptions, getSearchPathQueryOptions, getSearchTopicsQueryOptions, getSimilarEntriesQueryOptions, getStatsQueryOptions, getTransactionsInfiniteQueryOptions, getTrendingTagsQueryOptions, getTrendingTagsWithStatsQueryOptions, getUser, getUserProposalVotesQueryOptions, getVestingDelegationsQueryOptions, getVisibleFirstLevelThreadItems, getWavesByHostQueryOptions, getWavesByTagQueryOptions, getWavesFollowingQueryOptions, getWavesTrendingTagsQueryOptions, getWithdrawRoutesQueryOptions, getWitnessesInfiniteQueryOptions, hsTokenRenew, isCommunity, lookupAccountsQueryOptions, makeQueryClient, mapThreadItemsToWaveEntries, markNotifications, moveSchedule, normalizeWaveEntryFromApi, onboardEmail, parseAccounts, parseAsset, parseProfileMetadata, roleMap, saveNotificationSetting, searchQueryOptions, signUp, sortDiscussions, subscribeEmail, toEntryArray, updateDraft, uploadImage, useAccountFavouriteAdd, useAccountFavouriteDelete, useAccountRelationsUpdate, useAccountRevokeKey, useAccountRevokePosting, useAccountUpdate, useAccountUpdateKeyAuths, useAccountUpdatePassword, useAccountUpdateRecovery, useAddFragment, useBookmarkAdd, useBookmarkDelete, useBroadcastMutation, useEditFragment, useGameClaim, useRecordActivity, useRemoveFragment, useSignOperationByHivesigner, useSignOperationByKey, useSignOperationByKeychain, usrActivity };
|
|
4913
|
+
export { ACCOUNT_OPERATION_GROUPS, ALL_ACCOUNT_OPERATIONS, ALL_NOTIFY_TYPES, CONFIG, ConfigManager, mutations_exports as EcencyAnalytics, EcencyQueriesManager, HiveSignerIntegration, keychain_exports as Keychain, NaiMap, NotificationFilter, NotificationViewType, NotifyTypes, ROLES, SortOrder, Symbol2 as Symbol, ThreeSpeakIntegration, addDraft, addImage, addSchedule, bridgeApiCall, broadcastJson, buildProfileMetadata, checkUsernameWalletsPendingQueryOptions, decodeObj, dedupeAndSortKeyAuths, deleteDraft, deleteImage, deleteSchedule, downVotingPower, encodeObj, extractAccountProfile, getAccessToken, getAccountFullQueryOptions, getAccountNotificationsInfiniteQueryOptions, getAccountPendingRecoveryQueryOptions, getAccountPosts, getAccountPostsInfiniteQueryOptions, getAccountPostsQueryOptions, getAccountRcQueryOptions, getAccountRecoveriesQueryOptions, getAccountReputationsQueryOptions, getAccountSubscriptionsQueryOptions, getAccountVoteHistoryInfiniteQueryOptions, getAccountsQueryOptions, getActiveAccountBookmarksQueryOptions, getActiveAccountFavouritesQueryOptions, getAnnouncementsQueryOptions, getBoostPlusAccountPricesQueryOptions, getBoostPlusPricesQueryOptions, getBotsQueryOptions, getBoundFetch, getChainPropertiesQueryOptions, getCollateralizedConversionRequestsQueryOptions, getCommentHistoryQueryOptions, getCommunities, getCommunitiesQueryOptions, getCommunity, getCommunityContextQueryOptions, getCommunityPermissions, getCommunityQueryOptions, getCommunitySubscribersQueryOptions, getCommunityType, getContentQueryOptions, getContentRepliesQueryOptions, getControversialRisingInfiniteQueryOptions, getConversionRequestsQueryOptions, getCurrencyRate, getCurrencyRates, getCurrencyTokenRate, getDeletedEntryQueryOptions, getDiscoverCurationQueryOptions, getDiscoverLeaderboardQueryOptions, getDiscussion, getDiscussionQueryOptions, getDiscussionsQueryOptions, getDraftsQueryOptions, getDynamicPropsQueryOptions, getEntryActiveVotesQueryOptions, getFollowCountQueryOptions, getFollowingQueryOptions, getFragmentsQueryOptions, getFriendsInfiniteQueryOptions, getGalleryImagesQueryOptions, getGameStatusCheckQueryOptions, getHiveHbdStatsQueryOptions, getHivePoshLinksQueryOptions, getImagesQueryOptions, getIncomingRcQueryOptions, getLoginType, getMarketData, getMarketDataQueryOptions, getMarketHistoryQueryOptions, getMarketStatisticsQueryOptions, getMutedUsersQueryOptions, getNormalizePostQueryOptions, getNotificationSetting, getNotifications, getNotificationsInfiniteQueryOptions, getNotificationsSettingsQueryOptions, getNotificationsUnreadCountQueryOptions, getOpenOrdersQueryOptions, getOrderBookQueryOptions, getOutgoingRcDelegationsInfiniteQueryOptions, getPageStatsQueryOptions, getPointsQueryOptions, getPost, getPostHeader, getPostHeaderQueryOptions, getPostQueryOptions, getPostTipsQueryOptions, getPostingKey, getPostsRanked, getPostsRankedInfiniteQueryOptions, getPostsRankedQueryOptions, getProfiles, getProfilesQueryOptions, getPromotePriceQueryOptions, getPromotedPost, getPromotedPostsQuery, getProposalQueryOptions, getProposalVotesInfiniteQueryOptions, getProposalsQueryOptions, getQueryClient, getRcStatsQueryOptions, getReblogsQueryOptions, getReceivedVestingSharesQueryOptions, getReferralsInfiniteQueryOptions, getReferralsStatsQueryOptions, getRefreshToken, getRelationshipBetweenAccounts, getRelationshipBetweenAccountsQueryOptions, getRewardedCommunitiesQueryOptions, getSavingsWithdrawFromQueryOptions, getSchedulesQueryOptions, getSearchAccountQueryOptions, getSearchAccountsByUsernameQueryOptions, getSearchApiInfiniteQueryOptions, getSearchFriendsQueryOptions, getSearchPathQueryOptions, getSearchTopicsQueryOptions, getSimilarEntriesQueryOptions, getStatsQueryOptions, getSubscribers, getSubscriptions, getTradeHistoryQueryOptions, getTransactionsInfiniteQueryOptions, getTrendingTagsQueryOptions, getTrendingTagsWithStatsQueryOptions, getUser, getUserProposalVotesQueryOptions, getVestingDelegationsQueryOptions, getVisibleFirstLevelThreadItems, getWavesByHostQueryOptions, getWavesByTagQueryOptions, getWavesFollowingQueryOptions, getWavesTrendingTagsQueryOptions, getWithdrawRoutesQueryOptions, getWitnessesInfiniteQueryOptions, hsTokenRenew, isCommunity, lookupAccountsQueryOptions, makeQueryClient, mapThreadItemsToWaveEntries, markNotifications, moveSchedule, normalizePost, normalizeWaveEntryFromApi, onboardEmail, parseAccounts, parseAsset, parseProfileMetadata, powerRechargeTime, rcPower, resolvePost, roleMap, saveNotificationSetting, search, searchAccount, searchPath, searchQueryOptions, searchTag, signUp, sortDiscussions, subscribeEmail, toEntryArray, updateDraft, uploadImage, useAccountFavouriteAdd, useAccountFavouriteDelete, useAccountRelationsUpdate, useAccountRevokeKey, useAccountRevokePosting, useAccountUpdate, useAccountUpdateKeyAuths, useAccountUpdatePassword, useAccountUpdateRecovery, useAddFragment, useBookmarkAdd, useBookmarkDelete, useBroadcastMutation, useEditFragment, useGameClaim, useRecordActivity, useRemoveFragment, useSignOperationByHivesigner, useSignOperationByKey, useSignOperationByKeychain, usrActivity, validatePostCreating, votingPower, votingValue };
|
|
4288
4914
|
//# sourceMappingURL=index.js.map
|
|
4289
4915
|
//# sourceMappingURL=index.js.map
|