ParentTransaction

class arbitrum_py.message.parent_transaction.ParentTransactionReceipt(tx)[source]

Bases: CaseDict

A transaction receipt for transactions sent on the parent chain.

This class represents a transaction receipt with additional functionality specific to parent chain transactions in the Arbitrum ecosystem.

Parameters:

tx (TxReceipt) – The transaction receipt from web3.py

Variables:
  • to (str) – The address the transaction was sent to

  • from (str) – The address that sent the transaction

  • contractAddress (str) – The contract address created, if the transaction was a contract creation

  • transactionIndex (int) – Integer of the transaction’s index position in the block

  • root (str) – The root of the state trie after this transaction

  • gasUsed (int) – The amount of gas used by this specific transaction

  • logsBloom (str) – The bloom filter for the logs of the block

  • blockHash (str) – Hash of the block where this transaction was in

  • transactionHash (str) – Hash of the transaction

  • logs (List[Dict]) – Array of log objects that this transaction generated

  • blockNumber (int) – Block number where this transaction was in

  • confirmations (int) – Number of block confirmations

  • cumulativeGasUsed (int) – The total amount of gas used when this transaction was executed in the block

  • effectiveGasPrice (int) – The actual value per gas deducted from the senders account

  • byzantium (bool) – True if block is byzantium hard fork or later

  • type (int) – Transaction type

  • status (int) – Either 1 (success) or 0 (failure)

__init__(tx)[source]
is_classic(child_signer_or_provider)[source]

Check if the transaction was processed by the classic Arbitrum system.

Parameters:

child_signer_or_provider (Union[Web3, BaseProvider]) – The Web3 instance or provider for the child chain

Returns:

True if the transaction was processed by classic Arbitrum, False otherwise

Return type:

bool

get_message_delivered_events()[source]

Get MessageDelivered events from the transaction logs.

Returns:

List of parsed MessageDelivered events

Return type:

List[Dict[str, Any]]

get_inbox_message_delivered_events()[source]

Get InboxMessageDelivered events from the transaction logs.

Returns:

List of parsed InboxMessageDelivered events

Return type:

List[Dict[str, Any]]

get_message_events()[source]

Get combined message events from both Bridge and Inbox contracts.

This method combines MessageDelivered events from the Bridge contract with InboxMessageDelivered events from the Inbox contract, matching them by message index.

Returns:

List of combined message events

Return type:

List[Dict[str, Any]]

Raises:

ArbSdkError – If there is a mismatch in the number of events or if a matching event is not found

get_eth_deposits(child_provider)[source]

Get ETH deposit messages from the transaction logs.

Parameters:

child_provider (Union[Web3, BaseProvider]) – The Web3 instance or provider for the child chain

Returns:

List of ETH deposit messages

Return type:

List[EthDepositMessage]

get_parent_to_child_messages_classic(child_provider)[source]

Get classic parent-to-child messages from the transaction logs.

Parameters:

child_provider (Union[Web3, BaseProvider]) – The Web3 instance or provider for the child chain

Returns:

List of classic parent-to-child messages

Return type:

List[ParentToChildMessageReaderClassic]

Raises:

Exception – If the transaction is not a classic transaction

get_parent_to_child_messages(child_signer_or_provider)[source]

Get parent-to-child messages from the transaction logs.

Parameters:

child_signer_or_provider (Union[Web3, BaseProvider]) – The Web3 instance or provider for the child chain

Returns:

List of parent-to-child messages

Return type:

List[ParentToChildMessage]

Raises:

Exception – If the transaction is not a nitro transaction

get_token_deposit_events()[source]

Get token deposit events from the transaction logs.

Returns:

List of parsed token deposit events

Return type:

List[Dict[str, Any]]

static monkey_patch_wait(contract_transaction)[source]

Add wait functionality to contract transaction.

Parameters:

contract_transaction (TxReceipt) – The contract transaction

Returns:

The transaction receipt

Return type:

ParentTransactionReceipt

static monkey_patch_eth_deposit_wait(contract_transaction)[source]

Add ETH deposit wait functionality.

Parameters:

contract_transaction (TxReceipt) – The contract transaction

Returns:

The transaction receipt

Return type:

ParentEthDepositTransactionReceipt

static monkey_patch_contract_call_wait(tx_receipt)[source]

Add contract call wait functionality.

Parameters:

tx_receipt (TxReceipt) – The transaction receipt

Returns:

The transaction receipt

Return type:

ParentContractCallTransactionReceipt

class arbitrum_py.message.parent_transaction.ParentEthDepositTransactionReceipt(tx)[source]

Bases: ParentTransactionReceipt

A transaction receipt for ETH deposits from parent to child chain.

This class extends ParentTransactionReceipt with additional functionality specific to ETH deposit transactions.

Variables:
  • complete (bool) – Whether the transaction is complete

  • message (EthDepositMessage) – The ETH deposit message

wait_for_child_transaction_receipt(child_provider, confirmations=None, timeout=None)[source]

Wait for the ETH deposit to arrive on the child chain.

Parameters:
  • child_provider (Union[Web3, BaseProvider]) – The Web3 instance or provider for the child chain

  • confirmations (Optional[int]) – Number of confirmations to wait for (optional)

  • timeout (Optional[int]) – Maximum time to wait in milliseconds (optional)

Returns:

A dictionary containing:
  • complete (bool): Whether the transaction is complete

  • message (EthDepositMessage): The ETH deposit message

  • status (ParentToChildMessageStatus): Current status of the message

  • childTxReceipt (Optional[TxReceipt]): Receipt of the child transaction if available

Return type:

Dict[str, Any]

class arbitrum_py.message.parent_transaction.ParentContractCallTransactionReceipt(tx)[source]

Bases: ParentTransactionReceipt

A transaction receipt for contract calls from parent to child chain.

This class extends ParentTransactionReceipt with additional functionality specific to contract call transactions, including token deposits.

Variables:
  • complete (bool) – Whether the transaction is complete

  • message (ParentToChildMessageReaderOrWriter) – The parent-to-child message

wait_for_child_transaction_receipt(child_signer_or_provider, confirmations=None, timeout=None)[source]

Wait for the transaction to arrive and be executed on the child chain.

Parameters:
  • child_signer_or_provider (Union[Web3, BaseProvider]) – The Web3 instance or provider for the child chain

  • confirmations (Optional[int]) – Number of confirmations to wait for (optional)

  • timeout (Optional[int]) – Maximum time to wait in milliseconds (optional)

Returns:

A dictionary containing:
  • complete (bool): Whether the transaction is complete

  • message (ParentToChildMessageReaderOrWriter): The parent-to-child message

  • status (ParentToChildMessageStatus): Current status of the message

  • childTxReceipt (Optional[TxReceipt]): Receipt of the child transaction if available

Return type:

Dict[str, Any]

class arbitrum_py.message.parent_transaction.ParentContractTransaction[source]

Bases: object

Base class for parent chain contract transactions.

This class provides a common interface for all parent chain transactions.

wait(confirmations=None)[source]

Wait for transaction confirmation.

Parameters:

confirmations (Optional[int]) – Number of confirmations to wait for (optional)

Returns:

The transaction receipt

Return type:

ParentTransactionReceipt

class arbitrum_py.message.parent_transaction.ParentEthDepositTransaction[source]

Bases: ParentContractTransaction

Parent chain ETH deposit transaction.

This class represents a transaction that deposits ETH from the parent chain to the child chain.

wait(confirmations=None)[source]

Wait for ETH deposit confirmation.

Parameters:

confirmations (Optional[int]) – Number of confirmations to wait for (optional)

Returns:

The transaction receipt

Return type:

ParentEthDepositTransactionReceipt

class arbitrum_py.message.parent_transaction.ParentContractCallTransaction[source]

Bases: ParentContractTransaction

Parent chain contract call transaction.

This class represents a transaction that calls a contract on the child chain from the parent chain.

wait(confirmations=None)[source]

Wait for contract call confirmation.

Parameters:

confirmations (Optional[int]) – Number of confirmations to wait for (optional)

Returns:

The transaction receipt

Return type:

ParentContractCallTransactionReceipt