Skip to content

Commit 12de153

Browse files
0xLucca0xlukem
andauthored
Apply suggestions from code review
Co-authored-by: Lucas Malizia <[email protected]>
1 parent 5e1a650 commit 12de153

File tree

2 files changed

+5
-5
lines changed
  • .snippets/code/develop/toolkit/api-libraries/subxt
  • develop/toolkit/api-libraries

2 files changed

+5
-5
lines changed

.snippets/code/develop/toolkit/api-libraries/subxt/subxt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
1212
// Define the node URL.
1313
const NODE_URL: &str = "INSERT_NODE_URL";
1414

15-
// Initialize the Subxt client for interacting with the blockchain.
15+
// Initialize the Subxt client to interact with the blockchain.
1616
let api = OnlineClient::<PolkadotConfig>::from_url(NODE_URL).await?;
1717

1818
// A query to obtain some constant.

develop/toolkit/api-libraries/subxt.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Subxt is a Rust library for type-safe interaction with Polkadot SDK
77

88
## Introduction
99

10-
subxt is a Rust library designed for interacting with Polkadot SDK-based blockchains. It provides a type-safe interface for submitting transactions, querying on-chain state, and performing other blockchain interactions. By leveraging Rust’s strong type system, subxt ensures that your code is validated at compile time, reducing runtime errors and improving reliability.
10+
subxt is a Rust library designed to interact with Polkadot SDK-based blockchains. It provides a type-safe interface for submitting transactions, querying on-chain state, and performing other blockchain interactions. By leveraging Rust’s strong type system, subxt ensures that your code is validated at compile time, reducing runtime errors and improving reliability.
1111

1212
## Prerequisites
1313

@@ -23,7 +23,7 @@ Before using subxt, ensure you have the following installed:
2323

2424
To use subxt in your project, you need to install the necessary dependencies. Each plays a specific role in enabling interaction with the blockchain:
2525

26-
1. **Install the subxt CLI** - [`subxt-cli`](https://crates.io/crates/subxt-cli){target=\_blank} is a command-line tool that provides utilities for working with Polkadot SDK metadata. In the context of subxt, it is essential for downloading chain metadata, which is required to generate type-safe Rust interfaces for interacting with the blockchain. Install it using:
26+
1. **Install the subxt CLI** - [`subxt-cli`](https://crates.io/crates/subxt-cli){target=\_blank} is a command-line tool that provides utilities for working with Polkadot SDK metadata. In the context of subxt, it is essential to download chain metadata, which is required to generate type-safe Rust interfaces for interacting with the blockchain. Install it using:
2727

2828
```bash
2929
cargo install subxt-cli
@@ -100,15 +100,15 @@ To interact with a blockchain node using subxt, create an asynchronous main func
100100

101101
subxt provides multiple ways to access on-chain data:
102102

103-
- Constants - constants are predefined values in the runtime that remain unchanged unless modified by a runtime upgrade
103+
- **Constants** - constants are predefined values in the runtime that remain unchanged unless modified by a runtime upgrade
104104

105105
For example, to retrieve the existential deposit, use:
106106

107107
```rust
108108
--8<-- 'code/develop/toolkit/api-libraries/subxt/subxt.rs:18:24'
109109
```
110110

111-
- State - state refers to the current chain data, which updates with each block
111+
- **State** - state refers to the current chain data, which updates with each block
112112

113113
To fetch account information, replace `INSERT_ADDRESS` with the address you want to fetch data from and use:
114114

0 commit comments

Comments
 (0)