message.rs

Overview

This file defines the data structures and database query operations related to blockchain messages within the system. It provides models representing messages and related query arguments, along with asynchronous methods to retrieve message data from a SQLite database. The primary focus is on querying messages associated with blockchain accounts, blocks, and transactions, including support for pagination and filtering by message types and other criteria.


Data Structures and Classes

InBlockMessage

A lightweight struct representing a message included in a specific blockchain block.

This struct is used primarily for listing messages tied to blocks.


AccountMessagesQueryArgs

Encapsulates filter and pagination parameters used when querying messages related to blockchain accounts.


Message

Represents a blockchain message record with detailed fields mapped to a database row.


Important Implementation Details and Algorithms


Interaction with Other Parts of the System


Mermaid Class Diagram

classDiagram
class InBlockMessage {
+msg_id: String
+transaction_id: String
}
class AccountMessagesQueryArgs {
-allow_latest_inconsistent_data: Option<bool>
-master_seq_no_range: Option<BlockchainMasterSeqNoFilter>
-counterparties: Option<Vec<String>>
-msg_type: Option<Vec<BlockchainMessageTypeFilterEnum>>
-min_value: Option<String>
+pagination: PaginationArgs
+new()
-has_msg_type()
-has_ext_in()
-has_ext_out()
-has_int_in()
-has_int_out()
}
class Message {
+rowid: Option<i64>
+id: String
+boc: Option<Vec<u8>>
+body: Option<Vec<u8>>
+body_hash: Option<String>
+status: Option<i64>
+transaction_id: Option<String>
+msg_type: Option<i64>
+src: Option<String>
+src_workchain_id: Option<i64>
+dst: Option<String>
+dst_workchain_id: Option<i64>
+import_fee: Option<String>
+fwd_fee: Option<String>
+bounce: Option<i64>
+bounced: Option<i64>
+value: Option<String>
+value_other: Option<Vec<u8>>
+created_lt: Option<String>
+created_at: Option<i64>
+dst_chain_order: Option<String>
+src_chain_order: Option<String>
+proof: Option<String>
+code: Option<Vec<u8>>
+code_hash: Option<String>
+data: Option<Vec<u8>>
+data_hash: Option<String>
+src_dapp_id: Option<String>
+msg_chain_order: Option<String>
+list()
+in_block_msgs()
+account_messages()
+account_events()
}