@gnolang/tm2-js-client 1.3.3 → 2.0.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 (316) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.cjs +12 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.mjs +12 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.cjs +14 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.mjs +14 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.cjs +9 -0
  7. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.mjs +9 -0
  8. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.cjs +16 -0
  9. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.mjs +11 -0
  10. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  11. package/dist/index.cjs +92 -0
  12. package/dist/index.cjs.map +1 -0
  13. package/dist/index.d.cts +23 -0
  14. package/dist/index.d.cts.map +1 -0
  15. package/dist/index.d.mts +23 -0
  16. package/dist/index.d.mts.map +1 -0
  17. package/dist/index.mjs +22 -0
  18. package/dist/index.mjs.map +1 -0
  19. package/dist/proto/google/protobuf/any.cjs +84 -0
  20. package/dist/proto/google/protobuf/any.cjs.map +1 -0
  21. package/dist/proto/google/protobuf/any.d.cts +141 -0
  22. package/dist/proto/google/protobuf/any.d.cts.map +1 -0
  23. package/dist/proto/google/protobuf/any.d.mts +141 -0
  24. package/dist/proto/google/protobuf/any.d.mts.map +1 -0
  25. package/dist/proto/google/protobuf/any.mjs +83 -0
  26. package/dist/proto/google/protobuf/any.mjs.map +1 -0
  27. package/dist/proto/index.cjs +2 -0
  28. package/dist/proto/index.d.cts +2 -0
  29. package/dist/proto/index.d.mts +2 -0
  30. package/dist/proto/index.mjs +3 -0
  31. package/dist/proto/tm2/abci.cjs +182 -0
  32. package/dist/proto/tm2/abci.cjs.map +1 -0
  33. package/dist/proto/tm2/abci.d.cts +33 -0
  34. package/dist/proto/tm2/abci.d.cts.map +1 -0
  35. package/dist/proto/tm2/abci.d.mts +33 -0
  36. package/dist/proto/tm2/abci.d.mts.map +1 -0
  37. package/dist/proto/tm2/abci.mjs +181 -0
  38. package/dist/proto/tm2/abci.mjs.map +1 -0
  39. package/dist/proto/tm2/tx.cjs +263 -0
  40. package/dist/proto/tm2/tx.cjs.map +1 -0
  41. package/dist/proto/tm2/tx.d.cts +49 -0
  42. package/dist/proto/tm2/tx.d.cts.map +1 -0
  43. package/dist/proto/tm2/tx.d.mts +49 -0
  44. package/dist/proto/tm2/tx.d.mts.map +1 -0
  45. package/dist/proto/tm2/tx.mjs +258 -0
  46. package/dist/proto/tm2/tx.mjs.map +1 -0
  47. package/dist/provider/endpoints.cjs +43 -0
  48. package/dist/provider/endpoints.cjs.map +1 -0
  49. package/dist/provider/endpoints.d.cts +33 -0
  50. package/dist/provider/endpoints.d.cts.map +1 -0
  51. package/dist/provider/endpoints.d.mts +33 -0
  52. package/dist/provider/endpoints.d.mts.map +1 -0
  53. package/dist/provider/endpoints.mjs +39 -0
  54. package/dist/provider/endpoints.mjs.map +1 -0
  55. package/dist/provider/errors/errors.cjs +122 -0
  56. package/dist/provider/errors/errors.cjs.map +1 -0
  57. package/dist/provider/errors/errors.d.cts +62 -0
  58. package/dist/provider/errors/errors.d.cts.map +1 -0
  59. package/dist/provider/errors/errors.d.mts +62 -0
  60. package/dist/provider/errors/errors.d.mts.map +1 -0
  61. package/dist/provider/errors/errors.mjs +104 -0
  62. package/dist/provider/errors/errors.mjs.map +1 -0
  63. package/dist/provider/errors/messages.cjs +40 -0
  64. package/dist/provider/errors/messages.cjs.map +1 -0
  65. package/dist/provider/errors/messages.mjs +23 -0
  66. package/dist/provider/errors/messages.mjs.map +1 -0
  67. package/dist/provider/index.cjs +12 -0
  68. package/dist/provider/index.d.cts +11 -0
  69. package/dist/provider/index.d.mts +11 -0
  70. package/dist/provider/index.mjs +13 -0
  71. package/dist/provider/jsonrpc/index.cjs +1 -0
  72. package/dist/provider/jsonrpc/index.d.cts +1 -0
  73. package/dist/provider/jsonrpc/index.d.mts +1 -0
  74. package/dist/provider/jsonrpc/index.mjs +2 -0
  75. package/dist/provider/jsonrpc/jsonrpc.cjs +20 -0
  76. package/dist/provider/jsonrpc/jsonrpc.cjs.map +1 -0
  77. package/dist/provider/jsonrpc/jsonrpc.d.cts +16 -0
  78. package/dist/provider/jsonrpc/jsonrpc.d.cts.map +1 -0
  79. package/dist/provider/jsonrpc/jsonrpc.d.mts +16 -0
  80. package/dist/provider/jsonrpc/jsonrpc.d.mts.map +1 -0
  81. package/dist/provider/jsonrpc/jsonrpc.mjs +19 -0
  82. package/dist/provider/jsonrpc/jsonrpc.mjs.map +1 -0
  83. package/dist/provider/provider.cjs +130 -0
  84. package/dist/provider/provider.cjs.map +1 -0
  85. package/dist/provider/provider.d.cts +130 -0
  86. package/dist/provider/provider.d.cts.map +1 -0
  87. package/dist/provider/provider.d.mts +130 -0
  88. package/dist/provider/provider.d.mts.map +1 -0
  89. package/dist/provider/provider.mjs +130 -0
  90. package/dist/provider/provider.mjs.map +1 -0
  91. package/dist/provider/types/abci.cjs +6 -0
  92. package/dist/provider/types/abci.cjs.map +1 -0
  93. package/dist/provider/types/abci.d.cts +42 -0
  94. package/dist/provider/types/abci.d.cts.map +1 -0
  95. package/dist/provider/types/abci.d.mts +42 -0
  96. package/dist/provider/types/abci.d.mts.map +1 -0
  97. package/dist/provider/types/abci.mjs +6 -0
  98. package/dist/provider/types/abci.mjs.map +1 -0
  99. package/dist/provider/types/common.d.cts +186 -0
  100. package/dist/provider/types/common.d.cts.map +1 -0
  101. package/dist/provider/types/common.d.mts +186 -0
  102. package/dist/provider/types/common.d.mts.map +1 -0
  103. package/dist/provider/types/jsonrpc.d.cts +30 -0
  104. package/dist/provider/types/jsonrpc.d.cts.map +1 -0
  105. package/dist/provider/types/jsonrpc.d.mts +30 -0
  106. package/dist/provider/types/jsonrpc.d.mts.map +1 -0
  107. package/dist/provider/utility/adapters.cjs +241 -0
  108. package/dist/provider/utility/adapters.cjs.map +1 -0
  109. package/dist/provider/utility/adapters.d.cts +19 -0
  110. package/dist/provider/utility/adapters.d.cts.map +1 -0
  111. package/dist/provider/utility/adapters.d.mts +19 -0
  112. package/dist/provider/utility/adapters.d.mts.map +1 -0
  113. package/dist/provider/utility/adapters.mjs +231 -0
  114. package/dist/provider/utility/adapters.mjs.map +1 -0
  115. package/dist/provider/utility/errors.utility.cjs +38 -0
  116. package/dist/provider/utility/errors.utility.cjs.map +1 -0
  117. package/dist/provider/utility/errors.utility.mjs +38 -0
  118. package/dist/provider/utility/errors.utility.mjs.map +1 -0
  119. package/dist/provider/utility/index.cjs +3 -0
  120. package/dist/provider/utility/index.d.cts +3 -0
  121. package/dist/provider/utility/index.d.mts +3 -0
  122. package/dist/provider/utility/index.mjs +4 -0
  123. package/dist/provider/utility/provider.utility.cjs +122 -0
  124. package/dist/provider/utility/provider.utility.cjs.map +1 -0
  125. package/{bin/provider/utility/provider.utility.d.ts → dist/provider/utility/provider.utility.d.cts} +15 -10
  126. package/dist/provider/utility/provider.utility.d.cts.map +1 -0
  127. package/dist/provider/utility/provider.utility.d.mts +45 -0
  128. package/dist/provider/utility/provider.utility.d.mts.map +1 -0
  129. package/dist/provider/utility/provider.utility.mjs +116 -0
  130. package/dist/provider/utility/provider.utility.mjs.map +1 -0
  131. package/dist/provider/utility/requests.utility.cjs +75 -0
  132. package/dist/provider/utility/requests.utility.cjs.map +1 -0
  133. package/dist/provider/utility/requests.utility.d.cts +40 -0
  134. package/dist/provider/utility/requests.utility.d.cts.map +1 -0
  135. package/dist/provider/utility/requests.utility.d.mts +40 -0
  136. package/dist/provider/utility/requests.utility.d.mts.map +1 -0
  137. package/dist/provider/utility/requests.utility.mjs +68 -0
  138. package/dist/provider/utility/requests.utility.mjs.map +1 -0
  139. package/dist/provider/websocket/index.cjs +1 -0
  140. package/dist/provider/websocket/index.d.cts +1 -0
  141. package/dist/provider/websocket/index.d.mts +1 -0
  142. package/dist/provider/websocket/index.mjs +2 -0
  143. package/dist/provider/websocket/ws.cjs +27 -0
  144. package/dist/provider/websocket/ws.cjs.map +1 -0
  145. package/dist/provider/websocket/ws.d.cts +21 -0
  146. package/dist/provider/websocket/ws.d.cts.map +1 -0
  147. package/dist/provider/websocket/ws.d.mts +21 -0
  148. package/dist/provider/websocket/ws.d.mts.map +1 -0
  149. package/dist/provider/websocket/ws.mjs +26 -0
  150. package/dist/provider/websocket/ws.mjs.map +1 -0
  151. package/dist/services/index.cjs +1 -0
  152. package/dist/services/index.d.cts +2 -0
  153. package/dist/services/index.d.mts +2 -0
  154. package/dist/services/index.mjs +2 -0
  155. package/dist/services/rest/restService.cjs +16 -0
  156. package/dist/services/rest/restService.cjs.map +1 -0
  157. package/dist/services/rest/restService.d.cts +9 -0
  158. package/dist/services/rest/restService.d.cts.map +1 -0
  159. package/dist/services/rest/restService.d.mts +9 -0
  160. package/dist/services/rest/restService.d.mts.map +1 -0
  161. package/dist/services/rest/restService.mjs +14 -0
  162. package/dist/services/rest/restService.mjs.map +1 -0
  163. package/dist/services/rest/restService.types.d.cts +11 -0
  164. package/dist/services/rest/restService.types.d.cts.map +1 -0
  165. package/dist/services/rest/restService.types.d.mts +11 -0
  166. package/dist/services/rest/restService.types.d.mts.map +1 -0
  167. package/dist/wallet/index.cjs +8 -0
  168. package/dist/wallet/index.d.cts +7 -0
  169. package/dist/wallet/index.d.mts +7 -0
  170. package/dist/wallet/index.mjs +9 -0
  171. package/dist/wallet/key/index.cjs +1 -0
  172. package/dist/wallet/key/index.mjs +2 -0
  173. package/dist/wallet/key/key.cjs +46 -0
  174. package/dist/wallet/key/key.cjs.map +1 -0
  175. package/dist/wallet/key/key.d.cts +26 -0
  176. package/dist/wallet/key/key.d.cts.map +1 -0
  177. package/dist/wallet/key/key.d.mts +26 -0
  178. package/dist/wallet/key/key.d.mts.map +1 -0
  179. package/dist/wallet/key/key.mjs +45 -0
  180. package/dist/wallet/key/key.mjs.map +1 -0
  181. package/dist/wallet/ledger/index.cjs +1 -0
  182. package/dist/wallet/ledger/index.d.cts +1 -0
  183. package/dist/wallet/ledger/index.d.mts +1 -0
  184. package/dist/wallet/ledger/index.mjs +2 -0
  185. package/dist/wallet/ledger/ledger.cjs +49 -0
  186. package/dist/wallet/ledger/ledger.cjs.map +1 -0
  187. package/dist/wallet/ledger/ledger.d.cts +27 -0
  188. package/dist/wallet/ledger/ledger.d.cts.map +1 -0
  189. package/dist/wallet/ledger/ledger.d.mts +27 -0
  190. package/dist/wallet/ledger/ledger.d.mts.map +1 -0
  191. package/dist/wallet/ledger/ledger.mjs +48 -0
  192. package/dist/wallet/ledger/ledger.mjs.map +1 -0
  193. package/dist/wallet/signer.d.cts +33 -0
  194. package/dist/wallet/signer.d.cts.map +1 -0
  195. package/dist/wallet/signer.d.mts +33 -0
  196. package/dist/wallet/signer.d.mts.map +1 -0
  197. package/dist/wallet/types/sign.cjs +6 -0
  198. package/dist/wallet/types/sign.cjs.map +1 -0
  199. package/dist/wallet/types/sign.d.cts +20 -0
  200. package/dist/wallet/types/sign.d.cts.map +1 -0
  201. package/dist/wallet/types/sign.d.mts +20 -0
  202. package/dist/wallet/types/sign.d.mts.map +1 -0
  203. package/dist/wallet/types/sign.mjs +6 -0
  204. package/dist/wallet/types/sign.mjs.map +1 -0
  205. package/dist/wallet/types/wallet.d.cts +9 -0
  206. package/dist/wallet/types/wallet.d.cts.map +1 -0
  207. package/dist/wallet/types/wallet.d.mts +9 -0
  208. package/dist/wallet/types/wallet.d.mts.map +1 -0
  209. package/dist/wallet/utility/index.cjs +1 -0
  210. package/dist/wallet/utility/index.d.cts +1 -0
  211. package/dist/wallet/utility/index.d.mts +1 -0
  212. package/dist/wallet/utility/index.mjs +2 -0
  213. package/dist/wallet/utility/utility.cjs +83 -0
  214. package/dist/wallet/utility/utility.cjs.map +1 -0
  215. package/dist/wallet/utility/utility.d.cts +42 -0
  216. package/dist/wallet/utility/utility.d.cts.map +1 -0
  217. package/dist/wallet/utility/utility.d.mts +42 -0
  218. package/dist/wallet/utility/utility.d.mts.map +1 -0
  219. package/dist/wallet/utility/utility.mjs +75 -0
  220. package/dist/wallet/utility/utility.mjs.map +1 -0
  221. package/dist/wallet/wallet.cjs +223 -0
  222. package/dist/wallet/wallet.cjs.map +1 -0
  223. package/dist/wallet/wallet.d.cts +113 -0
  224. package/dist/wallet/wallet.d.cts.map +1 -0
  225. package/dist/wallet/wallet.d.mts +113 -0
  226. package/dist/wallet/wallet.d.mts.map +1 -0
  227. package/dist/wallet/wallet.mjs +222 -0
  228. package/dist/wallet/wallet.mjs.map +1 -0
  229. package/package.json +57 -38
  230. package/bin/index.d.ts +0 -4
  231. package/bin/index.js +0 -20
  232. package/bin/proto/google/protobuf/any.d.ts +0 -145
  233. package/bin/proto/google/protobuf/any.js +0 -113
  234. package/bin/proto/index.d.ts +0 -2
  235. package/bin/proto/index.js +0 -20
  236. package/bin/proto/tm2/abci.d.ts +0 -37
  237. package/bin/proto/tm2/abci.js +0 -277
  238. package/bin/proto/tm2/multisig.d.ts +0 -43
  239. package/bin/proto/tm2/multisig.js +0 -322
  240. package/bin/proto/tm2/multisig.test.d.ts +0 -1
  241. package/bin/proto/tm2/multisig.test.js +0 -63
  242. package/bin/proto/tm2/tx.d.ts +0 -52
  243. package/bin/proto/tm2/tx.js +0 -360
  244. package/bin/provider/endpoints.d.ts +0 -29
  245. package/bin/provider/endpoints.js +0 -37
  246. package/bin/provider/errors/errors.d.ts +0 -59
  247. package/bin/provider/errors/errors.js +0 -173
  248. package/bin/provider/errors/index.d.ts +0 -1
  249. package/bin/provider/errors/index.js +0 -17
  250. package/bin/provider/errors/messages.d.ts +0 -19
  251. package/bin/provider/errors/messages.js +0 -41
  252. package/bin/provider/index.d.ts +0 -7
  253. package/bin/provider/index.js +0 -23
  254. package/bin/provider/jsonrpc/index.d.ts +0 -1
  255. package/bin/provider/jsonrpc/index.js +0 -17
  256. package/bin/provider/jsonrpc/jsonrpc.d.ts +0 -31
  257. package/bin/provider/jsonrpc/jsonrpc.js +0 -327
  258. package/bin/provider/jsonrpc/jsonrpc.test.d.ts +0 -1
  259. package/bin/provider/jsonrpc/jsonrpc.test.js +0 -488
  260. package/bin/provider/provider.d.ts +0 -98
  261. package/bin/provider/provider.js +0 -2
  262. package/bin/provider/types/abci.d.ts +0 -39
  263. package/bin/provider/types/abci.js +0 -4
  264. package/bin/provider/types/common.d.ts +0 -184
  265. package/bin/provider/types/common.js +0 -3
  266. package/bin/provider/types/index.d.ts +0 -3
  267. package/bin/provider/types/index.js +0 -19
  268. package/bin/provider/types/jsonrpc.d.ts +0 -26
  269. package/bin/provider/types/jsonrpc.js +0 -2
  270. package/bin/provider/utility/errors.utility.d.ts +0 -11
  271. package/bin/provider/utility/errors.utility.js +0 -56
  272. package/bin/provider/utility/index.d.ts +0 -2
  273. package/bin/provider/utility/index.js +0 -18
  274. package/bin/provider/utility/provider.utility.js +0 -244
  275. package/bin/provider/utility/requests.utility.d.ts +0 -35
  276. package/bin/provider/utility/requests.utility.js +0 -80
  277. package/bin/provider/websocket/index.d.ts +0 -1
  278. package/bin/provider/websocket/index.js +0 -17
  279. package/bin/provider/websocket/ws.d.ts +0 -58
  280. package/bin/provider/websocket/ws.js +0 -415
  281. package/bin/provider/websocket/ws.test.d.ts +0 -1
  282. package/bin/provider/websocket/ws.test.js +0 -648
  283. package/bin/services/index.d.ts +0 -2
  284. package/bin/services/index.js +0 -18
  285. package/bin/services/rest/restService.d.ts +0 -4
  286. package/bin/services/rest/restService.js +0 -72
  287. package/bin/services/rest/restService.types.d.ts +0 -6
  288. package/bin/services/rest/restService.types.js +0 -2
  289. package/bin/wallet/index.d.ts +0 -6
  290. package/bin/wallet/index.js +0 -22
  291. package/bin/wallet/key/index.d.ts +0 -1
  292. package/bin/wallet/key/index.js +0 -17
  293. package/bin/wallet/key/key.d.ts +0 -21
  294. package/bin/wallet/key/key.js +0 -102
  295. package/bin/wallet/key/key.test.d.ts +0 -1
  296. package/bin/wallet/key/key.test.js +0 -121
  297. package/bin/wallet/ledger/index.d.ts +0 -1
  298. package/bin/wallet/ledger/index.js +0 -17
  299. package/bin/wallet/ledger/ledger.d.ts +0 -22
  300. package/bin/wallet/ledger/ledger.js +0 -109
  301. package/bin/wallet/signer.d.ts +0 -29
  302. package/bin/wallet/signer.js +0 -2
  303. package/bin/wallet/types/index.d.ts +0 -2
  304. package/bin/wallet/types/index.js +0 -18
  305. package/bin/wallet/types/sign.d.ts +0 -16
  306. package/bin/wallet/types/sign.js +0 -4
  307. package/bin/wallet/types/wallet.d.ts +0 -5
  308. package/bin/wallet/types/wallet.js +0 -2
  309. package/bin/wallet/utility/index.d.ts +0 -1
  310. package/bin/wallet/utility/index.js +0 -17
  311. package/bin/wallet/utility/utility.d.ts +0 -36
  312. package/bin/wallet/utility/utility.js +0 -117
  313. package/bin/wallet/wallet.d.ts +0 -106
  314. package/bin/wallet/wallet.js +0 -361
  315. package/bin/wallet/wallet.test.d.ts +0 -1
  316. package/bin/wallet/wallet.test.js +0 -423
@@ -1,184 +0,0 @@
1
- import { ABCIResponseBase } from './abci';
2
- import { TransactionEndpoint } from '../endpoints';
3
- export interface NetworkInfo {
4
- listening: boolean;
5
- listeners: string[];
6
- n_peers: string;
7
- peers: string[];
8
- }
9
- export interface Status {
10
- node_info: NodeInfo;
11
- sync_info: SyncInfo;
12
- validator_info: ValidatorInfo;
13
- }
14
- interface NodeInfo {
15
- version_set: VersionInfo[];
16
- net_address: string;
17
- network: string;
18
- software: string;
19
- version: string;
20
- channels: string;
21
- monkier: string;
22
- other: {
23
- tx_index: string;
24
- rpc_address: string;
25
- };
26
- }
27
- interface VersionInfo {
28
- Name: string;
29
- Version: string;
30
- Optional: boolean;
31
- }
32
- interface SyncInfo {
33
- latest_block_hash: string;
34
- latest_app_hash: string;
35
- latest_block_height: string;
36
- latest_block_time: string;
37
- catching_up: boolean;
38
- }
39
- interface ValidatorInfo {
40
- address: string;
41
- pub_key: PublicKey;
42
- voting_power: string;
43
- }
44
- interface PublicKey {
45
- type: string;
46
- value: string;
47
- }
48
- export interface ConsensusParams {
49
- block_height: string;
50
- consensus_params: {
51
- Block: {
52
- MaxTxBytes: string;
53
- MaxDataBytes: string;
54
- MaxBlockBytes: string;
55
- MaxGas: string;
56
- TimeIotaMS: string;
57
- };
58
- Validator: {
59
- PubKeyTypeURLs: string[];
60
- };
61
- };
62
- }
63
- export interface ConsensusState {
64
- round_state: {
65
- [key: string]: string | null | object;
66
- start_time: string;
67
- proposal_block_hash: string | null;
68
- locked_block_hash: string | null;
69
- valid_block_hash: string | null;
70
- height_vote_set: object;
71
- };
72
- }
73
- export interface BlockInfo {
74
- block_meta: BlockMeta;
75
- block: Block;
76
- }
77
- export interface BlockMeta {
78
- block_id: BlockID;
79
- header: BlockHeader;
80
- }
81
- export interface Block {
82
- header: BlockHeader;
83
- data: {
84
- txs: string[] | null;
85
- };
86
- last_commit: {
87
- block_id: BlockID;
88
- precommits: PrecommitInfo[] | null;
89
- };
90
- }
91
- export interface BlockHeader {
92
- version: string;
93
- chain_id: string;
94
- height: string;
95
- time: string;
96
- num_txs: string;
97
- total_txs: string;
98
- app_version: string;
99
- last_block_id: BlockID;
100
- last_commit_hash: string | null;
101
- data_hash: string | null;
102
- validators_hash: string;
103
- consensus_hash: string;
104
- app_hash: string;
105
- last_results_hash: string | null;
106
- proposer_address: string;
107
- }
108
- export interface BlockID {
109
- hash: string | null;
110
- parts: {
111
- total: string;
112
- hash: string | null;
113
- };
114
- }
115
- export interface PrecommitInfo {
116
- type: number;
117
- height: string;
118
- round: string;
119
- block_id: BlockID;
120
- timestamp: string;
121
- validator_address: string;
122
- validator_index: string;
123
- signature: string;
124
- }
125
- export interface BlockResult {
126
- height: string;
127
- results: {
128
- deliver_tx: DeliverTx[] | null;
129
- end_block: EndBlock;
130
- begin_block: BeginBlock;
131
- };
132
- }
133
- export interface TxResult {
134
- hash: string;
135
- index: number;
136
- height: string;
137
- tx_result: DeliverTx;
138
- tx: string;
139
- }
140
- export interface DeliverTx {
141
- ResponseBase: ABCIResponseBase;
142
- GasWanted: string;
143
- GasUsed: string;
144
- }
145
- export interface EndBlock {
146
- ResponseBase: ABCIResponseBase;
147
- ValidatorUpdates: string | null;
148
- ConsensusParams: string | null;
149
- Events: string | null;
150
- }
151
- export interface BeginBlock {
152
- ResponseBase: ABCIResponseBase;
153
- }
154
- export interface BroadcastTxSyncResult {
155
- error: {
156
- [key: string]: string;
157
- } | null;
158
- data: string | null;
159
- Log: string;
160
- hash: string;
161
- }
162
- export interface BroadcastTxCommitResult {
163
- check_tx: DeliverTx;
164
- deliver_tx: DeliverTx;
165
- hash: string;
166
- height: string;
167
- }
168
- export type BroadcastType = TransactionEndpoint.BROADCAST_TX_SYNC | TransactionEndpoint.BROADCAST_TX_COMMIT;
169
- export type BroadcastTransactionSync = {
170
- endpoint: TransactionEndpoint.BROADCAST_TX_SYNC;
171
- result: BroadcastTxSyncResult;
172
- };
173
- export type BroadcastTransactionCommit = {
174
- endpoint: TransactionEndpoint.BROADCAST_TX_COMMIT;
175
- result: BroadcastTxCommitResult;
176
- };
177
- export type BroadcastTransactionMap = {
178
- [TransactionEndpoint.BROADCAST_TX_COMMIT]: BroadcastTransactionCommit;
179
- [TransactionEndpoint.BROADCAST_TX_SYNC]: BroadcastTransactionSync;
180
- };
181
- export type BroadcastAsGeneric<K extends keyof BroadcastTransactionMap = keyof BroadcastTransactionMap> = {
182
- [P in K]: BroadcastTransactionMap[P];
183
- }[K];
184
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var endpoints_1 = require("../endpoints");
@@ -1,3 +0,0 @@
1
- export * from './abci';
2
- export * from './common';
3
- export * from './jsonrpc';
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./abci"), exports);
18
- __exportStar(require("./common"), exports);
19
- __exportStar(require("./jsonrpc"), exports);
@@ -1,26 +0,0 @@
1
- /**
2
- * The base JSON-RPC 2.0 request
3
- */
4
- export interface RPCRequest {
5
- jsonrpc: string;
6
- id: string | number;
7
- method: string;
8
- params?: any[];
9
- }
10
- /**
11
- * The base JSON-RPC 2.0 response
12
- */
13
- export interface RPCResponse<Result> {
14
- jsonrpc: string;
15
- id: string | number;
16
- result?: Result;
17
- error?: RPCError;
18
- }
19
- /**
20
- * The base JSON-RPC 2.0 typed response error
21
- */
22
- export interface RPCError {
23
- code: number;
24
- message: string;
25
- data?: any;
26
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- import { TM2Error } from '../errors';
2
- /**
3
- * Constructs the appropriate Tendermint2
4
- * error based on the error ID.
5
- * Error IDs retrieved from:
6
- * https://github.com/gnolang/gno/blob/64f0fd0fa44021a076e1453b1767fbc914ed3b66/tm2/pkg/std/package.go#L20C1-L38
7
- * @param {string} errorID the proto ID of the error
8
- * @param {string} [log] the log associated with the error, if any
9
- * @returns {TM2Error}
10
- */
11
- export declare const constructRequestError: (errorID: string, log?: string) => TM2Error;
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.constructRequestError = void 0;
4
- var errors_1 = require("../errors");
5
- /**
6
- * Constructs the appropriate Tendermint2
7
- * error based on the error ID.
8
- * Error IDs retrieved from:
9
- * https://github.com/gnolang/gno/blob/64f0fd0fa44021a076e1453b1767fbc914ed3b66/tm2/pkg/std/package.go#L20C1-L38
10
- * @param {string} errorID the proto ID of the error
11
- * @param {string} [log] the log associated with the error, if any
12
- * @returns {TM2Error}
13
- */
14
- var constructRequestError = function (errorID, log) {
15
- switch (errorID) {
16
- case '/std.InternalError':
17
- return new errors_1.InternalError(log);
18
- case '/std.TxDecodeError':
19
- return new errors_1.TxDecodeError(log);
20
- case '/std.InvalidSequenceError':
21
- return new errors_1.InvalidSequenceError(log);
22
- case '/std.UnauthorizedError':
23
- return new errors_1.UnauthorizedError(log);
24
- case '/std.InsufficientFundsError':
25
- return new errors_1.InsufficientFundsError(log);
26
- case '/std.UnknownRequestError':
27
- return new errors_1.UnknownRequestError(log);
28
- case '/std.InvalidAddressError':
29
- return new errors_1.InvalidAddressError(log);
30
- case '/std.UnknownAddressError':
31
- return new errors_1.UnknownAddressError(log);
32
- case '/std.InvalidPubKeyError':
33
- return new errors_1.InvalidPubKeyError(log);
34
- case '/std.InsufficientCoinsError':
35
- return new errors_1.InsufficientCoinsError(log);
36
- case '/std.InvalidCoinsError':
37
- return new errors_1.InvalidCoinsError(log);
38
- case '/std.InvalidGasWantedError':
39
- return new errors_1.InvalidGasWantedError(log);
40
- case '/std.OutOfGasError':
41
- return new errors_1.OutOfGasError(log);
42
- case '/std.MemoTooLargeError':
43
- return new errors_1.MemoTooLargeError(log);
44
- case '/std.InsufficientFeeError':
45
- return new errors_1.InsufficientFeeError(log);
46
- case '/std.TooManySignaturesError':
47
- return new errors_1.TooManySignaturesError(log);
48
- case '/std.NoSignaturesError':
49
- return new errors_1.NoSignaturesError(log);
50
- case '/std.GasOverflowError':
51
- return new errors_1.GasOverflowError(log);
52
- default:
53
- return new errors_1.TM2Error("unknown error: ".concat(errorID), log);
54
- }
55
- };
56
- exports.constructRequestError = constructRequestError;
@@ -1,2 +0,0 @@
1
- export * from './provider.utility';
2
- export * from './requests.utility';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./provider.utility"), exports);
18
- __exportStar(require("./requests.utility"), exports);
@@ -1,244 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.waitForTransaction = exports.extractSimulateFromResponse = exports.extractAccountFromResponse = exports.extractAccountNumberFromResponse = exports.extractSequenceFromResponse = exports.extractBalanceFromResponse = void 0;
40
- var crypto_1 = require("@cosmjs/crypto");
41
- var proto_1 = require("../../proto");
42
- var abci_1 = require("../../proto/tm2/abci");
43
- var types_1 = require("../types");
44
- var errors_utility_1 = require("./errors.utility");
45
- var requests_utility_1 = require("./requests.utility");
46
- /**
47
- * Extracts the specific balance denomination from the ABCI response
48
- * @param {string | null} abciData the base64-encoded ABCI data
49
- * @param {string} denomination the required denomination
50
- */
51
- var extractBalanceFromResponse = function (abciData, denomination) {
52
- // Make sure the response is initialized
53
- if (!abciData) {
54
- return 0;
55
- }
56
- // Extract the balances
57
- var balancesRaw = Buffer.from(abciData, 'base64')
58
- .toString()
59
- .replace(/"/gi, '');
60
- // Find the correct balance denomination
61
- var balances = balancesRaw.split(',');
62
- if (balances.length < 1) {
63
- return 0;
64
- }
65
- // Find the correct denomination
66
- var pattern = new RegExp("^(\\d+)".concat(denomination, "$"));
67
- for (var _i = 0, balances_1 = balances; _i < balances_1.length; _i++) {
68
- var balance = balances_1[_i];
69
- var match = balance.match(pattern);
70
- if (match) {
71
- return parseInt(match[1], 10);
72
- }
73
- }
74
- return 0;
75
- };
76
- exports.extractBalanceFromResponse = extractBalanceFromResponse;
77
- /**
78
- * Extracts the account sequence from the ABCI response
79
- * @param {string | null} abciData the base64-encoded ABCI data
80
- */
81
- var extractSequenceFromResponse = function (abciData) {
82
- // Make sure the response is initialized
83
- if (!abciData) {
84
- return 0;
85
- }
86
- try {
87
- // Parse the account
88
- var account = (0, requests_utility_1.parseABCI)(abciData);
89
- return parseInt(account.BaseAccount.sequence, 10);
90
- }
91
- catch (e) {
92
- // unused case
93
- }
94
- // Account not initialized,
95
- // return default value (0)
96
- return 0;
97
- };
98
- exports.extractSequenceFromResponse = extractSequenceFromResponse;
99
- /**
100
- * Extracts the account number from the ABCI response
101
- * @param {string | null} abciData the base64-encoded ABCI data
102
- */
103
- var extractAccountNumberFromResponse = function (abciData) {
104
- // Make sure the response is initialized
105
- if (!abciData) {
106
- throw new Error('account is not initialized');
107
- }
108
- try {
109
- // Parse the account
110
- var account = (0, requests_utility_1.parseABCI)(abciData);
111
- return parseInt(account.BaseAccount.account_number, 10);
112
- }
113
- catch (e) {
114
- throw new Error('account is not initialized');
115
- }
116
- };
117
- exports.extractAccountNumberFromResponse = extractAccountNumberFromResponse;
118
- /**
119
- * Extracts the account from the ABCI response
120
- * @param {string | null} abciData the base64-encoded ABCI data
121
- */
122
- var extractAccountFromResponse = function (abciData) {
123
- // Make sure the response is initialized
124
- if (!abciData) {
125
- throw new Error('account is not initialized');
126
- }
127
- try {
128
- // Parse the account
129
- var account = (0, requests_utility_1.parseABCI)(abciData);
130
- return account;
131
- }
132
- catch (e) {
133
- throw new Error('account is not initialized');
134
- }
135
- };
136
- exports.extractAccountFromResponse = extractAccountFromResponse;
137
- /**
138
- * Extracts the simulate transaction response from the ABCI response value
139
- * @param {string | null} abciData the base64-encoded ResponseDeliverTx proto message
140
- */
141
- var extractSimulateFromResponse = function (abciResponse) {
142
- var _a, _b;
143
- // Make sure the response is initialized
144
- if (!abciResponse) {
145
- throw new Error('abci data is not initialized');
146
- }
147
- var error = (_b = (_a = abciResponse.response) === null || _a === void 0 ? void 0 : _a.ResponseBase) === null || _b === void 0 ? void 0 : _b.Error;
148
- if (error && error[types_1.ABCIErrorKey]) {
149
- throw (0, errors_utility_1.constructRequestError)(error[types_1.ABCIErrorKey]);
150
- }
151
- var value = abciResponse.response.Value;
152
- if (!value) {
153
- throw new Error('abci data is not initialized');
154
- }
155
- try {
156
- return (0, requests_utility_1.parseProto)(value, abci_1.ResponseDeliverTx.decode);
157
- }
158
- catch (e) {
159
- throw new Error('unable to parse simulate response');
160
- }
161
- };
162
- exports.extractSimulateFromResponse = extractSimulateFromResponse;
163
- /**
164
- * Waits for the transaction to be committed to a block in the chain
165
- * of the specified provider. This helper does a search for incoming blocks
166
- * and checks if a transaction
167
- * @param {Provider} provider the provider instance
168
- * @param {string} hash the base64-encoded hash of the transaction
169
- * @param {number} [fromHeight=latest] the starting height for the search. If omitted, it is the latest block in the chain
170
- * @param {number} [timeout=15000] the timeout in MS for the search
171
- */
172
- var waitForTransaction = function (provider, hash, fromHeight, timeout) { return __awaiter(void 0, void 0, void 0, function () {
173
- return __generator(this, function (_a) {
174
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
175
- var currentHeight, _a, exitTimeout, fetchInterval;
176
- return __generator(this, function (_b) {
177
- switch (_b.label) {
178
- case 0:
179
- if (!fromHeight) return [3 /*break*/, 1];
180
- _a = fromHeight;
181
- return [3 /*break*/, 3];
182
- case 1: return [4 /*yield*/, provider.getBlockNumber()];
183
- case 2:
184
- _a = _b.sent();
185
- _b.label = 3;
186
- case 3:
187
- currentHeight = _a;
188
- exitTimeout = timeout ? timeout : 15000;
189
- fetchInterval = setInterval(function () { return __awaiter(void 0, void 0, void 0, function () {
190
- var latestHeight, blockNum, block, _i, _a, tx, txRaw, txHash;
191
- return __generator(this, function (_b) {
192
- switch (_b.label) {
193
- case 0: return [4 /*yield*/, provider.getBlockNumber()];
194
- case 1:
195
- latestHeight = _b.sent();
196
- if (latestHeight < currentHeight) {
197
- // No need to parse older blocks
198
- return [2 /*return*/];
199
- }
200
- blockNum = currentHeight;
201
- _b.label = 2;
202
- case 2:
203
- if (!(blockNum <= latestHeight)) return [3 /*break*/, 5];
204
- return [4 /*yield*/, provider.getBlock(blockNum)];
205
- case 3:
206
- block = _b.sent();
207
- // Check if there are any transactions at all in the block
208
- if (!block.block.data.txs || block.block.data.txs.length == 0) {
209
- return [3 /*break*/, 4];
210
- }
211
- // Find the transaction among the block transactions
212
- for (_i = 0, _a = block.block.data.txs; _i < _a.length; _i++) {
213
- tx = _a[_i];
214
- txRaw = (0, requests_utility_1.base64ToUint8Array)(tx);
215
- txHash = (0, crypto_1.sha256)(txRaw);
216
- if ((0, requests_utility_1.uint8ArrayToBase64)(txHash) == hash) {
217
- // Clear the interval
218
- clearInterval(fetchInterval);
219
- // Decode the transaction from amino
220
- resolve(proto_1.Tx.decode(txRaw));
221
- }
222
- }
223
- _b.label = 4;
224
- case 4:
225
- blockNum++;
226
- return [3 /*break*/, 2];
227
- case 5:
228
- currentHeight = latestHeight + 1;
229
- return [2 /*return*/];
230
- }
231
- });
232
- }); }, 1000);
233
- setTimeout(function () {
234
- // Clear the fetch interval
235
- clearInterval(fetchInterval);
236
- reject('transaction fetch timeout');
237
- }, exitTimeout);
238
- return [2 /*return*/];
239
- }
240
- });
241
- }); })];
242
- });
243
- }); };
244
- exports.waitForTransaction = waitForTransaction;
@@ -1,35 +0,0 @@
1
- import { BinaryReader } from '@bufbuild/protobuf/wire';
2
- import { RPCError, RPCRequest, RPCResponse } from '../types';
3
- /**
4
- * Creates a new JSON-RPC 2.0 request
5
- * @param {string} method the requested method
6
- * @param {string[]} [params] the requested params, if any
7
- */
8
- export declare const newRequest: (method: string, params?: any[]) => RPCRequest;
9
- /**
10
- * Creates a new JSON-RPC 2.0 response
11
- * @param {Result} result the response result, if any
12
- * @param {RPCError} error the response error, if any
13
- */
14
- export declare const newResponse: <Result>(result?: Result, error?: RPCError) => RPCResponse<Result>;
15
- /**
16
- * Parses the base64 encoded ABCI JSON into a concrete type
17
- * @param {string} data the base64-encoded JSON
18
- */
19
- export declare const parseABCI: <Result>(data: string) => Result;
20
- export declare const parseProto: <T>(data: string, decodeFn: (input: BinaryReader | Uint8Array, length?: number) => T) => T;
21
- /**
22
- * Converts a string into base64 representation
23
- * @param {string} str the raw string
24
- */
25
- export declare const stringToBase64: (str: string) => string;
26
- /**
27
- * Converts a base64 string into a Uint8Array representation
28
- * @param {string} str the base64-encoded string
29
- */
30
- export declare const base64ToUint8Array: (str: string) => Uint8Array;
31
- /**
32
- * Converts a Uint8Array into base64 representation
33
- * @param {Uint8Array} data the Uint8Array to be encoded
34
- */
35
- export declare const uint8ArrayToBase64: (data: Uint8Array) => string;