hive-nectar 0.0.11__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.

Files changed (56) hide show
  1. {hive_nectar-0.0.11.dist-info → hive_nectar-0.1.0.dist-info}/METADATA +10 -11
  2. hive_nectar-0.1.0.dist-info/RECORD +88 -0
  3. nectar/__init__.py +1 -4
  4. nectar/account.py +791 -685
  5. nectar/amount.py +82 -21
  6. nectar/asset.py +1 -2
  7. nectar/block.py +34 -22
  8. nectar/blockchain.py +111 -143
  9. nectar/blockchaininstance.py +396 -247
  10. nectar/blockchainobject.py +33 -5
  11. nectar/cli.py +1058 -1349
  12. nectar/comment.py +313 -181
  13. nectar/community.py +39 -43
  14. nectar/constants.py +1 -14
  15. nectar/discussions.py +793 -139
  16. nectar/hive.py +137 -77
  17. nectar/hivesigner.py +106 -68
  18. nectar/imageuploader.py +33 -23
  19. nectar/instance.py +31 -79
  20. nectar/market.py +128 -264
  21. nectar/memo.py +40 -13
  22. nectar/message.py +23 -10
  23. nectar/nodelist.py +115 -81
  24. nectar/price.py +80 -61
  25. nectar/profile.py +6 -3
  26. nectar/rc.py +45 -25
  27. nectar/snapshot.py +285 -163
  28. nectar/storage.py +16 -5
  29. nectar/transactionbuilder.py +132 -41
  30. nectar/utils.py +37 -17
  31. nectar/version.py +1 -1
  32. nectar/vote.py +171 -30
  33. nectar/wallet.py +26 -19
  34. nectar/witness.py +153 -54
  35. nectarapi/graphenerpc.py +147 -133
  36. nectarapi/noderpc.py +12 -6
  37. nectarapi/rpcutils.py +12 -6
  38. nectarapi/version.py +1 -1
  39. nectarbase/ledgertransactions.py +24 -1
  40. nectarbase/objects.py +17 -6
  41. nectarbase/operations.py +160 -90
  42. nectarbase/signedtransactions.py +38 -2
  43. nectarbase/version.py +1 -1
  44. nectargraphenebase/account.py +295 -17
  45. nectargraphenebase/chains.py +0 -135
  46. nectargraphenebase/ecdsasig.py +152 -176
  47. nectargraphenebase/types.py +18 -4
  48. nectargraphenebase/unsignedtransactions.py +1 -1
  49. nectargraphenebase/version.py +1 -1
  50. hive_nectar-0.0.11.dist-info/RECORD +0 -91
  51. nectar/blurt.py +0 -562
  52. nectar/conveyor.py +0 -308
  53. nectar/steem.py +0 -581
  54. {hive_nectar-0.0.11.dist-info → hive_nectar-0.1.0.dist-info}/WHEEL +0 -0
  55. {hive_nectar-0.0.11.dist-info → hive_nectar-0.1.0.dist-info}/entry_points.txt +0 -0
  56. {hive_nectar-0.0.11.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: Hive or Steem instance for blockchain access
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
- >>> stm = Hive(node=nodelist.get_hive_nodes())
45
- >>> community = Community("hive-139531", blockchain_instance=stm)
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
- """Initialize a Community instance.
66
-
67
- Args:
68
- community: Either a community name (str) or a dictionary containing community data
69
- observer: Observer account for personalized results (default: "")
70
- full: If True, fetch full community data (default: True)
71
- lazy: If True, use lazy loading (default: False)
72
- blockchain_instance: Hive or Steem instance for blockchain access
73
- **kwargs: Additional arguments including 'hive_instance' or 'steem_instance'
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=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
- """Refresh the community's data from the blockchain.
88
+ """
89
+ Refresh the community's data from the blockchain.
92
90
 
93
- This method updates the community's data by fetching the latest information
94
- from the blockchain. It raises an exception if the community doesn't exist.
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 the community doesn't exist on the blockchain
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: Hive or Steem instance to use for blockchain access
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
- """Initialize the Communities list with the given parameters.
786
+ """
787
+ Initialize a Communities collection by querying the blockchain for community metadata.
791
788
 
792
- Args:
793
- sort: Sort order for communities (default: "rank")
794
- observer: Observer account for personalized results (optional)
795
- last: Last community name for pagination (optional)
796
- limit: Maximum number of communities to fetch (default: 100)
797
- lazy: If True, use lazy loading (default: False)
798
- full: If True, fetch full community data (default: True)
799
- blockchain_instance: Hive or Steem instance to use for blockchain access
800
- **kwargs: Additional arguments including 'steem_instance' or 'hive_instance'
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
- STEEM_100_PERCENT = 10000
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