@zuhaibnoor/zigchain-sdk 1.0.2 → 1.1.0

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 (172) hide show
  1. package/dist/auth/ChainAuthApi.d.ts +0 -3
  2. package/dist/auth/ChainAuthApi.d.ts.map +1 -1
  3. package/dist/auth/ChainAuthApi.js +0 -26
  4. package/dist/auth/ChainAuthApi.js.map +1 -1
  5. package/dist/bank/ChainBankApi.d.ts +0 -9
  6. package/dist/bank/ChainBankApi.d.ts.map +1 -1
  7. package/dist/bank/ChainBankApi.js +0 -18
  8. package/dist/bank/ChainBankApi.js.map +1 -1
  9. package/dist/client/http.d.ts +1 -0
  10. package/dist/client/http.d.ts.map +1 -1
  11. package/dist/client/http.js +10 -0
  12. package/dist/client/http.js.map +1 -1
  13. package/dist/distribution/ChainDistributionApi.d.ts +47 -0
  14. package/dist/distribution/ChainDistributionApi.d.ts.map +1 -0
  15. package/dist/distribution/ChainDistributionApi.js +75 -0
  16. package/dist/distribution/ChainDistributionApi.js.map +1 -0
  17. package/dist/distribution/types.d.ts +71 -0
  18. package/dist/distribution/types.d.ts.map +1 -0
  19. package/dist/distribution/types.js +2 -0
  20. package/dist/distribution/types.js.map +1 -0
  21. package/dist/evidence/ChainEvidenceApi.d.ts +15 -0
  22. package/dist/evidence/ChainEvidenceApi.d.ts.map +1 -0
  23. package/dist/evidence/ChainEvidenceApi.js +22 -0
  24. package/dist/evidence/ChainEvidenceApi.js.map +1 -0
  25. package/dist/evidence/types.d.ts +15 -0
  26. package/dist/evidence/types.d.ts.map +1 -0
  27. package/dist/evidence/types.js +2 -0
  28. package/dist/evidence/types.js.map +1 -0
  29. package/dist/feegrant/ChainFeegrantApi.d.ts +22 -0
  30. package/dist/feegrant/ChainFeegrantApi.d.ts.map +1 -0
  31. package/dist/feegrant/ChainFeegrantApi.js +32 -0
  32. package/dist/feegrant/ChainFeegrantApi.js.map +1 -0
  33. package/dist/feegrant/types.d.ts +17 -0
  34. package/dist/feegrant/types.d.ts.map +1 -0
  35. package/dist/feegrant/types.js +2 -0
  36. package/dist/feegrant/types.js.map +1 -0
  37. package/dist/ibc/ChainIbcApi.d.ts +55 -0
  38. package/dist/ibc/ChainIbcApi.d.ts.map +1 -0
  39. package/dist/ibc/ChainIbcApi.js +82 -0
  40. package/dist/ibc/ChainIbcApi.js.map +1 -0
  41. package/dist/ibc/ibcChannel/ChainIbcChannelApi.d.ts +55 -0
  42. package/dist/ibc/ibcChannel/ChainIbcChannelApi.d.ts.map +1 -0
  43. package/dist/ibc/ibcChannel/ChainIbcChannelApi.js +82 -0
  44. package/dist/ibc/ibcChannel/ChainIbcChannelApi.js.map +1 -0
  45. package/dist/ibc/ibcChannel/types.d.ts +106 -0
  46. package/dist/ibc/ibcChannel/types.d.ts.map +1 -0
  47. package/dist/ibc/ibcChannel/types.js +2 -0
  48. package/dist/ibc/ibcChannel/types.js.map +1 -0
  49. package/dist/ibc/ibcChannelV2/ChainIbcChannelV2.d.ts +14 -0
  50. package/dist/ibc/ibcChannelV2/ChainIbcChannelV2.d.ts.map +1 -0
  51. package/dist/ibc/ibcChannelV2/ChainIbcChannelV2.js +38 -0
  52. package/dist/ibc/ibcChannelV2/ChainIbcChannelV2.js.map +1 -0
  53. package/dist/ibc/ibcChannelV2/types.d.ts +26 -0
  54. package/dist/ibc/ibcChannelV2/types.d.ts.map +1 -0
  55. package/dist/ibc/ibcChannelV2/types.js +3 -0
  56. package/dist/ibc/ibcChannelV2/types.js.map +1 -0
  57. package/dist/ibc/ibcClient/ChainIbcClientApi.d.ts +15 -0
  58. package/dist/ibc/ibcClient/ChainIbcClientApi.d.ts.map +1 -0
  59. package/dist/ibc/ibcClient/ChainIbcClientApi.js +39 -0
  60. package/dist/ibc/ibcClient/ChainIbcClientApi.js.map +1 -0
  61. package/dist/ibc/ibcClient/types.d.ts +53 -0
  62. package/dist/ibc/ibcClient/types.d.ts.map +1 -0
  63. package/dist/ibc/ibcClient/types.js +2 -0
  64. package/dist/ibc/ibcClient/types.js.map +1 -0
  65. package/dist/ibc/ibcConnection/ChainIbcConnectionApi.d.ts +11 -0
  66. package/dist/ibc/ibcConnection/ChainIbcConnectionApi.d.ts.map +1 -0
  67. package/dist/ibc/ibcConnection/ChainIbcConnectionApi.js +24 -0
  68. package/dist/ibc/ibcConnection/ChainIbcConnectionApi.js.map +1 -0
  69. package/dist/ibc/ibcConnection/types.d.ts +18 -0
  70. package/dist/ibc/ibcConnection/types.d.ts.map +1 -0
  71. package/dist/ibc/ibcConnection/types.js +2 -0
  72. package/dist/ibc/ibcConnection/types.js.map +1 -0
  73. package/dist/ibc/types.d.ts +106 -0
  74. package/dist/ibc/types.d.ts.map +1 -0
  75. package/dist/ibc/types.js +2 -0
  76. package/dist/ibc/types.js.map +1 -0
  77. package/dist/ibc-transfer/ChainIbcTransferApi.d.ts +12 -0
  78. package/dist/ibc-transfer/ChainIbcTransferApi.d.ts.map +1 -0
  79. package/dist/ibc-transfer/ChainIbcTransferApi.js +30 -0
  80. package/dist/ibc-transfer/ChainIbcTransferApi.js.map +1 -0
  81. package/dist/ibc-transfer/types.d.ts +26 -0
  82. package/dist/ibc-transfer/types.d.ts.map +1 -0
  83. package/dist/ibc-transfer/types.js +2 -0
  84. package/dist/ibc-transfer/types.js.map +1 -0
  85. package/dist/index.d.ts +26 -0
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +26 -0
  88. package/dist/index.js.map +1 -1
  89. package/dist/interchain-accounts/ChainInterChainAccApi.d.ts +9 -0
  90. package/dist/interchain-accounts/ChainInterChainAccApi.d.ts.map +1 -0
  91. package/dist/interchain-accounts/ChainInterChainAccApi.js +16 -0
  92. package/dist/interchain-accounts/ChainInterChainAccApi.js.map +1 -0
  93. package/dist/interchain-accounts/types.d.ts +12 -0
  94. package/dist/interchain-accounts/types.d.ts.map +1 -0
  95. package/dist/interchain-accounts/types.js +2 -0
  96. package/dist/interchain-accounts/types.js.map +1 -0
  97. package/dist/networks/endpoints.js +2 -2
  98. package/dist/networks/endpoints.js.map +1 -1
  99. package/dist/runtime/ChainRuntimeApi.d.ts +12 -0
  100. package/dist/runtime/ChainRuntimeApi.d.ts.map +1 -0
  101. package/dist/runtime/ChainRuntimeApi.js +16 -0
  102. package/dist/runtime/ChainRuntimeApi.js.map +1 -0
  103. package/dist/runtime/types.d.ts +4 -0
  104. package/dist/runtime/types.d.ts.map +1 -0
  105. package/dist/runtime/types.js +2 -0
  106. package/dist/runtime/types.js.map +1 -0
  107. package/dist/tokenwrapper/ChainTokenWrapperApi.d.ts +19 -0
  108. package/dist/tokenwrapper/ChainTokenWrapperApi.d.ts.map +1 -0
  109. package/dist/tokenwrapper/ChainTokenWrapperApi.js +26 -0
  110. package/dist/tokenwrapper/ChainTokenWrapperApi.js.map +1 -0
  111. package/dist/tokenwrapper/types.d.ts +15 -0
  112. package/dist/tokenwrapper/types.d.ts.map +1 -0
  113. package/dist/tokenwrapper/types.js +2 -0
  114. package/dist/tokenwrapper/types.js.map +1 -0
  115. package/dist/txs/ChainTxsApi.d.ts +12 -0
  116. package/dist/txs/ChainTxsApi.d.ts.map +1 -0
  117. package/dist/txs/ChainTxsApi.js +17 -0
  118. package/dist/txs/ChainTxsApi.js.map +1 -0
  119. package/dist/txs/types.d.ts +22 -0
  120. package/dist/txs/types.d.ts.map +1 -0
  121. package/dist/txs/types.js +5 -0
  122. package/dist/txs/types.js.map +1 -0
  123. package/dist/upgrade/ChainUpgradeApi.d.ts +22 -0
  124. package/dist/upgrade/ChainUpgradeApi.d.ts.map +1 -0
  125. package/dist/upgrade/ChainUpgradeApi.js +40 -0
  126. package/dist/upgrade/ChainUpgradeApi.js.map +1 -0
  127. package/dist/upgrade/types.d.ts +24 -0
  128. package/dist/upgrade/types.d.ts.map +1 -0
  129. package/dist/upgrade/types.js +5 -0
  130. package/dist/upgrade/types.js.map +1 -0
  131. package/dist/validator-set/ChainCometValidator.d.ts +8 -0
  132. package/dist/validator-set/ChainCometValidator.d.ts.map +1 -0
  133. package/dist/validator-set/ChainCometValidator.js +15 -0
  134. package/dist/validator-set/ChainCometValidator.js.map +1 -0
  135. package/dist/validator-set/types.d.ts +18 -0
  136. package/dist/validator-set/types.d.ts.map +1 -0
  137. package/dist/validator-set/types.js +2 -0
  138. package/dist/validator-set/types.js.map +1 -0
  139. package/dist/wasm/ChainWasmApi.d.ts +57 -0
  140. package/dist/wasm/ChainWasmApi.d.ts.map +1 -0
  141. package/dist/wasm/ChainWasmApi.js +78 -0
  142. package/dist/wasm/ChainWasmApi.js.map +1 -0
  143. package/dist/wasm/types.d.ts +77 -0
  144. package/dist/wasm/types.d.ts.map +1 -0
  145. package/dist/wasm/types.js +2 -0
  146. package/dist/wasm/types.js.map +1 -0
  147. package/docs/auth.md +555 -0
  148. package/docs/bank.md +974 -0
  149. package/docs/block-results.md +371 -0
  150. package/docs/block.md +97 -0
  151. package/docs/circuit.md +93 -0
  152. package/docs/comet-validator-set.md +70 -0
  153. package/docs/dex.md +159 -0
  154. package/docs/distribution.md +201 -0
  155. package/docs/evidence.md +199 -0
  156. package/docs/factory.md +159 -0
  157. package/docs/feegrant.md +206 -0
  158. package/docs/gov.md +166 -0
  159. package/docs/ibc/ibcChannel.md +490 -0
  160. package/docs/ibc/ibcClient.md +302 -0
  161. package/docs/ibc/ibcConnection.md +214 -0
  162. package/docs/ibc-transfer.md +204 -0
  163. package/docs/interchain-accounts.md +120 -0
  164. package/docs/mint.md +133 -0
  165. package/docs/runtime.md +81 -0
  166. package/docs/slashing.md +139 -0
  167. package/docs/staking.md +633 -0
  168. package/docs/tokenwrapper.md +137 -0
  169. package/docs/txs.md +0 -0
  170. package/docs/upgrade.md +133 -0
  171. package/docs/wasm.md +916 -0
  172. package/package.json +2 -1
@@ -0,0 +1,137 @@
1
+ # Token Wrapper Module
2
+
3
+ The **Token Wrapper module** keeps track of ZIG tokens that move **out of ZigChain to other blockchains** and come **back again**.
4
+ It helps the chain maintain balance by **locking tokens when they leave** and **unlocking them when they return**, so no extra tokens are ever created.
5
+
6
+ ---
7
+
8
+ ## How Token Wrapping Works (Simple Explanation)
9
+
10
+ 1. You send **ZIG tokens out of ZigChain**
11
+ 2. Those ZIG tokens are **locked** on ZigChain
12
+ 3. You receive **wrapped ZIG** on another chain
13
+ 4. If wrapped ZIG comes back:
14
+
15
+ * Wrapped tokens are **destroyed**
16
+ * Original ZIG tokens are **unlocked**
17
+
18
+ If wrapped ZIG is **spent on the other chain and never returned**,
19
+ the corresponding ZIG **remains locked forever** on ZigChain.
20
+
21
+ ---
22
+
23
+ ## Setup
24
+
25
+ ```ts
26
+ import {
27
+ ChainTokenWrapperApi,
28
+ getNetworkEndpoints,
29
+ Network
30
+ } from '@zuhaibnoor/zigchain-sdk'
31
+
32
+ const endpoints = getNetworkEndpoints(Network.Testnet)
33
+ const tokenWrapperApi = new ChainTokenWrapperApi(endpoints)
34
+ ```
35
+
36
+ ---
37
+
38
+ ## `fetchModuleInfo`
39
+
40
+ Returns basic information about the Token Wrapper module.
41
+
42
+
43
+ **Method**
44
+
45
+ ```ts
46
+ fetchModuleInfo()
47
+ ```
48
+
49
+ **Example**
50
+
51
+ ```ts
52
+ const info = await tokenWrapperApi.fetchModuleInfo()
53
+ console.log(info)
54
+ ```
55
+
56
+ **Use case**
57
+
58
+ * Verify that the Token Wrapper module is available and active on the chain
59
+
60
+ ---
61
+
62
+ ## `fetchParams`
63
+
64
+ Fetches the **configuration parameters** of the Token Wrapper module.
65
+
66
+ **Method**
67
+
68
+ ```ts
69
+ fetchParams()
70
+ ```
71
+
72
+ **Example**
73
+
74
+ ```ts
75
+ const params = await tokenWrapperApi.fetchParams()
76
+ console.log(params)
77
+ ```
78
+
79
+ **Use case**
80
+
81
+ * Check whether token wrapping is enabled
82
+ * Inspect module behavior settings
83
+
84
+ ---
85
+
86
+ ## `fetchTotalTransfers`
87
+
88
+ Returns the **total amount of ZIG tokens**:
89
+
90
+ * Sent **out of ZigChain**
91
+ * Returned **back to ZigChain**
92
+
93
+ **Method**
94
+
95
+ ```ts
96
+ fetchTotalTransfers()
97
+ ```
98
+
99
+ **Example**
100
+
101
+ ```ts
102
+ const totals = await tokenWrapperApi.fetchTotalTransfers()
103
+ console.log(totals)
104
+ ```
105
+
106
+ **What this tells you**
107
+
108
+ * How much ZIG is currently **locked**
109
+ * How much ZIG has **returned**
110
+ * Helps audit cross-chain token movement
111
+
112
+ ---
113
+
114
+ ## Real-World Example
115
+
116
+ * You send **10 ZIG** out of ZigChain
117
+ * ZigChain **locks 10 ZIG**
118
+ * You receive **10 wrapped ZIG** on another chain
119
+ * You spend **5 wrapped ZIG**
120
+ * You return **5 wrapped ZIG** back
121
+
122
+ Result:
123
+
124
+ * **5 ZIG unlocked and returned**
125
+ * **5 ZIG remain locked forever** (because they were spent)
126
+
127
+ ---
128
+
129
+ ## Summary Table
130
+
131
+ | Function | Purpose |
132
+ | --------------------- | ----------------------------------------------- |
133
+ | `fetchModuleInfo` | Shows basic info about the Token Wrapper module |
134
+ | `fetchParams` | Displays module configuration settings |
135
+ | `fetchTotalTransfers` | Shows total ZIG moved out and returned |
136
+
137
+
package/docs/txs.md ADDED
File without changes
@@ -0,0 +1,133 @@
1
+ # Upgrade Module
2
+
3
+ The **ChainUpgradeApi** lets you query on-chain upgrade information.
4
+
5
+ It is used to fetch the **current upgrade plan**, **upgrade authority**, and **module versions**, which helps track scheduled chain upgrades and module migration states.
6
+
7
+ ---
8
+
9
+ ## Setup
10
+
11
+ ```ts
12
+ import {
13
+ ChainUpgradeApi,
14
+ getNetworkEndpoints,
15
+ Network,
16
+ } from '@zuhaibnoor/zigchain-sdk'
17
+
18
+ const endpoints = getNetworkEndpoints(Network.Testnet)
19
+ const upgradeApi = new ChainUpgradeApi(endpoints)
20
+ ```
21
+
22
+ ---
23
+
24
+ ## `fetchCurrentPlan()`
25
+
26
+ Fetch the **currently scheduled upgrade plan** (if one exists).
27
+
28
+ **CLI equivalent**
29
+
30
+ ```bash
31
+ zigchaind query upgrade plan
32
+ ```
33
+
34
+ **Method**
35
+
36
+ ```ts
37
+ fetchCurrentPlan()
38
+ ```
39
+
40
+ **Example**
41
+
42
+ ```ts
43
+ const plan = await upgradeApi.fetchCurrentPlan()
44
+ console.dir(plan, { depth: null })
45
+ ```
46
+
47
+ ---
48
+
49
+ ## `fetchAuthority()`
50
+
51
+ Fetch the **upgrade authority address**.
52
+
53
+ This is typically the governance module account that has permission to schedule upgrades.
54
+
55
+ **CLI equivalent**
56
+
57
+ ```bash
58
+ zigchaind query upgrade authority
59
+ ```
60
+
61
+ **Method**
62
+
63
+ ```ts
64
+ fetchAuthority()
65
+ ```
66
+
67
+ **Example**
68
+
69
+ ```ts
70
+ const authority = await upgradeApi.fetchAuthority()
71
+ console.log(authority)
72
+ ```
73
+
74
+ ---
75
+
76
+ ## `fetchModuleVersions()`
77
+
78
+ Fetch the **module consensus versions** currently running on-chain.
79
+
80
+ This is useful during upgrades to verify module migrations.
81
+
82
+ **CLI equivalent**
83
+
84
+ ```bash
85
+ zigchaind query upgrade module-versions
86
+ ```
87
+
88
+ **Method**
89
+
90
+ ```ts
91
+ fetchModuleVersions()
92
+ ```
93
+
94
+ **Example**
95
+
96
+ ```ts
97
+ const versions = await upgradeApi.fetchModuleVersions()
98
+ console.dir(versions, { depth: null })
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Example (Full)
104
+
105
+ ```ts
106
+ import {
107
+ ChainUpgradeApi,
108
+ getNetworkEndpoints,
109
+ Network
110
+ } from '@zuhaibnoor/zigchain-sdk'
111
+
112
+ async function main() {
113
+ const endpoints = getNetworkEndpoints(Network.Testnet)
114
+ const upgradeApi = new ChainUpgradeApi(endpoints)
115
+
116
+ console.log('--- Current Upgrade Plan ---')
117
+ const plan = await upgradeApi.fetchCurrentPlan()
118
+ console.dir(plan, { depth: null })
119
+
120
+ console.log('\n--- Upgrade Authority ---')
121
+ const authority = await upgradeApi.fetchAuthority()
122
+ console.log(authority)
123
+
124
+ console.log('\n--- Module Versions ---')
125
+ const versions = await upgradeApi.fetchModuleVersions()
126
+ console.dir(versions, { depth: null })
127
+ }
128
+
129
+ main()
130
+ ```
131
+
132
+ ---
133
+