You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .chain-interactions/query-data/query-sdks.md
+35-29Lines changed: 35 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,24 +8,22 @@ categories: Chain Interactions
8
8
9
9
## Introduction
10
10
11
-
Polkadot SDK-based blockchains store data in a key-value database that can be queried by external applications. This on-chain state includes account balances, asset information, governance proposals, and any other data the runtime manages.
11
+
Polkadot SDK-based blockchains store data in a key-value database that external applications can query. This on-chain state includes account balances, asset information, governance proposals, and any other data the runtime manages.
12
12
13
13
This guide demonstrates how to query on-chain storage using five popular SDKs:
14
14
15
-
-**[Polkadot API (PAPI)](/reference/tools/papi/){target=\_blank}** - Modern TypeScript library with type-safe APIs
@@ -102,8 +100,6 @@ Select your preferred SDK below to see complete, runnable examples that query Po
102
100
!!! warning "Maintenance Mode Only"
103
101
The Polkadot.js API is no longer actively developed. New projects should use [PAPI](/reference/tools/papi/){target=\_blank} or [Dedot](/reference/tools/dedot/){target=\_blank} as actively maintained alternatives.
104
102
105
-
[Polkadot.js API](/reference/tools/polkadot-js-api/){target=\_blank} is a comprehensive JavaScript library with extensive ecosystem support.
106
-
107
103
**Prerequisites**
108
104
109
105
- [Node.js](https://nodejs.org/){target=\_blank} v18 or higher
@@ -128,7 +124,7 @@ Select your preferred SDK below to see complete, runnable examples that query Po
128
124
129
125
The following example queries the `System.Account` storage to retrieve an account's native token balance.
130
126
131
-
Create a file named `query-balance.js`:
127
+
Create a file named `query-balance.js` and add the following code to it:
@@ -170,8 +166,6 @@ Select your preferred SDK below to see complete, runnable examples that query Po
170
166
171
167
=== "Dedot"
172
168
173
-
[Dedot](/reference/tools/dedot/){target=\_blank} is a next-generation TypeScript client that's lightweight, tree-shakable, and maintains API compatibility with Polkadot.js.
174
-
175
169
**Prerequisites**
176
170
177
171
- [Node.js](https://nodejs.org/){target=\_blank} v18 or higher
@@ -197,7 +191,7 @@ Select your preferred SDK below to see complete, runnable examples that query Po
197
191
198
192
The following example queries the `System.Account` storage to retrieve an account's native token balance.
199
193
200
-
Create a file named `query-balance.ts`:
194
+
Create a file named `query-balance.ts` and add the following code to it:
[Python Substrate Interface](/reference/tools/py-substrate-interface/){target=\_blank} provides a Python library for interacting with Substrate-based chains.
234
+
=== "Py Substrate Interface"
243
235
244
236
**Prerequisites**
245
237
@@ -265,7 +257,7 @@ Select your preferred SDK below to see complete, runnable examples that query Po
265
257
266
258
The following example queries the `System.Account` storage to retrieve an account's native token balance.
267
259
268
-
Create a file named `query_balance.py`:
260
+
Create a file named `query_balance.py` and add the following code to it:
0 commit comments