account.rs

Overview

This file defines the GraphQL schema and query resolvers related to blockchain accounts, their messages, and transactions. It provides the data structures and asynchronous query methods to fetch account information, paginate through account messages, and paginate through account transactions. These queries support filtering, pagination, and data consistency options tailored for blockchain data retrieved from a SQLite database and external clients.

The file primarily implements the BlockchainAccountQuery struct with GraphQL query methods, along with supporting enums, input objects, and connection/edge types used for GraphQL cursor-based pagination of messages and transactions.


Types, Enums, and Structs

BlockchainMessageTypeFilterEnum

An enumeration representing the type of blockchain messages for filtering purposes.

BlockchainMasterSeqNoFilter

An input object representing a filter for blockchain master sequence numbers (block sequence numbers).

Used to define a range for filtering messages or transactions by block sequence numbers.

Connection and Edge Types

These structs implement ConnectionNameType or EdgeNameType traits for GraphQL connections and edges used in pagination.

Each provides a static method to return its GraphQL type name, e.g., "BlockchainMessageEdge".


BlockchainAccountQuery<'a>

A GraphQL query object representing queries related to a specific blockchain account.

Fields

GraphQL Query Methods

info(_by_block: Option<String>) -> Option<BlockchainAccount>

Fetches account information such as the account's BOC (Bag of Cells) or other details.

messages(...) -> Option<Connection<String, BlockchainMessage, ...>>

Returns a paginated connection of blockchain messages related to the account, supporting various filters.

transactions(...) -> Option<Connection<String, BlockchainTransaction, ...>>

Returns a paginated connection of blockchain transactions related to the account, supporting various filters.


Important Implementation Details


Interactions with Other System Components


Visual Diagram: Class Diagram of Key Structs and Their Methods

classDiagram
class BlockchainAccountQuery {
+ctx: &Context
+address: String
+preloaded: Option<db::Account>
+info(_by_block: Option<String>) : Option<BlockchainAccount>
+messages(...) : Option<Connection<String, BlockchainMessage>>
+transactions(...) : Option<Connection<String, BlockchainTransaction>>
}
class BlockchainMessageTypeFilterEnum {
<<enum>>
+ExtIn
+ExtOut
+IntIn
+IntOut
}
class BlockchainMasterSeqNoFilter {
+start: Option<i32>
+end: Option<i32>
}
class BlockchainMessagesConnection {
+type_name<T>() : String
}
class BlockchainMessageEdge {
+type_name<T>() : String
}
class BlockchainTransactionsConnection {
+type_name<T>() : String
}
class BlockchainTransactionsEdge {
+type_name<T>() : String
}
BlockchainAccountQuery --> BlockchainMessageTypeFilterEnum : uses
BlockchainAccountQuery --> BlockchainMasterSeqNoFilter : uses
BlockchainAccountQuery --> BlockchainMessagesConnection : returns
BlockchainAccountQuery --> BlockchainMessageEdge : returns
BlockchainAccountQuery --> BlockchainTransactionsConnection : returns
BlockchainAccountQuery --> BlockchainTransactionsEdge : returns

References to Related Topics