hive-nectar 0.1.1__py3-none-any.whl → 0.1.3__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hive-nectar
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Hive Blockchain Python Library
5
5
  Project-URL: Homepage, http://www.github.com/thecrazygm/hive-nectar
6
6
  Project-URL: Download, https://github.com/thecrazygm/hive-nectar/tarball/0.1.0b
@@ -48,7 +48,6 @@ Requires-Python: >=3.10
48
48
  Requires-Dist: appdirs
49
49
  Requires-Dist: asn1crypto
50
50
  Requires-Dist: click
51
- Requires-Dist: click-shell
52
51
  Requires-Dist: cryptography
53
52
  Requires-Dist: diff-match-patch
54
53
  Requires-Dist: ecdsa
@@ -1,26 +1,27 @@
1
1
  nectar/__init__.py,sha256=zy2BLTHFDp70FCUzqxOJfXIbII78Md9FHcHYiSkvmLA,458
2
- nectar/account.py,sha256=5MrlA2cdDEdVGUiqxJ4sdiw_R-F2QKW5yeS5z54rX9I,191917
2
+ nectar/account.py,sha256=V4yHwiPxLfkSYaaEqGRz5Dt6hF3xG4XKGVdHb5k2eKE,193895
3
3
  nectar/amount.py,sha256=ZEECuR_2uwcwjaenXl96yPAv2w3X_Cs2ZU-X-_44tL8,21688
4
4
  nectar/asciichart.py,sha256=DwPyZAqne6o9L_PPRtlw6Xj0QdOZ-aId1lpOnmbyc6Q,8828
5
5
  nectar/asset.py,sha256=sxrxLb4yP3pwvs3gcHBeN68zH57kFmsvd6FsDb08u2k,2732
6
- nectar/block.py,sha256=irRh-Bh23qkM_u9lv4WcBUiVyYROBIO_kTzutmidI9w,17757
7
- nectar/blockchain.py,sha256=yLZxV7N07HTB7oMxZuXYXKWc1Q1RcdXsnM5pqA1QLCg,49501
8
- nectar/blockchaininstance.py,sha256=7aVmrjyqWrRPo7gFwb2wCEC-E0bGgQN7l519N-82JyQ,104850
6
+ nectar/block.py,sha256=_E6VvRnKNX71mtEqkNvmE056W47ILtUShGfxczmfsyQ,17721
7
+ nectar/blockchain.py,sha256=emYKvsxBN8AeQAYq_vDj3LemWfLJoWyvvytt0avz_QA,49489
8
+ nectar/blockchaininstance.py,sha256=4S6yFGHeZRdRtTN3A1B-DbQj3fDrDFBH5M1l4DbPMUY,105406
9
9
  nectar/blockchainobject.py,sha256=fq_ocT_So0y5neZzs8v_LmBfKlvDdXwsBj3_ZvO7fkg,8660
10
- nectar/cli.py,sha256=FgkZsuX1iXnWMoVglnAB4-4lC4u8Wcla2oP2iIxYn68,212838
11
- nectar/comment.py,sha256=EzCqvFhLrWvVD4Af5lPaSR_-e-vCR9Q6Er9Ha1GXBKo,58755
10
+ nectar/cli.py,sha256=cakZ6FReSQUVpLxHIsya0nNcquTGUbG_7Dm2W0EyiEM,214710
11
+ nectar/comment.py,sha256=W7NOKsQS1UucJAZ01yyHw8_71YANEbzB6NApSr0CQtM,59182
12
12
  nectar/community.py,sha256=exeYHRLfLfzylZn-dL8A-XLfO2__gd3GE4Zg2Nq9fes,31810
13
13
  nectar/constants.py,sha256=d_B4XfCeCysvczThCtBjrMpuKwFXZ0_xmBvCIyI4FhU,4498
14
14
  nectar/discussions.py,sha256=Nb-i_9ltLLz8gBJbPgNle6J68w906NP_aBr-LLL3has,109187
15
15
  nectar/exceptions.py,sha256=AKA75cDNnpioZPe2XcNWvyAVPRLcHBfPyBwjYVFOJC0,2884
16
+ nectar/haf.py,sha256=uE_9UZEaeZ1EXrXlWc5QgBuz2ijgeskJDDet56EruhM,13570
16
17
  nectar/hive.py,sha256=PIOuWjg1cY2fAwf9AT3DCj7i3Tk1AGN3oHzRNvi1OwM,27597
17
- nectar/hivesigner.py,sha256=RpFb8EoYYk7K-cmEPalpr0BiWV87npJoXq8z2QeLS_I,17510
18
+ nectar/hivesigner.py,sha256=QLvIg6in2GZjrQS3BJM7vsC1wU3qCmgLRogruaBICwQ,17884
18
19
  nectar/imageuploader.py,sha256=Qz1N1BPjuQVvh1SUItyZLwGVc8xYXxmnrADVpWPld6E,3436
19
20
  nectar/instance.py,sha256=JwHluHm1hUtjylUAqkB9IubGxyIeyCmAIpwLW1_qz6M,2718
20
- nectar/market.py,sha256=oGl2CVlCaLVicKkHTNtu2UB_z3ddu1MIBlPZE2cfFCk,39002
21
- nectar/memo.py,sha256=PQxF54bVqU8VnBUGy3aYxeNRMVIyAIZslqqrVZxl61o,19987
21
+ nectar/market.py,sha256=siUc2jU_E_q_E0wKb0ktnznPuSeXOESntuspOC4Rtbk,38944
22
+ nectar/memo.py,sha256=v33ri4qh6p5-QGuFpD6R0AS1hRafrirOy3eEbLZT7nw,19989
22
23
  nectar/message.py,sha256=m53YjIY9gAXN7kjxREoeMkRxVIsyQuqRwj_Yk-Uclp4,13641
23
- nectar/nodelist.py,sha256=Km9P2S1gRYRTgJ6Z1MpTVbEBK1Wymexv7GgM2_AVnYA,22208
24
+ nectar/nodelist.py,sha256=uFbMpN0_dGKwvjntA-49atAcLaT3MmXg9y0t0GJ7ycU,21457
24
25
  nectar/price.py,sha256=5TLcWREki2Jl4U9xL6V6_a9jW8c974aJqL7EANEeuDs,22730
25
26
  nectar/profile.py,sha256=loVIWX2CBtMqaVB-jRJeUD3uhF_0pMflqIYI0pRbZXY,2170
26
27
  nectar/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -28,8 +29,8 @@ nectar/rc.py,sha256=EKiL1Hw2YhTj0zlwbjJEsRGtyNNw7WVMrtWgCvR7Zaw,14407
28
29
  nectar/snapshot.py,sha256=z6qsTTZ0sJuP9fCVVwg1AUjAA3pjl9V9uouYUJJhywo,40967
29
30
  nectar/storage.py,sha256=B_V_rD3xHArNfzyOMd9uKaI0qQpB9odj67iMkwDSsY0,2788
30
31
  nectar/transactionbuilder.py,sha256=Ji5jIKDIY1-h40obTdJIfpBPdPt_QozUaLqH3HrEF8A,31663
31
- nectar/utils.py,sha256=FqFy9-qePrvqMI-NloE2wEPd5AdvlPic4UljAwslrdk,19895
32
- nectar/version.py,sha256=wCRHhfMdCUo68JZ0hk3D3RtahZA6FH2XxtH9K5lu020,76
32
+ nectar/utils.py,sha256=HWDNg3bZmsczvrgImzSrAajJEvIxtdYkf75eBaQaTok,21070
33
+ nectar/version.py,sha256=VafjOiCwpEB6BLoFUPsL7S2nniZfzWT-A42sbQewV6Y,76
33
34
  nectar/vote.py,sha256=26OzZUw3ZNKbLFQ766vv32qMxiDld94csEjMGzeU4WU,28641
34
35
  nectar/wallet.py,sha256=VUxsKLveb4QokfAEDQFAkxZgmiWAppqFhHOm2ayBlH4,16777
35
36
  nectar/witness.py,sha256=lNk3CwHI21HDrckPUF1D6CTZp7HEFSoT_l4XmXnAtKY,29155
@@ -40,7 +41,7 @@ nectarapi/node.py,sha256=mjK-fMFJ2icDaOUBoiUuDU-beo3aQK0HGwt0l0pC0YQ,5456
40
41
  nectarapi/noderpc.py,sha256=K96Mt5g5-T3npfFZoWmVl0xhFfifUrlxpQml3AixlFE,10767
41
42
  nectarapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
43
  nectarapi/rpcutils.py,sha256=OQQPApgzViYggeVrRKeQ15w6iWzUeIHI11rpNv4oMJQ,3096
43
- nectarapi/version.py,sha256=wCRHhfMdCUo68JZ0hk3D3RtahZA6FH2XxtH9K5lu020,76
44
+ nectarapi/version.py,sha256=VafjOiCwpEB6BLoFUPsL7S2nniZfzWT-A42sbQewV6Y,76
44
45
  nectarbase/__init__.py,sha256=O11coqB-Woq_yp946kA1b8hzqSdDcK9j9gwenx7d6JE,253
45
46
  nectarbase/ledgertransactions.py,sha256=_1vNbybdT2kGBisQJfaP0ZJHLabV7VD6_Us0Hf30cD0,3773
46
47
  nectarbase/memo.py,sha256=Ix5Uhan7x2rz54_QMSQ-Z5rZz-FqvR3i13H3cGEnPIY,7496
@@ -51,11 +52,11 @@ nectarbase/operations.py,sha256=k6tYdFjebs__sIjz1cZ5k9P-X52HNdT9aSFy7KKG6mI,5242
51
52
  nectarbase/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
53
  nectarbase/signedtransactions.py,sha256=0YpmcU0hEx7rALV9IbXgk6W2ilmBzbo12dveqSlL_TI,3541
53
54
  nectarbase/transactions.py,sha256=D7TK4Pkxr1N7p0Yh2bxvdXpOuEYpLl2tWK84Pj_93c0,319
54
- nectarbase/version.py,sha256=wCRHhfMdCUo68JZ0hk3D3RtahZA6FH2XxtH9K5lu020,76
55
+ nectarbase/version.py,sha256=VafjOiCwpEB6BLoFUPsL7S2nniZfzWT-A42sbQewV6Y,76
55
56
  nectargrapheneapi/__init__.py,sha256=_Gxdt_qaQQwwYABHEFBuf4tMh93ItIa3HPBH9nk1PTw,151
56
57
  nectargrapheneapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
58
  nectargraphenebase/__init__.py,sha256=66IxULO3eMKcx-nRDFDLz0YfEvXCkty08xjt9M1WgyY,577
58
- nectargraphenebase/account.py,sha256=ILrfxR0xyZIC09cTwsTJpmPG1o0jk0yTxV4-jNGhTZo,38582
59
+ nectargraphenebase/account.py,sha256=o81CDtNzEefyZeHYWTx677qKG7mb82jNEFkdX2FVK0o,38547
59
60
  nectargraphenebase/aes.py,sha256=BywHJR8F7n2IBXhBmXqyc61DlVXcJ_QIE9qkubFdX2M,1578
60
61
  nectargraphenebase/base58.py,sha256=7ilcjbwV3YGDL3a5MCilR03P-p5kNVafrmsRsftr0d8,5410
61
62
  nectargraphenebase/bip32.py,sha256=UjqgbBvvdya3gQRD73ccdfEQL4brxs4DWhM9vTvRMpc,16023
@@ -72,7 +73,7 @@ nectargraphenebase/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
73
  nectargraphenebase/signedtransactions.py,sha256=rhFEQDNcOau08qnNAf_3UxJDXtIpi5Y8tOFDXZK1bPw,7119
73
74
  nectargraphenebase/types.py,sha256=d_4asPAmcQ61dmsXEAsXalUElAPfdmKBMuL6OMIysvI,10237
74
75
  nectargraphenebase/unsignedtransactions.py,sha256=02jtLuTp-xNV1ujNOmMoUvx364kLMT5x7txeWeA_PJE,9238
75
- nectargraphenebase/version.py,sha256=wCRHhfMdCUo68JZ0hk3D3RtahZA6FH2XxtH9K5lu020,76
76
+ nectargraphenebase/version.py,sha256=VafjOiCwpEB6BLoFUPsL7S2nniZfzWT-A42sbQewV6Y,76
76
77
  nectarstorage/__init__.py,sha256=nEM9OMoHqHPS6IoV_JzVyxPRORz0DCeS7Yv-MwjmWoQ,1772
77
78
  nectarstorage/base.py,sha256=h7Oca1_RaJw39P1I_xXRKup016pS8zCLOs3e4IHKKdE,9734
78
79
  nectarstorage/exceptions.py,sha256=0erk_d0Ejia9td_Ke7XFBl17H1BxbM42gFpkej8EbV0,421
@@ -81,8 +82,8 @@ nectarstorage/masterpassword.py,sha256=xOAOZvVfIctfGiwIed_XpKnWcGDla95qp8osTLyYY
81
82
  nectarstorage/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
83
  nectarstorage/ram.py,sha256=Cy6JbMrlgcEG673_KqfyaofhAdJR-luRKTedj3qTZEE,1034
83
84
  nectarstorage/sqlite.py,sha256=ZKJxPL0AZjJIlwjxCEh6GGcjQzlBPuWs6tj40oPZz3M,10635
84
- hive_nectar-0.1.1.dist-info/METADATA,sha256=3LZzNZ0B7jJbVRANxrN7F_S0N1bPso2eCHxiLnR2moM,6246
85
- hive_nectar-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
- hive_nectar-0.1.1.dist-info/entry_points.txt,sha256=DbqiJb5fFpQvGZ0ojvc2w3dXZitTg6FPz09CobKq4m8,47
87
- hive_nectar-0.1.1.dist-info/licenses/LICENSE.txt,sha256=WjJRNR4r7FuLEO2BTBLGa05T7bBecGGgH47NgKsSY0E,1158
88
- hive_nectar-0.1.1.dist-info/RECORD,,
85
+ hive_nectar-0.1.3.dist-info/METADATA,sha256=Mdxii-IuD2qmXCZQnsBF5mBZxVKuOSnjIBR1Cbqx0Bo,6219
86
+ hive_nectar-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
87
+ hive_nectar-0.1.3.dist-info/entry_points.txt,sha256=DbqiJb5fFpQvGZ0ojvc2w3dXZitTg6FPz09CobKq4m8,47
88
+ hive_nectar-0.1.3.dist-info/licenses/LICENSE.txt,sha256=WjJRNR4r7FuLEO2BTBLGa05T7bBecGGgH47NgKsSY0E,1158
89
+ hive_nectar-0.1.3.dist-info/RECORD,,
nectar/account.py CHANGED
@@ -29,6 +29,7 @@ from nectargraphenebase.account import PasswordKey, PublicKey
29
29
  from .blockchain import Blockchain
30
30
  from .blockchainobject import BlockchainObject
31
31
  from .exceptions import AccountDoesNotExistsException, OfflineHasNoRPCException
32
+ from .haf import HAF
32
33
  from .utils import (
33
34
  addTzInfo,
34
35
  formatTimedelta,
@@ -613,26 +614,41 @@ class Account(BlockchainObject):
613
614
  """
614
615
  Return the account's normalized reputation score.
615
616
 
616
- If the node is offline, returns None. When connected, prefers the appbase `reputation` API to fetch the latest reputation; if that call fails or is unavailable, falls back to the account's cached `reputation` field. The returned value is the normalized reputation computed by `reputation_to_score`.
617
+ If the node is offline, returns a default reputation score. When connected, tries the HAF reputation API first
618
+ which returns the final normalized score directly. Falls back to the cached reputation
619
+ field if HAF fails.
617
620
  """
618
621
  if not self.blockchain.is_connected():
619
- return None
620
- self.blockchain.rpc.set_next_node_on_empty_reply(False)
621
- if self.blockchain.rpc.get_use_appbase():
622
+ return reputation_to_score(0)
623
+
624
+ # Try HAF API first - returns final normalized score
625
+ haf = HAF(blockchain_instance=self.blockchain)
626
+ rep_data = haf.reputation(self["name"])
627
+ if rep_data is not None:
628
+ # Handle both dict and direct responses
622
629
  try:
623
- rep = self.blockchain.rpc.get_account_reputations(
624
- {"account_lower_bound": self["name"], "limit": 1}, api="reputation"
625
- )["reputations"]
626
- if len(rep) > 0:
627
- rep = int(rep[0]["reputation"])
628
- except Exception:
629
- if "reputation" in self:
630
- rep = int(self["reputation"])
630
+ if isinstance(rep_data, dict) and "reputation" in rep_data:
631
+ return float(rep_data["reputation"])
632
+ elif isinstance(rep_data, (int, float)):
633
+ return float(rep_data)
631
634
  else:
632
- rep = 0
635
+ # Try to convert to float if it's a string
636
+ return float(rep_data)
637
+ except (ValueError, TypeError, KeyError) as e:
638
+ log.warning(f"Failed to parse reputation data from HAF for {self['name']}: {e}")
639
+
640
+ # Fallback to cached reputation field (old behavior)
641
+ if "reputation" in self:
642
+ try:
643
+ rep = int(self["reputation"])
644
+ log.debug(f"Using cached reputation for {self['name']}: {rep}")
645
+ return reputation_to_score(rep)
646
+ except (ValueError, TypeError) as e:
647
+ log.warning(f"Invalid cached reputation for {self['name']}: {e}")
648
+ return reputation_to_score(0)
633
649
  else:
634
- rep = int(self["reputation"])
635
- return reputation_to_score(rep)
650
+ log.warning(f"No reputation data available for {self['name']}")
651
+ return reputation_to_score(0)
636
652
 
637
653
  def get_manabar(self):
638
654
  """
@@ -999,14 +1015,12 @@ class Account(BlockchainObject):
999
1015
  raise AssertionError(
1000
1016
  "Should input %s, not any other asset!" % self.blockchain.backed_token_symbol
1001
1017
  )
1002
- vote_pct = self.blockchain.rshares_to_vote_pct(
1003
- self.blockchain.hbd_to_rshares(
1004
- token_units, not_broadcasted_vote=not_broadcasted_vote
1005
- ),
1006
- post_rshares=post_rshares,
1007
- voting_power=voting_power * 100,
1008
- hive_power=token_power,
1009
- )
1018
+ vote_pct = self.blockchain.rshares_to_vote_pct(
1019
+ self.blockchain.hbd_to_rshares(token_units, not_broadcasted_vote=not_broadcasted_vote),
1020
+ post_rshares=post_rshares,
1021
+ voting_power=voting_power * 100,
1022
+ hive_power=token_power,
1023
+ )
1010
1024
  return vote_pct
1011
1025
 
1012
1026
  def get_creator(self):
@@ -1282,6 +1296,8 @@ class Account(BlockchainObject):
1282
1296
  unread_notes = self.blockchain.rpc.unread_notifications(
1283
1297
  {"account": account}, api="bridge"
1284
1298
  )
1299
+ if unread_notes is None:
1300
+ return []
1285
1301
  if limit is None or limit > unread_notes["unread"]:
1286
1302
  limit = unread_notes["unread"]
1287
1303
  if limit is None or limit == 0:
@@ -1558,7 +1574,12 @@ class Account(BlockchainObject):
1558
1574
  if not self.blockchain.is_connected():
1559
1575
  raise OfflineHasNoRPCException("No RPC available in offline mode!")
1560
1576
  self.blockchain.rpc.set_next_node_on_empty_reply(True)
1561
- return self.blockchain.rpc.list_all_subscriptions({"account": account}, api="bridge")
1577
+ subscriptions = self.blockchain.rpc.list_all_subscriptions(
1578
+ {"account": account}, api="bridge"
1579
+ )
1580
+ if subscriptions is None:
1581
+ return []
1582
+ return subscriptions
1562
1583
 
1563
1584
  def get_account_posts(self, sort="feed", limit=20, account=None, observer=None, raw_data=False):
1564
1585
  """Returns account feed"""
@@ -4018,7 +4039,9 @@ class Account(BlockchainObject):
4018
4039
  else:
4019
4040
  return self.blockchain.finalizeOp(op, account, "active", **kwargs)
4020
4041
 
4021
- def disallow(self, foreign, permission="posting", account=None, threshold=None, **kwargs):
4042
+ def disallow(
4043
+ self, foreign, permission="posting", account=None, weight=None, threshold=None, **kwargs
4044
+ ):
4022
4045
  """Remove additional access to an account by some other public
4023
4046
  key or account.
4024
4047
 
@@ -4041,19 +4064,47 @@ class Account(BlockchainObject):
4041
4064
 
4042
4065
  try:
4043
4066
  pubkey = PublicKey(foreign, prefix=self.blockchain.prefix)
4044
- affected_items = list([x for x in authority["key_auths"] if x[0] == str(pubkey)])
4045
- authority["key_auths"] = list(
4046
- [x for x in authority["key_auths"] if x[0] != str(pubkey)]
4047
- )
4048
- except Exception:
4049
- try:
4050
- foreign_account = Account(foreign, blockchain_instance=self.blockchain)
4067
+ if weight:
4051
4068
  affected_items = list(
4052
- [x for x in authority["account_auths"] if x[0] == foreign_account["name"]]
4069
+ [x for x in authority["key_auths"] if x[0] == str(pubkey) and x[1] == weight]
4070
+ )
4071
+ authority["key_auths"] = list(
4072
+ [
4073
+ x
4074
+ for x in authority["key_auths"]
4075
+ if not (x[0] == str(pubkey) and x[1] == weight)
4076
+ ]
4053
4077
  )
4054
- authority["account_auths"] = list(
4055
- [x for x in authority["account_auths"] if x[0] != foreign_account["name"]]
4078
+ else:
4079
+ affected_items = list([x for x in authority["key_auths"] if x[0] == str(pubkey)])
4080
+ authority["key_auths"] = list(
4081
+ [x for x in authority["key_auths"] if x[0] != str(pubkey)]
4056
4082
  )
4083
+ except Exception:
4084
+ try:
4085
+ foreign_account = Account(foreign, blockchain_instance=self.blockchain)
4086
+ if weight:
4087
+ affected_items = list(
4088
+ [
4089
+ x
4090
+ for x in authority["account_auths"]
4091
+ if x[0] == foreign_account["name"] and x[1] == weight
4092
+ ]
4093
+ )
4094
+ authority["account_auths"] = list(
4095
+ [
4096
+ x
4097
+ for x in authority["account_auths"]
4098
+ if not (x[0] == foreign_account["name"] and x[1] == weight)
4099
+ ]
4100
+ )
4101
+ else:
4102
+ affected_items = list(
4103
+ [x for x in authority["account_auths"] if x[0] == foreign_account["name"]]
4104
+ )
4105
+ authority["account_auths"] = list(
4106
+ [x for x in authority["account_auths"] if x[0] != foreign_account["name"]]
4107
+ )
4057
4108
  except Exception:
4058
4109
  raise ValueError("Unknown foreign account or unvalid public key")
4059
4110
 
nectar/block.py CHANGED
@@ -310,7 +310,8 @@ class Block(BlockchainObject):
310
310
  op_type = op_type[:-10]
311
311
  else:
312
312
  op_type = op[0]
313
- ops_stat[op_type] += 1
313
+ if op_type in ops_stat:
314
+ ops_stat[op_type] += 1
314
315
  return ops_stat
315
316
 
316
317
 
@@ -430,6 +431,7 @@ class Blocks(list):
430
431
  only_ops=False,
431
432
  only_virtual_ops=False,
432
433
  blockchain_instance=None,
434
+ **kwargs,
433
435
  ):
434
436
  """
435
437
  Initialize a Blocks collection by fetching a contiguous range of blocks from the chain and populating the list with Block objects.
@@ -462,8 +464,6 @@ class Blocks(list):
462
464
  x,
463
465
  lazy=lazy,
464
466
  full=full,
465
- only_ops=only_ops,
466
- only_virtual_ops=only_virtual_ops,
467
467
  blockchain_instance=self.blockchain,
468
468
  )
469
469
  for x in blocks
nectar/blockchain.py CHANGED
@@ -1016,12 +1016,12 @@ class Blockchain(object):
1016
1016
  if self.blockchain.rpc.get_use_appbase():
1017
1017
  ret = self.blockchain.rpc.get_account_reputations(
1018
1018
  {"account_lower_bound": lastname, "limit": steps}, api="condenser"
1019
- )["reputations"]
1019
+ )
1020
1020
  else:
1021
1021
  ret = self.blockchain.rpc.get_account_reputations(lastname, steps, api="condenser")
1022
1022
  for account in ret:
1023
1023
  if isinstance(account, dict):
1024
- account_name = account["name"]
1024
+ account_name = account["account"]
1025
1025
  else:
1026
1026
  account_name = account
1027
1027
  if account_name != lastname or skip_first is False:
@@ -247,7 +247,12 @@ class BlockChainInstance(object):
247
247
 
248
248
  def is_connected(self):
249
249
  """Returns if rpc is connected"""
250
- return self.rpc is not None
250
+ # Consider the instance connected only if an RPC client exists AND
251
+ # it has an active URL set by rpcconnect(). Previously, this returned
252
+ # True when self.rpc was merely instantiated but without a selected
253
+ # working node (i.e., self.rpc.url was None), which caused downstream
254
+ # RPC calls to raise RPCConnection("RPC is not connected!").
255
+ return self.rpc is not None and bool(getattr(self.rpc, "url", None))
251
256
 
252
257
  def __repr__(self):
253
258
  if self.offline:
@@ -939,6 +944,11 @@ class BlockChainInstance(object):
939
944
  return False
940
945
  return "HIVE_CHAIN_ID" in config
941
946
 
947
+ @property
948
+ def is_steem(self):
949
+ """Deprecated compatibility flag; always False in Hive-only nectar."""
950
+ return False
951
+
942
952
  def set_default_account(self, account):
943
953
  """
944
954
  Set the instance default account.