FederationWallet

FederationWallet

class FederationWallet(**kwargs)

Implements the federationwallet api endpoints.

balance(**kwargs) → pystratis.api.global_responsemodels.walletbalancemodel.WalletBalanceModel

Retrieves wallet balances.

Parameters:**kwargs – Extra keyword arguments.
Returns:Federation wallet balance information.
Return type:WalletBalanceModel
Raises:APIError – Error thrown by node API. See message for details.
enable_federation(mnemonic: str, password: str, passphrase: str = None, timeout_seconds: int = 60, **kwargs) → Union[NoneType, str]

Enables the federation so that it can sign transactions.

Parameters:
  • mnemonic (str) – The mnemonic.
  • password (str) – The password.
  • passphrase (str, optional) – The passphrase.
  • timeout_seconds (int, optional) – Seconds to timeout. Default=60.
  • **kwargs – Extra keyword arguments.
Returns:

None if successful, str if error.

Return type:

(str, None)

Raises:

APIError

general_info(**kwargs) → pystratis.api.global_responsemodels.walletgeneralinfomodel.WalletGeneralInfoModel

Retrieves general information about the wallet.

Parameters:**kwargs – Extra keyword arguments.
Returns:General information about the federation wallet.
Return type:WalletGeneralInfoModel
Raises:APIError – Error thrown by node API. See message for details.
history(max_entries_to_return: int, **kwargs) → List[pystratis.api.federationwallet.responsemodels.withdrawalmodel.WithdrawalModel]

Retrieves a withdrawal history for the wallet.

Parameters:
  • max_entries_to_return (int) – The maximum number of history entries to return.
  • **kwargs – Extra keyword arguments.
Returns:

The federation wallet history.

Return type:

List[WithdrawalModel]

Raises:

APIError – Error thrown by node API. See message for details.

remove_transactions(resync: bool = True, **kwargs) → List[pystratis.api.global_responsemodels.removedtransactionmodel.RemovedTransactionModel]

Remove all transactions from the wallet.

Parameters:
  • resync (bool, optional) – A flag to resync the wallet after transactions are removed. Default=True.
  • **kwargs – Extra keyword arguments.
Returns:

A list of removed transactions from the federation wallet.

Return type:

List[RemovedTransactionModel]

Raises:

APIError – Error thrown by node API. See message for details.

sync(block_hash: Union[str, pystratis.core.types.uint256.uint256], **kwargs) → None

Starts sending block to wallet for synchronisation. Demo/testing use only.

Parameters:
  • block_hash (uint256, str) – The block hash at which to start sync.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

RemovedTransactionModel

class RemovedTransactionModel

A pydantic model for a removed transaction.

WalletBalanceModel

class WalletBalanceModel

A pydantic model for a wallet balance.

WalletGeneralInfoModel

class WalletGeneralInfoModel

A model representing general wallet info.

WithdrawalModel

class WithdrawalModel

A pydantic model for a withdrawal processed by the multisig federation.