Skip to content

Reference

wax

IHiveChainInterface

Bases: IWaxBaseInterface, Generic[ApiCollectionT]

api abstractmethod property

Returns the API collection object.

endpoint_url abstractmethod property writable

endpoint_url: HttpUrl

Returns the selected endpoint url used to perform API calls.

broadcast abstractmethod async

Broadcast transaction to the selected during Wax Chain initialization Hive Node.

Please note that when IOnlineTransaction is passed perform_on_chain_verification method is called automatically.

Parameters:

Name Type Description Default
transaction
ITransaction | IOnlineTransaction

Transaction object to be broadcasted.

required

Raises:

Type Description
TransactionNotSignedError

When the transaction is not signed.

WaxValidationFailedError

When the transaction is incorrect.

AccountNotFoundError

If IOnlineTransaction provided and ANY of impacted accounts not found on the chain.

PrivateKeyDetectedInMemoError

If IOnlineTransaction provided private key detected in the content of the operation.

Source code in wax/interfaces.py
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
@abstractmethod
async def broadcast(self, transaction: ITransaction | IOnlineTransaction) -> None:
    """
    Broadcast transaction to the selected during Wax Chain initialization Hive Node.

    Please note that when IOnlineTransaction is passed `perform_on_chain_verification`
    method is called automatically.

    Args:
        transaction: Transaction object to be broadcasted.

    Raises:
        TransactionNotSignedError: When the transaction is not signed.
        WaxValidationFailedError: When the transaction is incorrect.
        AccountNotFoundError: If IOnlineTransaction provided and ANY of impacted accounts not found on the chain.
        PrivateKeyDetectedInMemoError: If IOnlineTransaction provided private key detected in the content
         of the operation.
    """

collect_account_authorities abstractmethod async

collect_account_authorities(*accounts: AccountName) -> WaxAccountAuthorityInfo | list[WaxAccountAuthorityInfo]

Collects account authorities.

Parameters:

Name Type Description Default
accounts
AccountName

Account name(s).

()

Returns:

Name Type Description
WaxAccountAuthorityInfo WaxAccountAuthorityInfo | list[WaxAccountAuthorityInfo]

Account authority info.

Raises:

Type Description
InvalidAccountNameError

When the account(s) name is invalid.

AccountNotFoundError

When the account(s) is not found in the HIVE api node.

Source code in wax/interfaces.py
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
@abstractmethod
async def collect_account_authorities(
    self, *accounts: AccountName
) -> WaxAccountAuthorityInfo | list[WaxAccountAuthorityInfo]:
    """
    Collects account authorities.

    Args:
        accounts: Account name(s).

    Returns:
        WaxAccountAuthorityInfo: Account authority info.

    Raises:
        InvalidAccountNameError: When the account(s) name is invalid.
        AccountNotFoundError: When the account(s) is not found in the HIVE api node.
    """

create_transaction abstractmethod async

create_transaction(expiration: TTimestamp | None = None) -> IOnlineTransaction

Same as IWaxBaseInterface.create_transaction_with_tapos but pulls the reference block data from the remote.

Parameters:

Name Type Description Default
expiration
TTimestamp | None

time (UTC) till transaction is valid. Default to +1 minute.

None

Returns:

Type Description
IOnlineTransaction

Transaction object

Raises:

Type Description
AssertionError

when expiration is not valid type.

Source code in wax/interfaces.py
722
723
724
725
726
727
728
729
730
731
732
733
734
735
@abstractmethod
async def create_transaction(self, expiration: TTimestamp | None = None) -> IOnlineTransaction:
    """
    Same as `IWaxBaseInterface.create_transaction_with_tapos` but pulls the reference block data from the remote.

    Args:
        expiration: time (UTC) till transaction is valid. Default to +1 minute.

    Returns:
        Transaction object

    Raises:
        AssertionError: when expiration is not valid type.
    """

extend_rest abstractmethod

Extends the current rest API collection with a new one.

Parameters:

Name Type Description Default
new_rest_api
type[ExtendedApiCollectionT]

New rest API collection class to be added.

required

Returns:

Name Type Description
IHiveChainInterface IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]

New chain instance with the extended rest API collection.

Examples:

class MyCustomApiCollection: def init(self): self.my_custom_api = MyCustomApi

chain = create_hive_chain() extended_chain = chain.extend_rest(ExtendedApiCollection)

response = await extended_chain.api.my_custom_api.custom_endpoint() # With full intellisense support

Source code in wax/interfaces.py
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
@abstractmethod
def extend_rest(
    self, new_rest_api: type[ExtendedApiCollectionT]
) -> IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]:
    """
    Extends the current rest API collection with a new one.

    Args:
        new_rest_api: New rest API collection class to be added.

    Returns:
        IHiveChainInterface: New chain instance with the extended rest API collection.

    Examples:
        class MyCustomApiCollection:
            def __init__(self):
               self.my_custom_api = MyCustomApi

        chain = create_hive_chain()
        extended_chain = chain.extend_rest(ExtendedApiCollection)

        response = await extended_chain.api.my_custom_api.custom_endpoint()  # With full intellisense support
    """

extends abstractmethod

Extends the current API collection with a new one.

Parameters:

Name Type Description Default
new_api
type[ExtendedApiCollectionT]

New API collection class to be added.

required

Returns:

Name Type Description
IHiveChainInterface IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]

New chain instance with the extended API collection.

Examples:

class MyCustomApiCollection: def init(self): self.my_custom_api = MyCustomApi

chain = create_hive_chain() extended_chain = chain.extends(ExtendedApiCollection)

response = await extended_chain.api.my_custom_api.custom_endpoint() # With full intellisense support

Source code in wax/interfaces.py
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
@abstractmethod
def extends(
    self, new_api: type[ExtendedApiCollectionT]
) -> IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]:
    """
    Extends the current API collection with a new one.

    Args:
        new_api: New API collection class to be added.

    Returns:
        IHiveChainInterface: New chain instance with the extended API collection.

    Examples:
        class MyCustomApiCollection:
            def __init__(self):
               self.my_custom_api = MyCustomApi

        chain = create_hive_chain()
        extended_chain = chain.extends(ExtendedApiCollection)

        response = await extended_chain.api.my_custom_api.custom_endpoint()  # With full intellisense support
    """

teardown abstractmethod

teardown() -> None

Call when work with API communication is over.

Source code in wax/interfaces.py
718
719
720
@abstractmethod
def teardown(self) -> None:
    """Call when work with API communication is over."""

IOnlineTransaction

Bases: ITransaction, ABC

Transaction interface with support on-chain verification.

perform_on_chain_verification abstractmethod async

perform_on_chain_verification() -> None

Performs on-chain verification of the transaction.

This method checks if all accounts involved in the transaction exist on the blockchain. It also scans the transaction for any potential private key leaks in operation contents.

Raises:

Type Description
AccountNotFoundError

If ANY of impacted accounts do not exist in the blockchain.

PrivateKeyDetectedInMemoError

If private key detected in the content of the operation.

Source code in wax/interfaces.py
252
253
254
255
256
257
258
259
260
261
262
263
@abstractmethod
async def perform_on_chain_verification(self) -> None:
    """
    Performs on-chain verification of the transaction.

    This method checks if all accounts involved in the transaction exist on the blockchain.
    It also scans the transaction for any potential private key leaks in operation contents.

    Raises:
        AccountNotFoundError: If ANY of impacted accounts do not exist in the blockchain.
        PrivateKeyDetectedInMemoError: If private key detected in the content of the operation.
    """

ITransaction

Bases: ITransactionBase

push_operation abstractmethod

push_operation(operation: WaxMetaOperation) -> Self

Pushes given operation into the transaction (exactly to the list of operations).

Parameters:

Name Type Description Default
operation
WaxMetaOperation

Operation to be pushed into the transaction in dict or proto format.

required

Examples:

  • Proto format: transaction.push_operation(vote_pb2.vote(voter="alice", author="bob", permlink="/", weight=11))

Returns:

Name Type Description
Self Self

current transaction instance.

Source code in wax/interfaces.py
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
@abstractmethod
def push_operation(self, operation: WaxMetaOperation) -> Self:
    """
    Pushes given operation into the transaction (exactly to the list of operations).

    Args:
        operation: Operation to be pushed into the transaction in dict or proto format.

    Examples:
        * Proto format:
        transaction.push_operation(vote_pb2.vote(voter="alice", author="bob", permlink="/", weight=11))

    Returns:
        Self: current transaction instance.
    """

IWaxBaseInterface

Bases: ABC

address_prefix abstractmethod property

address_prefix: str

Returns the public key address prefix.

chain_id abstractmethod property

chain_id: ChainId

Returns the chain id.

config abstractmethod property

config: ChainConfig

Returns protocol configuration for the current chain.

hbd abstractmethod property

Returns set of methods to create HBD asset.

hive abstractmethod property

Returns set of methods to create HIVE asset.

vests abstractmethod property

vests: AssetFactory

Returns set of methods to create VESTS asset.

calculate_account_hp abstractmethod

Calculates account HP based on given vests, total vesting fund HIVE and total vesting shares.

Parameters:

Name Type Description Default
vests
VestsNaiAssetConvertible

VESTS asset.

required
total_vesting_fund_hive
HiveNaiAssetConvertible

HIVE asset total vesting fund.

required
total_vesting_shares
VestsNaiAssetConvertible

VESTS asset total vesting shares.

required

Returns:

Name Type Description
NaiAsset NaiAsset

calculated HP for the given vests, total vesting fund HIVE and total vesting shares.

Raises:

Type Description
UnknownAssetTypeError / CannotCreateAssetError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
@abstractmethod
def calculate_account_hp(
    self,
    vests: VestsNaiAssetConvertible,
    total_vesting_fund_hive: HiveNaiAssetConvertible,
    total_vesting_shares: VestsNaiAssetConvertible,
) -> NaiAsset:
    """
    Calculates account HP based on given vests, total vesting fund HIVE and total vesting shares.

    Args:
        vests: VESTS asset.
        total_vesting_fund_hive: HIVE asset total vesting fund.
        total_vesting_shares: VESTS asset total vesting shares.

    Returns:
        NaiAsset: calculated HP for the given vests, total vesting fund HIVE and total vesting shares.

    Raises:
        UnknownAssetTypeError/CannotCreateAssetError/AssertionError: When passed asset is incorrect.
    """

calculate_current_manabar_value abstractmethod staticmethod

Calculates of the current manabar.

Parameters:

Name Type Description Default
head_block_time
datetime

Head block time. Can be obtained using time property from dgpo (dynamic global properties)

required
max_mana
int

Maximum account mana. * For upvotes should equal post_voting_power.amount from the find_account. * For downvotes remember to multiply this value by downvote_pool_percent from the dgpo. * For rc manabar calculations use max_rc value from the rc_accounts API call.

required
current_mana
int

Current account mana. * For upvotes should equal voting_manabar.current_mana from the find_account API call. * For downvotes: downvote_manabar.current_mana. * For rc manabar calculations use rc_manabar value from the rc_accounts API call

required
last_update_time
int

Last update of the current account mana. * For upvotes should equal voting_manabar.last_update_time from the find_account API call. * For downvotes should equal downvote_manabar.current_mana. * For rc manabar calculations use rc_manabar value from the rc_accounts API call.

required

Returns:

Name Type Description
IManabarData IManabarData

Calculated manabar value.

Raises:

Type Description
WaxValidationFailedError

When passed parameters are wrong.

Source code in wax/interfaces.py
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
@staticmethod
@abstractmethod
def calculate_current_manabar_value(
    head_block_time: datetime, max_mana: int, current_mana: int, last_update_time: int
) -> IManabarData:
    """
    Calculates of the current manabar.

    Args:
        head_block_time:
            Head block time. Can be obtained using time property from dgpo (dynamic global properties)
        max_mana:
            Maximum account mana.
            * For upvotes should equal post_voting_power.amount from the find_account.
            * For downvotes remember to multiply this value by downvote_pool_percent from the dgpo.
            * For rc manabar calculations use max_rc value from the rc_accounts API call.
        current_mana:
            Current account mana.
            * For upvotes should equal voting_manabar.current_mana from the find_account API call.
            * For downvotes: downvote_manabar.current_mana.
            * For rc manabar calculations use rc_manabar value from the rc_accounts API call
        last_update_time:
            Last update of the current account mana.
            * For upvotes should equal voting_manabar.last_update_time from the find_account API call.
            * For downvotes should equal downvote_manabar.current_mana.
            * For rc manabar calculations use rc_manabar value from the rc_accounts API call.

    Returns:
        IManabarData: Calculated manabar value.

    Raises:
        WaxValidationFailedError: When passed parameters are wrong.
    """

calculate_hp_apr abstractmethod

Calculates HP APR.

Parameters:

Name Type Description Default
head_block_num
int

Head block number.

required
vesting_reward_percent
int

Vesting reward percent.

required
virtual_supply
HiveNaiAssetConvertible

Virtual supply.

required
total_vesting_fund_hive
HiveNaiAssetConvertible

Total vesting fund HIVE.

required

Returns:

Name Type Description
Decimal Decimal

HP APR percent with 2 decimals

Raises:

Type Description
WaxValidationFailedError

When passed parameters are wrong.

Source code in wax/interfaces.py
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
@abstractmethod
def calculate_hp_apr(
    self,
    head_block_num: int,
    vesting_reward_percent: int,
    virtual_supply: HiveNaiAssetConvertible,
    total_vesting_fund_hive: HiveNaiAssetConvertible,
) -> Decimal:
    """
    Calculates HP APR.

    Args:
        head_block_num: Head block number.
        vesting_reward_percent: Vesting reward percent.
        virtual_supply: Virtual supply.
        total_vesting_fund_hive: Total vesting fund HIVE.

    Returns:
        Decimal: HP APR percent with 2 decimals

    Raises:
        WaxValidationFailedError: When passed parameters are wrong.
    """

calculate_manabar_full_regeneration_time abstractmethod staticmethod

calculate_manabar_full_regeneration_time(head_block_time: datetime, max_mana: int, current_mana: int, last_update_time: int) -> datetime

Calculates manabar full regeneration time.

Parameters:

Name Type Description Default
head_block_time
datetime

Head block time. Can be obtained using time property from dgpo (dynamic global properties)

required
max_mana
int

Maximum account mana. * For upvotes should equal post_voting_power.amount from the find_account. * For downvotes remember to multiply this value by downvote_pool_percent from the dgpo. * For rc manabar calculations use max_rc value from the rc_accounts API call.

required
current_mana
int

Current account mana. * For upvotes should equal voting_manabar.current_mana from the find_account API call. * For downvotes: downvote_manabar.current_mana. * For rc manabar calculations use rc_manabar value from the rc_accounts API call

required
last_update_time
int

Last update of the current account mana. * For upvotes should equal voting_manabar.last_update_time from the find_account API call. * For downvotes should equal downvote_manabar.current_mana. * For rc manabar calculations use rc_manabar value from the rc_accounts API call.

required

Returns:

Name Type Description
datetime datetime

Calculated manabar full regeneration time.

Raises:

Type Description
WaxValidationFailedError

when passed parameters are wrong.

Source code in wax/interfaces.py
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
@staticmethod
@abstractmethod
def calculate_manabar_full_regeneration_time(
    head_block_time: datetime, max_mana: int, current_mana: int, last_update_time: int
) -> datetime:
    """
    Calculates manabar full regeneration time.

    Args:
        head_block_time:
            Head block time. Can be obtained using time property from dgpo (dynamic global properties)
        max_mana:
            Maximum account mana.
            * For upvotes should equal post_voting_power.amount from the find_account.
            * For downvotes remember to multiply this value by downvote_pool_percent from the dgpo.
            * For rc manabar calculations use max_rc value from the rc_accounts API call.
        current_mana:
            Current account mana.
            * For upvotes should equal voting_manabar.current_mana from the find_account API call.
            * For downvotes: downvote_manabar.current_mana.
            * For rc manabar calculations use rc_manabar value from the rc_accounts API call
        last_update_time:
            Last update of the current account mana.
            * For upvotes should equal voting_manabar.last_update_time from the find_account API call.
            * For downvotes should equal downvote_manabar.current_mana.
            * For rc manabar calculations use rc_manabar value from the rc_accounts API call.

    Returns:
        datetime: Calculated manabar full regeneration time.

    Raises:
        WaxValidationFailedError: when passed parameters are wrong.
    """

calculate_witness_votes_hp abstractmethod

Calculates witness votes HP based on given votes, total vesting fund HIVE and total vesting shares.

Parameters:

Name Type Description Default
number
int

witness votes.

required
total_vesting_fund_hive
HiveNaiAssetConvertible

HIVE asset total vesting fund.

required
total_vesting_shares
VestsNaiAssetConvertible

VESTS asset total vesting shares.

required

Returns:

Name Type Description
NaiAsset NaiAsset

Calculated votes in nai asset form.

Raises:

Type Description
UnknownAssetTypeError / CannotCreateAssetError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
@abstractmethod
def calculate_witness_votes_hp(
    self,
    number: int,
    total_vesting_fund_hive: HiveNaiAssetConvertible,
    total_vesting_shares: VestsNaiAssetConvertible,
) -> NaiAsset:
    """
    Calculates witness votes HP based on given votes, total vesting fund HIVE and total vesting shares.

    Args:
        number: witness votes.
        total_vesting_fund_hive: HIVE asset total vesting fund.
        total_vesting_shares: VESTS asset total vesting shares.

    Returns:
        NaiAsset: Calculated votes in nai asset form.

    Raises:
         UnknownAssetTypeError/CannotCreateAssetError/AssertionError: When passed asset is incorrect.
    """

create_transaction_from_json abstractmethod

create_transaction_from_json(transaction: JsonTransaction) -> ITransaction

Creates transaction object from JSON transaction.

Parameters:

Name Type Description Default
transaction
JsonTransaction

JSON transaction object.

required

Returns:

Type Description
ITransaction

Transaction object

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

Source code in wax/interfaces.py
630
631
632
633
634
635
636
637
638
639
640
641
642
643
@abstractmethod
def create_transaction_from_json(self, transaction: JsonTransaction) -> ITransaction:
    """
    Creates transaction object from JSON transaction.

    Args:
        transaction: JSON transaction object.

    Returns:
        Transaction object

    Raises:
        WaxValidationFailedError: When the transaction is incorrect.
    """

create_transaction_from_proto abstractmethod

create_transaction_from_proto(transaction: ProtoTransaction) -> ITransaction

Creates transaction object from proto transaction.

Parameters:

Name Type Description Default
transaction
ProtoTransaction

Proto transaction object.

required

Returns:

Type Description
ITransaction

Transaction object

Source code in wax/interfaces.py
618
619
620
621
622
623
624
625
626
627
628
@abstractmethod
def create_transaction_from_proto(self, transaction: ProtoTransaction) -> ITransaction:
    """
    Creates transaction object from proto transaction.

    Args:
        transaction: Proto transaction object.

    Returns:
        Transaction object
    """

create_transaction_with_tapos abstractmethod

create_transaction_with_tapos(tapos_block_id: str, expiration: TTimestamp | None = None) -> ITransaction

Creates transaction object using basic information from chain.

Parameters:

Name Type Description Default
tapos_block_id
str

Block id (mostly head) that transaction should refer to

required
expiration
TTimestamp | None

time (UTC) till transaction is valid. Default to +1 minute.

None

Returns:

Type Description
ITransaction

Transaction object

Source code in wax/interfaces.py
605
606
607
608
609
610
611
612
613
614
615
616
@abstractmethod
def create_transaction_with_tapos(self, tapos_block_id: str, expiration: TTimestamp | None = None) -> ITransaction:
    """
    Creates transaction object using basic information from chain.

    Args:
        tapos_block_id: Block id (mostly head) that transaction should refer to
        expiration: time (UTC) till transaction is valid. Default to +1 minute.

    Returns:
        Transaction object
    """

estimate_hive_collateral abstractmethod

Estimate hive collateral.

Parameters:

Name Type Description Default
current_median_history_base
HbdNaiAssetConvertible

Base for Current median price retrieved by get_feed_history

required
current_median_history_quote
HiveNaiAssetConvertible

Quote for Current median price retrieved by get_feed_history

required
current_min_history_base
HbdNaiAssetConvertible

Base for Current minimal price retrieved by get_feed_history

required
current_min_history_quote
HiveNaiAssetConvertible

Quote for Current minimal price retrieved by get_feed_history

required
hbd_amount_to_get
HbdNaiAssetConvertible

HBD amount to get.

required

Returns:

Name Type Description
NaiAsset NaiAsset

Estimated HIVE collateral.

Raises:

Type Description
CannotCreateAssetError / UnknownAssetTypeError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
@abstractmethod
def estimate_hive_collateral(
    self,
    current_median_history_base: HbdNaiAssetConvertible,
    current_median_history_quote: HiveNaiAssetConvertible,
    current_min_history_base: HbdNaiAssetConvertible,
    current_min_history_quote: HiveNaiAssetConvertible,
    hbd_amount_to_get: HbdNaiAssetConvertible,
) -> NaiAsset:
    """
    Estimate hive collateral.

    Args:
        current_median_history_base: Base for Current median price retrieved by `get_feed_history`
        current_median_history_quote: Quote for Current median price retrieved by `get_feed_history`
        current_min_history_base: Base for Current minimal price retrieved by `get_feed_history`
        current_min_history_quote:  Quote for Current minimal price retrieved by `get_feed_history`
        hbd_amount_to_get: HBD amount to get.

    Returns:
        NaiAsset: Estimated HIVE collateral.

    Raises:
        CannotCreateAssetError/UnknownAssetTypeError/AssertionError: When passed asset is incorrect.
    """

get_operation_impacted_accounts abstractmethod staticmethod

get_operation_impacted_accounts(operation: Operation) -> list[AccountName]

Retrieves the list of account names (not authorities!) that are impacted by a given operation.

Parameters:

Name Type Description Default
operation
Operation

Operation in HF26 format or proto operation.

required

Returns:

Type Description
list[AccountName]

list[AccountName]: list of account names impacted in operation.

Raises:

Type Description
(InvalidOperationFormatError, WaxValidationFailedError)

When operation is incorrect.

Source code in wax/interfaces.py
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
@staticmethod
@abstractmethod
def get_operation_impacted_accounts(operation: Operation) -> list[AccountName]:
    """
    Retrieves the list of account names (not authorities!) that are impacted by a given operation.

    Args:
        operation: Operation in HF26 format or proto operation.

    Returns:
        list[AccountName]: list of account names impacted in operation.

    Raises:
        InvalidOperationFormatError, WaxValidationFailedError: When operation is incorrect.
    """

get_private_key_from_password abstractmethod staticmethod

get_private_key_from_password(account: AccountName, role: str, password: str) -> IPrivateKeyData

Returns private key data.

Parameters:

Name Type Description Default
account
AccountName

Account name.

required
role
str

active | owner | posting | memo.

required
password
str

the Master Password to derive key from.

required

Returns:

Name Type Description
PrivateKeyData IPrivateKeyData

generated private key along with the associated public key in WIF format.

Source code in wax/interfaces.py
454
455
456
457
458
459
460
461
462
463
464
465
466
467
@staticmethod
@abstractmethod
def get_private_key_from_password(account: AccountName, role: str, password: str) -> IPrivateKeyData:
    """
    Returns private key data.

    Args:
        account: Account name.
        role: active | owner | posting | memo.
        password: the Master Password to derive key from.

    Returns:
        PrivateKeyData: generated private key along with the associated public key in WIF format.
    """

get_public_key_from_signature abstractmethod staticmethod

get_public_key_from_signature(sig_digest: Hex, signature: Signature) -> PublicKey

Retrieves the public key in wif format from the given sig digest and signature in hexadecimal format.

Parameters:

Name Type Description Default
sig_digest
Hex

Digest data in hexadecimal format.

required
signature
Signature

Signature in hexadecimal format.

required

Returns:

Name Type Description
PublicKey PublicKey

Public key used in the signature

Raises:

Type Description
WaxValidationFailedError

When passed parameters are wrong.

Source code in wax/interfaces.py
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
@staticmethod
@abstractmethod
def get_public_key_from_signature(sig_digest: Hex, signature: Signature) -> PublicKey:
    """
    Retrieves the public key in wif format from the given sig digest and signature in hexadecimal format.

    Args:
        sig_digest: Digest data in hexadecimal format.
        signature: Signature in hexadecimal format.

    Returns:
        PublicKey: Public key used in the signature

    Raises:
        WaxValidationFailedError: When passed parameters are wrong.
    """

hbd_to_hive abstractmethod

Converts given HBD into HIVE, both in nai form.

Parameters:

Name Type Description Default
hbd
HbdNaiAssetConvertible

HBD asset to be converted.

required
base
HbdNaiAssetConvertible

HBD asset price base.

required
quote
HiveNaiAssetConvertible

HIVE asset price quote.

required

Returns:

Name Type Description
NaiAsset NaiAsset

asset converted asset into HIVE.

Raises:

Type Description
UnknownAssetTypeError / CannotCreateAssetError / AssertionError

When passed asset it is incorrect.

Source code in wax/interfaces.py
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
@abstractmethod
def hbd_to_hive(
    self, hbd: HbdNaiAssetConvertible, base: HbdNaiAssetConvertible, quote: HiveNaiAssetConvertible
) -> NaiAsset:
    """
    Converts given HBD into HIVE, both in nai form.

    Args:
        hbd: HBD asset to be converted.
        base: HBD asset price base.
        quote: HIVE asset price quote.

    Returns:
        NaiAsset: asset converted asset into HIVE.

    Raises:
        UnknownAssetTypeError/CannotCreateAssetError/AssertionError: When passed asset it is incorrect.
    """

hive_to_hbd abstractmethod

Converts given HIVE into HBD, both in nai form.

Parameters:

Name Type Description Default
hive
HiveNaiAssetConvertible

HIVE asset to be converted.

required
base
HbdNaiAssetConvertible

HBD asset price base.

required
quote
HiveNaiAssetConvertible

HIVE asset price quote.

required

Returns:

Name Type Description
NaiAsset NaiAsset

converted asset into HBD.

Raises:

Type Description
UnknownAssetTypeError / CannotCreateAssetError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
@abstractmethod
def hive_to_hbd(
    self, hive: HiveNaiAssetConvertible, base: HbdNaiAssetConvertible, quote: HiveNaiAssetConvertible
) -> NaiAsset:
    """
    Converts given HIVE into HBD, both in nai form.

    Args:
        hive: HIVE asset to be converted.
        base: HBD asset price base.
        quote: HIVE asset price quote.

    Returns:
        NaiAsset: converted asset into HBD.

    Raises:
        UnknownAssetTypeError/CannotCreateAssetError/AssertionError: When passed asset is incorrect.
    """

is_valid_account_name abstractmethod staticmethod

is_valid_account_name(account_name: AccountName) -> bool

Checks if the given account name is valid.

Parameters:

Name Type Description Default
account_name
AccountName

Account name to be checked.

required

Returns:

Name Type Description
bool bool

True if the account name is valid, False otherwise.

Source code in wax/interfaces.py
294
295
296
297
298
299
300
301
302
303
304
305
@staticmethod
@abstractmethod
def is_valid_account_name(account_name: AccountName) -> bool:
    """
    Checks if the given account name is valid.

    Args:
        account_name: Account name to be checked.

    Returns:
        bool: True if the account name is valid, False otherwise.
    """

suggest_brain_key abstractmethod staticmethod

suggest_brain_key() -> IBrainKeyData

Returns brain key data.

Returns:

Name Type Description
BrainKeyData IBrainKeyData
  • brain key: a string containing space separated list of N words generated as a brain key (atm 16)
  • wif private key: first private key derived from above specified brain key
  • associated public key: base58 string pointing the public key associated to the private key
Source code in wax/interfaces.py
441
442
443
444
445
446
447
448
449
450
451
452
@staticmethod
@abstractmethod
def suggest_brain_key() -> IBrainKeyData:
    """
    Returns brain key data.

    Returns:
        BrainKeyData:
            * brain key: a string containing space separated list of N words generated as a brain key (atm 16)
            * wif private key: first private key derived from above specified brain key
            * associated public key: base58 string pointing the public key associated to the private key
    """

vests_to_hp abstractmethod

Converts given VESTS into HP, both in nai form.

Parameters:

Name Type Description Default
vests
VestsNaiAssetConvertible

VESTS asset.

required
total_vesting_fund_hive
HiveNaiAssetConvertible

HIVE asset total vesting fund.

required
total_vesting_shares
VestsNaiAssetConvertible

VESTS asset total vesting shares.

required

Returns:

Name Type Description
NaiAsset NaiAsset

converted asset into HP (HIVE).

Raises:

Type Description
CannotCreateAssetError / UnknownAssetTypeError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
@abstractmethod
def vests_to_hp(
    self,
    vests: VestsNaiAssetConvertible,
    total_vesting_fund_hive: HiveNaiAssetConvertible,
    total_vesting_shares: VestsNaiAssetConvertible,
) -> NaiAsset:
    """
    Converts given VESTS into HP, both in nai form.

    Args:
        vests: VESTS asset.
        total_vesting_fund_hive: HIVE asset total vesting fund.
        total_vesting_shares: VESTS asset total vesting shares.

    Returns:
        NaiAsset: converted asset into HP (HIVE).

    Raises:
        CannotCreateAssetError/UnknownAssetTypeError/AssertionError: When passed asset is incorrect.
    """

WaxChainOptions

WaxChainOptions(chain_id: ChainId | str = DEFAULT_CHAIN_ID, endpoint_url: HttpUrl | str = DEFAULT_ENDPOINT_URL)

Bases: WaxOptions

Allows configuration of wax itself, including chain part.

Constructs WaxChainOptions.

Parameters:

Name Type Description Default

chain_id

ChainId | str

chain id used for signing. Defaults to mainnet chain id.

DEFAULT_CHAIN_ID

endpoint_url

HttpUrl | str

url of the node to connect to. Defaults to mainnet (hive.blog) node.

DEFAULT_ENDPOINT_URL

Raises:

Type Description
InvalidEndpointUrlFormatError

if endpoint_url is not valid.

Source code in wax/wax_options.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
def __init__(
    self,
    chain_id: ChainId | str = DEFAULT_CHAIN_ID,
    endpoint_url: HttpUrl | str = DEFAULT_ENDPOINT_URL,
) -> None:
    """
    Constructs WaxChainOptions.

    Args:
        chain_id: chain id used for signing. Defaults to mainnet chain id.
        endpoint_url: url of the node to connect to. Defaults to mainnet (hive.blog) node.

    Raises:
        InvalidEndpointUrlFormatError: if endpoint_url is not valid.
    """
    super().__init__(chain_id)
    self._endpoint_url = convert_to_http_url(endpoint_url)

WaxOptions

WaxOptions(chain_id: ChainId = DEFAULT_CHAIN_ID)

Allows configuration of wax itself.

Constructs WaxOptions.

Parameters:

Name Type Description Default

chain_id

ChainId

chain id used for signing. Defaults to mainnet chain id.

DEFAULT_CHAIN_ID
Source code in wax/wax_options.py
16
17
18
19
20
21
22
23
def __init__(self, chain_id: ChainId = DEFAULT_CHAIN_ID) -> None:
    """
    Constructs WaxOptions.

    Args:
        chain_id: chain id used for signing. Defaults to mainnet chain id.
    """
    self.chain_id = chain_id

create_hive_chain

create_hive_chain(options: WaxChainOptions | None = None) -> IHiveChainInterface

Factory function to provide hive chain interface functionality.

Source code in wax/wax_factory.py
20
21
22
23
24
25
26
27
28
29
def create_hive_chain(options: WaxChainOptions | None = None) -> IHiveChainInterface:
    """Factory function to provide hive chain interface functionality."""
    from wax._private.chain_api import HiveChainApi
    from wax.wax_options import WaxChainOptions

    options = options if options is not None else WaxChainOptions()
    chain_id = options.chain_id
    endpoint_url = options.endpoint_url

    return HiveChainApi(chain_id, endpoint_url, _private=True)

create_wax_foundation

create_wax_foundation(options: WaxOptions | None = None) -> IWaxBaseInterface

Factory function to provide wax base interface functionality.

Source code in wax/wax_factory.py
10
11
12
13
14
15
16
17
def create_wax_foundation(options: WaxOptions | None = None) -> IWaxBaseInterface:
    """Factory function to provide wax base interface functionality."""
    from wax._private.base_api import WaxBaseApi
    from wax.wax_options import WaxOptions

    chain_id = options.chain_id if options is not None else WaxOptions().chain_id

    return WaxBaseApi(chain_id, _private=True)

complex_operations

account_update

AuthorityRoleCategories module-attribute
AuthorityRoleCategories = (HiveAccountCategory,)

All of the role categories. Add new categories here.

AccountAuthorityUpdateOperation
AccountAuthorityUpdateOperation(possible_categories: PossibleCategoriesByCategoryName, possible_roles: PossibleRoles, *, _private: bool = False)

Bases: OperationBase

Account authority update operation.

Notes

To create an instance of this class, use the factory method create_for. Otherwise, assertion error will be raised.

Source code in wax/complex_operations/account_update.py
48
49
50
51
52
53
54
55
56
57
58
59
60
def __init__(
    self,
    possible_categories: PossibleCategoriesByCategoryName,
    possible_roles: PossibleRoles,
    *,
    _private: bool = False,
) -> None:
    assert (
        _private
    ), "AccountAuthorityUpdateOperation should be created only by AccountAuthorityUpdateOperation.create_for"
    super().__init__()
    self._possible_categories: PossibleCategoriesByCategoryName = possible_categories
    self._possible_roles: PossibleRoles = possible_roles
categories property

Get category to modify.

roles property

Get role to modify.

Typical usage example

account_update_operation.roles.active.any_action()

create_for async staticmethod

Factory method for creating AccountAuthorityUpdateOperation.

This is an online version - creates default provider instance and does call to api.

Parameters:

Name Type Description Default
wax_interface IHiveChainInterface

instance of interface.

required
account_name AccountName

account name of account to gain authority data from.

required

Returns:

Type Description
AccountAuthorityUpdateOperation

AccountAuthorityUpdateOperation instance.

Source code in wax/complex_operations/account_update.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@staticmethod
async def create_for(
    wax_interface: IHiveChainInterface,
    account_name: AccountName,
) -> AccountAuthorityUpdateOperation:
    """
    Factory method for creating AccountAuthorityUpdateOperation.

    This is an online version - creates default provider instance and does call to api.

    Args:
        wax_interface (IHiveChainInterface): instance of interface.
        account_name (AccountName): account name of account to gain authority data from.

    Returns:
        AccountAuthorityUpdateOperation instance.
    """
    provider = OnlineChainAuthorityDataProvider(wax_interface)
    return await AccountAuthorityUpdateOperation.create_for_with_provider(wax_interface, account_name, provider)
create_for_with_provider async staticmethod

Factory method for creating AccountAuthorityUpdateOperation.

This one support providing own authority data provider.

Parameters:

Name Type Description Default
wax_interface IWaxBaseInterface

instance of interface.

required
account_name AccountName

account name of account to gain authority data from.

required
provider IAuthorityDataProvider

authority provider.

required

Returns:

Type Description
AccountAuthorityUpdateOperation

AccountAuthorityUpdateOperation instance.

Source code in wax/complex_operations/account_update.py
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
@staticmethod
async def create_for_with_provider(
    wax_interface: IWaxBaseInterface, account_name: AccountName, provider: IAuthorityDataProvider
) -> AccountAuthorityUpdateOperation:
    """
    Factory method for creating AccountAuthorityUpdateOperation.

    This one support providing own authority data provider.

    Args:
        wax_interface (IWaxBaseInterface): instance of interface.
        account_name (AccountName): account name of account to gain authority data from.
        provider (IAuthorityDataProvider): authority provider.

    Returns:
        AccountAuthorityUpdateOperation instance.
    """
    role_per_role_name: dict[str, LevelBase[Any]] = {}
    category_per_category_name: dict[str, RoleCategoryBase[Any]] = {}

    for category in AuthorityRoleCategories:
        container = category()
        category_per_category_name[container.category] = container

    for category_instance in category_per_category_name.values():
        await category_instance.init(wax_interface, account_name, provider)

        for role_name, role_instance in category_instance.authorities.__dict__.items():
            role_per_role_name[role_name] = role_instance  # noqa: PERF403

    return AccountAuthorityUpdateOperation(
        PossibleCategoriesByCategoryName(**category_per_category_name),  # type: ignore[arg-type]
        PossibleRoles(**role_per_role_name),  # type: ignore[arg-type]
        _private=True,
    )
enforce_owner_role_authorisation
enforce_owner_role_authorisation() -> None

Enforces the requirement for owner role authorization when modifying active or posting roles.

HF 28 introduces stricter matching between the authority role required by a given operation and the role used to authorize the transaction. - Since modifying active or posting roles requires active authority at the time of transaction signing, the pre-HF28 behavior — which allowed signing with the owner key — will be disallowed. - This change may pose difficulties for users who have lost their active keys and attempt to use their owner key to set a new one. - To address this, the function allows the inclusion — within the account_update2_operation generated internally — of elements that enforce the owner role requirement, specifically through an ineffective change of the owner authority to the same value currently recorded on-chain.

Source code in wax/complex_operations/account_update.py
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
def enforce_owner_role_authorisation(self) -> None:
    """
    Enforces the requirement for **owner** role authorization when modifying **active** or **posting** roles.

    **HF 28** introduces stricter matching between the authority role required by a given operation and the role
    used to authorize the transaction.
        - Since modifying **active** or **posting** roles requires **active** authority at the time of transaction
          signing, the pre-HF28 behavior — which allowed signing with the **owner** key — will be **disallowed**.
        - This change may pose difficulties for users who have lost their active keys and attempt to use their
          owner key to set a new one.
        - To address this, the function allows the inclusion — within the `account_update2_operation` generated
          internally — of elements that enforce the **owner** role requirement, specifically through an ineffective
          change of the owner authority to the same value currently recorded on-chain.
    """
    self._possible_roles.owner.enforce_modifications()
finalize
finalize(api: IWaxBaseInterface) -> Iterable[ConvertedToProtoOperation]

Finalize updating account authority.

Parameters:

Name Type Description Default
api IWaxBaseInterface

Wax api subclass instance.

required

Returns:

Type Description
Iterable[ConvertedToProtoOperation]

Iterable[ConvertedToProtoOperation]: List of operations.

Raises:

Type Description
NoAuthorityOperationGeneratedError

If no operation was generated.

Source code in wax/complex_operations/account_update.py
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
def finalize(self, api: IWaxBaseInterface) -> Iterable[ConvertedToProtoOperation]:
    """
    Finalize updating account authority.

    Args:
        api (IWaxBaseInterface): Wax api subclass instance.

    Returns:
        Iterable[ConvertedToProtoOperation]: List of operations.

    Raises:
        NoAuthorityOperationGeneratedError: If no operation was generated.
    """
    operations: list[ConvertedToProtoOperation] = [
        operation for category in asdict(self.categories).values() for operation in category.finalize(api)
    ]

    if not operations:
        raise NoAuthorityOperationGeneratedError

    return operations
PossibleCategoriesByCategoryName dataclass
PossibleCategoriesByCategoryName(hive: HiveAccountCategory)

All of possible categories grouped by name. Add new categories also here.

PossibleRoles dataclass

Bases: HiveRoles

All of possible roles. Add new roles to as base classes.

data_providers

authority_data_provider
OnlineChainAuthorityDataProvider
OnlineChainAuthorityDataProvider(chain_api: IHiveChainInterface)

Bases: IAuthorityDataProvider

Online version of authority data provider which does call to api.

Parameters:

Name Type Description Default
chain_api IHiveChainInterface

the instance used to perform the api call.

required
Source code in wax/complex_operations/data_providers/authority_data_provider.py
14
15
16
17
18
19
20
21
def __init__(self, chain_api: IHiveChainInterface) -> None:
    """
    Online version of authority data provider which does call to api.

    Args:
        chain_api (IHiveChainInterface): the instance used to perform the api call.
    """
    self._chain_api = chain_api
get_hive_authority_data async
get_hive_authority_data(account: AccountName) -> WaxAccountAuthorityInfo

Get AuthorityAccount from account name.

Parameters:

Name Type Description Default
account(AccountName)

name of account that will be passed to api call.

required

Raises:

Type Description
AccountNotFoundError

When account with given name was not found.

Returns:

Type Description
WaxAccountAuthorityInfo

Object that holds authority data.

Source code in wax/complex_operations/data_providers/authority_data_provider.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
async def get_hive_authority_data(self, account: AccountName) -> WaxAccountAuthorityInfo:
    """
    Get AuthorityAccount from account name.

    Args:
        account(AccountName): name of account that will be passed to api call.

    Raises:
        AccountNotFoundError: When account with given name was not found.

    Returns:
        Object that holds authority data.
    """
    authorities = await self._chain_api.collect_account_authorities(account)
    assert not isinstance(authorities, list), f"Found multiple authorities for the {account} account."
    return authorities

recurrent_transfer

DefineRecurrentTransferOperation
DefineRecurrentTransferOperation(data: RecurrentTransferData)

Bases: RecurrentTransferOperationBase

Operation class for defining a recurrent transfer.

This class validates that the amount is greater than zero and provides a name identifier for the operation.

  • The amount must be strictly greater than zero. A ValueError is raised if amount is None or 0.
  • If a recurrent transfer between the same from and to accounts already exists:
    • If the recurrence value is unchanged, the next execution will follow the original schedule.
    • If the recurrence value is changed, the next execution will be scheduled for: update date + recurrence. In this case, no transfer will be executed on the update date itself.
  • Since HF28, users may define multiple recurrent transfers between the same accounts by using pair_id in the extensions.
  • A single account can define up to 255 recurrent transfers to other accounts.
  • The final execution date of the recurrent transfer must be no more than 730 days in the future.

Raises:

Type Description
ValueError

If the transfer amount is None or less than or equal to 0.

Source code in wax/complex_operations/recurrent_transfer.py
123
124
125
126
127
128
129
130
131
def __init__(self, data: RecurrentTransferData) -> None:
    amount = data.amount

    if amount is None:
        raise ValueError("Amount of the recurrent transfer must be provided.")

    if int(amount.amount) <= 0:
        raise ValueError("Amount of the recurrent transfer must be greater than 0.")
    super().__init__(data)
RecurrentTransferData dataclass
RecurrentTransferData(from_account: AccountName, to_account: AccountName, amount: NaiAsset | None = None, pair_id: int | None = None, executions: int = DEFAULT_EXECUTIONS, recurrence: int = DEFAULT_RECURRENCE, memo: str = '')

Data needed to define recurrent transfer operation.

Attributes:

Name Type Description
from_account AccountName

Account to transfer asset from.

to_account AccountName

Account to transfer asset to. Cannot set a transfer to yourself.

amount NaiAsset | None

The amount of asset to transfer. Allowed assets: HIVE and HBD. In case of removal - amount is not needed.

pair_id int | None

Since HF 28, if user has more than one recurrent transfer to the same receiver or creates the recurrent transfer using pair_id, they must specify it in order to update or remove the defined recurrent transfer.

executions int

How many times the recurrent payment will be executed. Executions must be at least 2; if set to 1, the transfer will not execute.

recurrence int

How often the payment is triggered, in hours. First transfer is immediate. Minimum value is 24 h.

memo str

Optional memo for the transfer. Must be shorter than 2048 characters.

RecurrentTransferOperationBase
RecurrentTransferOperationBase(data: RecurrentTransferData)

Bases: OperationBase

Base class for the recurrent transfer define and removal classes.

Source code in wax/complex_operations/recurrent_transfer.py
53
54
55
56
def __init__(self, data: RecurrentTransferData) -> None:
    super().__init__()
    self.data = data
    self.recurrent_transfer = self.get_recurrent_transfer_proto_operation() if data.amount is not None else None
get_recurrent_transfer_proto_operation
get_recurrent_transfer_proto_operation() -> recurrent_transfer

Creates recurrent_transfer operation.

Returns:

Type Description
recurrent_transfer

A recurrent transfer operation.

Source code in wax/complex_operations/recurrent_transfer.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
def get_recurrent_transfer_proto_operation(self) -> recurrent_transfer:
    """
    Creates recurrent_transfer operation.

    Returns:
        A recurrent transfer operation.
    """
    return recurrent_transfer(
        from_account=self.data.from_account,
        to_account=self.data.to_account,
        amount=self.data.amount,
        extensions=[self._get_default_extensions(self.data.pair_id)] if self.data.pair_id is not None else [],
        executions=self.data.executions,
        recurrence=self.data.recurrence,
        memo=self.data.memo,
    )
RecurrentTransferRemovalOperation
RecurrentTransferRemovalOperation(from_account: AccountName, to_account: AccountName, pair_id: int | None = None)

Bases: RecurrentTransferOperationBase

Operation class for removing a recurrent transfer.

Ensures that amount is set to zero if not provided or invalid.

  • If multiple recurrent transfers exist between the same from and to accounts, a pair_id must be specified in the extensions to identify the exact one to be removed.
  • When this operation is executed, it does not generate a fill_recurrent_transfer_operation virtual operation.
Source code in wax/complex_operations/recurrent_transfer.py
145
146
def __init__(self, from_account: AccountName, to_account: AccountName, pair_id: int | None = None) -> None:
    super().__init__(RecurrentTransferData(from_account, to_account, pair_id=pair_id))

role_classes

hive_authority
hive_account_category
HiveAccountCategory
HiveAccountCategory()

Bases: RoleCategoryBase[HiveRoles]

Class representing the hive account category. It contains all necessary authorities for the hive account.

Attributes:

Name Type Description
account AccountName

Account name.

authorities HiveRoles

Hive roles.

hive_max_authority_membership int

Maximum authority membership.

Notice

Trying to access the attributes before calling the init method will raise an assertion error.

Source code in wax/complex_operations/role_classes/hive_authority/hive_account_category.py
56
57
58
59
60
def __init__(self) -> None:
    super().__init__()
    self._account: AccountName | NotYetInitialized = NotYetInitialized()
    self._HIVE_MAX_AUTHORITY_MEMBERSHIP: int | NotYetInitialized = NotYetInitialized()
    self._authorities: HiveRoles | NotYetInitialized = NotYetInitialized()
init async
init(api: IWaxBaseInterface, account_name: AccountName, provider: IAuthorityDataProvider) -> None

Initializes the hive account category.

Function retrieves all necessary authorities from the chain and initializes them.

Raises:

Type Description
HiveTempAccountUsedError

When trying to edit a temporary account.

AccountNotFoundError

When the account is not found on the chain.

AssertionError

When the chain config is not reachable.

Source code in wax/complex_operations/role_classes/hive_authority/hive_account_category.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
async def init(
    self,
    api: IWaxBaseInterface,
    account_name: AccountName,
    provider: IAuthorityDataProvider,
) -> None:
    """
    Initializes the hive account category.

    Function retrieves all necessary authorities from the chain and initializes them.

    Raises:
        HiveTempAccountUsedError: When trying to edit a temporary account.
        AccountNotFoundError: When the account is not found on the chain.
        AssertionError: When the chain config is not reachable.
    """

    def raise_cannot_update_owner_error() -> None:
        raise WaxError("Owner authority cannot be updated due to owner authority update limit - twice an hour")

    def check_owner_time_diff(time: datetime) -> bool:
        return datetime.now(tz=timezone.utc) - time > timedelta(
            seconds=int(self._ensure_chain_config_reachable(api.config.get("HIVE_OWNER_UPDATE_LIMIT"))) / 1_000_000
        )

    authority_data = await provider.get_hive_authority_data(account_name)
    self._account = authority_data.account

    if api.config.get("HIVE_TEMP_ACCOUNT") == authority_data.account:
        raise HiveTempAccountUsedError

    self._HIVE_MAX_AUTHORITY_MEMBERSHIP = int(
        self._ensure_chain_config_reachable(api.config.get("HIVE_MAX_AUTHORITY_MEMBERSHIP"))
    )

    max_account_name_length = int(
        self._ensure_chain_config_reachable(api.config.get("HIVE_MAX_ACCOUNT_NAME_LENGTH"))
    )

    address_prefix = self._ensure_chain_config_reachable(api.config.get("HIVE_ADDRESS_PREFIX"))

    active, posting, owner, memo_key = (
        authority_data.authorities.active,
        authority_data.authorities.posting,
        authority_data.authorities.owner,
        authority_data.memo_key,
    )

    self._authorities = HiveRoles(
        active=HiveRoleAuthorityDefinition("active"),
        owner=HiveRoleAuthorityDefinition(
            "owner",
            lambda role: raise_cannot_update_owner_error()  # noqa: ARG005
            if not check_owner_time_diff(authority_data.last_owner_update)
            and check_owner_time_diff(authority_data.previous_owner_update)
            else None,
        ),
        posting=HiveRoleAuthorityDefinition("posting"),
        memo=HiveRoleMemoKeyDefinition(),
    )

    self._authorities.active.init(
        max_account_name_length,
        address_prefix,
        active,
    )

    self._authorities.owner.init(
        max_account_name_length,
        address_prefix,
        owner,
    )

    self._authorities.posting.init(
        max_account_name_length,
        address_prefix,
        posting,
    )

    self._authorities.memo.init(
        address_prefix,
        memo_key,
    )
hive_role_authority_definition
HiveRoleAuthorityDefinition
HiveRoleAuthorityDefinition(level: TRole, ensure_can_update: Callable[[TRole], None] = lambda level: None)

Bases: LevelBase[TRole]

Hive role authority definition.

Attributes:

Name Type Description
hive_max_account_length int

Maximum account name length.

hive_address_prefix str

Hive address prefix.

authority WaxAuthority

Current authority.

previous_authority WaxAuthority

Previous authority.

Notice

All above attributes are initialized after calling the init method. If you try to access them before calling the init method, an assertion will be raised.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_authority_definition.py
35
36
37
38
39
40
41
42
43
44
45
46
47
def __init__(
    self,
    level: TRole,
    ensure_can_update: Callable[[TRole], None] = lambda level: None,  # noqa: ARG005
) -> None:
    super().__init__(level)
    self.ensure_can_update = ensure_can_update

    self._HIVE_MAX_ACCOUNT_NAME_LENGTH: int | NotYetInitialized = NotYetInitialized()
    self._HIVE_ADDRESS_PREFIX: str | NotYetInitialized = NotYetInitialized()
    self._authority: WaxAuthority | NotYetInitialized = NotYetInitialized()
    self._previous_authority: WaxAuthority | NotYetInitialized = NotYetInitialized()
    self._enforced_modifications: bool = False
changed property
changed: bool

Checks if the authority has changed since the last update.

is_null_authority property
is_null_authority: bool

Checks if the currently selected role is null - everyone can access your account. No account, key is added.

Returns:

Name Type Description
bool bool

True if the currently selected role is null.

add
add(account_or_key: PublicKey | AccountName, weight: int = DEFAULT_ACCOUNT_OR_KEY_WEIGHT) -> Self

Adds an account or key to the currently selected role with specified weight.

Notes

If the account or key already exists, its weight is updated.

Parameters:

Name Type Description Default
account_or_key PublicKey | AccountName

Account or key to be added to the currently selected role.

required
weight int

Account or key weight in the authority. Default is 1.

DEFAULT_ACCOUNT_OR_KEY_WEIGHT

Returns:

Name Type Description
Self Self

itself.

Raises:

Type Description
InvalidAccountOrKeyError

If the account or key is invalid.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_authority_definition.py
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
def add(self, account_or_key: PublicKey | AccountName, weight: int = DEFAULT_ACCOUNT_OR_KEY_WEIGHT) -> Self:
    """
    Adds an account or key to the currently selected role with specified weight.

    Notes:
        If the account or key already exists, its weight is updated.

    Args:
        account_or_key: Account or key to be added to the currently selected role.
        weight: Account or key weight in the authority. Default is 1.

    Returns:
        Self: itself.

    Raises:
        InvalidAccountOrKeyError: If the account or key is invalid.
    """
    self.ensure_can_update(self.level)
    self._add_to_role(account_or_key, weight)
    return self
clear
clear() -> Self

Clears the currently selected role.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_authority_definition.py
234
235
236
237
238
239
240
241
242
def clear(self) -> Self:
    """Clears the currently selected role."""
    self.ensure_can_update(self.level)

    self.authority.key_auths.clear()
    self.authority.account_auths.clear()
    self.authority.weight_threshold = DEFAULT_ACCOUNT_OR_KEY_WEIGHT

    return self
has
has(account_or_key: PublicKey | AccountName, weight: int | None = None) -> bool

Checks if the account or key is present in the currently selected role.

Parameters:

Name Type Description Default
account_or_key PublicKey | AccountName

Account or key to be checked.

required
weight int | None

Account or key weight in the authority. If provided - is checked as well.

None

Returns:

Name Type Description
bool bool

True if the account or key is present in the currently selected role.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_authority_definition.py
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
def has(self, account_or_key: PublicKey | AccountName, weight: int | None = None) -> bool:
    """
    Checks if the account or key is present in the currently selected role.

    Args:
        account_or_key: Account or key to be checked.
        weight: Account or key weight in the authority. If provided - is checked as well.

    Returns:
        bool: True if the account or key is present in the currently selected role.
    """
    as_tuple = self._get_tuple(account_or_key)

    if weight and as_tuple:
        return as_tuple[1] == weight
    return bool(as_tuple)
remove

Remove given account or key from the currently selected role.

Parameters:

Name Type Description Default
account_or_key PublicKey | AccountName

Account or key to be removed from the currently selected role.

required

Returns:

Name Type Description
Self Self

itself.

Raises:

Type Description
InvalidAccountOrKeyError

If the account or key is invalid.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_authority_definition.py
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
def remove(self, account_or_key: PublicKey | AccountName) -> Self:
    """
    Remove given account or key from the currently selected role.

    Args:
        account_or_key: Account or key to be removed from the currently selected role.

    Returns:
        Self: itself.

    Raises:
        InvalidAccountOrKeyError: If the account or key is invalid.
    """
    self.ensure_can_update(self.level)
    self._remove_from_role(account_or_key)
    return self
replace

Replaces an account or key in the currently selected role or changes the weight of the existing account or key.

Parameters:

Name Type Description Default
account_or_key PublicKey | AccountName

Account or key to be replaced.

required
weight int

Account or key weight.

required
new_account_or_key PublicKey | AccountName | None

New account or key to replace the old one. If not provided, the account or key is not replaced, but weight is changed.

None

Returns:

Name Type Description
Self Self

itself.

Raises:

Type Description
InvalidAccountOrKeyError

If the account or key is invalid.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_authority_definition.py
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
def replace(
    self,
    account_or_key: PublicKey | AccountName,
    weight: int,
    new_account_or_key: PublicKey | AccountName | None = None,
) -> Self:
    """
    Replaces an account or key in the currently selected role or changes the weight of the existing account or key.

    Args:
        account_or_key: Account or key to be replaced.
        weight: Account or key weight.
        new_account_or_key: New account or key to replace the old one. If not provided,
                            the account or key is not replaced, but weight is changed.

    Returns:
        Self: itself.

    Raises:
        InvalidAccountOrKeyError: If the account or key is invalid.
    """
    self.ensure_can_update(self.level)

    if new_account_or_key is None:
        new_account_or_key = account_or_key

    if account_or_key != new_account_or_key:
        self._ensure_valid_account_or_key(new_account_or_key)
        self._remove_from_role(account_or_key)

    self._add_to_role(new_account_or_key, weight)
    return self
set_threshold
set_threshold(threshold: int = DEFAULT_ACCOUNT_OR_KEY_WEIGHT) -> Self

Set the weight threshold for the currently selected role.

Parameters:

Name Type Description Default
threshold int

Weight threshold for the currently selected role.

DEFAULT_ACCOUNT_OR_KEY_WEIGHT

Returns:

Name Type Description
Self Self

itself.

Raises:

Type Description
AssertionError

If the role is not initialized.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_authority_definition.py
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
def set_threshold(self, threshold: int = DEFAULT_ACCOUNT_OR_KEY_WEIGHT) -> Self:
    """
    Set the weight threshold for the currently selected role.

    Args:
        threshold: Weight threshold for the currently selected role.

    Returns:
        Self: itself.

    Raises:
        AssertionError: If the role is not initialized.

    """
    self.ensure_can_update(self.level)
    self.authority.weight_threshold = threshold
    return self
hive_role_memo_key
MemoKeyRoleName module-attribute
MemoKeyRoleName = Literal['memo']

Memo key role name.

HiveRoleMemoKeyDefinition
HiveRoleMemoKeyDefinition()

Bases: LevelBase[MemoKeyRoleName]

Hive role memo key definition.

Attributes:

Name Type Description
hive_address_prefix str

Hive address prefix.

public_key PublicKey

Current public key.

previous_public_key PublicKey

Previous public key.

Notice

All above attributes are initialized after calling the init method. If you try to access them before calling the init method, an assertion will be raised.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_memo_key.py
35
36
37
38
39
40
41
def __init__(self) -> None:
    super().__init__("memo")
    self._HIVE_ADDRESS_PREFIX: str | NotYetInitialized = NotYetInitialized()

    self._public_key: PublicKey | NotYetInitialized = NotYetInitialized()
    self._previous_public_key: PublicKey | NotYetInitialized = NotYetInitialized()
    self._enforced_modifications = False
changed property
changed: bool

Checks if the key has changed since the last update.

is_set property
is_set: bool

Check if the memo key is set to the default value - null public key.

set
set(public_key: PublicKey) -> Self

Sets the provided public key as the account memo key.

Parameters:

Name Type Description Default
public_key PublicKey

Public key to set.

required

Returns:

Name Type Description
Self Self

Role instance.

Raises:

Type Description
InvalidMemoKeyError

If the provided public key is invalid.

Source code in wax/complex_operations/role_classes/hive_authority/hive_role_memo_key.py
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
def set(self, public_key: PublicKey) -> Self:
    """
    Sets the provided public key as the account memo key.

    Args:
        public_key (PublicKey): Public key to set.

    Returns:
        Self: Role instance.

    Raises:
        InvalidMemoKeyError: If the provided public key is invalid.
    """
    if not self._is_public_key_valid(public_key):
        raise InvalidMemoKeyError(public_key)

    self._public_key = public_key
    return self
hive_roles
ActiveRoleName module-attribute
ActiveRoleName = Literal['active']

Active role name.

OwnerRoleName module-attribute
OwnerRoleName = Literal['owner']

Owner role name.

PostingRoleName module-attribute
PostingRoleName = Literal['posting']

Posting role name.

HiveRoles dataclass

Currently available roles in the hive account category.

level_base
TRole module-attribute
TRole = TypeVar('TRole', bound=Literal['memo', 'active', 'owner', 'posting'])

Type variable for role names.

LevelBase
LevelBase(level: TRole)

Bases: ABC, Generic[TRole]

All role levels should inherit from this class.

Please remember to include role/level name in the TRole type-var

Source code in wax/complex_operations/role_classes/level_base.py
17
18
def __init__(self, level: TRole) -> None:
    self._level = level
changed abstractmethod property
changed: bool

Indicates if the level has changed since the last update.

level property
level: TRole

Role level name. Should be unique.

value abstractmethod property
value: Any

Returns the value of the level.

enforce_modifications abstractmethod
enforce_modifications() -> None

Enforces that the modifications are applied during the next operation generation.

Source code in wax/complex_operations/role_classes/level_base.py
30
31
32
@abstractmethod
def enforce_modifications(self) -> None:
    """Enforces that the modifications are applied during the next operation generation."""
reset abstractmethod
reset() -> None

Resets the level to the initial state.

Source code in wax/complex_operations/role_classes/level_base.py
39
40
41
@abstractmethod
def reset(self) -> None:
    """Resets the level to the initial state."""
role_category_base
AuthType module-attribute
AuthType = TypeVar('AuthType')

Type variable for the authority type.

RoleCategoryBase

Bases: ABC, Generic[AuthType]

Base class for all role categories. Please inherit from this class when yoy create a new category.

authorities abstractmethod property
authorities: AuthType

Returns object that is filled by the init function.

category abstractmethod property
category: str

Category name. Should be unique.

changed abstractmethod property
changed: bool

Indicates if any of the authority levels has changed since the last update.

finalize abstractmethod
finalize(api: IWaxBaseInterface) -> Iterable[ConvertedToProtoOperation]

Function should return iterable object of operations that will modify the user accounts roles.

Parameters:

Name Type Description Default
api IWaxBaseInterface

Instance of the wax base api subclass.

required
Source code in wax/complex_operations/role_classes/role_category_base.py
50
51
52
53
54
55
56
57
@abstractmethod
def finalize(self, api: IWaxBaseInterface) -> Iterable[ConvertedToProtoOperation]:
    """
    Function should return iterable object of operations that will modify the user accounts roles.

    Args:
        api (IWaxBaseInterface): Instance of the wax base api subclass.
    """
init abstractmethod async

Responsible for gathering authority types for the given account.

Parameters:

Name Type Description Default
api IWaxBaseInterface | IWaxBaseInterface

instance of the wax base api subclass.

required
account_name AccountName

name of the account that will be used to gather authority data.

required
provider IAuthorityDataProvider

object that delivers authority data.

required
Source code in wax/complex_operations/role_classes/role_category_base.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@abstractmethod
async def init(
    self,
    api: IWaxBaseInterface,
    account_name: AccountName,
    provider: IAuthorityDataProvider,
) -> None:
    """
    Responsible for gathering authority types for the given account.

    Args:
        api (IWaxBaseInterface | IWaxBaseInterface): instance of the wax base api subclass.
        account_name (AccountName): name of the account that will be used to gather authority data.
        provider (IAuthorityDataProvider): object that delivers authority data.
    """

update_proposal_operation

UpdateProposalOperation
UpdateProposalOperation(data: UpdateProposalOperationData)

Bases: OperationBase

Source code in wax/complex_operations/update_proposal_operation.py
45
46
47
48
49
def __init__(self, data: UpdateProposalOperationData) -> None:
    super().__init__()
    self.data = data
    self._extensions: list[update_proposal_extension] = []
    self._add_end_date()
UpdateProposalOperationData dataclass
UpdateProposalOperationData(proposal_id: int | str, creator: AccountName, daily_pay: NaiAsset, subject: str, permlink: str, end_date: str | datetime | None = None)

Data class used to store update proposal operation related data.

Attributes:

Name Type Description
proposal_id int | str

The ID of the proposal to be updated.

creator AccountName

The account name of the proposal creator.

daily_pay NaiAsset

NaiAsset representing the daily pay for the proposal (only HBD allowed).

subject str

The subject of the proposal.

permlink str

The permlink associated with the proposal.

end_date str | datetime | None

Optional end date for the proposal as a timestamp or datetime.

witness_set_properties

WitnessSetProperties
WitnessSetProperties(data: WitnessSetPropertiesData)

Bases: OperationBase

Operation to update the properties of a witness.

Wrapper around the witness_set_properties operation to simplify its usage by properly serializing witness props.

Source code in wax/complex_operations/witness_set_properties.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(self, data: WitnessSetPropertiesData) -> None:
    super().__init__()
    self.owner = data.owner
    self.account_creation_fee = data.account_creation_fee
    self.hbd_exchange_rate = data.hbd_exchange_rate
    self.props = python_witness_set_properties_data(
        to_cpp_string(data.witness_signing_key),
        to_cpp_string(data.new_signing_key) if data.new_signing_key else None,
        None,  # account_creation_fee -> set in finalize
        to_cpp_string(data.url) if data.url else None,
        None,  # hbd_exchange_rate -> set in finalize
        data.maximum_block_size,
        data.hbd_interest_rate,
        data.account_subsidy_budget,
        data.account_subsidy_decay,
    )

cpp_python_bridge

__file__ module

__file__ = '/builds/hive/wax/python/wax/cpp_python_bridge.cpython-312-x86_64-linux-gnu.so'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__name__ module

__name__ = 'wax.cpp_python_bridge'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__package__ module

__package__ = 'wax'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__test__ module

__test__ = {}

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

WaxAssertionError

WaxAssertionError(assertion_hash: str, assertion_data: str)

Bases: WaxError

Raises when an assertion occurred while calling C++ code.

Source code in wax/exceptions/wax_error.py
20
21
22
23
def __init__(self, assertion_hash: str, assertion_data: str) -> None:
    self.assertion_hash = assertion_hash
    self.assertion_data = assertion_data
    super().__init__(self.assertion_data)

WaxError

Bases: Exception

Base exception for all wax operations.

exceptions

AccountNotFoundError

AccountNotFoundError(*accounts: AccountName)

Bases: WaxError

Raised when an account(s) not found when calling find_accounts API call.

Source code in wax/exceptions/chain_errors.py
14
15
16
17
def __init__(self, *accounts: AccountName) -> None:
    self.accounts = accounts
    self.message = f"Account '{accounts}' not found."
    super().__init__(self.message)

AssetError

Bases: WaxError

Base error for the asset-related exceptions.

For more detailed exceptions, see the subclasses.

AuthorityCannotBeSatisfiedError

AuthorityCannotBeSatisfiedError(authority_level: str)

Bases: HiveAccountCategoryError

Raised when the authority cannot be satisfied.

Source code in wax/exceptions/chain_errors.py
45
46
47
48
def __init__(self, authority_level: str) -> None:
    self.message = f"{authority_level} authority cannot be satisfied due to insufficient weight"
    self.authority_level = authority_level
    super().__init__(self.message)

DecimalConversionError

Bases: WaxError

Base exception for all decimal conversion errors.

DecimalConversionNegativePrecisionError

DecimalConversionNegativePrecisionError(precision: int)

Bases: DecimalConversionError

Raised when decimal conversion fails because the precision is negative.

Source code in wax/exceptions/conversion_errors.py
17
18
19
20
def __init__(self, precision: int) -> None:
    self.precision = precision
    self.message = f"Precision must be a positive integer. Given: {precision}"
    super().__init__(self.message)

DecimalConversionNotANumberError

Bases: DecimalConversionError

Raised when decimal conversion fails because the value is not a number.

HiveAccountCategoryError

Bases: WaxError

Base class for HiveAccountCategory errors.

HiveMaxAuthorityMembershipExceededError

HiveMaxAuthorityMembershipExceededError(max_membership: int, current_membership: int)

Bases: HiveAccountCategoryError

Raised when the authority membership exceeds the maximum.

Source code in wax/exceptions/chain_errors.py
35
36
37
38
39
def __init__(self, max_membership: int, current_membership: int) -> None:
    self.message = f"Authority membership exceeds. Max: {max_membership}, current: {current_membership}"
    self.max_membership = max_membership
    self.current_membership = current_membership
    super().__init__(self.message)

HiveTempAccountUsedError

HiveTempAccountUsedError()

Bases: HiveAccountCategoryError

Raised when trying to edit a temporary account in the hive category.

Source code in wax/exceptions/chain_errors.py
27
28
29
def __init__(self) -> None:
    self.message = "Cannot edit temporary account in hive category"
    super().__init__(self.message)

InvalidAccountNameError

InvalidAccountNameError(account: AccountName)

Bases: WaxError

Raised when an account name is invalid.

Note that this error is different from AccountNotFoundError and is created to not make an API call when the account name is invalid.

Source code in wax/exceptions/validation_errors.py
29
30
31
32
def __init__(self, account: AccountName) -> None:
    self.account = account
    self.message = f"Account name '{account}' is invalid."
    super().__init__(self.message)

InvalidAccountOrKeyError

InvalidAccountOrKeyError(account_or_key: str)

Bases: WaxError

Raised when account or key is invalid.

Source code in wax/exceptions/validation_errors.py
51
52
53
54
def __init__(self, account_or_key: str) -> None:
    self.account_or_key = account_or_key
    self.message = f"Account or key '{account_or_key}' is invalid."
    super().__init__(self.message)

InvalidMemoKeyError

InvalidMemoKeyError(memo_key: PublicKey)

Bases: WaxError

Raised when an invalid memo key is provided.

Source code in wax/exceptions/validation_errors.py
60
61
62
63
def __init__(self, memo_key: PublicKey) -> None:
    self.memo_key = memo_key
    self.message = f"Invalid memo key: {memo_key} provided."
    super().__init__(self.message)

InvalidOperationFormatError

Bases: WaxError

Raised when operation is in invalid format.

MissingAuthorityError

MissingAuthorityError()

Bases: HiveAccountCategoryError

Raised when there is a missing authority.

Source code in wax/exceptions/chain_errors.py
58
59
60
def __init__(self) -> None:
    self.message = "Missing authority"
    super().__init__(self.message)

ToLongFollowingListError

ToLongFollowingListError(max_length: int)

Bases: WaxError

Raised when the following list exceeds the maximum allowed length.

Source code in wax/exceptions/validation_errors.py
77
78
79
80
def __init__(self, max_length: int) -> None:
    self.max_length = max_length
    self.message = f"Too long following list. Accepted max length: {max_length}."
    super().__init__(self.message)

WaxAssertionError

WaxAssertionError(assertion_hash: str, assertion_data: str)

Bases: WaxError

Raises when an assertion occurred while calling C++ code.

Source code in wax/exceptions/wax_error.py
20
21
22
23
def __init__(self, assertion_hash: str, assertion_data: str) -> None:
    self.assertion_hash = assertion_hash
    self.assertion_data = assertion_data
    super().__init__(self.assertion_data)

WaxError

Bases: Exception

Base exception for all wax operations.

WaxImportProtoBeforeCompileError

WaxImportProtoBeforeCompileError()

Bases: WaxError

Raised when trying to import a proto module before compiling it.

Source code in wax/exceptions/wax_error.py
11
12
13
14
def __init__(self) -> None:
    super().__init__(
        "You must compile the proto files before importing them.Using `build_wax..sh` script is recommended."
    )

WaxValidationFailedError

WaxValidationFailedError(reason: str)

Bases: WaxError

Raises when validation using wax failed.

Source code in wax/exceptions/validation_errors.py
15
16
17
18
def __init__(self, reason: str) -> None:
    self.reason = reason
    self.message = f"Validation using wax failed due to: {reason}"
    super().__init__(self.message)

asset_errors

AssetError

Bases: WaxError

Base error for the asset-related exceptions.

For more detailed exceptions, see the subclasses.

chain_errors

AccountNotFoundError
AccountNotFoundError(*accounts: AccountName)

Bases: WaxError

Raised when an account(s) not found when calling find_accounts API call.

Source code in wax/exceptions/chain_errors.py
14
15
16
17
def __init__(self, *accounts: AccountName) -> None:
    self.accounts = accounts
    self.message = f"Account '{accounts}' not found."
    super().__init__(self.message)
AuthorityCannotBeSatisfiedError
AuthorityCannotBeSatisfiedError(authority_level: str)

Bases: HiveAccountCategoryError

Raised when the authority cannot be satisfied.

Source code in wax/exceptions/chain_errors.py
45
46
47
48
def __init__(self, authority_level: str) -> None:
    self.message = f"{authority_level} authority cannot be satisfied due to insufficient weight"
    self.authority_level = authority_level
    super().__init__(self.message)
HiveAccountCategoryError

Bases: WaxError

Base class for HiveAccountCategory errors.

HiveMaxAuthorityMembershipExceededError
HiveMaxAuthorityMembershipExceededError(max_membership: int, current_membership: int)

Bases: HiveAccountCategoryError

Raised when the authority membership exceeds the maximum.

Source code in wax/exceptions/chain_errors.py
35
36
37
38
39
def __init__(self, max_membership: int, current_membership: int) -> None:
    self.message = f"Authority membership exceeds. Max: {max_membership}, current: {current_membership}"
    self.max_membership = max_membership
    self.current_membership = current_membership
    super().__init__(self.message)
HiveTempAccountUsedError
HiveTempAccountUsedError()

Bases: HiveAccountCategoryError

Raised when trying to edit a temporary account in the hive category.

Source code in wax/exceptions/chain_errors.py
27
28
29
def __init__(self) -> None:
    self.message = "Cannot edit temporary account in hive category"
    super().__init__(self.message)
MissingAuthorityError
MissingAuthorityError()

Bases: HiveAccountCategoryError

Raised when there is a missing authority.

Source code in wax/exceptions/chain_errors.py
58
59
60
def __init__(self) -> None:
    self.message = "Missing authority"
    super().__init__(self.message)
PrivateKeyDetectedInMemoError

Bases: WaxError

Raised when private key was detected in the memo field.

conversion_errors

DecimalConversionError

Bases: WaxError

Base exception for all decimal conversion errors.

DecimalConversionNegativePrecisionError
DecimalConversionNegativePrecisionError(precision: int)

Bases: DecimalConversionError

Raised when decimal conversion fails because the precision is negative.

Source code in wax/exceptions/conversion_errors.py
17
18
19
20
def __init__(self, precision: int) -> None:
    self.precision = precision
    self.message = f"Precision must be a positive integer. Given: {precision}"
    super().__init__(self.message)
DecimalConversionNotANumberError

Bases: DecimalConversionError

Raised when decimal conversion fails because the value is not a number.

validation_errors

InvalidAccountNameError
InvalidAccountNameError(account: AccountName)

Bases: WaxError

Raised when an account name is invalid.

Note that this error is different from AccountNotFoundError and is created to not make an API call when the account name is invalid.

Source code in wax/exceptions/validation_errors.py
29
30
31
32
def __init__(self, account: AccountName) -> None:
    self.account = account
    self.message = f"Account name '{account}' is invalid."
    super().__init__(self.message)
InvalidAccountOrKeyError
InvalidAccountOrKeyError(account_or_key: str)

Bases: WaxError

Raised when account or key is invalid.

Source code in wax/exceptions/validation_errors.py
51
52
53
54
def __init__(self, account_or_key: str) -> None:
    self.account_or_key = account_or_key
    self.message = f"Account or key '{account_or_key}' is invalid."
    super().__init__(self.message)
InvalidEndpointUrlFormatError
InvalidEndpointUrlFormatError(url: HttpUrl | str)

Bases: WaxError

Raised when endpoint url is in invalid format.

Source code in wax/exceptions/validation_errors.py
42
43
44
45
def __init__(self, url: HttpUrl | str) -> None:
    self.url = url
    self.message = f"Endpoint url '{url}' is in invalid format."
    super().__init__(self.message)
InvalidMemoKeyError
InvalidMemoKeyError(memo_key: PublicKey)

Bases: WaxError

Raised when an invalid memo key is provided.

Source code in wax/exceptions/validation_errors.py
60
61
62
63
def __init__(self, memo_key: PublicKey) -> None:
    self.memo_key = memo_key
    self.message = f"Invalid memo key: {memo_key} provided."
    super().__init__(self.message)
InvalidOperationFormatError

Bases: WaxError

Raised when operation is in invalid format.

NoAuthorityOperationGeneratedError
NoAuthorityOperationGeneratedError()

Bases: WaxError

Raised when no operations are generated.

Source code in wax/exceptions/validation_errors.py
69
70
71
def __init__(self) -> None:
    self.message = "No operations updating account authority generated."
    super().__init__(self.message)
ToLongFollowingListError
ToLongFollowingListError(max_length: int)

Bases: WaxError

Raised when the following list exceeds the maximum allowed length.

Source code in wax/exceptions/validation_errors.py
77
78
79
80
def __init__(self, max_length: int) -> None:
    self.max_length = max_length
    self.message = f"Too long following list. Accepted max length: {max_length}."
    super().__init__(self.message)
WaxValidationFailedError
WaxValidationFailedError(reason: str)

Bases: WaxError

Raises when validation using wax failed.

Source code in wax/exceptions/validation_errors.py
15
16
17
18
def __init__(self, reason: str) -> None:
    self.reason = reason
    self.message = f"Validation using wax failed due to: {reason}"
    super().__init__(self.message)

wax_error

WaxAssertionError
WaxAssertionError(assertion_hash: str, assertion_data: str)

Bases: WaxError

Raises when an assertion occurred while calling C++ code.

Source code in wax/exceptions/wax_error.py
20
21
22
23
def __init__(self, assertion_hash: str, assertion_data: str) -> None:
    self.assertion_hash = assertion_hash
    self.assertion_data = assertion_data
    super().__init__(self.assertion_data)
WaxError

Bases: Exception

Base exception for all wax operations.

WaxImportProtoBeforeCompileError
WaxImportProtoBeforeCompileError()

Bases: WaxError

Raised when trying to import a proto module before compiling it.

Source code in wax/exceptions/wax_error.py
11
12
13
14
def __init__(self) -> None:
    super().__init__(
        "You must compile the proto files before importing them.Using `build_wax..sh` script is recommended."
    )

helpy

OffsetTimeControl dataclass

OffsetTimeControl(speed_up_rate: float | int | None = None, offset: str = '+0')

Bases: TimeControl

Represents a control mechanism for time-related parameters.

Parameters:

Name Type Description Default
offset
str

The offset value specifying a relative time. Format: '[+-]N[mhdy\s]', where 'N' is any positive floating-point number. The letter at the end denotes the unit of time (y: year d: day, h: hour, m: minute). Default without any letter means second. (e.g. "+10h")

'+0'
speed_up_rate
float

An speed-up rate Format: positive floating-point number. (e.g. "10.0")

None

Raises:

Type Description
ValueError

Methods:

Name Description
as_string

Returns a string representation of the time control parameters.

SpeedUpRateTimeControl dataclass

SpeedUpRateTimeControl(speed_up_rate: float | int | None = None)

Bases: TimeControl

Represents a control mechanism for time-related parameters.

Parameters:

Name Type Description Default
speed_up_rate
float | int | None

An speed-up rate Format: positive floating-point number. (e.g. "10.0")

None

Raises:

Type Description
ValueError

if speed_up_rate has an incorrect format.

Methods:

Name Description
as_string

Returns a string representation of the time control parameters.

StartTimeControl dataclass

StartTimeControl(speed_up_rate: float | int | None = None, start_time: Literal['head_block_time'] | datetime = now())

Bases: TimeControl

Represents a control mechanism for time-related parameters.

Parameters:

Name Type Description Default
start_time
Literal['head_block_time'] | datetime

The starting time specifying an absolute time. Format: "@%Y-%m-%d %H:%M:%S" or "@%Y-%m-%d %H:%M:%S.%f" (e.g. "@1970-01-01 00:00:00")

now()
speed_up_rate
float | int | None

An speed-up rate Format: positive floating-point number. (e.g. "10.0")

None

Raises:

Type Description
ValueError

if start_time has an incorrect format, if speed_up_rate has an incorrect format.

Methods:

Name Description
as_string

Returns a string representation of the time control parameters.

Time

async_wait_for async classmethod
async_wait_for(predicate: Callable[[], bool] | Callable[[], Awaitable[bool]], *, timeout: float | timedelta = inf, timeout_error_message: str | None = None, poll_time: float = 1.0) -> float

Waits asynchronously for the predicate to return True.

Parameters:

Name Type Description Default
predicate
Callable[[], bool] | Callable[[], Awaitable[bool]]

Callable that returns boolean value.

required
timeout
float | timedelta

Timeout in seconds or preferably timedelta.

inf
timeout_error_message
str | None

Message that will be displayed if timeout is reached.

None
poll_time
float

Time between predicate calls.

1.0

Raises:

Type Description
TimeoutError

if given timeout exceeds

Returns:

Type Description
float

Time it took to wait for predicate return True.

Source code in wax/helpy/_interfaces/time.py
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
@classmethod
async def async_wait_for(
    cls,
    predicate: Callable[[], bool] | Callable[[], Awaitable[bool]],
    *,
    timeout: float | timedelta = math.inf,
    timeout_error_message: str | None = None,
    poll_time: float = 1.0,
) -> float:
    """
    Waits asynchronously for the predicate to return True.

    Args:
        predicate: Callable that returns boolean value.
        timeout: Timeout in seconds or preferably timedelta.
        timeout_error_message: Message that will be displayed if timeout is reached.
        poll_time: Time between predicate calls.

    Raises:
        TimeoutError: if given timeout exceeds

    Returns:
        Time it took to wait for predicate return True.
    """
    timeout_secs = cls.__calculate_timeout_secs_and_validate_it(timeout=timeout)
    already_waited = 0.0

    async def __run_asynchronously_predicate() -> bool:
        result = predicate()
        if isinstance(result, bool):
            return result
        return await result

    while not await __run_asynchronously_predicate():
        cls.__check_is_timeout_exceeded(
            timeout_secs=timeout_secs, already_waited=already_waited, timeout_error_message=timeout_error_message
        )

        sleep_time = min(poll_time, timeout_secs)
        await asyncio.sleep(sleep_time)
        already_waited += sleep_time

    return already_waited
from_now classmethod
from_now(*, milliseconds: int = 0, seconds: int = 0, minutes: int = 0, hours: int = 0, days: int = 0, weeks: int = 0, months: int = 0, years: int = 0, time_zone: timezone | None = utc, serialize: bool = True, serialize_format: TimeFormats | str = DEFAULT_FORMAT) -> str | datetime

Adds to current time given time periods.

Parameters:

Name Type Description Default
milliseconds
int

milliseconds to add.

0
seconds
int

seconds to add.

0
minutes
int

minutes to add.

0
hours
int

hours to add.

0
days
int

days to add.

0
weeks
int

weeks to add.

0
months
int

months to add.

0
years
int

years to add.

0
time_zone
timezone | None

time zone to set.

utc
serialize
bool

return serialized time or as datetime.

True
serialize_format
TimeFormats | str

if serialize, this determines format.

DEFAULT_FORMAT

Raises:

Type Description
ValueError

no periods has been given

Returns:

Type Description
str | datetime

serialized or as datetime, shifted time with given time periods.

Source code in wax/helpy/_interfaces/time.py
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
@classmethod
def from_now(  # noqa: PLR0913 # it is mirroring timedelta interface
    cls,
    *,
    milliseconds: int = 0,
    seconds: int = 0,
    minutes: int = 0,
    hours: int = 0,
    days: int = 0,
    weeks: int = 0,
    months: int = 0,
    years: int = 0,
    time_zone: timezone | None = timezone.utc,
    serialize: bool = True,
    serialize_format: TimeFormats | str = TimeFormats.DEFAULT_FORMAT,
) -> str | datetime:
    """
    Adds to current time given time periods.

    Args:
        milliseconds: milliseconds to add.
        seconds: seconds to add.
        minutes: minutes to add.
        hours: hours to add.
        days: days to add.
        weeks: weeks to add.
        months: months to add.
        years: years to add.
        time_zone: time zone to set.
        serialize: return serialized time or as datetime.
        serialize_format: if serialize, this determines format.

    Raises:
        ValueError: no periods has been given

    Returns:
        serialized or as datetime, shifted time with given time periods.
    """
    if not any([milliseconds, seconds, minutes, hours, days, weeks, months, years]):
        raise ValueError(
            "At least one keyword argument is required.\n"
            "If you want to get the current datetime, please use `Time.now()` instead."
        )

    delta = relativedelta(
        microseconds=milliseconds * 10**3,
        seconds=seconds,
        minutes=minutes,
        hours=hours,
        days=days,
        weeks=weeks,
        months=months,
        years=years,
    )

    now = cls.now(time_zone=time_zone, serialize=False)
    assert isinstance(now, datetime)  # just because of mypy
    time = now + delta
    return cls.serialize(time, format_=serialize_format) if serialize else time
parse classmethod
parse(time: str, *, format_: TimeFormats | str | None = None, time_zone: timezone | None = utc) -> datetime

Parses given string with given format in given timezone.

Note

By default, when format_ parameter is specified as None - the ISO format (Time.DEFAULT_FORMAT) and ISO format including milliseconds (Time.DEFAULT_FORMAT_WITH_MILLIS) could be parsed.

Parameters:

Name Type Description Default
time
str

time string to parse

required
format_
TimeFormats | str | None

format of given time string

None
time_zone
timezone | None

timezone to set after parsing

utc

Raises:

Type Description
ParseError

if parsing is not possible

Returns:

Type Description
datetime

datetime.datetime object

Source code in wax/helpy/_interfaces/time.py
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
@classmethod
def parse(
    cls,
    time: str,
    *,
    format_: TimeFormats | str | None = None,
    time_zone: timezone | None = timezone.utc,
) -> datetime:
    """
    Parses given string with given format in given timezone.

    Note:
        By default, when `format_` parameter is specified as None - the ISO format (Time.DEFAULT_FORMAT)
        and ISO format including milliseconds (Time.DEFAULT_FORMAT_WITH_MILLIS) could be parsed.

    Args:
        time: time string to parse
        format_: format of given time string
        time_zone: timezone to set after parsing

    Raises:
        ParseError: if parsing is not possible

    Returns:
        datetime.datetime object
    """
    if isinstance(time, datetime):
        return time

    def __parse_in_specified_format(_format: TimeFormats | str) -> datetime:
        if isinstance(_format, str):
            _format = TimeFormats(_format)
        try:
            parsed = datetime.strptime(time, _format.value)  # noqa: DTZ007 # in hive project %z is unused because all timestamps are utc
            return parsed.replace(tzinfo=time_zone) if time_zone else parsed
        except ValueError as exception:
            format_info = (
                f"`{_format}` custom format."
                if _format not in (TimeFormats.DEFAULT_FORMAT_WITH_MILLIS, TimeFormats.DEFAULT_FORMAT)
                else (
                    f"`{TimeFormats.DEFAULT_FORMAT}` or `{TimeFormats.DEFAULT_FORMAT_WITH_MILLIS}` default formats."
                )
            )
            raise ParseError(f"Could not be parse the `{time}` string using the {format_info}") from exception

    if format_ is not None:
        return __parse_in_specified_format(format_)

    try:
        return __parse_in_specified_format(TimeFormats.DEFAULT_FORMAT)
    except ParseError:
        return __parse_in_specified_format(TimeFormats.DEFAULT_FORMAT_WITH_MILLIS)
sync_wait_for classmethod
sync_wait_for(predicate: Callable[[], bool], *, timeout: float | timedelta = inf, timeout_error_message: str | None = None, poll_time: float = 1.0) -> float

Waits synchronously for the predicate to return True.

Parameters:

Name Type Description Default
predicate
Callable[[], bool]

Callable that returns boolean value.

required
timeout
float | timedelta

Timeout in seconds or preferably timedelta.

inf
timeout_error_message
str | None

Message that will be displayed if timeout is reached.

None
poll_time
float

Time between predicate calls.

1.0

Raises:

Type Description
TimeoutError

if given timeout exceeds

Returns:

Type Description
float

Time it took to wait for predicate return True.

Source code in wax/helpy/_interfaces/time.py
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
@classmethod
def sync_wait_for(
    cls,
    predicate: Callable[[], bool],
    *,
    timeout: float | timedelta = math.inf,
    timeout_error_message: str | None = None,
    poll_time: float = 1.0,
) -> float:
    """
    Waits synchronously for the predicate to return True.

    Args:
        predicate: Callable that returns boolean value.
        timeout: Timeout in seconds or preferably timedelta.
        timeout_error_message: Message that will be displayed if timeout is reached.
        poll_time: Time between predicate calls.

    Raises:
        TimeoutError: if given timeout exceeds

    Returns:
        Time it took to wait for predicate return True.
    """
    timeout_secs = cls.__calculate_timeout_secs_and_validate_it(timeout=timeout)
    already_waited = 0.0
    while not predicate():
        if timeout_secs - already_waited <= 0:
            raise TimeoutError(timeout_error_message or "Waited too long, timeout was reached")

        sleep_time = min(poll_time, timeout_secs)
        time.sleep(sleep_time)
        already_waited += sleep_time

    return already_waited
wait_for staticmethod
wait_for(predicate: Callable[[], bool], *, timeout: float | timedelta = inf, timeout_error_message: str | None = None, poll_time: float = 1.0) -> float

Waits for the predicate to return True in the given timeout and raises TimeoutError if it was exceeded.

Parameters:

Name Type Description Default
predicate
Callable[[], bool]

Callable that returns boolean value.

required
timeout
float | timedelta

Timeout in seconds or preferably timedelta (e.g. tt.Time.minutes(1)).

inf
timeout_error_message
str | None

Message that will be displayed if timeout is reached.

None
poll_time
float

Time between predicate calls.

1.0

Returns:

Type Description
float

Time in seconds that was spent on waiting.

Source code in wax/helpy/_interfaces/time.py
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
@staticmethod
def wait_for(
    predicate: Callable[[], bool],
    *,
    timeout: float | timedelta = math.inf,
    timeout_error_message: str | None = None,
    poll_time: float = 1.0,
) -> float:
    """
    Waits for the predicate to return True in the given timeout and raises TimeoutError if it was exceeded.

    Args:
        predicate: Callable that returns boolean value.
        timeout: Timeout in seconds or preferably timedelta (e.g. tt.Time.minutes(1)).
        timeout_error_message: Message that will be displayed if timeout is reached.
        poll_time: Time between predicate calls.

    Returns:
        Time in seconds that was spent on waiting.
    """
    timeout_secs: float = timeout.total_seconds() if isinstance(timeout, timedelta) else timeout
    assert timeout_secs >= 0, "The `timeout` argument must be non-negative value."

    already_waited = 0.0
    while not predicate():
        if timeout_secs - already_waited <= 0:
            raise TimeoutError(timeout_error_message or "Waited too long, timeout was reached")

        sleep_time = min(poll_time, timeout_secs)
        time.sleep(sleep_time)
        already_waited += sleep_time

    return already_waited

exceptions

BlockWaitTimeoutError

Bases: HelpyError

Raised if reached not expected block number.

Creates exception.

Parameters:

Name Type Description Default
last_block_number
int

last fetched block number

required
block_number
int

block that was expected to be irreversible

required
last_irreversible_block_number
int

last fetched irreversible block number

required
Source code in wax/helpy/exceptions.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def __init__(
    self,
    last_block_number: int,
    block_number: int,
    last_irreversible_block_number: int,
) -> None:
    """
    Creates exception.

    Args:
        last_block_number: last fetched block number
        block_number: block that was expected to be irreversible
        last_irreversible_block_number: last fetched irreversible block number
    """
    super().__init__(
        f"Block with number `{last_block_number}` was just reached but expected `{block_number}` is still not"
        " irreversible.\n"
        f"Last irreversible block number is `{last_irreversible_block_number}`."
    )
HelpyError

Bases: Exception

Base class for all helpy Errors.

ParseError

Bases: HelpyError

Raised if cannot parse given str, e.x. url, date, asset.

hive_apps_operations

CommunityOperation

CommunityOperation()

Bases: HiveAppsOperation[CommunityOperationPossibleTypes]

Handles community-related actions within Hive Apps.

Source code in wax/hive_apps_operations/factory.py
38
39
40
def __init__(self) -> None:
    self._body: list[HiveAppsOperationDataT] = []
    self.ops: list[operation] = []
id property
id: str

Returns the operation ID.

flag_post

Flags a post in a community.

Parameters:

Name Type Description Default
community
str

The community name.

required
account
AccountName

The account name of the user flagging the post.

required
permlink
str

The permlink of the post.

required
notes
str

Additional notes for the flag.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
def flag_post(self, community: str, account: AccountName, permlink: str, notes: str) -> CommunityOperation:
    """
    Flags a post in a community.

    Args:
        community: The community name.
        account: The account name of the user flagging the post.
        permlink: The permlink of the post.
        notes: Additional notes for the flag.

    Returns:
        The current instance for chaining.
    """
    self._body.append(FlagPostData(flag_post=FlagPostData.FlagPostDataItem(community, account, permlink, notes)))
    return self
mute_post

Mutes a post in a community.

Parameters:

Name Type Description Default
community
str

The community name.

required
account
AccountName

The account name.

required
permlink
str

The permlink of the post.

required
notes
str

Additional notes.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
def mute_post(self, community: str, account: AccountName, permlink: str, notes: str) -> CommunityOperation:
    """
    Mutes a post in a community.

    Args:
        community: The community name.
        account: The account name.
        permlink: The permlink of the post.
        notes: Additional notes.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangeMutePostData(
            change_mute_post=ChangeMutePostData.ChangeMutePostDataItem(community, account, permlink, notes)
        )
    )
    return self
pin_post

Pins a post in a community.

Parameters:

Name Type Description Default
community
str

The community name.

required
account
AccountName

The account name.

required
permlink
str

The permlink of the post.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
def pin_post(self, community: str, account: AccountName, permlink: str) -> CommunityOperation:
    """
    Pins a post in a community.

    Args:
        community: The community name.
        account: The account name.
        permlink: The permlink of the post.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangePinPostData(change_pin_post=ChangePinPostData.ChangePinPostDataItem(community, account, permlink))
    )
    return self
set_role
set_role(community: str, account: AccountName, role: PossibleCommunityRole) -> CommunityOperation

Sets a role for an account in a community.

Parameters:

Name Type Description Default
community
str

The community name.

required
account
AccountName

The account name.

required
role
PossibleCommunityRole

The role to set.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
230
231
232
233
234
235
236
237
238
239
240
241
242
243
def set_role(self, community: str, account: AccountName, role: PossibleCommunityRole) -> CommunityOperation:
    """
    Sets a role for an account in a community.

    Args:
        community: The community name.
        account: The account name.
        role: The role to set.

    Returns:
        The current instance for chaining.
    """
    self._body.append(SetRoleData(set_role=SetRoleData.SetRoleDataItem(community, account, role)))
    return self
set_user_title

Sets a user title in a community.

Parameters:

Name Type Description Default
community
str

The community name.

required
account
AccountName

The account name.

required
title
str

The title to set.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
def set_user_title(self, community: str, account: AccountName, title: str) -> CommunityOperation:
    """
    Sets a user title in a community.

    Args:
        community: The community name.
        account: The account name.
        title: The title to set.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        SetUserTitleData(set_user_title=SetUserTitleData.SetUserTitleDataItem(community, account, title))
    )
    return self
subscribe

Subscribes to a community.

Parameters:

Name Type Description Default
community
str

The community name.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
262
263
264
265
266
267
268
269
270
271
272
273
274
275
def subscribe(self, community: str) -> CommunityOperation:
    """
    Subscribes to a community.

    Args:
        community: The community name.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangeSubscriptionData(change_subscription=ChangeSubscriptionData.ChangeSubscriptionDataItem(community))
    )
    return self
unmute_post

Unmutes a post in a community.

Parameters:

Name Type Description Default
community
str

The community name.

required
account
AccountName

The account name.

required
permlink
str

The permlink of the post.

required
notes
str

Additional notes.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
def unmute_post(self, community: str, account: AccountName, permlink: str, notes: str) -> CommunityOperation:
    """
    Unmutes a post in a community.

    Args:
        community: The community name.
        account: The account name.
        permlink: The permlink of the post.
        notes: Additional notes.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangeMutePostData(
            change_mute_post=ChangeMutePostData.ChangeMutePostDataItem(community, account, permlink, notes),
            mute=False,
        )
    )

    return self
unpin_post

Unpins a post in a community.

Parameters:

Name Type Description Default
community
str

The community name.

required
account
AccountName

The account name.

required
permlink
str

The permlink of the post.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
def unpin_post(self, community: str, account: AccountName, permlink: str) -> CommunityOperation:
    """
    Unpins a post in a community.

    Args:
        community: The community name.
        account: The account name.
        permlink: The permlink of the post.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangePinPostData(
            change_pin_post=ChangePinPostData.ChangePinPostDataItem(community, account, permlink), pin=False
        )
    )
    return self
unsubscribe
unsubscribe(community: str) -> CommunityOperation

Unsubscribes from a community.

Parameters:

Name Type Description Default
community
str

The community name.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def unsubscribe(self, community: str) -> CommunityOperation:
    """
    Unsubscribes from a community.

    Args:
        community: The community name.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangeSubscriptionData(
            change_subscription=ChangeSubscriptionData.ChangeSubscriptionDataItem(community), subscribe=False
        )
    )
    return self
update_props

Updates community properties.

Parameters:

Name Type Description Default
community
str

The community name.

required
props
CommunityProps

The properties to update.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
372
373
374
375
376
377
378
379
380
381
382
383
384
def update_props(self, community: str, props: CommunityProps) -> CommunityOperation:
    """
    Updates community properties.

    Args:
        community: The community name.
        props: The properties to update.

    Returns:
        The current instance for chaining.
    """
    self._body.append(UpdatePropsData(update_props=UpdatePropsData.UpdatePropsDataItem(community, props)))
    return self

FollowOperation

FollowOperation()

Bases: HiveAppsOperation[FollowOperationData | ReblogOperationData]

Represents a Hive follow-related operation.

Source code in wax/hive_apps_operations/factory.py
38
39
40
def __init__(self) -> None:
    self._body: list[HiveAppsOperationDataT] = []
    self.ops: list[operation] = []
id property
id: str

Returns the operation ID.

Returns:

Type Description
str

The operation identifier string.

blacklist_blog

Creates an operation to add the specified blogs to the blacklist.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the blacklist action.

required
blog
AccountName

The main blog account to blacklist.

required
other_blogs
AccountName

Additional blog accounts to blacklist.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
def blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to add the specified blogs to the blacklist.

    Args:
        working_account: The account performing the blacklist action.
        blog: The main blog account to blacklist.
        other_blogs: Additional blog accounts to blacklist.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.BLACKLIST, working_account, blog, *other_blogs)
follow_blacklist_blog
follow_blacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to follow blacklisted blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the follow action.

required
blog
AccountName

The main blog account to follow from the blacklist.

required
other_blogs
AccountName

Additional blog accounts to follow from the blacklist.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
def follow_blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to follow blacklisted blogs.

    Args:
        working_account: The account performing the follow action.
        blog: The main blog account to follow from the blacklist.
        other_blogs: Additional blog accounts to follow from the blacklist.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.FOLLOW_BLACKLIST, working_account, blog, *other_blogs)
follow_blog

Creates an operation to follow the specified blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the follow action.

required
blog
AccountName

The main blog account to follow.

required
other_blogs
AccountName

Additional blog accounts to follow.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
def follow_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to follow the specified blogs.

    Args:
        working_account: The account performing the follow action.
        blog: The main blog account to follow.
        other_blogs: Additional blog accounts to follow.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.FOLLOW, working_account, blog, *other_blogs)
follow_muted_blog
follow_muted_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to follow muted blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the reset action.

required
blog
AccountName

The main blog account to reset the follow muted list for.

required
other_blogs
AccountName

Additional blog accounts to reset the follow muted list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
def follow_muted_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to follow muted blogs.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow muted list for.
        other_blogs: Additional blog accounts to reset the follow muted list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.FOLLOW_MUTED, working_account, blog, *other_blogs)
mute_blog

Creates an operation to mute the specified blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the mute action.

required
blog
AccountName

The main blog account to mute.

required
other_blogs
AccountName

Additional blog accounts to mute.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
def mute_blog(self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation:
    """
    Creates an operation to mute the specified blogs.

    Args:
        working_account: The account performing the mute action.
        blog: The main blog account to mute.
        other_blogs: Additional blog accounts to mute.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.MUTE, working_account, blog, *other_blogs)
reblog

Creates an operation to reblog a specific post.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the reblog action.

required
author
AccountName

The author of the post to be reblogged.

required
permlink
str

The permlink of the post to be reblogged.

required

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Source code in wax/hive_apps_operations/follow.py
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
def reblog(self, working_account: AccountName, author: AccountName, permlink: str) -> FollowOperation:
    """
    Creates an operation to reblog a specific post.

    Args:
        working_account: The account performing the reblog action.
        author: The author of the post to be reblogged.
        permlink: The permlink of the post to be reblogged.

    Returns:
        The FollowOperation instance.
    """
    self._body.append(ReblogOperationData(ReblogOperationDataItem(working_account, author, permlink)))

    return self
reset_all_blog

Creates an operation to reset all lists related to the specified blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the reset action.

required
blog
AccountName

The main blog account to reset the follow muted list for.

required
other_blogs
AccountName

Additional blog accounts to reset the follow muted list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
def reset_all_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to reset all lists related to the specified blogs.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow muted list for.
        other_blogs: Additional blog accounts to reset the follow muted list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.RESET_ALL_LISTS, working_account, blog, *other_blogs)
reset_blacklist_blog
reset_blacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to reset the blacklist for the specified blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the reset action.

required
blog
AccountName

The main blog account to reset the blacklist for.

required
other_blogs
AccountName

Additional blog accounts to reset the blacklist for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
def reset_blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to reset the blacklist for the specified blogs.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the blacklist for.
        other_blogs: Additional blog accounts to reset the blacklist for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.RESET_BLACKLIST, working_account, blog, *other_blogs)
reset_blog_list
reset_blog_list(action: EFollowBlogAction, working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Clears specific or all follow/mute lists for the given blogs.

Parameters:

Name Type Description Default
action
EFollowBlogAction

The type of list to reset (follow, mute, or both).

required
working_account
AccountName

The account performing the reset action.

required
blog
AccountName

The main blog account to reset the list for.

required
other_blogs
AccountName

Additional blog accounts to reset the list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
def reset_blog_list(
    self,
    action: EFollowBlogAction,
    working_account: AccountName,
    blog: AccountName,
    *other_blogs: AccountName,
) -> FollowOperation:
    """
    Clears specific or all follow/mute lists for the given blogs.

    Args:
        action: The type of list to reset (follow, mute, or both).
        working_account: The account performing the reset action.
        blog: The main blog account to reset the list for.
        other_blogs: Additional blog accounts to reset the list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    if action == EFollowBlogAction.FOLLOW_BLOG:
        return self._follow_body_builder(EFollowActions.RESET_FOLLOWING_LIST, working_account, blog, *other_blogs)
    if action == EFollowBlogAction.BOTH:
        self._follow_body_builder(EFollowActions.RESET_FOLLOWING_LIST, working_account, blog, *other_blogs)
        return self._follow_body_builder(EFollowActions.RESET_MUTED_LIST, working_account, blog, *other_blogs)
    if action == EFollowBlogAction.MUTE_BLOG:
        return self._follow_body_builder(EFollowActions.RESET_MUTED_LIST, working_account, blog, *other_blogs)
    return self
reset_follow_blacklist_blog
reset_follow_blacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to reset the follow blacklist list.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the reset action.

required
blog
AccountName

The main blog account to reset the follow blacklist for.

required
other_blogs
AccountName

Additional blog accounts to reset the follow blacklist for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
def reset_follow_blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to reset the follow blacklist list.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow blacklist for.
        other_blogs: Additional blog accounts to reset the follow blacklist for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.RESET_FOLLOW_BLACKLIST, working_account, blog, *other_blogs)
reset_follow_muted_blog
reset_follow_muted_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to reset the follow muted list.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the reset action.

required
blog
AccountName

The main blog account to reset the follow muted list for.

required
other_blogs
AccountName

Additional blog accounts to reset the follow muted list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
def reset_follow_muted_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to reset the follow muted list.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow muted list for.
        other_blogs: Additional blog accounts to reset the follow muted list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.RESET_FOLLOW_MUTED_LIST, working_account, blog, *other_blogs)
unblacklist_blog
unblacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to remove blogs from the blacklist.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the unblacklist action.

required
blog
AccountName

The main blog account to unblacklist.

required
other_blogs
AccountName

Additional blog accounts to unblacklist.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
def unblacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to remove blogs from the blacklist.

    Args:
        working_account: The account performing the unblacklist action.
        blog: The main blog account to unblacklist.
        other_blogs: Additional blog accounts to unblacklist.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.UNBLACKLIST, working_account, blog, *other_blogs)
unfollow_blacklist_blog
unfollow_blacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to unfollow blacklisted blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the unfollow action.

required
blog
AccountName

The main blog account to unfollow from the blacklist.

required
other_blogs
AccountName

Additional blog accounts to unfollow from the blacklist.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
def unfollow_blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to unfollow blacklisted blogs.

    Args:
        working_account: The account performing the unfollow action.
        blog: The main blog account to unfollow from the blacklist.
        other_blogs: Additional blog accounts to unfollow from the blacklist.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.UNFOLLOW_BLACKLIST, working_account, blog, *other_blogs)
unfollow_blog

Creates an operation to unfollow the specified blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the unfollow action.

required
blog
AccountName

The main blog account to unfollow.

required
other_blogs
AccountName

Additional blog accounts to unfollow.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
def unfollow_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to unfollow the specified blogs.

    Args:
        working_account: The account performing the unfollow action.
        blog: The main blog account to unfollow.
        other_blogs: Additional blog accounts to unfollow.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.UNFOLLOW, working_account, blog, *other_blogs)
unfollow_muted_blog
unfollow_muted_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to unfollow muted blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the reset action.

required
blog
AccountName

The main blog account to reset the follow muted list for.

required
other_blogs
AccountName

Additional blog accounts to reset the follow muted list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
def unfollow_muted_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to unfollow muted blogs.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow muted list for.
        other_blogs: Additional blog accounts to reset the follow muted list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.UNFOLLOW_MUTED, working_account, blog, *other_blogs)
unmute_blog

Creates an operation to unmute the specified blogs.

Parameters:

Name Type Description Default
working_account
AccountName

The account performing the unmute action.

required
blog
AccountName

The main blog account to unmute.

required
other_blogs
AccountName

Additional blog accounts to unmute.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
def unmute_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to unmute the specified blogs.

    Args:
        working_account: The account performing the unmute action.
        blog: The main blog account to unmute.
        other_blogs: Additional blog accounts to unmute.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self.unfollow_blog(working_account, blog, *other_blogs)

ResourceCreditsOperation

ResourceCreditsOperation()

Bases: HiveAppsOperation[ResourceCreditsOperationData]

Resource Credits operation for delegating and removing delegation of resource credits.

Source code in wax/hive_apps_operations/factory.py
38
39
40
def __init__(self) -> None:
    self._body: list[HiveAppsOperationDataT] = []
    self.ops: list[operation] = []
delegate

Delegates resource credits from one account to one or more delegatee accounts.

Parameters:

Name Type Description Default
working_account
AccountName

The account delegating the resource credits.

required
max_rc
int

The maximum amount of resource credits to delegate.

required
delegatee
AccountName

The primary account receiving the delegated resource credits.

required
other_delegatees
AccountName

Additional accounts receiving the delegated resource credits.

()

Returns:

Type Description
ResourceCreditsOperation

The current instance of ResourceCreditsOperation for method chaining, with the delegation details added to the body.

Source code in wax/hive_apps_operations/rc.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
def delegate(
    self, working_account: AccountName, max_rc: int, delegatee: AccountName, *other_delegatees: AccountName
) -> ResourceCreditsOperation:
    """
    Delegates resource credits from one account to one or more delegatee accounts.

    Args:
        working_account: The account delegating the resource credits.
        max_rc: The maximum amount of resource credits to delegate.
        delegatee: The primary account receiving the delegated resource credits.
        other_delegatees: Additional accounts receiving the delegated resource credits.

    Returns:
        The current instance of ResourceCreditsOperation for method chaining,
         with the delegation details added to the body.
    """
    delegatees = [delegatee, *other_delegatees]

    rc_delegation_data = ResourceCreditsOperationDataItem(
        from_account=working_account, max_rc=max_rc, delegatees=delegatees
    )
    rc_delegation = ResourceCreditsOperationData(delegate_rc=rc_delegation_data)
    self._body.append(rc_delegation)
    return self
remove_delegation

Removes delegation of resource credits from one account to one or more delegatee accounts.

Parameters:

Name Type Description Default
working_account
AccountName

The account removing the delegation of resource credits.

required
delegatee
AccountName

The primary account from which the delegation is being removed.

required
other_delegatees
AccountName

Additional accounts from which the delegation is being removed.

()

Returns:

Type Description
ResourceCreditsOperation

The current instance of ResourceCreditsOperation for method chaining, with max_rc set to 0.

Source code in wax/hive_apps_operations/rc.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
def remove_delegation(
    self, working_account: AccountName, delegatee: AccountName, *other_delegatees: AccountName
) -> ResourceCreditsOperation:
    """
    Removes delegation of resource credits from one account to one or more delegatee accounts.

    Args:
        working_account: The account removing the delegation of resource credits.
        delegatee: The primary account from which the delegation is being removed.
        other_delegatees: Additional accounts from which the delegation is being removed.

    Returns:
        The current instance of ResourceCreditsOperation for method chaining, with max_rc set to 0.
    """
    return self.delegate(working_account, 0, delegatee, *other_delegatees)

community

BaseCommunityActionData dataclass
BaseCommunityActionData()

Bases: HiveAppsOperationBaseData, ABC

Base class for community action data.

get_operation_action abstractmethod
get_operation_action() -> ECommunityOperationActions

Returns the operation action.

Name of the action to be performed in the community. Will be used as first element of the list in the custom json operation.

Source code in wax/hive_apps_operations/community.py
45
46
47
48
49
50
51
52
@abstractmethod
def get_operation_action(self) -> ECommunityOperationActions:
    """
    Returns the operation action.

    Name of the action to be performed in the community.
    Will be used as first element of the list in the custom json operation.
    """
CommunityOperation
CommunityOperation()

Bases: HiveAppsOperation[CommunityOperationPossibleTypes]

Handles community-related actions within Hive Apps.

Source code in wax/hive_apps_operations/factory.py
38
39
40
def __init__(self) -> None:
    self._body: list[HiveAppsOperationDataT] = []
    self.ops: list[operation] = []
id property
id: str

Returns the operation ID.

flag_post

Flags a post in a community.

Parameters:

Name Type Description Default
community str

The community name.

required
account AccountName

The account name of the user flagging the post.

required
permlink str

The permlink of the post.

required
notes str

Additional notes for the flag.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
def flag_post(self, community: str, account: AccountName, permlink: str, notes: str) -> CommunityOperation:
    """
    Flags a post in a community.

    Args:
        community: The community name.
        account: The account name of the user flagging the post.
        permlink: The permlink of the post.
        notes: Additional notes for the flag.

    Returns:
        The current instance for chaining.
    """
    self._body.append(FlagPostData(flag_post=FlagPostData.FlagPostDataItem(community, account, permlink, notes)))
    return self
mute_post

Mutes a post in a community.

Parameters:

Name Type Description Default
community str

The community name.

required
account AccountName

The account name.

required
permlink str

The permlink of the post.

required
notes str

Additional notes.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
def mute_post(self, community: str, account: AccountName, permlink: str, notes: str) -> CommunityOperation:
    """
    Mutes a post in a community.

    Args:
        community: The community name.
        account: The account name.
        permlink: The permlink of the post.
        notes: Additional notes.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangeMutePostData(
            change_mute_post=ChangeMutePostData.ChangeMutePostDataItem(community, account, permlink, notes)
        )
    )
    return self
pin_post

Pins a post in a community.

Parameters:

Name Type Description Default
community str

The community name.

required
account AccountName

The account name.

required
permlink str

The permlink of the post.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
def pin_post(self, community: str, account: AccountName, permlink: str) -> CommunityOperation:
    """
    Pins a post in a community.

    Args:
        community: The community name.
        account: The account name.
        permlink: The permlink of the post.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangePinPostData(change_pin_post=ChangePinPostData.ChangePinPostDataItem(community, account, permlink))
    )
    return self
set_role
set_role(community: str, account: AccountName, role: PossibleCommunityRole) -> CommunityOperation

Sets a role for an account in a community.

Parameters:

Name Type Description Default
community str

The community name.

required
account AccountName

The account name.

required
role PossibleCommunityRole

The role to set.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
230
231
232
233
234
235
236
237
238
239
240
241
242
243
def set_role(self, community: str, account: AccountName, role: PossibleCommunityRole) -> CommunityOperation:
    """
    Sets a role for an account in a community.

    Args:
        community: The community name.
        account: The account name.
        role: The role to set.

    Returns:
        The current instance for chaining.
    """
    self._body.append(SetRoleData(set_role=SetRoleData.SetRoleDataItem(community, account, role)))
    return self
set_user_title

Sets a user title in a community.

Parameters:

Name Type Description Default
community str

The community name.

required
account AccountName

The account name.

required
title str

The title to set.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
def set_user_title(self, community: str, account: AccountName, title: str) -> CommunityOperation:
    """
    Sets a user title in a community.

    Args:
        community: The community name.
        account: The account name.
        title: The title to set.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        SetUserTitleData(set_user_title=SetUserTitleData.SetUserTitleDataItem(community, account, title))
    )
    return self
subscribe

Subscribes to a community.

Parameters:

Name Type Description Default
community str

The community name.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
262
263
264
265
266
267
268
269
270
271
272
273
274
275
def subscribe(self, community: str) -> CommunityOperation:
    """
    Subscribes to a community.

    Args:
        community: The community name.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangeSubscriptionData(change_subscription=ChangeSubscriptionData.ChangeSubscriptionDataItem(community))
    )
    return self
unmute_post

Unmutes a post in a community.

Parameters:

Name Type Description Default
community str

The community name.

required
account AccountName

The account name.

required
permlink str

The permlink of the post.

required
notes str

Additional notes.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
def unmute_post(self, community: str, account: AccountName, permlink: str, notes: str) -> CommunityOperation:
    """
    Unmutes a post in a community.

    Args:
        community: The community name.
        account: The account name.
        permlink: The permlink of the post.
        notes: Additional notes.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangeMutePostData(
            change_mute_post=ChangeMutePostData.ChangeMutePostDataItem(community, account, permlink, notes),
            mute=False,
        )
    )

    return self
unpin_post

Unpins a post in a community.

Parameters:

Name Type Description Default
community str

The community name.

required
account AccountName

The account name.

required
permlink str

The permlink of the post.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
def unpin_post(self, community: str, account: AccountName, permlink: str) -> CommunityOperation:
    """
    Unpins a post in a community.

    Args:
        community: The community name.
        account: The account name.
        permlink: The permlink of the post.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangePinPostData(
            change_pin_post=ChangePinPostData.ChangePinPostDataItem(community, account, permlink), pin=False
        )
    )
    return self
unsubscribe
unsubscribe(community: str) -> CommunityOperation

Unsubscribes from a community.

Parameters:

Name Type Description Default
community str

The community name.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def unsubscribe(self, community: str) -> CommunityOperation:
    """
    Unsubscribes from a community.

    Args:
        community: The community name.

    Returns:
        The current instance for chaining.
    """
    self._body.append(
        ChangeSubscriptionData(
            change_subscription=ChangeSubscriptionData.ChangeSubscriptionDataItem(community), subscribe=False
        )
    )
    return self
update_props

Updates community properties.

Parameters:

Name Type Description Default
community str

The community name.

required
props CommunityProps

The properties to update.

required

Returns:

Type Description
CommunityOperation

The current instance for chaining.

Source code in wax/hive_apps_operations/community.py
372
373
374
375
376
377
378
379
380
381
382
383
384
def update_props(self, community: str, props: CommunityProps) -> CommunityOperation:
    """
    Updates community properties.

    Args:
        community: The community name.
        props: The properties to update.

    Returns:
        The current instance for chaining.
    """
    self._body.append(UpdatePropsData(update_props=UpdatePropsData.UpdatePropsDataItem(community, props)))
    return self
CommunityProps dataclass
CommunityProps(title: str, about: str = '', is_nsfw: bool = False, lang: ESupportedLanguages = ENGLISH, description: str = '', flag_text: str = '')
flag_text class-attribute instance-attribute
flag_text: str = ''

Community rules.

is_nsfw class-attribute instance-attribute
is_nsfw: bool = False

Is not safe for work flag.

factory

HiveAppsOperationDataT module-attribute
HiveAppsOperationDataT = TypeVar('HiveAppsOperationDataT', bound='HiveAppsOperationBaseData')

Type var represents data of the hive app operation.

HiveAppsOperation
HiveAppsOperation()

Bases: OperationBase, ABC, Generic[HiveAppsOperationDataT]

Base class for all Hive Apps operations.

Attributes:

Name Type Description
ops list[operation]

List of proto operations representing the operations to be performed.

Source code in wax/hive_apps_operations/factory.py
38
39
40
def __init__(self) -> None:
    self._body: list[HiveAppsOperationDataT] = []
    self.ops: list[operation] = []
authorize
authorize(required_posting_auths: list[str] | str, required_auths: list[str] | None = None) -> Self

Authorizes the operation with the given posting and active authorities.

Parameters:

Name Type Description Default
required_posting_auths list[str] | str

A single posting authority or a list of posting authorities.

required
required_auths list[str] | None

A list of active authorities.

None

Raises:

Type Description
WaxError

When required_posting_auths and required_auths not passed.

Source code in wax/hive_apps_operations/factory.py
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
def authorize(
    self,
    required_posting_auths: list[str] | str,
    required_auths: list[str] | None = None,
) -> Self:
    """
    Authorizes the operation with the given posting and active authorities.

    Args:
        required_posting_auths: A single posting authority or a list of posting authorities.
        required_auths: A list of active authorities.

    Raises:
        WaxError: When required_posting_auths and required_auths not passed.
    """
    posting_auths = [required_posting_auths] if isinstance(required_posting_auths, str) else required_posting_auths
    auths = required_auths if required_auths is not None else []

    if not auths and not posting_auths:
        raise MissingAuthorityError

    for operation_in_body in self._body:
        op_as_dict = operation_in_body.to_dict()

        operation_name = next(iter(op_as_dict.keys()))
        operation_data = op_as_dict.get(operation_name)

        valid_json_field_format = [operation_name, operation_data]

        json_str = json.dumps(
            valid_json_field_format,
            default=lambda v: str(v) if isinstance(v, int) and abs(v) > (1 << 53) else v,
        )
        self.ops.append(
            custom_json(id=self.id, json=json_str, required_auths=auths, required_posting_auths=posting_auths)
        )

    self._body.clear()
    return self
get_operations
get_operations() -> list[HiveAppsOperationDataT]

Returns the list of all operations added.

Notes

Please notice that after calling authorize method this list is cleared.

Returns:

Type Description
list[HiveAppsOperationDataT]

List of operations.

Source code in wax/hive_apps_operations/factory.py
86
87
88
89
90
91
92
93
94
95
96
def get_operations(self) -> list[HiveAppsOperationDataT]:
    """
    Returns the list of all operations added.

    Notes:
        Please notice that after calling authorize method this list is cleared.

    Returns:
        List of operations.
    """
    return self._body
HiveAppsOperationBaseData dataclass
HiveAppsOperationBaseData()

Bases: ABC

Base class for Hive Apps operation data structures.

to_dict abstractmethod
to_dict() -> dict[str, int | str]

Converts the operation data to a dictionary representation.

Source code in wax/hive_apps_operations/factory.py
25
26
27
@abstractmethod
def to_dict(self) -> dict[str, int | str]:
    """Converts the operation data to a dictionary representation."""

follow

FollowOperation
FollowOperation()

Bases: HiveAppsOperation[FollowOperationData | ReblogOperationData]

Represents a Hive follow-related operation.

Source code in wax/hive_apps_operations/factory.py
38
39
40
def __init__(self) -> None:
    self._body: list[HiveAppsOperationDataT] = []
    self.ops: list[operation] = []
id property
id: str

Returns the operation ID.

Returns:

Type Description
str

The operation identifier string.

blacklist_blog

Creates an operation to add the specified blogs to the blacklist.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the blacklist action.

required
blog AccountName

The main blog account to blacklist.

required
other_blogs AccountName

Additional blog accounts to blacklist.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
def blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to add the specified blogs to the blacklist.

    Args:
        working_account: The account performing the blacklist action.
        blog: The main blog account to blacklist.
        other_blogs: Additional blog accounts to blacklist.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.BLACKLIST, working_account, blog, *other_blogs)
follow_blacklist_blog
follow_blacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to follow blacklisted blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the follow action.

required
blog AccountName

The main blog account to follow from the blacklist.

required
other_blogs AccountName

Additional blog accounts to follow from the blacklist.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
def follow_blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to follow blacklisted blogs.

    Args:
        working_account: The account performing the follow action.
        blog: The main blog account to follow from the blacklist.
        other_blogs: Additional blog accounts to follow from the blacklist.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.FOLLOW_BLACKLIST, working_account, blog, *other_blogs)
follow_blog

Creates an operation to follow the specified blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the follow action.

required
blog AccountName

The main blog account to follow.

required
other_blogs AccountName

Additional blog accounts to follow.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
def follow_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to follow the specified blogs.

    Args:
        working_account: The account performing the follow action.
        blog: The main blog account to follow.
        other_blogs: Additional blog accounts to follow.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.FOLLOW, working_account, blog, *other_blogs)
follow_muted_blog
follow_muted_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to follow muted blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the reset action.

required
blog AccountName

The main blog account to reset the follow muted list for.

required
other_blogs AccountName

Additional blog accounts to reset the follow muted list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
def follow_muted_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to follow muted blogs.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow muted list for.
        other_blogs: Additional blog accounts to reset the follow muted list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.FOLLOW_MUTED, working_account, blog, *other_blogs)
mute_blog

Creates an operation to mute the specified blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the mute action.

required
blog AccountName

The main blog account to mute.

required
other_blogs AccountName

Additional blog accounts to mute.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
def mute_blog(self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation:
    """
    Creates an operation to mute the specified blogs.

    Args:
        working_account: The account performing the mute action.
        blog: The main blog account to mute.
        other_blogs: Additional blog accounts to mute.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.MUTE, working_account, blog, *other_blogs)
reblog

Creates an operation to reblog a specific post.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the reblog action.

required
author AccountName

The author of the post to be reblogged.

required
permlink str

The permlink of the post to be reblogged.

required

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Source code in wax/hive_apps_operations/follow.py
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
def reblog(self, working_account: AccountName, author: AccountName, permlink: str) -> FollowOperation:
    """
    Creates an operation to reblog a specific post.

    Args:
        working_account: The account performing the reblog action.
        author: The author of the post to be reblogged.
        permlink: The permlink of the post to be reblogged.

    Returns:
        The FollowOperation instance.
    """
    self._body.append(ReblogOperationData(ReblogOperationDataItem(working_account, author, permlink)))

    return self
reset_all_blog

Creates an operation to reset all lists related to the specified blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the reset action.

required
blog AccountName

The main blog account to reset the follow muted list for.

required
other_blogs AccountName

Additional blog accounts to reset the follow muted list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
def reset_all_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to reset all lists related to the specified blogs.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow muted list for.
        other_blogs: Additional blog accounts to reset the follow muted list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.RESET_ALL_LISTS, working_account, blog, *other_blogs)
reset_blacklist_blog
reset_blacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to reset the blacklist for the specified blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the reset action.

required
blog AccountName

The main blog account to reset the blacklist for.

required
other_blogs AccountName

Additional blog accounts to reset the blacklist for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
def reset_blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to reset the blacklist for the specified blogs.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the blacklist for.
        other_blogs: Additional blog accounts to reset the blacklist for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.RESET_BLACKLIST, working_account, blog, *other_blogs)
reset_blog_list
reset_blog_list(action: EFollowBlogAction, working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Clears specific or all follow/mute lists for the given blogs.

Parameters:

Name Type Description Default
action EFollowBlogAction

The type of list to reset (follow, mute, or both).

required
working_account AccountName

The account performing the reset action.

required
blog AccountName

The main blog account to reset the list for.

required
other_blogs AccountName

Additional blog accounts to reset the list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
def reset_blog_list(
    self,
    action: EFollowBlogAction,
    working_account: AccountName,
    blog: AccountName,
    *other_blogs: AccountName,
) -> FollowOperation:
    """
    Clears specific or all follow/mute lists for the given blogs.

    Args:
        action: The type of list to reset (follow, mute, or both).
        working_account: The account performing the reset action.
        blog: The main blog account to reset the list for.
        other_blogs: Additional blog accounts to reset the list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    if action == EFollowBlogAction.FOLLOW_BLOG:
        return self._follow_body_builder(EFollowActions.RESET_FOLLOWING_LIST, working_account, blog, *other_blogs)
    if action == EFollowBlogAction.BOTH:
        self._follow_body_builder(EFollowActions.RESET_FOLLOWING_LIST, working_account, blog, *other_blogs)
        return self._follow_body_builder(EFollowActions.RESET_MUTED_LIST, working_account, blog, *other_blogs)
    if action == EFollowBlogAction.MUTE_BLOG:
        return self._follow_body_builder(EFollowActions.RESET_MUTED_LIST, working_account, blog, *other_blogs)
    return self
reset_follow_blacklist_blog
reset_follow_blacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to reset the follow blacklist list.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the reset action.

required
blog AccountName

The main blog account to reset the follow blacklist for.

required
other_blogs AccountName

Additional blog accounts to reset the follow blacklist for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
def reset_follow_blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to reset the follow blacklist list.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow blacklist for.
        other_blogs: Additional blog accounts to reset the follow blacklist for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.RESET_FOLLOW_BLACKLIST, working_account, blog, *other_blogs)
reset_follow_muted_blog
reset_follow_muted_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to reset the follow muted list.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the reset action.

required
blog AccountName

The main blog account to reset the follow muted list for.

required
other_blogs AccountName

Additional blog accounts to reset the follow muted list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
def reset_follow_muted_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to reset the follow muted list.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow muted list for.
        other_blogs: Additional blog accounts to reset the follow muted list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.RESET_FOLLOW_MUTED_LIST, working_account, blog, *other_blogs)
unblacklist_blog
unblacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to remove blogs from the blacklist.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the unblacklist action.

required
blog AccountName

The main blog account to unblacklist.

required
other_blogs AccountName

Additional blog accounts to unblacklist.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
def unblacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to remove blogs from the blacklist.

    Args:
        working_account: The account performing the unblacklist action.
        blog: The main blog account to unblacklist.
        other_blogs: Additional blog accounts to unblacklist.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.UNBLACKLIST, working_account, blog, *other_blogs)
unfollow_blacklist_blog
unfollow_blacklist_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to unfollow blacklisted blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the unfollow action.

required
blog AccountName

The main blog account to unfollow from the blacklist.

required
other_blogs AccountName

Additional blog accounts to unfollow from the blacklist.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
def unfollow_blacklist_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to unfollow blacklisted blogs.

    Args:
        working_account: The account performing the unfollow action.
        blog: The main blog account to unfollow from the blacklist.
        other_blogs: Additional blog accounts to unfollow from the blacklist.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.UNFOLLOW_BLACKLIST, working_account, blog, *other_blogs)
unfollow_blog

Creates an operation to unfollow the specified blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the unfollow action.

required
blog AccountName

The main blog account to unfollow.

required
other_blogs AccountName

Additional blog accounts to unfollow.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
def unfollow_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to unfollow the specified blogs.

    Args:
        working_account: The account performing the unfollow action.
        blog: The main blog account to unfollow.
        other_blogs: Additional blog accounts to unfollow.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.UNFOLLOW, working_account, blog, *other_blogs)
unfollow_muted_blog
unfollow_muted_blog(working_account: AccountName, blog: AccountName, *other_blogs: AccountName) -> FollowOperation

Creates an operation to unfollow muted blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the reset action.

required
blog AccountName

The main blog account to reset the follow muted list for.

required
other_blogs AccountName

Additional blog accounts to reset the follow muted list for.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
def unfollow_muted_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to unfollow muted blogs.

    Args:
        working_account: The account performing the reset action.
        blog: The main blog account to reset the follow muted list for.
        other_blogs: Additional blog accounts to reset the follow muted list for.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self._follow_body_builder(EFollowActions.UNFOLLOW_MUTED, working_account, blog, *other_blogs)
unmute_blog

Creates an operation to unmute the specified blogs.

Parameters:

Name Type Description Default
working_account AccountName

The account performing the unmute action.

required
blog AccountName

The main blog account to unmute.

required
other_blogs AccountName

Additional blog accounts to unmute.

()

Returns:

Type Description
FollowOperation

The FollowOperation instance.

Raises:

Type Description
ToLongFollowingListError

If the number of blogs provided exceeds 100.

Source code in wax/hive_apps_operations/follow.py
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
def unmute_blog(
    self, working_account: AccountName, blog: AccountName, *other_blogs: AccountName
) -> FollowOperation:
    """
    Creates an operation to unmute the specified blogs.

    Args:
        working_account: The account performing the unmute action.
        blog: The main blog account to unmute.
        other_blogs: Additional blog accounts to unmute.

    Returns:
        The FollowOperation instance.

    Raises:
        ToLongFollowingListError: If the number of blogs provided exceeds 100.
    """
    return self.unfollow_blog(working_account, blog, *other_blogs)
FollowOperationDataItem dataclass
FollowOperationDataItem(what: EFollowActions, follower: AccountName, following: AccountName | list[AccountName])

Represents a single follow operation data structure.

ReblogOperationDataItem dataclass
ReblogOperationDataItem(account: AccountName, author: AccountName, permlink: str)

Represents a single reblog operation data structure.

rc

ResourceCreditsOperation
ResourceCreditsOperation()

Bases: HiveAppsOperation[ResourceCreditsOperationData]

Resource Credits operation for delegating and removing delegation of resource credits.

Source code in wax/hive_apps_operations/factory.py
38
39
40
def __init__(self) -> None:
    self._body: list[HiveAppsOperationDataT] = []
    self.ops: list[operation] = []
delegate

Delegates resource credits from one account to one or more delegatee accounts.

Parameters:

Name Type Description Default
working_account AccountName

The account delegating the resource credits.

required
max_rc int

The maximum amount of resource credits to delegate.

required
delegatee AccountName

The primary account receiving the delegated resource credits.

required
other_delegatees AccountName

Additional accounts receiving the delegated resource credits.

()

Returns:

Type Description
ResourceCreditsOperation

The current instance of ResourceCreditsOperation for method chaining, with the delegation details added to the body.

Source code in wax/hive_apps_operations/rc.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
def delegate(
    self, working_account: AccountName, max_rc: int, delegatee: AccountName, *other_delegatees: AccountName
) -> ResourceCreditsOperation:
    """
    Delegates resource credits from one account to one or more delegatee accounts.

    Args:
        working_account: The account delegating the resource credits.
        max_rc: The maximum amount of resource credits to delegate.
        delegatee: The primary account receiving the delegated resource credits.
        other_delegatees: Additional accounts receiving the delegated resource credits.

    Returns:
        The current instance of ResourceCreditsOperation for method chaining,
         with the delegation details added to the body.
    """
    delegatees = [delegatee, *other_delegatees]

    rc_delegation_data = ResourceCreditsOperationDataItem(
        from_account=working_account, max_rc=max_rc, delegatees=delegatees
    )
    rc_delegation = ResourceCreditsOperationData(delegate_rc=rc_delegation_data)
    self._body.append(rc_delegation)
    return self
remove_delegation

Removes delegation of resource credits from one account to one or more delegatee accounts.

Parameters:

Name Type Description Default
working_account AccountName

The account removing the delegation of resource credits.

required
delegatee AccountName

The primary account from which the delegation is being removed.

required
other_delegatees AccountName

Additional accounts from which the delegation is being removed.

()

Returns:

Type Description
ResourceCreditsOperation

The current instance of ResourceCreditsOperation for method chaining, with max_rc set to 0.

Source code in wax/hive_apps_operations/rc.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
def remove_delegation(
    self, working_account: AccountName, delegatee: AccountName, *other_delegatees: AccountName
) -> ResourceCreditsOperation:
    """
    Removes delegation of resource credits from one account to one or more delegatee accounts.

    Args:
        working_account: The account removing the delegation of resource credits.
        delegatee: The primary account from which the delegation is being removed.
        other_delegatees: Additional accounts from which the delegation is being removed.

    Returns:
        The current instance of ResourceCreditsOperation for method chaining, with max_rc set to 0.
    """
    return self.delegate(working_account, 0, delegatee, *other_delegatees)
ResourceCreditsOperationDataItem dataclass
ResourceCreditsOperationDataItem(from_account: AccountName, max_rc: int, delegatees: list[AccountName], extensions: list[Any] = list())

Data structure for Resource Credits operation.

Attributes:

Name Type Description
from_account AccountName

The account delegating the resource credits.

max_rc int

The amount of resource credits to delegate.

delegatees list[AccountName]

List of accounts receiving the delegated resource credits.

interfaces

ApiCollectionT module-attribute

ApiCollectionT = TypeVar('ApiCollectionT', default=WaxApiCollection)

TypeVar for API collection, available by default in the IHiveChainInterface.

ChainConfig module-attribute

ChainConfig: TypeAlias = dict[str, str]

ChainConfig is a type alias for a dictionary containing chain configuration parameters.

ExtendedApiCollectionT module-attribute

ExtendedApiCollectionT = TypeVar('ExtendedApiCollectionT')

TypeVar for API collection that will be added to the IHiveChainInterface by the user.

TTimestamp module-attribute

TTimestamp: TypeAlias = datetime | timedelta

TTimestamp is a type alias for a timestamp that can be either a datetime object or a timedelta object.

IAuthorityDataProvider

Bases: ABC

Interface providing authority data.

get_hive_authority_data abstractmethod async
get_hive_authority_data(name: AccountName) -> WaxAccountAuthorityInfo

Get hive authority by account name.

Source code in wax/interfaces.py
45
46
47
@abstractmethod
async def get_hive_authority_data(self, name: AccountName) -> WaxAccountAuthorityInfo:
    """Get hive authority by account name."""

IHiveChainInterface

Bases: IWaxBaseInterface, Generic[ApiCollectionT]

api abstractmethod property

Returns the API collection object.

endpoint_url abstractmethod property writable
endpoint_url: HttpUrl

Returns the selected endpoint url used to perform API calls.

broadcast abstractmethod async

Broadcast transaction to the selected during Wax Chain initialization Hive Node.

Please note that when IOnlineTransaction is passed perform_on_chain_verification method is called automatically.

Parameters:

Name Type Description Default
transaction
ITransaction | IOnlineTransaction

Transaction object to be broadcasted.

required

Raises:

Type Description
TransactionNotSignedError

When the transaction is not signed.

WaxValidationFailedError

When the transaction is incorrect.

AccountNotFoundError

If IOnlineTransaction provided and ANY of impacted accounts not found on the chain.

PrivateKeyDetectedInMemoError

If IOnlineTransaction provided private key detected in the content of the operation.

Source code in wax/interfaces.py
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
@abstractmethod
async def broadcast(self, transaction: ITransaction | IOnlineTransaction) -> None:
    """
    Broadcast transaction to the selected during Wax Chain initialization Hive Node.

    Please note that when IOnlineTransaction is passed `perform_on_chain_verification`
    method is called automatically.

    Args:
        transaction: Transaction object to be broadcasted.

    Raises:
        TransactionNotSignedError: When the transaction is not signed.
        WaxValidationFailedError: When the transaction is incorrect.
        AccountNotFoundError: If IOnlineTransaction provided and ANY of impacted accounts not found on the chain.
        PrivateKeyDetectedInMemoError: If IOnlineTransaction provided private key detected in the content
         of the operation.
    """
collect_account_authorities abstractmethod async
collect_account_authorities(*accounts: AccountName) -> WaxAccountAuthorityInfo | list[WaxAccountAuthorityInfo]

Collects account authorities.

Parameters:

Name Type Description Default
accounts
AccountName

Account name(s).

()

Returns:

Name Type Description
WaxAccountAuthorityInfo WaxAccountAuthorityInfo | list[WaxAccountAuthorityInfo]

Account authority info.

Raises:

Type Description
InvalidAccountNameError

When the account(s) name is invalid.

AccountNotFoundError

When the account(s) is not found in the HIVE api node.

Source code in wax/interfaces.py
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
@abstractmethod
async def collect_account_authorities(
    self, *accounts: AccountName
) -> WaxAccountAuthorityInfo | list[WaxAccountAuthorityInfo]:
    """
    Collects account authorities.

    Args:
        accounts: Account name(s).

    Returns:
        WaxAccountAuthorityInfo: Account authority info.

    Raises:
        InvalidAccountNameError: When the account(s) name is invalid.
        AccountNotFoundError: When the account(s) is not found in the HIVE api node.
    """
create_transaction abstractmethod async
create_transaction(expiration: TTimestamp | None = None) -> IOnlineTransaction

Same as IWaxBaseInterface.create_transaction_with_tapos but pulls the reference block data from the remote.

Parameters:

Name Type Description Default
expiration
TTimestamp | None

time (UTC) till transaction is valid. Default to +1 minute.

None

Returns:

Type Description
IOnlineTransaction

Transaction object

Raises:

Type Description
AssertionError

when expiration is not valid type.

Source code in wax/interfaces.py
722
723
724
725
726
727
728
729
730
731
732
733
734
735
@abstractmethod
async def create_transaction(self, expiration: TTimestamp | None = None) -> IOnlineTransaction:
    """
    Same as `IWaxBaseInterface.create_transaction_with_tapos` but pulls the reference block data from the remote.

    Args:
        expiration: time (UTC) till transaction is valid. Default to +1 minute.

    Returns:
        Transaction object

    Raises:
        AssertionError: when expiration is not valid type.
    """
extend_rest abstractmethod

Extends the current rest API collection with a new one.

Parameters:

Name Type Description Default
new_rest_api
type[ExtendedApiCollectionT]

New rest API collection class to be added.

required

Returns:

Name Type Description
IHiveChainInterface IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]

New chain instance with the extended rest API collection.

Examples:

class MyCustomApiCollection: def init(self): self.my_custom_api = MyCustomApi

chain = create_hive_chain() extended_chain = chain.extend_rest(ExtendedApiCollection)

response = await extended_chain.api.my_custom_api.custom_endpoint() # With full intellisense support

Source code in wax/interfaces.py
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
@abstractmethod
def extend_rest(
    self, new_rest_api: type[ExtendedApiCollectionT]
) -> IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]:
    """
    Extends the current rest API collection with a new one.

    Args:
        new_rest_api: New rest API collection class to be added.

    Returns:
        IHiveChainInterface: New chain instance with the extended rest API collection.

    Examples:
        class MyCustomApiCollection:
            def __init__(self):
               self.my_custom_api = MyCustomApi

        chain = create_hive_chain()
        extended_chain = chain.extend_rest(ExtendedApiCollection)

        response = await extended_chain.api.my_custom_api.custom_endpoint()  # With full intellisense support
    """
extends abstractmethod

Extends the current API collection with a new one.

Parameters:

Name Type Description Default
new_api
type[ExtendedApiCollectionT]

New API collection class to be added.

required

Returns:

Name Type Description
IHiveChainInterface IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]

New chain instance with the extended API collection.

Examples:

class MyCustomApiCollection: def init(self): self.my_custom_api = MyCustomApi

chain = create_hive_chain() extended_chain = chain.extends(ExtendedApiCollection)

response = await extended_chain.api.my_custom_api.custom_endpoint() # With full intellisense support

Source code in wax/interfaces.py
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
@abstractmethod
def extends(
    self, new_api: type[ExtendedApiCollectionT]
) -> IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]:
    """
    Extends the current API collection with a new one.

    Args:
        new_api: New API collection class to be added.

    Returns:
        IHiveChainInterface: New chain instance with the extended API collection.

    Examples:
        class MyCustomApiCollection:
            def __init__(self):
               self.my_custom_api = MyCustomApi

        chain = create_hive_chain()
        extended_chain = chain.extends(ExtendedApiCollection)

        response = await extended_chain.api.my_custom_api.custom_endpoint()  # With full intellisense support
    """
teardown abstractmethod
teardown() -> None

Call when work with API communication is over.

Source code in wax/interfaces.py
718
719
720
@abstractmethod
def teardown(self) -> None:
    """Call when work with API communication is over."""

IManabarData dataclass

IManabarData(max_mana: int, current_mana: int)

Bases: ABC

Manabar data contains: max mana, current mana and percent.

IOnlineTransaction

Bases: ITransaction, ABC

Transaction interface with support on-chain verification.

perform_on_chain_verification abstractmethod async
perform_on_chain_verification() -> None

Performs on-chain verification of the transaction.

This method checks if all accounts involved in the transaction exist on the blockchain. It also scans the transaction for any potential private key leaks in operation contents.

Raises:

Type Description
AccountNotFoundError

If ANY of impacted accounts do not exist in the blockchain.

PrivateKeyDetectedInMemoError

If private key detected in the content of the operation.

Source code in wax/interfaces.py
252
253
254
255
256
257
258
259
260
261
262
263
@abstractmethod
async def perform_on_chain_verification(self) -> None:
    """
    Performs on-chain verification of the transaction.

    This method checks if all accounts involved in the transaction exist on the blockchain.
    It also scans the transaction for any potential private key leaks in operation contents.

    Raises:
        AccountNotFoundError: If ANY of impacted accounts do not exist in the blockchain.
        PrivateKeyDetectedInMemoError: If private key detected in the content of the operation.
    """

ITransaction

Bases: ITransactionBase

push_operation abstractmethod
push_operation(operation: WaxMetaOperation) -> Self

Pushes given operation into the transaction (exactly to the list of operations).

Parameters:

Name Type Description Default
operation
WaxMetaOperation

Operation to be pushed into the transaction in dict or proto format.

required

Examples:

  • Proto format: transaction.push_operation(vote_pb2.vote(voter="alice", author="bob", permlink="/", weight=11))

Returns:

Name Type Description
Self Self

current transaction instance.

Source code in wax/interfaces.py
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
@abstractmethod
def push_operation(self, operation: WaxMetaOperation) -> Self:
    """
    Pushes given operation into the transaction (exactly to the list of operations).

    Args:
        operation: Operation to be pushed into the transaction in dict or proto format.

    Examples:
        * Proto format:
        transaction.push_operation(vote_pb2.vote(voter="alice", author="bob", permlink="/", weight=11))

    Returns:
        Self: current transaction instance.
    """

ITransactionBase

Bases: ABC

id abstractmethod property

Returns id of the transaction (HF26 serialization used).

Returns:

Name Type Description
TransactionId TransactionId

Transaction id in hex form.

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

impacted_accounts abstractmethod property
impacted_accounts: list[AccountName]

Returns list of account names (not authorities!) impacted by a whole transaction.

Returns:

Type Description
list[AccountName]

list[AccountName]: List of account names impacted by the transaction.

Raises:

Type Description
WaxValidationFailedError

When any of the accounts is incorrect.

is_signed abstractmethod property
is_signed: bool

Checks if underlying transaction has been already signed at least one time.

Returns:

Name Type Description
bool bool

Either true or false based on the signatures amount.

required_authorities abstractmethod property
required_authorities: ITransactionRequiredAuthorities

Returns required authority accounts from the transaction.

Returns:

Name Type Description
ITransactionRequiredAuthorities ITransactionRequiredAuthorities

All possible authority models.

sig_digest abstractmethod property
sig_digest: SigDigest

Returns digest of the transaction for signing (HF26 serialization used).

Returns:

Name Type Description
SigDigest SigDigest

Digest of the transaction in hex form.

Raises:

Type Description
WaxValidationFailedError

When the transaction or chain id is incorrect.

signature_keys abstractmethod property
signature_keys: list[PublicKey]

Returns signature keys from the transaction signatures (HF26 serialization used).

Returns:

Type Description
list[PublicKey]

list[PublicKey]: List of public keys used to sign the transaction.

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

transaction abstractmethod property
transaction: ProtoTransaction

Fills up constructed transaction basing on preconfigured TAPOS. Also applies the transaction expiration time.

Returns:

Name Type Description
ProtoTransaction ProtoTransaction

Proto transaction object.

add_signature abstractmethod
add_signature(signature: Signature) -> Signature

Adds your signature to the internal signatures list inside underlying transaction.

Parameters:

Name Type Description Default
signature
Signature

Signature to be added.

required

Returns:

Name Type Description
Signature Signature

Added transaction signature.

Source code in wax/interfaces.py
161
162
163
164
165
166
167
168
169
170
171
@abstractmethod
def add_signature(self, signature: Signature) -> Signature:
    """
    Adds your signature to the internal signatures list inside underlying transaction.

    Args:
        signature: Signature to be added.

    Returns:
        Signature: Added transaction signature.
    """
sign abstractmethod async
sign(wallet: AsyncUnlockedWallet, public_key: PublicKey) -> Signature

Signs asynchronously the transaction using given public key. Applies the transaction expiration time.

Parameters:

Name Type Description Default
wallet
AsyncUnlockedWallet

Unlocked wallet to be used for signing.

required
public_key
PublicKey

Public key for signing (remember that should be available in the wallet!)

required

Returns:

Name Type Description
Signature Signature

Transaction signature signed using given key.

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

Source code in wax/interfaces.py
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
@abstractmethod
async def sign(self, wallet: AsyncUnlockedWallet, public_key: PublicKey) -> Signature:
    """
    Signs asynchronously the transaction using given public key. Applies the transaction expiration time.

    Args:
        wallet: Unlocked wallet to be used for signing.
        public_key: Public key for signing (remember that should be available in the wallet!)

    Returns:
        Signature: Transaction signature signed using given key.

    Raises:
        WaxValidationFailedError: When the transaction is incorrect.
    """
to_api abstractmethod
to_api() -> str

Converts the created transaction into the Hive API-form str.

Returns:

Name Type Description
str str

Transaction in Hive API-form.

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

Source code in wax/interfaces.py
194
195
196
197
198
199
200
201
202
203
204
@abstractmethod
def to_api(self) -> str:
    """
    Converts the created transaction into the Hive API-form str.

    Returns:
        str: Transaction in Hive API-form.

    Raises:
        WaxValidationFailedError: When the transaction is incorrect.
    """
to_api_json abstractmethod
to_api_json() -> JsonTransaction

Converts the created transaction into the Hive API-form JSON.

Returns:

Name Type Description
JsonTransaction JsonTransaction

Transaction in Hive API-form.

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

Source code in wax/interfaces.py
218
219
220
221
222
223
224
225
226
227
228
@abstractmethod
def to_api_json(self) -> JsonTransaction:
    """
    Converts the created transaction into the Hive API-form JSON.

    Returns:
        JsonTransaction: Transaction in Hive API-form.

    Raises:
        WaxValidationFailedError: When the transaction is incorrect.
    """
to_binary_form abstractmethod
to_binary_form() -> Hex

Allows to serialize underlying transaction to HF26 specific binary form, then return it as hexstring.

Returns:

Name Type Description
Hex Hex

Serialized transaction in hex form.

Source code in wax/interfaces.py
185
186
187
188
189
190
191
192
@abstractmethod
def to_binary_form(self) -> Hex:
    """
    Allows to serialize underlying transaction to HF26 specific binary form, then return it as hexstring.

    Returns:
        Hex: Serialized transaction in hex form.
    """
to_dict abstractmethod
to_dict() -> dict[str, Any]

Converts the created transaction into the Hive API-form dict.

Returns:

Name Type Description
dict dict[str, Any]

Transaction in Hive API-form.

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

Source code in wax/interfaces.py
206
207
208
209
210
211
212
213
214
215
216
@abstractmethod
def to_dict(self) -> dict[str, Any]:
    """
    Converts the created transaction into the Hive API-form dict.

    Returns:
        dict: Transaction in Hive API-form.

    Raises:
        WaxValidationFailedError: When the transaction is incorrect.
    """
to_string abstractmethod
to_string() -> str

Converts transaction object into the protobuf JSON string.

Returns:

Name Type Description
str str

Protobuf JSON string.

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

Source code in wax/interfaces.py
173
174
175
176
177
178
179
180
181
182
183
@abstractmethod
def to_string(self) -> str:
    """
    Converts transaction object into the protobuf JSON string.

    Returns:
        str: Protobuf JSON string.

    Raises:
        WaxValidationFailedError: When the transaction is incorrect.
    """
validate abstractmethod
validate() -> None

Validates current transaction.

Returns:

Type Description
None

None

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

Source code in wax/interfaces.py
133
134
135
136
137
138
139
140
141
142
143
@abstractmethod
def validate(self) -> None:
    """
    Validates current transaction.

    Returns:
        None

    Raises:
        WaxValidationFailedError: When the transaction is incorrect.
    """

IWaxBaseInterface

Bases: ABC

address_prefix abstractmethod property
address_prefix: str

Returns the public key address prefix.

chain_id abstractmethod property
chain_id: ChainId

Returns the chain id.

config abstractmethod property
config: ChainConfig

Returns protocol configuration for the current chain.

hbd abstractmethod property

Returns set of methods to create HBD asset.

hive abstractmethod property

Returns set of methods to create HIVE asset.

vests abstractmethod property
vests: AssetFactory

Returns set of methods to create VESTS asset.

calculate_account_hp abstractmethod

Calculates account HP based on given vests, total vesting fund HIVE and total vesting shares.

Parameters:

Name Type Description Default
vests
VestsNaiAssetConvertible

VESTS asset.

required
total_vesting_fund_hive
HiveNaiAssetConvertible

HIVE asset total vesting fund.

required
total_vesting_shares
VestsNaiAssetConvertible

VESTS asset total vesting shares.

required

Returns:

Name Type Description
NaiAsset NaiAsset

calculated HP for the given vests, total vesting fund HIVE and total vesting shares.

Raises:

Type Description
UnknownAssetTypeError / CannotCreateAssetError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
@abstractmethod
def calculate_account_hp(
    self,
    vests: VestsNaiAssetConvertible,
    total_vesting_fund_hive: HiveNaiAssetConvertible,
    total_vesting_shares: VestsNaiAssetConvertible,
) -> NaiAsset:
    """
    Calculates account HP based on given vests, total vesting fund HIVE and total vesting shares.

    Args:
        vests: VESTS asset.
        total_vesting_fund_hive: HIVE asset total vesting fund.
        total_vesting_shares: VESTS asset total vesting shares.

    Returns:
        NaiAsset: calculated HP for the given vests, total vesting fund HIVE and total vesting shares.

    Raises:
        UnknownAssetTypeError/CannotCreateAssetError/AssertionError: When passed asset is incorrect.
    """
calculate_current_manabar_value abstractmethod staticmethod

Calculates of the current manabar.

Parameters:

Name Type Description Default
head_block_time
datetime

Head block time. Can be obtained using time property from dgpo (dynamic global properties)

required
max_mana
int

Maximum account mana. * For upvotes should equal post_voting_power.amount from the find_account. * For downvotes remember to multiply this value by downvote_pool_percent from the dgpo. * For rc manabar calculations use max_rc value from the rc_accounts API call.

required
current_mana
int

Current account mana. * For upvotes should equal voting_manabar.current_mana from the find_account API call. * For downvotes: downvote_manabar.current_mana. * For rc manabar calculations use rc_manabar value from the rc_accounts API call

required
last_update_time
int

Last update of the current account mana. * For upvotes should equal voting_manabar.last_update_time from the find_account API call. * For downvotes should equal downvote_manabar.current_mana. * For rc manabar calculations use rc_manabar value from the rc_accounts API call.

required

Returns:

Name Type Description
IManabarData IManabarData

Calculated manabar value.

Raises:

Type Description
WaxValidationFailedError

When passed parameters are wrong.

Source code in wax/interfaces.py
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
@staticmethod
@abstractmethod
def calculate_current_manabar_value(
    head_block_time: datetime, max_mana: int, current_mana: int, last_update_time: int
) -> IManabarData:
    """
    Calculates of the current manabar.

    Args:
        head_block_time:
            Head block time. Can be obtained using time property from dgpo (dynamic global properties)
        max_mana:
            Maximum account mana.
            * For upvotes should equal post_voting_power.amount from the find_account.
            * For downvotes remember to multiply this value by downvote_pool_percent from the dgpo.
            * For rc manabar calculations use max_rc value from the rc_accounts API call.
        current_mana:
            Current account mana.
            * For upvotes should equal voting_manabar.current_mana from the find_account API call.
            * For downvotes: downvote_manabar.current_mana.
            * For rc manabar calculations use rc_manabar value from the rc_accounts API call
        last_update_time:
            Last update of the current account mana.
            * For upvotes should equal voting_manabar.last_update_time from the find_account API call.
            * For downvotes should equal downvote_manabar.current_mana.
            * For rc manabar calculations use rc_manabar value from the rc_accounts API call.

    Returns:
        IManabarData: Calculated manabar value.

    Raises:
        WaxValidationFailedError: When passed parameters are wrong.
    """
calculate_hp_apr abstractmethod

Calculates HP APR.

Parameters:

Name Type Description Default
head_block_num
int

Head block number.

required
vesting_reward_percent
int

Vesting reward percent.

required
virtual_supply
HiveNaiAssetConvertible

Virtual supply.

required
total_vesting_fund_hive
HiveNaiAssetConvertible

Total vesting fund HIVE.

required

Returns:

Name Type Description
Decimal Decimal

HP APR percent with 2 decimals

Raises:

Type Description
WaxValidationFailedError

When passed parameters are wrong.

Source code in wax/interfaces.py
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
@abstractmethod
def calculate_hp_apr(
    self,
    head_block_num: int,
    vesting_reward_percent: int,
    virtual_supply: HiveNaiAssetConvertible,
    total_vesting_fund_hive: HiveNaiAssetConvertible,
) -> Decimal:
    """
    Calculates HP APR.

    Args:
        head_block_num: Head block number.
        vesting_reward_percent: Vesting reward percent.
        virtual_supply: Virtual supply.
        total_vesting_fund_hive: Total vesting fund HIVE.

    Returns:
        Decimal: HP APR percent with 2 decimals

    Raises:
        WaxValidationFailedError: When passed parameters are wrong.
    """
calculate_manabar_full_regeneration_time abstractmethod staticmethod
calculate_manabar_full_regeneration_time(head_block_time: datetime, max_mana: int, current_mana: int, last_update_time: int) -> datetime

Calculates manabar full regeneration time.

Parameters:

Name Type Description Default
head_block_time
datetime

Head block time. Can be obtained using time property from dgpo (dynamic global properties)

required
max_mana
int

Maximum account mana. * For upvotes should equal post_voting_power.amount from the find_account. * For downvotes remember to multiply this value by downvote_pool_percent from the dgpo. * For rc manabar calculations use max_rc value from the rc_accounts API call.

required
current_mana
int

Current account mana. * For upvotes should equal voting_manabar.current_mana from the find_account API call. * For downvotes: downvote_manabar.current_mana. * For rc manabar calculations use rc_manabar value from the rc_accounts API call

required
last_update_time
int

Last update of the current account mana. * For upvotes should equal voting_manabar.last_update_time from the find_account API call. * For downvotes should equal downvote_manabar.current_mana. * For rc manabar calculations use rc_manabar value from the rc_accounts API call.

required

Returns:

Name Type Description
datetime datetime

Calculated manabar full regeneration time.

Raises:

Type Description
WaxValidationFailedError

when passed parameters are wrong.

Source code in wax/interfaces.py
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
@staticmethod
@abstractmethod
def calculate_manabar_full_regeneration_time(
    head_block_time: datetime, max_mana: int, current_mana: int, last_update_time: int
) -> datetime:
    """
    Calculates manabar full regeneration time.

    Args:
        head_block_time:
            Head block time. Can be obtained using time property from dgpo (dynamic global properties)
        max_mana:
            Maximum account mana.
            * For upvotes should equal post_voting_power.amount from the find_account.
            * For downvotes remember to multiply this value by downvote_pool_percent from the dgpo.
            * For rc manabar calculations use max_rc value from the rc_accounts API call.
        current_mana:
            Current account mana.
            * For upvotes should equal voting_manabar.current_mana from the find_account API call.
            * For downvotes: downvote_manabar.current_mana.
            * For rc manabar calculations use rc_manabar value from the rc_accounts API call
        last_update_time:
            Last update of the current account mana.
            * For upvotes should equal voting_manabar.last_update_time from the find_account API call.
            * For downvotes should equal downvote_manabar.current_mana.
            * For rc manabar calculations use rc_manabar value from the rc_accounts API call.

    Returns:
        datetime: Calculated manabar full regeneration time.

    Raises:
        WaxValidationFailedError: when passed parameters are wrong.
    """
calculate_witness_votes_hp abstractmethod

Calculates witness votes HP based on given votes, total vesting fund HIVE and total vesting shares.

Parameters:

Name Type Description Default
number
int

witness votes.

required
total_vesting_fund_hive
HiveNaiAssetConvertible

HIVE asset total vesting fund.

required
total_vesting_shares
VestsNaiAssetConvertible

VESTS asset total vesting shares.

required

Returns:

Name Type Description
NaiAsset NaiAsset

Calculated votes in nai asset form.

Raises:

Type Description
UnknownAssetTypeError / CannotCreateAssetError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
@abstractmethod
def calculate_witness_votes_hp(
    self,
    number: int,
    total_vesting_fund_hive: HiveNaiAssetConvertible,
    total_vesting_shares: VestsNaiAssetConvertible,
) -> NaiAsset:
    """
    Calculates witness votes HP based on given votes, total vesting fund HIVE and total vesting shares.

    Args:
        number: witness votes.
        total_vesting_fund_hive: HIVE asset total vesting fund.
        total_vesting_shares: VESTS asset total vesting shares.

    Returns:
        NaiAsset: Calculated votes in nai asset form.

    Raises:
         UnknownAssetTypeError/CannotCreateAssetError/AssertionError: When passed asset is incorrect.
    """
create_transaction_from_json abstractmethod
create_transaction_from_json(transaction: JsonTransaction) -> ITransaction

Creates transaction object from JSON transaction.

Parameters:

Name Type Description Default
transaction
JsonTransaction

JSON transaction object.

required

Returns:

Type Description
ITransaction

Transaction object

Raises:

Type Description
WaxValidationFailedError

When the transaction is incorrect.

Source code in wax/interfaces.py
630
631
632
633
634
635
636
637
638
639
640
641
642
643
@abstractmethod
def create_transaction_from_json(self, transaction: JsonTransaction) -> ITransaction:
    """
    Creates transaction object from JSON transaction.

    Args:
        transaction: JSON transaction object.

    Returns:
        Transaction object

    Raises:
        WaxValidationFailedError: When the transaction is incorrect.
    """
create_transaction_from_proto abstractmethod
create_transaction_from_proto(transaction: ProtoTransaction) -> ITransaction

Creates transaction object from proto transaction.

Parameters:

Name Type Description Default
transaction
ProtoTransaction

Proto transaction object.

required

Returns:

Type Description
ITransaction

Transaction object

Source code in wax/interfaces.py
618
619
620
621
622
623
624
625
626
627
628
@abstractmethod
def create_transaction_from_proto(self, transaction: ProtoTransaction) -> ITransaction:
    """
    Creates transaction object from proto transaction.

    Args:
        transaction: Proto transaction object.

    Returns:
        Transaction object
    """
create_transaction_with_tapos abstractmethod
create_transaction_with_tapos(tapos_block_id: str, expiration: TTimestamp | None = None) -> ITransaction

Creates transaction object using basic information from chain.

Parameters:

Name Type Description Default
tapos_block_id
str

Block id (mostly head) that transaction should refer to

required
expiration
TTimestamp | None

time (UTC) till transaction is valid. Default to +1 minute.

None

Returns:

Type Description
ITransaction

Transaction object

Source code in wax/interfaces.py
605
606
607
608
609
610
611
612
613
614
615
616
@abstractmethod
def create_transaction_with_tapos(self, tapos_block_id: str, expiration: TTimestamp | None = None) -> ITransaction:
    """
    Creates transaction object using basic information from chain.

    Args:
        tapos_block_id: Block id (mostly head) that transaction should refer to
        expiration: time (UTC) till transaction is valid. Default to +1 minute.

    Returns:
        Transaction object
    """
estimate_hive_collateral abstractmethod

Estimate hive collateral.

Parameters:

Name Type Description Default
current_median_history_base
HbdNaiAssetConvertible

Base for Current median price retrieved by get_feed_history

required
current_median_history_quote
HiveNaiAssetConvertible

Quote for Current median price retrieved by get_feed_history

required
current_min_history_base
HbdNaiAssetConvertible

Base for Current minimal price retrieved by get_feed_history

required
current_min_history_quote
HiveNaiAssetConvertible

Quote for Current minimal price retrieved by get_feed_history

required
hbd_amount_to_get
HbdNaiAssetConvertible

HBD amount to get.

required

Returns:

Name Type Description
NaiAsset NaiAsset

Estimated HIVE collateral.

Raises:

Type Description
CannotCreateAssetError / UnknownAssetTypeError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
@abstractmethod
def estimate_hive_collateral(
    self,
    current_median_history_base: HbdNaiAssetConvertible,
    current_median_history_quote: HiveNaiAssetConvertible,
    current_min_history_base: HbdNaiAssetConvertible,
    current_min_history_quote: HiveNaiAssetConvertible,
    hbd_amount_to_get: HbdNaiAssetConvertible,
) -> NaiAsset:
    """
    Estimate hive collateral.

    Args:
        current_median_history_base: Base for Current median price retrieved by `get_feed_history`
        current_median_history_quote: Quote for Current median price retrieved by `get_feed_history`
        current_min_history_base: Base for Current minimal price retrieved by `get_feed_history`
        current_min_history_quote:  Quote for Current minimal price retrieved by `get_feed_history`
        hbd_amount_to_get: HBD amount to get.

    Returns:
        NaiAsset: Estimated HIVE collateral.

    Raises:
        CannotCreateAssetError/UnknownAssetTypeError/AssertionError: When passed asset is incorrect.
    """
get_operation_impacted_accounts abstractmethod staticmethod
get_operation_impacted_accounts(operation: Operation) -> list[AccountName]

Retrieves the list of account names (not authorities!) that are impacted by a given operation.

Parameters:

Name Type Description Default
operation
Operation

Operation in HF26 format or proto operation.

required

Returns:

Type Description
list[AccountName]

list[AccountName]: list of account names impacted in operation.

Raises:

Type Description
(InvalidOperationFormatError, WaxValidationFailedError)

When operation is incorrect.

Source code in wax/interfaces.py
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
@staticmethod
@abstractmethod
def get_operation_impacted_accounts(operation: Operation) -> list[AccountName]:
    """
    Retrieves the list of account names (not authorities!) that are impacted by a given operation.

    Args:
        operation: Operation in HF26 format or proto operation.

    Returns:
        list[AccountName]: list of account names impacted in operation.

    Raises:
        InvalidOperationFormatError, WaxValidationFailedError: When operation is incorrect.
    """
get_private_key_from_password abstractmethod staticmethod
get_private_key_from_password(account: AccountName, role: str, password: str) -> IPrivateKeyData

Returns private key data.

Parameters:

Name Type Description Default
account
AccountName

Account name.

required
role
str

active | owner | posting | memo.

required
password
str

the Master Password to derive key from.

required

Returns:

Name Type Description
PrivateKeyData IPrivateKeyData

generated private key along with the associated public key in WIF format.

Source code in wax/interfaces.py
454
455
456
457
458
459
460
461
462
463
464
465
466
467
@staticmethod
@abstractmethod
def get_private_key_from_password(account: AccountName, role: str, password: str) -> IPrivateKeyData:
    """
    Returns private key data.

    Args:
        account: Account name.
        role: active | owner | posting | memo.
        password: the Master Password to derive key from.

    Returns:
        PrivateKeyData: generated private key along with the associated public key in WIF format.
    """
get_public_key_from_signature abstractmethod staticmethod
get_public_key_from_signature(sig_digest: Hex, signature: Signature) -> PublicKey

Retrieves the public key in wif format from the given sig digest and signature in hexadecimal format.

Parameters:

Name Type Description Default
sig_digest
Hex

Digest data in hexadecimal format.

required
signature
Signature

Signature in hexadecimal format.

required

Returns:

Name Type Description
PublicKey PublicKey

Public key used in the signature

Raises:

Type Description
WaxValidationFailedError

When passed parameters are wrong.

Source code in wax/interfaces.py
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
@staticmethod
@abstractmethod
def get_public_key_from_signature(sig_digest: Hex, signature: Signature) -> PublicKey:
    """
    Retrieves the public key in wif format from the given sig digest and signature in hexadecimal format.

    Args:
        sig_digest: Digest data in hexadecimal format.
        signature: Signature in hexadecimal format.

    Returns:
        PublicKey: Public key used in the signature

    Raises:
        WaxValidationFailedError: When passed parameters are wrong.
    """
hbd_to_hive abstractmethod

Converts given HBD into HIVE, both in nai form.

Parameters:

Name Type Description Default
hbd
HbdNaiAssetConvertible

HBD asset to be converted.

required
base
HbdNaiAssetConvertible

HBD asset price base.

required
quote
HiveNaiAssetConvertible

HIVE asset price quote.

required

Returns:

Name Type Description
NaiAsset NaiAsset

asset converted asset into HIVE.

Raises:

Type Description
UnknownAssetTypeError / CannotCreateAssetError / AssertionError

When passed asset it is incorrect.

Source code in wax/interfaces.py
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
@abstractmethod
def hbd_to_hive(
    self, hbd: HbdNaiAssetConvertible, base: HbdNaiAssetConvertible, quote: HiveNaiAssetConvertible
) -> NaiAsset:
    """
    Converts given HBD into HIVE, both in nai form.

    Args:
        hbd: HBD asset to be converted.
        base: HBD asset price base.
        quote: HIVE asset price quote.

    Returns:
        NaiAsset: asset converted asset into HIVE.

    Raises:
        UnknownAssetTypeError/CannotCreateAssetError/AssertionError: When passed asset it is incorrect.
    """
hive_to_hbd abstractmethod

Converts given HIVE into HBD, both in nai form.

Parameters:

Name Type Description Default
hive
HiveNaiAssetConvertible

HIVE asset to be converted.

required
base
HbdNaiAssetConvertible

HBD asset price base.

required
quote
HiveNaiAssetConvertible

HIVE asset price quote.

required

Returns:

Name Type Description
NaiAsset NaiAsset

converted asset into HBD.

Raises:

Type Description
UnknownAssetTypeError / CannotCreateAssetError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
@abstractmethod
def hive_to_hbd(
    self, hive: HiveNaiAssetConvertible, base: HbdNaiAssetConvertible, quote: HiveNaiAssetConvertible
) -> NaiAsset:
    """
    Converts given HIVE into HBD, both in nai form.

    Args:
        hive: HIVE asset to be converted.
        base: HBD asset price base.
        quote: HIVE asset price quote.

    Returns:
        NaiAsset: converted asset into HBD.

    Raises:
        UnknownAssetTypeError/CannotCreateAssetError/AssertionError: When passed asset is incorrect.
    """
is_valid_account_name abstractmethod staticmethod
is_valid_account_name(account_name: AccountName) -> bool

Checks if the given account name is valid.

Parameters:

Name Type Description Default
account_name
AccountName

Account name to be checked.

required

Returns:

Name Type Description
bool bool

True if the account name is valid, False otherwise.

Source code in wax/interfaces.py
294
295
296
297
298
299
300
301
302
303
304
305
@staticmethod
@abstractmethod
def is_valid_account_name(account_name: AccountName) -> bool:
    """
    Checks if the given account name is valid.

    Args:
        account_name: Account name to be checked.

    Returns:
        bool: True if the account name is valid, False otherwise.
    """
suggest_brain_key abstractmethod staticmethod
suggest_brain_key() -> IBrainKeyData

Returns brain key data.

Returns:

Name Type Description
BrainKeyData IBrainKeyData
  • brain key: a string containing space separated list of N words generated as a brain key (atm 16)
  • wif private key: first private key derived from above specified brain key
  • associated public key: base58 string pointing the public key associated to the private key
Source code in wax/interfaces.py
441
442
443
444
445
446
447
448
449
450
451
452
@staticmethod
@abstractmethod
def suggest_brain_key() -> IBrainKeyData:
    """
    Returns brain key data.

    Returns:
        BrainKeyData:
            * brain key: a string containing space separated list of N words generated as a brain key (atm 16)
            * wif private key: first private key derived from above specified brain key
            * associated public key: base58 string pointing the public key associated to the private key
    """
vests_to_hp abstractmethod

Converts given VESTS into HP, both in nai form.

Parameters:

Name Type Description Default
vests
VestsNaiAssetConvertible

VESTS asset.

required
total_vesting_fund_hive
HiveNaiAssetConvertible

HIVE asset total vesting fund.

required
total_vesting_shares
VestsNaiAssetConvertible

VESTS asset total vesting shares.

required

Returns:

Name Type Description
NaiAsset NaiAsset

converted asset into HP (HIVE).

Raises:

Type Description
CannotCreateAssetError / UnknownAssetTypeError / AssertionError

When passed asset is incorrect.

Source code in wax/interfaces.py
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
@abstractmethod
def vests_to_hp(
    self,
    vests: VestsNaiAssetConvertible,
    total_vesting_fund_hive: HiveNaiAssetConvertible,
    total_vesting_shares: VestsNaiAssetConvertible,
) -> NaiAsset:
    """
    Converts given VESTS into HP, both in nai form.

    Args:
        vests: VESTS asset.
        total_vesting_fund_hive: HIVE asset total vesting fund.
        total_vesting_shares: VESTS asset total vesting shares.

    Returns:
        NaiAsset: converted asset into HP (HIVE).

    Raises:
        CannotCreateAssetError/UnknownAssetTypeError/AssertionError: When passed asset is incorrect.
    """

models

asset

AnyNaiAssetConvertible module-attribute

Type alias for types convertible to any of the HIVE, HBD, or VESTS nai formats.

AssetAmount module-attribute
AssetAmount: TypeAlias = int | float | Decimal

Type alias for an number that can be used as an amount of an asset.

HbdNaiAssetConvertible module-attribute
HbdNaiAssetConvertible: TypeAlias = NaiAsset | dict[str, str | int] | str

Type alias for types convertible to Hbd nai format.

HiveNaiAssetConvertible module-attribute
HiveNaiAssetConvertible: TypeAlias = NaiAsset | dict[str, str | int] | str

Type alias for types convertible to Hive nai format.

NaiAsset module-attribute
NaiAsset: TypeAlias = asset

Type alias for an asset in nai format (hf26).

VestsNaiAssetConvertible module-attribute
VestsNaiAssetConvertible: TypeAlias = NaiAsset | dict[str, str | int] | str

Type alias for types convertible to Vests nai format.

AssetFactory

Bases: Protocol

coins staticmethod

Returns asset in nai/HF26 format with given amount.

Please notice that this function works with precision!

Parameters:

Name Type Description Default
amount AssetAmount

amount of the asset.

required

Returns:

Name Type Description
NaiAsset NaiAsset

asset in nai form.

Raises:

Type Description
DecimalConversionNotANumberError

Raised when given amount is in invalid format.

Source code in wax/models/asset.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@staticmethod
def coins(amount: AssetAmount) -> NaiAsset:
    """
    Returns asset in nai/HF26 format with given amount.

    Please notice that this function works with precision!

    Args:
        amount: amount of the asset.

    Returns:
        NaiAsset: asset in nai form.

    Raises:
        DecimalConversionNotANumberError: Raised when given amount is in invalid format.
    """
satoshis staticmethod
satoshis(amount: int) -> NaiAsset

Returns asset in nai/HF26 format with given amount.

Please notice that this function works without precision and accept only integers!

Parameters:

Name Type Description Default
amount int

amount of the asset.

required

Returns:

Name Type Description
NaiAsset NaiAsset

asset in nai form.

Raises:

Type Description
TypeError

If given amount is not integer.

Source code in wax/models/asset.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@staticmethod
def satoshis(amount: int) -> NaiAsset:
    """
    Returns asset in nai/HF26 format with given amount.

    Please notice that this function works without precision and accept only integers!

    Args:
        amount: amount of the asset.

    Returns:
        NaiAsset: asset in nai form.

    Raises:
        TypeError: If given amount is not integer.
    """
AssetInfo dataclass
AssetInfo(nai: str, precision: int)

Represents information about an asset.

AssetName

Bases: Enum

Enum representing the names of assets in the Hive blockchain.

authority

AccountAuths module-attribute
AccountAuths: TypeAlias = dict[AccountName, int]

AccountAuths is a type alias for a dictionary mapping account names to their weight in the authority structure.

KeyAuths module-attribute
KeyAuths: TypeAlias = dict[PublicKey, int]

KeyAuths is a type alias for a dictionary mapping public keys to their weight in the authority structure.

WaxAuthority module-attribute
WaxAuthority: TypeAlias = authority

Type alias for one of the authorities used in wax.

ITransactionRequiredAuthorities

Bases: ABC

Interface for transaction required authorities.

active_accounts abstractmethod property
active_accounts: set[AccountName]

Get required active accounts.

other_authorities abstractmethod property
other_authorities: list[WaxAuthority]

Get required other authorities.

owner_accounts abstractmethod property
owner_accounts: set[AccountName]

Get required owner accounts.

posting_accounts abstractmethod property
posting_accounts: set[AccountName]

Get required posting accounts.

WaxAccountAuthorityInfo dataclass
WaxAccountAuthorityInfo(account: AccountName, authorities: WaxAuthorities, memo_key: PublicKey, last_owner_update: HiveDateTime, previous_owner_update: HiveDateTime)

Represents the authority information for an account.

WaxAuthorities dataclass
WaxAuthorities(owner: WaxAuthority | None = None, active: WaxAuthority | None = None, posting: WaxAuthority | None = None)

Represents the authorities available when using wax.

basic

AccountName module-attribute
AccountName: TypeAlias = str

AccountName is a type alias for the name of an account on the Hive blockchain.

ChainId module-attribute
ChainId: TypeAlias = Hex

ChainId is a type alias for the chain identifier of the Hive blockchain.

HeadBlockId module-attribute
HeadBlockId: TypeAlias = Hex

HeadBlockId is a type alias for the identifier of the head block.

Hex module-attribute
Hex: TypeAlias = str

Hex is a type alias for a hexadecimal string.

PublicKey module-attribute
PublicKey: TypeAlias = str

PublicKey is a type alias for a public key in the Hive blockchain.

SigDigest module-attribute
SigDigest: TypeAlias = Hex

SigDigest is a type alias for the signature digest of a transaction.

Signature module-attribute
Signature: TypeAlias = Hex

Signature is a type alias for a hexadecimal string representing a signature.

TransactionId module-attribute
TransactionId: TypeAlias = Hex

TransactionId is a type alias for the identifier of a transaction.

ChainReferenceData dataclass
ChainReferenceData(time: HiveDateTime, head_block_id: HeadBlockId = '')

Data that is used to reference the chain.

key_data

IBrainKeyData

Bases: IPrivateKeyData, ABC

Interface for brain key data.

brain_key abstractmethod property
brain_key: str

Get brain key.

IPrivateKeyData

Bases: ABC

Interface for private key data.

associated_public_key abstractmethod property
associated_public_key: str

Get associated public key.

wif_private_key abstractmethod property
wif_private_key: str

Get WIF private key.

operations

Operation module-attribute

Either a proto or a protocol(hf26) operation.

ProtoOperation module-attribute
ProtoOperation: TypeAlias = dict[str, Any] | str | Message

ProtoOperation is a type alias for a type that can be converted to a proto message.

ProtocolOperation module-attribute
ProtocolOperation: TypeAlias = dict[str, Any] | str

ProtocolOperation is a type alias for the operation in the protocol (hf26) format.

WaxMetaOperation module-attribute
WaxMetaOperation: TypeAlias = Message | OperationBase

WaxMetaOperation is a type alias for a protobuf message or an OperationBase instance.

proto

operations

account_create
account_create(*, fee: asset | None = ..., creator: str | None = ..., new_account_name: str | None = ..., owner: authority | None = ..., active: authority | None = ..., posting: authority | None = ..., memo_key: str | None = ..., json_metadata: str | None = ...)

Bases: Message

A new account may be created only by an existing account. The account that creates a new account pays a fee. The fee amount is set by the witnesses.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/09_account_create.md?ref_type=heads&plain=0&blame=1#2-parameters

active property
active: authority

@param {authority} active

creator instance-attribute
creator: str

@param {string} creator - An account that creates a new account.

fee property
fee: asset

@param {asset} fee - Paid by creator. The witnesses decide the amount of the fee. Now, it is 3 HIVE.

json_metadata instance-attribute
json_metadata: str

@param {string} json_metadata

memo_key instance-attribute
memo_key: str

@param {string} memo_key - Not authority, public memo key.

new_account_name instance-attribute
new_account_name: str

@param {string} new_account_name - Valid account name may consist of many parts separated by a dot, total may have up to 16 characters, parts have to start from a letter, may be followed by numbers, or '-'.

owner property
owner: authority

@param {authority} owner

posting property
posting: authority

@param {authority} posting

account_create_with_delegation
account_create_with_delegation(*, fee: asset | None = ..., delegation: asset | None = ..., creator: str | None = ..., new_account_name: str | None = ..., owner: authority | None = ..., active: authority | None = ..., posting: authority | None = ..., memo_key: str | None = ..., json_metadata: str | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

Deprecated.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/41_account_create_with_delegation.md?ref_type=heads

account_update
account_update(*, account: str | None = ..., owner: authority | None = ..., active: authority | None = ..., posting: authority | None = ..., memo_key: str | None = ..., json_metadata: str | None = ...)

Bases: Message

Operations account_update_operation and account_update2_operation share a limit of allowed updates of the owner authority: two executions per 60 minutes (HIVE_OWNER_UPDATE_LIMIT) (meaning each of them can be executed twice or both can be executed once during that time period). After 30 days (HIVE_OWNER_AUTH_RECOVERY_PERIOD) using the account recovery process to change the owner authority is no longer possible. The operation account_update_operation allows changing authorities, it doesn’t allow changing the posting_json_metadata.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/10_account_update.md?ref_type=heads

account instance-attribute
account: str

@param {string} account - Account name, it cannot be updated.

active property
active: authority

@param {authority} active - In order to update the {active}, the active authority is required. If a user provides a new authority, the old one will be deleted.

json_metadata instance-attribute
json_metadata: str

@param {string} json_metadata - json_string; in order to update the {json_metadata}, the active authority is required.

memo_key instance-attribute
memo_key: str

@param {string} memo_key - In order to update the {memo_key}, active authority is required. If a user provides a new key, the old one will be deleted.

owner property
owner: authority

@param {authority} owner - In order to update the {owner}, the owner authority is required. It may be changed 2 times per hour. If a user provides a new authority, the old one will be deleted, but the deleted authority may be used up to 30 days in the process of the recovery account.

posting property
posting: authority

@param {authority} posting - In order to update the {posting}, the active authority is required. If a user provides a new authority, the old one will be deleted.

account_update2
account_update2(*, account: str | None = ..., owner: authority | None = ..., active: authority | None = ..., posting: authority | None = ..., memo_key: str | None = ..., json_metadata: str | None = ..., posting_json_metadata: str | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

There are two operations that allow updating an account data: account_update_operation and account_update2_operation. Operations account_update_operation and account_update2_operation share a limit of allowed updates of the owner authority - two executions per 60 minutes (HIVE_OWNER_UPDATE_LIMIT) - meaning each of them can be executed twice or both can be executed once during that time period. After 30 days (HIVE_OWNER_AUTH_RECOVERY_PERIOD) using the account recovery process to change the owner authority is no longer possible. The operation allows to update authority, json_metadata and the posting_json_metadata. Depending on what the user wants to change, a different authority has to be used. Each authority (owner, active, posting, memo_key) consists of: - weight_threshold - key or account name with its weight The authority may have more than one key and more than one assigned account name.

@example Example 1: The posting authority: weight_threshold = 1 'first_key', weight = 1 'second_key', weight = 1 'account_name_1', weight = 1 The above settings mean that a user with 'first_key', a user with 'second_key' or a user 'account_name_1' may post on behalf of this account.

@example Example 2: The posting authority: weight_threshold = 2 'first_key', weight = 1 'second_key', weight = 1 'account_name_1', weight = 1 The above settings mean that at least two signatures are needed to post on behalf of this account.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/43_account_update2.md?ref_type=heads

account instance-attribute
account: str

@param {string} account - Account name, it cannot be updated.

active property
active: authority

@param {authority} active - Optional. In order to update the {active}, the active authority is required. If a user provides a new authority, the old one will be deleted.

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions

json_metadata instance-attribute
json_metadata: str

@param {string} json_metadata - json_string; In order to update the {json_metadata}, the active authority is required.

memo_key instance-attribute
memo_key: str

@param {string} memo_key - Optional. In order to update the {memo_key}, the active authority is required. If a user provides a new key, the old one will be deleted.

owner property
owner: authority

@param {authority} owner - Optional. In order to update the {owner}, the owner authority is required. It may be changed 2 times per hour. If a user provides a new authority, the old one will be deleted.

posting property
posting: authority

@param {authority} posting - Optional. In order to update the {posting}, the active authority is required. If a user provides a new authority, the old one will be deleted.

posting_json_metadata instance-attribute
posting_json_metadata: str

@param {string} posting_json_metadata - json_string; In order to update the { posting_json_metadata }, the posting authority is required.

account_witness_proxy
account_witness_proxy(*, account: str | None = ..., proxy: str | None = ...)

Bases: Message

A user may vote for a witness or proposal directly (using an operation: account_witness_vote_operation or update_proposal_votes_operation) or indirectly (using the proxy - operation: account_witness_proxy_operation). If a user sets a proxy, the witness votes are removed and the proposal votes are deactivated. If a user removes a proxy, there are no witness votes and the proposal votes are activated. Settings proxy means that a user wants to cede a decision on which witnesses to vote for to an account indicated as {proxy}. {proxy} will also vote for proposals in the name of {account}. If the operation account_witness_vote_operation or account_witness_proxy_operation or update_proposal_votes_operation is not executed in HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD, the votes are removed and the virtual operation: expired_account_notification_operation is generated. If the proxy was set and now it is removed, the additionally the virtual operation: proxy_cleared_operation is generated.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/13_account_witness_proxy.md?ref_type=heads

account instance-attribute
account: str

@param {string} account

proxy instance-attribute
proxy: str

@param {string} proxy - Account name. To remove the proxy, the parameter should be set empty. Only one proxy may be set for an account.

account_witness_vote
account_witness_vote(*, account: str | None = ..., witness: str | None = ..., approve: bool | None = ...)

Bases: Message

A user may vote for a witness directly using an operation: account_witness_vote_operation or indirectly using the proxy - operation: account_witness_proxy_operation. All accounts with a Hive Power (also called Vesting Fund Shares or VESTS) can vote for up to 30 witnesses, but you cannot vote twice for the same witnesses. If a proxy is specified then all existing votes are removed. Your vote power depends on your HP. If the operation account_witness_vote_operation or account_witness_proxy_operation or update_proposal_votes_operation is not executed in a HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD, the votes are removed and the virtual operation: expired_account_notification_operation is generated.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/12_account_witness_vote.md?ref_type=heads

account instance-attribute
account: str

@param {string} account

approve instance-attribute
approve: bool

@param {bool} approve - To vote for the witness, the approve = true. To remove the vote, the approve = false.

witness instance-attribute
witness: str

@param {string} witness - Witness account.

cancel_transfer_from_savings
cancel_transfer_from_savings(*, from_account: str | None = ..., request_id: int | None = ...)

Bases: Message

Funds withdrawals from the savings can be canceled at any time before it is executed.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/34_cancel_transfer_from_savings.md?ref_type=heads

from_account instance-attribute
from_account: str

@param {string} from_account

request_id instance-attribute
request_id: int

@param {number} request_id

change_recovery_account
change_recovery_account(*, account_to_recover: str | None = ..., new_recovery_account: str | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

The operation change_recovery_account_operation allows a user to update their recovery account. It is important to keep it actual, because only a recovery account may create a request account recovery in case of compromised the owner authority. By default the recovery account is set to the account creator or it is empty if it was created by temp account or mined. In order to cancel the change_recovery_account_operation, the operation change_recovery_account_operation, the operation should be created with {new_recovery_account} set to the old one. The operation is done with a 30 days (HIVE_OWNER_AUTH_RECOVERY_PERIOD) delay.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/26_change_recovery_account.md?ref_type=heads

account_to_recover instance-attribute
account_to_recover: str

@param {string} account_to_recover

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions

new_recovery_account instance-attribute
new_recovery_account: str

@param {string} new_recovery_account

claim_account
claim_account(*, creator: str | None = ..., fee: asset | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

A user may create a new account using a pair of operations: claim_account_operation and create_claimed_account_operation. After the operation claim_account_operation a user receives a token: pending claimed accounts and later (using operation create_claimed_account_operation) a user may create a new account. After executing the operation claim_account_operation, a new account is not created.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/22_claim_account.md?ref_type=heads

creator instance-attribute
creator: str

@param {string} creator - Account name.

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions - Not currently used.

fee property
fee: asset

@param {asset} fee - The amount of fee for creating a new account is decided by the witnesses. It may be paid in HIVE or in the Recourse Credit (RC). If a user wants to pay a fee in RC, it should be set {fee= 0}.

claim_reward_balance
claim_reward_balance(*, account: str | None = ..., reward_hive: asset | None = ..., reward_hbd: asset | None = ..., reward_vests: asset | None = ...)

Bases: Message

An operation claim_reward_balance_operation is used to transfer previously collected author and/or curation rewards from sub balance for the reward to regular balances. Rewards expressed in Hive and HBD are transferred to liquid balances, rewards in HP increase vesting balance. When claimed, HP rewards are immediately active towards governance voting power (compare with transfer_to_vesting_operation).

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/39_claim_reward_balance.md?ref_type=heads

account instance-attribute
account: str

@param {string} account - Account name.

reward_hbd property
reward_hbd: asset

@param {asset} reward_hbd - The amount of HBD reward to be transferred to liquid balance

reward_hive property
reward_hive: asset

@param {asset} reward_hive - The amount of Hive reward to be transferred to liquid balance.

reward_vests property
reward_vests: asset

@param {asset} reward_vests - The amount of HP reward to be transferred to vesting balance.

collateralized_convert
collateralized_convert(*, owner: str | None = ..., requestid: int | None = ..., amount: asset | None = ...)

Bases: Message

Similar to convert_operation, this operation instructs the blockchain to convert HIVE to HBD. The operation is performed after 3.5 days, but the owner gets HBD immediately. The price risk is cushioned by extra HIVE (HIVE_COLLATERAL_RATIO = 200 % ). After actual conversion takes place the excess HIVE is returned to the owner.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/48_collateralized_convert.md?ref_type=heads

amount property
amount: asset

@param {asset} amount - Amount > 0, have to be in Hive.

owner instance-attribute
owner: str

@param {string} owner - Account name.

requestid instance-attribute
requestid: int

@param {number} requestid - The number is given by a user. Should be unique for a user.

collateralized_convert_immediate_conversion
collateralized_convert_immediate_conversion(*, owner: str | None = ..., requestid: int | None = ..., hbd_out: asset | None = ...)

Bases: Message

Related to collateralized_convert_operation. Generated every time above operation is executed. Contains amount of HBD received right when the transfer actually happens. @see fill_collateralized_convert_request

hbd_out property
hbd_out: asset

@param {asset} hbd_out - (HBD) funds after conversion

owner instance-attribute
owner: str

@param {string} owner - user that requested conversion (receiver of hbd_out)

requestid instance-attribute
requestid: int

@param {number} requested - id of the conversion request

comment
comment(*, parent_author: str | None = ..., parent_permlink: str | None = ..., author: str | None = ..., permlink: str | None = ..., title: str | None = ..., body: str | None = ..., json_metadata: str | None = ...)

Bases: Message

Using comment operation a user may create a post or a comment. From the blockchain point of view, it is the same operation – always comment. If a comment has no parent, it is a post. The parent of the comment may be a post or a comment. Users may comment their own comments.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/01_comment.md?ref_type=heads

author instance-attribute
author: str

@param {string} author - Account name, the author of the post or the comment. It cannot be modified.

body instance-attribute
body: str

@param {string} body - The content of the post or the comment. It may be modified.

json_metadata instance-attribute
json_metadata: str

@param {string} json_metadata - There is no blockchain validation on json_metadata, but the structure has been established by the community. From the blockchain point of view it is a json file. For the second layer, the following keys may be used: - app, e.g. peakd/2023.2.3 - format, e.g. markdown - tags, e.g. photography - users - images

parent_author instance-attribute
parent_author: str

@param {string} parent_author - Account name, the author of the commented post or comment. If the operation creates a post, it is empty. It cannot be modified.

parent_permlink: str

@param {string} parent_permlink - The identifier of the commented post or comment. When a user creates a post, it may contain the identifier of the community (e.g. hive-174695) or main tag (e.g. travel). It cannot be modified.

permlink: str

@param {string} permlink - Unique to the author, the identifier of the post or comment. It cannot be modified.

title instance-attribute
title: str

@param {string} title - The title of the submitted post, in case of the comment, is often empty. It may be modified.

comment_options
comment_options(*, author: str | None = ..., permlink: str | None = ..., max_accepted_payout: asset | None = ..., percent_hbd: int | None = ..., allow_votes: bool | None = ..., allow_curation_rewards: bool | None = ..., extensions: Iterable[global___comment_options_extension] | None = ...)

Bases: Message

The operation comment_options_operation allows to set properties regarding payouts, rewards or beneficiaries (using {extensions}) for comments. If the operation: comment_options_operation is done by one of the frontends, it is usually in the same transaction with the operation: comment_operation. If a comment has received any votes, only the parameter {percent_hbd} may be changed.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/19_comment_options.md?ref_type=heads

allow_curation_rewards instance-attribute
allow_curation_rewards: bool

@param {bool} allow_curation_rewards - The flag that allows to decide whether the voters for the comment should receive the curation rewards. Rewards return to the reward fund. Default value: allow_curation_rewards = true.

allow_votes instance-attribute
allow_votes: bool

@param {bool} allow_votes - The flag that allows to decide whether the comment may receive a vote. Default value: allow_votes = true.

author instance-attribute
author: str

@param {string} author - Account name, the author of the comment.

extensions property
extensions: RepeatedCompositeFieldContainer[global___comment_options_extension]

@param {comment_options_extension} extensions - It may contain the list of the beneficiaries, the accounts that should receive the author reward. The list consists of the account name and the weight of the shares in the author reward. If the sum of the weights is less than 100%, the rest of the reward is received by the author. It should be defined less than 128 accounts. The allowed range of the weight is from 0 to 10000 (0 – 100%). The beneficiaries should be listed in alphabetical order, no duplicates.

max_accepted_payout property
max_accepted_payout: asset

@param {asset} max_accepted_payout - The maximum value of payout in HBD. Default value: max_accepted_payout = asset( 1000000000, HBD_SYMBOL ). The allowed value should be less than the default value. If max_accepted_payout = 0, then voters and authors will not receive the payout.

percent_hbd instance-attribute
percent_hbd: int

@param {number} percent_hbd - By default the author reward is paid 50% HP and 50 % HBD. In some rare situations, instead of HBD, the Hive may be paid. percent_hbd = HIVE_100_PERCENT means that 100 % of HBD part is paid in HBD. A user may decide how many percent of HBD (from 50 %) they wants to receive in the HBD, the rest will be paid out in HP. Default value: percent_hbd = HIVE_100_PERCENT. The allowed value should be less than the default value. This is the only parameter that can be modified after the comment receives any vote.

convert
convert(*, owner: str | None = ..., requestid: int | None = ..., amount: asset | None = ...)

Bases: Message

This operation instructs the blockchain to start a conversion of HBD to Hive.
The funds are deposited after 3.5 days.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/08_convert.md?ref_type=heads

amount property
amount: asset

@param {asset} amount - Amount > 0, have to be in HBD.

owner instance-attribute
owner: str

@param {string} owner - Account name.

requestid instance-attribute
requestid: int

@param {number} requestid - The number is given by a user. Should be unique for a user.

create_claimed_account
create_claimed_account(*, creator: str | None = ..., new_account_name: str | None = ..., owner: authority | None = ..., active: authority | None = ..., posting: authority | None = ..., memo_key: str | None = ..., json_metadata: str | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

The operation create_claimed_account_operation may be used by the user who has the token. Pending claimed accounts (see claim_account_operation). After executing the operation create_claimed_account_operation, a new account is created.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/23_create_claimed_account.md?ref_type=heads

active property
active: authority

@param {authority} active

creator instance-attribute
creator: str

@param {string} creator - An account who create a new account.

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions - Not currently used.

json_metadata instance-attribute
json_metadata: str

@param {string} json_metadata - Json string.

memo_key instance-attribute
memo_key: str

@param {string} memo_key

new_account_name instance-attribute
new_account_name: str

@param {string} new_account_name - Account name. Valid account name may consist of many parts separated by a dot, total may have up to 16 characters, parts have to start from a letter, may be followed by numbers, or “-“.

owner property
owner: authority

@param {authority} owner

posting property
posting: authority

@param {authority} posting

create_proposal
create_proposal(*, creator: str | None = ..., receiver: str | None = ..., start_date: str | None = ..., end_date: str | None = ..., daily_pay: asset | None = ..., subject: str | None = ..., permlink: str | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

There is a Decentralized Hive Fund (DHF) on the Hive. Users may submit proposals for funding and if the proposal receives enough votes, it will be funded. In order to create a proposal user should create a post first and then marked it as a proposal with the operation create_proposal_operation. User defines when the proposal starts and ends and how many funds need to realize it. The creating proposal costs 10 HBD and additionally 1 HBD for each day over 60 days. The fee goes back to DHF. Every hour all active proposals are processed and taking into consideration a current number of votes payments are done. Accounts can create/remove votes anytime.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/44_create_proposal.md?ref_type=heads

creator instance-attribute
creator: str

@param {string} creator

daily_pay property
daily_pay: asset

@param {asset} daily_pay

end_date instance-attribute
end_date: str

@param {asset} end_date

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions

permlink: str

@param {string} permlink

receiver instance-attribute
receiver: str

@param {string} receiver

start_date instance-attribute
start_date: str

@param {string} start_date

subject instance-attribute
subject: str

@param {string} subject

custom
custom(*, required_auths: Iterable[str] | None = ..., id: int | None = ..., data: str | None = ...)

Bases: Message

There are the following custom operations: custom_operation, custom_json_operation and custom_binary (currently is disabled). The operation: custom_operation provides a generic way to add higher level protocols on top of witness consensus operations.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/15_custom.md?ref_type=heads

data instance-attribute
data: str

@param {string} data

id instance-attribute
id: int

@param {number} id

required_auths property
required_auths: RepeatedScalarFieldContainer[str]

@param {string} required_auths

custom_json
custom_json(*, required_auths: Iterable[str] | None = ..., required_posting_auths: Iterable[str] | None = ..., id: str | None = ..., json: str | None = ...)

Bases: Message

The operation custom_json_operation works similar as custom_operation, but it is designed to be human readable/developer friendly. The custom_json_operation is larger than custom_operation or custom_binary, that is why it costs more RC. It should be signed as required in { required_auths } or { required_posting_auths }. The examples of custom_json_operation: - reblog - muted - pinned - follow

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/18_custom_json.md?ref_type=heads

id instance-attribute
id: str

@param {string} id - Must be less than 32 characters long.

json instance-attribute
json: str

@param {string} json - Must be a proper utf8 JSON string.

required_auths property
required_auths: RepeatedScalarFieldContainer[str]

@param {string} required_auths

required_posting_auths property
required_posting_auths: RepeatedScalarFieldContainer[str]

@param {string} required_posting_auths

decline_voting_rights
decline_voting_rights(*, account: str | None = ..., decline: bool | None = ...)

Bases: Message

Using the operation decline_voting_rights_operation, a user may decide to decline their voting rights – for content, witnesses and proposals. Additionally, a user cannot set a proxy (operation account_witness_proxy_operation). The operation is done with a HIVE_OWNER_AUTH_RECOVERY_PERIOD day delay. After HIVE_OWNER_AUTH_RECOVERY_PERIOD days it is irreversible. During HIVE_OWNER_AUTH_RECOVERY_PERIOD days after creation, the operation may be canceled using the operation declive_voting_rights_operation with {decline = false}.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/36_decline_voting_rights.md?ref_type=heads

account instance-attribute
account: str

@param {string} account - Account name.

decline instance-attribute
decline: bool

@param {bool} decline

delegate_vesting_shares
delegate_vesting_shares(*, delegator: str | None = ..., delegatee: str | None = ..., vesting_shares: asset | None = ...)

Bases: Message

The operation delegate_vesting_shares_operation allows to delegate an amount of { vesting_shares } to an { delegatee } account. The { vesting_shares } are still owned by { delegator }, but the voting rights and resource credit are transferred. A user may not delegate: - the vesting shares that are already delegated - the delegated vesting shares to him (a user does not own them) - the vesting shares in the Power down process - the already used voting shares for voting or downvoting In order to remove the vesting shares delegation, the operation delegate_vesting_shares_operation should be created with {vesting_shares = 0}. When a delegation is removed, the delegated vesting shares are frozen for five days (HIVE_DELEGATION_RETURN_PERIOD_HF20) to prevent voting twice.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/40_delegate_vesting_shares.md?ref_type=heads

delegatee instance-attribute
delegatee: str

@param {string} delegatee - The account receiving vesting shares.

delegator instance-attribute
delegator: str

@param {string} delegator - The account delegating vesting shares.

vesting_shares property
vesting_shares: asset

@param {asset} vesting_shares - The amount of vesting shares to be delegated. Minimal amount = 1/3 of the fee for creating a new account.

delete_comment
delete_comment(*, author: str | None = ..., permlink: str | None = ...)

Bases: Message

The post or comment may be deleted by the author. If the post or comment is deleted, the {permlink} may be reused. The delete doesn’t mean that the comment is removed from the blockchain.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/17_delete_comment.md?ref_type=heads

author instance-attribute
author: str

@param {string} author - Account name, the author of the post or the comment.

permlink: str

@param {string} permlink - The identifier of the post or the comment.

effective_comment_vote
effective_comment_vote(*, voter: str | None = ..., author: str | None = ..., permlink: str | None = ..., weight: int | None = ..., rshares: int | None = ..., total_vote_weight: int | None = ..., pending_payout: asset | None = ...)

Bases: Message

Related to vote_operation. Generated every time vote is cast for the first time or edited, but only as long as it is effective, that is, the target comment was not yet cashed out.

author instance-attribute
author: str

@param {string} author - author of comment voted on

pending_payout property
pending_payout: asset

@param {asset} pending_payout - (HBD) estimated reward on target comment; supplemented by AH RocksDB plugin

permlink: str

@param {string} permlink - permlink of comment voted on

rshares instance-attribute
rshares: int

@param {number} rshares - power of the vote

total_vote_weight instance-attribute
total_vote_weight: int

@param {number} total_vote_weight - sum of all vote weights on the target comment in the moment of casting current vote

voter instance-attribute
voter: str

@param {string} voter - account that casts a vote

weight instance-attribute
weight: int

@param {number} weight - weight of vote depending on when vote was cast and with what power

escrow_approve
escrow_approve(*, from_account: str | None = ..., to_account: str | None = ..., agent: str | None = ..., who: str | None = ..., escrow_id: int | None = ..., approve: bool | None = ...)

Bases: Message

The operation escrow_approve_operation is used to approve the escrow. The approval should be done by { to } and by the { agent }. The escrow approval is irreversible. If { agent } or { to } haven’t approved the escrow before the { ratification_deadline} or either of them explicitly rejected the escrow, the escrow is rejected. If {agent} and {to} have approved the escrow, the {fee} is transferred from temporary balance to {agent} account.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/31_escrow_approve.md?ref_type=heads

agent instance-attribute
agent: str

@param {string} agent - Account name.

approve instance-attribute
approve: bool

@param {bool} approve - approve = true; (approve = false explicitly rejects the escrow)

escrow_id instance-attribute
escrow_id: int

@param {number} escrow_id - Escrow identifier.

from_account instance-attribute
from_account: str

@param {string} from_account - Account name.

to_account instance-attribute
to_account: str

@param {string} to_account - Account name.

who instance-attribute
who: str

@param {string} who - Account name. Either {to} or {agent}.

escrow_dispute
escrow_dispute(*, from_account: str | None = ..., to_account: str | None = ..., agent: str | None = ..., who: str | None = ..., escrow_id: int | None = ...)

Bases: Message

The operation escrow_dispute_operation is used to raise the dispute. It may be used by { from } or { to } accounts. If there is a dispute, only {agent} may release the funds.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/28_escrow_dispute.md?ref_type=heads

agent instance-attribute
agent: str

@param {string} agent - Account name.

escrow_id instance-attribute
escrow_id: int

@param {number} escrow_id - Escrow identifier.

from_account instance-attribute
from_account: str

@param {string} from_account - Account name.

to_account instance-attribute
to_account: str

@param {string} to_account - Account name.

who instance-attribute
who: str

@param {string} who - Account name. Either {to} or {agent}.

escrow_rejected
escrow_rejected(*, from_account: str | None = ..., to_account: str | None = ..., agent: str | None = ..., escrow_id: int | None = ..., hbd_amount: asset | None = ..., hive_amount: asset | None = ..., fee: asset | None = ...)

Bases: Message

Related to escrow_approve_operation and escrow_transfer_operation. Generated when pending escrow transfer is cancelled and user that initiated it receives all the funds back. It can happen with explicit rejection with use of first operation. Can also happen during block processing when either agent or to account failed to approve before ratification deadline. @see escrow_approved

agent instance-attribute
agent: str

@param {string} agent - user that was designated as agent of cancelled escrow transfer

escrow_id instance-attribute
escrow_id: int

@param {number} escrow_id - id of cancelled escrow transfer

fee property
fee: asset

@param {asset} fee - (HIVE of HBD) fee from cancelled escrow transfer (same amount as in escrow_transfer_operation)

from_account instance-attribute
from_account: str

@param {string} from_account - user that initiated escrow transfer (receiver of all the funds)

hbd_amount property
hbd_amount: asset

@param {asset} hbd_amount - (HBD) funds from cancelled escrow transfer (same amount as in escrow_transfer_operation)

hive_amount property
hive_amount: asset

@param {asset} hive_amount - (HIVE) funds from cancelled escrow transfer (same amount as in escrow_transfer_operation)

to_account instance-attribute
to_account: str

@param {string} to_account - user that was target of cancelled escrow transfer

escrow_release
escrow_release(*, from_account: str | None = ..., to_account: str | None = ..., agent: str | None = ..., who: str | None = ..., receiver: str | None = ..., escrow_id: int | None = ..., hbd_amount: asset | None = ..., hive_amount: asset | None = ...)

Bases: Message

The operation is used to release the funds of the escrow. The escrow may be released by { from }, { to } or { agent } – depending on the following conditions: If there is no dispute and escrow has not expired, either party can release funds to the other. If escrow expires and there is no dispute, either party can release funds to either party. If there is a dispute regardless of expiration, the agent can release funds to either party following whichever agreement was in place between the parties.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/29_escrow_release.md?ref_type=heads

agent instance-attribute
agent: str

@param {string} agent - Account name.

escrow_id instance-attribute
escrow_id: int

@param {number} escrow_id - Escrow indicator.

from_account instance-attribute
from_account: str

@param {string} from_account - Account name.

hbd_amount property
hbd_amount: asset

@param {asset} hbd_amount - The amount of HBD to release.

hive_amount property
hive_amount: asset

@param {asset} hive_amount - The amount of HIVE to release.

receiver instance-attribute
receiver: str

@param {string} receiver - The account that should receive funds (might be {from}, might be {to}).

to_account instance-attribute
to_account: str

@param {string} to_account - Account name.

who instance-attribute
who: str

@param {string} who - The account that is attempting to release the funds.

escrow_transfer
escrow_transfer(*, from_account: str | None = ..., to_account: str | None = ..., agent: str | None = ..., escrow_id: int | None = ..., hbd_amount: asset | None = ..., hive_amount: asset | None = ..., fee: asset | None = ..., ratification_deadline: str | None = ..., escrow_expiration: str | None = ..., json_meta: str | None = ...)

Bases: Message

The escrow allows the account { from_account } to send money to an account { to_account } only if the agreed terms will be fulfilled. In case of dispute { agent } may divide the funds between { from } and { to }. The escrow lasts up to { escrow_expiration }. When the escrow is created, the funds are transferred {from} to a temporary account. The funds are on the temporary balance, till the operation escrow_release_operation is created. To create an valid escrow: 1. Sender { from } creates the escrow using the operation: escrow_transfer_operation indicated { to } and { agent }. 2. The { agent } and { to } have up to { ratification_deadline } for approving the escrow using operation: escrow_approve_operation. If there is a dispute, the operation: escrow_dispute_operation should be used. In case of the escrow releases, the operation: escrow_release_operation should be used.

Descritpion https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/27_escrow_transfer.md?ref_type=heads

agent instance-attribute
agent: str

@param {string} agent - Account name.

escrow_expiration instance-attribute
escrow_expiration: str

@param {string} escrow_expiration - See description of escrow_release_operation.

escrow_id instance-attribute
escrow_id: int

@param {number} escrow_id - It is defined by the sender. It should be unique for { from }.

fee property
fee: asset

@param {asset} fee - The fee amount depends on the agent. The fee is paid to the agent when approved.

from_account instance-attribute
from_account: str

@param {string} from_account - Account name.

hbd_amount property
hbd_amount: asset

@param {asset} hbd_amount - Escrow amount.

hive_amount property
hive_amount: asset

@param {asset} hive_amount - Escrow amount.

json_meta instance-attribute
json_meta: str

@param {string} json_meta - json string.

ratification_deadline instance-attribute
ratification_deadline: str

@param {string} ratification_deadline - Time for approval for { to } and { agent }. If the escrow is not approved till { ratification_deadline }, it will be rejected and all funds returned to { from }.

to_account instance-attribute
to_account: str

@param {string} to_account - Account name.

feed_publish
feed_publish(*, publisher: str | None = ..., exchange_rate: price | None = ...)

Bases: Message

This is an operation for witnesses. The witnesses publish the exchange rate between Hive and HBD. Only the exchange rate published by the top 20 witnesses is used to define the exchange rate.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/07_feed_publish.md?ref_type=heads

exchange_rate property
exchange_rate: price

@param {price} exchange_rate - How many HBD the 1 Hive should cost Example: "base":"0.345 HBD","quote":"1.000 HIVE"

publisher instance-attribute
publisher: str

@param {string} publisher - The witness.

limit_order_cancel
limit_order_cancel(*, owner: str | None = ..., orderid: int | None = ...)

Bases: Message

Cancels an order (limit_order_create_operation or limit_order_create2_operation) and returns the balance to the owner.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/06_limit_order_cancel.md?ref_type=heads

orderid instance-attribute
orderid: int

@param {number} orderid - The request_id provided by a user during creating a limit_order_create_operation or limit_order_create2_operation.

owner instance-attribute
owner: str

@param {string} owner

limit_order_create
limit_order_create(*, owner: str | None = ..., orderid: int | None = ..., amount_to_sell: asset | None = ..., min_to_receive: asset | None = ..., fill_or_kill: bool | None = ..., expiration: str | None = ...)

Bases: Message

This operation creates a limit order and matches it against existing open orders. It allows to sell Hive and buy HBD or sell HBD and buy Hive. It is a way for a user to declare they want to sell {amount_to_sell} Hive/HBD for at least {min_to_receive} HBD/Hive. The user may be a taker (if a user creates an order and the order matches some order(s)) or a maker (if a user creates an order and the order doesn’t match and the order is waiting for a match on the market). If there is a partial match, a user may be a taker and maker for the same order. If a taker creates an order for all orders on the market the order(s) that are the best deal for the taker are matched. If there are two orders with the same price, the older one is matched. The operation is used by the markets see: https://wallet.hive.blog/market

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/05_limit_order_create.md?ref_type=heads

amount_to_sell property
amount_to_sell: asset

@param {asset} amount_to_sell

expiration instance-attribute
expiration: str

@param {string} expiration

fill_or_kill instance-attribute
fill_or_kill: bool

@param {bool} fill_or_kill - If fill_or_kill = true, then the operation is executed immediately or it fails (the operation is not added to the block). If fill_or_kill = false, then the order is valid till 'expiration'.

min_to_receive property
min_to_receive: asset

@param {asset} min_to_receive

orderid instance-attribute
orderid: int

@param {number} orderid - an ID assigned by owner, must be unique.

owner instance-attribute
owner: str

@param {string} owner

limit_order_create2
limit_order_create2(*, owner: str | None = ..., orderid: int | None = ..., amount_to_sell: asset | None = ..., fill_or_kill: bool | None = ..., exchange_rate: price | None = ..., expiration: str | None = ...)

Bases: Message

This operation creates a limit order and matches it against existing open orders. It is similar to limit_order_create except it serializes the price rather than calculating it from other fields. It allows to sell Hive and buy HBD or sell HBD and buy Hive. It is a way for a user to declare they wants to sell {amount_to_sell} Hive/HBD for at least {exchange_rate} per HBD/Hive.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/21_limit_order_create2.md?ref_type=heads

amount_to_sell property
amount_to_sell: asset

@param {asset} amount_to_sell

exchange_rate property
exchange_rate: price

@param {price} exchange_rate

expiration instance-attribute
expiration: str

@param {string} expiration

fill_or_kill instance-attribute
fill_or_kill: bool

@param {bool} fill_or_kill - If fill_or_kill = true, then the operation is executed immediately or it fails (the operation is not added to the block). If fill_or_kill = false, then the order is valid till {expiration}.

orderid instance-attribute
orderid: int

@param {number} orderid - an ID assigned by owner, must be unique.

owner instance-attribute
owner: str

@param {string} owner

operation
operation(*, vote_operation: vote | None = ..., comment_operation: comment | None = ..., transfer_operation: transfer | None = ..., transfer_to_vesting_operation: transfer_to_vesting | None = ..., withdraw_vesting_operation: withdraw_vesting | None = ..., limit_order_create_operation: limit_order_create | None = ..., limit_order_cancel_operation: limit_order_cancel | None = ..., feed_publish_operation: feed_publish | None = ..., convert_operation: convert | None = ..., account_create_operation: account_create | None = ..., account_update_operation: account_update | None = ..., witness_update_operation: witness_update | None = ..., account_witness_vote_operation: account_witness_vote | None = ..., account_witness_proxy_operation: account_witness_proxy | None = ..., pow_operation: pow | None = ..., custom_operation: custom | None = ..., witness_block_approve_operation: witness_block_approve | None = ..., delete_comment_operation: delete_comment | None = ..., custom_json_operation: custom_json | None = ..., comment_options_operation: comment_options | None = ..., set_withdraw_vesting_route_operation: set_withdraw_vesting_route | None = ..., limit_order_create2_operation: limit_order_create2 | None = ..., claim_account_operation: claim_account | None = ..., create_claimed_account_operation: create_claimed_account | None = ..., request_account_recovery_operation: request_account_recovery | None = ..., recover_account_operation: recover_account | None = ..., change_recovery_account_operation: change_recovery_account | None = ..., escrow_transfer_operation: escrow_transfer | None = ..., escrow_dispute_operation: escrow_dispute | None = ..., escrow_release_operation: escrow_release | None = ..., pow2_operation: pow2 | None = ..., escrow_approve_operation: escrow_approve | None = ..., transfer_to_savings_operation: transfer_to_savings | None = ..., transfer_from_savings_operation: transfer_from_savings | None = ..., cancel_transfer_from_savings_operation: cancel_transfer_from_savings | None = ..., decline_voting_rights_operation: decline_voting_rights | None = ..., claim_reward_balance_operation: claim_reward_balance | None = ..., delegate_vesting_shares_operation: delegate_vesting_shares | None = ..., account_create_with_delegation_operation: account_create_with_delegation | None = ..., witness_set_properties_operation: witness_set_properties | None = ..., account_update2_operation: account_update2 | None = ..., create_proposal_operation: create_proposal | None = ..., update_proposal_votes_operation: update_proposal_votes | None = ..., remove_proposal_operation: remove_proposal | None = ..., update_proposal_operation: update_proposal | None = ..., collateralized_convert_operation: collateralized_convert | None = ..., recurrent_transfer_operation: recurrent_transfer | None = ..., fill_convert_request_operation: fill_convert_request | None = ..., author_reward_operation: author_reward | None = ..., curation_reward_operation: curation_reward | None = ..., comment_reward_operation: comment_reward | None = ..., liquidity_reward_operation: liquidity_reward | None = ..., interest_operation: interest | None = ..., fill_vesting_withdraw_operation: fill_vesting_withdraw | None = ..., fill_order_operation: fill_order | None = ..., shutdown_witness_operation: shutdown_witness | None = ..., fill_transfer_from_savings_operation: fill_transfer_from_savings | None = ..., hardfork_operation: hardfork | None = ..., comment_payout_update_operation: comment_payout_update | None = ..., return_vesting_delegation_operation: return_vesting_delegation | None = ..., comment_benefactor_reward_operation: comment_benefactor_reward | None = ..., producer_reward_operation: producer_reward | None = ..., clear_null_account_balance_operation: clear_null_account_balance | None = ..., proposal_pay_operation: proposal_pay | None = ..., dhf_funding_operation: dhf_funding | None = ..., hardfork_hive_operation: hardfork_hive | None = ..., hardfork_hive_restore_operation: hardfork_hive_restore | None = ..., delayed_voting_operation: delayed_voting | None = ..., consolidate_treasury_balance_operation: consolidate_treasury_balance | None = ..., effective_comment_vote_operation: effective_comment_vote | None = ..., ineffective_delete_comment_operation: ineffective_delete_comment | None = ..., dhf_conversion_operation: dhf_conversion | None = ..., expired_account_notification_operation: expired_account_notification | None = ..., changed_recovery_account_operation: changed_recovery_account | None = ..., transfer_to_vesting_completed_operation: transfer_to_vesting_completed | None = ..., pow_reward_operation: pow_reward | None = ..., vesting_shares_split_operation: vesting_shares_split | None = ..., account_created_operation: account_created | None = ..., fill_collateralized_convert_request_operation: fill_collateralized_convert_request | None = ..., system_warning_operation: system_warning | None = ..., fill_recurrent_transfer_operation: fill_recurrent_transfer | None = ..., failed_recurrent_transfer_operation: failed_recurrent_transfer | None = ..., limit_order_cancelled_operation: limit_order_cancelled | None = ..., producer_missed_operation: producer_missed | None = ..., proposal_fee_operation: proposal_fee | None = ..., collateralized_convert_immediate_conversion_operation: collateralized_convert_immediate_conversion | None = ..., escrow_approved_operation: escrow_approved | None = ..., escrow_rejected_operation: escrow_rejected | None = ..., proxy_cleared_operation: proxy_cleared | None = ..., declined_voting_rights_operation: declined_voting_rights | None = ...)

Bases: Message

NOTE: do not change the order of any operations prior to the virtual operations or it will trigger a hardfork.

fill_convert_request_operation property
fill_convert_request_operation: fill_convert_request

Virtual operations:

recover_account
recover_account(*, account_to_recover: str | None = ..., new_owner_authority: authority | None = ..., recent_owner_authority: authority | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

This operation is part of the recovery account process (more information in request_account_recovery). After creating by recovery account the operation request_account_recovery, the user has HIVE_ACCOUNT_RECOVERY_REQUEST_EXPIRATION_PERIOD hours to respond using operation recover_account_operation and set a new owner authority. The operation recover_account_operation has to be signed using the two owner authorities, the old one (maybe compromised) and the new one (see request_account_recovery). There must be at least 60 minutes (HIVE_OWNER_UPDATE_LIMIT) between executions of operation recover_account_operation.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/25_recover_account.md?ref_type=heads

account_to_recover instance-attribute
account_to_recover: str

@param {string} account_to_recover - The account to be recovered.

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions - Not currently used.

new_owner_authority property
new_owner_authority: authority

@param {authority} new_owner_authority - The new owner authority as specified in the request account recovery operation.

recent_owner_authority property
recent_owner_authority: authority

@param {authority} recent_owner_authority - A previous owner's authority, may be compromised. If the operation change_recovery_account_operation was generated, it has not been yet 30 days since its creation.

recurrent_transfer
recurrent_transfer(*, from_account: str | None = ..., to_account: str | None = ..., amount: asset | None = ..., memo: str | None = ..., recurrence: int | None = ..., executions: int | None = ..., extensions: Iterable[recurrent_transfer_extension] | None = ...)

Bases: Message

Creates/updates/removes a recurrent transfer in the currency Hive or HBD. Since HF 28, if user has more than one recurrent transfer to the same receiver or if user creates the recurrent transfer using pair_id in the extensions, user has to specify the pair_id in order to update or remove the defined recurrent transfer. - If amount is set to 0, the recurrent transfer will be deleted and the virtual operation fill_recurrent_transfer_operation is not generated - If there is already a recurrent transfer matching 'from' and 'to', the recurrent transfer will be replaced, but: - If the 'recurrence' is not changed, the next execution will be according to “old definition” - If the 'recurrence' is changed, then the next execution will be “update date” + 'recurrence' there is no execution on the update date. - Up to HF28 there can be only one recurrent transfer for sender 'from' and receiver 'to'. Since H28 users may define more recurrent transfers to the same sender and receiver using pair_id in the 'executions'. - The one account may define up to 255 recurrent transfers to other accounts. - The execution date of the last transfer should be no more than 730 days in the future.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/49_recurrent_transfer.md?ref_type=heads

amount property
amount: asset

@param {asset} amount - The amount of asset to transfer from @ref from to @ref to. If the recurrent transfer failed 10 (HIVE_MAX_CONSECUTIVE_RECURRENT_TRANSFER_FAILURES) times because of the lack of funds, the recurrent transfer will be deleted. Allowed currency: Hive and HBD.

executions instance-attribute
executions: int

@param {number} executions - How many times the recurrent payment will be executed. Executions must be at least 2, if you set executions to 1 the recurrent transfer will not be executed.

extensions property
extensions: RepeatedCompositeFieldContainer[recurrent_transfer_extension]

@param {recurrent_transfer_extension} extensions - Extensions. Since HF 28 it may contain the 'pair_id'. It allows to define more than one recurrent transfer from sender to the same receiver 'to'. Default value 'pair_id=0'.

from_account instance-attribute
from_account: str

@param {string} from_account

memo instance-attribute
memo: str

@param {string} memo - must be shorter than 2048.

recurrence instance-attribute
recurrence: int

@param {number} recurrence - How often will the payment be triggered, unit: hours. The first transfer is executed immediately. The minimum value of the parameter is 24 h.

to_account instance-attribute
to_account: str

@param {string} to_account - Account to transfer asset to. Cannot set a transfer to yourself.

remove_proposal
remove_proposal(*, proposal_owner: str | None = ..., proposal_ids: Iterable[int] | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

Using operation remove_proposal_operation, a user may remove proposals specified by given IDs.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/46_remove_proposal.md?ref_type=heads

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions

proposal_ids property
proposal_ids: RepeatedScalarFieldContainer[int]

@param {number} proposal_ids

proposal_owner instance-attribute
proposal_owner: str

@param {string} proposal_owner

request_account_recovery
request_account_recovery(*, recovery_account: str | None = ..., account_to_recover: str | None = ..., new_owner_authority: authority | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

In case of the compromised owner authority, a user may recover it. There are two conditions that have to be fulfilled to do it: 1. A user should have an actual recovery account. During an account creation, the account that created a new account is set as a recovery account by default, but it can be changed by the user (using operation change_recovery_account_operation). If the account was created by account temp, then a recovery account is empty and it is set as a top witness – it is not good a recovery account. Note: it takes HIVE_OWNER_AUTH_RECOVERY_PERIOD (30 days) after sending change_recovery_account_operation. for the new recovery agent to become active. During that period the previous agent remains active for the account. 2. The compromised owner authority is still recent. Owner authority is considered recent and remains valid for the purpose of account recovery for HIVE_OWNER_AUTH_RECOVERY_PERIOD (30 days) after it was changed.

Note: look for account_update_operation or account_update2_operation in account history to see when its owner authority was compromised.

The recovery account process. Conditions: 1. An account { account_to_recover } has an actual recovery account. 2. An account { account_to_recover } realizes that someone may have access to its owner key and it is less than 30 days from generating an operation: change_recovery_account_operation. Steps: A user { account_to_recover } asks his recovery account { recovery_account } to create a request account recovery (outside the blockchain). A recovery account { recovery_account } creates an operation: request_account_recovery_operation with {new_owner_authority}. A user { account_to_recover } creates an operation: recover_account_operation using { new_owner_authority} and {recent_owner_authority} and signing with two signatures (the old one and the new one). A user has HIVE_ACCOUNT_RECOVERY_REQUEST_EXPIRATION_PERIOD to generate this operation.

In order to cancel a request, a user should create a new request with weight of authority =0. The operation: request_account_recovery is valid HIVE_ACCOUNT_RECOVERY_REQUEST_EXPIRATION_PERIOD hours and if after HIVE_ACCOUNT_RECOVERY_REQUEST_EXPIRATION_PERIOD hours there is no response (operation: recover_account_operation) it is expired.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/24_request_account_recovery.md?ref_type=heads

account_to_recover instance-attribute
account_to_recover: str

@param {string} account_to_recover - The account to be recovered.

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions - Not currently used.

new_owner_authority property
new_owner_authority: authority

@param {authority} new_owner_authority - The new owner authority – the public, not private key. The new authority should be satisfiable.

recovery_account instance-attribute
recovery_account: str

@param {string} recovery_account - The account that may create a request for account recovery. It is important to keep it actual.

set_withdraw_vesting_route
set_withdraw_vesting_route(*, from_account: str | None = ..., to_account: str | None = ..., percent: int | None = ..., auto_vest: bool | None = ...)

Bases: Message

The operation set_withdraw_vesting_route_operation allows a user to decide where and how much percent of hive should be transferred to the account { to_account } from power down operation. A user may also decide that the Hive may be immediately converted to Hive Power. The operation may be created in any moment of power down operation and even if there is no power down operation in progress. The setting is valid till a user creates an operation set_withdraw_vesting_route_operation with the same { to_account} and with the {percent} = 0. A user may set up 10 { to_account } accounts.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/20_set_withdraw_vesting_route.md?ref_type=heads

auto_vest instance-attribute
auto_vest: bool

@param {bool} auto_vest - If auto_vest = true, then the amount of the Hive is immediately converted into HP on the { to_account } balance. If auto_vest = false, there is no conversion from Hive into HP. Default auto_vest = false;

from_account instance-attribute
from_account: str

@param {string} from_account - The account the funds are coming from.

percent instance-attribute
percent: int

@param {number} percent - The percentage of the HP shares. If the sum of the setting shares is less than 100%, the rest is transferred to the liquid balance of { from_account }. Default value: percent = 0;

to_account instance-attribute
to_account: str

@param {string} to_account - The account the funds are going to. A user may set up 10 accounts.

transfer
transfer(*, from_account: str | None = ..., to_account: str | None = ..., amount: asset | None = ..., memo: str | None = ...)

Bases: Message

@brief Transfers any liquid asset (nonvesting) from one account to another.

Transfer funds from 'from_account' to 'to_account'. HIVE and HBD can be transferred. Memo for the transaction can be encrypted if message is started with '#'. Private Memo Key must already be in the wallet for encrypted memo to work.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/02_transfer.md?ref_type=heads

amount property
amount: asset

@param {asset} amount - The amount of asset to transfer from @ref from_account to @ref to_account, the allowed currency: HIVE and HBD.

from_account instance-attribute
from_account: str

@param {string} from_account - The account the funds are coming from.

memo instance-attribute
memo: str

@param {string} memo - The memo is plain-text, any encryption on the memo is up to a higher level protocol, must be shorter than 2048.

to_account instance-attribute
to_account: str

@param {string} to_account - The account the funds are going to.

transfer_from_savings
transfer_from_savings(*, from_account: str | None = ..., request_id: int | None = ..., to_account: str | None = ..., amount: asset | None = ..., memo: str | None = ...)

Bases: Message

Funds withdrawals from the savings to an account take three days.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/33_transfer_from_savings.md?ref_type=heads

amount property
amount: asset

@param {asset} amount - The allowed currency: HIVE and HBD, amount > 0.

from_account instance-attribute
from_account: str

@param {string} from_account - Account name.

memo instance-attribute
memo: str

@param {string} memo - Have to be UTF8, must be shorter than 2048.

request_id instance-attribute
request_id: int

@param {number} request_id - The number is given by a user. Should be unique for a user.

to_account instance-attribute
to_account: str

@param {string} to_account - Account name.

transfer_to_savings
transfer_to_savings(*, from_account: str | None = ..., to_account: str | None = ..., amount: asset | None = ..., memo: str | None = ...)

Bases: Message

A user can place Hive and Hive Dollars into savings balances. Funds can be withdrawn from these balances after a three day delay. Keeping funds on the savings balance mitigates loss from hacked and compromised accounts. The maximum amount a user can lose instantaneously is the sum of what they hold in liquid balances. Assuming an account can be recovered quickly, loss in such situations can be kept to a minimum Additionally for keeping Hive Dollars on the savings balance, the interests are calculated.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/32_transfer_to_savings.md?ref_type=heads

amount property
amount: asset

@param {asset} amount - The allowed currency: HIVE and HBD, amount > 0.

from_account instance-attribute
from_account: str

@param {string} from_account - The account the funds are coming from.

memo instance-attribute
memo: str

@param {string} memo - Have to be UTF8, must be shorter than 2048.

to_account instance-attribute
to_account: str

@param {string} to_account - The account the funds are going to. The funds may be transferred to someone else savings balance.

transfer_to_vesting
transfer_to_vesting(*, from_account: str | None = ..., to_account: str | None = ..., amount: asset | None = ...)

Bases: Message

The operation is also called Staking. This operation converts Hive into Hive Power (also called Vesting Fund Shares or VESTS) at the current exchange rate. The conversion may be done between the same account or to another account. The more HP (Hive Power) the account has, the more: a. Governance voting power (for witnesses and proposals) has b. Social voting power has (indirectly affects Increase curation rewards) c. Resource Credit has

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/03_transfer_to_vesting.md?ref_type=heads

amount property
amount: asset

@param {asset} amount - Must be HIVE, amount > 0.

from_account instance-attribute
from_account: str

@param {string} from_account - The account the funds are coming from.

to_account instance-attribute
to_account: str

@param {string} to_account - The account the funds are going to. If null, then the same as 'from_account'.

update_proposal
update_proposal(*, proposal_id: int | None = ..., creator: str | None = ..., daily_pay: asset | None = ..., subject: str | None = ..., permlink: str | None = ..., extensions: Iterable[global___update_proposal_extension] | None = ...)

Bases: Message

A user who created the proposal may update it. A user may decrease {daily_pay}, change subject, permlink and {end_date} (using {extensions}). In order to update the proposal parameters, all parameters should be entered.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/47_update_proposal.md?ref_type=heads

creator instance-attribute
creator: str

@param {string} creator

daily_pay property
daily_pay: asset

@param {asset} daily_pay

extensions property
extensions: RepeatedCompositeFieldContainer[global___update_proposal_extension]

@param {update_proposal_extension} extensions

permlink: str

@param {string} permlinks

proposal_id instance-attribute
proposal_id: int

@param {number} proposal_id

subject instance-attribute
subject: str

@param {string} subject

update_proposal_votes
update_proposal_votes(*, voter: str | None = ..., proposal_ids: Iterable[int] | None = ..., approve: bool | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

A user may vote for proposals directly using an operation: update_proposal_votes_operation, or indirectly using the proxy - operation: account_witness_proxy_operation. A user may vote for proposals submitted by the other users. By voting for the proposal, a user may select which proposals should be funded. A user may vote for as many proposals as they wants, but you cannot vote twice for the same proposal. If a proxy is specified then all existing votes are deactivated. When the proxy is removed, the votes will be activated. Your vote power depends on your HP. If the operation account_witness_vote_operation or account_witness_proxy_operation or update_proposal_votes_operation is not executed in HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD, the votes are removed and the virtual operation: expired_account_notification_operation is generated.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/45_update_proposal_votes.md?ref_type=heads

approve instance-attribute
approve: bool

@param {bool} approve - To vote for the proposal, the approve = true. To remove the vote, the approve = false.

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions

proposal_ids property
proposal_ids: RepeatedScalarFieldContainer[int]

@param {number} proposal_ids - IDs of proposals to vote for/against. Before HF28 nonexisting IDs are ignored from HF28 they trigger an error.

voter instance-attribute
voter: str

@param {string} voter - Account name.

vote
vote(*, voter: str | None = ..., author: str | None = ..., permlink: str | None = ..., weight: int | None = ...)

Bases: Message

A user may upvote or downvote a post or a comment.

A user has a voting power. The max voting power depends on HP.

There are two manabars related to voting: Voting manabar and Downvoting manabar. Voting and downvoting manabars are defined as a percentage of total vote weight. Downvote manabar has 25% of the vote power weight and vote manabar has 100% of the vote power weight, but a user downvote with the total vote weight (not 25 %, but 100%).

When a user casts a vote, 1/50th of the remaining mana is used for a 100% vote. The voting powers regenerate from 0 to 100% in 5 days (20% per day).

If a voter casts another vote for the same post or comment before rewards are paid, it counts as vote edit. Vote edit cancels all effects of previous vote and acts as completely new vote, except mana used for previous vote is not returned.

The author of the post or the comment may receive the reward, the amount of the author's reward depends on the numbers and powers of the votes. By default the author reward is paid 50% HP and 50 % HBD.

A user who votes for the post or the comment may receive the curation reward. It is paid 100% HP. Its share depends on: - voting power - weight of the vote – a user may decide about the weight of the vote - the time when they vote – the sooner you vote, the higher the share in the curation reward (the first 24 h the weight of the vote is 100% - early voting, next 48 hours the weight is divided by 2, then – till the 7th day - it is divided by 8)

When a post or a comment receives a reward, it is divided between the author's reward and the curation reward. The curation reward is shared among curators.

The calculated reward should be more than 0.02 HBD to be paid, if it is less, it is not paid.

A downvoting user doesn’t receive the curation reward. Downvoting may affect the author of the comment's reputation when a user who downvotes has a higher reputation than the author.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/00_vote.md?ref_type=heads

author instance-attribute
author: str

@param {string} author - Account name, the author of the post or the comment.

permlink: str

@param {string} permlink - The identifier of the post or comment.

voter instance-attribute
voter: str

@param {string} voter - Account name.

weight instance-attribute
weight: int

@param {number} weight - It defines how many percent of the non-used voting power a user wants to use. Allowed values from -10000 (-100%) to 10000 (100%). Downvotes: from -10000 (-100%) to 0. Upvotes: from 0 to 10000 (100%).

withdraw_vesting
withdraw_vesting(*, account: str | None = ..., vesting_shares: asset | None = ...)

Bases: Message

This operation converts Hive Power (also called Vesting Fund Shares or VESTS) into HIVE. At any given point in time an account can be withdrawing from their vesting shares. A user may change the number of shares they wish to cash out at any time between 0 and their total vesting stake. After applying this operation, vesting_shares will be withdrawn at a rate of vesting_shares/13 per week for 13 weeks starting one week after this operation is included in the blockchain. This operation is not valid if a user has no vesting shares. There can be only one withdraw_vesting_operation processed at the same time. If a user wants to stop withdraw_vesting_operation, they should create an operation withdraw_vesting_operation with amount =0. If a user creates a new withdraw_vesting_operation when the old one is still processed, then the old withdraw_vesting_operation will be canceled and a new one will be processed.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/04_withdraw_vesting.md?ref_type=heads

account instance-attribute
account: str

@param {string} account - The account the funds are coming from.

vesting_shares property
vesting_shares: asset

@param {asset} vesting_shares - Amount of VESTS (HP)

witness_block_approve
witness_block_approve(*, witness: str | None = ..., block_id: str | None = ...)

Bases: Message

This is an operation for witnesses. This operation is used in the process of block_validity_vote (see https://hive.blog/hive-139531/@blocktrades/one-block-irreversibility-for-delegated-proof-of-stake-dpos).

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/16_witness_block_approve.md?ref_type=heads

block_id instance-attribute
block_id: str

@param {string} block_id

witness instance-attribute
witness: str

@param {string} witness

witness_set_properties
witness_set_properties(*, owner: str | None = ..., props: Mapping[str, str] | None = ..., extensions: Iterable[future_extensions] | None = ...)

Bases: Message

This is an operation for witnesses. This is one of the two operations allowing to update witness properties (@see witness_update_operation). The whole list of properties is available here: https://gitlab.syncad.com/hive/hive/-/blob/master/doc/witness_parameters.md.

Description https://gitlab.syncad.com/hive/hive/-/blob/develop/doc/devs/operations/42_witness_set_properties.md?ref_type=heads

extensions property
extensions: RepeatedCompositeFieldContainer[future_extensions]

@param {future_extensions} extensions

owner instance-attribute
owner: str

@param {string} owner - Witness account name.

props property
props: ScalarMap[str, str]

@param {map} props - There are the following properties available in the {props}: account_creation_fee, account_subsidy_budget, account_subsidy_decay, maximum_block_size, hbd_interest_rate. hbd_exchange_rate, url and new_signing_key.

witness_update
witness_update(*, owner: str | None = ..., url: str | None = ..., block_signing_key: str | None = ..., props: legacy_chain_properties | None = ..., fee: asset | None = ...)

Bases: Message

The operation witness_update_operation may be used to become a new witness or to update witness properties. There are two operations that allow to update witness properties witness_update_operation and witness_set_properties_operation. In order to update witness properties it is recommended to use witness_set_properties_operation.

If a user wants to become a witness, the operation witness_update_operation should be created. If the witness doesn’t want to be a witness any more, the operation witness_update_operation with empty { block_signing_key } should be created.

block_signing_key instance-attribute
block_signing_key: str

@param {string} block_signing_key - Public block signing key.

fee property
fee: asset

@param {asset} fee - The asset is validated (the format should be correct and should be expressed in Hive), but the fee is currently ignored.

owner instance-attribute
owner: str

@param {string} owner - The witness who wants to update properties or a user who wants to become a witness.

props property
props: legacy_chain_properties

@param {legacy_chain_properties} props

url instance-attribute
url: str

@param {string} url - url to information about witness.

transaction

transaction
transaction(*, ref_block_num: int | None = ..., ref_block_prefix: int | None = ..., expiration: str | None = ..., operations: Iterable[operation] | None = ..., extensions: Iterable[future_extensions] | None = ..., signatures: Iterable[str] | None = ...)

Bases: Message

signatures property
signatures: RepeatedScalarFieldContainer[str]

for signed_transaction

transaction_type_aliases

JsonTransaction module-attribute

JsonTransaction: TypeAlias = str

Type alias for a transaction in JSON format, which is used in Hive API calls.

ProtoTransaction module-attribute

ProtoTransaction: TypeAlias = transaction

Type alias for a transaction in proto format.

proto_transaction

proto_transaction(*, ref_block_num: int | None = ..., ref_block_prefix: int | None = ..., expiration: str | None = ..., operations: Iterable[operation] | None = ..., extensions: Iterable[future_extensions] | None = ..., signatures: Iterable[str] | None = ...)

Bases: Message

signatures property
signatures: RepeatedScalarFieldContainer[str]

for signed_transaction

wax_factory

create_hive_chain

create_hive_chain(options: WaxChainOptions | None = None) -> IHiveChainInterface

Factory function to provide hive chain interface functionality.

Source code in wax/wax_factory.py
20
21
22
23
24
25
26
27
28
29
def create_hive_chain(options: WaxChainOptions | None = None) -> IHiveChainInterface:
    """Factory function to provide hive chain interface functionality."""
    from wax._private.chain_api import HiveChainApi
    from wax.wax_options import WaxChainOptions

    options = options if options is not None else WaxChainOptions()
    chain_id = options.chain_id
    endpoint_url = options.endpoint_url

    return HiveChainApi(chain_id, endpoint_url, _private=True)

create_wax_foundation

create_wax_foundation(options: WaxOptions | None = None) -> IWaxBaseInterface

Factory function to provide wax base interface functionality.

Source code in wax/wax_factory.py
10
11
12
13
14
15
16
17
def create_wax_foundation(options: WaxOptions | None = None) -> IWaxBaseInterface:
    """Factory function to provide wax base interface functionality."""
    from wax._private.base_api import WaxBaseApi
    from wax.wax_options import WaxOptions

    chain_id = options.chain_id if options is not None else WaxOptions().chain_id

    return WaxBaseApi(chain_id, _private=True)

wax_options

WaxChainOptions

WaxChainOptions(chain_id: ChainId | str = DEFAULT_CHAIN_ID, endpoint_url: HttpUrl | str = DEFAULT_ENDPOINT_URL)

Bases: WaxOptions

Allows configuration of wax itself, including chain part.

Constructs WaxChainOptions.

Parameters:

Name Type Description Default
chain_id
ChainId | str

chain id used for signing. Defaults to mainnet chain id.

DEFAULT_CHAIN_ID
endpoint_url
HttpUrl | str

url of the node to connect to. Defaults to mainnet (hive.blog) node.

DEFAULT_ENDPOINT_URL

Raises:

Type Description
InvalidEndpointUrlFormatError

if endpoint_url is not valid.

Source code in wax/wax_options.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
def __init__(
    self,
    chain_id: ChainId | str = DEFAULT_CHAIN_ID,
    endpoint_url: HttpUrl | str = DEFAULT_ENDPOINT_URL,
) -> None:
    """
    Constructs WaxChainOptions.

    Args:
        chain_id: chain id used for signing. Defaults to mainnet chain id.
        endpoint_url: url of the node to connect to. Defaults to mainnet (hive.blog) node.

    Raises:
        InvalidEndpointUrlFormatError: if endpoint_url is not valid.
    """
    super().__init__(chain_id)
    self._endpoint_url = convert_to_http_url(endpoint_url)

WaxOptions

WaxOptions(chain_id: ChainId = DEFAULT_CHAIN_ID)

Allows configuration of wax itself.

Constructs WaxOptions.

Parameters:

Name Type Description Default
chain_id
ChainId

chain id used for signing. Defaults to mainnet chain id.

DEFAULT_CHAIN_ID
Source code in wax/wax_options.py
16
17
18
19
20
21
22
23
def __init__(self, chain_id: ChainId = DEFAULT_CHAIN_ID) -> None:
    """
    Constructs WaxOptions.

    Args:
        chain_id: chain id used for signing. Defaults to mainnet chain id.
    """
    self.chain_id = chain_id

wax_visitor

AbstractOperationVisitor

Bases: ABC

User must overrides all the abstract methods in derived visitor class.

OperationVisitor

Bases: AbstractOperationVisitor

User need to override only method(s) for operation(s) he wants to be processed.

All other operations will be silently skipped.