hive-nectar 0.0.6__py3-none-any.whl → 0.0.9__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.6.dist-info → hive_nectar-0.0.9.dist-info}/METADATA +5 -3
  2. hive_nectar-0.0.9.dist-info/RECORD +91 -0
  3. nectar/__init__.py +1 -0
  4. nectar/account.py +44 -48
  5. nectar/amount.py +6 -11
  6. nectar/block.py +8 -9
  7. nectar/blockchain.py +4 -5
  8. nectar/blockchaininstance.py +4 -4
  9. nectar/blockchainobject.py +5 -6
  10. nectar/blurt.py +3 -4
  11. nectar/cli.py +14 -14
  12. nectar/comment.py +10 -11
  13. nectar/community.py +527 -181
  14. nectar/conveyor.py +3 -4
  15. nectar/exceptions.py +30 -24
  16. nectar/hive.py +3 -4
  17. nectar/hivesigner.py +2 -2
  18. nectar/imageuploader.py +2 -3
  19. nectar/nodelist.py +83 -7
  20. nectar/price.py +6 -13
  21. nectar/rc.py +1 -2
  22. nectar/steem.py +3 -4
  23. nectar/storage.py +3 -4
  24. nectar/transactionbuilder.py +12 -3
  25. nectar/version.py +1 -1
  26. nectar/vote.py +8 -9
  27. nectar/wallet.py +1 -1
  28. nectarapi/__init__.py +1 -0
  29. nectarapi/exceptions.py +20 -14
  30. nectarapi/version.py +1 -1
  31. nectarbase/__init__.py +1 -0
  32. nectarbase/ledgertransactions.py +2 -3
  33. nectarbase/memo.py +9 -10
  34. nectarbase/objects.py +4 -5
  35. nectarbase/operations.py +3 -7
  36. nectarbase/version.py +1 -1
  37. nectargraphenebase/__init__.py +1 -1
  38. nectargraphenebase/account.py +16 -37
  39. nectargraphenebase/base58.py +5 -8
  40. nectargraphenebase/bip32.py +5 -11
  41. nectargraphenebase/bip38.py +6 -7
  42. nectargraphenebase/ecdsasig.py +32 -37
  43. nectargraphenebase/objects.py +6 -7
  44. nectargraphenebase/operations.py +2 -0
  45. nectargraphenebase/signedtransactions.py +10 -9
  46. nectargraphenebase/types.py +9 -19
  47. nectargraphenebase/unsignedtransactions.py +21 -28
  48. nectargraphenebase/version.py +1 -1
  49. nectarstorage/__init__.py +21 -1
  50. nectarstorage/masterpassword.py +2 -3
  51. nectarstorage/sqlite.py +1 -1
  52. hive_nectar-0.0.6.dist-info/RECORD +0 -92
  53. nectargraphenebase/py23.py +0 -38
  54. {hive_nectar-0.0.6.dist-info → hive_nectar-0.0.9.dist-info}/WHEEL +0 -0
  55. {hive_nectar-0.0.6.dist-info → hive_nectar-0.0.9.dist-info}/entry_points.txt +0 -0
  56. {hive_nectar-0.0.6.dist-info → hive_nectar-0.0.9.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hive-nectar
3
- Version: 0.0.6
3
+ Version: 0.0.9
4
4
  Summary: Unofficial Python library for HIVE
5
5
  Project-URL: Homepage, http://www.github.com/thecrazygm/hive-nectar
6
- Project-URL: Download, https://github.com/thecrazygm/hive-nectar/tarball/0.00.01
6
+ Project-URL: Download, https://github.com/thecrazygm/hive-nectar/tarball/0.0.7
7
7
  Project-URL: Bug Tracker, https://github.com/thecrazygm/hive-nectar/issues
8
8
  Author-email: Michael Garcia <thecrazygm@gmail.com>
9
9
  Maintainer-email: Michael Garcia <thecrazygm@gmail.com>
@@ -39,10 +39,12 @@ Classifier: License :: OSI Approved :: MIT License
39
39
  Classifier: Operating System :: OS Independent
40
40
  Classifier: Programming Language :: Python
41
41
  Classifier: Programming Language :: Python :: 3
42
+ Classifier: Programming Language :: Python :: 3.10
43
+ Classifier: Programming Language :: Python :: 3.11
42
44
  Classifier: Programming Language :: Python :: 3.12
43
45
  Classifier: Programming Language :: Python :: 3.13
44
46
  Classifier: Topic :: Office/Business :: Financial
45
- Requires-Python: >=3.12
47
+ Requires-Python: >=3.10
46
48
  Requires-Dist: appdirs
47
49
  Requires-Dist: asn1crypto
48
50
  Requires-Dist: click
@@ -0,0 +1,91 @@
1
+ nectar/__init__.py,sha256=ykNGWDHaB3B2l22VK3HF8jpXXUf78tb6uyUw_Gnq6Kc,522
2
+ nectar/account.py,sha256=R__rmM8RwgKlO0-wwCo3jWecjz7WP6BxJEtLLVDhOXg,172221
3
+ nectar/amount.py,sha256=m5u0ixthz-XY69yEhla8yu6iKQACOcNtpKlK1NY__v0,18057
4
+ nectar/asciichart.py,sha256=DwPyZAqne6o9L_PPRtlw6Xj0QdOZ-aId1lpOnmbyc6Q,8828
5
+ nectar/asset.py,sha256=spGsJmlVQeZ6-oYhcwmQKsI3gpGmrpCzimYO1Qv4MtA,2725
6
+ nectar/block.py,sha256=6UIKzeKaPBOE2kRopTbnT0wAyz0g_FOJ4EuTZWMKA0Y,16050
7
+ nectar/blockchain.py,sha256=jLJ6Lsw35nwamzhcSXnU1UOtrEacBlDIINXUnYQS_P0,49101
8
+ nectar/blockchaininstance.py,sha256=dYGvI5JpNNHP6XOttIX3QR12fkuBCqek1O5DgDFdZwQ,93159
9
+ nectar/blockchainobject.py,sha256=bgfEjTGjFaUputmfNCD1jRTqk1d94tbnujYGkNshsWs,6984
10
+ nectar/blurt.py,sha256=2qRZf9-k5vonJEd-e8Dnpb09GP5bRvP5fE_MItSpCZw,23013
11
+ nectar/cli.py,sha256=zQHYUbqEW-TPvEsYuILrYxuynhGJHLSWJiez3mxcKsg,227615
12
+ nectar/comment.py,sha256=Q49xT7r1zvdR6RAuA-zH871XOq7KoEQA_A-qAdGWV0Q,46615
13
+ nectar/community.py,sha256=EUCPSgHDWQIeFvO4zHOIl15dcfmEHN6VU2m1jHKVWxo,31821
14
+ nectar/constants.py,sha256=lrspBwCz9BE0YZY10DMS98oPwwxgmI0LzFdlQ7v53Ig,4974
15
+ nectar/conveyor.py,sha256=atw49yhCEPEGIVdcSL0T0Y0_DY-vp6MCWOm2umBbgXo,11203
16
+ nectar/discussions.py,sha256=n-4GnYvnDc5AwFdUHSA9wTfdCmLWHb9h06U4vWq05q4,66439
17
+ nectar/exceptions.py,sha256=AKA75cDNnpioZPe2XcNWvyAVPRLcHBfPyBwjYVFOJC0,2884
18
+ nectar/hive.py,sha256=SjTTbLt_wWshEbaJFxjAPYT38wTa1i5RgBNepdeoAcw,22197
19
+ nectar/hivesigner.py,sha256=DpHMdGhsy7Kh8gfcEAeHtFHEXOVTr0AqeZBXxgQNzIQ,14010
20
+ nectar/imageuploader.py,sha256=dR6bd-CtHcKReLHuWsF_XmE_uJfqWxyWbU6lLhI2iM8,2647
21
+ nectar/instance.py,sha256=oUAycW1q5ynM3M4O9a0drgY7e8UBExTj69aMxrOjxwg,3905
22
+ nectar/market.py,sha256=mlKKsq6DQ4WCLaqNnuuwbJM4qUiejy5pGdXIPKK2Sug,41972
23
+ nectar/memo.py,sha256=lTIuPrX-kPynOa-9q6kJHRzb9BfJjSf0kdpipwEXnY8,17777
24
+ nectar/message.py,sha256=lVGaydsxh8oMTS90khho3DtqxhzgIrt4NmjxwyP0X3k,13019
25
+ nectar/nodelist.py,sha256=sEQcnRMk80RwpiE85X4VeD4XcwnoB9UoQtPNLIKE88o,18613
26
+ nectar/price.py,sha256=Rv-ffhkyN1c-tl6QTGWvhrdqTQNHbE1rcUzTi21t4Tc,21052
27
+ nectar/profile.py,sha256=t-pqC2DZxzvTV2XLU6iZWT1NdHuk77A_iiisbA0QIOM,1921
28
+ nectar/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ nectar/rc.py,sha256=XRscyDqXiw03cBDznUPafEdhB64jxkrn6pH1kvoLcW4,12773
30
+ nectar/snapshot.py,sha256=_5hsrmJDpPoWTYtQGZ2grMMuuGBInOGS0ip9gv5-RJo,31696
31
+ nectar/steem.py,sha256=z7yrhWbnkVF4PzlpvG-JO4tqEFYZZ5dnqC5YMchnWFY,23859
32
+ nectar/storage.py,sha256=efmvfBD102ye8TTCRhMUkegVNmASFAYCfV9qqSFSSJM,1844
33
+ nectar/transactionbuilder.py,sha256=S14zLfbyvrMCnTOAAOUf6gqvU3aEyPDRZqEbYPYl4DM,25886
34
+ nectar/utils.py,sha256=OGeLuO_nYDAvcX-onrm4xjn1L0binq8Glelgg6RdlSo,18882
35
+ nectar/version.py,sha256=uxo8fuHw_1Sq6WXrFQxlbH5B2bx3nKdboBIUQElx-vc,76
36
+ nectar/vote.py,sha256=-FHyrF79K4zmvH_IYl-2ImrX6pUhSs0dS7wCMeJAYh8,20085
37
+ nectar/wallet.py,sha256=mbFNDbzo8PbcN7iYlVwwFIp9e4zCFuS4cYoWeepF1jY,16232
38
+ nectar/witness.py,sha256=88XYjhTRNhyu9hfIG0sm3Pg1hC9eooo3HhW5EhcaYps,23600
39
+ nectarapi/__init__.py,sha256=eyiQRdZ8agc_qi9fr8sAvYPfpStEpTN06yBWFxkCTJk,176
40
+ nectarapi/exceptions.py,sha256=gDaDFy1QcFkXrpOadduZ9bFWanHZpaiZRK_AOJZ-AWo,2044
41
+ nectarapi/graphenerpc.py,sha256=7woRA4CmuwqYrJU9E4LV3UdxaANHzIrKuWZPaxTcJnw,22642
42
+ nectarapi/node.py,sha256=mjK-fMFJ2icDaOUBoiUuDU-beo3aQK0HGwt0l0pC0YQ,5456
43
+ nectarapi/noderpc.py,sha256=FxJz1KbjU6FbNdyp7ovOSZ8TbmD_xqQclKjeBP42Jls,10093
44
+ nectarapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
+ nectarapi/rpcutils.py,sha256=0nKCrEeNHFSEU3AjaOGNh-2pjc8qw4mRA9lCrBkP1FQ,2910
46
+ nectarapi/version.py,sha256=uxo8fuHw_1Sq6WXrFQxlbH5B2bx3nKdboBIUQElx-vc,76
47
+ nectarbase/__init__.py,sha256=O11coqB-Woq_yp946kA1b8hzqSdDcK9j9gwenx7d6JE,253
48
+ nectarbase/ledgertransactions.py,sha256=0N1EHIZJdp-pVXmd0PgIVwhCFUtPRky4Pt9RQdP4f2A,2488
49
+ nectarbase/memo.py,sha256=Ix5Uhan7x2rz54_QMSQ-Z5rZz-FqvR3i13H3cGEnPIY,7496
50
+ nectarbase/objects.py,sha256=zDDLTz0eaenBDiZf_T1E9nXehU3xTs0aZyrrttkGKSk,14813
51
+ nectarbase/objecttypes.py,sha256=zrKBFwoUJXvWDSn8RugWioKqf7TS7dY0EEXVAZv_-K0,690
52
+ nectarbase/operationids.py,sha256=wpKltPFlInpueyvLl3XCI2fjP9ziIs4MStoIj2mbPfQ,3645
53
+ nectarbase/operations.py,sha256=Ik87L6_rzptfCy4eeOX--9669mcrZ6SVxQe7jrmHd5U,47419
54
+ nectarbase/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
+ nectarbase/signedtransactions.py,sha256=r-MRnEQDnx6U6XFPcM3hPXiDZvU6sQVx4Vv_0nZF7fs,1792
56
+ nectarbase/transactions.py,sha256=D7TK4Pkxr1N7p0Yh2bxvdXpOuEYpLl2tWK84Pj_93c0,319
57
+ nectarbase/version.py,sha256=uxo8fuHw_1Sq6WXrFQxlbH5B2bx3nKdboBIUQElx-vc,76
58
+ nectargrapheneapi/__init__.py,sha256=_Gxdt_qaQQwwYABHEFBuf4tMh93ItIa3HPBH9nk1PTw,151
59
+ nectargrapheneapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
+ nectargraphenebase/__init__.py,sha256=66IxULO3eMKcx-nRDFDLz0YfEvXCkty08xjt9M1WgyY,577
61
+ nectargraphenebase/account.py,sha256=tjEbiqkFmTs0AZAaCRke3OzopHKV4i3deryCAR54xek,28984
62
+ nectargraphenebase/aes.py,sha256=BywHJR8F7n2IBXhBmXqyc61DlVXcJ_QIE9qkubFdX2M,1578
63
+ nectargraphenebase/base58.py,sha256=7ilcjbwV3YGDL3a5MCilR03P-p5kNVafrmsRsftr0d8,5410
64
+ nectargraphenebase/bip32.py,sha256=UjqgbBvvdya3gQRD73ccdfEQL4brxs4DWhM9vTvRMpc,16023
65
+ nectargraphenebase/bip38.py,sha256=EIlaNMvDHOhb4GKTcjX_8X8FWIG45pP3VTyoZD70Mh4,4458
66
+ nectargraphenebase/chains.py,sha256=JhaqY8qZaK-6OYf72RLVNxJtrc6yZtYxJm8p9U-i338,6185
67
+ nectargraphenebase/dictionary.py,sha256=Fooynl3XWE9ALy31jsVNb9CEHZh5N8TeJUAZJvqslnY,360748
68
+ nectargraphenebase/ecdsasig.py,sha256=Etv1C83GpkhGFgWrHoB7WR4T_Ygh4SZ-6Qlnc9XCYHY,12129
69
+ nectargraphenebase/objects.py,sha256=twOADiBOSXlZNu6y1TrdDw135zWQeIsfn12xRl5m6Fw,3896
70
+ nectargraphenebase/objecttypes.py,sha256=8YkRyxtd1hNZ06XvyHBRA5PatVeTd8XCFQmW_2p8MGk,160
71
+ nectargraphenebase/operationids.py,sha256=TLXB8FovmDwC39PNAR8OaW-NWyo1gFH0zE4ibShcMiI,65
72
+ nectargraphenebase/operations.py,sha256=Lp25CSjHUttzWLbcgYLeccFtPHqip8uo9iTqLKKm40U,690
73
+ nectargraphenebase/prefix.py,sha256=tpX2_uz5lPveUoGbmXC4zsrG-5QsaVbIGIFPWJvYRbg,280
74
+ nectargraphenebase/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
+ nectargraphenebase/signedtransactions.py,sha256=rhFEQDNcOau08qnNAf_3UxJDXtIpi5Y8tOFDXZK1bPw,7119
76
+ nectargraphenebase/types.py,sha256=nxkpR4N1DOZwIwDSVQrMxp8VZVKVjYdiLvPv0sX65jU,9439
77
+ nectargraphenebase/unsignedtransactions.py,sha256=6WLZCSVC0vCa7VVBt39TQl1vW-GAF2khkF0DLIgZG-s,9247
78
+ nectargraphenebase/version.py,sha256=uxo8fuHw_1Sq6WXrFQxlbH5B2bx3nKdboBIUQElx-vc,76
79
+ nectarstorage/__init__.py,sha256=nEM9OMoHqHPS6IoV_JzVyxPRORz0DCeS7Yv-MwjmWoQ,1772
80
+ nectarstorage/base.py,sha256=h7Oca1_RaJw39P1I_xXRKup016pS8zCLOs3e4IHKKdE,9734
81
+ nectarstorage/exceptions.py,sha256=0erk_d0Ejia9td_Ke7XFBl17H1BxbM42gFpkej8EbV0,421
82
+ nectarstorage/interfaces.py,sha256=WK2YR2mKUk1Qts50ZYLd407gECywA02A8iWr_p0KfCw,6786
83
+ nectarstorage/masterpassword.py,sha256=xOAOZvVfIctfGiwIed_XpKnWcGDla95qp8osTLyYYCk,8654
84
+ nectarstorage/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
+ nectarstorage/ram.py,sha256=Cy6JbMrlgcEG673_KqfyaofhAdJR-luRKTedj3qTZEE,1034
86
+ nectarstorage/sqlite.py,sha256=ZKJxPL0AZjJIlwjxCEh6GGcjQzlBPuWs6tj40oPZz3M,10635
87
+ hive_nectar-0.0.9.dist-info/METADATA,sha256=A0QNBjciLjFVpXBlD_sMcg5rKtRoCj7ssRH6xzLmloA,6162
88
+ hive_nectar-0.0.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
89
+ hive_nectar-0.0.9.dist-info/entry_points.txt,sha256=DbqiJb5fFpQvGZ0ojvc2w3dXZitTg6FPz09CobKq4m8,47
90
+ hive_nectar-0.0.9.dist-info/licenses/LICENSE.txt,sha256=WjJRNR4r7FuLEO2BTBLGa05T7bBecGGgH47NgKsSY0E,1158
91
+ hive_nectar-0.0.9.dist-info/RECORD,,
nectar/__init__.py CHANGED
@@ -6,6 +6,7 @@ from .steem import Steem
6
6
  from .version import version as __version__
7
7
 
8
8
  __all__ = [
9
+ "__version__",
9
10
  "steem",
10
11
  "account",
11
12
  "amount",
nectar/account.py CHANGED
@@ -23,7 +23,6 @@ from nectarapi.exceptions import (
23
23
  )
24
24
  from nectarbase import operations
25
25
  from nectargraphenebase.account import PasswordKey, PublicKey
26
- from nectargraphenebase.py23 import integer_types, string_types
27
26
 
28
27
  from .blockchain import Blockchain
29
28
  from .blockchainobject import BlockchainObject
@@ -164,12 +163,12 @@ class Account(BlockchainObject):
164
163
  "savings_hbd_seconds",
165
164
  ]
166
165
  for p in parse_int:
167
- if p in account and isinstance(account.get(p), string_types):
166
+ if p in account and isinstance(account.get(p), str):
168
167
  account[p] = int(account.get(p, 0))
169
168
  if "proxied_vsf_votes" in account:
170
169
  proxied_vsf_votes = []
171
170
  for p_int in account["proxied_vsf_votes"]:
172
- if isinstance(p_int, string_types):
171
+ if isinstance(p_int, str):
173
172
  proxied_vsf_votes.append(int(p_int))
174
173
  else:
175
174
  proxied_vsf_votes.append(p_int)
@@ -197,7 +196,7 @@ class Account(BlockchainObject):
197
196
  "savings_hbd_last_interest_payment",
198
197
  ]
199
198
  for p in parse_times:
200
- if p in account and isinstance(account.get(p), string_types):
199
+ if p in account and isinstance(account.get(p), str):
201
200
  account[p] = formatTimeString(account.get(p, "1970-01-01T00:00:00"))
202
201
  # Parse Amounts
203
202
  amounts = [
@@ -220,7 +219,7 @@ class Account(BlockchainObject):
220
219
  "vesting_balance",
221
220
  ]
222
221
  for p in amounts:
223
- if p in account and isinstance(account.get(p), (string_types, list, dict)):
222
+ if p in account and isinstance(account.get(p), (str, list, dict)):
224
223
  account[p] = Amount(account[p], blockchain_instance=self.blockchain)
225
224
  return account
226
225
 
@@ -239,15 +238,15 @@ class Account(BlockchainObject):
239
238
  "average_bandwidth",
240
239
  ]
241
240
  for p in parse_int:
242
- if p in output and isinstance(output[p], integer_types):
241
+ if p in output and isinstance(output[p], int):
243
242
  output[p] = str(output[p])
244
243
  for p in parse_int_without_zero:
245
- if p in output and isinstance(output[p], integer_types) and output[p] != 0:
244
+ if p in output and isinstance(output[p], int) and output[p] != 0:
246
245
  output[p] = str(output[p])
247
246
  if "proxied_vsf_votes" in output:
248
247
  proxied_vsf_votes = []
249
248
  for p_int in output["proxied_vsf_votes"]:
250
- if isinstance(p_int, integer_types) and p_int != 0:
249
+ if isinstance(p_int, int) and p_int != 0:
251
250
  proxied_vsf_votes.append(str(p_int))
252
251
  else:
253
252
  proxied_vsf_votes.append(p_int)
@@ -427,7 +426,7 @@ class Account(BlockchainObject):
427
426
  rc_mana = self.get_rc_manabar()
428
427
  rc = self.get_rc()
429
428
  rc_calc = RC(blockchain_instance=self.blockchain)
430
- except:
429
+ except Exception:
431
430
  rc_mana = None
432
431
  rc_calc = None
433
432
 
@@ -564,7 +563,7 @@ class Account(BlockchainObject):
564
563
  )["reputations"]
565
564
  if len(rep) > 0:
566
565
  rep = int(rep[0]["reputation"])
567
- except:
566
+ except Exception:
568
567
  if "reputation" in self:
569
568
  rep = int(self["reputation"])
570
569
  else:
@@ -839,7 +838,7 @@ class Account(BlockchainObject):
839
838
 
840
839
  if isinstance(token_units, Amount):
841
840
  token_units = Amount(token_units, blockchain_instance=self.blockchain)
842
- elif isinstance(token_units, string_types):
841
+ elif isinstance(token_units, str):
843
842
  token_units = Amount(token_units, blockchain_instance=self.blockchain)
844
843
  else:
845
844
  token_units = Amount(
@@ -1136,7 +1135,7 @@ class Account(BlockchainObject):
1136
1135
  if isinstance(ret, dict) and "blog" in ret:
1137
1136
  ret = ret["blog"]
1138
1137
  return [Comment(c["comment"], blockchain_instance=self.blockchain) for c in ret]
1139
- except:
1138
+ except Exception:
1140
1139
  success = False
1141
1140
 
1142
1141
  if not self.blockchain.rpc.get_use_appbase() or not success:
@@ -1221,7 +1220,7 @@ class Account(BlockchainObject):
1221
1220
  last_notification = self.get_notifications(only_unread=False, limit=1, account=account)
1222
1221
  if len(last_notification) == 0:
1223
1222
  raise ValueError("Notification list is empty")
1224
- last_read = last_notification[0]["date"]
1223
+ last_read = datetime.now(timezone.utc)
1225
1224
  if isinstance(last_read, datetime):
1226
1225
  last_read = formatTimeString(last_read)
1227
1226
  json_body = [
@@ -1262,7 +1261,7 @@ class Account(BlockchainObject):
1262
1261
  return self.blockchain.rpc.get_blog_authors(
1263
1262
  {"blog_account": account}, api="condenser"
1264
1263
  )["blog_authors"]
1265
- except:
1264
+ except Exception:
1266
1265
  return self.blockchain.rpc.get_blog_authors(account, api="condenser")
1267
1266
  else:
1268
1267
  return self.blockchain.rpc.get_blog_authors(account, api="condenser")
@@ -1278,7 +1277,7 @@ class Account(BlockchainObject):
1278
1277
  if self.blockchain.rpc.get_use_appbase():
1279
1278
  try:
1280
1279
  return self.blockchain.rpc.get_follow_count({"account": account}, api="condenser")
1281
- except:
1280
+ except Exception:
1282
1281
  return self.blockchain.rpc.get_follow_count(account, api="condenser")
1283
1282
  else:
1284
1283
  return self.blockchain.rpc.get_follow_count(account, api="condenser")
@@ -1370,7 +1369,7 @@ class Account(BlockchainObject):
1370
1369
  if direction == "follower":
1371
1370
  try:
1372
1371
  followers = self.blockchain.rpc.get_followers(query, api="condenser")
1373
- except:
1372
+ except Exception:
1374
1373
  followers = self.blockchain.rpc.get_followers(
1375
1374
  self.name, last_user, what, limit, api="condenser"
1376
1375
  )
@@ -1379,7 +1378,7 @@ class Account(BlockchainObject):
1379
1378
  elif direction == "following":
1380
1379
  try:
1381
1380
  followers = self.blockchain.rpc.get_following(query, api="condenser")
1382
- except:
1381
+ except Exception:
1383
1382
  followers = self.blockchain.rpc.get_following(
1384
1383
  self.name, last_user, what, limit, api="condenser"
1385
1384
  )
@@ -1391,7 +1390,7 @@ class Account(BlockchainObject):
1391
1390
  followers = self.blockchain.rpc.get_followers(
1392
1391
  self.name, last_user, what, limit, api="condenser"
1393
1392
  )
1394
- except:
1393
+ except Exception:
1395
1394
  followers = self.blockchain.rpc.get_followers(
1396
1395
  [self.name, last_user, what, limit], api="condenser"
1397
1396
  )
@@ -1400,7 +1399,7 @@ class Account(BlockchainObject):
1400
1399
  followers = self.blockchain.rpc.get_following(
1401
1400
  self.name, last_user, what, limit, api="condenser"
1402
1401
  )
1403
- except:
1402
+ except Exception:
1404
1403
  followers = self.blockchain.rpc.get_following(
1405
1404
  self.name, last_user, what, limit, api="condenser"
1406
1405
  )
@@ -1549,12 +1548,12 @@ class Account(BlockchainObject):
1549
1548
  >>> nodelist = NodeList()
1550
1549
  >>> nodelist.update_nodes()
1551
1550
  >>> stm = Hive(node=nodelist.get_hive_nodes())
1552
- >>> account = Account("nectar.app", blockchain_instance=stm)
1551
+ >>> account = Account("nectarflower", blockchain_instance=stm)
1553
1552
  >>> account.get_balance("rewards", "HBD")
1554
1553
  0.000 HBD
1555
1554
 
1556
1555
  """
1557
- if isinstance(balances, string_types):
1556
+ if isinstance(balances, str):
1558
1557
  if balances == "available":
1559
1558
  balances = self.available_balances
1560
1559
  elif balances == "savings":
@@ -1672,7 +1671,7 @@ class Account(BlockchainObject):
1672
1671
  global_properties = self.blockchain.get_dynamic_global_properties()
1673
1672
  try:
1674
1673
  reserve_ratio = self.blockchain.get_reserve_ratio()
1675
- except:
1674
+ except Exception:
1676
1675
  return {"used": 0, "allocated": 0}
1677
1676
  if "received_vesting_shares" in self:
1678
1677
  received_vesting_shares = self["received_vesting_shares"].amount
@@ -1695,7 +1694,7 @@ class Account(BlockchainObject):
1695
1694
  if self.blockchain.is_connected() and self.blockchain.rpc.get_use_appbase():
1696
1695
  try:
1697
1696
  account_bandwidth = self.get_account_bandwidth(bandwidth_type=1, account=account)
1698
- except:
1697
+ except Exception:
1699
1698
  account_bandwidth = None
1700
1699
  if account_bandwidth is None:
1701
1700
  return {"used": 0, "allocated": allocated_bandwidth}
@@ -1734,7 +1733,7 @@ class Account(BlockchainObject):
1734
1733
  >>> nodelist = NodeList()
1735
1734
  >>> nodelist.update_nodes()
1736
1735
  >>> stm = Hive(node=nodelist.get_hive_nodes())
1737
- >>> account = Account("nectar.app", blockchain_instance=stm)
1736
+ >>> account = Account("nectarflower", blockchain_instance=stm)
1738
1737
  >>> account.get_owner_history()
1739
1738
  []
1740
1739
 
@@ -1767,7 +1766,7 @@ class Account(BlockchainObject):
1767
1766
  >>> nodelist = NodeList()
1768
1767
  >>> nodelist.update_nodes()
1769
1768
  >>> stm = Hive(node=nodelist.get_hive_nodes())
1770
- >>> account = Account("nectar.app", blockchain_instance=stm)
1769
+ >>> account = Account("nectarflower", blockchain_instance=stm)
1771
1770
  >>> account.get_conversion_requests()
1772
1771
  []
1773
1772
 
@@ -1805,7 +1804,7 @@ class Account(BlockchainObject):
1805
1804
  >>> nodelist = NodeList()
1806
1805
  >>> nodelist.update_nodes()
1807
1806
  >>> stm = Hive(node=nodelist.get_hive_nodes())
1808
- >>> account = Account("nectar.app", blockchain_instance=stm)
1807
+ >>> account = Account("nectarflower", blockchain_instance=stm)
1809
1808
  >>> account.get_vesting_delegations()
1810
1809
  []
1811
1810
 
@@ -1840,7 +1839,7 @@ class Account(BlockchainObject):
1840
1839
  >>> nodelist = NodeList()
1841
1840
  >>> nodelist.update_nodes()
1842
1841
  >>> stm = Hive(node=nodelist.get_hive_nodes())
1843
- >>> account = Account("nectar.app", blockchain_instance=stm)
1842
+ >>> account = Account("nectarflower", blockchain_instance=stm)
1844
1843
  >>> account.get_withdraw_routes()
1845
1844
  []
1846
1845
 
@@ -1874,7 +1873,7 @@ class Account(BlockchainObject):
1874
1873
  >>> nodelist = NodeList()
1875
1874
  >>> nodelist.update_nodes()
1876
1875
  >>> stm = Hive(node=nodelist.get_hive_nodes())
1877
- >>> account = Account("nectar.app", blockchain_instance=stm)
1876
+ >>> account = Account("nectarflower", blockchain_instance=stm)
1878
1877
  >>> account.get_savings_withdrawals()
1879
1878
  []
1880
1879
 
@@ -1909,7 +1908,7 @@ class Account(BlockchainObject):
1909
1908
  >>> nodelist = NodeList()
1910
1909
  >>> nodelist.update_nodes()
1911
1910
  >>> stm = Hive(node=nodelist.get_hive_nodes())
1912
- >>> account = Account("nectar.app", blockchain_instance=stm)
1911
+ >>> account = Account("nectarflower", blockchain_instance=stm)
1913
1912
  >>> account.get_recovery_request()
1914
1913
  []
1915
1914
 
@@ -1922,7 +1921,7 @@ class Account(BlockchainObject):
1922
1921
  self.blockchain.rpc.set_next_node_on_empty_reply(False)
1923
1922
  if self.blockchain.rpc.get_use_appbase():
1924
1923
  return self.blockchain.rpc.find_account_recovery_requests(
1925
- {"account": account}, api="database"
1924
+ {"accounts": [account]}, api="database"
1926
1925
  )["requests"]
1927
1926
  else:
1928
1927
  return self.blockchain.rpc.get_recovery_request(account)
@@ -1943,7 +1942,7 @@ class Account(BlockchainObject):
1943
1942
  >>> nodelist = NodeList()
1944
1943
  >>> nodelist.update_nodes()
1945
1944
  >>> stm = Hive(node=nodelist.get_hive_nodes())
1946
- >>> account = Account("nectar.app", blockchain_instance=stm)
1945
+ >>> account = Account("nectarflower", blockchain_instance=stm)
1947
1946
  >>> account.get_escrow(1234)
1948
1947
  []
1949
1948
 
@@ -2036,7 +2035,7 @@ class Account(BlockchainObject):
2036
2035
  >>> nodelist = NodeList()
2037
2036
  >>> nodelist.update_nodes()
2038
2037
  >>> stm = Hive(node=nodelist.get_hive_nodes())
2039
- >>> account = Account("nectar.app", blockchain_instance=stm)
2038
+ >>> account = Account("nectarflower", blockchain_instance=stm)
2040
2039
  >>> account.get_expiring_vesting_delegations()
2041
2040
  []
2042
2041
 
@@ -2073,7 +2072,7 @@ class Account(BlockchainObject):
2073
2072
  >>> nodelist = NodeList()
2074
2073
  >>> nodelist.update_nodes()
2075
2074
  >>> stm = Hive(node=nodelist.get_hive_nodes())
2076
- >>> account = Account("nectar.app", blockchain_instance=stm)
2075
+ >>> account = Account("nectarflower", blockchain_instance=stm)
2077
2076
  >>> account.get_account_votes() # doctest: +SKIP
2078
2077
 
2079
2078
  """
@@ -2246,7 +2245,7 @@ class Account(BlockchainObject):
2246
2245
  min_index = 0
2247
2246
  try:
2248
2247
  created = self._get_blocknum_from_hist(0, min_index=min_index)
2249
- except:
2248
+ except Exception:
2250
2249
  min_index = 1
2251
2250
  created = self._get_blocknum_from_hist(0, min_index=min_index)
2252
2251
  return created, min_index
@@ -3653,12 +3652,9 @@ class Account(BlockchainObject):
3653
3652
  return self.blockchain.finalizeOp(op, account, "active", **kwargs)
3654
3653
 
3655
3654
  def _check_amount(self, amount, symbol):
3656
- if isinstance(amount, (float, integer_types)):
3655
+ if isinstance(amount, (float, int)):
3657
3656
  amount = Amount(amount, symbol, blockchain_instance=self.blockchain)
3658
- elif (
3659
- isinstance(amount, string_types)
3660
- and amount.replace(".", "", 1).replace(",", "", 1).isdigit()
3661
- ):
3657
+ elif isinstance(amount, str) and amount.replace(".", "", 1).replace(",", "", 1).isdigit():
3662
3658
  amount = Amount(float(amount), symbol, blockchain_instance=self.blockchain)
3663
3659
  else:
3664
3660
  amount = Amount(amount, blockchain_instance=self.blockchain)
@@ -3879,11 +3875,11 @@ class Account(BlockchainObject):
3879
3875
  try:
3880
3876
  pubkey = PublicKey(foreign, prefix=self.blockchain.prefix)
3881
3877
  authority["key_auths"].append([str(pubkey), weight])
3882
- except:
3878
+ except Exception:
3883
3879
  try:
3884
3880
  foreign_account = Account(foreign, blockchain_instance=self.blockchain)
3885
3881
  authority["account_auths"].append([foreign_account["name"], weight])
3886
- except:
3882
+ except Exception:
3887
3883
  raise ValueError("Unknown foreign account or invalid public key")
3888
3884
  if threshold:
3889
3885
  authority["weight_threshold"] = threshold
@@ -3930,7 +3926,7 @@ class Account(BlockchainObject):
3930
3926
  authority["key_auths"] = list(
3931
3927
  [x for x in authority["key_auths"] if x[0] != str(pubkey)]
3932
3928
  )
3933
- except:
3929
+ except Exception:
3934
3930
  try:
3935
3931
  foreign_account = Account(foreign, blockchain_instance=self.blockchain)
3936
3932
  affected_items = list(
@@ -3939,7 +3935,7 @@ class Account(BlockchainObject):
3939
3935
  authority["account_auths"] = list(
3940
3936
  [x for x in authority["account_auths"] if x[0] != foreign_account["name"]]
3941
3937
  )
3942
- except:
3938
+ except Exception:
3943
3939
  raise ValueError("Unknown foreign account or unvalid public key")
3944
3940
 
3945
3941
  if not affected_items:
@@ -3954,7 +3950,7 @@ class Account(BlockchainObject):
3954
3950
  # authority)
3955
3951
  try:
3956
3952
  self.blockchain._test_weights_treshold(authority)
3957
- except:
3953
+ except Exception:
3958
3954
  log.critical("The account's threshold will be reduced by %d" % (removed_weight))
3959
3955
  authority["weight_threshold"] -= removed_weight
3960
3956
  self.blockchain._test_weights_treshold(authority)
@@ -4010,7 +4006,7 @@ class Account(BlockchainObject):
4010
4006
 
4011
4007
  """
4012
4008
  if limit is not None:
4013
- if not isinstance(limit, integer_types) or limit <= 0:
4009
+ if not isinstance(limit, int) or limit <= 0:
4014
4010
  raise AssertionError("`limit` has to be greater than 0`")
4015
4011
  if (start_author is None and start_permlink is not None) or (
4016
4012
  start_author is not None and start_permlink is None
@@ -4084,7 +4080,7 @@ class Account(BlockchainObject):
4084
4080
 
4085
4081
  """
4086
4082
  if limit is not None:
4087
- if not isinstance(limit, integer_types) or limit <= 0:
4083
+ if not isinstance(limit, int) or limit <= 0:
4088
4084
  raise AssertionError("`limit` has to be greater than 0`")
4089
4085
 
4090
4086
  if account is None:
@@ -4156,7 +4152,7 @@ class Account(BlockchainObject):
4156
4152
 
4157
4153
  """
4158
4154
  if limit is not None:
4159
- if not isinstance(limit, integer_types) or limit <= 0:
4155
+ if not isinstance(limit, int) or limit <= 0:
4160
4156
  raise AssertionError("`limit` has to be greater than 0`")
4161
4157
 
4162
4158
  if account is None:
@@ -4223,7 +4219,7 @@ class Account(BlockchainObject):
4223
4219
 
4224
4220
  """
4225
4221
  if limit is not None:
4226
- if not isinstance(limit, integer_types) or limit <= 0:
4222
+ if not isinstance(limit, int) or limit <= 0:
4227
4223
  raise AssertionError("`limit` has to be greater than 0`")
4228
4224
  if (start_author is None and start_permlink is not None) or (
4229
4225
  start_author is not None and start_permlink is None
nectar/amount.py CHANGED
@@ -3,7 +3,6 @@ from decimal import ROUND_DOWN, Decimal
3
3
 
4
4
  from nectar.asset import Asset
5
5
  from nectar.instance import shared_blockchain_instance
6
- from nectargraphenebase.py23 import integer_types, string_types
7
6
 
8
7
 
9
8
  def check_asset(other, self, stm):
@@ -122,7 +121,7 @@ class Amount(dict):
122
121
  self["asset"] = Asset(amount["nai"], blockchain_instance=self.blockchain)
123
122
  self["symbol"] = self["asset"]["symbol"]
124
123
 
125
- elif amount is not None and asset is None and isinstance(amount, string_types):
124
+ elif amount is not None and asset is None and isinstance(amount, str):
126
125
  self["amount"], self["symbol"] = amount.split(" ")
127
126
  self["asset"] = Asset(self["symbol"], blockchain_instance=self.blockchain)
128
127
 
@@ -153,7 +152,7 @@ class Amount(dict):
153
152
  self["asset"] = asset
154
153
  self["symbol"] = self["asset"]["symbol"]
155
154
 
156
- elif isinstance(amount, (integer_types, Decimal)) and asset and isinstance(asset, Asset):
155
+ elif isinstance(amount, (int, Decimal)) and asset and isinstance(asset, Asset):
157
156
  self["amount"] = amount
158
157
  self["asset"] = asset
159
158
  self["symbol"] = self["asset"]["symbol"]
@@ -163,21 +162,17 @@ class Amount(dict):
163
162
  self["asset"] = asset
164
163
  self["symbol"] = self["asset"]["symbol"]
165
164
 
166
- elif isinstance(amount, (integer_types, Decimal)) and asset and isinstance(asset, dict):
165
+ elif isinstance(amount, (int, Decimal)) and asset and isinstance(asset, dict):
167
166
  self["amount"] = amount
168
167
  self["asset"] = asset
169
168
  self["symbol"] = self["asset"]["symbol"]
170
169
 
171
- elif isinstance(amount, (float)) and asset and isinstance(asset, string_types):
170
+ elif isinstance(amount, (float)) and asset and isinstance(asset, str):
172
171
  self["amount"] = str(amount)
173
172
  self["asset"] = Asset(asset, blockchain_instance=self.blockchain)
174
173
  self["symbol"] = asset
175
174
 
176
- elif (
177
- isinstance(amount, (integer_types, Decimal))
178
- and asset
179
- and isinstance(asset, string_types)
180
- ):
175
+ elif isinstance(amount, (int, Decimal)) and asset and isinstance(asset, str):
181
176
  self["amount"] = amount
182
177
  self["asset"] = Asset(asset, blockchain_instance=self.blockchain)
183
178
  self["symbol"] = asset
@@ -185,7 +180,7 @@ class Amount(dict):
185
180
  self["amount"] = amount
186
181
  self["symbol"] = asset["symbol"]
187
182
  self["asset"] = asset
188
- elif amount and asset and isinstance(asset, string_types):
183
+ elif amount and asset and isinstance(asset, str):
189
184
  self["amount"] = amount
190
185
  self["asset"] = Asset(asset, blockchain_instance=self.blockchain)
191
186
  self["symbol"] = self["asset"]["symbol"]
nectar/block.py CHANGED
@@ -4,7 +4,6 @@ from datetime import date, datetime
4
4
 
5
5
  from nectar.instance import shared_blockchain_instance
6
6
  from nectarapi.exceptions import ApiNotSupported
7
- from nectargraphenebase.py23 import string_types
8
7
 
9
8
  from .blockchainobject import BlockchainObject
10
9
  from .exceptions import BlockDoesNotExistsException
@@ -81,12 +80,12 @@ class Block(BlockchainObject):
81
80
  "timestamp",
82
81
  ]
83
82
  for p in parse_times:
84
- if p in block and isinstance(block.get(p), string_types):
83
+ if p in block and isinstance(block.get(p), str):
85
84
  block[p] = formatTimeString(block.get(p, "1970-01-01T00:00:00"))
86
85
  if "transactions" in block:
87
86
  for i in range(len(block["transactions"])):
88
87
  if "expiration" in block["transactions"][i] and isinstance(
89
- block["transactions"][i]["expiration"], string_types
88
+ block["transactions"][i]["expiration"], str
90
89
  ):
91
90
  block["transactions"][i]["expiration"] = formatTimeString(
92
91
  block["transactions"][i]["expiration"]
@@ -94,7 +93,7 @@ class Block(BlockchainObject):
94
93
  elif "operations" in block:
95
94
  for i in range(len(block["operations"])):
96
95
  if "timestamp" in block["operations"][i] and isinstance(
97
- block["operations"][i]["timestamp"], string_types
96
+ block["operations"][i]["timestamp"], str
98
97
  ):
99
98
  block["operations"][i]["timestamp"] = formatTimeString(
100
99
  block["operations"][i]["timestamp"]
@@ -186,9 +185,8 @@ class Block(BlockchainObject):
186
185
  else:
187
186
  block = self.blockchain.rpc.get_block(self.identifier)
188
187
  if not block:
189
- raise BlockDoesNotExistsException(
190
- "output: %s of identifier %s" % (str(block), str(self.identifier))
191
- )
188
+ message = f"Block {self.identifier} does not exist or is not available from {self.blockchain.rpc.url}"
189
+ raise BlockDoesNotExistsException(message)
192
190
  block = self._parse_json_data(block)
193
191
  super(Block, self).__init__(
194
192
  block, lazy=self.lazy, full=self.full, blockchain_instance=self.blockchain
@@ -298,7 +296,8 @@ class Block(BlockchainObject):
298
296
 
299
297
  ops_stat = nectarbase.operationids.operations.copy()
300
298
  for key in ops_stat:
301
- ops_stat[key] = 0
299
+ if isinstance(key, int):
300
+ ops_stat[key] = 0
302
301
  else:
303
302
  ops_stat = add_to_ops_stat.copy()
304
303
  for op in self.operations:
@@ -386,7 +385,7 @@ class BlockHeader(BlockchainObject):
386
385
  "timestamp",
387
386
  ]
388
387
  for p in parse_times:
389
- if p in block and isinstance(block.get(p), string_types):
388
+ if p in block and isinstance(block.get(p), str):
390
389
  block[p] = formatTimeString(block.get(p, "1970-01-01T00:00:00"))
391
390
  return block
392
391