@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,287 @@
1
+ # Slashing Module
2
+
3
+ ## What is the Slashing Module?
4
+
5
+ The **Slashing module** enforces validator accountability.
6
+
7
+ It penalizes validators for:
8
+
9
+ * Double-signing blocks
10
+ * Missing too many blocks (downtime)
11
+
12
+ Penalties may include:
13
+
14
+ * Token slashing (stake reduction)
15
+ * Temporary jailing
16
+ * Permanent tombstoning (for double-signing)
17
+
18
+ This module ensures network security and validator reliability.
19
+
20
+ ---
21
+
22
+ # Important Terminology
23
+
24
+ ### Validator Consensus Address (`valcons`)
25
+
26
+ A special validator address used for consensus-level operations.
27
+
28
+ Example:
29
+
30
+ ```text
31
+ zigvalcons1qd9g9rwjmgs7k02w65t2hlekc39vnqsq0ajs47
32
+ ```
33
+
34
+ Used when querying signing information.
35
+
36
+ ---
37
+
38
+ ### Signed Blocks Window
39
+
40
+ Number of recent blocks tracked for validator uptime.
41
+
42
+ ---
43
+
44
+ ### Missed Blocks Counter
45
+
46
+ Number of missed blocks within the tracking window.
47
+
48
+ ---
49
+
50
+ ### Tombstoned
51
+
52
+ If `true`, the validator permanently double-signed and can never rejoin the validator set.
53
+
54
+ ---
55
+
56
+ ### Jail
57
+
58
+ Temporary removal from the validator set due to downtime.
59
+
60
+ ---
61
+
62
+ # Setup
63
+
64
+ ```ts
65
+ import {
66
+ ChainSlashingApi,
67
+ getNetworkEndpoints,
68
+ Network,
69
+ } from '@zuhaibnoor/zigchain-sdk'
70
+
71
+ const endpoints = getNetworkEndpoints(Network.Testnet)
72
+ const slashingApi = new ChainSlashingApi(endpoints)
73
+ ```
74
+
75
+ ---
76
+
77
+ # 1️⃣ fetchParams
78
+
79
+ ## Method
80
+
81
+ ```ts
82
+ async fetchParams()
83
+ ```
84
+
85
+ ## CLI Equivalent
86
+
87
+ ```bash
88
+ zigchaind query slashing params
89
+ ```
90
+
91
+ ## Description
92
+
93
+ Fetches the **slashing module parameters** that define:
94
+
95
+ * Uptime requirements
96
+ * Jail duration
97
+ * Slashing percentages
98
+
99
+ ## Parameters
100
+
101
+ None.
102
+
103
+ ## Usage Example
104
+
105
+ ```ts
106
+ const params = await slashingApi.fetchParams()
107
+ console.dir(params, { depth: null })
108
+ ```
109
+
110
+ ## Example Response
111
+
112
+ ```json
113
+ {
114
+ "params": {
115
+ "signed_blocks_window": "35000",
116
+ "min_signed_per_window": "0.800000000000000000",
117
+ "downtime_jail_duration": "600s",
118
+ "slash_fraction_double_sign": "0.000500000000000000",
119
+ "slash_fraction_downtime": "0.000100000000000000"
120
+ }
121
+ }
122
+ ```
123
+
124
+ ## Response Field Explanation
125
+
126
+ | Field | Description |
127
+ | -------------------------- | ------------------------------------------------ |
128
+ | signed_blocks_window | Number of blocks tracked for validator uptime |
129
+ | min_signed_per_window | Minimum percentage of blocks that must be signed |
130
+ | downtime_jail_duration | Time a validator remains jailed for downtime |
131
+ | slash_fraction_double_sign | Percentage slashed for double-signing |
132
+ | slash_fraction_downtime | Percentage slashed for excessive downtime |
133
+
134
+ ### Example Interpretation
135
+
136
+ ```text
137
+ min_signed_per_window = 0.8 → validator must sign 80% of 35,000 blocks
138
+ downtime_jail_duration = 600s → jailed for 10 minutes
139
+ ```
140
+
141
+ ---
142
+
143
+ # 2️⃣ fetchSigningInfos
144
+
145
+ ## Method
146
+
147
+ ```ts
148
+ async fetchSigningInfos()
149
+ ```
150
+
151
+ ## CLI Equivalent
152
+
153
+ ```bash
154
+ zigchaind query slashing signing-infos
155
+ ```
156
+
157
+ ## Description
158
+
159
+ Fetches **signing information for all validators**.
160
+
161
+ Includes:
162
+
163
+ * Start height
164
+ * Jail status
165
+ * Missed block count
166
+ * Tombstone status
167
+
168
+ ## Parameters
169
+
170
+ None.
171
+
172
+ ## Usage Example
173
+
174
+ ```ts
175
+ const infos = await slashingApi.fetchSigningInfos()
176
+ console.log(infos)
177
+ ```
178
+
179
+ ## Example Response (Truncated)
180
+
181
+ ```json
182
+ {
183
+ "info": [
184
+ {
185
+ "address": "zigvalcons1qd9g9rwjmgs7k02w65t2hlekc39vnqsq0ajs47",
186
+ "start_height": "3909190",
187
+ "index_offset": "724541",
188
+ "jailed_until": "1970-01-01T00:00:00Z",
189
+ "tombstoned": false,
190
+ "missed_blocks_counter": "0"
191
+ }
192
+ ],
193
+ "pagination": {
194
+ "next_key": null,
195
+ "total": "8"
196
+ }
197
+ }
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Signing Info Field Explanation
203
+
204
+ | Field | Description |
205
+ | --------------------- | ----------------------------------- |
206
+ | address | Validator consensus address |
207
+ | start_height | Block height when tracking started |
208
+ | index_offset | Internal block tracking offset |
209
+ | jailed_until | Timestamp until validator is jailed |
210
+ | tombstoned | Permanent ban indicator |
211
+ | missed_blocks_counter | Number of missed blocks |
212
+
213
+ ### Jail Status Interpretation
214
+
215
+ If:
216
+
217
+ ```text
218
+ jailed_until = 1970-01-01T00:00:00Z
219
+ ```
220
+
221
+ The validator is **not currently jailed**.
222
+
223
+ If the timestamp is in the future → validator is jailed.
224
+
225
+ ---
226
+
227
+ # 3️⃣ fetchSigningInfo
228
+
229
+ ## Method
230
+
231
+ ```ts
232
+ async fetchSigningInfo(valConsAddress: string)
233
+ ```
234
+
235
+ ## CLI Equivalent
236
+
237
+ ```bash
238
+ zigchaind query slashing signing-info <valcons-address>
239
+ ```
240
+
241
+ ## Description
242
+
243
+ Fetches signing information for a **specific validator** using its consensus address.
244
+
245
+ ## Parameters
246
+
247
+ | Parameter | Type | Description |
248
+ | -------------- | ------ | --------------------------------------- |
249
+ | valConsAddress | string | Validator consensus (`valcons`) address |
250
+
251
+ ## Usage Example
252
+
253
+ ```ts
254
+ const singleInfo = await slashingApi.fetchSigningInfo(
255
+ 'zigvalcons1qd9g9rwjmgs7k02w65t2hlekc39vnqsq0ajs47'
256
+ )
257
+
258
+ console.dir(singleInfo, { depth: null })
259
+ ```
260
+
261
+ ## Example Response
262
+
263
+ ```json
264
+ {
265
+ "val_signing_info": {
266
+ "address": "zigvalcons1qd9g9rwjmgs7k02w65t2hlekc39vnqsq0ajs47",
267
+ "start_height": "3909190",
268
+ "index_offset": "724541",
269
+ "jailed_until": "1970-01-01T00:00:00Z",
270
+ "tombstoned": false,
271
+ "missed_blocks_counter": "0"
272
+ }
273
+ }
274
+ ```
275
+
276
+ ---
277
+
278
+ # Summary
279
+
280
+ | Function | CLI Equivalent | Purpose |
281
+ | --------------------- | ------------------------------------------------- | --------------------------------------- |
282
+ | `fetchParams()` | `zigchaind query slashing params` | Returns slashing configuration |
283
+ | `fetchSigningInfos()` | `zigchaind query slashing signing-infos` | Returns signing info for all validators |
284
+ | `fetchSigningInfo()` | `zigchaind query slashing signing-info <valcons>` | Returns signing info for one validator |
285
+
286
+ ---
287
+