@zuhaibnoor/zigchain-sdk 1.0.3 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/README.md +1 -1
  2. package/dist/auth/ChainAuthApi.d.ts +0 -3
  3. package/dist/auth/ChainAuthApi.d.ts.map +1 -1
  4. package/dist/auth/ChainAuthApi.js +0 -26
  5. package/dist/auth/ChainAuthApi.js.map +1 -1
  6. package/dist/bank/ChainBankApi.d.ts +0 -9
  7. package/dist/bank/ChainBankApi.d.ts.map +1 -1
  8. package/dist/bank/ChainBankApi.js +0 -18
  9. package/dist/bank/ChainBankApi.js.map +1 -1
  10. package/dist/circuit/ChainCircuitApi.d.ts.map +1 -1
  11. package/dist/circuit/ChainCircuitApi.js.map +1 -1
  12. package/dist/client/http.d.ts +1 -0
  13. package/dist/client/http.d.ts.map +1 -1
  14. package/dist/client/http.js +10 -0
  15. package/dist/client/http.js.map +1 -1
  16. package/dist/dex/ChainDexApi.d.ts.map +1 -1
  17. package/dist/dex/ChainDexApi.js.map +1 -1
  18. package/dist/distribution/ChainDistributionApi.d.ts +47 -0
  19. package/dist/distribution/ChainDistributionApi.d.ts.map +1 -0
  20. package/dist/distribution/ChainDistributionApi.js +74 -0
  21. package/dist/distribution/ChainDistributionApi.js.map +1 -0
  22. package/dist/distribution/types.d.ts +71 -0
  23. package/dist/distribution/types.d.ts.map +1 -0
  24. package/dist/distribution/types.js +2 -0
  25. package/dist/distribution/types.js.map +1 -0
  26. package/dist/evidence/ChainEvidenceApi.d.ts +15 -0
  27. package/dist/evidence/ChainEvidenceApi.d.ts.map +1 -0
  28. package/dist/evidence/ChainEvidenceApi.js +22 -0
  29. package/dist/evidence/ChainEvidenceApi.js.map +1 -0
  30. package/dist/evidence/types.d.ts +15 -0
  31. package/dist/evidence/types.d.ts.map +1 -0
  32. package/dist/evidence/types.js +2 -0
  33. package/dist/evidence/types.js.map +1 -0
  34. package/dist/feegrant/ChainFeegrantApi.d.ts +22 -0
  35. package/dist/feegrant/ChainFeegrantApi.d.ts.map +1 -0
  36. package/dist/feegrant/ChainFeegrantApi.js +32 -0
  37. package/dist/feegrant/ChainFeegrantApi.js.map +1 -0
  38. package/dist/feegrant/types.d.ts +17 -0
  39. package/dist/feegrant/types.d.ts.map +1 -0
  40. package/dist/feegrant/types.js +2 -0
  41. package/dist/feegrant/types.js.map +1 -0
  42. package/dist/ibc/ChainIbcApi.d.ts +55 -0
  43. package/dist/ibc/ChainIbcApi.d.ts.map +1 -0
  44. package/dist/ibc/ChainIbcApi.js +82 -0
  45. package/dist/ibc/ChainIbcApi.js.map +1 -0
  46. package/dist/ibc/ibcChannel/ChainIbcChannelApi.d.ts +55 -0
  47. package/dist/ibc/ibcChannel/ChainIbcChannelApi.d.ts.map +1 -0
  48. package/dist/ibc/ibcChannel/ChainIbcChannelApi.js +82 -0
  49. package/dist/ibc/ibcChannel/ChainIbcChannelApi.js.map +1 -0
  50. package/dist/ibc/ibcChannel/types.d.ts +106 -0
  51. package/dist/ibc/ibcChannel/types.d.ts.map +1 -0
  52. package/dist/ibc/ibcChannel/types.js +2 -0
  53. package/dist/ibc/ibcChannel/types.js.map +1 -0
  54. package/dist/ibc/ibcChannelV2/ChainIbcChannelV2.d.ts +14 -0
  55. package/dist/ibc/ibcChannelV2/ChainIbcChannelV2.d.ts.map +1 -0
  56. package/dist/ibc/ibcChannelV2/ChainIbcChannelV2.js +38 -0
  57. package/dist/ibc/ibcChannelV2/ChainIbcChannelV2.js.map +1 -0
  58. package/dist/ibc/ibcChannelV2/types.d.ts +26 -0
  59. package/dist/ibc/ibcChannelV2/types.d.ts.map +1 -0
  60. package/dist/ibc/ibcChannelV2/types.js +3 -0
  61. package/dist/ibc/ibcChannelV2/types.js.map +1 -0
  62. package/dist/ibc/ibcClient/ChainIbcClientApi.d.ts +15 -0
  63. package/dist/ibc/ibcClient/ChainIbcClientApi.d.ts.map +1 -0
  64. package/dist/ibc/ibcClient/ChainIbcClientApi.js +39 -0
  65. package/dist/ibc/ibcClient/ChainIbcClientApi.js.map +1 -0
  66. package/dist/ibc/ibcClient/types.d.ts +53 -0
  67. package/dist/ibc/ibcClient/types.d.ts.map +1 -0
  68. package/dist/ibc/ibcClient/types.js +2 -0
  69. package/dist/ibc/ibcClient/types.js.map +1 -0
  70. package/dist/ibc/ibcConnection/ChainIbcConnectionApi.d.ts +11 -0
  71. package/dist/ibc/ibcConnection/ChainIbcConnectionApi.d.ts.map +1 -0
  72. package/dist/ibc/ibcConnection/ChainIbcConnectionApi.js +24 -0
  73. package/dist/ibc/ibcConnection/ChainIbcConnectionApi.js.map +1 -0
  74. package/dist/ibc/ibcConnection/types.d.ts +18 -0
  75. package/dist/ibc/ibcConnection/types.d.ts.map +1 -0
  76. package/dist/ibc/ibcConnection/types.js +2 -0
  77. package/dist/ibc/ibcConnection/types.js.map +1 -0
  78. package/dist/ibc/types.d.ts +106 -0
  79. package/dist/ibc/types.d.ts.map +1 -0
  80. package/dist/ibc/types.js +2 -0
  81. package/dist/ibc/types.js.map +1 -0
  82. package/dist/ibc-transfer/ChainIbcTransferApi.d.ts +12 -0
  83. package/dist/ibc-transfer/ChainIbcTransferApi.d.ts.map +1 -0
  84. package/dist/ibc-transfer/ChainIbcTransferApi.js +30 -0
  85. package/dist/ibc-transfer/ChainIbcTransferApi.js.map +1 -0
  86. package/dist/ibc-transfer/types.d.ts +26 -0
  87. package/dist/ibc-transfer/types.d.ts.map +1 -0
  88. package/dist/ibc-transfer/types.js +2 -0
  89. package/dist/ibc-transfer/types.js.map +1 -0
  90. package/dist/index.d.ts +26 -0
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +26 -0
  93. package/dist/index.js.map +1 -1
  94. package/dist/interchain-accounts/ChainInterChainAccApi.d.ts +9 -0
  95. package/dist/interchain-accounts/ChainInterChainAccApi.d.ts.map +1 -0
  96. package/dist/interchain-accounts/ChainInterChainAccApi.js +16 -0
  97. package/dist/interchain-accounts/ChainInterChainAccApi.js.map +1 -0
  98. package/dist/interchain-accounts/types.d.ts +12 -0
  99. package/dist/interchain-accounts/types.d.ts.map +1 -0
  100. package/dist/interchain-accounts/types.js +2 -0
  101. package/dist/interchain-accounts/types.js.map +1 -0
  102. package/dist/networks/endpoints.js +2 -2
  103. package/dist/networks/endpoints.js.map +1 -1
  104. package/dist/runtime/ChainRuntimeApi.d.ts +12 -0
  105. package/dist/runtime/ChainRuntimeApi.d.ts.map +1 -0
  106. package/dist/runtime/ChainRuntimeApi.js +16 -0
  107. package/dist/runtime/ChainRuntimeApi.js.map +1 -0
  108. package/dist/runtime/types.d.ts +4 -0
  109. package/dist/runtime/types.d.ts.map +1 -0
  110. package/dist/runtime/types.js +2 -0
  111. package/dist/runtime/types.js.map +1 -0
  112. package/dist/staking/ChainStakingApi.d.ts +1 -5
  113. package/dist/staking/ChainStakingApi.d.ts.map +1 -1
  114. package/dist/staking/ChainStakingApi.js +9 -7
  115. package/dist/staking/ChainStakingApi.js.map +1 -1
  116. package/dist/tokenwrapper/ChainTokenWrapperApi.d.ts +19 -0
  117. package/dist/tokenwrapper/ChainTokenWrapperApi.d.ts.map +1 -0
  118. package/dist/tokenwrapper/ChainTokenWrapperApi.js +26 -0
  119. package/dist/tokenwrapper/ChainTokenWrapperApi.js.map +1 -0
  120. package/dist/tokenwrapper/types.d.ts +15 -0
  121. package/dist/tokenwrapper/types.d.ts.map +1 -0
  122. package/dist/tokenwrapper/types.js +2 -0
  123. package/dist/tokenwrapper/types.js.map +1 -0
  124. package/dist/txs/ChainTxsApi.d.ts +12 -0
  125. package/dist/txs/ChainTxsApi.d.ts.map +1 -0
  126. package/dist/txs/ChainTxsApi.js +17 -0
  127. package/dist/txs/ChainTxsApi.js.map +1 -0
  128. package/dist/txs/types.d.ts +22 -0
  129. package/dist/txs/types.d.ts.map +1 -0
  130. package/dist/txs/types.js +5 -0
  131. package/dist/txs/types.js.map +1 -0
  132. package/dist/upgrade/ChainUpgradeApi.d.ts +22 -0
  133. package/dist/upgrade/ChainUpgradeApi.d.ts.map +1 -0
  134. package/dist/upgrade/ChainUpgradeApi.js +40 -0
  135. package/dist/upgrade/ChainUpgradeApi.js.map +1 -0
  136. package/dist/upgrade/types.d.ts +24 -0
  137. package/dist/upgrade/types.d.ts.map +1 -0
  138. package/dist/upgrade/types.js +5 -0
  139. package/dist/upgrade/types.js.map +1 -0
  140. package/dist/validator-set/ChainCometValidator.d.ts +8 -0
  141. package/dist/validator-set/ChainCometValidator.d.ts.map +1 -0
  142. package/dist/validator-set/ChainCometValidator.js +15 -0
  143. package/dist/validator-set/ChainCometValidator.js.map +1 -0
  144. package/dist/validator-set/ChainValidator.d.ts +8 -0
  145. package/dist/validator-set/ChainValidator.d.ts.map +1 -0
  146. package/dist/validator-set/ChainValidator.js +15 -0
  147. package/dist/validator-set/ChainValidator.js.map +1 -0
  148. package/dist/validator-set/types.d.ts +18 -0
  149. package/dist/validator-set/types.d.ts.map +1 -0
  150. package/dist/validator-set/types.js +2 -0
  151. package/dist/validator-set/types.js.map +1 -0
  152. package/dist/wasm/ChainWasmApi.d.ts +57 -0
  153. package/dist/wasm/ChainWasmApi.d.ts.map +1 -0
  154. package/dist/wasm/ChainWasmApi.js +78 -0
  155. package/dist/wasm/ChainWasmApi.js.map +1 -0
  156. package/dist/wasm/types.d.ts +77 -0
  157. package/dist/wasm/types.d.ts.map +1 -0
  158. package/dist/wasm/types.js +2 -0
  159. package/dist/wasm/types.js.map +1 -0
  160. package/docs/auth.md +438 -72
  161. package/docs/bank.md +782 -123
  162. package/docs/block-results.md +328 -21
  163. package/docs/block.md +325 -38
  164. package/docs/circuit.md +164 -35
  165. package/docs/dex.md +313 -63
  166. package/docs/distribution.md +772 -0
  167. package/docs/evidence.md +194 -0
  168. package/docs/factory.md +308 -62
  169. package/docs/feegrant.md +206 -0
  170. package/docs/gov.md +364 -0
  171. package/docs/ibc/ibcChannel.md +977 -0
  172. package/docs/ibc/ibcClient.md +771 -0
  173. package/docs/ibc/ibcConnection.md +214 -0
  174. package/docs/ibc-transfer.md +463 -0
  175. package/docs/interchain-accounts.md +223 -0
  176. package/docs/mint.md +270 -0
  177. package/docs/runtime.md +120 -0
  178. package/docs/slashing.md +287 -0
  179. package/docs/staking.md +756 -0
  180. package/docs/tokenwrapper.md +294 -0
  181. package/docs/txs.md +447 -0
  182. package/docs/upgrade.md +356 -0
  183. package/docs/validator-set.md +177 -0
  184. package/docs/wasm.md +916 -0
  185. package/package.json +1 -1
@@ -0,0 +1,356 @@
1
+ # Upgrade Module
2
+
3
+ ## What is the Upgrade Module?
4
+
5
+ This **Upgrade module** allows you to query information about chain upgrades, including:
6
+
7
+ * Current upgrade plans scheduled for the chain
8
+ * Who has authority to schedule upgrades
9
+ * Module versions currently running on the chain
10
+
11
+ Its module is essential for:
12
+
13
+ * Monitoring planned network upgrades
14
+ * Verifying upgrade governance
15
+ * Tracking module versions across the network
16
+ * Planning infrastructure updates
17
+
18
+ ---
19
+
20
+ # Important Terminology
21
+
22
+ Before documenting functions, let's define key terms.
23
+
24
+ ### Upgrade Plan
25
+
26
+ An **Upgrade Plan** is a scheduled network upgrade that will happen at a specific block height.
27
+
28
+ An upgrade plan contains:
29
+
30
+ * **Name** – Identifier for the upgrade
31
+ * **Height** – Block number when the upgrade takes effect
32
+ * **Info** – Description of what changes
33
+
34
+ Example:
35
+
36
+ ```json
37
+ {
38
+ "name": "v2.0.0",
39
+ "height": 5000000,
40
+ "info": "Major network upgrade with new features"
41
+ }
42
+ ```
43
+
44
+ ⚠️ If no upgrade is currently planned, the plan will be `null`.
45
+
46
+ ---
47
+
48
+ ### Upgrade Authority
49
+
50
+ The **Upgrade Authority** is the address that has permission to schedule network upgrades.
51
+
52
+ Only this address can propose and approve upgrade plans (via governance).
53
+
54
+ Example:
55
+
56
+ ```
57
+ zig10d07y265gmmuvt4z0w9aw880jnsr700jmgkh5m
58
+ ```
59
+
60
+ ---
61
+
62
+ ### Module Version
63
+
64
+ Each **module** running on the chain has a **version number**.
65
+
66
+ Modules are components of the blockchain (e.g., `bank`, `staking`, `auth`).
67
+
68
+ Example module:
69
+
70
+ ```json
71
+ {
72
+ "name": "bank",
73
+ "version": "4"
74
+ }
75
+ ```
76
+
77
+ ---
78
+
79
+ # Functions Documentation
80
+
81
+ Setup:
82
+ ```ts
83
+ import {
84
+ ChainUpgradeApi,
85
+ getNetworkEndpoints,
86
+ Network
87
+ } from '@zuhaibnoor/zigchain-sdk'
88
+
89
+ const endpoints = getNetworkEndpoints(Network.Testnet)
90
+ const upgradeApi = new ChainUpgradeApi(endpoints)
91
+ ```
92
+
93
+ ---
94
+
95
+ # 1️⃣ fetchCurrentPlan
96
+
97
+ ## Method
98
+
99
+ ```ts
100
+ async fetchCurrentPlan(): Promise<CurrentPlanResponse>
101
+ ```
102
+
103
+ ## CLI Equivalent
104
+
105
+ ```bash
106
+ zigchaind query upgrade plan
107
+ ```
108
+
109
+ ## Description
110
+
111
+ Fetches the **current upgrade plan** scheduled on the chain.
112
+
113
+ Returns:
114
+
115
+ * Plan name
116
+ * Target block height
117
+ * Plan description
118
+
119
+ If no upgrade is planned, returns `plan: null`.
120
+
121
+ ## Parameters
122
+
123
+ None.
124
+
125
+ ## Usage Example
126
+
127
+ ```ts
128
+ const plan = await upgradeApi.fetchCurrentPlan()
129
+ console.dir(plan, { depth: null })
130
+ ```
131
+
132
+ ## Example Response
133
+
134
+ ### When an Upgrade is Planned
135
+
136
+ ```json
137
+ {
138
+ "plan": {
139
+ "name": "v2.0.0",
140
+ "time": "0001-01-01T00:00:00Z",
141
+ "height": "5000000",
142
+ "info": "Major network upgrade introducing new governance features and performance improvements",
143
+ "upgraded_client_state": null
144
+ }
145
+ }
146
+ ```
147
+
148
+ ### When No Upgrade is Planned
149
+
150
+ ```json
151
+ {
152
+ "plan": null
153
+ }
154
+ ```
155
+
156
+ ## Response Field Explanation
157
+
158
+ ### `plan`
159
+
160
+ The upgrade plan object, or `null` if no upgrade is scheduled.
161
+
162
+ If present, contains:
163
+
164
+ | Field | Description |
165
+ | ------------------------ | ---------------------------------------------- |
166
+ | name | Name/identifier of the upgrade |
167
+ | time | Estimated time |
168
+ | height | Block height when upgrade takes effect |
169
+ | info | Human-readable description of changes |
170
+ | upgraded_client_state | IBC client state after upgrade |
171
+
172
+ ## When to Use
173
+
174
+ * Monitoring network upgrade schedules
175
+ * Planning infrastructure maintenance
176
+ * Setting up notifications for upcoming upgrades
177
+ * Building chain status dashboards
178
+ * Verifying upgrade timing
179
+
180
+ ---
181
+
182
+ # 2️⃣ fetchAuthority
183
+
184
+ ## Method
185
+
186
+ ```ts
187
+ async fetchAuthority(): Promise<UpgradeAuthorityResponse>
188
+ ```
189
+
190
+ ## CLI Equivalent
191
+
192
+ ```bash
193
+ zigchaind query upgrade authority
194
+ ```
195
+
196
+ ## Description
197
+
198
+ Fetches the **address with authority to schedule upgrades**.
199
+
200
+ This is the account that can propose and execute upgrade plans through governance.
201
+
202
+ ## Parameters
203
+
204
+ None.
205
+
206
+ ## Usage Example
207
+
208
+ ```ts
209
+ const authority = await upgradeApi.fetchAuthority()
210
+ console.dir(authority, { depth: null })
211
+ ```
212
+
213
+ ## Example Response
214
+
215
+ ```json
216
+ {
217
+ "address": "zig10d07y265gmmuvt4z0w9aw880jnsr700jmgkh5m"
218
+ }
219
+ ```
220
+
221
+ ## Response Field Explanation
222
+
223
+ | Field | Description |
224
+ | ------- | -------------------------------------------- |
225
+ | address | Bech32 address of the upgrade authority |
226
+
227
+ ## When to Use
228
+
229
+ * Auditing governance configuration
230
+ * Verifying upgrade permissions
231
+ * Building chain dashboards
232
+ * Security analysis
233
+ * Understanding governance structure
234
+
235
+ ---
236
+
237
+ # 3️⃣ fetchModuleVersions
238
+
239
+ ## Method
240
+
241
+ ```ts
242
+ async fetchModuleVersions(): Promise<ModuleVersionsResponse>
243
+ ```
244
+
245
+ ## CLI Equivalent
246
+
247
+ ```bash
248
+ zigchaind query upgrade module-versions
249
+ ```
250
+ ## Description
251
+
252
+ Fetches the **versions of all modules** running on the chain.
253
+
254
+ Returns a list of every module with its current version number.
255
+
256
+ This helps track which features and improvements are active on the network.
257
+
258
+ ## Parameters
259
+
260
+ None.
261
+
262
+ ## Usage Example
263
+
264
+ ```ts
265
+ const versions = await upgradeApi.fetchModuleVersions()
266
+ console.dir(versions, { depth: null })
267
+ ```
268
+
269
+ ## Example Response
270
+
271
+ ```json
272
+ {
273
+ "module_versions": [
274
+ { "name": "06-solomachine", "version": "0" },
275
+ { "name": "07-tendermint", "version": "0" },
276
+ { "name": "auth", "version": "5" },
277
+ { "name": "authz", "version": "2" },
278
+ { "name": "bank", "version": "4" },
279
+ { "name": "circuit", "version": "1" },
280
+ { "name": "consensus", "version": "1" },
281
+ { "name": "crisis", "version": "2" },
282
+ { "name": "dex", "version": "2" },
283
+ { "name": "distribution", "version": "3" },
284
+ { "name": "evidence", "version": "1" },
285
+ { "name": "factory", "version": "2" },
286
+ { "name": "feegrant", "version": "2" },
287
+ { "name": "genutil", "version": "1" },
288
+ { "name": "gov", "version": "5" },
289
+ { "name": "group", "version": "2" },
290
+ { "name": "ibc", "version": "8" },
291
+ { "name": "interchainaccounts", "version": "3" },
292
+ { "name": "mint", "version": "2" },
293
+ { "name": "nft", "version": "1" },
294
+ { "name": "packetfowardmiddleware", "version": "3" },
295
+ { "name": "params", "version": "1" },
296
+ { "name": "ratelimit", "version": "1" },
297
+ { "name": "runtime", "version": "0" },
298
+ { "name": "slashing", "version": "4" },
299
+ { "name": "staking", "version": "5" },
300
+ { "name": "tokenwrapper", "version": "2" },
301
+ { "name": "transfer", "version": "6" },
302
+ { "name": "upgrade", "version": "2" },
303
+ { "name": "vesting", "version": "1" },
304
+ { "name": "wasm", "version": "4" }
305
+ ]
306
+ }
307
+ ```
308
+
309
+ ## Response Field Explanation
310
+
311
+ ### `module_versions`
312
+
313
+ Array of module version objects.
314
+
315
+ Each entry contains:
316
+
317
+ | Field | Description |
318
+ | ------- | ------------------------ |
319
+ | name | Module name/identifier |
320
+ | version | Current version number |
321
+
322
+
323
+ ## Common ZigChain Modules
324
+
325
+ | Module Name | Purpose |
326
+ | ------------------------ | ------------------------------------------ |
327
+ | `auth` | Account authentication and management |
328
+ | `authz` | Authorization and delegation |
329
+ | `bank` | Token transfers and balances |
330
+ | `consensus` | Consensus parameters |
331
+ | `dex` | Decentralized exchange |
332
+ | `distribution` | Validator reward distribution |
333
+ | `factory` | Token factory for creating new assets |
334
+ | `gov` | On-chain governance and voting |
335
+ | `group` | Group account management |
336
+ | `ibc` | Inter-Blockchain Communication |
337
+ | `interchainaccounts` | IBC account abstraction |
338
+ | `mint` | Token minting and inflation |
339
+ | `nft` | NFT module |
340
+ | `slashing` | Validator punishment for misbehavior |
341
+ | `staking` | Validator staking and delegation |
342
+ | `transfer` | IBC asset transfers |
343
+ | `upgrade` | Network upgrade management |
344
+ | `wasm` | Smart contracts (WebAssembly) |
345
+
346
+ ## When to Use
347
+
348
+ * Checking which features are available on the chain
349
+ * Verifying module compatibility
350
+ * Building chain status dashboards
351
+ * Comparing module versions across networks
352
+ * Planning development based on module versions
353
+ * Auditing chain capabilities
354
+
355
+ ---
356
+
@@ -0,0 +1,177 @@
1
+ # Validator Set
2
+
3
+ ## What is the Validator Set?
4
+
5
+ The **Validator Set** is the active set of nodes currently responsible for producing and signing blocks on ZigChain.
6
+
7
+ At any given block height, a fixed set of validators participates in consensus. Each validator has a voting power proportional to their stake, and one validator is selected as the **proposer** for each block based on a weighted round-robin algorithm driven by `proposer_priority`.
8
+
9
+ ---
10
+
11
+ ## Important Terminology
12
+
13
+ ### Validator
14
+
15
+ A **validator** is a node actively participating in block production. They are identified here by their **consensus address** (`zigvalcons...`), which is distinct from their operator address (`zigvaloper...`) used in the staking module.
16
+
17
+ ---
18
+
19
+ ### Consensus Address
20
+
21
+ The `zigvalcons` address is the validator's identity. It is derived from their Ed25519 consensus public key.
22
+
23
+ Example:
24
+ ```
25
+ zigvalcons15hcvyh2h0rrzrsswzu67s83z2v462rantszqnx
26
+ ```
27
+
28
+ > This is different from the validator's staking operator address (`zigvaloper...`). The consensus address is used for block signing; the operator address is used for staking operations.
29
+
30
+ ---
31
+
32
+ ### Voting Power
33
+
34
+ A validator's **voting power** is their relative weight in the consensus process. It is proportional to the amount of stake bonded to that validator.
35
+
36
+ ---
37
+
38
+ ### Proposer Priority
39
+
40
+ An internal numeric value used by CometBFT's weighted round-robin algorithm to determine which validator proposes the next block. It adjusts each round based on voting power — validators with higher voting power propose more frequently.
41
+
42
+ This value oscillates between positive and negative and is not directly meaningful on its own.
43
+
44
+ ---
45
+
46
+ ### Historical Validator Set
47
+
48
+ The validator set is **not static** — validators can be added or removed via staking and governance. Querying at a specific height shows the exact set that was active at that point in chain history.
49
+
50
+ Comparing the validator set across heights lets you track validator churn — for example, the set at height `4009281` had 7 validators while the set at height `4646865` has 8, indicating a new validator joined during that period.
51
+
52
+ ---
53
+
54
+ ## Setup
55
+
56
+ ```ts
57
+ import {
58
+ ChainValidatorSetApi,
59
+ getNetworkEndpoints,
60
+ Network,
61
+ } from '@zuhaibnoor/zigchain-sdk'
62
+
63
+ const endpoints = getNetworkEndpoints(Network.Testnet)
64
+ const validatorApi = new ChainValidatorSetApi(endpoints)
65
+ ```
66
+
67
+ ---
68
+
69
+ # 1️⃣ fetchValidatorSet
70
+
71
+ ## Method
72
+
73
+ ```ts
74
+ async fetchValidatorSet(height?: number | string)
75
+ ```
76
+
77
+ ## CLI Equivalent
78
+
79
+ ```bash
80
+ # Latest validator set
81
+ zigchaind query comet-validator-set
82
+
83
+ # Validator set at a specific height
84
+ zigchaind query comet-validator-set <height>
85
+ ```
86
+
87
+ ## Description
88
+
89
+ Fetches the **full validator set** — either at the latest block or at a specific historical height.
90
+
91
+ Each entry in the set includes the validator's consensus address, their public key, current voting power, and proposer priority. This is the consensus-layer view of validators, as opposed to the staking-layer view available through the staking module.
92
+
93
+ Omit `height` to get the current active validator set. Pass a height to inspect the set at any past block.
94
+
95
+ ## Parameters
96
+
97
+ | Name | Type | Required | Description |
98
+ | ------ | ---------------- | -------- | --------------------------------------------------------- |
99
+ | height | number \| string | ❌ No | Block height to query. Omit for the latest validator set. |
100
+
101
+ ## Usage Example
102
+
103
+ **Latest validator set:**
104
+
105
+ ```ts
106
+ const validatorSet = await validatorApi.fetchValidatorSet()
107
+ console.dir(validatorSet, { depth: null })
108
+ ```
109
+
110
+ **Validator set at a specific height:**
111
+
112
+ ```ts
113
+ const validatorSetAtHeight = await validatorApi.fetchValidatorSet('4009281')
114
+ console.dir(validatorSetAtHeight, { depth: null })
115
+ ```
116
+
117
+ ## Example Response
118
+
119
+ ```json
120
+ {
121
+ "block_height": "4646865",
122
+ "validators": [
123
+ {
124
+ "address": "zigvalcons15hcvyh2h0rrzrsswzu67s83z2v462rantszqnx",
125
+ "pub_key": {
126
+ "@type": "/cosmos.crypto.ed25519.PubKey",
127
+ "key": "f+akljJ8Y0dKwWz3bKkRN+RDz9EM+yA/j7Gre+Hn02c="
128
+ },
129
+ "voting_power": "25350158",
130
+ "proposer_priority": "17577896"
131
+ },
132
+ {
133
+ "address": "zigvalcons13atuu9t8ryjaq6a5a3twjc2nudh7l6uemvgmes",
134
+ "pub_key": {
135
+ "@type": "/cosmos.crypto.ed25519.PubKey",
136
+ "key": "SBjHwAbgG2ZfZtbBMJgcr+z+S/2BuPQZROVLnvS4QHM="
137
+ },
138
+ "voting_power": "25227820",
139
+ "proposer_priority": "28755507"
140
+ }
141
+ ],
142
+ "pagination": {
143
+ "next_key": null,
144
+ "total": "8"
145
+ }
146
+ }
147
+ ```
148
+
149
+ ## Response Field Explanation
150
+
151
+ ### Top-level fields
152
+
153
+ | Field | Description |
154
+ | ------------ | ---------------------------------------------------- |
155
+ | block_height | The block height this validator set corresponds to |
156
+ | validators | Array of all active validators at this height |
157
+ | pagination | Pagination info for the validator list |
158
+
159
+ ### `validators[]` — Per-Validator Entry
160
+
161
+ | Field | Description |
162
+ | ----------------- | ------------------------------------------------------------------------ |
163
+ | address | Validator's consensus address (`zigvalcons...`) |
164
+ | pub_key.@type | Cryptographic key type — always `ed25519` for CometBFT validators |
165
+ | pub_key.key | Base64-encoded Ed25519 public key used for block signing |
166
+ | voting_power | Validator's weighted vote in consensus, proportional to bonded stake |
167
+ | proposer_priority | Internal CometBFT value used to select the next block proposer |
168
+
169
+ ---
170
+
171
+ ## When to Use
172
+
173
+ * Displaying the active validator set in a block explorer
174
+ * Checking current voting power distribution
175
+ * Tracking validator set changes over time
176
+ * Verifying which validators were active at a specific block
177
+ ---