@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,194 @@
1
+ # Evidence Module
2
+
3
+ ## What is the Evidence Module?
4
+
5
+ The **Evidence module** is responsible for handling **cryptographic proof of validator misbehavior** on ZigChain.
6
+
7
+ It allows the chain to objectively verify faults such as:
8
+
9
+ * Double-signing (signing two different blocks at the same height)
10
+ * Or other consensus rule violations
11
+
12
+ Once verified, this evidence is forwarded to the **Slashing module**, which may:
13
+
14
+ * Slash validator stake
15
+ * Jail the validator
16
+ * Tombstone the validator (permanent ban)
17
+
18
+ This module is part of ZigChain’s **core security layer**.
19
+
20
+ ---
21
+
22
+ ## Important Terminology
23
+
24
+ ### Evidence
25
+
26
+ **Evidence** is a cryptographic proof that a validator violated consensus rules.
27
+
28
+ It contains enough data for the blockchain to independently verify the misbehavior without trusting any party.
29
+
30
+ Evidence is:
31
+
32
+ * Public
33
+ * Immutable once accepted
34
+ * Automatically processed by the chain
35
+
36
+ ---
37
+
38
+ ### Evidence Hash
39
+
40
+ Each evidence record has a **unique hash** that identifies it on-chain.
41
+
42
+ This hash is used to query a specific evidence record via:
43
+
44
+ ```bash
45
+ zigchaind query evidence evidence <hash>
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Setup
51
+
52
+ ```ts
53
+ import {
54
+ ChainEvidenceApi,
55
+ getNetworkEndpoints,
56
+ Network
57
+ } from '@zuhaibnoor/zigchain-sdk'
58
+
59
+ const endpoints = getNetworkEndpoints(Network.Testnet)
60
+ const evidenceApi = new ChainEvidenceApi(endpoints)
61
+ ```
62
+
63
+ ---
64
+
65
+ # 1️⃣ fetchEvidence
66
+
67
+ ## Method
68
+
69
+ ```ts
70
+ async fetchEvidence(hash: string)
71
+ ```
72
+
73
+ ## CLI Equivalent
74
+
75
+ ```bash
76
+ zigchaind query evidence evidence <hash>
77
+ ```
78
+
79
+ ## Description
80
+
81
+ Fetches a **single evidence record** using its unique evidence hash.
82
+
83
+ This is useful when:
84
+
85
+ * You obtained a hash from logs or an explorer
86
+ * You are auditing a slashing event
87
+ * You are investigating validator misbehavior
88
+
89
+ If the hash does not exist, the chain will return an error.
90
+
91
+ ## Parameters
92
+
93
+ | Name | Type | Description |
94
+ | ---- | ------ | ------------------------------------------- |
95
+ | hash | string | Unique hash identifying the evidence record |
96
+
97
+ ## Usage Example
98
+
99
+ ```ts
100
+ const evidence = await evidenceApi.fetchEvidence(
101
+ 'A1B2C3D4E5F6...'
102
+ )
103
+
104
+ console.dir(evidence, { depth: null })
105
+ ```
106
+
107
+ ## Response Structure
108
+
109
+ ```ts
110
+ {
111
+ evidence: {
112
+ type_url: string
113
+ value: any
114
+ }
115
+ }
116
+ ```
117
+
118
+ ### `evidence`
119
+
120
+ | Field | Description |
121
+ ----------|------------|
122
+ | `type_url` | Identifies the evidence type (e.g., duplicate vote) |
123
+ | `value` | Evidence-specific structure (depends on type) |
124
+
125
+ ## When to Use
126
+
127
+ * Debugging validator slashing
128
+ * Explorer implementations
129
+ * Governance/security monitoring
130
+ * Auditing historical faults
131
+
132
+ ---
133
+
134
+ # 2️⃣ fetchAllEvidence
135
+
136
+ ## Method
137
+
138
+ ```ts
139
+ async fetchAllEvidence()
140
+ ```
141
+
142
+ ## CLI Equivalent
143
+
144
+ ```bash
145
+ zigchaind query evidence list
146
+ ```
147
+
148
+ ## Description
149
+
150
+ Returns **all submitted evidence records** currently stored on-chain.
151
+
152
+ On ZigChain testnet, this typically returns:
153
+
154
+ ```json
155
+ {
156
+ "evidence": [],
157
+ "pagination": {
158
+ "next_key": null,
159
+ "total": "0"
160
+ }
161
+ }
162
+ ```
163
+
164
+ This simply means no validator misbehavior has been recorded.
165
+
166
+ ## Parameters
167
+
168
+ None.
169
+
170
+ ## Usage Example
171
+
172
+ ```ts
173
+ const allEvidence = await evidenceApi.fetchAllEvidence()
174
+ console.dir(allEvidence, { depth: null })
175
+ ```
176
+
177
+ ## Response Structure
178
+
179
+ ```ts
180
+ {
181
+ evidence: Evidence[]
182
+ pagination: {
183
+ next_key: string | null
184
+ total: string
185
+ }
186
+ }
187
+ ```
188
+
189
+ ## When to Use
190
+
191
+ * Building blockchain explorers
192
+ * Monitoring validator behavior
193
+ * Security dashboards
194
+ ---
package/docs/factory.md CHANGED
@@ -1,7 +1,77 @@
1
1
  # Factory Module
2
2
 
3
- The **ChainFactoryApi** allows you to interact with the chain’s token factory module.
4
- It is used to query **denoms created by admins**, **denom details**, **denom authorizations**, and the **module parameters**.
3
+ ## What is the Factory Module?
4
+
5
+ The **Factory module** is a ZigChain-native token factory that allows any address to **create and manage custom tokens** directly on-chain.
6
+
7
+ ---
8
+
9
+ ## Important Terminology
10
+
11
+ ### Factory Token
12
+
13
+ A token created through the Factory module. Every factory token has a structured denom format:
14
+
15
+ ```
16
+ coin.<creator-address>.<token-name>
17
+ ```
18
+
19
+ Example:
20
+ ```
21
+ coin.zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a.neon
22
+ ```
23
+
24
+ This format ensures every factory token is globally unique and its creator is identifiable directly from the denom.
25
+
26
+ ---
27
+
28
+ ### Creator
29
+
30
+ The address that originally created the token through the Factory module. The creator address is permanently embedded in the token denom and cannot be changed.
31
+
32
+ ---
33
+
34
+ ### Bank Admin
35
+
36
+ The address authorized to **mint and burn** this token. By default this is the creator, but it can be transferred to another address — for example, a smart contract that controls minting logic.
37
+
38
+ ---
39
+
40
+ ### Metadata Admin
41
+
42
+ The address authorized to **update the token's metadata** (name, symbol, description, URI). Also defaults to the creator and can be transferred independently of the bank admin.
43
+
44
+ > Bank admin and metadata admin can be different addresses — this allows separating minting authority from metadata management.
45
+
46
+ ---
47
+
48
+ ### Minting Cap
49
+
50
+ The maximum amount that can be minted **in a single minting operation**. This is a per-operation limit, not a total supply limit.
51
+
52
+ ```
53
+ minting_cap = '1000000000'
54
+ ```
55
+
56
+ ---
57
+
58
+ ### Max Supply
59
+
60
+ The absolute maximum total supply this token can ever reach. Once `total_minted` reaches `max_supply`, no more tokens can be minted.
61
+
62
+ ```
63
+ max_supply = '1000000000'
64
+ ```
65
+
66
+ ---
67
+
68
+ ### Creation Fee
69
+
70
+ A flat fee in `uzig` that must be paid to create a new factory token. This fee goes to the configured `beneficiary` address.
71
+
72
+ ```
73
+ create_fee_amount = 100000000 → 100 ZIG
74
+ ```
5
75
 
6
76
  ---
7
77
 
@@ -16,144 +86,320 @@ import {
16
86
 
17
87
  const endpoints = getNetworkEndpoints(Network.Testnet)
18
88
  const factoryApi = new ChainFactoryApi(endpoints)
89
+
90
+ const denom = 'coin.zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a.neon'
91
+ const denom_admin = 'zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a'
19
92
  ```
20
93
 
21
94
  ---
22
95
 
23
- ## `fetchParams`
96
+ # 1️⃣ fetchParams
97
+
98
+ ## Method
24
99
 
25
- Fetch the **factory module parameters**.
100
+ ```ts
101
+ async fetchParams()
102
+ ```
26
103
 
27
- **CLI equivalent**
104
+ ## CLI Equivalent
28
105
 
29
106
  ```bash
30
107
  zigchaind query factory params
31
108
  ```
32
109
 
33
- **Method**
110
+ ## Description
34
111
 
35
- ```ts
36
- fetchParams()
37
- ```
112
+ Fetches the **Factory module parameters** configured at chain level.
38
113
 
39
- **Returns**
114
+ These governance-controlled settings define the cost of creating a new token and where that fee is sent. Anyone who wants to create a factory token must pay the `create_fee_amount` in `create_fee_denom` to the `beneficiary` address.
40
115
 
41
- * `FactoryParamsResponse` – Contains factory-related settings and limits.
116
+ ## Parameters
42
117
 
43
- **Example**
118
+ None.
119
+
120
+ ## Usage Example
44
121
 
45
122
  ```ts
46
123
  const params = await factoryApi.fetchParams()
47
- console.log('Factory params:')
48
124
  console.dir(params, { depth: null })
49
125
  ```
50
126
 
127
+ ## Example Response
128
+
129
+ ```json
130
+ {
131
+ "params": {
132
+ "create_fee_denom": "uzig",
133
+ "create_fee_amount": 100000000,
134
+ "beneficiary": "zig1s3mhkcycpgjj5tdv09ux6qg7hgzcyu6shzsfu0"
135
+ }
136
+ }
137
+ ```
138
+
139
+ ## Response Field Explanation
140
+
141
+ ### `params`
142
+
143
+ | Field | Description |
144
+ | ------------------ | ------------------------------------------------------------------------------- |
145
+ | create_fee_denom | Denomination in which the creation fee must be paid (always `uzig`) |
146
+ | create_fee_amount | Amount in `uzig` required to create a new token (`100000000` = 100 ZIG) |
147
+ | beneficiary | Address that receives the token creation fee |
148
+
149
+ ## When to Use
150
+
151
+ * Displaying token creation cost to users before they create a token
152
+ * Verifying current fee requirements for factory token creation
153
+ * Governance monitoring for fee parameter changes
154
+
51
155
  ---
52
156
 
53
- ## `fetchDenomsByAdmin`
157
+ # 2️⃣ fetchDenomsByAdmin
54
158
 
55
- Fetch all **denoms created by a specific admin address**.
159
+ ## Method
160
+
161
+ ```ts
162
+ async fetchDenomsByAdmin(admin: string)
163
+ ```
56
164
 
57
- **CLI equivalent**
165
+ ## CLI Equivalent
58
166
 
59
167
  ```bash
60
168
  zigchaind query factory denoms-by-admin <admin-address>
61
169
  ```
62
170
 
63
- **Method**
171
+ ---
64
172
 
65
- ```ts
66
- fetchDenomsByAdmin(admin: string)
67
- ```
173
+ ## Description
68
174
 
69
- **Parameters**
175
+ Fetches **all factory tokens created by a specific address**.
70
176
 
71
- * `admin: string` Address of the admin whose denoms you want to fetch.
177
+ This answers the question: "Which tokens has this address created through the factory module?" It returns the full list of token denoms owned by the given admin, paginated for large collections.
72
178
 
73
- **Returns**
179
+ ---
180
+
181
+ ## Parameters
74
182
 
75
- * `DenomsByAdminResponse` List of denoms created by the admin.
183
+ | Name | Type | Description |
184
+ | ----- | ------ | ------------------------------------------------------- |
185
+ | admin | string | Bech32 address of the token creator/admin to query |
186
+
187
+ ---
76
188
 
77
- **Example**
189
+ ## Usage Example
78
190
 
79
191
  ```ts
80
- const denoms = await factoryApi.fetchDenomsByAdmin('zig1...adminaddress')
81
- console.log('Denoms by admin:')
192
+ const denoms = await factoryApi.fetchDenomsByAdmin(denom_admin)
82
193
  console.dir(denoms, { depth: null })
83
194
  ```
84
195
 
196
+ ## Example Response
197
+
198
+ ```json
199
+ {
200
+ "denoms": [
201
+ "coin.zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a.neon"
202
+ ],
203
+ "pagination": {
204
+ "next_key": null,
205
+ "total": "1"
206
+ }
207
+ }
208
+ ```
209
+
210
+ ## Response Field Explanation
211
+
212
+ ### `denoms`
213
+
214
+ Array of factory token denoms created by this admin.
215
+
216
+ | Field | Description |
217
+ | ------ | -------------------------------------------------------------- |
218
+ | denoms | List of full token denom strings owned by this admin address |
219
+
220
+ Each denom follows the format `coin.<admin-address>.<token-name>`.
221
+
222
+ ### `pagination`
223
+
224
+ | Field | Description |
225
+ | -------- | ------------------------------------------------------------- |
226
+ | next_key | Cursor for next page. `null` if all results are returned |
227
+ | total | Total number of factory tokens created by this address |
228
+
229
+ ## When to Use
230
+
231
+ * Wallet dashboards showing all tokens a user has created
232
+ * Token discovery tools for a specific creator
233
+ * Auditing which tokens an address controls as admin
234
+ * Building creator profile pages in token explorers
235
+
85
236
  ---
86
237
 
87
- ## `fetchDenom`
238
+ # 3️⃣ fetchDenom
88
239
 
89
- Fetch **details of a specific denom**.
240
+ ## Method
90
241
 
91
- **CLI equivalent**
242
+ ```ts
243
+ async fetchDenom(denom: string)
244
+ ```
245
+
246
+ ## CLI Equivalent
92
247
 
93
248
  ```bash
94
249
  zigchaind query factory show-denom <denom>
95
250
  ```
96
251
 
97
- **Method**
252
+ ## Description
98
253
 
99
- ```ts
100
- fetchDenom(denom: string)
101
- ```
102
-
103
- **Parameters**
254
+ Fetches the **full details and lifecycle statistics** of a specific factory token.
104
255
 
105
- * `denom: string` The denom to query.
256
+ This returns everything about a token its supply stats (minted, burned, current), supply caps, whether the minting cap can be changed, and the addresses holding admin and metadata authority.
106
257
 
107
- **Returns**
258
+ ## Parameters
108
259
 
109
- * `ShowDenomResponse` Information about the denom, such as creator, admin, and metadata.
260
+ | Name | Type | Description |
261
+ | ----- | ------ | ---------------------------------------- |
262
+ | denom | string | Full factory token denom to query |
110
263
 
111
- **Example**
264
+ ## Usage Example
112
265
 
113
266
  ```ts
114
- const denomInfo = await factoryApi.fetchDenom('uzig')
115
- console.log('Denom info:')
267
+ const denomInfo = await factoryApi.fetchDenom(denom)
116
268
  console.dir(denomInfo, { depth: null })
117
269
  ```
118
270
 
119
- ---
271
+ ## Example Response
272
+
273
+ ```json
274
+ {
275
+ "denom": "coin.zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a.neon",
276
+ "total_minted": "0",
277
+ "total_supply": "0",
278
+ "total_burned": "0",
279
+ "minting_cap": "1000000000",
280
+ "max_supply": "1000000000",
281
+ "can_change_minting_cap": true,
282
+ "creator": "zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a",
283
+ "bank_admin": "zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a",
284
+ "metadata_admin": "zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a"
285
+ }
286
+ ```
120
287
 
121
- ## `fetchDenomAuth`
288
+ ## Response Field Explanation
122
289
 
123
- Fetch the **authorization details for a specific denom**.
290
+ | Field | Description |
291
+ | --------------------- | ---------------------------------------------------------------------------------- |
292
+ | denom | Full factory token denom string |
293
+ | total_minted | Cumulative amount ever minted since token creation |
294
+ | total_supply | Current circulating supply (`total_minted - total_burned`) |
295
+ | total_burned | Cumulative amount ever burned since token creation |
296
+ | minting_cap | Maximum amount mintable in a single minting operation |
297
+ | max_supply | Absolute maximum total supply this token can ever reach |
298
+ | can_change_minting_cap | Whether the bank admin can update the `minting_cap` in the future |
299
+ | creator | Address that originally created this token — permanently embedded in the denom |
300
+ | bank_admin | Address authorized to mint and burn this token |
301
+ | metadata_admin | Address authorized to update this token's name, symbol, description, and URI |
124
302
 
125
- **CLI equivalent**
303
+ ### Supply Lifecycle
126
304
 
127
- ```bash
128
- zigchaind query factory denom-auth <denom>
305
+ ```
306
+ total_minted - total_burned = total_supply
129
307
  ```
130
308
 
131
- **Method**
309
+ | Field | Meaning |
310
+ | ------------- | -------------------------------------------- |
311
+ | total_minted | All tokens ever created (cumulative) |
312
+ | total_burned | All tokens ever destroyed (cumulative) |
313
+ | total_supply | Tokens currently in circulation |
314
+
315
+ > In the example, all three supply fields are `0` — this token was created but no minting has occurred yet.
316
+
317
+ ## When to Use
318
+
319
+ * Verifying a token's supply cap before interacting with it
320
+ * Checking who controls minting and metadata for a token
321
+ * Auditing token admin authority for security reviews
322
+ * Tracking a token's mint/burn history over time
323
+
324
+ ---
325
+
326
+ # 4️⃣ fetchDenomAuth
327
+
328
+ ## Method
132
329
 
133
330
  ```ts
134
- fetchDenomAuth(denom: string)
331
+ async fetchDenomAuth(denom: string)
135
332
  ```
136
333
 
137
- **Parameters**
334
+ ## CLI Equivalent
335
+
336
+ ```bash
337
+ zigchaind query factory denom-auth <denom>
338
+ ```
138
339
 
139
- * `denom: string` – The denom to query.
340
+ ## Description
140
341
 
141
- **Returns**
342
+ Fetches the **current authorization configuration** for a factory token — specifically which addresses hold bank admin and metadata admin authority.
142
343
 
143
- * `DenomAuthResponse` Shows the permissions and authorities associated with the denom.
344
+ This is a lightweight alternative to `fetchDenom` when you only need to check who controls a token, without the full supply statistics.
144
345
 
145
- **Example**
346
+ ## Parameters
347
+
348
+ | Name | Type | Description |
349
+ | ----- | ------ | ----------------------------------------- |
350
+ | denom | string | Full factory token denom to query |
351
+
352
+ ## Usage Example
146
353
 
147
354
  ```ts
148
- const auth = await factoryApi.fetchDenomAuth('uzig')
149
- console.log('Denom authorization:')
355
+ const auth = await factoryApi.fetchDenomAuth(denom)
150
356
  console.dir(auth, { depth: null })
151
357
  ```
152
358
 
153
- ---
359
+ ## Example Response
360
+
361
+ ```json
362
+ {
363
+ "denom_auth": {
364
+ "denom": "coin.zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a.neon",
365
+ "bank_admin": "zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a",
366
+ "metadata_admin": "zig1020uljv3lamnhlgvetx5tq5gtjl6p7ggvepdeep2fjul6u0pevzsjz270a"
367
+ }
368
+ }
369
+ ```
370
+
371
+ ## Response Field Explanation
372
+
373
+ ### `denom_auth`
374
+
375
+ | Field | Description |
376
+ | -------------- | ------------------------------------------------------------------------ |
377
+ | denom | The factory token denom this authorization applies to |
378
+ | bank_admin | Address authorized to mint and burn this token |
379
+ | metadata_admin | Address authorized to update this token's metadata |
380
+
381
+ ### `fetchDenom` vs `fetchDenomAuth`
382
+
383
+ | Feature | fetchDenom | fetchDenomAuth |
384
+ | -------------------------- | ------------------- | --------------------------- |
385
+ | Admin addresses | ✅ Yes | ✅ Yes |
386
+ | Supply statistics | ✅ Yes | ❌ No |
387
+ | Supply caps | ✅ Yes | ❌ No |
388
+ | Creator address | ✅ Yes | ❌ No |
389
+ | Use case | Full token details | Quick authority check only |
390
+
391
+ ### Admin Role Separation
392
+
393
+ | Role | Can Do | Cannot Do |
394
+ | -------------- | --------------------------------------------- | ---------------------------- |
395
+ | bank_admin | Mint tokens, burn tokens, update minting cap | Change metadata |
396
+ | metadata_admin | Update name, symbol, description, URI | Mint or burn tokens |
397
+
398
+ > When both admin roles are the same address (as in the example), the creator has full control over the token. When they differ, minting authority and metadata authority are independently delegated.
399
+
400
+ ## When to Use
154
401
 
155
- ## Notes
402
+ * Quick check of who can mint or burn a specific token
403
+ * Verifying whether admin authority has been transferred
404
+ * Security audits of token control structures
156
405
 
157
- * All queries are **read-only** and do not require a wallet.
158
- * Useful for tracking **admin-created tokens** and their **permissions**.
159
- * Denom authorizations indicate **who can mint, burn, or manage a token**.