tronwb 6.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 (318) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +201 -0
  3. package/dist/TronWeb.js +3 -0
  4. package/dist/TronWeb.js.LICENSE.txt +12 -0
  5. package/dist/TronWeb.js.map +1 -0
  6. package/dist/TronWeb.node.js +2 -0
  7. package/dist/TronWeb.node.js.map +1 -0
  8. package/kj9btptx.cjs +1 -0
  9. package/lib/commonjs/index.d.ts +64 -0
  10. package/lib/commonjs/index.js +37 -0
  11. package/lib/commonjs/index.js.map +1 -0
  12. package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.d.ts +127 -0
  13. package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.js +1771 -0
  14. package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.js.map +1 -0
  15. package/lib/commonjs/lib/TransactionBuilder/helper.d.ts +28 -0
  16. package/lib/commonjs/lib/TransactionBuilder/helper.js +122 -0
  17. package/lib/commonjs/lib/TransactionBuilder/helper.js.map +1 -0
  18. package/lib/commonjs/lib/contract/index.d.ts +29 -0
  19. package/lib/commonjs/lib/contract/index.js +124 -0
  20. package/lib/commonjs/lib/contract/index.js.map +1 -0
  21. package/lib/commonjs/lib/contract/method.d.ts +50 -0
  22. package/lib/commonjs/lib/contract/method.js +238 -0
  23. package/lib/commonjs/lib/contract/method.js.map +1 -0
  24. package/lib/commonjs/lib/event.d.ts +85 -0
  25. package/lib/commonjs/lib/event.js +137 -0
  26. package/lib/commonjs/lib/event.js.map +1 -0
  27. package/lib/commonjs/lib/plugin.d.ts +28 -0
  28. package/lib/commonjs/lib/plugin.js +84 -0
  29. package/lib/commonjs/lib/plugin.js.map +1 -0
  30. package/lib/commonjs/lib/providers/HttpProvider.d.ts +15 -0
  31. package/lib/commonjs/lib/providers/HttpProvider.js +63 -0
  32. package/lib/commonjs/lib/providers/HttpProvider.js.map +1 -0
  33. package/lib/commonjs/lib/providers/index.d.ts +6 -0
  34. package/lib/commonjs/lib/providers/index.js +8 -0
  35. package/lib/commonjs/lib/providers/index.js.map +1 -0
  36. package/lib/commonjs/lib/trx.d.ts +315 -0
  37. package/lib/commonjs/lib/trx.js +965 -0
  38. package/lib/commonjs/lib/trx.js.map +1 -0
  39. package/lib/commonjs/package.json +1 -0
  40. package/lib/commonjs/paramValidator/index.d.ts +19 -0
  41. package/lib/commonjs/paramValidator/index.js +110 -0
  42. package/lib/commonjs/paramValidator/index.js.map +1 -0
  43. package/lib/commonjs/protocol/core/Tron_pb.cjs +7524 -0
  44. package/lib/commonjs/protocol/core/contract/account_contract_pb.cjs +961 -0
  45. package/lib/commonjs/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
  46. package/lib/commonjs/protocol/core/contract/balance_contract_pb.cjs +3826 -0
  47. package/lib/commonjs/protocol/core/contract/common_pb.cjs +34 -0
  48. package/lib/commonjs/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
  49. package/lib/commonjs/protocol/core/contract/proposal_contract_pb.cjs +675 -0
  50. package/lib/commonjs/protocol/core/contract/smart_contract_pb.cjs +2960 -0
  51. package/lib/commonjs/protocol/core/contract/storage_contract_pb.cjs +848 -0
  52. package/lib/commonjs/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
  53. package/lib/commonjs/protocol/core/contract/witness_contract_pb.cjs +956 -0
  54. package/lib/commonjs/tronweb.d.ts +111 -0
  55. package/lib/commonjs/tronweb.js +365 -0
  56. package/lib/commonjs/tronweb.js.map +1 -0
  57. package/lib/commonjs/types/ABI.d.ts +59 -0
  58. package/lib/commonjs/types/ABI.js +3 -0
  59. package/lib/commonjs/types/ABI.js.map +1 -0
  60. package/lib/commonjs/types/APIResponse.d.ts +31 -0
  61. package/lib/commonjs/types/APIResponse.js +3 -0
  62. package/lib/commonjs/types/APIResponse.js.map +1 -0
  63. package/lib/commonjs/types/Contract.d.ts +287 -0
  64. package/lib/commonjs/types/Contract.js +63 -0
  65. package/lib/commonjs/types/Contract.js.map +1 -0
  66. package/lib/commonjs/types/Providers.d.ts +8 -0
  67. package/lib/commonjs/types/Providers.js +3 -0
  68. package/lib/commonjs/types/Providers.js.map +1 -0
  69. package/lib/commonjs/types/Transaction.d.ts +65 -0
  70. package/lib/commonjs/types/Transaction.js +3 -0
  71. package/lib/commonjs/types/Transaction.js.map +1 -0
  72. package/lib/commonjs/types/TransactionBuilder.d.ts +270 -0
  73. package/lib/commonjs/types/TransactionBuilder.js +3 -0
  74. package/lib/commonjs/types/TransactionBuilder.js.map +1 -0
  75. package/lib/commonjs/types/TronWeb.d.ts +20 -0
  76. package/lib/commonjs/types/TronWeb.js +3 -0
  77. package/lib/commonjs/types/TronWeb.js.map +1 -0
  78. package/lib/commonjs/types/Trx.d.ts +263 -0
  79. package/lib/commonjs/types/Trx.js +42 -0
  80. package/lib/commonjs/types/Trx.js.map +1 -0
  81. package/lib/commonjs/types/UtilsTypes.d.ts +23 -0
  82. package/lib/commonjs/types/UtilsTypes.js +3 -0
  83. package/lib/commonjs/types/UtilsTypes.js.map +1 -0
  84. package/lib/commonjs/types/index.d.ts +9 -0
  85. package/lib/commonjs/types/index.js +13 -0
  86. package/lib/commonjs/types/index.js.map +1 -0
  87. package/lib/commonjs/utils/abi.d.ts +5 -0
  88. package/lib/commonjs/utils/abi.js +251 -0
  89. package/lib/commonjs/utils/abi.js.map +1 -0
  90. package/lib/commonjs/utils/accounts.d.ts +22 -0
  91. package/lib/commonjs/utils/accounts.js +51 -0
  92. package/lib/commonjs/utils/accounts.js.map +1 -0
  93. package/lib/commonjs/utils/address.d.ts +12 -0
  94. package/lib/commonjs/utils/address.js +91 -0
  95. package/lib/commonjs/utils/address.js.map +1 -0
  96. package/lib/commonjs/utils/base58.d.ts +3 -0
  97. package/lib/commonjs/utils/base58.js +68 -0
  98. package/lib/commonjs/utils/base58.js.map +1 -0
  99. package/lib/commonjs/utils/base64.d.ts +10 -0
  100. package/lib/commonjs/utils/base64.js +173 -0
  101. package/lib/commonjs/utils/base64.js.map +1 -0
  102. package/lib/commonjs/utils/bytes.d.ts +7 -0
  103. package/lib/commonjs/utils/bytes.js +61 -0
  104. package/lib/commonjs/utils/bytes.js.map +1 -0
  105. package/lib/commonjs/utils/code.d.ts +12 -0
  106. package/lib/commonjs/utils/code.js +166 -0
  107. package/lib/commonjs/utils/code.js.map +1 -0
  108. package/lib/commonjs/utils/crypto.d.ts +25 -0
  109. package/lib/commonjs/utils/crypto.js +222 -0
  110. package/lib/commonjs/utils/crypto.js.map +1 -0
  111. package/lib/commonjs/utils/ethersUtils.d.ts +14 -0
  112. package/lib/commonjs/utils/ethersUtils.js +39 -0
  113. package/lib/commonjs/utils/ethersUtils.js.map +1 -0
  114. package/lib/commonjs/utils/fragments.d.ts +465 -0
  115. package/lib/commonjs/utils/fragments.js +1342 -0
  116. package/lib/commonjs/utils/fragments.js.map +1 -0
  117. package/lib/commonjs/utils/help.d.ts +8 -0
  118. package/lib/commonjs/utils/help.js +61 -0
  119. package/lib/commonjs/utils/help.js.map +1 -0
  120. package/lib/commonjs/utils/index.d.ts +56 -0
  121. package/lib/commonjs/utils/index.js +43 -0
  122. package/lib/commonjs/utils/index.js.map +1 -0
  123. package/lib/commonjs/utils/interface.d.ts +381 -0
  124. package/lib/commonjs/utils/interface.js +1121 -0
  125. package/lib/commonjs/utils/interface.js.map +1 -0
  126. package/lib/commonjs/utils/message.d.ts +4 -0
  127. package/lib/commonjs/utils/message.js +38 -0
  128. package/lib/commonjs/utils/message.js.map +1 -0
  129. package/lib/commonjs/utils/transaction.d.ts +17 -0
  130. package/lib/commonjs/utils/transaction.js +678 -0
  131. package/lib/commonjs/utils/transaction.js.map +1 -0
  132. package/lib/commonjs/utils/typedData.d.ts +148 -0
  133. package/lib/commonjs/utils/typedData.js +498 -0
  134. package/lib/commonjs/utils/typedData.js.map +1 -0
  135. package/lib/commonjs/utils/validations.d.ts +22 -0
  136. package/lib/commonjs/utils/validations.js +128 -0
  137. package/lib/commonjs/utils/validations.js.map +1 -0
  138. package/lib/esm/index.d.ts +64 -0
  139. package/lib/esm/index.js +33 -0
  140. package/lib/esm/index.js.map +1 -0
  141. package/lib/esm/lib/TransactionBuilder/TransactionBuilder.d.ts +127 -0
  142. package/lib/esm/lib/TransactionBuilder/TransactionBuilder.js +1767 -0
  143. package/lib/esm/lib/TransactionBuilder/TransactionBuilder.js.map +1 -0
  144. package/lib/esm/lib/TransactionBuilder/helper.d.ts +28 -0
  145. package/lib/esm/lib/TransactionBuilder/helper.js +112 -0
  146. package/lib/esm/lib/TransactionBuilder/helper.js.map +1 -0
  147. package/lib/esm/lib/contract/index.d.ts +29 -0
  148. package/lib/esm/lib/contract/index.js +118 -0
  149. package/lib/esm/lib/contract/index.js.map +1 -0
  150. package/lib/esm/lib/contract/method.d.ts +50 -0
  151. package/lib/esm/lib/contract/method.js +233 -0
  152. package/lib/esm/lib/contract/method.js.map +1 -0
  153. package/lib/esm/lib/event.d.ts +85 -0
  154. package/lib/esm/lib/event.js +132 -0
  155. package/lib/esm/lib/event.js.map +1 -0
  156. package/lib/esm/lib/plugin.d.ts +28 -0
  157. package/lib/esm/lib/plugin.js +79 -0
  158. package/lib/esm/lib/plugin.js.map +1 -0
  159. package/lib/esm/lib/providers/HttpProvider.d.ts +15 -0
  160. package/lib/esm/lib/providers/HttpProvider.js +59 -0
  161. package/lib/esm/lib/providers/HttpProvider.js.map +1 -0
  162. package/lib/esm/lib/providers/index.d.ts +6 -0
  163. package/lib/esm/lib/providers/index.js +4 -0
  164. package/lib/esm/lib/providers/index.js.map +1 -0
  165. package/lib/esm/lib/trx.d.ts +315 -0
  166. package/lib/esm/lib/trx.js +960 -0
  167. package/lib/esm/lib/trx.js.map +1 -0
  168. package/lib/esm/package.json +1 -0
  169. package/lib/esm/paramValidator/index.d.ts +19 -0
  170. package/lib/esm/paramValidator/index.js +106 -0
  171. package/lib/esm/paramValidator/index.js.map +1 -0
  172. package/lib/esm/protocol/core/Tron_pb.cjs +7524 -0
  173. package/lib/esm/protocol/core/contract/account_contract_pb.cjs +961 -0
  174. package/lib/esm/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
  175. package/lib/esm/protocol/core/contract/balance_contract_pb.cjs +3826 -0
  176. package/lib/esm/protocol/core/contract/common_pb.cjs +34 -0
  177. package/lib/esm/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
  178. package/lib/esm/protocol/core/contract/proposal_contract_pb.cjs +675 -0
  179. package/lib/esm/protocol/core/contract/smart_contract_pb.cjs +2960 -0
  180. package/lib/esm/protocol/core/contract/storage_contract_pb.cjs +848 -0
  181. package/lib/esm/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
  182. package/lib/esm/protocol/core/contract/witness_contract_pb.cjs +956 -0
  183. package/lib/esm/tronweb.d.ts +111 -0
  184. package/lib/esm/tronweb.js +360 -0
  185. package/lib/esm/tronweb.js.map +1 -0
  186. package/lib/esm/types/ABI.d.ts +59 -0
  187. package/lib/esm/types/ABI.js +2 -0
  188. package/lib/esm/types/ABI.js.map +1 -0
  189. package/lib/esm/types/APIResponse.d.ts +31 -0
  190. package/lib/esm/types/APIResponse.js +2 -0
  191. package/lib/esm/types/APIResponse.js.map +1 -0
  192. package/lib/esm/types/Contract.d.ts +287 -0
  193. package/lib/esm/types/Contract.js +60 -0
  194. package/lib/esm/types/Contract.js.map +1 -0
  195. package/lib/esm/types/Providers.d.ts +8 -0
  196. package/lib/esm/types/Providers.js +2 -0
  197. package/lib/esm/types/Providers.js.map +1 -0
  198. package/lib/esm/types/Transaction.d.ts +65 -0
  199. package/lib/esm/types/Transaction.js +2 -0
  200. package/lib/esm/types/Transaction.js.map +1 -0
  201. package/lib/esm/types/TransactionBuilder.d.ts +270 -0
  202. package/lib/esm/types/TransactionBuilder.js +2 -0
  203. package/lib/esm/types/TransactionBuilder.js.map +1 -0
  204. package/lib/esm/types/TronWeb.d.ts +20 -0
  205. package/lib/esm/types/TronWeb.js +2 -0
  206. package/lib/esm/types/TronWeb.js.map +1 -0
  207. package/lib/esm/types/Trx.d.ts +263 -0
  208. package/lib/esm/types/Trx.js +39 -0
  209. package/lib/esm/types/Trx.js.map +1 -0
  210. package/lib/esm/types/UtilsTypes.d.ts +23 -0
  211. package/lib/esm/types/UtilsTypes.js +2 -0
  212. package/lib/esm/types/UtilsTypes.js.map +1 -0
  213. package/lib/esm/types/index.d.ts +9 -0
  214. package/lib/esm/types/index.js +10 -0
  215. package/lib/esm/types/index.js.map +1 -0
  216. package/lib/esm/utils/abi.d.ts +5 -0
  217. package/lib/esm/utils/abi.js +245 -0
  218. package/lib/esm/utils/abi.js.map +1 -0
  219. package/lib/esm/utils/accounts.d.ts +22 -0
  220. package/lib/esm/utils/accounts.js +46 -0
  221. package/lib/esm/utils/accounts.js.map +1 -0
  222. package/lib/esm/utils/address.d.ts +12 -0
  223. package/lib/esm/utils/address.js +82 -0
  224. package/lib/esm/utils/address.js.map +1 -0
  225. package/lib/esm/utils/base58.d.ts +3 -0
  226. package/lib/esm/utils/base58.js +64 -0
  227. package/lib/esm/utils/base58.js.map +1 -0
  228. package/lib/esm/utils/base64.d.ts +10 -0
  229. package/lib/esm/utils/base64.js +169 -0
  230. package/lib/esm/utils/base64.js.map +1 -0
  231. package/lib/esm/utils/bytes.d.ts +7 -0
  232. package/lib/esm/utils/bytes.js +53 -0
  233. package/lib/esm/utils/bytes.js.map +1 -0
  234. package/lib/esm/utils/code.d.ts +12 -0
  235. package/lib/esm/utils/code.js +149 -0
  236. package/lib/esm/utils/code.js.map +1 -0
  237. package/lib/esm/utils/crypto.d.ts +25 -0
  238. package/lib/esm/utils/crypto.js +198 -0
  239. package/lib/esm/utils/crypto.js.map +1 -0
  240. package/lib/esm/utils/ethersUtils.d.ts +14 -0
  241. package/lib/esm/utils/ethersUtils.js +17 -0
  242. package/lib/esm/utils/ethersUtils.js.map +1 -0
  243. package/lib/esm/utils/fragments.d.ts +465 -0
  244. package/lib/esm/utils/fragments.js +1330 -0
  245. package/lib/esm/utils/fragments.js.map +1 -0
  246. package/lib/esm/utils/help.d.ts +8 -0
  247. package/lib/esm/utils/help.js +51 -0
  248. package/lib/esm/utils/help.js.map +1 -0
  249. package/lib/esm/utils/index.d.ts +56 -0
  250. package/lib/esm/utils/index.js +40 -0
  251. package/lib/esm/utils/index.js.map +1 -0
  252. package/lib/esm/utils/interface.d.ts +381 -0
  253. package/lib/esm/utils/interface.js +1112 -0
  254. package/lib/esm/utils/interface.js.map +1 -0
  255. package/lib/esm/utils/message.d.ts +4 -0
  256. package/lib/esm/utils/message.js +32 -0
  257. package/lib/esm/utils/message.js.map +1 -0
  258. package/lib/esm/utils/transaction.d.ts +17 -0
  259. package/lib/esm/utils/transaction.js +669 -0
  260. package/lib/esm/utils/transaction.js.map +1 -0
  261. package/lib/esm/utils/typedData.d.ts +148 -0
  262. package/lib/esm/utils/typedData.js +493 -0
  263. package/lib/esm/utils/typedData.js.map +1 -0
  264. package/lib/esm/utils/validations.d.ts +22 -0
  265. package/lib/esm/utils/validations.js +108 -0
  266. package/lib/esm/utils/validations.js.map +1 -0
  267. package/package.json +110 -0
  268. package/src/index.ts +42 -0
  269. package/src/lib/TransactionBuilder/TransactionBuilder.ts +2272 -0
  270. package/src/lib/TransactionBuilder/helper.ts +139 -0
  271. package/src/lib/contract/index.ts +151 -0
  272. package/src/lib/contract/method.ts +336 -0
  273. package/src/lib/event.ts +248 -0
  274. package/src/lib/plugin.ts +102 -0
  275. package/src/lib/providers/HttpProvider.ts +66 -0
  276. package/src/lib/providers/index.ts +6 -0
  277. package/src/lib/trx.ts +1463 -0
  278. package/src/paramValidator/index.ts +136 -0
  279. package/src/protocol/core/Tron_pb.cjs +7524 -0
  280. package/src/protocol/core/contract/account_contract_pb.cjs +961 -0
  281. package/src/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
  282. package/src/protocol/core/contract/balance_contract_pb.cjs +3826 -0
  283. package/src/protocol/core/contract/common_pb.cjs +34 -0
  284. package/src/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
  285. package/src/protocol/core/contract/proposal_contract_pb.cjs +675 -0
  286. package/src/protocol/core/contract/smart_contract_pb.cjs +2960 -0
  287. package/src/protocol/core/contract/storage_contract_pb.cjs +848 -0
  288. package/src/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
  289. package/src/protocol/core/contract/witness_contract_pb.cjs +956 -0
  290. package/src/tronweb.ts +437 -0
  291. package/src/types/ABI.ts +82 -0
  292. package/src/types/APIResponse.ts +34 -0
  293. package/src/types/Contract.ts +352 -0
  294. package/src/types/Providers.ts +7 -0
  295. package/src/types/Transaction.ts +70 -0
  296. package/src/types/TransactionBuilder.ts +281 -0
  297. package/src/types/TronWeb.ts +23 -0
  298. package/src/types/Trx.ts +285 -0
  299. package/src/types/UtilsTypes.ts +25 -0
  300. package/src/types/index.ts +9 -0
  301. package/src/types/interface.d.ts +1 -0
  302. package/src/utils/abi.ts +257 -0
  303. package/src/utils/accounts.ts +60 -0
  304. package/src/utils/address.ts +89 -0
  305. package/src/utils/base58.ts +78 -0
  306. package/src/utils/base64.ts +200 -0
  307. package/src/utils/bytes.ts +68 -0
  308. package/src/utils/code.ts +172 -0
  309. package/src/utils/crypto.ts +264 -0
  310. package/src/utils/ethersUtils.ts +60 -0
  311. package/src/utils/fragments.ts +1738 -0
  312. package/src/utils/help.ts +59 -0
  313. package/src/utils/index.ts +42 -0
  314. package/src/utils/interface.ts +1362 -0
  315. package/src/utils/message.ts +38 -0
  316. package/src/utils/transaction.ts +991 -0
  317. package/src/utils/typedData.ts +688 -0
  318. package/src/utils/validations.ts +130 -0
@@ -0,0 +1,465 @@
1
+ /**
2
+ * A fragment is a single item from an ABI, which may represent any of:
3
+ *
4
+ * - [Functions](FunctionFragment)
5
+ * - [Events](EventFragment)
6
+ * - [Constructors](ConstructorFragment)
7
+ * - Custom [Errors](ErrorFragment)
8
+ * - [Fallback or Receive](FallbackFragment) functions
9
+ *
10
+ * @_subsection api/abi/abi-coder:Fragments [about-fragments]
11
+ */
12
+ /**
13
+ * A Type description in a [JSON ABI format](link-solc-jsonabi).
14
+ */
15
+ export interface JsonFragmentType {
16
+ /**
17
+ * The parameter name.
18
+ */
19
+ readonly name?: string;
20
+ /**
21
+ * If the parameter is indexed.
22
+ */
23
+ readonly indexed?: boolean;
24
+ /**
25
+ * The type of the parameter.
26
+ */
27
+ readonly type?: string;
28
+ /**
29
+ * The internal Solidity type.
30
+ */
31
+ readonly internalType?: string;
32
+ /**
33
+ * The components for a tuple.
34
+ */
35
+ readonly components?: ReadonlyArray<JsonFragmentType>;
36
+ }
37
+ /**
38
+ * A fragment for a method, event or error in a [JSON ABI format](link-solc-jsonabi).
39
+ */
40
+ export interface JsonFragment {
41
+ /**
42
+ * The name of the error, event, function, etc.
43
+ */
44
+ readonly name?: string;
45
+ /**
46
+ * The type of the fragment (e.g. ``event``, ``"function"``, etc.)
47
+ */
48
+ readonly type?: string;
49
+ /**
50
+ * If the event is anonymous.
51
+ */
52
+ readonly anonymous?: boolean;
53
+ /**
54
+ * If the function is payable.
55
+ */
56
+ readonly payable?: boolean;
57
+ /**
58
+ * If the function is constant.
59
+ */
60
+ readonly constant?: boolean;
61
+ /**
62
+ * The mutability state of the function.
63
+ */
64
+ readonly stateMutability?: string;
65
+ /**
66
+ * The input parameters.
67
+ */
68
+ readonly inputs?: ReadonlyArray<JsonFragmentType>;
69
+ /**
70
+ * The output parameters.
71
+ */
72
+ readonly outputs?: ReadonlyArray<JsonFragmentType>;
73
+ /**
74
+ * The gas limit to use when sending a transaction for this function.
75
+ */
76
+ readonly gas?: string;
77
+ }
78
+ /**
79
+ * The format to serialize the output as.
80
+ *
81
+ * **``"sighash"``** - the bare formatting, used to compute the selector
82
+ * or topic hash; this format cannot be reversed (as it discards ``indexed``)
83
+ * so cannot by used to export an [[Interface]].
84
+ *
85
+ * **``"minimal"``** - Human-Readable ABI with minimal spacing and without
86
+ * names, so it is compact, but will result in Result objects that cannot
87
+ * be accessed by name.
88
+ *
89
+ * **``"full"``** - Full Human-Readable ABI, with readable spacing and names
90
+ * intact; this is generally the recommended format.
91
+ *
92
+ * **``"json"``** - The [JSON ABI format](link-solc-jsonabi).
93
+ */
94
+ export type FormatType = 'sighash' | 'minimal' | 'full' | 'json';
95
+ /**
96
+ * When [walking](ParamType-walk) a [[ParamType]], this is called
97
+ * on each component.
98
+ */
99
+ export type ParamTypeWalkFunc = (type: string, value: any) => any;
100
+ /**
101
+ * When [walking asynchronously](ParamType-walkAsync) a [[ParamType]],
102
+ * this is called on each component.
103
+ */
104
+ export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise<any>;
105
+ /**
106
+ * Each input and output of a [[Fragment]] is an Array of **ParamType**.
107
+ */
108
+ export declare class ParamType {
109
+ #private;
110
+ /**
111
+ * The local name of the parameter (or ``""`` if unbound)
112
+ */
113
+ readonly name: string;
114
+ /**
115
+ * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``,
116
+ * ``"uint256[3][]"``)
117
+ */
118
+ readonly type: string;
119
+ /**
120
+ * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``)
121
+ */
122
+ readonly baseType: string;
123
+ /**
124
+ * True if the parameters is indexed.
125
+ *
126
+ * For non-indexable types this is ``null``.
127
+ */
128
+ readonly indexed: null | boolean;
129
+ /**
130
+ * The components for the tuple.
131
+ *
132
+ * For non-tuple types this is ``null``.
133
+ */
134
+ readonly components: null | ReadonlyArray<ParamType>;
135
+ /**
136
+ * The array length, or ``-1`` for dynamic-lengthed arrays.
137
+ *
138
+ * For non-array types this is ``null``.
139
+ */
140
+ readonly arrayLength: null | number;
141
+ /**
142
+ * The type of each child in the array.
143
+ *
144
+ * For non-array types this is ``null``.
145
+ */
146
+ readonly arrayChildren: null | ParamType;
147
+ /**
148
+ * @private
149
+ */
150
+ constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray<ParamType>, arrayLength: null | number, arrayChildren: null | ParamType);
151
+ /**
152
+ * Return a string representation of this type.
153
+ *
154
+ * For example,
155
+ *
156
+ * ``sighash" => "(uint256,address)"``
157
+ *
158
+ * ``"minimal" => "tuple(uint256,address) indexed"``
159
+ *
160
+ * ``"full" => "tuple(uint256 foo, address bar) indexed baz"``
161
+ */
162
+ format(format?: FormatType): string;
163
+ /**
164
+ * Returns true if %%this%% is an Array type.
165
+ *
166
+ * This provides a type gaurd ensuring that [[arrayChildren]]
167
+ * and [[arrayLength]] are non-null.
168
+ */
169
+ isArray(): this is ParamType & {
170
+ arrayChildren: ParamType;
171
+ arrayLength: number;
172
+ };
173
+ /**
174
+ * Returns true if %%this%% is a Tuple type.
175
+ *
176
+ * This provides a type gaurd ensuring that [[components]]
177
+ * is non-null.
178
+ */
179
+ isTuple(): this is ParamType & {
180
+ components: ReadonlyArray<ParamType>;
181
+ };
182
+ /**
183
+ * Returns true if %%this%% is an Indexable type.
184
+ *
185
+ * This provides a type gaurd ensuring that [[indexed]]
186
+ * is non-null.
187
+ */
188
+ isIndexable(): this is ParamType & {
189
+ indexed: boolean;
190
+ };
191
+ /**
192
+ * Walks the **ParamType** with %%value%%, calling %%process%%
193
+ * on each type, destructing the %%value%% recursively.
194
+ */
195
+ walk(value: any, process: ParamTypeWalkFunc): any;
196
+ /**
197
+ * Walks the **ParamType** with %%value%%, asynchronously calling
198
+ * %%process%% on each type, destructing the %%value%% recursively.
199
+ *
200
+ * This can be used to resolve ENS naes by walking and resolving each
201
+ * ``"address"`` type.
202
+ */
203
+ walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise<any>;
204
+ /**
205
+ * Creates a new **ParamType** for %%obj%%.
206
+ *
207
+ * If %%allowIndexed%% then the ``indexed`` keyword is permitted,
208
+ * otherwise the ``indexed`` keyword will throw an error.
209
+ */
210
+ static from(obj: any, allowIndexed?: boolean): ParamType;
211
+ /**
212
+ * Returns true if %%value%% is a **ParamType**.
213
+ */
214
+ static isParamType(value: any): value is ParamType;
215
+ }
216
+ /**
217
+ * The type of a [[Fragment]].
218
+ */
219
+ export type FragmentType = 'constructor' | 'error' | 'event' | 'fallback' | 'function' | 'struct';
220
+ /**
221
+ * An abstract class to represent An individual fragment from a parse ABI.
222
+ */
223
+ export declare abstract class Fragment {
224
+ /**
225
+ * The type of the fragment.
226
+ */
227
+ readonly type: FragmentType;
228
+ /**
229
+ * The inputs for the fragment.
230
+ */
231
+ readonly inputs: ReadonlyArray<ParamType>;
232
+ /**
233
+ * @private
234
+ */
235
+ constructor(guard: any, type: FragmentType, inputs: ReadonlyArray<ParamType>);
236
+ /**
237
+ * Returns a string representation of this fragment as %%format%%.
238
+ */
239
+ abstract format(format?: FormatType): string;
240
+ /**
241
+ * Creates a new **Fragment** for %%obj%%, wich can be any supported
242
+ * ABI frgament type.
243
+ */
244
+ static from(obj: any): Fragment;
245
+ /**
246
+ * Returns true if %%value%% is a [[ConstructorFragment]].
247
+ */
248
+ static isConstructor(value: any): value is ConstructorFragment;
249
+ /**
250
+ * Returns true if %%value%% is an [[ErrorFragment]].
251
+ */
252
+ static isError(value: any): value is ErrorFragment;
253
+ /**
254
+ * Returns true if %%value%% is an [[EventFragment]].
255
+ */
256
+ static isEvent(value: any): value is EventFragment;
257
+ /**
258
+ * Returns true if %%value%% is a [[FunctionFragment]].
259
+ */
260
+ static isFunction(value: any): value is FunctionFragment;
261
+ /**
262
+ * Returns true if %%value%% is a [[StructFragment]].
263
+ */
264
+ static isStruct(value: any): value is StructFragment;
265
+ }
266
+ /**
267
+ * An abstract class to represent An individual fragment
268
+ * which has a name from a parse ABI.
269
+ */
270
+ export declare abstract class NamedFragment extends Fragment {
271
+ /**
272
+ * The name of the fragment.
273
+ */
274
+ readonly name: string;
275
+ /**
276
+ * @private
277
+ */
278
+ constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray<ParamType>);
279
+ }
280
+ /**
281
+ * A Fragment which represents a //Custom Error//.
282
+ */
283
+ export declare class ErrorFragment extends NamedFragment {
284
+ /**
285
+ * @private
286
+ */
287
+ constructor(guard: any, name: string, inputs: ReadonlyArray<ParamType>);
288
+ /**
289
+ * The Custom Error selector.
290
+ */
291
+ get selector(): string;
292
+ /**
293
+ * Returns a string representation of this fragment as %%format%%.
294
+ */
295
+ format(format?: FormatType): string;
296
+ /**
297
+ * Returns a new **ErrorFragment** for %%obj%%.
298
+ */
299
+ static from(obj: any): ErrorFragment;
300
+ /**
301
+ * Returns ``true`` and provides a type guard if %%value%% is an
302
+ * **ErrorFragment**.
303
+ */
304
+ static isFragment(value: any): value is ErrorFragment;
305
+ }
306
+ /**
307
+ * A Fragment which represents an Event.
308
+ */
309
+ export declare class EventFragment extends NamedFragment {
310
+ /**
311
+ * Whether this event is anonymous.
312
+ */
313
+ readonly anonymous: boolean;
314
+ /**
315
+ * @private
316
+ */
317
+ constructor(guard: any, name: string, inputs: ReadonlyArray<ParamType>, anonymous: boolean);
318
+ /**
319
+ * The Event topic hash.
320
+ */
321
+ get topicHash(): string;
322
+ /**
323
+ * Returns a string representation of this event as %%format%%.
324
+ */
325
+ format(format?: FormatType): string;
326
+ /**
327
+ * Return the topic hash for an event with %%name%% and %%params%%.
328
+ */
329
+ static getTopicHash(name: string, params?: Array<any>): string;
330
+ /**
331
+ * Returns a new **EventFragment** for %%obj%%.
332
+ */
333
+ static from(obj: any): EventFragment;
334
+ /**
335
+ * Returns ``true`` and provides a type guard if %%value%% is an
336
+ * **EventFragment**.
337
+ */
338
+ static isFragment(value: any): value is EventFragment;
339
+ }
340
+ /**
341
+ * A Fragment which represents a constructor.
342
+ */
343
+ export declare class ConstructorFragment extends Fragment {
344
+ /**
345
+ * Whether the constructor can receive an endowment.
346
+ */
347
+ readonly payable: boolean;
348
+ /**
349
+ * The recommended gas limit for deployment or ``null``.
350
+ */
351
+ readonly gas: null | bigint;
352
+ /**
353
+ * @private
354
+ */
355
+ constructor(guard: any, type: FragmentType, inputs: ReadonlyArray<ParamType>, payable: boolean, gas: null | bigint);
356
+ /**
357
+ * Returns a string representation of this constructor as %%format%%.
358
+ */
359
+ format(format?: FormatType): string;
360
+ /**
361
+ * Returns a new **ConstructorFragment** for %%obj%%.
362
+ */
363
+ static from(obj: any): ConstructorFragment;
364
+ /**
365
+ * Returns ``true`` and provides a type guard if %%value%% is a
366
+ * **ConstructorFragment**.
367
+ */
368
+ static isFragment(value: any): value is ConstructorFragment;
369
+ }
370
+ /**
371
+ * A Fragment which represents a method.
372
+ */
373
+ export declare class FallbackFragment extends Fragment {
374
+ /**
375
+ * If the function can be sent value during invocation.
376
+ */
377
+ readonly payable: boolean;
378
+ constructor(guard: any, inputs: ReadonlyArray<ParamType>, payable: boolean);
379
+ /**
380
+ * Returns a string representation of this fallback as %%format%%.
381
+ */
382
+ format(format?: FormatType): string;
383
+ /**
384
+ * Returns a new **FallbackFragment** for %%obj%%.
385
+ */
386
+ static from(obj: any): FallbackFragment;
387
+ /**
388
+ * Returns ``true`` and provides a type guard if %%value%% is a
389
+ * **FallbackFragment**.
390
+ */
391
+ static isFragment(value: any): value is FallbackFragment;
392
+ }
393
+ /**
394
+ * A Fragment which represents a method.
395
+ */
396
+ export declare class FunctionFragment extends NamedFragment {
397
+ /**
398
+ * If the function is constant (e.g. ``pure`` or ``view`` functions).
399
+ */
400
+ readonly constant: boolean;
401
+ /**
402
+ * The returned types for the result of calling this function.
403
+ */
404
+ readonly outputs: ReadonlyArray<ParamType>;
405
+ /**
406
+ * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``
407
+ * or ``pure``)
408
+ */
409
+ readonly stateMutability: 'payable' | 'nonpayable' | 'view' | 'pure';
410
+ /**
411
+ * If the function can be sent value during invocation.
412
+ */
413
+ readonly payable: boolean;
414
+ /**
415
+ * The recommended gas limit to send when calling this function.
416
+ */
417
+ readonly gas: null | bigint;
418
+ /**
419
+ * @private
420
+ */
421
+ constructor(guard: any, name: string, stateMutability: 'payable' | 'nonpayable' | 'view' | 'pure', inputs: ReadonlyArray<ParamType>, outputs: ReadonlyArray<ParamType>, gas: null | bigint);
422
+ /**
423
+ * The Function selector.
424
+ */
425
+ get selector(): string;
426
+ /**
427
+ * Returns a string representation of this function as %%format%%.
428
+ */
429
+ format(format?: FormatType): string;
430
+ /**
431
+ * Return the selector for a function with %%name%% and %%params%%.
432
+ */
433
+ static getSelector(name: string, params?: Array<any>): string;
434
+ /**
435
+ * Returns a new **FunctionFragment** for %%obj%%.
436
+ */
437
+ static from(obj: any): FunctionFragment;
438
+ /**
439
+ * Returns ``true`` and provides a type guard if %%value%% is a
440
+ * **FunctionFragment**.
441
+ */
442
+ static isFragment(value: any): value is FunctionFragment;
443
+ }
444
+ /**
445
+ * A Fragment which represents a structure.
446
+ */
447
+ export declare class StructFragment extends NamedFragment {
448
+ /**
449
+ * @private
450
+ */
451
+ constructor(guard: any, name: string, inputs: ReadonlyArray<ParamType>);
452
+ /**
453
+ * Returns a string representation of this struct as %%format%%.
454
+ */
455
+ format(): string;
456
+ /**
457
+ * Returns a new **StructFragment** for %%obj%%.
458
+ */
459
+ static from(obj: any): StructFragment;
460
+ /**
461
+ * Returns ``true`` and provides a type guard if %%value%% is a
462
+ * **StructFragment**.
463
+ */
464
+ static isFragment(value: any): value is FunctionFragment;
465
+ }