from typing import TYPE_CHECKING, Union
from ..exceptions import SdkError
if TYPE_CHECKING:
from .assembled_transaction import AssembledTransaction
from .assembled_transaction_async import AssembledTransactionAsync
__all__ = [
"AssembledTransactionError",
"RestorationFailureError",
"NotYetSimulatedError",
"SimulationFailedError",
"ExpiredStateError",
"NoSignatureNeededError",
"NeedsMoreSignaturesError",
"SendTransactionFailedError",
"TransactionFailedError",
"TransactionStillPendingError",
]
[docs]
class AssembledTransactionError(SdkError):
"""Raised when an assembled transaction fails."""
def __init__(
self,
message,
assembled_transaction: Union[
"AssembledTransaction", "AssembledTransactionAsync"
],
) -> None:
super().__init__(message)
self.assembled_transaction = assembled_transaction
[docs]
class RestorationFailureError(AssembledTransactionError):
"""Raised when a restoration fails."""
[docs]
class NotYetSimulatedError(AssembledTransactionError):
"""Raised when trying to get the result of a transaction that has not been simulated yet."""
[docs]
class SimulationFailedError(AssembledTransactionError):
"""Raised when a simulation fails."""
[docs]
class ExpiredStateError(AssembledTransactionError):
"""Raised when the state has expired."""
[docs]
class NoSignatureNeededError(AssembledTransactionError):
"""Raised when no signature is needed."""
[docs]
class NeedsMoreSignaturesError(AssembledTransactionError):
"""Raised when more signatures are needed."""
[docs]
class SendTransactionFailedError(AssembledTransactionError):
"""Raised when invoking `send_transaction` fails."""
[docs]
class TransactionFailedError(AssembledTransactionError):
"""Raised when invoking `get_transaction` fails."""
[docs]
class TransactionStillPendingError(AssembledTransactionError):
"""Raised when the transaction is still pending."""