Skip to content

Commit

Permalink
chore(docs): document the experimental tx_status RPC method (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
iTranscend authored Dec 22, 2023
1 parent d82d359 commit abf4010
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/methods/experimental/tx_status.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
//! Queries the status of a transaction.
//!
//! ## Example
//!
//! Returns the final transaction result for
//! <https://explorer.near.org/transactions/B9aypWiMuiWR5kqzewL9eC96uZWA3qCMhLe67eBMWacq>
//!
//! ```
//! use near_jsonrpc_client::{methods, JsonRpcClient};
//! use near_primitives::views;
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = JsonRpcClient::connect("https://archival-rpc.mainnet.near.org");
//! let tx_hash = "B9aypWiMuiWR5kqzewL9eC96uZWA3qCMhLe67eBMWacq".parse()?;
//!
//! let request = methods::EXPERIMENTAL_tx_status::RpcTransactionStatusRequest {
//! transaction_info: methods::EXPERIMENTAL_tx_status::TransactionInfo::TransactionId {
//! hash: tx_hash,
//! account_id: "itranscend.near".parse()?,
//! }
//! };
//!
//! let response = client.call(request).await?;
//!
//! assert!(matches!(
//! response,
//! views::FinalExecutionOutcomeWithReceiptView { .. }
//! ));
//! # Ok(())
//! # }
//! ```
use super::*;

pub use near_jsonrpc_primitives::types::transactions::RpcTransactionError;
Expand Down

0 comments on commit abf4010

Please sign in to comment.