hive-nectar 0.0.10__py3-none-any.whl → 0.1.0__py3-none-any.whl
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.
Potentially problematic release.
This version of hive-nectar might be problematic. Click here for more details.
- {hive_nectar-0.0.10.dist-info → hive_nectar-0.1.0.dist-info}/METADATA +10 -11
- hive_nectar-0.1.0.dist-info/RECORD +88 -0
- nectar/__init__.py +1 -4
- nectar/account.py +791 -685
- nectar/amount.py +82 -21
- nectar/asset.py +1 -2
- nectar/block.py +34 -22
- nectar/blockchain.py +111 -143
- nectar/blockchaininstance.py +396 -247
- nectar/blockchainobject.py +33 -5
- nectar/cli.py +1058 -1349
- nectar/comment.py +317 -182
- nectar/community.py +39 -43
- nectar/constants.py +1 -14
- nectar/discussions.py +793 -139
- nectar/hive.py +137 -77
- nectar/hivesigner.py +106 -68
- nectar/imageuploader.py +33 -23
- nectar/instance.py +31 -79
- nectar/market.py +128 -264
- nectar/memo.py +40 -13
- nectar/message.py +23 -10
- nectar/nodelist.py +118 -82
- nectar/price.py +80 -61
- nectar/profile.py +6 -3
- nectar/rc.py +45 -25
- nectar/snapshot.py +285 -163
- nectar/storage.py +16 -5
- nectar/transactionbuilder.py +132 -41
- nectar/utils.py +37 -17
- nectar/version.py +1 -1
- nectar/vote.py +171 -30
- nectar/wallet.py +26 -19
- nectar/witness.py +153 -54
- nectarapi/graphenerpc.py +147 -133
- nectarapi/noderpc.py +12 -6
- nectarapi/rpcutils.py +12 -6
- nectarapi/version.py +1 -1
- nectarbase/ledgertransactions.py +24 -1
- nectarbase/objects.py +17 -6
- nectarbase/operations.py +160 -90
- nectarbase/signedtransactions.py +38 -2
- nectarbase/version.py +1 -1
- nectargraphenebase/account.py +295 -17
- nectargraphenebase/chains.py +0 -135
- nectargraphenebase/ecdsasig.py +152 -176
- nectargraphenebase/types.py +18 -4
- nectargraphenebase/unsignedtransactions.py +1 -1
- nectargraphenebase/version.py +1 -1
- hive_nectar-0.0.10.dist-info/RECORD +0 -91
- nectar/blurt.py +0 -562
- nectar/conveyor.py +0 -308
- nectar/steem.py +0 -581
- {hive_nectar-0.0.10.dist-info → hive_nectar-0.1.0.dist-info}/WHEEL +0 -0
- {hive_nectar-0.0.10.dist-info → hive_nectar-0.1.0.dist-info}/entry_points.txt +0 -0
- {hive_nectar-0.0.10.dist-info → hive_nectar-0.1.0.dist-info}/licenses/LICENSE.txt +0 -0
nectar/community.py
CHANGED
|
@@ -29,8 +29,7 @@ class Community(BlockchainObject):
|
|
|
29
29
|
observer: Observer account for personalized results (default: "")
|
|
30
30
|
full: If True, fetch full community data (default: True)
|
|
31
31
|
lazy: If True, use lazy loading (default: False)
|
|
32
|
-
blockchain_instance:
|
|
33
|
-
**kwargs: Additional arguments including 'hive_instance' or 'steem_instance'
|
|
32
|
+
blockchain_instance: Blockchain instance for RPC access
|
|
34
33
|
|
|
35
34
|
Attributes:
|
|
36
35
|
type_id (int): Type identifier for blockchain objects (2 for communities)
|
|
@@ -41,8 +40,8 @@ class Community(BlockchainObject):
|
|
|
41
40
|
>>> from nectar.nodelist import NodeList
|
|
42
41
|
>>> nodelist = NodeList()
|
|
43
42
|
>>> nodelist.update_nodes()
|
|
44
|
-
>>>
|
|
45
|
-
>>> community = Community("hive-139531", blockchain_instance=
|
|
43
|
+
>>> hv = Hive(node=nodelist.get_hive_nodes())
|
|
44
|
+
>>> community = Community("hive-139531", blockchain_instance=hv)
|
|
46
45
|
>>> print(community)
|
|
47
46
|
<Community hive-139531>
|
|
48
47
|
|
|
@@ -60,42 +59,41 @@ class Community(BlockchainObject):
|
|
|
60
59
|
full: bool = True,
|
|
61
60
|
lazy: bool = False,
|
|
62
61
|
blockchain_instance=None,
|
|
63
|
-
**kwargs,
|
|
64
62
|
) -> None:
|
|
65
|
-
"""
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
"""
|
|
64
|
+
Create a Community wrapper for the given community identifier or raw data.
|
|
65
|
+
|
|
66
|
+
If `community` is a dict, it will be normalized via _parse_json_data before initialization.
|
|
67
|
+
This sets instance flags (full, lazy, observer) and resolves the blockchain instance used
|
|
68
|
+
for RPC calls (falls back to the shared global instance). The object is constructed with
|
|
69
|
+
its identifier field set to "name".
|
|
70
|
+
|
|
71
|
+
Parameters:
|
|
72
|
+
community: Community name (str) or a dict with community data.
|
|
73
|
+
observer: Account name used to request personalized data (optional).
|
|
74
|
+
full: If True, load complete community data when available.
|
|
75
|
+
lazy: If True, defer loading detail until accessed.
|
|
74
76
|
"""
|
|
75
77
|
self.full = full
|
|
76
78
|
self.lazy = lazy
|
|
77
79
|
self.observer = observer
|
|
78
|
-
if blockchain_instance is None:
|
|
79
|
-
if kwargs.get("steem_instance"):
|
|
80
|
-
blockchain_instance = kwargs["steem_instance"]
|
|
81
|
-
elif kwargs.get("hive_instance"):
|
|
82
|
-
blockchain_instance = kwargs["hive_instance"]
|
|
83
80
|
self.blockchain = blockchain_instance or shared_blockchain_instance()
|
|
84
81
|
if isinstance(community, dict):
|
|
85
82
|
community = self._parse_json_data(community)
|
|
86
83
|
super(Community, self).__init__(
|
|
87
|
-
community, lazy=lazy, full=full, id_item="name", blockchain_instance=
|
|
84
|
+
community, lazy=lazy, full=full, id_item="name", blockchain_instance=self.blockchain
|
|
88
85
|
)
|
|
89
86
|
|
|
90
87
|
def refresh(self) -> None:
|
|
91
|
-
"""
|
|
88
|
+
"""
|
|
89
|
+
Refresh the community's data from the blockchain.
|
|
92
90
|
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
Fetches the latest community record for this community's name via the bridge RPC and
|
|
92
|
+
reinitializes the Community object with the returned data (updating identifier and all fields).
|
|
93
|
+
If the instance is offline, the method returns without performing any RPC call.
|
|
95
94
|
|
|
96
95
|
Raises:
|
|
97
|
-
AccountDoesNotExistsException: If
|
|
98
|
-
OfflineHasNoRPCException: If not connected to the blockchain
|
|
96
|
+
AccountDoesNotExistsException: If no community data is returned for this community name.
|
|
99
97
|
"""
|
|
100
98
|
if not self.blockchain.is_connected():
|
|
101
99
|
return
|
|
@@ -772,8 +770,7 @@ class Communities(CommunityObject):
|
|
|
772
770
|
limit: Maximum number of communities to fetch (default: 100)
|
|
773
771
|
lazy: If True, use lazy loading (default: False)
|
|
774
772
|
full: If True, fetch full community data (default: True)
|
|
775
|
-
blockchain_instance:
|
|
776
|
-
**kwargs: Additional arguments including 'steem_instance' or 'hive_instance'
|
|
773
|
+
blockchain_instance: Blockchain instance to use for RPC access
|
|
777
774
|
"""
|
|
778
775
|
|
|
779
776
|
def __init__(
|
|
@@ -785,25 +782,24 @@ class Communities(CommunityObject):
|
|
|
785
782
|
lazy: bool = False,
|
|
786
783
|
full: bool = True,
|
|
787
784
|
blockchain_instance=None,
|
|
788
|
-
**kwargs,
|
|
789
785
|
) -> None:
|
|
790
|
-
"""
|
|
786
|
+
"""
|
|
787
|
+
Initialize a Communities collection by querying the blockchain for community metadata.
|
|
791
788
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
789
|
+
Fetches up to `limit` communities from the resolved blockchain instance using paginated bridge RPC calls and constructs Community objects from the results.
|
|
790
|
+
|
|
791
|
+
Parameters:
|
|
792
|
+
sort (str): Sort order for results (e.g., "rank"). Defaults to "rank".
|
|
793
|
+
observer (str | None): Account used to personalize results; passed through to the RPC call.
|
|
794
|
+
last (str | None): Starting community name for pagination; used as the RPC `last` parameter.
|
|
795
|
+
limit (int): Maximum number of communities to fetch (clamped per-request to 100). Defaults to 100.
|
|
796
|
+
lazy (bool): If True, created Community objects will use lazy loading. Defaults to False.
|
|
797
|
+
full (bool): If True, created Community objects will request full data. Defaults to True.
|
|
798
|
+
|
|
799
|
+
Notes:
|
|
800
|
+
- If no blockchain instance is connected, initialization returns early and yields an empty collection.
|
|
801
|
+
- The constructor ensures at most `limit` Community objects are created.
|
|
801
802
|
"""
|
|
802
|
-
if blockchain_instance is None:
|
|
803
|
-
if kwargs.get("steem_instance"):
|
|
804
|
-
blockchain_instance = kwargs["steem_instance"]
|
|
805
|
-
elif kwargs.get("hive_instance"):
|
|
806
|
-
blockchain_instance = kwargs["hive_instance"]
|
|
807
803
|
self.blockchain = blockchain_instance or shared_blockchain_instance()
|
|
808
804
|
|
|
809
805
|
if not self.blockchain.is_connected():
|
nectar/constants.py
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
STEEM_1_PERCENT = 100
|
|
6
|
-
STEEM_REVERSE_AUCTION_WINDOW_SECONDS_HF21 = 300
|
|
7
|
-
STEEM_REVERSE_AUCTION_WINDOW_SECONDS_HF20 = 900
|
|
8
|
-
STEEM_REVERSE_AUCTION_WINDOW_SECONDS_HF6 = 1800
|
|
9
|
-
STEEM_CONTENT_REWARD_PERCENT_HF16 = 7500
|
|
10
|
-
STEEM_CONTENT_REWARD_PERCENT_HF21 = 6500
|
|
11
|
-
STEEM_DOWNVOTE_POOL_PERCENT_HF21 = 2500
|
|
12
|
-
STEEM_VOTE_REGENERATION_SECONDS = 432000
|
|
13
|
-
STEEM_VOTING_MANA_REGENERATION_SECONDS = 432000
|
|
14
|
-
STEEM_VOTE_DUST_THRESHOLD = 50000000
|
|
15
|
-
STEEM_ROOT_POST_PARENT = ""
|
|
16
|
-
STEEM_RC_REGEN_TIME = 60 * 60 * 24 * 5
|
|
17
|
-
|
|
4
|
+
# Hive-only canonical constants
|
|
18
5
|
HIVE_100_PERCENT = 10000
|
|
19
6
|
HIVE_1_PERCENT = 100
|
|
20
7
|
HIVE_REVERSE_AUCTION_WINDOW_SECONDS_HF21 = 300
|