crypto-aio 0.0.3 → 0.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 (691) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +144 -14
  3. package/dist/adapters/avalanche/address.d.ts +15 -0
  4. package/dist/adapters/avalanche/address.js +74 -0
  5. package/dist/adapters/avalanche/address.js.map +1 -0
  6. package/dist/adapters/avalanche/api.d.ts +100 -0
  7. package/dist/adapters/avalanche/api.js +381 -0
  8. package/dist/adapters/avalanche/api.js.map +1 -0
  9. package/dist/adapters/avalanche/builder.d.ts +13 -0
  10. package/dist/adapters/avalanche/builder.js +336 -0
  11. package/dist/adapters/avalanche/builder.js.map +1 -0
  12. package/dist/adapters/avalanche/cb58.d.ts +7 -0
  13. package/dist/adapters/avalanche/cb58.js +49 -0
  14. package/dist/adapters/avalanche/cb58.js.map +1 -0
  15. package/dist/adapters/avalanche/chains.d.ts +21 -0
  16. package/dist/adapters/avalanche/chains.js +79 -0
  17. package/dist/adapters/avalanche/chains.js.map +1 -0
  18. package/dist/adapters/avalanche/codec.d.ts +94 -0
  19. package/dist/adapters/avalanche/codec.js +371 -0
  20. package/dist/adapters/avalanche/codec.js.map +1 -0
  21. package/dist/adapters/avalanche/context.d.ts +59 -0
  22. package/dist/adapters/avalanche/context.js +114 -0
  23. package/dist/adapters/avalanche/context.js.map +1 -0
  24. package/dist/adapters/avalanche/decode.d.ts +16 -0
  25. package/dist/adapters/avalanche/decode.js +101 -0
  26. package/dist/adapters/avalanche/decode.js.map +1 -0
  27. package/dist/adapters/avalanche/driver.d.ts +22 -0
  28. package/dist/adapters/avalanche/driver.js +81 -0
  29. package/dist/adapters/avalanche/driver.js.map +1 -0
  30. package/dist/adapters/avalanche/errors.d.ts +18 -0
  31. package/dist/adapters/avalanche/errors.js +61 -0
  32. package/dist/adapters/avalanche/errors.js.map +1 -0
  33. package/dist/adapters/avalanche/fees.d.ts +23 -0
  34. package/dist/adapters/avalanche/fees.js +105 -0
  35. package/dist/adapters/avalanche/fees.js.map +1 -0
  36. package/dist/adapters/avalanche/index.d.ts +19 -0
  37. package/dist/adapters/avalanche/index.js +8 -0
  38. package/dist/adapters/avalanche/index.js.map +1 -0
  39. package/dist/adapters/avalanche/network.d.ts +37 -0
  40. package/dist/adapters/avalanche/network.js +135 -0
  41. package/dist/adapters/avalanche/network.js.map +1 -0
  42. package/dist/adapters/avalanche/plugin.d.ts +21 -0
  43. package/dist/adapters/avalanche/plugin.js +46 -0
  44. package/dist/adapters/avalanche/plugin.js.map +1 -0
  45. package/dist/adapters/avalanche/presets.d.ts +6 -0
  46. package/dist/adapters/avalanche/presets.js +86 -0
  47. package/dist/adapters/avalanche/presets.js.map +1 -0
  48. package/dist/adapters/avalanche/proofs.d.ts +41 -0
  49. package/dist/adapters/avalanche/proofs.js +270 -0
  50. package/dist/adapters/avalanche/proofs.js.map +1 -0
  51. package/dist/adapters/avalanche/reader.d.ts +40 -0
  52. package/dist/adapters/avalanche/reader.js +231 -0
  53. package/dist/adapters/avalanche/reader.js.map +1 -0
  54. package/dist/adapters/avalanche/sdk.d.ts +182 -0
  55. package/dist/adapters/avalanche/sdk.js +21 -0
  56. package/dist/adapters/avalanche/sdk.js.map +1 -0
  57. package/dist/adapters/avalanche/types.d.ts +86 -0
  58. package/dist/{type/common.js → adapters/avalanche/types.js} +1 -1
  59. package/dist/adapters/avalanche/types.js.map +1 -0
  60. package/dist/adapters/evm/builder.d.ts +11 -0
  61. package/dist/adapters/evm/builder.js +326 -0
  62. package/dist/adapters/evm/builder.js.map +1 -0
  63. package/dist/adapters/evm/chains.d.ts +6 -0
  64. package/dist/adapters/evm/chains.js +203 -0
  65. package/dist/adapters/evm/chains.js.map +1 -0
  66. package/dist/adapters/evm/client.d.ts +84 -0
  67. package/dist/adapters/evm/client.js +335 -0
  68. package/dist/adapters/evm/client.js.map +1 -0
  69. package/dist/adapters/evm/decode.d.ts +35 -0
  70. package/dist/adapters/evm/decode.js +170 -0
  71. package/dist/adapters/evm/decode.js.map +1 -0
  72. package/dist/adapters/evm/driver.d.ts +8 -0
  73. package/dist/adapters/evm/driver.js +61 -0
  74. package/dist/adapters/evm/driver.js.map +1 -0
  75. package/dist/adapters/evm/errors.d.ts +20 -0
  76. package/dist/adapters/evm/errors.js +110 -0
  77. package/dist/adapters/evm/errors.js.map +1 -0
  78. package/dist/adapters/evm/ethers-client.d.ts +43 -0
  79. package/dist/adapters/evm/ethers-client.js +135 -0
  80. package/dist/adapters/evm/ethers-client.js.map +1 -0
  81. package/dist/adapters/evm/fees.d.ts +79 -0
  82. package/dist/adapters/evm/fees.js +234 -0
  83. package/dist/adapters/evm/fees.js.map +1 -0
  84. package/dist/adapters/evm/index.d.ts +20 -0
  85. package/dist/adapters/evm/index.js +11 -0
  86. package/dist/adapters/evm/index.js.map +1 -0
  87. package/dist/adapters/evm/network.d.ts +60 -0
  88. package/dist/adapters/evm/network.js +131 -0
  89. package/dist/adapters/evm/network.js.map +1 -0
  90. package/dist/adapters/evm/plugin.d.ts +36 -0
  91. package/dist/adapters/evm/plugin.js +102 -0
  92. package/dist/adapters/evm/plugin.js.map +1 -0
  93. package/dist/adapters/evm/presets.d.ts +2 -0
  94. package/dist/adapters/evm/presets.js +105 -0
  95. package/dist/adapters/evm/presets.js.map +1 -0
  96. package/dist/adapters/evm/proofs.d.ts +19 -0
  97. package/dist/adapters/evm/proofs.js +358 -0
  98. package/dist/adapters/evm/proofs.js.map +1 -0
  99. package/dist/adapters/evm/rawtx.d.ts +25 -0
  100. package/dist/adapters/evm/rawtx.js +176 -0
  101. package/dist/adapters/evm/rawtx.js.map +1 -0
  102. package/dist/adapters/evm/reader.d.ts +65 -0
  103. package/dist/adapters/evm/reader.js +292 -0
  104. package/dist/adapters/evm/reader.js.map +1 -0
  105. package/dist/adapters/evm/rpc.d.ts +39 -0
  106. package/dist/adapters/evm/rpc.js +152 -0
  107. package/dist/adapters/evm/rpc.js.map +1 -0
  108. package/dist/adapters/evm/tokens.d.ts +7 -0
  109. package/dist/adapters/evm/tokens.js +23 -0
  110. package/dist/adapters/evm/tokens.js.map +1 -0
  111. package/dist/adapters/evm/types.d.ts +255 -0
  112. package/dist/{type/account.js → adapters/evm/types.js} +1 -1
  113. package/dist/adapters/evm/types.js.map +1 -0
  114. package/dist/adapters/evm/web3-client.d.ts +23 -0
  115. package/dist/adapters/evm/web3-client.js +159 -0
  116. package/dist/adapters/evm/web3-client.js.map +1 -0
  117. package/dist/adapters/solana/builder.d.ts +18 -0
  118. package/dist/adapters/solana/builder.js +545 -0
  119. package/dist/adapters/solana/builder.js.map +1 -0
  120. package/dist/adapters/solana/chains.d.ts +13 -0
  121. package/dist/adapters/solana/chains.js +37 -0
  122. package/dist/adapters/solana/chains.js.map +1 -0
  123. package/dist/adapters/solana/decode.d.ts +111 -0
  124. package/dist/adapters/solana/decode.js +595 -0
  125. package/dist/adapters/solana/decode.js.map +1 -0
  126. package/dist/adapters/solana/driver.d.ts +15 -0
  127. package/dist/adapters/solana/driver.js +72 -0
  128. package/dist/adapters/solana/driver.js.map +1 -0
  129. package/dist/adapters/solana/errors.d.ts +36 -0
  130. package/dist/adapters/solana/errors.js +154 -0
  131. package/dist/adapters/solana/errors.js.map +1 -0
  132. package/dist/adapters/solana/fees.d.ts +68 -0
  133. package/dist/adapters/solana/fees.js +205 -0
  134. package/dist/adapters/solana/fees.js.map +1 -0
  135. package/dist/adapters/solana/heights.d.ts +47 -0
  136. package/dist/adapters/solana/heights.js +185 -0
  137. package/dist/adapters/solana/heights.js.map +1 -0
  138. package/dist/adapters/solana/history.d.ts +10 -0
  139. package/dist/adapters/solana/history.js +71 -0
  140. package/dist/adapters/solana/history.js.map +1 -0
  141. package/dist/adapters/solana/index.d.ts +16 -0
  142. package/dist/adapters/solana/index.js +9 -0
  143. package/dist/adapters/solana/index.js.map +1 -0
  144. package/dist/adapters/solana/keys.d.ts +13 -0
  145. package/dist/adapters/solana/keys.js +69 -0
  146. package/dist/adapters/solana/keys.js.map +1 -0
  147. package/dist/adapters/solana/network.d.ts +24 -0
  148. package/dist/adapters/solana/network.js +95 -0
  149. package/dist/adapters/solana/network.js.map +1 -0
  150. package/dist/adapters/solana/plugin.d.ts +18 -0
  151. package/dist/adapters/solana/plugin.js +41 -0
  152. package/dist/adapters/solana/plugin.js.map +1 -0
  153. package/dist/adapters/solana/presets.d.ts +2 -0
  154. package/dist/adapters/solana/presets.js +77 -0
  155. package/dist/adapters/solana/presets.js.map +1 -0
  156. package/dist/adapters/solana/programs.d.ts +44 -0
  157. package/dist/adapters/solana/programs.js +159 -0
  158. package/dist/adapters/solana/programs.js.map +1 -0
  159. package/dist/adapters/solana/proofs.d.ts +56 -0
  160. package/dist/adapters/solana/proofs.js +540 -0
  161. package/dist/adapters/solana/proofs.js.map +1 -0
  162. package/dist/adapters/solana/reader.d.ts +82 -0
  163. package/dist/adapters/solana/reader.js +326 -0
  164. package/dist/adapters/solana/reader.js.map +1 -0
  165. package/dist/adapters/solana/rpc.d.ts +102 -0
  166. package/dist/adapters/solana/rpc.js +301 -0
  167. package/dist/adapters/solana/rpc.js.map +1 -0
  168. package/dist/adapters/solana/tokens.d.ts +7 -0
  169. package/dist/adapters/solana/tokens.js +19 -0
  170. package/dist/adapters/solana/tokens.js.map +1 -0
  171. package/dist/adapters/solana/types.d.ts +121 -0
  172. package/dist/{type/contract.js → adapters/solana/types.js} +1 -1
  173. package/dist/adapters/solana/types.js.map +1 -0
  174. package/dist/adapters/solana/web3.d.ts +5 -0
  175. package/dist/adapters/solana/web3.js +83 -0
  176. package/dist/adapters/solana/web3.js.map +1 -0
  177. package/dist/adapters/solana/wire.d.ts +62 -0
  178. package/dist/adapters/solana/wire.js +168 -0
  179. package/dist/adapters/solana/wire.js.map +1 -0
  180. package/dist/adapters/ton/address.d.ts +43 -0
  181. package/dist/adapters/ton/address.js +168 -0
  182. package/dist/adapters/ton/address.js.map +1 -0
  183. package/dist/adapters/ton/api.d.ts +344 -0
  184. package/dist/adapters/ton/api.js +942 -0
  185. package/dist/adapters/ton/api.js.map +1 -0
  186. package/dist/adapters/ton/builder.d.ts +18 -0
  187. package/dist/adapters/ton/builder.js +701 -0
  188. package/dist/adapters/ton/builder.js.map +1 -0
  189. package/dist/adapters/ton/chains.d.ts +16 -0
  190. package/dist/adapters/ton/chains.js +39 -0
  191. package/dist/adapters/ton/chains.js.map +1 -0
  192. package/dist/adapters/ton/decode.d.ts +43 -0
  193. package/dist/adapters/ton/decode.js +219 -0
  194. package/dist/adapters/ton/decode.js.map +1 -0
  195. package/dist/adapters/ton/driver.d.ts +10 -0
  196. package/dist/adapters/ton/driver.js +117 -0
  197. package/dist/adapters/ton/driver.js.map +1 -0
  198. package/dist/adapters/ton/errors.d.ts +36 -0
  199. package/dist/adapters/ton/errors.js +89 -0
  200. package/dist/adapters/ton/errors.js.map +1 -0
  201. package/dist/adapters/ton/fees.d.ts +28 -0
  202. package/dist/adapters/ton/fees.js +121 -0
  203. package/dist/adapters/ton/fees.js.map +1 -0
  204. package/dist/adapters/ton/index.d.ts +16 -0
  205. package/dist/adapters/ton/index.js +9 -0
  206. package/dist/adapters/ton/index.js.map +1 -0
  207. package/dist/adapters/ton/messages.d.ts +157 -0
  208. package/dist/adapters/ton/messages.js +397 -0
  209. package/dist/adapters/ton/messages.js.map +1 -0
  210. package/dist/adapters/ton/native-client.d.ts +10 -0
  211. package/dist/adapters/ton/native-client.js +47 -0
  212. package/dist/adapters/ton/native-client.js.map +1 -0
  213. package/dist/adapters/ton/network.d.ts +58 -0
  214. package/dist/adapters/ton/network.js +207 -0
  215. package/dist/adapters/ton/network.js.map +1 -0
  216. package/dist/adapters/ton/plugin.d.ts +24 -0
  217. package/dist/adapters/ton/plugin.js +57 -0
  218. package/dist/adapters/ton/plugin.js.map +1 -0
  219. package/dist/adapters/ton/presets.d.ts +6 -0
  220. package/dist/adapters/ton/presets.js +94 -0
  221. package/dist/adapters/ton/presets.js.map +1 -0
  222. package/dist/adapters/ton/proofs.d.ts +66 -0
  223. package/dist/adapters/ton/proofs.js +813 -0
  224. package/dist/adapters/ton/proofs.js.map +1 -0
  225. package/dist/adapters/ton/reader.d.ts +194 -0
  226. package/dist/adapters/ton/reader.js +781 -0
  227. package/dist/adapters/ton/reader.js.map +1 -0
  228. package/dist/adapters/ton/tokens.d.ts +10 -0
  229. package/dist/adapters/ton/tokens.js +27 -0
  230. package/dist/adapters/ton/tokens.js.map +1 -0
  231. package/dist/adapters/ton/trace.d.ts +48 -0
  232. package/dist/adapters/ton/trace.js +277 -0
  233. package/dist/adapters/ton/trace.js.map +1 -0
  234. package/dist/adapters/ton/types.d.ts +105 -0
  235. package/dist/{type/transact.js → adapters/ton/types.js} +1 -1
  236. package/dist/adapters/ton/types.js.map +1 -0
  237. package/dist/adapters/ton/wallets.d.ts +86 -0
  238. package/dist/adapters/ton/wallets.js +373 -0
  239. package/dist/adapters/ton/wallets.js.map +1 -0
  240. package/dist/adapters/tron/abi.d.ts +39 -0
  241. package/dist/adapters/tron/abi.js +110 -0
  242. package/dist/adapters/tron/abi.js.map +1 -0
  243. package/dist/adapters/tron/address.d.ts +20 -0
  244. package/dist/adapters/tron/address.js +110 -0
  245. package/dist/adapters/tron/address.js.map +1 -0
  246. package/dist/adapters/tron/builder.d.ts +12 -0
  247. package/dist/adapters/tron/builder.js +553 -0
  248. package/dist/adapters/tron/builder.js.map +1 -0
  249. package/dist/adapters/tron/chains.d.ts +12 -0
  250. package/dist/adapters/tron/chains.js +35 -0
  251. package/dist/adapters/tron/chains.js.map +1 -0
  252. package/dist/adapters/tron/codec.d.ts +10 -0
  253. package/dist/adapters/tron/codec.js +322 -0
  254. package/dist/adapters/tron/codec.js.map +1 -0
  255. package/dist/adapters/tron/decode.d.ts +50 -0
  256. package/dist/adapters/tron/decode.js +280 -0
  257. package/dist/adapters/tron/decode.js.map +1 -0
  258. package/dist/adapters/tron/driver.d.ts +12 -0
  259. package/dist/adapters/tron/driver.js +106 -0
  260. package/dist/adapters/tron/driver.js.map +1 -0
  261. package/dist/adapters/tron/errors.d.ts +74 -0
  262. package/dist/adapters/tron/errors.js +261 -0
  263. package/dist/adapters/tron/errors.js.map +1 -0
  264. package/dist/adapters/tron/fees.d.ts +49 -0
  265. package/dist/adapters/tron/fees.js +166 -0
  266. package/dist/adapters/tron/fees.js.map +1 -0
  267. package/dist/adapters/tron/http.d.ts +173 -0
  268. package/dist/adapters/tron/http.js +729 -0
  269. package/dist/adapters/tron/http.js.map +1 -0
  270. package/dist/adapters/tron/index.d.ts +16 -0
  271. package/dist/adapters/tron/index.js +15 -0
  272. package/dist/adapters/tron/index.js.map +1 -0
  273. package/dist/adapters/tron/network.d.ts +44 -0
  274. package/dist/adapters/tron/network.js +163 -0
  275. package/dist/adapters/tron/network.js.map +1 -0
  276. package/dist/adapters/tron/plugin.d.ts +17 -0
  277. package/dist/adapters/tron/plugin.js +39 -0
  278. package/dist/adapters/tron/plugin.js.map +1 -0
  279. package/dist/adapters/tron/presets.d.ts +5 -0
  280. package/dist/adapters/tron/presets.js +68 -0
  281. package/dist/adapters/tron/presets.js.map +1 -0
  282. package/dist/adapters/tron/proofs.d.ts +80 -0
  283. package/dist/adapters/tron/proofs.js +370 -0
  284. package/dist/adapters/tron/proofs.js.map +1 -0
  285. package/dist/adapters/tron/protobuf.d.ts +36 -0
  286. package/dist/adapters/tron/protobuf.js +90 -0
  287. package/dist/adapters/tron/protobuf.js.map +1 -0
  288. package/dist/adapters/tron/reader.d.ts +47 -0
  289. package/dist/adapters/tron/reader.js +203 -0
  290. package/dist/adapters/tron/reader.js.map +1 -0
  291. package/dist/adapters/tron/tokens.d.ts +7 -0
  292. package/dist/adapters/tron/tokens.js +14 -0
  293. package/dist/adapters/tron/tokens.js.map +1 -0
  294. package/dist/adapters/tron/types.d.ts +166 -0
  295. package/dist/adapters/tron/types.js +3 -0
  296. package/dist/adapters/tron/types.js.map +1 -0
  297. package/dist/adapters/utxo/address.d.ts +51 -0
  298. package/dist/adapters/utxo/address.js +341 -0
  299. package/dist/adapters/utxo/address.js.map +1 -0
  300. package/dist/adapters/utxo/builder.d.ts +35 -0
  301. package/dist/adapters/utxo/builder.js +380 -0
  302. package/dist/adapters/utxo/builder.js.map +1 -0
  303. package/dist/adapters/utxo/chains.d.ts +17 -0
  304. package/dist/adapters/utxo/chains.js +99 -0
  305. package/dist/adapters/utxo/chains.js.map +1 -0
  306. package/dist/adapters/utxo/codec.d.ts +120 -0
  307. package/dist/adapters/utxo/codec.js +408 -0
  308. package/dist/adapters/utxo/codec.js.map +1 -0
  309. package/dist/adapters/utxo/coinselect.d.ts +48 -0
  310. package/dist/adapters/utxo/coinselect.js +131 -0
  311. package/dist/adapters/utxo/coinselect.js.map +1 -0
  312. package/dist/adapters/utxo/context.d.ts +57 -0
  313. package/dist/adapters/utxo/context.js +118 -0
  314. package/dist/adapters/utxo/context.js.map +1 -0
  315. package/dist/adapters/utxo/decode.d.ts +14 -0
  316. package/dist/adapters/utxo/decode.js +85 -0
  317. package/dist/adapters/utxo/decode.js.map +1 -0
  318. package/dist/adapters/utxo/driver.d.ts +16 -0
  319. package/dist/adapters/utxo/driver.js +74 -0
  320. package/dist/adapters/utxo/driver.js.map +1 -0
  321. package/dist/adapters/utxo/ecc.d.ts +9 -0
  322. package/dist/adapters/utxo/ecc.js +26 -0
  323. package/dist/adapters/utxo/ecc.js.map +1 -0
  324. package/dist/adapters/utxo/errors.d.ts +52 -0
  325. package/dist/adapters/utxo/errors.js +191 -0
  326. package/dist/adapters/utxo/errors.js.map +1 -0
  327. package/dist/adapters/utxo/esplora.d.ts +79 -0
  328. package/dist/adapters/utxo/esplora.js +451 -0
  329. package/dist/adapters/utxo/esplora.js.map +1 -0
  330. package/dist/adapters/utxo/fees.d.ts +41 -0
  331. package/dist/adapters/utxo/fees.js +125 -0
  332. package/dist/adapters/utxo/fees.js.map +1 -0
  333. package/dist/adapters/utxo/index.d.ts +17 -0
  334. package/dist/adapters/utxo/index.js +8 -0
  335. package/dist/adapters/utxo/index.js.map +1 -0
  336. package/dist/adapters/utxo/network.d.ts +50 -0
  337. package/dist/adapters/utxo/network.js +165 -0
  338. package/dist/adapters/utxo/network.js.map +1 -0
  339. package/dist/adapters/utxo/plugin.d.ts +17 -0
  340. package/dist/adapters/utxo/plugin.js +41 -0
  341. package/dist/adapters/utxo/plugin.js.map +1 -0
  342. package/dist/adapters/utxo/presets.d.ts +12 -0
  343. package/dist/adapters/utxo/presets.js +47 -0
  344. package/dist/adapters/utxo/presets.js.map +1 -0
  345. package/dist/adapters/utxo/preview.d.ts +3 -0
  346. package/dist/adapters/utxo/preview.js +65 -0
  347. package/dist/adapters/utxo/preview.js.map +1 -0
  348. package/dist/adapters/utxo/proofs.d.ts +57 -0
  349. package/dist/adapters/utxo/proofs.js +331 -0
  350. package/dist/adapters/utxo/proofs.js.map +1 -0
  351. package/dist/adapters/utxo/rawtx.d.ts +59 -0
  352. package/dist/adapters/utxo/rawtx.js +234 -0
  353. package/dist/adapters/utxo/rawtx.js.map +1 -0
  354. package/dist/adapters/utxo/reader.d.ts +36 -0
  355. package/dist/adapters/utxo/reader.js +265 -0
  356. package/dist/adapters/utxo/reader.js.map +1 -0
  357. package/dist/adapters/utxo/sdk.d.ts +18 -0
  358. package/dist/adapters/utxo/sdk.js +17 -0
  359. package/dist/adapters/utxo/sdk.js.map +1 -0
  360. package/dist/adapters/utxo/signed-psbt.d.ts +36 -0
  361. package/dist/adapters/utxo/signed-psbt.js +428 -0
  362. package/dist/adapters/utxo/signed-psbt.js.map +1 -0
  363. package/dist/adapters/utxo/spend.d.ts +59 -0
  364. package/dist/adapters/utxo/spend.js +230 -0
  365. package/dist/adapters/utxo/spend.js.map +1 -0
  366. package/dist/adapters/utxo/types.d.ts +167 -0
  367. package/dist/adapters/utxo/types.js +3 -0
  368. package/dist/adapters/utxo/types.js.map +1 -0
  369. package/dist/core/assets/service.d.ts +18 -0
  370. package/dist/core/assets/service.js +69 -0
  371. package/dist/core/assets/service.js.map +1 -0
  372. package/dist/core/blockchain/default-ref.d.ts +4 -0
  373. package/dist/core/blockchain/default-ref.js +16 -0
  374. package/dist/core/blockchain/default-ref.js.map +1 -0
  375. package/dist/core/blockchain/handle.d.ts +200 -0
  376. package/dist/core/blockchain/handle.js +579 -0
  377. package/dist/core/blockchain/handle.js.map +1 -0
  378. package/dist/core/blockchain/internal.d.ts +19 -0
  379. package/dist/core/blockchain/internal.js +16 -0
  380. package/dist/core/blockchain/internal.js.map +1 -0
  381. package/dist/core/blockchain/mapping.d.ts +22 -0
  382. package/dist/core/blockchain/mapping.js +136 -0
  383. package/dist/core/blockchain/mapping.js.map +1 -0
  384. package/dist/core/config/env.d.ts +8 -0
  385. package/dist/core/config/env.js +60 -0
  386. package/dist/core/config/env.js.map +1 -0
  387. package/dist/core/config/merge.d.ts +26 -0
  388. package/dist/core/config/merge.js +144 -0
  389. package/dist/core/config/merge.js.map +1 -0
  390. package/dist/core/config/resolve.d.ts +12 -0
  391. package/dist/core/config/resolve.js +251 -0
  392. package/dist/core/config/resolve.js.map +1 -0
  393. package/dist/core/config/types.d.ts +165 -0
  394. package/dist/core/config/types.js +3 -0
  395. package/dist/core/config/types.js.map +1 -0
  396. package/dist/core/container/builtins.d.ts +4 -0
  397. package/dist/core/container/builtins.js +13 -0
  398. package/dist/core/container/builtins.js.map +1 -0
  399. package/dist/core/container/container.d.ts +69 -0
  400. package/dist/core/container/container.js +466 -0
  401. package/dist/core/container/container.js.map +1 -0
  402. package/dist/core/container/default.d.ts +15 -0
  403. package/dist/core/container/default.js +70 -0
  404. package/dist/core/container/default.js.map +1 -0
  405. package/dist/core/container/internals.d.ts +54 -0
  406. package/dist/core/container/internals.js +21 -0
  407. package/dist/core/container/internals.js.map +1 -0
  408. package/dist/core/container/pool.d.ts +27 -0
  409. package/dist/core/container/pool.js +77 -0
  410. package/dist/core/container/pool.js.map +1 -0
  411. package/dist/core/driver/types.d.ts +346 -0
  412. package/dist/core/driver/types.js +3 -0
  413. package/dist/core/driver/types.js.map +1 -0
  414. package/dist/core/errors/codes.d.ts +153 -0
  415. package/dist/core/errors/codes.js +49 -0
  416. package/dist/core/errors/codes.js.map +1 -0
  417. package/dist/core/errors/error.d.ts +66 -0
  418. package/dist/core/errors/error.js +129 -0
  419. package/dist/core/errors/error.js.map +1 -0
  420. package/dist/core/events/bus.d.ts +12 -0
  421. package/dist/core/events/bus.js +46 -0
  422. package/dist/core/events/bus.js.map +1 -0
  423. package/dist/core/events/logger.d.ts +13 -0
  424. package/dist/core/events/logger.js +42 -0
  425. package/dist/core/events/logger.js.map +1 -0
  426. package/dist/core/events/types.d.ts +131 -0
  427. package/dist/core/events/types.js +3 -0
  428. package/dist/core/events/types.js.map +1 -0
  429. package/dist/core/lifecycle/engine-rules.d.ts +107 -0
  430. package/dist/core/lifecycle/engine-rules.js +257 -0
  431. package/dist/core/lifecycle/engine-rules.js.map +1 -0
  432. package/dist/core/lifecycle/engine.d.ts +500 -0
  433. package/dist/core/lifecycle/engine.js +1732 -0
  434. package/dist/core/lifecycle/engine.js.map +1 -0
  435. package/dist/core/lifecycle/evaluate.d.ts +19 -0
  436. package/dist/core/lifecycle/evaluate.js +72 -0
  437. package/dist/core/lifecycle/evaluate.js.map +1 -0
  438. package/dist/core/lifecycle/intent.d.ts +11 -0
  439. package/dist/core/lifecycle/intent.js +88 -0
  440. package/dist/core/lifecycle/intent.js.map +1 -0
  441. package/dist/core/lifecycle/monitor.d.ts +138 -0
  442. package/dist/core/lifecycle/monitor.js +606 -0
  443. package/dist/core/lifecycle/monitor.js.map +1 -0
  444. package/dist/core/lifecycle/observations.d.ts +17 -0
  445. package/dist/core/lifecycle/observations.js +59 -0
  446. package/dist/core/lifecycle/observations.js.map +1 -0
  447. package/dist/core/lifecycle/reconcile.d.ts +58 -0
  448. package/dist/core/lifecycle/reconcile.js +112 -0
  449. package/dist/core/lifecycle/reconcile.js.map +1 -0
  450. package/dist/core/lifecycle/views.d.ts +49 -0
  451. package/dist/core/lifecycle/views.js +57 -0
  452. package/dist/core/lifecycle/views.js.map +1 -0
  453. package/dist/core/lifecycle/workers.d.ts +82 -0
  454. package/dist/core/lifecycle/workers.js +329 -0
  455. package/dist/core/lifecycle/workers.js.map +1 -0
  456. package/dist/core/model/address.d.ts +32 -0
  457. package/dist/core/model/address.js +43 -0
  458. package/dist/core/model/address.js.map +1 -0
  459. package/dist/core/model/amount.d.ts +25 -0
  460. package/dist/core/model/amount.js +102 -0
  461. package/dist/core/model/amount.js.map +1 -0
  462. package/dist/core/model/asset.d.ts +28 -0
  463. package/dist/core/model/asset.js +47 -0
  464. package/dist/core/model/asset.js.map +1 -0
  465. package/dist/core/model/capability.d.ts +3 -0
  466. package/dist/core/model/capability.js +18 -0
  467. package/dist/core/model/capability.js.map +1 -0
  468. package/dist/core/model/chain.d.ts +63 -0
  469. package/dist/core/model/chain.js +8 -0
  470. package/dist/core/model/chain.js.map +1 -0
  471. package/dist/core/model/fee.d.ts +36 -0
  472. package/dist/core/model/fee.js +17 -0
  473. package/dist/core/model/fee.js.map +1 -0
  474. package/dist/core/model/ids.d.ts +37 -0
  475. package/dist/core/model/ids.js +13 -0
  476. package/dist/core/model/ids.js.map +1 -0
  477. package/dist/core/model/intent.d.ts +63 -0
  478. package/dist/core/model/intent.js +81 -0
  479. package/dist/core/model/intent.js.map +1 -0
  480. package/dist/core/model/ordering.d.ts +20 -0
  481. package/dist/core/model/ordering.js +29 -0
  482. package/dist/core/model/ordering.js.map +1 -0
  483. package/dist/core/model/transaction.d.ts +116 -0
  484. package/dist/{type/lib-types.js → core/model/transaction.js} +1 -1
  485. package/dist/core/model/transaction.js.map +1 -0
  486. package/dist/core/observe/scanner.d.ts +135 -0
  487. package/dist/core/observe/scanner.js +355 -0
  488. package/dist/core/observe/scanner.js.map +1 -0
  489. package/dist/core/ordering/reservations.d.ts +16 -0
  490. package/dist/core/ordering/reservations.js +53 -0
  491. package/dist/core/ordering/reservations.js.map +1 -0
  492. package/dist/core/ordering/sequence.d.ts +61 -0
  493. package/dist/core/ordering/sequence.js +155 -0
  494. package/dist/core/ordering/sequence.js.map +1 -0
  495. package/dist/core/registry/adapters.d.ts +10 -0
  496. package/dist/core/registry/adapters.js +56 -0
  497. package/dist/core/registry/adapters.js.map +1 -0
  498. package/dist/core/registry/assets.d.ts +18 -0
  499. package/dist/core/registry/assets.js +90 -0
  500. package/dist/core/registry/assets.js.map +1 -0
  501. package/dist/core/registry/chains.d.ts +10 -0
  502. package/dist/core/registry/chains.js +80 -0
  503. package/dist/core/registry/chains.js.map +1 -0
  504. package/dist/core/registry/plugin.d.ts +41 -0
  505. package/dist/core/registry/plugin.js +109 -0
  506. package/dist/core/registry/plugin.js.map +1 -0
  507. package/dist/core/registry/providers.d.ts +31 -0
  508. package/dist/core/registry/providers.js +43 -0
  509. package/dist/core/registry/providers.js.map +1 -0
  510. package/dist/core/registry/schemes.d.ts +30 -0
  511. package/dist/core/registry/schemes.js +84 -0
  512. package/dist/core/registry/schemes.js.map +1 -0
  513. package/dist/core/secret/fragments.d.ts +33 -0
  514. package/dist/core/secret/fragments.js +110 -0
  515. package/dist/core/secret/fragments.js.map +1 -0
  516. package/dist/core/secret/redact.d.ts +10 -0
  517. package/dist/core/secret/redact.js +110 -0
  518. package/dist/core/secret/redact.js.map +1 -0
  519. package/dist/core/secret/secret.d.ts +14 -0
  520. package/dist/core/secret/secret.js +42 -0
  521. package/dist/core/secret/secret.js.map +1 -0
  522. package/dist/core/signing/callback.d.ts +10 -0
  523. package/dist/core/signing/callback.js +22 -0
  524. package/dist/core/signing/callback.js.map +1 -0
  525. package/dist/core/signing/guard.d.ts +18 -0
  526. package/dist/core/signing/guard.js +72 -0
  527. package/dist/core/signing/guard.js.map +1 -0
  528. package/dist/core/signing/hd.d.ts +36 -0
  529. package/dist/core/signing/hd.js +167 -0
  530. package/dist/core/signing/hd.js.map +1 -0
  531. package/dist/core/signing/local.d.ts +48 -0
  532. package/dist/core/signing/local.js +190 -0
  533. package/dist/core/signing/local.js.map +1 -0
  534. package/dist/core/signing/orchestrator.d.ts +40 -0
  535. package/dist/core/signing/orchestrator.js +300 -0
  536. package/dist/core/signing/orchestrator.js.map +1 -0
  537. package/dist/core/signing/types.d.ts +64 -0
  538. package/dist/core/signing/types.js +3 -0
  539. package/dist/core/signing/types.js.map +1 -0
  540. package/dist/core/signing/wallet.d.ts +48 -0
  541. package/dist/core/signing/wallet.js +153 -0
  542. package/dist/core/signing/wallet.js.map +1 -0
  543. package/dist/core/store/clone.d.ts +25 -0
  544. package/dist/core/store/clone.js +71 -0
  545. package/dist/core/store/clone.js.map +1 -0
  546. package/dist/core/store/memory.d.ts +38 -0
  547. package/dist/core/store/memory.js +325 -0
  548. package/dist/core/store/memory.js.map +1 -0
  549. package/dist/core/store/types.d.ts +246 -0
  550. package/dist/core/store/types.js +117 -0
  551. package/dist/core/store/types.js.map +1 -0
  552. package/dist/core/transport/backoff.d.ts +8 -0
  553. package/dist/core/transport/backoff.js +27 -0
  554. package/dist/core/transport/backoff.js.map +1 -0
  555. package/dist/core/transport/circuit.d.ts +25 -0
  556. package/dist/core/transport/circuit.js +61 -0
  557. package/dist/core/transport/circuit.js.map +1 -0
  558. package/dist/core/transport/http-transport.d.ts +30 -0
  559. package/dist/core/transport/http-transport.js +1695 -0
  560. package/dist/core/transport/http-transport.js.map +1 -0
  561. package/dist/core/transport/rate-limit.d.ts +27 -0
  562. package/dist/core/transport/rate-limit.js +78 -0
  563. package/dist/core/transport/rate-limit.js.map +1 -0
  564. package/dist/core/transport/stale-view.d.ts +11 -0
  565. package/dist/core/transport/stale-view.js +17 -0
  566. package/dist/core/transport/stale-view.js.map +1 -0
  567. package/dist/core/transport/types.d.ts +144 -0
  568. package/dist/core/transport/types.js +6 -0
  569. package/dist/core/transport/types.js.map +1 -0
  570. package/dist/core/util/bytes.d.ts +9 -0
  571. package/dist/core/util/bytes.js +40 -0
  572. package/dist/core/util/bytes.js.map +1 -0
  573. package/dist/core/util/clock.d.ts +6 -0
  574. package/dist/core/util/clock.js +26 -0
  575. package/dist/core/util/clock.js.map +1 -0
  576. package/dist/core/util/freeze.d.ts +8 -0
  577. package/dist/core/util/freeze.js +31 -0
  578. package/dist/core/util/freeze.js.map +1 -0
  579. package/dist/core/util/json.d.ts +29 -0
  580. package/dist/core/util/json.js +165 -0
  581. package/dist/core/util/json.js.map +1 -0
  582. package/dist/core/util/names.d.ts +21 -0
  583. package/dist/core/util/names.js +46 -0
  584. package/dist/core/util/names.js.map +1 -0
  585. package/dist/index.d.ts +64 -14
  586. package/dist/index.js +105 -49
  587. package/dist/index.js.map +1 -1
  588. package/dist/native.d.ts +21 -0
  589. package/dist/native.js +44 -0
  590. package/dist/native.js.map +1 -0
  591. package/dist/testing/contracts/api.d.ts +12 -0
  592. package/dist/testing/contracts/api.js +58 -0
  593. package/dist/testing/contracts/api.js.map +1 -0
  594. package/dist/testing/contracts/cursors.d.ts +6 -0
  595. package/dist/testing/contracts/cursors.js +43 -0
  596. package/dist/testing/contracts/cursors.js.map +1 -0
  597. package/dist/testing/contracts/locks.d.ts +10 -0
  598. package/dist/testing/contracts/locks.js +63 -0
  599. package/dist/testing/contracts/locks.js.map +1 -0
  600. package/dist/testing/contracts/operations.d.ts +21 -0
  601. package/dist/testing/contracts/operations.js +718 -0
  602. package/dist/testing/contracts/operations.js.map +1 -0
  603. package/dist/testing/contracts/sequences.d.ts +6 -0
  604. package/dist/testing/contracts/sequences.js +68 -0
  605. package/dist/testing/contracts/sequences.js.map +1 -0
  606. package/dist/testing/env.d.ts +63 -0
  607. package/dist/testing/env.js +105 -0
  608. package/dist/testing/env.js.map +1 -0
  609. package/dist/testing/fake-chain.d.ts +118 -0
  610. package/dist/testing/fake-chain.js +536 -0
  611. package/dist/testing/fake-chain.js.map +1 -0
  612. package/dist/testing/fake-clock.d.ts +15 -0
  613. package/dist/testing/fake-clock.js +86 -0
  614. package/dist/testing/fake-clock.js.map +1 -0
  615. package/dist/testing/fake-driver.d.ts +15 -0
  616. package/dist/testing/fake-driver.js +458 -0
  617. package/dist/testing/fake-driver.js.map +1 -0
  618. package/dist/testing/fake-fetch.d.ts +32 -0
  619. package/dist/testing/fake-fetch.js +81 -0
  620. package/dist/testing/fake-fetch.js.map +1 -0
  621. package/dist/testing/fake-plugin.d.ts +30 -0
  622. package/dist/testing/fake-plugin.js +66 -0
  623. package/dist/testing/fake-plugin.js.map +1 -0
  624. package/dist/testing/faulty-store.d.ts +36 -0
  625. package/dist/testing/faulty-store.js +66 -0
  626. package/dist/testing/faulty-store.js.map +1 -0
  627. package/dist/testing/generation.d.ts +60 -0
  628. package/dist/testing/generation.js +252 -0
  629. package/dist/testing/generation.js.map +1 -0
  630. package/dist/testing/index.d.ts +28 -0
  631. package/dist/testing/index.js +51 -0
  632. package/dist/testing/index.js.map +1 -0
  633. package/package.json +188 -45
  634. package/dist/libs/eth/account.d.ts +0 -9
  635. package/dist/libs/eth/account.js +0 -58
  636. package/dist/libs/eth/account.js.map +0 -1
  637. package/dist/libs/eth/contract.d.ts +0 -7
  638. package/dist/libs/eth/contract.js +0 -42
  639. package/dist/libs/eth/contract.js.map +0 -1
  640. package/dist/libs/eth/index.d.ts +0 -24
  641. package/dist/libs/eth/index.js +0 -72
  642. package/dist/libs/eth/index.js.map +0 -1
  643. package/dist/libs/eth/transact.d.ts +0 -7
  644. package/dist/libs/eth/transact.js +0 -26
  645. package/dist/libs/eth/transact.js.map +0 -1
  646. package/dist/libs/index.d.ts +0 -2
  647. package/dist/libs/index.js +0 -19
  648. package/dist/libs/index.js.map +0 -1
  649. package/dist/libs/trx/account.d.ts +0 -9
  650. package/dist/libs/trx/account.js +0 -55
  651. package/dist/libs/trx/account.js.map +0 -1
  652. package/dist/libs/trx/contract.d.ts +0 -7
  653. package/dist/libs/trx/contract.js +0 -27
  654. package/dist/libs/trx/contract.js.map +0 -1
  655. package/dist/libs/trx/index.d.ts +0 -22
  656. package/dist/libs/trx/index.js +0 -64
  657. package/dist/libs/trx/index.js.map +0 -1
  658. package/dist/libs/trx/transact.d.ts +0 -7
  659. package/dist/libs/trx/transact.js +0 -26
  660. package/dist/libs/trx/transact.js.map +0 -1
  661. package/dist/tool/common.d.ts +0 -28
  662. package/dist/tool/common.js +0 -33
  663. package/dist/tool/common.js.map +0 -1
  664. package/dist/tool/eth-tools.d.ts +0 -3
  665. package/dist/tool/eth-tools.js +0 -33
  666. package/dist/tool/eth-tools.js.map +0 -1
  667. package/dist/tool/index.d.ts +0 -5
  668. package/dist/tool/index.js +0 -22
  669. package/dist/tool/index.js.map +0 -1
  670. package/dist/tool/logging.d.ts +0 -3
  671. package/dist/tool/logging.js +0 -11
  672. package/dist/tool/logging.js.map +0 -1
  673. package/dist/tool/options.d.ts +0 -6
  674. package/dist/tool/options.js +0 -41
  675. package/dist/tool/options.js.map +0 -1
  676. package/dist/tool/trx-tools.d.ts +0 -3
  677. package/dist/tool/trx-tools.js +0 -20
  678. package/dist/tool/trx-tools.js.map +0 -1
  679. package/dist/type/account.d.ts +0 -9
  680. package/dist/type/account.js.map +0 -1
  681. package/dist/type/common.d.ts +0 -18
  682. package/dist/type/common.js.map +0 -1
  683. package/dist/type/contract.d.ts +0 -10
  684. package/dist/type/contract.js.map +0 -1
  685. package/dist/type/index.d.ts +0 -5
  686. package/dist/type/index.js +0 -22
  687. package/dist/type/index.js.map +0 -1
  688. package/dist/type/lib-types.d.ts +0 -9
  689. package/dist/type/lib-types.js.map +0 -1
  690. package/dist/type/transact.d.ts +0 -7
  691. package/dist/type/transact.js.map +0 -1
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Proofs, the block source and TronGrid history.
3
+ *
4
+ * Proofs: every read is a `proof` quorum
5
+ * read, and each fact is attested at its own height, so no endpoint proposes a height:
6
+ * - "my solidified block's timestamp is at or past the expiration" is a monotone predicate
7
+ * quorum key on the latest solidified block; honest endpoints disagree only in the moment
8
+ * it becomes true on one of them, which decides nothing;
9
+ * - a block at a fixed height is read from the solidity node, which serves it only once it
10
+ * is solidified there, keyed on its consensus facts;
11
+ * - `finalizedHead` is the one unanchored read: one endpoint's view, trailed by
12
+ * `PEER_SKEW` blocks, then attested at that height.
13
+ * A stale or lagging answer is a retryable `PROVIDER_INCONSISTENT` or `PROVIDER_UNAVAILABLE`
14
+ * and decides nothing.
15
+ *
16
+ * Which blocks can hold a transaction (java-tron GreatVoyage-v4.8.2.2 `d5c3d1d1`:
17
+ * `Manager.processBlock` runs `processTransaction`, so `validateTapos` and `validateCommon`,
18
+ * for each transaction, and only then records the block in the recent-block store and as
19
+ * the head):
20
+ * - expiry: a transaction is invalid in a block whose parent's timestamp is at or past
21
+ * its expiration, and block timestamps strictly increase, so no block after the first one
22
+ * at or past the expiration can hold it;
23
+ * - TaPoS: only a block above the reference block, and at most `TAPOS_WINDOW` above it, can
24
+ * hold it.
25
+ *
26
+ * "Not included": the solidity index (and TronGrid behind a load balancer) can lag, so an
27
+ * empty index answer is never taken as absence: an expired verdict for a transfer the
28
+ * index missed would let `rebuild` pay twice.
29
+ * `includedFinal` answers `included: false` only once expiry is attested and a scan of every
30
+ * block that could hold the transaction shows it absent, from the attested first block at or
31
+ * past the SIGNED expiration (`expiresAtMs`, which `assemble` binds to the signed bytes) down
32
+ * to just above the reference block. The floor is never a time derived from the expiration:
33
+ * the build-time head and the local clock are claims, so the expiration can sit any distance
34
+ * after the reference.
35
+ * - The ordering (`TronExpiryOrdering`) carries the reference height the build-time head
36
+ * claimed (`lastValidHeight − TAPOS_WINDOW`) and the signed `ref_block_hash`. Only the
37
+ * height's low 16 bits are signed (`ref_block_bytes`), so the height is trusted only when
38
+ * the attested solidified block there carries the signed hash: then the scan runs from the
39
+ * top down to it.
40
+ * - Otherwise (another block there, or a height at or above the top) the proof searches the
41
+ * heights TaPoS can match: every block up to the top checks the reference against the latest
42
+ * block at or below its parent with the signed low 16 bits, and its parent is at most 24 h
43
+ * before the expiration (`MAXIMUM_TIME_UNTIL_EXPIRATION`). So the attested blocks at those
44
+ * heights, from one TaPoS window below that 24 h mark up to the top, are the only possible
45
+ * references. None carries the signed hash: no block can hold the transaction. One does:
46
+ * the blocks in its TaPoS window (and not before the 24 h mark) are scanned.
47
+ * - Either way, a block whose parent is more than 24 h before the expiration cannot hold the
48
+ * transaction, so no scan goes below the first block at or past that mark.
49
+ * - A missing or malformed stored hash decides nothing.
50
+ * Each scanned block is read by hash under the quorum, its parent hash names the next, and the
51
+ * walk must end on the attested block below the window. A scanned block that holds the
52
+ * transaction while the index says nothing decides nothing.
53
+ *
54
+ * Read cost, each read a quorum read: the reference check is one; a scan is one per block in
55
+ * the window (about 20 for a 60 s expiration). A reference older than a day (a build head that
56
+ * named an old block), or the search below, adds a gallop and binary search for the block 24 h
57
+ * before the expiration (a few reads, logarithmic in missed slots). The search, only when the
58
+ * stored height is not the reference, adds one read per candidate height (two or three). A
59
+ * scan never covers more than the blocks from that 24 h mark to the first block at or past the
60
+ * expiration: at most a day of blocks (28,800 at one per 3-second slot, fewer when slots are
61
+ * missed), and never more than one TaPoS window (65,536).
62
+ */
63
+ import type { AddressHistorySource, BlockSource, DriverTransaction, ProofSource } from '../../core/driver/types';
64
+ import type { Transport } from '../../core/transport/types';
65
+ import type { TronContext } from './reader';
66
+ export declare function createTronProofs(ctx: TronContext): ProofSource;
67
+ export declare function createTronBlocks(ctx: TronContext): BlockSource;
68
+ /**
69
+ * TronGrid history, each entry re-read from the full node and decoded like any
70
+ * transaction; confirmed (solidified) entries only (`historyPage`). Phase `t` is
71
+ * `/transactions`: the account's own transactions, TRX sent to it and, for a contract
72
+ * account, other accounts' calls to it. Phase `x` is `/transactions/trc20`: every TRC-20
73
+ * transfer from or to it (a spender's `transferFrom` out of it included), less the account's
74
+ * own calls, which phase `t` listed. A TRC-20 transfer a wallet only received is in phase `x`
75
+ * alone (TronGrid, read-only on Nile, 2026-09-28), but a call to a contract account that moves
76
+ * its own tokens comes in both phases, so callers dedupe on `transfer.id`.
77
+ * Paging follows the raw page's fingerprint, never how many items survive the filter, and
78
+ * an entry the node cannot serve yet decides nothing: dropping it would skip it for good.
79
+ */
80
+ export declare function createTronHistory(ctx: TronContext, indexer: Transport, getTransaction: (id: string) => Promise<DriverTransaction | null>): AddressHistorySource;
@@ -0,0 +1,370 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTronProofs = createTronProofs;
4
+ exports.createTronBlocks = createTronBlocks;
5
+ exports.createTronHistory = createTronHistory;
6
+ const error_1 = require("../../core/errors/error");
7
+ const address_1 = require("./address");
8
+ const decode_1 = require("./decode");
9
+ const http_1 = require("./http");
10
+ const network_1 = require("./network");
11
+ function undecided() {
12
+ return new error_1.ProviderError('PROVIDER_UNAVAILABLE', 'finalized state cannot decide this yet');
13
+ }
14
+ /** Attested answers that the chain's own rules make impossible together: decides nothing. */
15
+ function contradiction(what) {
16
+ return new error_1.ProviderError('PROVIDER_INCONSISTENT', `${what}, which decides nothing`, {
17
+ retryable: true,
18
+ });
19
+ }
20
+ const SLOT_MS = 3_000;
21
+ /**
22
+ * How far `finalizedHead` trails one endpoint's solidified head: up to 6 s behind, and no
23
+ * verdict reads it.
24
+ */
25
+ const PEER_SKEW = 2n;
26
+ /** java-tron's block heights are `long`s. */
27
+ const INT64_MAX = 2n ** 63n - 1n;
28
+ const TX_ID = /^[0-9a-f]{64}$/;
29
+ /** A signed `ref_block_hash`: 8 bytes, lower-case hex, as the builder stores it. */
30
+ const REF_HASH = /^[0-9a-f]{16}$/;
31
+ /**
32
+ * java-tron's `MAXIMUM_TIME_UNTIL_EXPIRATION` (`Constant.java`): `validateCommon` refuses an
33
+ * expiration more than 24 h after the parent block's time.
34
+ */
35
+ const MAX_LIFETIME_MS = 86_400_000;
36
+ /** The timestamp of a solidified-block answer, or -1 when it is not one (never agrees). */
37
+ function solidTimestamp(answer) {
38
+ const raw = answer
39
+ ?.block_header?.raw_data;
40
+ return typeof raw?.timestamp === 'number' ? raw.timestamp : -1;
41
+ }
42
+ /**
43
+ * Where an Attempt can be, from its `TronExpiryOrdering`; null when a field is missing or
44
+ * out of range, which decides nothing.
45
+ */
46
+ function attemptBounds(ordering) {
47
+ if (ordering.kind !== 'expiry')
48
+ return null;
49
+ const { expiresAtMs, lastValidHeight, refBlockHash } = ordering;
50
+ if (!Number.isSafeInteger(expiresAtMs) ||
51
+ typeof lastValidHeight !== 'bigint' ||
52
+ lastValidHeight < network_1.TAPOS_WINDOW ||
53
+ lastValidHeight > INT64_MAX ||
54
+ typeof refBlockHash !== 'string' ||
55
+ !REF_HASH.test(refBlockHash)) {
56
+ return null;
57
+ }
58
+ return {
59
+ expiration: expiresAtMs,
60
+ reference: lastValidHeight - network_1.TAPOS_WINDOW,
61
+ refBlockHash,
62
+ };
63
+ }
64
+ /** Bytes 8..16 of a block id: what a transaction's `ref_block_hash` names. */
65
+ const hashBytes = (block) => block.id.slice(16, 32);
66
+ /** Scanned blocks kept per driver: immutable chain data, so a retry is cheap. */
67
+ const SCAN_CACHE_SIZE = 1_024;
68
+ function createTronProofs(ctx) {
69
+ const { api } = ctx;
70
+ // Only quorum-agreed blocks below an attested solidified block, keyed by hash: final.
71
+ const scanned = new Map();
72
+ /** The block `hash`, expected at `height`; cached only once its height checks out. */
73
+ async function finalBlockByHash(hash, height) {
74
+ const cached = scanned.get(hash);
75
+ if (cached)
76
+ return cached;
77
+ const block = await api.rpcBlock(hash, http_1.PROOF);
78
+ if (block && block.number === height) {
79
+ if (scanned.size >= SCAN_CACHE_SIZE) {
80
+ scanned.delete(scanned.keys().next().value);
81
+ }
82
+ scanned.set(hash, block);
83
+ }
84
+ return block;
85
+ }
86
+ /** A block at a fixed height, attested as solidified on every quorum endpoint. */
87
+ async function solidHeader(height) {
88
+ const header = await api.block('solid', height, http_1.PROOF);
89
+ if (!header)
90
+ throw undecided();
91
+ return header;
92
+ }
93
+ /**
94
+ * The latest solidified block when every quorum endpoint's solidified block is at or past
95
+ * `expiration` (a monotone predicate), else null.
96
+ */
97
+ async function passedExpiry(expiration) {
98
+ const head = (await api.block('solid', undefined, {
99
+ ...http_1.PROOF,
100
+ quorumKey: (answer) => solidTimestamp(answer) >= expiration,
101
+ }));
102
+ return head.timestamp >= expiration ? head : null;
103
+ }
104
+ /**
105
+ * The first solidified block at or past `time`, at or below `hi` (an attested block at or
106
+ * past it). Block timestamps strictly increase, so "at or past `time`" is monotone in the
107
+ * height: a gallop down from the slot estimate, then a binary search. Every probe is
108
+ * an attested fixed-height read at or below `hi`, which every quorum endpoint has
109
+ * solidified, so none can stall; the slot spacing only picks the first probe.
110
+ */
111
+ async function firstAtOrAfter(time, hi) {
112
+ let high = hi;
113
+ let low;
114
+ let step = BigInt(Math.max(1, Math.floor((hi.timestamp - time) / SLOT_MS)));
115
+ while (low === undefined) {
116
+ if (high.number === 0n)
117
+ return high;
118
+ const probe = await solidHeader(high.number > step ? high.number - step : 0n);
119
+ if (probe.timestamp < time) {
120
+ low = probe;
121
+ }
122
+ else {
123
+ high = probe;
124
+ step *= 2n;
125
+ }
126
+ }
127
+ while (high.number - low.number > 1n) {
128
+ const mid = await solidHeader((low.number + high.number) / 2n);
129
+ if (mid.timestamp < time)
130
+ low = mid;
131
+ else
132
+ high = mid;
133
+ }
134
+ return high;
135
+ }
136
+ /**
137
+ * The first solidified block at or past `expiration`, or null while the quorum has not
138
+ * solidified past it. Only the predicate is attested: the latest block's height and time
139
+ * are one endpoint's word, so a block trailed by the peer skew is attested at its own height
140
+ * (a freshest endpoint then stalls nothing), and the search runs at or below it
141
+ * or, within the skew, up to the first block at the expiration, which every endpoint has
142
+ * solidified (bounded, whatever the endpoint claimed).
143
+ */
144
+ async function expiryBlock(expiration) {
145
+ const seen = await passedExpiry(expiration);
146
+ if (!seen)
147
+ return null;
148
+ let top = await solidHeader(seen.number > PEER_SKEW ? seen.number - PEER_SKEW : 0n);
149
+ if (top.timestamp >= expiration)
150
+ return firstAtOrAfter(expiration, top);
151
+ while (top.timestamp < expiration) {
152
+ if (top.number >= seen.number)
153
+ throw undecided();
154
+ top = await solidHeader(top.number + 1n);
155
+ }
156
+ return top;
157
+ }
158
+ /**
159
+ * No block above the attested `floor`, at or below `last` and `top`, holds `id`: walked by
160
+ * parent hash from the upper end, which must arrive at `floor`. Throws when anything cannot
161
+ * be decided. Every height read is below `top`, which every quorum endpoint has solidified.
162
+ */
163
+ async function absentAbove(id, floor, top, last) {
164
+ const end = last < top.number ? last : top.number;
165
+ if (end <= floor.number)
166
+ return;
167
+ const start = end === top.number ? top : await solidHeader(end);
168
+ let hash = start.id;
169
+ for (let height = start.number; height > floor.number; height -= 1n) {
170
+ const block = await finalBlockByHash(hash, height);
171
+ // Missing, or not the block the parent chain leads to: an endpoint is behind or lying.
172
+ if (!block || block.number !== height)
173
+ throw undecided();
174
+ // In a solidified block, yet the index said nothing: it lags. Decide later.
175
+ if (block.transactions.includes(id))
176
+ throw undecided();
177
+ hash = block.parentHash;
178
+ }
179
+ // The walk is bound at both ends: it must arrive at the attested block below the window.
180
+ if (hash !== floor.id) {
181
+ throw contradiction('the scanned blocks do not lead to the reference block');
182
+ }
183
+ }
184
+ /**
185
+ * Absence proven by scan; throws when anything cannot be decided. `top`
186
+ * is the attested first block at or past the expiration: no block above it can hold `id`.
187
+ */
188
+ async function absent(id, bounds, top) {
189
+ const { reference, refBlockHash } = bounds;
190
+ /** The 24 h mark: only a block whose parent is at or after it can hold `id`. */
191
+ const dayMark = bounds.expiration - MAX_LIFETIME_MS;
192
+ // The stored height is the build-time head's claim: it bounds the scan only when the
193
+ // attested block there carries the signed hash bytes.
194
+ if (reference < top.number) {
195
+ const named = await solidHeader(reference);
196
+ if (hashBytes(named) === refBlockHash) {
197
+ // A reference older than a day (a build head that named an old block) is
198
+ // scanned only from the 24 h mark, as the search below does, never its whole window.
199
+ const floor = named.timestamp < dayMark ? await firstAtOrAfter(dayMark, top) : named;
200
+ await absentAbove(id, floor, top, reference + network_1.TAPOS_WINDOW);
201
+ return;
202
+ }
203
+ }
204
+ // Otherwise, the heights TaPoS can match: the signed low 16 bits, below the top, from one
205
+ // TaPoS window below the first block within 24 h of the expiration (a block's parent is at
206
+ // or after it). Every block up to the top checks the reference against one of them.
207
+ const earliest = await firstAtOrAfter(dayMark, top);
208
+ const low16 = reference % network_1.TAPOS_WINDOW;
209
+ const from = earliest.number + 1n > network_1.TAPOS_WINDOW ? earliest.number + 1n - network_1.TAPOS_WINDOW : 0n;
210
+ let height = from + ((low16 - (from % network_1.TAPOS_WINDOW) + network_1.TAPOS_WINDOW) % network_1.TAPOS_WINDOW);
211
+ for (; height < top.number; height += network_1.TAPOS_WINDOW) {
212
+ const candidate = await solidHeader(height);
213
+ if (hashBytes(candidate) !== refBlockHash)
214
+ continue;
215
+ // Its TaPoS window, less the blocks whose parent is more than 24 h before the expiration.
216
+ const floor = candidate.number >= earliest.number ? candidate : earliest;
217
+ await absentAbove(id, floor, top, candidate.number + network_1.TAPOS_WINDOW);
218
+ }
219
+ }
220
+ return {
221
+ async finalizedHead() {
222
+ // The unanchored exception: one endpoint's view, trailed by the peer skew, attested.
223
+ const seen = (await api.block('solid', undefined, http_1.MONITOR));
224
+ const head = await solidHeader(seen.number > PEER_SKEW ? seen.number - PEER_SKEW : 0n);
225
+ return { height: head.number, hash: head.id, timestamp: head.timestamp };
226
+ },
227
+ async includedFinal(ref, ordering) {
228
+ // Bounded before any work; our own Attempt's ref is always a txID.
229
+ if (typeof ref.id !== 'string' || ref.id.length !== 64)
230
+ throw undecided();
231
+ const id = ref.id.toLowerCase();
232
+ if (!TX_ID.test(id))
233
+ throw undecided();
234
+ const info = await api.transactionInfo('solid', id, http_1.PROOF);
235
+ if (info) {
236
+ const [header, tx] = await Promise.all([
237
+ api.block('solid', info.blockNumber, http_1.PROOF),
238
+ api.transaction('solid', id, http_1.PROOF),
239
+ ]);
240
+ if (!header || !tx)
241
+ throw undecided();
242
+ // java-tron writes the block's time into each receipt (`blockTimeStamp`): a receipt
243
+ // dated otherwise is not from the solidified block at its height.
244
+ if (info.blockTimestamp !== header.timestamp) {
245
+ throw contradiction('a receipt does not match its solidified block');
246
+ }
247
+ // `verdictOf` pairs the receipt with the transaction by id, reads the verdict
248
+ // fields strictly and wants evidence that value moved; a contradiction decides
249
+ // nothing.
250
+ const verdict = (0, decode_1.verdictOf)(ctx.codec, tx, info);
251
+ return {
252
+ included: true,
253
+ success: verdict.success,
254
+ blockHeight: info.blockNumber,
255
+ blockHash: header.id,
256
+ txHash: id,
257
+ ...(verdict.reason !== undefined ? { reason: verdict.reason } : {}),
258
+ };
259
+ }
260
+ const bounds = attemptBounds(ordering);
261
+ if (!bounds)
262
+ throw undecided();
263
+ const top = await expiryBlock(bounds.expiration);
264
+ if (!top)
265
+ throw undecided();
266
+ await absent(id, bounds, top);
267
+ return { included: false };
268
+ },
269
+ async slotConsumed() {
270
+ // Tron has no nonce or sequence: expiry is the only way an Attempt dies.
271
+ return false;
272
+ },
273
+ async expired(ordering) {
274
+ if (ordering.kind !== 'expiry' || !Number.isSafeInteger(ordering.expiresAtMs)) {
275
+ return false;
276
+ }
277
+ return (await expiryBlock(ordering.expiresAtMs)) !== null;
278
+ },
279
+ async blockHash(height, level) {
280
+ if (height < 0n || height > INT64_MAX)
281
+ return null;
282
+ const header = await api.block(level === 'finalized' ? 'solid' : 'full', height, http_1.PROOF);
283
+ return header?.id ?? null;
284
+ },
285
+ };
286
+ }
287
+ function createTronBlocks(ctx) {
288
+ return {
289
+ async header(height) {
290
+ const header = await ctx.api.block('full', height, http_1.MONITOR);
291
+ return header
292
+ ? {
293
+ height: header.number,
294
+ hash: header.id,
295
+ parentHash: header.parentId,
296
+ timestamp: header.timestamp,
297
+ }
298
+ : null;
299
+ },
300
+ async transactions(block, filter) {
301
+ // Genesis holds only the chain's initial allocations, which are not reported,
302
+ // and java-tron answers `{}` for its receipts, which a scanner would retry for ever.
303
+ if (block.height === 0n)
304
+ return [];
305
+ const read = await ctx.api.blockWithTransactions(block.height, http_1.MONITOR);
306
+ if (!read || read.header.id !== block.hash) {
307
+ throw new error_1.ProviderError('PROVIDER_INCONSISTENT', `block ${block.height} changed while scanning`, { retryable: true });
308
+ }
309
+ // Receipts pair with transactions by id, never by position.
310
+ const infos = new Map(read.infos.map((info) => [info.id, info]));
311
+ const txs = read.transactions.map((tx) => {
312
+ const info = infos.get(tx.id);
313
+ if (!info) {
314
+ throw new error_1.ProviderError('PROVIDER_UNAVAILABLE', 'a scanned block lacks a receipt');
315
+ }
316
+ return (0, decode_1.decodeTransaction)(ctx.codec, tx, info, block.hash);
317
+ });
318
+ if (!filter?.addresses?.length)
319
+ return txs;
320
+ const wanted = new Set(filter.addresses.map((a) => (0, address_1.toBase58Address)(a)));
321
+ return txs.filter((tx) => wanted.has(String(tx.details.owner)) ||
322
+ tx.transfers.some((t) => wanted.has(t.to) || t.from.some((f) => wanted.has(f))));
323
+ },
324
+ };
325
+ }
326
+ const CURSOR = /^([tx]):(.*)$/;
327
+ /** The largest page TronGrid serves. */
328
+ const MAX_PAGE = 200;
329
+ /**
330
+ * TronGrid history, each entry re-read from the full node and decoded like any
331
+ * transaction; confirmed (solidified) entries only (`historyPage`). Phase `t` is
332
+ * `/transactions`: the account's own transactions, TRX sent to it and, for a contract
333
+ * account, other accounts' calls to it. Phase `x` is `/transactions/trc20`: every TRC-20
334
+ * transfer from or to it (a spender's `transferFrom` out of it included), less the account's
335
+ * own calls, which phase `t` listed. A TRC-20 transfer a wallet only received is in phase `x`
336
+ * alone (TronGrid, read-only on Nile, 2026-09-28), but a call to a contract account that moves
337
+ * its own tokens comes in both phases, so callers dedupe on `transfer.id`.
338
+ * Paging follows the raw page's fingerprint, never how many items survive the filter, and
339
+ * an entry the node cannot serve yet decides nothing: dropping it would skip it for good.
340
+ */
341
+ function createTronHistory(ctx, indexer, getTransaction) {
342
+ return {
343
+ async list(address, options) {
344
+ const match = CURSOR.exec(options.cursor ?? 't:');
345
+ if (!match)
346
+ throw new error_1.ConfigError('CONFIG_INVALID', 'not a Tron history cursor');
347
+ const phase = match[1];
348
+ const fingerprint = match[2];
349
+ const owner = (0, address_1.toBase58Address)(address);
350
+ const page = await (0, http_1.historyPage)(indexer, owner, phase === 't' ? 'transactions' : 'trc20', {
351
+ limit: Math.min(Math.max(Math.trunc(options.limit) || 1, 1), MAX_PAGE),
352
+ ...(fingerprint ? { fingerprint } : {}),
353
+ }, http_1.READ);
354
+ const items = [];
355
+ for (const id of page.ids) {
356
+ const tx = await getTransaction(id);
357
+ // The index lists it as confirmed: a node that serves nothing, or only its pool
358
+ // copy, is behind; listing that copy would move the cursor past it for good.
359
+ if (!tx || tx.observation.seen !== 'block')
360
+ throw (0, http_1.notServable)();
361
+ // Phase x skips the account's own calls: phase t listed them.
362
+ if (!(phase === 'x' && tx.details.owner === owner))
363
+ items.push(tx);
364
+ }
365
+ const next = page.next ? `${phase}:${page.next}` : phase === 't' ? 'x:' : undefined;
366
+ return { items, ...(next !== undefined ? { next } : {}) };
367
+ },
368
+ };
369
+ }
370
+ //# sourceMappingURL=proofs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proofs.js","sourceRoot":"","sources":["../../../src/adapters/tron/proofs.ts"],"names":[],"mappings":";;AAoKA,4CAsOC;AAED,4CA8CC;AAkBD,8CAmCC;AA3aD,mDAAqE;AAGrE,uCAA4C;AAC5C,qCAAwD;AACxD,iCAQgB;AAChB,uCAAyC;AAIzC,SAAS,SAAS;IAChB,OAAO,IAAI,qBAAa,CACtB,sBAAsB,EACtB,wCAAwC,CACzC,CAAC;AACJ,CAAC;AAED,6FAA6F;AAC7F,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,qBAAa,CAAC,uBAAuB,EAAE,GAAG,IAAI,yBAAyB,EAAE;QAClF,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB;;;GAGG;AACH,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,6CAA6C;AAC7C,MAAM,SAAS,GAAG,EAAE,IAAI,GAAG,GAAG,EAAE,CAAC;AACjC,MAAM,KAAK,GAAG,gBAAgB,CAAC;AAC/B,oFAAoF;AACpF,MAAM,QAAQ,GAAG,gBAAgB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YACrE,CAAC;YACD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YACpF,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5D,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Proofs, the block source and TronGrid history.\n *\n * Proofs: every read is a `proof` quorum\n * read, and each fact is attested at its own height, so no endpoint proposes a height:\n * - \"my solidified block's timestamp is at or past the expiration\" is a monotone predicate\n * quorum key on the latest solidified block; honest endpoints disagree only in the moment\n * it becomes true on one of them, which decides nothing;\n * - a block at a fixed height is read from the solidity node, which serves it only once it\n * is solidified there, keyed on its consensus facts;\n * - `finalizedHead` is the one unanchored read: one endpoint's view, trailed by\n * `PEER_SKEW` blocks, then attested at that height.\n * A stale or lagging answer is a retryable `PROVIDER_INCONSISTENT` or `PROVIDER_UNAVAILABLE`\n * and decides nothing.\n *\n * Which blocks can hold a transaction (java-tron GreatVoyage-v4.8.2.2 `d5c3d1d1`:\n * `Manager.processBlock` runs `processTransaction`, so `validateTapos` and `validateCommon`,\n * for each transaction, and only then records the block in the recent-block store and as\n * the head):\n * - expiry: a transaction is invalid in a block whose parent's timestamp is at or past\n * its expiration, and block timestamps strictly increase, so no block after the first one\n * at or past the expiration can hold it;\n * - TaPoS: only a block above the reference block, and at most `TAPOS_WINDOW` above it, can\n * hold it.\n *\n * \"Not included\": the solidity index (and TronGrid behind a load balancer) can lag, so an\n * empty index answer is never taken as absence: an expired verdict for a transfer the\n * index missed would let `rebuild` pay twice.\n * `includedFinal` answers `included: false` only once expiry is attested and a scan of every\n * block that could hold the transaction shows it absent, from the attested first block at or\n * past the SIGNED expiration (`expiresAtMs`, which `assemble` binds to the signed bytes) down\n * to just above the reference block. The floor is never a time derived from the expiration:\n * the build-time head and the local clock are claims, so the expiration can sit any distance\n * after the reference.\n * - The ordering (`TronExpiryOrdering`) carries the reference height the build-time head\n * claimed (`lastValidHeight − TAPOS_WINDOW`) and the signed `ref_block_hash`. Only the\n * height's low 16 bits are signed (`ref_block_bytes`), so the height is trusted only when\n * the attested solidified block there carries the signed hash: then the scan runs from the\n * top down to it.\n * - Otherwise (another block there, or a height at or above the top) the proof searches the\n * heights TaPoS can match: every block up to the top checks the reference against the latest\n * block at or below its parent with the signed low 16 bits, and its parent is at most 24 h\n * before the expiration (`MAXIMUM_TIME_UNTIL_EXPIRATION`). So the attested blocks at those\n * heights, from one TaPoS window below that 24 h mark up to the top, are the only possible\n * references. None carries the signed hash: no block can hold the transaction. One does:\n * the blocks in its TaPoS window (and not before the 24 h mark) are scanned.\n * - Either way, a block whose parent is more than 24 h before the expiration cannot hold the\n * transaction, so no scan goes below the first block at or past that mark.\n * - A missing or malformed stored hash decides nothing.\n * Each scanned block is read by hash under the quorum, its parent hash names the next, and the\n * walk must end on the attested block below the window. A scanned block that holds the\n * transaction while the index says nothing decides nothing.\n *\n * Read cost, each read a quorum read: the reference check is one; a scan is one per block in\n * the window (about 20 for a 60 s expiration). A reference older than a day (a build head that\n * named an old block), or the search below, adds a gallop and binary search for the block 24 h\n * before the expiration (a few reads, logarithmic in missed slots). The search, only when the\n * stored height is not the reference, adds one read per candidate height (two or three). A\n * scan never covers more than the blocks from that 24 h mark to the first block at or past the\n * expiration: at most a day of blocks (28,800 at one per 3-second slot, fewer when slots are\n * missed), and never more than one TaPoS window (65,536).\n */\nimport type {\n AddressHistorySource,\n BlockSource,\n DriverTransaction,\n ProofSource,\n} from '../../core/driver/types';\nimport { ConfigError, ProviderError } from '../../core/errors/error';\nimport type { OrderingData } from '../../core/model/ordering';\nimport type { Transport } from '../../core/transport/types';\nimport { toBase58Address } from './address';\nimport { decodeTransaction, verdictOf } from './decode';\nimport {\n MONITOR,\n PROOF,\n READ,\n historyPage,\n notServable,\n type RpcBlock,\n type TronBlockHeader,\n} from './http';\nimport { TAPOS_WINDOW } from './network';\nimport type { TronContext } from './reader';\nimport type { TronExpiryOrdering } from './types';\n\nfunction undecided(): ProviderError {\n return new ProviderError(\n 'PROVIDER_UNAVAILABLE',\n 'finalized state cannot decide this yet',\n );\n}\n\n/** Attested answers that the chain's own rules make impossible together: decides nothing. */\nfunction contradiction(what: string): ProviderError {\n return new ProviderError('PROVIDER_INCONSISTENT', `${what}, which decides nothing`, {\n retryable: true,\n });\n}\n\nconst SLOT_MS = 3_000;\n/**\n * How far `finalizedHead` trails one endpoint's solidified head: up to 6 s behind, and no\n * verdict reads it.\n */\nconst PEER_SKEW = 2n;\n/** java-tron's block heights are `long`s. */\nconst INT64_MAX = 2n ** 63n - 1n;\nconst TX_ID = /^[0-9a-f]{64}$/;\n/** A signed `ref_block_hash`: 8 bytes, lower-case hex, as the builder stores it. */\nconst REF_HASH = /^[0-9a-f]{16}$/;\n/**\n * java-tron's `MAXIMUM_TIME_UNTIL_EXPIRATION` (`Constant.java`): `validateCommon` refuses an\n * expiration more than 24 h after the parent block's time.\n */\nconst MAX_LIFETIME_MS = 86_400_000;\n\n/** The timestamp of a solidified-block answer, or -1 when it is not one (never agrees). */\nfunction solidTimestamp(answer: unknown): number {\n const raw = (answer as { block_header?: { raw_data?: { timestamp?: unknown } } } | null)\n ?.block_header?.raw_data;\n return typeof raw?.timestamp === 'number' ? raw.timestamp : -1;\n}\n\ninterface Bounds {\n /** The signed expiration. */\n readonly expiration: number;\n /** The reference height the build-time head claimed: only its low 16 bits are signed. */\n readonly reference: bigint;\n /** The signed `ref_block_hash`. */\n readonly refBlockHash: string;\n}\n\n/**\n * Where an Attempt can be, from its `TronExpiryOrdering`; null when a field is missing or\n * out of range, which decides nothing.\n */\nfunction attemptBounds(ordering: OrderingData): Bounds | null {\n if (ordering.kind !== 'expiry') return null;\n const { expiresAtMs, lastValidHeight, refBlockHash } =\n ordering as Partial<TronExpiryOrdering>;\n if (\n !Number.isSafeInteger(expiresAtMs) ||\n typeof lastValidHeight !== 'bigint' ||\n lastValidHeight < TAPOS_WINDOW ||\n lastValidHeight > INT64_MAX ||\n typeof refBlockHash !== 'string' ||\n !REF_HASH.test(refBlockHash)\n ) {\n return null;\n }\n return {\n expiration: expiresAtMs as number,\n reference: lastValidHeight - TAPOS_WINDOW,\n refBlockHash,\n };\n}\n\n/** Bytes 8..16 of a block id: what a transaction's `ref_block_hash` names. */\nconst hashBytes = (block: TronBlockHeader): string => block.id.slice(16, 32);\n\n/** Scanned blocks kept per driver: immutable chain data, so a retry is cheap. */\nconst SCAN_CACHE_SIZE = 1_024;\n\nexport function createTronProofs(ctx: TronContext): ProofSource {\n const { api } = ctx;\n // Only quorum-agreed blocks below an attested solidified block, keyed by hash: final.\n const scanned = new Map<string, RpcBlock>();\n\n /** The block `hash`, expected at `height`; cached only once its height checks out. */\n async function finalBlockByHash(\n hash: string,\n height: bigint,\n ): Promise<RpcBlock | null> {\n const cached = scanned.get(hash);\n if (cached) return cached;\n const block = await api.rpcBlock(hash, PROOF);\n if (block && block.number === height) {\n if (scanned.size >= SCAN_CACHE_SIZE) {\n scanned.delete(scanned.keys().next().value as string);\n }\n scanned.set(hash, block);\n }\n return block;\n }\n\n /** A block at a fixed height, attested as solidified on every quorum endpoint. */\n async function solidHeader(height: bigint): Promise<TronBlockHeader> {\n const header = await api.block('solid', height, PROOF);\n if (!header) throw undecided();\n return header;\n }\n\n /**\n * The latest solidified block when every quorum endpoint's solidified block is at or past\n * `expiration` (a monotone predicate), else null.\n */\n async function passedExpiry(expiration: number): Promise<TronBlockHeader | null> {\n const head = (await api.block('solid', undefined, {\n ...PROOF,\n quorumKey: (answer) => solidTimestamp(answer) >= expiration,\n })) as TronBlockHeader;\n return head.timestamp >= expiration ? head : null;\n }\n\n /**\n * The first solidified block at or past `time`, at or below `hi` (an attested block at or\n * past it). Block timestamps strictly increase, so \"at or past `time`\" is monotone in the\n * height: a gallop down from the slot estimate, then a binary search. Every probe is\n * an attested fixed-height read at or below `hi`, which every quorum endpoint has\n * solidified, so none can stall; the slot spacing only picks the first probe.\n */\n async function firstAtOrAfter(\n time: number,\n hi: TronBlockHeader,\n ): Promise<TronBlockHeader> {\n let high = hi;\n let low: TronBlockHeader | undefined;\n let step = BigInt(Math.max(1, Math.floor((hi.timestamp - time) / SLOT_MS)));\n while (low === undefined) {\n if (high.number === 0n) return high;\n const probe = await solidHeader(high.number > step ? high.number - step : 0n);\n if (probe.timestamp < time) {\n low = probe;\n } else {\n high = probe;\n step *= 2n;\n }\n }\n while (high.number - low.number > 1n) {\n const mid = await solidHeader((low.number + high.number) / 2n);\n if (mid.timestamp < time) low = mid;\n else high = mid;\n }\n return high;\n }\n\n /**\n * The first solidified block at or past `expiration`, or null while the quorum has not\n * solidified past it. Only the predicate is attested: the latest block's height and time\n * are one endpoint's word, so a block trailed by the peer skew is attested at its own height\n * (a freshest endpoint then stalls nothing), and the search runs at or below it\n * or, within the skew, up to the first block at the expiration, which every endpoint has\n * solidified (bounded, whatever the endpoint claimed).\n */\n async function expiryBlock(expiration: number): Promise<TronBlockHeader | null> {\n const seen = await passedExpiry(expiration);\n if (!seen) return null;\n let top = await solidHeader(seen.number > PEER_SKEW ? seen.number - PEER_SKEW : 0n);\n if (top.timestamp >= expiration) return firstAtOrAfter(expiration, top);\n while (top.timestamp < expiration) {\n if (top.number >= seen.number) throw undecided();\n top = await solidHeader(top.number + 1n);\n }\n return top;\n }\n\n /**\n * No block above the attested `floor`, at or below `last` and `top`, holds `id`: walked by\n * parent hash from the upper end, which must arrive at `floor`. Throws when anything cannot\n * be decided. Every height read is below `top`, which every quorum endpoint has solidified.\n */\n async function absentAbove(\n id: string,\n floor: TronBlockHeader,\n top: TronBlockHeader,\n last: bigint,\n ): Promise<void> {\n const end = last < top.number ? last : top.number;\n if (end <= floor.number) return;\n const start = end === top.number ? top : await solidHeader(end);\n let hash = start.id;\n for (let height = start.number; height > floor.number; height -= 1n) {\n const block = await finalBlockByHash(hash, height);\n // Missing, or not the block the parent chain leads to: an endpoint is behind or lying.\n if (!block || block.number !== height) throw undecided();\n // In a solidified block, yet the index said nothing: it lags. Decide later.\n if (block.transactions.includes(id)) throw undecided();\n hash = block.parentHash;\n }\n // The walk is bound at both ends: it must arrive at the attested block below the window.\n if (hash !== floor.id) {\n throw contradiction('the scanned blocks do not lead to the reference block');\n }\n }\n\n /**\n * Absence proven by scan; throws when anything cannot be decided. `top`\n * is the attested first block at or past the expiration: no block above it can hold `id`.\n */\n async function absent(id: string, bounds: Bounds, top: TronBlockHeader): Promise<void> {\n const { reference, refBlockHash } = bounds;\n /** The 24 h mark: only a block whose parent is at or after it can hold `id`. */\n const dayMark = bounds.expiration - MAX_LIFETIME_MS;\n // The stored height is the build-time head's claim: it bounds the scan only when the\n // attested block there carries the signed hash bytes.\n if (reference < top.number) {\n const named = await solidHeader(reference);\n if (hashBytes(named) === refBlockHash) {\n // A reference older than a day (a build head that named an old block) is\n // scanned only from the 24 h mark, as the search below does, never its whole window.\n const floor =\n named.timestamp < dayMark ? await firstAtOrAfter(dayMark, top) : named;\n await absentAbove(id, floor, top, reference + TAPOS_WINDOW);\n return;\n }\n }\n // Otherwise, the heights TaPoS can match: the signed low 16 bits, below the top, from one\n // TaPoS window below the first block within 24 h of the expiration (a block's parent is at\n // or after it). Every block up to the top checks the reference against one of them.\n const earliest = await firstAtOrAfter(dayMark, top);\n const low16 = reference % TAPOS_WINDOW;\n const from =\n earliest.number + 1n > TAPOS_WINDOW ? earliest.number + 1n - TAPOS_WINDOW : 0n;\n let height = from + ((low16 - (from % TAPOS_WINDOW) + TAPOS_WINDOW) % TAPOS_WINDOW);\n for (; height < top.number; height += TAPOS_WINDOW) {\n const candidate = await solidHeader(height);\n if (hashBytes(candidate) !== refBlockHash) continue;\n // Its TaPoS window, less the blocks whose parent is more than 24 h before the expiration.\n const floor = candidate.number >= earliest.number ? candidate : earliest;\n await absentAbove(id, floor, top, candidate.number + TAPOS_WINDOW);\n }\n }\n\n return {\n async finalizedHead() {\n // The unanchored exception: one endpoint's view, trailed by the peer skew, attested.\n const seen = (await api.block('solid', undefined, MONITOR)) as TronBlockHeader;\n const head = await solidHeader(\n seen.number > PEER_SKEW ? seen.number - PEER_SKEW : 0n,\n );\n return { height: head.number, hash: head.id, timestamp: head.timestamp };\n },\n\n async includedFinal(ref, ordering) {\n // Bounded before any work; our own Attempt's ref is always a txID.\n if (typeof ref.id !== 'string' || ref.id.length !== 64) throw undecided();\n const id = ref.id.toLowerCase();\n if (!TX_ID.test(id)) throw undecided();\n const info = await api.transactionInfo('solid', id, PROOF);\n if (info) {\n const [header, tx] = await Promise.all([\n api.block('solid', info.blockNumber, PROOF),\n api.transaction('solid', id, PROOF),\n ]);\n if (!header || !tx) throw undecided();\n // java-tron writes the block's time into each receipt (`blockTimeStamp`): a receipt\n // dated otherwise is not from the solidified block at its height.\n if (info.blockTimestamp !== header.timestamp) {\n throw contradiction('a receipt does not match its solidified block');\n }\n // `verdictOf` pairs the receipt with the transaction by id, reads the verdict\n // fields strictly and wants evidence that value moved; a contradiction decides\n // nothing.\n const verdict = verdictOf(ctx.codec, tx, info);\n return {\n included: true,\n success: verdict.success,\n blockHeight: info.blockNumber,\n blockHash: header.id,\n txHash: id,\n ...(verdict.reason !== undefined ? { reason: verdict.reason } : {}),\n };\n }\n const bounds = attemptBounds(ordering);\n if (!bounds) throw undecided();\n const top = await expiryBlock(bounds.expiration);\n if (!top) throw undecided();\n await absent(id, bounds, top);\n return { included: false };\n },\n\n async slotConsumed() {\n // Tron has no nonce or sequence: expiry is the only way an Attempt dies.\n return false;\n },\n\n async expired(ordering: OrderingData) {\n if (ordering.kind !== 'expiry' || !Number.isSafeInteger(ordering.expiresAtMs)) {\n return false;\n }\n return (await expiryBlock(ordering.expiresAtMs as number)) !== null;\n },\n\n async blockHash(height, level) {\n if (height < 0n || height > INT64_MAX) return null;\n const header = await api.block(\n level === 'finalized' ? 'solid' : 'full',\n height,\n PROOF,\n );\n return header?.id ?? null;\n },\n };\n}\n\nexport function createTronBlocks(ctx: TronContext): BlockSource {\n return {\n async header(height) {\n const header = await ctx.api.block('full', height, MONITOR);\n return header\n ? {\n height: header.number,\n hash: header.id,\n parentHash: header.parentId,\n timestamp: header.timestamp,\n }\n : null;\n },\n async transactions(block, filter) {\n // Genesis holds only the chain's initial allocations, which are not reported,\n // and java-tron answers `{}` for its receipts, which a scanner would retry for ever.\n if (block.height === 0n) return [];\n const read = await ctx.api.blockWithTransactions(block.height, MONITOR);\n if (!read || read.header.id !== block.hash) {\n throw new ProviderError(\n 'PROVIDER_INCONSISTENT',\n `block ${block.height} changed while scanning`,\n { retryable: true },\n );\n }\n // Receipts pair with transactions by id, never by position.\n const infos = new Map(read.infos.map((info) => [info.id, info]));\n const txs = read.transactions.map((tx) => {\n const info = infos.get(tx.id);\n if (!info) {\n throw new ProviderError(\n 'PROVIDER_UNAVAILABLE',\n 'a scanned block lacks a receipt',\n );\n }\n return decodeTransaction(ctx.codec, tx, info, block.hash);\n });\n if (!filter?.addresses?.length) return txs;\n const wanted = new Set(filter.addresses.map((a) => toBase58Address(a)));\n return txs.filter(\n (tx) =>\n wanted.has(String(tx.details.owner)) ||\n tx.transfers.some((t) => wanted.has(t.to) || t.from.some((f) => wanted.has(f))),\n );\n },\n };\n}\n\nconst CURSOR = /^([tx]):(.*)$/;\n/** The largest page TronGrid serves. */\nconst MAX_PAGE = 200;\n\n/**\n * TronGrid history, each entry re-read from the full node and decoded like any\n * transaction; confirmed (solidified) entries only (`historyPage`). Phase `t` is\n * `/transactions`: the account's own transactions, TRX sent to it and, for a contract\n * account, other accounts' calls to it. Phase `x` is `/transactions/trc20`: every TRC-20\n * transfer from or to it (a spender's `transferFrom` out of it included), less the account's\n * own calls, which phase `t` listed. A TRC-20 transfer a wallet only received is in phase `x`\n * alone (TronGrid, read-only on Nile, 2026-09-28), but a call to a contract account that moves\n * its own tokens comes in both phases, so callers dedupe on `transfer.id`.\n * Paging follows the raw page's fingerprint, never how many items survive the filter, and\n * an entry the node cannot serve yet decides nothing: dropping it would skip it for good.\n */\nexport function createTronHistory(\n ctx: TronContext,\n indexer: Transport,\n getTransaction: (id: string) => Promise<DriverTransaction | null>,\n): AddressHistorySource {\n return {\n async list(address, options) {\n const match = CURSOR.exec(options.cursor ?? 't:');\n if (!match) throw new ConfigError('CONFIG_INVALID', 'not a Tron history cursor');\n const phase = match[1] as 't' | 'x';\n const fingerprint = match[2] as string;\n const owner = toBase58Address(address);\n const page = await historyPage(\n indexer,\n owner,\n phase === 't' ? 'transactions' : 'trc20',\n {\n limit: Math.min(Math.max(Math.trunc(options.limit) || 1, 1), MAX_PAGE),\n ...(fingerprint ? { fingerprint } : {}),\n },\n READ,\n );\n const items: DriverTransaction[] = [];\n for (const id of page.ids) {\n const tx = await getTransaction(id);\n // The index lists it as confirmed: a node that serves nothing, or only its pool\n // copy, is behind; listing that copy would move the cursor past it for good.\n if (!tx || tx.observation.seen !== 'block') throw notServable();\n // Phase x skips the account's own calls: phase t listed them.\n if (!(phase === 'x' && tx.details.owner === owner)) items.push(tx);\n }\n const next = page.next ? `${phase}:${page.next}` : phase === 't' ? 'x:' : undefined;\n return { items, ...(next !== undefined ? { next } : {}) };\n },\n };\n}\n"]}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The protobuf wire reader the Tron family shares: the codec (`codec.ts`) reads
3
+ * chain transactions with it, and the broadcast classifier (`errors.ts`) the bytes it sent.
4
+ * SDK-free, so the classifier never loads tronweb. Linear in the input: each
5
+ * length is checked against the bytes left before it is used, a varint stops at 64 bits,
6
+ * and field number 0, a group or an unknown wire type makes the message unreadable (`null`),
7
+ * as does a truncated field.
8
+ */
9
+ /** A varint as a bigint, length-delimited bytes, or `null` for an opaque fixed-width field. */
10
+ export type WireValue = bigint | Uint8Array | null;
11
+ export interface WireField {
12
+ readonly field: number;
13
+ readonly value: WireValue;
14
+ /** The field's encoded length, tag included. */
15
+ readonly length: number;
16
+ }
17
+ /**
18
+ * What a reader does with a fixed-width field (wire types 1 and 5): `opaque` keeps it as a
19
+ * `null` value, for chain data that may carry fields the reader never reads (the codec);
20
+ * `refuse` makes the message unreadable, for a reader that names every field it accepts
21
+ * (the classifier).
22
+ */
23
+ export type FixedWidth = 'opaque' | 'refuse';
24
+ /** The wire type a known field must have (`singular`). */
25
+ export type FieldKinds = Readonly<Record<number, 'varint' | 'bytes'>>;
26
+ /** One protobuf message's fields, in order; `null` when the bytes do not read. */
27
+ export declare function wireFields(bytes: Uint8Array, fixed: FixedWidth): WireField[] | null;
28
+ /**
29
+ * A message whose fields are each singular, by number; `null` when the bytes do not read or
30
+ * a field number repeats, so a value is never guessed between protobuf's merge and last-wins
31
+ * rules. With `kinds`, only the listed fields are accepted, each of its wire type, and a
32
+ * fixed-width field is refused; without, any field is kept and a fixed-width one is opaque.
33
+ */
34
+ export declare function singular(bytes: Uint8Array | null, kinds?: FieldKinds): Map<number, WireValue> | null;
35
+ /** A field's bytes, or `null` when it is absent or not length-delimited. */
36
+ export declare const bytesOf: (value: WireValue | undefined) => Uint8Array | null;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ /**
3
+ * The protobuf wire reader the Tron family shares: the codec (`codec.ts`) reads
4
+ * chain transactions with it, and the broadcast classifier (`errors.ts`) the bytes it sent.
5
+ * SDK-free, so the classifier never loads tronweb. Linear in the input: each
6
+ * length is checked against the bytes left before it is used, a varint stops at 64 bits,
7
+ * and field number 0, a group or an unknown wire type makes the message unreadable (`null`),
8
+ * as does a truncated field.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.bytesOf = void 0;
12
+ exports.wireFields = wireFields;
13
+ exports.singular = singular;
14
+ /** One protobuf message's fields, in order; `null` when the bytes do not read. */
15
+ function wireFields(bytes, fixed) {
16
+ const out = [];
17
+ let i = 0;
18
+ const varint = () => {
19
+ let result = 0n;
20
+ for (let shift = 0n; shift < 64n; shift += 7n) {
21
+ const byte = bytes[i++];
22
+ // The tenth byte carries the 64th bit only.
23
+ if (byte === undefined || (shift === 63n && byte > 1))
24
+ return null;
25
+ result |= BigInt(byte & 0x7f) << shift;
26
+ if ((byte & 0x80) === 0)
27
+ return result;
28
+ }
29
+ return null;
30
+ };
31
+ while (i < bytes.length) {
32
+ const start = i;
33
+ const key = varint();
34
+ if (key === null || key >> 3n === 0n)
35
+ return null;
36
+ const wire = key & 7n;
37
+ let value;
38
+ if (wire === 0n) {
39
+ value = varint();
40
+ if (value === null)
41
+ return null;
42
+ }
43
+ else if (wire === 2n) {
44
+ const length = varint();
45
+ if (length === null || length > BigInt(bytes.length - i))
46
+ return null;
47
+ value = bytes.subarray(i, i + Number(length));
48
+ i += Number(length);
49
+ }
50
+ else if ((wire === 1n || wire === 5n) && fixed === 'opaque') {
51
+ i += wire === 1n ? 8 : 4;
52
+ if (i > bytes.length)
53
+ return null;
54
+ value = null;
55
+ }
56
+ else {
57
+ return null;
58
+ }
59
+ out.push({ field: Number(key >> 3n), value, length: i - start });
60
+ }
61
+ return out;
62
+ }
63
+ /**
64
+ * A message whose fields are each singular, by number; `null` when the bytes do not read or
65
+ * a field number repeats, so a value is never guessed between protobuf's merge and last-wins
66
+ * rules. With `kinds`, only the listed fields are accepted, each of its wire type, and a
67
+ * fixed-width field is refused; without, any field is kept and a fixed-width one is opaque.
68
+ */
69
+ function singular(bytes, kinds) {
70
+ const fields = bytes ? wireFields(bytes, kinds ? 'refuse' : 'opaque') : null;
71
+ if (!fields)
72
+ return null;
73
+ const out = new Map();
74
+ for (const { field, value } of fields) {
75
+ if (out.has(field))
76
+ return null;
77
+ if (kinds) {
78
+ const kind = Object.hasOwn(kinds, field) ? kinds[field] : undefined;
79
+ if (kind === undefined || (kind === 'varint') !== (typeof value === 'bigint')) {
80
+ return null;
81
+ }
82
+ }
83
+ out.set(field, value);
84
+ }
85
+ return out;
86
+ }
87
+ /** A field's bytes, or `null` when it is absent or not length-delimited. */
88
+ const bytesOf = (value) => value instanceof Uint8Array ? value : null;
89
+ exports.bytesOf = bytesOf;
90
+ //# sourceMappingURL=protobuf.js.map