aea.decision_maker.messages.transaction

The transaction message module.

TransactionMessage

class TransactionMessage(InternalMessage)

The transaction message class.

Performative

class Performative(Enum)

Transaction performative.

__init__

 | __init__(performative: Performative, skill_callback_ids: Sequence[PublicId], tx_id: TransactionId, tx_sender_addr: Address, tx_counterparty_addr: Address, tx_amount_by_currency_id: Dict[str, int], tx_sender_fee: int, tx_counterparty_fee: int, tx_quantities_by_good_id: Dict[str, int], ledger_id: LedgerId, info: Dict[str, Any], **kwargs)

Instantiate transaction message.

Arguments:

  • performative: the performative
  • skill_callback_ids: the list public ids of skills to receive the transaction message response
  • tx_id: the id of the transaction.
  • tx_sender_addr: the sender address of the transaction.
  • tx_counterparty_addr: the counterparty address of the transaction.
  • tx_amount_by_currency_id: the amount by the currency of the transaction.
  • tx_sender_fee: the part of the tx fee paid by the sender
  • tx_counterparty_fee: the part of the tx fee paid by the counterparty
  • tx_quantities_by_good_id: a map from good id to the quantity of that good involved in the transaction.
  • ledger_id: the ledger id
  • info: a dictionary for arbitrary information

performative

 | @property
 | performative() -> Performative

Get the performative of the message.

skill_callback_ids

 | @property
 | skill_callback_ids() -> List[PublicId]

Get the list of skill_callback_ids from the message.

tx_id

 | @property
 | tx_id() -> str

Get the transaction id.

tx_sender_addr

 | @property
 | tx_sender_addr() -> Address

Get the address of the sender.

tx_counterparty_addr

 | @property
 | tx_counterparty_addr() -> Address

Get the counterparty of the message.

tx_amount_by_currency_id

 | @property
 | tx_amount_by_currency_id() -> Dict[str, int]

Get the currency id.

tx_sender_fee

 | @property
 | tx_sender_fee() -> int

Get the fee for the sender from the messgae.

tx_counterparty_fee

 | @property
 | tx_counterparty_fee() -> int

Get the fee for the counterparty from the messgae.

tx_quantities_by_good_id

 | @property
 | tx_quantities_by_good_id() -> Dict[str, int]

Get the quantities by good ids.

ledger_id

 | @property
 | ledger_id() -> LedgerId

Get the ledger_id.

info

 | @property
 | info() -> Dict[str, Any]

Get the infos from the message.

tx_nonce

 | @property
 | tx_nonce() -> str

Get the tx_nonce from the message.

tx_digest

 | @property
 | tx_digest() -> str

Get the transaction digest.

signing_payload

 | @property
 | signing_payload() -> Dict[str, Any]

Get the signing payload.

signed_payload

 | @property
 | signed_payload() -> Dict[str, Any]

Get the signed payload.

amount

 | @property
 | amount() -> int

Get the amount.

currency_id

 | @property
 | currency_id() -> str

Get the currency id.

sender_amount

 | @property
 | sender_amount() -> int

Get the amount which the sender gets/pays as part of the tx.

counterparty_amount

 | @property
 | counterparty_amount() -> int

Get the amount which the counterparty gets/pays as part of the tx.

fees

 | @property
 | fees() -> int

Get the tx fees.

respond_settlement

 | @classmethod
 | respond_settlement(cls, other: "TransactionMessage", performative: Performative, tx_digest: Optional[str] = None) -> "TransactionMessage"

Create response message.

Arguments:

  • other: TransactionMessage
  • performative: the performative
  • tx_digest: the transaction digest

Returns:

a transaction message object

respond_signing

 | @classmethod
 | respond_signing(cls, other: "TransactionMessage", performative: Performative, signed_payload: Optional[Dict[str, Any]] = None) -> "TransactionMessage"

Create response message.

Arguments:

  • other: TransactionMessage
  • performative: the performative
  • signed_payload: the signed payload

Returns:

a transaction message object