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.
- hive_nectar-0.2.9.dist-info/METADATA +194 -0
- hive_nectar-0.2.9.dist-info/RECORD +87 -0
- hive_nectar-0.2.9.dist-info/WHEEL +4 -0
- hive_nectar-0.2.9.dist-info/entry_points.txt +2 -0
- hive_nectar-0.2.9.dist-info/licenses/LICENSE.txt +23 -0
- nectar/__init__.py +37 -0
- nectar/account.py +5076 -0
- nectar/amount.py +553 -0
- nectar/asciichart.py +303 -0
- nectar/asset.py +122 -0
- nectar/block.py +574 -0
- nectar/blockchain.py +1242 -0
- nectar/blockchaininstance.py +2590 -0
- nectar/blockchainobject.py +263 -0
- nectar/cli.py +5937 -0
- nectar/comment.py +1552 -0
- nectar/community.py +854 -0
- nectar/constants.py +95 -0
- nectar/discussions.py +1437 -0
- nectar/exceptions.py +152 -0
- nectar/haf.py +381 -0
- nectar/hive.py +630 -0
- nectar/imageuploader.py +114 -0
- nectar/instance.py +113 -0
- nectar/market.py +876 -0
- nectar/memo.py +542 -0
- nectar/message.py +379 -0
- nectar/nodelist.py +309 -0
- nectar/price.py +603 -0
- nectar/profile.py +74 -0
- nectar/py.typed +0 -0
- nectar/rc.py +333 -0
- nectar/snapshot.py +1024 -0
- nectar/storage.py +62 -0
- nectar/transactionbuilder.py +659 -0
- nectar/utils.py +630 -0
- nectar/version.py +3 -0
- nectar/vote.py +722 -0
- nectar/wallet.py +472 -0
- nectar/witness.py +728 -0
- nectarapi/__init__.py +12 -0
- nectarapi/exceptions.py +126 -0
- nectarapi/graphenerpc.py +596 -0
- nectarapi/node.py +194 -0
- nectarapi/noderpc.py +79 -0
- nectarapi/openapi.py +107 -0
- nectarapi/py.typed +0 -0
- nectarapi/rpcutils.py +98 -0
- nectarapi/version.py +3 -0
- nectarbase/__init__.py +15 -0
- nectarbase/ledgertransactions.py +106 -0
- nectarbase/memo.py +242 -0
- nectarbase/objects.py +521 -0
- nectarbase/objecttypes.py +21 -0
- nectarbase/operationids.py +102 -0
- nectarbase/operations.py +1357 -0
- nectarbase/py.typed +0 -0
- nectarbase/signedtransactions.py +89 -0
- nectarbase/transactions.py +11 -0
- nectarbase/version.py +3 -0
- nectargraphenebase/__init__.py +27 -0
- nectargraphenebase/account.py +1121 -0
- nectargraphenebase/aes.py +49 -0
- nectargraphenebase/base58.py +197 -0
- nectargraphenebase/bip32.py +575 -0
- nectargraphenebase/bip38.py +110 -0
- nectargraphenebase/chains.py +15 -0
- nectargraphenebase/dictionary.py +2 -0
- nectargraphenebase/ecdsasig.py +309 -0
- nectargraphenebase/objects.py +130 -0
- nectargraphenebase/objecttypes.py +8 -0
- nectargraphenebase/operationids.py +5 -0
- nectargraphenebase/operations.py +25 -0
- nectargraphenebase/prefix.py +13 -0
- nectargraphenebase/py.typed +0 -0
- nectargraphenebase/signedtransactions.py +221 -0
- nectargraphenebase/types.py +557 -0
- nectargraphenebase/unsignedtransactions.py +288 -0
- nectargraphenebase/version.py +3 -0
- nectarstorage/__init__.py +57 -0
- nectarstorage/base.py +317 -0
- nectarstorage/exceptions.py +15 -0
- nectarstorage/interfaces.py +244 -0
- nectarstorage/masterpassword.py +237 -0
- nectarstorage/py.typed +0 -0
- nectarstorage/ram.py +27 -0
- nectarstorage/sqlite.py +343 -0
nectarbase/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
3
|
+
|
|
4
|
+
from nectargraphenebase.chains import known_chains
|
|
5
|
+
from nectargraphenebase.signedtransactions import Signed_Transaction as GrapheneSigned_Transaction
|
|
6
|
+
|
|
7
|
+
from .operations import Operation
|
|
8
|
+
|
|
9
|
+
log = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Signed_Transaction(GrapheneSigned_Transaction):
|
|
13
|
+
"""Create a signed transaction and offer method to create the
|
|
14
|
+
signature
|
|
15
|
+
|
|
16
|
+
:param num refNum: parameter ref_block_num (see :func:`nectarbase.transactions.getBlockParams`)
|
|
17
|
+
:param num refPrefix: parameter ref_block_prefix (see :func:`nectarbase.transactions.getBlockParams`)
|
|
18
|
+
:param str expiration: expiration date
|
|
19
|
+
:param array operations: array of operations
|
|
20
|
+
:param dict custom_chains: custom chain which should be added to the known chains
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
24
|
+
self.known_chains = known_chains
|
|
25
|
+
custom_chain = kwargs.get("custom_chains", {})
|
|
26
|
+
if len(custom_chain) > 0:
|
|
27
|
+
for c in custom_chain:
|
|
28
|
+
if c not in self.known_chains:
|
|
29
|
+
self.known_chains[c] = custom_chain[c]
|
|
30
|
+
super().__init__(*args, **kwargs)
|
|
31
|
+
|
|
32
|
+
def add_custom_chains(self, custom_chain: Mapping[str, Any]) -> None:
|
|
33
|
+
"""
|
|
34
|
+
Add entries from custom_chain into this transaction's known chains without overwriting existing entries.
|
|
35
|
+
|
|
36
|
+
Accepts a mapping of chain identifiers to chain configuration values and merges any keys not already present into self.known_chains. Existing known chains are left unchanged.
|
|
37
|
+
Parameters:
|
|
38
|
+
custom_chain (Mapping): Mapping of chain name -> chain data (e.g., RPC URL or chain parameters); keys present in self.known_chains are not replaced.
|
|
39
|
+
"""
|
|
40
|
+
if len(custom_chain) > 0:
|
|
41
|
+
for c in custom_chain:
|
|
42
|
+
if c not in self.known_chains:
|
|
43
|
+
self.known_chains[c] = custom_chain[c]
|
|
44
|
+
|
|
45
|
+
def sign(
|
|
46
|
+
self, wifkeys: Union[str, List[str]], chain: Optional[Union[str, Dict[str, Any]]] = None
|
|
47
|
+
) -> GrapheneSigned_Transaction:
|
|
48
|
+
"""
|
|
49
|
+
Sign the transaction using one or more WIF-format private keys.
|
|
50
|
+
|
|
51
|
+
wifkeys: Single WIF string or iterable of WIF private key strings used to produce signatures.
|
|
52
|
+
chain: Chain identifier to use for signing (defaults to "HIVE").
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
The value returned by the superclass `sign` implementation.
|
|
56
|
+
"""
|
|
57
|
+
return super().sign(wifkeys, chain)
|
|
58
|
+
|
|
59
|
+
def verify(
|
|
60
|
+
self,
|
|
61
|
+
pubkeys: Optional[List[Any]] = None,
|
|
62
|
+
chain: Optional[Union[str, Dict[str, Any]]] = None,
|
|
63
|
+
recover_parameter: bool = False,
|
|
64
|
+
) -> List[Any]:
|
|
65
|
+
"""
|
|
66
|
+
Verify this transaction's signatures.
|
|
67
|
+
|
|
68
|
+
Parameters:
|
|
69
|
+
pubkeys (list[str] | None): Public keys to verify against. If None, an empty list is used (all signatures will be checked
|
|
70
|
+
without restricting expected pubkeys).
|
|
71
|
+
chain (str): Chain identifier to use for verification (defaults to "HIVE").
|
|
72
|
+
recover_parameter (bool): If True, return signature recovery parameters alongside verification results.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
Any: The result returned by the superclass verify method (verification outcome as defined by the base implementation).
|
|
76
|
+
"""
|
|
77
|
+
return super().verify(pubkeys, chain, recover_parameter)
|
|
78
|
+
|
|
79
|
+
def getOperationKlass(self) -> type[Operation]:
|
|
80
|
+
"""
|
|
81
|
+
Return the Operation class used to construct operations for this transaction.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
type: The Operation class used by this Signed_Transaction.
|
|
85
|
+
"""
|
|
86
|
+
return Operation
|
|
87
|
+
|
|
88
|
+
def getKnownChains(self) -> Dict[str, Any]:
|
|
89
|
+
return self.known_chains
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def getBlockParams(ws: Any) -> None:
|
|
5
|
+
"""Auxiliary method to obtain ``ref_block_num`` and
|
|
6
|
+
``ref_block_prefix``. Requires a websocket connection to a
|
|
7
|
+
witness node!
|
|
8
|
+
"""
|
|
9
|
+
raise DeprecationWarning(
|
|
10
|
+
"This method shouldn't be called anymore. It is part of transactionbuilder now"
|
|
11
|
+
)
|
nectarbase/version.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""nectargraphenebase."""
|
|
2
|
+
|
|
3
|
+
from .version import version as __version__
|
|
4
|
+
|
|
5
|
+
# from . import account as Account
|
|
6
|
+
# from .account import PrivateKey, PublicKey, Address, BrainKey
|
|
7
|
+
# from . import base58 as Base58
|
|
8
|
+
# from . import bip38 as Bip38
|
|
9
|
+
# from . import transactions as Transactions
|
|
10
|
+
# from . import dictionary as BrainKeyDictionary
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"__version__",
|
|
14
|
+
"account",
|
|
15
|
+
"aes",
|
|
16
|
+
"base58",
|
|
17
|
+
"bip32",
|
|
18
|
+
"bip38",
|
|
19
|
+
"types",
|
|
20
|
+
"ecdasig",
|
|
21
|
+
"chains",
|
|
22
|
+
"objects",
|
|
23
|
+
"operations",
|
|
24
|
+
"signedtransactions",
|
|
25
|
+
"unsignedtransactions",
|
|
26
|
+
"objecttypes",
|
|
27
|
+
]
|