nectarbase.signedtransactions module
- class nectarbase.signedtransactions.Signed_Transaction(*args: Any, **kwargs: Any)
Bases:
Signed_TransactionCreate a signed transaction and offer method to create the signature
- Parameters:
refNum (num) – parameter ref_block_num (see
nectarbase.transactions.getBlockParams())refPrefix (num) – parameter ref_block_prefix (see
nectarbase.transactions.getBlockParams())expiration (str) – expiration date
operations (array) – array of operations
custom_chains (dict) – custom chain which should be added to the known chains
- add_custom_chains(custom_chain: Mapping[str, Any]) None
Add entries from custom_chain into this transaction’s known chains without overwriting existing entries.
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. Parameters:
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.
- getKnownChains() Dict[str, Any]
- getOperationKlass() type[Operation]
Return the Operation class used to construct operations for this transaction.
- Returns:
type: The Operation class used by this Signed_Transaction.
- sign(wifkeys: str | List[str], chain: str | Dict[str, Any] | None = None) Signed_Transaction
Sign the transaction using one or more WIF-format private keys.
wifkeys: Single WIF string or iterable of WIF private key strings used to produce signatures. chain: Chain identifier to use for signing (defaults to “HIVE”).
- Returns:
The value returned by the superclass sign implementation.
- verify(pubkeys: List[Any] | None = None, chain: str | Dict[str, Any] | None = None, recover_parameter: bool = False) List[Any]
Verify this transaction’s signatures.
- Parameters:
- pubkeys (list[str] | None): Public keys to verify against. If None, an empty list is used (all signatures will be checked
without restricting expected pubkeys).
chain (str): Chain identifier to use for verification (defaults to “HIVE”). recover_parameter (bool): If True, return signature recovery parameters alongside verification results.
- Returns:
Any: The result returned by the superclass verify method (verification outcome as defined by the base implementation).