hive-nectar 0.2.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.
Files changed (87) hide show
  1. hive_nectar-0.2.9.dist-info/METADATA +194 -0
  2. hive_nectar-0.2.9.dist-info/RECORD +87 -0
  3. hive_nectar-0.2.9.dist-info/WHEEL +4 -0
  4. hive_nectar-0.2.9.dist-info/entry_points.txt +2 -0
  5. hive_nectar-0.2.9.dist-info/licenses/LICENSE.txt +23 -0
  6. nectar/__init__.py +37 -0
  7. nectar/account.py +5076 -0
  8. nectar/amount.py +553 -0
  9. nectar/asciichart.py +303 -0
  10. nectar/asset.py +122 -0
  11. nectar/block.py +574 -0
  12. nectar/blockchain.py +1242 -0
  13. nectar/blockchaininstance.py +2590 -0
  14. nectar/blockchainobject.py +263 -0
  15. nectar/cli.py +5937 -0
  16. nectar/comment.py +1552 -0
  17. nectar/community.py +854 -0
  18. nectar/constants.py +95 -0
  19. nectar/discussions.py +1437 -0
  20. nectar/exceptions.py +152 -0
  21. nectar/haf.py +381 -0
  22. nectar/hive.py +630 -0
  23. nectar/imageuploader.py +114 -0
  24. nectar/instance.py +113 -0
  25. nectar/market.py +876 -0
  26. nectar/memo.py +542 -0
  27. nectar/message.py +379 -0
  28. nectar/nodelist.py +309 -0
  29. nectar/price.py +603 -0
  30. nectar/profile.py +74 -0
  31. nectar/py.typed +0 -0
  32. nectar/rc.py +333 -0
  33. nectar/snapshot.py +1024 -0
  34. nectar/storage.py +62 -0
  35. nectar/transactionbuilder.py +659 -0
  36. nectar/utils.py +630 -0
  37. nectar/version.py +3 -0
  38. nectar/vote.py +722 -0
  39. nectar/wallet.py +472 -0
  40. nectar/witness.py +728 -0
  41. nectarapi/__init__.py +12 -0
  42. nectarapi/exceptions.py +126 -0
  43. nectarapi/graphenerpc.py +596 -0
  44. nectarapi/node.py +194 -0
  45. nectarapi/noderpc.py +79 -0
  46. nectarapi/openapi.py +107 -0
  47. nectarapi/py.typed +0 -0
  48. nectarapi/rpcutils.py +98 -0
  49. nectarapi/version.py +3 -0
  50. nectarbase/__init__.py +15 -0
  51. nectarbase/ledgertransactions.py +106 -0
  52. nectarbase/memo.py +242 -0
  53. nectarbase/objects.py +521 -0
  54. nectarbase/objecttypes.py +21 -0
  55. nectarbase/operationids.py +102 -0
  56. nectarbase/operations.py +1357 -0
  57. nectarbase/py.typed +0 -0
  58. nectarbase/signedtransactions.py +89 -0
  59. nectarbase/transactions.py +11 -0
  60. nectarbase/version.py +3 -0
  61. nectargraphenebase/__init__.py +27 -0
  62. nectargraphenebase/account.py +1121 -0
  63. nectargraphenebase/aes.py +49 -0
  64. nectargraphenebase/base58.py +197 -0
  65. nectargraphenebase/bip32.py +575 -0
  66. nectargraphenebase/bip38.py +110 -0
  67. nectargraphenebase/chains.py +15 -0
  68. nectargraphenebase/dictionary.py +2 -0
  69. nectargraphenebase/ecdsasig.py +309 -0
  70. nectargraphenebase/objects.py +130 -0
  71. nectargraphenebase/objecttypes.py +8 -0
  72. nectargraphenebase/operationids.py +5 -0
  73. nectargraphenebase/operations.py +25 -0
  74. nectargraphenebase/prefix.py +13 -0
  75. nectargraphenebase/py.typed +0 -0
  76. nectargraphenebase/signedtransactions.py +221 -0
  77. nectargraphenebase/types.py +557 -0
  78. nectargraphenebase/unsignedtransactions.py +288 -0
  79. nectargraphenebase/version.py +3 -0
  80. nectarstorage/__init__.py +57 -0
  81. nectarstorage/base.py +317 -0
  82. nectarstorage/exceptions.py +15 -0
  83. nectarstorage/interfaces.py +244 -0
  84. nectarstorage/masterpassword.py +237 -0
  85. nectarstorage/py.typed +0 -0
  86. nectarstorage/ram.py +27 -0
  87. nectarstorage/sqlite.py +343 -0
nectar/storage.py ADDED
@@ -0,0 +1,62 @@
1
+ import logging
2
+ from typing import Any, MutableMapping
3
+
4
+ from nectarstorage import SqliteConfigurationStore, SqliteEncryptedKeyStore
5
+
6
+ from .nodelist import NodeList
7
+
8
+ log = logging.getLogger(__name__)
9
+ log.setLevel(logging.DEBUG)
10
+ log.addHandler(logging.StreamHandler())
11
+
12
+
13
+ timeformat = "%Y%m%d-%H%M%S"
14
+
15
+
16
+ def generate_config_store(
17
+ config: MutableMapping[str, Any], blockchain: str = "hive", **kwargs: Any
18
+ ) -> MutableMapping[str, Any]:
19
+ #: Default configuration
20
+ """
21
+ Populate a configuration mapping with sensible defaults for Hive-related settings and return it.
22
+
23
+ This function mutates the provided mapping in-place by ensuring a set of default configuration keys exist and returns the same mapping. When `blockchain` is "hive" it fills the "node" entry with a current list of Hive nodes; for other values "node" is set to an empty list. Defaults include client and RPC placeholders, order expiration (7 days), canonical URL, default derivation path, and a Tor toggle.
24
+
25
+ Parameters:
26
+ config (MutableMapping): A dict-like configuration object to populate. It will be modified in place.
27
+ blockchain (str): Chain identifier; "hive" populates Hive nodes, any other value leaves the node list empty.
28
+
29
+ Returns:
30
+ MutableMapping: The same `config` mapping after defaults have been set.
31
+ """
32
+ nodelist = NodeList()
33
+ if blockchain == "hive":
34
+ nodes = nodelist.get_hive_nodes(testnet=False)
35
+ else:
36
+ # Hive-only
37
+ nodes = []
38
+
39
+ config.setdefault("node", nodes)
40
+ config.setdefault("default_chain", blockchain)
41
+ config.setdefault("password_storage", "environment")
42
+ config.setdefault("rpcpassword", "")
43
+ config.setdefault("rpcuser", "")
44
+ config.setdefault("order-expiration", 7 * 24 * 60 * 60)
45
+ config.setdefault("client_id", "")
46
+ config.setdefault("default_canonical_url", "https://hive.blog")
47
+ config.setdefault("default_path", "48'/13'/0'/0'/0'")
48
+ # Legacy toggle retained for compatibility; always treated as False in code paths.
49
+ config.setdefault("use_condenser", False)
50
+ config.setdefault("use_tor", False)
51
+ return config
52
+
53
+
54
+ def get_default_config_store(*args, **kwargs) -> MutableMapping[str, Any]:
55
+ config_store = SqliteConfigurationStore(*args, **kwargs)
56
+ return generate_config_store(config_store, blockchain="hive")
57
+
58
+
59
+ def get_default_key_store(
60
+ config: MutableMapping[str, Any], *args, **kwargs
61
+ ) -> SqliteEncryptedKeyStore:
62
+ return SqliteEncryptedKeyStore(config=config, **kwargs)