@ledgerhq/coin-tron 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/.eslintrc.js +20 -0
  2. package/.turbo/turbo-build.log +4 -0
  3. package/.unimportedrc.json +25 -0
  4. package/LICENSE.txt +21 -0
  5. package/jest.config.js +8 -0
  6. package/jest.integ.config.js +7 -0
  7. package/lib/bridge/broadcast.d.ts +7 -0
  8. package/lib/bridge/broadcast.d.ts.map +1 -0
  9. package/lib/bridge/broadcast.js +26 -0
  10. package/lib/bridge/broadcast.js.map +1 -0
  11. package/lib/bridge/buildOptimisticOperation.d.ts +5 -0
  12. package/lib/bridge/buildOptimisticOperation.d.ts.map +1 -0
  13. package/lib/bridge/buildOptimisticOperation.js +101 -0
  14. package/lib/bridge/buildOptimisticOperation.js.map +1 -0
  15. package/lib/bridge/createTransaction.d.ts +4 -0
  16. package/lib/bridge/createTransaction.d.ts.map +1 -0
  17. package/lib/bridge/createTransaction.js +19 -0
  18. package/lib/bridge/createTransaction.js.map +1 -0
  19. package/lib/bridge/deviceTransactionConfig.d.ts +20 -0
  20. package/lib/bridge/deviceTransactionConfig.d.ts.map +1 -0
  21. package/lib/bridge/deviceTransactionConfig.js +65 -0
  22. package/lib/bridge/deviceTransactionConfig.js.map +1 -0
  23. package/lib/bridge/estimateMaxSpendable.d.ts +5 -0
  24. package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
  25. package/lib/bridge/estimateMaxSpendable.js +30 -0
  26. package/lib/bridge/estimateMaxSpendable.js.map +1 -0
  27. package/lib/bridge/getEstimateFees.d.ts +6 -0
  28. package/lib/bridge/getEstimateFees.d.ts.map +1 -0
  29. package/lib/bridge/getEstimateFees.js +52 -0
  30. package/lib/bridge/getEstimateFees.js.map +1 -0
  31. package/lib/bridge/getTransactionStatus.d.ts +4 -0
  32. package/lib/bridge/getTransactionStatus.d.ts.map +1 -0
  33. package/lib/bridge/getTransactionStatus.js +218 -0
  34. package/lib/bridge/getTransactionStatus.js.map +1 -0
  35. package/lib/bridge/index.d.ts +10 -0
  36. package/lib/bridge/index.d.ts.map +1 -0
  37. package/lib/bridge/index.js +60 -0
  38. package/lib/bridge/index.js.map +1 -0
  39. package/lib/bridge/preload.d.ts +8 -0
  40. package/lib/bridge/preload.d.ts.map +1 -0
  41. package/lib/bridge/preload.js +32 -0
  42. package/lib/bridge/preload.js.map +1 -0
  43. package/lib/bridge/prepareTransaction.d.ts +4 -0
  44. package/lib/bridge/prepareTransaction.d.ts.map +1 -0
  45. package/lib/bridge/prepareTransaction.js +19 -0
  46. package/lib/bridge/prepareTransaction.js.map +1 -0
  47. package/lib/bridge/serialization.d.ts +9 -0
  48. package/lib/bridge/serialization.d.ts.map +1 -0
  49. package/lib/bridge/serialization.js +238 -0
  50. package/lib/bridge/serialization.js.map +1 -0
  51. package/lib/bridge/signOperation.d.ts +5 -0
  52. package/lib/bridge/signOperation.d.ts.map +1 -0
  53. package/lib/bridge/signOperation.js +92 -0
  54. package/lib/bridge/signOperation.js.map +1 -0
  55. package/lib/bridge/synchronization.d.ts +5 -0
  56. package/lib/bridge/synchronization.d.ts.map +1 -0
  57. package/lib/bridge/synchronization.integ.test.d.ts +3 -0
  58. package/lib/bridge/synchronization.integ.test.d.ts.map +1 -0
  59. package/lib/bridge/synchronization.integ.test.js +96 -0
  60. package/lib/bridge/synchronization.integ.test.js.map +1 -0
  61. package/lib/bridge/synchronization.js +216 -0
  62. package/lib/bridge/synchronization.js.map +1 -0
  63. package/lib/bridge/transaction.d.ts +15 -0
  64. package/lib/bridge/transaction.d.ts.map +1 -0
  65. package/lib/bridge/transaction.js +61 -0
  66. package/lib/bridge/transaction.js.map +1 -0
  67. package/lib/config.d.ts +10 -0
  68. package/lib/config.d.ts.map +1 -0
  69. package/lib/config.js +17 -0
  70. package/lib/config.js.map +1 -0
  71. package/lib/index.d.ts +3 -0
  72. package/lib/index.d.ts.map +1 -0
  73. package/lib/index.js +21 -0
  74. package/lib/index.js.map +1 -0
  75. package/lib/logic/constants.d.ts +4 -0
  76. package/lib/logic/constants.d.ts.map +1 -0
  77. package/lib/logic/constants.js +7 -0
  78. package/lib/logic/constants.js.map +1 -0
  79. package/lib/logic/pagination.d.ts +3 -0
  80. package/lib/logic/pagination.d.ts.map +1 -0
  81. package/lib/logic/pagination.js +19 -0
  82. package/lib/logic/pagination.js.map +1 -0
  83. package/lib/logic/utils.d.ts +12 -0
  84. package/lib/logic/utils.d.ts.map +1 -0
  85. package/lib/logic/utils.js +177 -0
  86. package/lib/logic/utils.js.map +1 -0
  87. package/lib/network/format.d.ts +9 -0
  88. package/lib/network/format.d.ts.map +1 -0
  89. package/lib/network/format.js +127 -0
  90. package/lib/network/format.js.map +1 -0
  91. package/lib/network/index.d.ts +30 -0
  92. package/lib/network/index.d.ts.map +1 -0
  93. package/lib/network/index.integ.test.d.ts +2 -0
  94. package/lib/network/index.integ.test.d.ts.map +1 -0
  95. package/lib/network/index.integ.test.js +38 -0
  96. package/lib/network/index.integ.test.js.map +1 -0
  97. package/lib/network/index.js +555 -0
  98. package/lib/network/index.js.map +1 -0
  99. package/lib/network/index.test.d.ts +2 -0
  100. package/lib/network/index.test.d.ts.map +1 -0
  101. package/lib/network/index.test.js +66 -0
  102. package/lib/network/index.test.js.map +1 -0
  103. package/lib/network/superRepresentativesData.mock.d.ts +69 -0
  104. package/lib/network/superRepresentativesData.mock.d.ts.map +1 -0
  105. package/lib/network/superRepresentativesData.mock.js +2208 -0
  106. package/lib/network/superRepresentativesData.mock.js.map +1 -0
  107. package/lib/network/types.d.ts +122 -0
  108. package/lib/network/types.d.ts.map +1 -0
  109. package/lib/network/types.fixture.d.ts +498 -0
  110. package/lib/network/types.fixture.d.ts.map +1 -0
  111. package/lib/network/types.fixture.js +4375 -0
  112. package/lib/network/types.fixture.js.map +1 -0
  113. package/lib/network/types.js +13 -0
  114. package/lib/network/types.js.map +1 -0
  115. package/lib/signer/getAddress.d.ts +6 -0
  116. package/lib/signer/getAddress.d.ts.map +1 -0
  117. package/lib/signer/getAddress.js +19 -0
  118. package/lib/signer/getAddress.js.map +1 -0
  119. package/lib/signer/index.d.ts +6 -0
  120. package/lib/signer/index.d.ts.map +1 -0
  121. package/lib/signer/index.js +11 -0
  122. package/lib/signer/index.js.map +1 -0
  123. package/lib/test/bot-deviceActions.d.ts +4 -0
  124. package/lib/test/bot-deviceActions.d.ts.map +1 -0
  125. package/lib/test/bot-deviceActions.js +103 -0
  126. package/lib/test/bot-deviceActions.js.map +1 -0
  127. package/lib/test/bot-specs.d.ts +7 -0
  128. package/lib/test/bot-specs.d.ts.map +1 -0
  129. package/lib/test/bot-specs.js +433 -0
  130. package/lib/test/bot-specs.js.map +1 -0
  131. package/lib/test/bridgeDatasetTest.d.ts +4 -0
  132. package/lib/test/bridgeDatasetTest.d.ts.map +1 -0
  133. package/lib/test/bridgeDatasetTest.js +1284 -0
  134. package/lib/test/bridgeDatasetTest.js.map +1 -0
  135. package/lib/test/cli.d.ts +52 -0
  136. package/lib/test/cli.d.ts.map +1 -0
  137. package/lib/test/cli.js +155 -0
  138. package/lib/test/cli.js.map +1 -0
  139. package/lib/test/index.d.ts +6 -0
  140. package/lib/test/index.d.ts.map +1 -0
  141. package/lib/test/index.js +26 -0
  142. package/lib/test/index.js.map +1 -0
  143. package/lib/types/bridge.d.ts +245 -0
  144. package/lib/types/bridge.d.ts.map +1 -0
  145. package/lib/types/bridge.js +16 -0
  146. package/lib/types/bridge.js.map +1 -0
  147. package/lib/types/errors.d.ts +49 -0
  148. package/lib/types/errors.d.ts.map +1 -0
  149. package/lib/types/errors.js +21 -0
  150. package/lib/types/errors.js.map +1 -0
  151. package/lib/types/index.d.ts +4 -0
  152. package/lib/types/index.d.ts.map +1 -0
  153. package/lib/types/index.js +21 -0
  154. package/lib/types/index.js.map +1 -0
  155. package/lib/types/signer.d.ts +10 -0
  156. package/lib/types/signer.d.ts.map +1 -0
  157. package/lib/types/signer.js +3 -0
  158. package/lib/types/signer.js.map +1 -0
  159. package/lib-es/bridge/broadcast.d.ts +7 -0
  160. package/lib-es/bridge/broadcast.d.ts.map +1 -0
  161. package/lib-es/bridge/broadcast.js +24 -0
  162. package/lib-es/bridge/broadcast.js.map +1 -0
  163. package/lib-es/bridge/buildOptimisticOperation.d.ts +5 -0
  164. package/lib-es/bridge/buildOptimisticOperation.d.ts.map +1 -0
  165. package/lib-es/bridge/buildOptimisticOperation.js +94 -0
  166. package/lib-es/bridge/buildOptimisticOperation.js.map +1 -0
  167. package/lib-es/bridge/createTransaction.d.ts +4 -0
  168. package/lib-es/bridge/createTransaction.d.ts.map +1 -0
  169. package/lib-es/bridge/createTransaction.js +14 -0
  170. package/lib-es/bridge/createTransaction.js.map +1 -0
  171. package/lib-es/bridge/deviceTransactionConfig.d.ts +20 -0
  172. package/lib-es/bridge/deviceTransactionConfig.d.ts.map +1 -0
  173. package/lib-es/bridge/deviceTransactionConfig.js +63 -0
  174. package/lib-es/bridge/deviceTransactionConfig.js.map +1 -0
  175. package/lib-es/bridge/estimateMaxSpendable.d.ts +5 -0
  176. package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
  177. package/lib-es/bridge/estimateMaxSpendable.js +25 -0
  178. package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
  179. package/lib-es/bridge/getEstimateFees.d.ts +6 -0
  180. package/lib-es/bridge/getEstimateFees.d.ts.map +1 -0
  181. package/lib-es/bridge/getEstimateFees.js +47 -0
  182. package/lib-es/bridge/getEstimateFees.js.map +1 -0
  183. package/lib-es/bridge/getTransactionStatus.d.ts +4 -0
  184. package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -0
  185. package/lib-es/bridge/getTransactionStatus.js +213 -0
  186. package/lib-es/bridge/getTransactionStatus.js.map +1 -0
  187. package/lib-es/bridge/index.d.ts +10 -0
  188. package/lib-es/bridge/index.d.ts.map +1 -0
  189. package/lib-es/bridge/index.js +53 -0
  190. package/lib-es/bridge/index.js.map +1 -0
  191. package/lib-es/bridge/preload.d.ts +8 -0
  192. package/lib-es/bridge/preload.d.ts.map +1 -0
  193. package/lib-es/bridge/preload.js +27 -0
  194. package/lib-es/bridge/preload.js.map +1 -0
  195. package/lib-es/bridge/prepareTransaction.d.ts +4 -0
  196. package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
  197. package/lib-es/bridge/prepareTransaction.js +15 -0
  198. package/lib-es/bridge/prepareTransaction.js.map +1 -0
  199. package/lib-es/bridge/serialization.d.ts +9 -0
  200. package/lib-es/bridge/serialization.d.ts.map +1 -0
  201. package/lib-es/bridge/serialization.js +229 -0
  202. package/lib-es/bridge/serialization.js.map +1 -0
  203. package/lib-es/bridge/signOperation.d.ts +5 -0
  204. package/lib-es/bridge/signOperation.d.ts.map +1 -0
  205. package/lib-es/bridge/signOperation.js +85 -0
  206. package/lib-es/bridge/signOperation.js.map +1 -0
  207. package/lib-es/bridge/synchronization.d.ts +5 -0
  208. package/lib-es/bridge/synchronization.d.ts.map +1 -0
  209. package/lib-es/bridge/synchronization.integ.test.d.ts +3 -0
  210. package/lib-es/bridge/synchronization.integ.test.d.ts.map +1 -0
  211. package/lib-es/bridge/synchronization.integ.test.js +89 -0
  212. package/lib-es/bridge/synchronization.integ.test.js.map +1 -0
  213. package/lib-es/bridge/synchronization.js +209 -0
  214. package/lib-es/bridge/synchronization.js.map +1 -0
  215. package/lib-es/bridge/transaction.d.ts +15 -0
  216. package/lib-es/bridge/transaction.d.ts.map +1 -0
  217. package/lib-es/bridge/transaction.js +55 -0
  218. package/lib-es/bridge/transaction.js.map +1 -0
  219. package/lib-es/config.d.ts +10 -0
  220. package/lib-es/config.d.ts.map +1 -0
  221. package/lib-es/config.js +12 -0
  222. package/lib-es/config.js.map +1 -0
  223. package/lib-es/index.d.ts +3 -0
  224. package/lib-es/index.d.ts.map +1 -0
  225. package/lib-es/index.js +3 -0
  226. package/lib-es/index.js.map +1 -0
  227. package/lib-es/logic/constants.d.ts +4 -0
  228. package/lib-es/logic/constants.d.ts.map +1 -0
  229. package/lib-es/logic/constants.js +4 -0
  230. package/lib-es/logic/constants.js.map +1 -0
  231. package/lib-es/logic/pagination.d.ts +3 -0
  232. package/lib-es/logic/pagination.d.ts.map +1 -0
  233. package/lib-es/logic/pagination.js +15 -0
  234. package/lib-es/logic/pagination.js.map +1 -0
  235. package/lib-es/logic/utils.d.ts +12 -0
  236. package/lib-es/logic/utils.d.ts.map +1 -0
  237. package/lib-es/logic/utils.js +167 -0
  238. package/lib-es/logic/utils.js.map +1 -0
  239. package/lib-es/network/format.d.ts +9 -0
  240. package/lib-es/network/format.d.ts.map +1 -0
  241. package/lib-es/network/format.js +117 -0
  242. package/lib-es/network/format.js.map +1 -0
  243. package/lib-es/network/index.d.ts +30 -0
  244. package/lib-es/network/index.d.ts.map +1 -0
  245. package/lib-es/network/index.integ.test.d.ts +2 -0
  246. package/lib-es/network/index.integ.test.d.ts.map +1 -0
  247. package/lib-es/network/index.integ.test.js +36 -0
  248. package/lib-es/network/index.integ.test.js.map +1 -0
  249. package/lib-es/network/index.js +524 -0
  250. package/lib-es/network/index.js.map +1 -0
  251. package/lib-es/network/index.test.d.ts +2 -0
  252. package/lib-es/network/index.test.d.ts.map +1 -0
  253. package/lib-es/network/index.test.js +63 -0
  254. package/lib-es/network/index.test.js.map +1 -0
  255. package/lib-es/network/superRepresentativesData.mock.d.ts +69 -0
  256. package/lib-es/network/superRepresentativesData.mock.d.ts.map +1 -0
  257. package/lib-es/network/superRepresentativesData.mock.js +2206 -0
  258. package/lib-es/network/superRepresentativesData.mock.js.map +1 -0
  259. package/lib-es/network/types.d.ts +122 -0
  260. package/lib-es/network/types.d.ts.map +1 -0
  261. package/lib-es/network/types.fixture.d.ts +498 -0
  262. package/lib-es/network/types.fixture.d.ts.map +1 -0
  263. package/lib-es/network/types.fixture.js +4371 -0
  264. package/lib-es/network/types.fixture.js.map +1 -0
  265. package/lib-es/network/types.js +8 -0
  266. package/lib-es/network/types.js.map +1 -0
  267. package/lib-es/signer/getAddress.d.ts +6 -0
  268. package/lib-es/signer/getAddress.d.ts.map +1 -0
  269. package/lib-es/signer/getAddress.js +17 -0
  270. package/lib-es/signer/getAddress.js.map +1 -0
  271. package/lib-es/signer/index.d.ts +6 -0
  272. package/lib-es/signer/index.d.ts.map +1 -0
  273. package/lib-es/signer/index.js +6 -0
  274. package/lib-es/signer/index.js.map +1 -0
  275. package/lib-es/test/bot-deviceActions.d.ts +4 -0
  276. package/lib-es/test/bot-deviceActions.d.ts.map +1 -0
  277. package/lib-es/test/bot-deviceActions.js +100 -0
  278. package/lib-es/test/bot-deviceActions.js.map +1 -0
  279. package/lib-es/test/bot-specs.d.ts +7 -0
  280. package/lib-es/test/bot-specs.d.ts.map +1 -0
  281. package/lib-es/test/bot-specs.js +428 -0
  282. package/lib-es/test/bot-specs.js.map +1 -0
  283. package/lib-es/test/bridgeDatasetTest.d.ts +4 -0
  284. package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -0
  285. package/lib-es/test/bridgeDatasetTest.js +1278 -0
  286. package/lib-es/test/bridgeDatasetTest.js.map +1 -0
  287. package/lib-es/test/cli.d.ts +52 -0
  288. package/lib-es/test/cli.d.ts.map +1 -0
  289. package/lib-es/test/cli.js +149 -0
  290. package/lib-es/test/cli.js.map +1 -0
  291. package/lib-es/test/index.d.ts +6 -0
  292. package/lib-es/test/index.d.ts.map +1 -0
  293. package/lib-es/test/index.js +6 -0
  294. package/lib-es/test/index.js.map +1 -0
  295. package/lib-es/types/bridge.d.ts +245 -0
  296. package/lib-es/types/bridge.d.ts.map +1 -0
  297. package/lib-es/types/bridge.js +11 -0
  298. package/lib-es/types/bridge.js.map +1 -0
  299. package/lib-es/types/errors.d.ts +49 -0
  300. package/lib-es/types/errors.d.ts.map +1 -0
  301. package/lib-es/types/errors.js +18 -0
  302. package/lib-es/types/errors.js.map +1 -0
  303. package/lib-es/types/index.d.ts +4 -0
  304. package/lib-es/types/index.d.ts.map +1 -0
  305. package/lib-es/types/index.js +5 -0
  306. package/lib-es/types/index.js.map +1 -0
  307. package/lib-es/types/signer.d.ts +10 -0
  308. package/lib-es/types/signer.d.ts.map +1 -0
  309. package/lib-es/types/signer.js +2 -0
  310. package/lib-es/types/signer.js.map +1 -0
  311. package/package.json +133 -0
  312. package/src/bridge/broadcast.ts +24 -0
  313. package/src/bridge/buildOptimisticOperation.ts +133 -0
  314. package/src/bridge/createTransaction.ts +16 -0
  315. package/src/bridge/deviceTransactionConfig.ts +99 -0
  316. package/src/bridge/estimateMaxSpendable.ts +32 -0
  317. package/src/bridge/getEstimateFees.ts +52 -0
  318. package/src/bridge/getTransactionStatus.ts +263 -0
  319. package/src/bridge/index.ts +78 -0
  320. package/src/bridge/preload.ts +24 -0
  321. package/src/bridge/prepareTransaction.ts +12 -0
  322. package/src/bridge/serialization.ts +288 -0
  323. package/src/bridge/signOperation.ts +123 -0
  324. package/src/bridge/synchronization.integ.test.ts +105 -0
  325. package/src/bridge/synchronization.ts +284 -0
  326. package/src/bridge/transaction.ts +84 -0
  327. package/src/config.ts +24 -0
  328. package/src/index.ts +3 -0
  329. package/src/logic/constants.ts +4 -0
  330. package/src/logic/pagination.ts +21 -0
  331. package/src/logic/utils.ts +231 -0
  332. package/src/network/format.ts +148 -0
  333. package/src/network/index.integ.test.ts +33 -0
  334. package/src/network/index.test.ts +61 -0
  335. package/src/network/index.ts +747 -0
  336. package/src/network/superRepresentativesData.mock.ts +2205 -0
  337. package/src/network/types.fixture.ts +4476 -0
  338. package/src/network/types.ts +147 -0
  339. package/src/signer/getAddress.ts +13 -0
  340. package/src/signer/index.ts +7 -0
  341. package/src/test/bot-deviceActions.ts +121 -0
  342. package/src/test/bot-specs.ts +457 -0
  343. package/src/test/bridgeDatasetTest.ts +1343 -0
  344. package/src/test/cli.ts +219 -0
  345. package/src/test/index.ts +6 -0
  346. package/src/types/bridge.ts +304 -0
  347. package/src/types/errors.ts +22 -0
  348. package/src/types/index.ts +4 -0
  349. package/src/types/signer.ts +9 -0
  350. package/tsconfig.json +14 -0
  351. package/types/tronweb/index.d.ts +5 -0
@@ -0,0 +1,1284 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.dataset = void 0;
7
+ const errors_1 = require("@ledgerhq/errors");
8
+ const bignumber_js_1 = require("bignumber.js");
9
+ const invariant_1 = __importDefault(require("invariant"));
10
+ const errors_2 = require("../types/errors");
11
+ const constants_1 = require("../logic/constants");
12
+ const transaction_1 = require("../bridge/transaction");
13
+ const unactivatedAddress = "TXFeV31qgUQYMLog3axKJeEBbXpQFtHsXD";
14
+ const activatedAddress1 = "TRqkRnAj6ceJFYAn2p1eE7aWrgBBwtdhS9";
15
+ const expectedTokenAccount = (a) => {
16
+ (0, invariant_1.default)(a && a.type === "TokenAccount", "expected token account");
17
+ return a;
18
+ };
19
+ const getTokenAccountId = (account, id) => expectedTokenAccount((account.subAccounts || []).find(a => expectedTokenAccount(a).token.id === id)).id;
20
+ const tron = {
21
+ FIXME_ignoreAccountFields: [
22
+ "tronResources.cacheTransactionInfoById", // this is a cache, don't save it
23
+ "tronResources.unwithdrawnReward", // it changes every vote cycles
24
+ "tronResources.bandwidth", // it changes if a tx is made
25
+ "tronResources.energy", // it keep changing?
26
+ ],
27
+ scanAccounts: [
28
+ {
29
+ name: "tron seed 1",
30
+ apdus: `
31
+ => e00200000d038000002c800000c380000000
32
+ <= 41049fc19cbc6d0f525b1c6947b4a36aec74b48e15f2531c5e7e58d272c9e926786da290eb3505d8fab9c83818c1174d9bc96fd18e0527365cba6b9534d43ad5052b2254546962427833526b4a4d6355394171357348337a376a5733455057676b324252419000
33
+ => e002000015058000002c800000c3800000000000000000000000
34
+ <= 41040897dbec3465fcfa24324d6be690bccab3bdb5bba7f7cbe756d58362336a91a4a8b9bdd0cb25cb97afdde08c85c2081f3a3a4ba96a012c91c835e992783ceca1225452716b526e416a3663654a4659416e3270316545376157726742427774646853399000
35
+ => e002000015058000002c800000c3800000010000000000000000
36
+ <= 4104af6028b35cd69b028df9bd1a8eccc9f7cc46ca916babe1b87500e17a65b8833e0d4a90e6ba7cfd76492378f43868cc48c89451362033cf5982f2fba92306fc95225448416534424e56787032393371677951457158456b484d705063717447373362699000
37
+ => e002000015058000002c800000c3800000020000000000000000
38
+ <= 410461936750537e962cb02353c8906cebfd61f35ee0b704be0a02640e5f2e0bb152c0614008db5753fc728cb4fd1eac47f843229ccb928890f3ac805d8cdb6b8e332254576570556e79427a487832616f45674e476f745a484379625a4a5a6531414864579000
39
+ => e002000015058000002c800000c3800000030000000000000000
40
+ <= 4104fd0fa05cefc7c50894935125c1777bba938043e19ad96fd62d4ee708e5bc5b610f401becc0b4ecb48370e1bbaf4afda6e11b425b424c8ff007205034164399392254544250424b316e386e5831566b5950683766734d35364b4c36473948524d3756639000
41
+ => e002000015058000002c800000c3800000040000000000000000
42
+ <= 41041da2283f752d855d858ea3b86ef44ed78def4878000e2508ed1a4ca5fce6a120a1f3edfbc14173577057b62e156f4a110410d886bb022e398cf607d8eb26f0c12254527a4164386b37386f623577545748657065447051727555754b596666683438789000
43
+ => e002000015058000002c800000c3800000050000000000000000
44
+ <= 4104dfeedfe3ec947d26b9b2be199c4d2a1b59b53ce8938fa37a3ebfccba5cd3432457987972d62f5ff7cebffba1655efe26324e25ae1c33d4c6b39d1ccf1a6c433f2254434b4655664672384555394356664b7a7138764c50786b5a5647347641657754649000
45
+ => e002000015058000002c800000c3800000060000000000000000
46
+ <= 4104f0bc4270d8d593486409062058abeabb87a0f2907b57d0f92a9173164e39b1a12a61ffce4c002f395cab8a790ccd00d41e056a32d285a01b218334d294abbf1f2254526552347a64464537384e614b67555555654869564758534763434434634e796a9000
47
+ => e002000015058000002c800000c3800000070000000000000000
48
+ <= 4104ac3f861b2006b1d950677b0ac77cc660a497d9e3afcb6caeb2bf4a67943535d56c0915fbd7476e93d50317fd13084ff3eb820a60cc448627e2e1be51c6145dc8225458466556333171675551594d4c6f673361784b4a654542625870514674487358449000
49
+ `,
50
+ },
51
+ ],
52
+ accounts: [
53
+ {
54
+ transactions: [
55
+ {
56
+ name: "sendSuccess",
57
+ transaction: (0, transaction_1.fromTransactionRaw)({
58
+ family: "tron",
59
+ recipient: activatedAddress1,
60
+ amount: "1000000",
61
+ networkInfo: null,
62
+ mode: "send",
63
+ duration: undefined,
64
+ resource: undefined,
65
+ votes: [],
66
+ }),
67
+ expectedStatus: {
68
+ amount: new bignumber_js_1.BigNumber("1000000"),
69
+ errors: {},
70
+ warnings: {},
71
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
72
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
73
+ },
74
+ },
75
+ {
76
+ name: "Send max",
77
+ transaction: (0, transaction_1.fromTransactionRaw)({
78
+ family: "tron",
79
+ recipient: activatedAddress1,
80
+ amount: "0",
81
+ useAllAmount: true,
82
+ networkInfo: null,
83
+ mode: "send",
84
+ duration: undefined,
85
+ resource: undefined,
86
+ votes: [],
87
+ }),
88
+ expectedStatus: account => ({
89
+ amount: account.spendableBalance,
90
+ errors: {},
91
+ warnings: {},
92
+ totalSpent: account.spendableBalance,
93
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
94
+ }),
95
+ },
96
+ {
97
+ name: "useAllAmountToUnactivatedAddressSuccess",
98
+ transaction: (0, transaction_1.fromTransactionRaw)({
99
+ family: "tron",
100
+ recipient: unactivatedAddress,
101
+ amount: "0",
102
+ useAllAmount: true,
103
+ networkInfo: null,
104
+ mode: "send",
105
+ duration: undefined,
106
+ resource: undefined,
107
+ votes: [],
108
+ }),
109
+ expectedStatus: (account, transaction, status) => {
110
+ return {
111
+ amount: account.spendableBalance.minus(status.estimatedFees),
112
+ errors: {},
113
+ warnings: {},
114
+ totalSpent: account.spendableBalance,
115
+ };
116
+ },
117
+ },
118
+ {
119
+ name: "voteSuccess",
120
+ transaction: (0, transaction_1.fromTransactionRaw)({
121
+ family: "tron",
122
+ recipient: activatedAddress1,
123
+ amount: "0",
124
+ networkInfo: null,
125
+ mode: "vote",
126
+ duration: undefined,
127
+ resource: undefined,
128
+ votes: [
129
+ {
130
+ address: "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
131
+ voteCount: 1,
132
+ },
133
+ {
134
+ address: "TGj1Ej1qRzL9feLTLhjwgxXF4Ct6GTWg2U",
135
+ voteCount: 1,
136
+ },
137
+ ],
138
+ }),
139
+ expectedStatus: {
140
+ amount: new bignumber_js_1.BigNumber("0"),
141
+ errors: {},
142
+ warnings: {},
143
+ totalSpent: new bignumber_js_1.BigNumber("0"),
144
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
145
+ },
146
+ },
147
+ {
148
+ name: "freezeBandwidthSuccess",
149
+ transaction: (0, transaction_1.fromTransactionRaw)({
150
+ family: "tron",
151
+ recipient: "",
152
+ amount: "1000000",
153
+ networkInfo: null,
154
+ mode: "freeze",
155
+ duration: undefined,
156
+ resource: "BANDWIDTH",
157
+ votes: [],
158
+ }),
159
+ expectedStatus: {
160
+ amount: new bignumber_js_1.BigNumber("1000000"),
161
+ errors: {},
162
+ warnings: {},
163
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
164
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
165
+ },
166
+ },
167
+ {
168
+ name: "freezeEnergySuccess",
169
+ transaction: (0, transaction_1.fromTransactionRaw)({
170
+ family: "tron",
171
+ recipient: "",
172
+ amount: "1000000",
173
+ networkInfo: null,
174
+ mode: "freeze",
175
+ duration: undefined,
176
+ resource: "ENERGY",
177
+ votes: [],
178
+ }),
179
+ expectedStatus: {
180
+ amount: new bignumber_js_1.BigNumber("1000000"),
181
+ errors: {},
182
+ warnings: {},
183
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
184
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
185
+ },
186
+ },
187
+ {
188
+ name: "NotEnoughFrozenEnergy",
189
+ transaction: (0, transaction_1.fromTransactionRaw)({
190
+ family: "tron",
191
+ recipient: "TBsyKdNsCKNXLgvneeUJ3rbXgWSgk6paTM",
192
+ amount: "1000000",
193
+ networkInfo: null,
194
+ mode: "unfreeze",
195
+ duration: undefined,
196
+ resource: "ENERGY",
197
+ votes: [],
198
+ }),
199
+ expectedStatus: {
200
+ amount: new bignumber_js_1.BigNumber("0"),
201
+ errors: {
202
+ resource: new errors_2.TronNoFrozenForEnergy(),
203
+ },
204
+ warnings: {},
205
+ totalSpent: new bignumber_js_1.BigNumber("0"),
206
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
207
+ },
208
+ },
209
+ {
210
+ name: "NotEnoughFrozenBandwidth",
211
+ transaction: (0, transaction_1.fromTransactionRaw)({
212
+ family: "tron",
213
+ recipient: "TBsyKdNsCKNXLgvneeUJ3rbXgWSgk6paTM",
214
+ amount: "1000000",
215
+ networkInfo: null,
216
+ mode: "unfreeze",
217
+ duration: undefined,
218
+ resource: "BANDWIDTH",
219
+ votes: [],
220
+ }),
221
+ expectedStatus: {
222
+ amount: new bignumber_js_1.BigNumber("0"),
223
+ errors: {
224
+ resource: new errors_2.TronNoFrozenForBandwidth(),
225
+ },
226
+ warnings: {},
227
+ totalSpent: new bignumber_js_1.BigNumber("0"),
228
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
229
+ },
230
+ },
231
+ {
232
+ name: "NoUnfrozenBalances",
233
+ transaction: (0, transaction_1.fromTransactionRaw)({
234
+ family: "tron",
235
+ recipient: "",
236
+ amount: "0",
237
+ networkInfo: null,
238
+ mode: "withdrawExpireUnfreeze",
239
+ duration: undefined,
240
+ votes: [],
241
+ resource: undefined,
242
+ }),
243
+ expectedStatus: {
244
+ amount: new bignumber_js_1.BigNumber("0"),
245
+ errors: {
246
+ resource: new errors_2.TronNoUnfrozenResource(),
247
+ },
248
+ warnings: {},
249
+ totalSpent: new bignumber_js_1.BigNumber("0"),
250
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
251
+ },
252
+ },
253
+ {
254
+ name: "InvalidUnDelegateResourceAmount",
255
+ transaction: (0, transaction_1.fromTransactionRaw)({
256
+ family: "tron",
257
+ recipient: "TBsyKdNsCKNXLgvneeUJ3rbXgWSgk6paTM",
258
+ amount: "100",
259
+ networkInfo: null,
260
+ mode: "unDelegateResource",
261
+ duration: undefined,
262
+ resource: "BANDWIDTH",
263
+ votes: [],
264
+ }),
265
+ expectedStatus: {
266
+ amount: new bignumber_js_1.BigNumber("0"),
267
+ errors: {
268
+ resource: new errors_2.TronInvalidUnDelegateResourceAmount(),
269
+ },
270
+ warnings: {},
271
+ totalSpent: new bignumber_js_1.BigNumber("0"),
272
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
273
+ },
274
+ },
275
+ {
276
+ name: "recipientRequired",
277
+ transaction: (0, transaction_1.fromTransactionRaw)({
278
+ family: "tron",
279
+ recipient: "",
280
+ amount: "1000000",
281
+ networkInfo: null,
282
+ mode: "send",
283
+ duration: undefined,
284
+ resource: undefined,
285
+ votes: [],
286
+ }),
287
+ expectedStatus: {
288
+ amount: new bignumber_js_1.BigNumber("1000000"),
289
+ errors: {
290
+ recipient: new errors_1.RecipientRequired(),
291
+ },
292
+ warnings: {},
293
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
294
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
295
+ },
296
+ },
297
+ {
298
+ name: "invalidRecipientIsTheSame",
299
+ transaction: (0, transaction_1.fromTransactionRaw)({
300
+ family: "tron",
301
+ recipient: "THAe4BNVxp293qgyQEqXEkHMpPcqtG73bi",
302
+ amount: "1000000",
303
+ networkInfo: null,
304
+ mode: "send",
305
+ duration: undefined,
306
+ resource: undefined,
307
+ votes: [],
308
+ }),
309
+ expectedStatus: {
310
+ amount: new bignumber_js_1.BigNumber("1000000"),
311
+ errors: {
312
+ recipient: new errors_1.InvalidAddressBecauseDestinationIsAlsoSource(),
313
+ },
314
+ warnings: {},
315
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
316
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
317
+ },
318
+ },
319
+ {
320
+ name: "invalidRecipientUnknown",
321
+ transaction: (0, transaction_1.fromTransactionRaw)({
322
+ family: "tron",
323
+ recipient: "unknown",
324
+ amount: "1000000",
325
+ networkInfo: null,
326
+ mode: "send",
327
+ duration: undefined,
328
+ resource: undefined,
329
+ votes: [],
330
+ }),
331
+ expectedStatus: {
332
+ amount: new bignumber_js_1.BigNumber("1000000"),
333
+ errors: {
334
+ recipient: new errors_1.InvalidAddress(),
335
+ },
336
+ warnings: {},
337
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
338
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
339
+ },
340
+ },
341
+ {
342
+ name: "amountRequired",
343
+ transaction: (0, transaction_1.fromTransactionRaw)({
344
+ family: "tron",
345
+ recipient: activatedAddress1,
346
+ amount: "0",
347
+ networkInfo: null,
348
+ mode: "send",
349
+ duration: undefined,
350
+ resource: undefined,
351
+ votes: [],
352
+ }),
353
+ expectedStatus: {
354
+ amount: new bignumber_js_1.BigNumber("0"),
355
+ errors: {
356
+ amount: new errors_1.AmountRequired(),
357
+ },
358
+ warnings: {},
359
+ totalSpent: new bignumber_js_1.BigNumber("0"),
360
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
361
+ },
362
+ },
363
+ {
364
+ name: "notEnoughBalance",
365
+ transaction: (0, transaction_1.fromTransactionRaw)({
366
+ family: "tron",
367
+ recipient: activatedAddress1,
368
+ amount: "1000000000",
369
+ networkInfo: null,
370
+ mode: "send",
371
+ duration: undefined,
372
+ resource: undefined,
373
+ votes: [],
374
+ }),
375
+ expectedStatus: {
376
+ amount: new bignumber_js_1.BigNumber("1000000000"),
377
+ errors: {
378
+ amount: new errors_1.NotEnoughBalance(),
379
+ },
380
+ warnings: {},
381
+ totalSpent: new bignumber_js_1.BigNumber("1000000000"),
382
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
383
+ },
384
+ },
385
+ {
386
+ name: "notEnoughBalance to unactivated",
387
+ transaction: t => (Object.assign(Object.assign({}, t), { amount: new bignumber_js_1.BigNumber(100), recipient: unactivatedAddress })),
388
+ expectedStatus: () => ({
389
+ estimatedFees: constants_1.ACTIVATION_FEES,
390
+ }),
391
+ },
392
+ {
393
+ name: "enoughBalance near the max",
394
+ transaction: (t, account) => (Object.assign(Object.assign({}, t), { recipient: unactivatedAddress, amount: account.spendableBalance.minus(constants_1.ACTIVATION_FEES).minus(1) })),
395
+ expectedStatus: () => ({
396
+ errors: {},
397
+ }),
398
+ },
399
+ {
400
+ name: "enoughBalance at exactly the max",
401
+ transaction: (t, account) => (Object.assign(Object.assign({}, t), { recipient: unactivatedAddress, amount: account.spendableBalance.minus(constants_1.ACTIVATION_FEES) })),
402
+ expectedStatus: () => ({
403
+ errors: {},
404
+ }),
405
+ },
406
+ {
407
+ name: "estimatedFeesWarning",
408
+ // send 1TRX to new account = +0.1TRX of fees
409
+ transaction: (0, transaction_1.fromTransactionRaw)({
410
+ family: "tron",
411
+ recipient: unactivatedAddress,
412
+ amount: "1000000",
413
+ networkInfo: null,
414
+ mode: "send",
415
+ duration: undefined,
416
+ resource: undefined,
417
+ votes: [],
418
+ }),
419
+ expectedStatus: {
420
+ amount: new bignumber_js_1.BigNumber("1000000"),
421
+ errors: {},
422
+ warnings: {
423
+ fee: new errors_2.TronUnexpectedFees("Estimated fees"),
424
+ },
425
+ totalSpent: new bignumber_js_1.BigNumber("2100000"),
426
+ estimatedFees: new bignumber_js_1.BigNumber("1100000"),
427
+ },
428
+ },
429
+ {
430
+ name: "tronSendTrc20ToContractAddressSuccess",
431
+ transaction: (t, account) => (Object.assign(Object.assign({}, t), { recipient: "TYmGYpY3LuHHge9jmTtq2aQmSpUpqKcZtJ",
432
+ // corresponds to a valid deposit contract address
433
+ subAccountId: getTokenAccountId(account, "tron/trc20/tla2f6vpqdgre67v1736s7bj8ray5wyju7"), amount: new bignumber_js_1.BigNumber("1000000") })),
434
+ expectedStatus: {
435
+ amount: new bignumber_js_1.BigNumber("1000000"),
436
+ errors: {},
437
+ warnings: {},
438
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
439
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
440
+ },
441
+ },
442
+ {
443
+ name: "tronSendTrc20ToNewAccountForbidden",
444
+ transaction: (t, account) => (Object.assign(Object.assign({}, t), { recipient: unactivatedAddress, subAccountId: getTokenAccountId(account, "tron/trc20/tla2f6vpqdgre67v1736s7bj8ray5wyju7"), amount: new bignumber_js_1.BigNumber("1000000") })),
445
+ expectedStatus: {
446
+ amount: new bignumber_js_1.BigNumber("1000000"),
447
+ errors: {
448
+ recipient: new errors_2.TronSendTrc20ToNewAccountForbidden(),
449
+ },
450
+ warnings: {},
451
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
452
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
453
+ },
454
+ }, // FIXME account have moved...
455
+ /*
456
+ {
457
+ name: "tronSendTrc20NotEnoughEnergyWarning",
458
+ transaction: fromTransactionRaw({
459
+ family: "tron",
460
+ recipient: activatedAddress1,
461
+ subAccountId:
462
+ "tronjs:2:tron:THAe4BNVxp293qgyQEqXEkHMpPcqtG73bi:+TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
463
+ amount: "1000000",
464
+ networkInfo: null,
465
+ mode: "send",
466
+ duration: undefined,
467
+ resource: undefined,
468
+ votes: []
469
+ }),
470
+ expectedStatus: {
471
+ amount: new BigNumber("1000000"),
472
+ errors: {},
473
+ warnings: { amount: new TronNotEnoughEnergy() },
474
+ totalSpent: new BigNumber("1000000"),
475
+ estimatedFees: new BigNumber("0")
476
+ }
477
+ },
478
+ */
479
+ {
480
+ name: "tronSendTrc20Success",
481
+ transaction: (t, account) => (Object.assign(Object.assign({}, t), { recipient: activatedAddress1, subAccountId: getTokenAccountId(account, "tron/trc20/tla2f6vpqdgre67v1736s7bj8ray5wyju7"), amount: new bignumber_js_1.BigNumber("1000000") })),
482
+ expectedStatus: {
483
+ amount: new bignumber_js_1.BigNumber("1000000"),
484
+ errors: {},
485
+ warnings: {},
486
+ totalSpent: new bignumber_js_1.BigNumber("1000000"),
487
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
488
+ },
489
+ },
490
+ {
491
+ name: "tronInvalidFreezeAmount",
492
+ transaction: (0, transaction_1.fromTransactionRaw)({
493
+ family: "tron",
494
+ recipient: "",
495
+ amount: "100000",
496
+ networkInfo: null,
497
+ mode: "freeze",
498
+ duration: undefined,
499
+ resource: "BANDWIDTH",
500
+ votes: [],
501
+ }),
502
+ expectedStatus: {
503
+ amount: new bignumber_js_1.BigNumber("100000"),
504
+ errors: {
505
+ amount: new errors_2.TronInvalidFreezeAmount(),
506
+ },
507
+ warnings: {},
508
+ totalSpent: new bignumber_js_1.BigNumber("100000"),
509
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
510
+ },
511
+ },
512
+ {
513
+ name: "tronLegacyUnFreezeBandwidth",
514
+ transaction: (0, transaction_1.fromTransactionRaw)({
515
+ family: "tron",
516
+ recipient: "",
517
+ amount: "1000000",
518
+ networkInfo: null,
519
+ mode: "legacyUnfreeze",
520
+ duration: undefined,
521
+ resource: "BANDWIDTH",
522
+ votes: [],
523
+ }),
524
+ expectedStatus: {
525
+ amount: new bignumber_js_1.BigNumber("0"),
526
+ errors: {},
527
+ warnings: {},
528
+ totalSpent: new bignumber_js_1.BigNumber("0"),
529
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
530
+ },
531
+ },
532
+ // Not so sure how ot make this test work again, frozen energy seems to be expired.
533
+ // {
534
+ // name: "tronNoFrozenForEnergy",
535
+ // transaction: fromTransactionRaw({
536
+ // family: "tron",
537
+ // recipient: "",
538
+ // amount: "0",
539
+ // networkInfo: null,
540
+ // mode: "unfreeze",
541
+ // duration: undefined,
542
+ // resource: "ENERGY",
543
+ // votes: [],
544
+ // }),
545
+ // expectedStatus: {
546
+ // amount: new BigNumber("0"),
547
+ // errors: {
548
+ // resource: new TronNoFrozenForEnergy(),
549
+ // },
550
+ // warnings: {},
551
+ // totalSpent: new BigNumber("0"),
552
+ // estimatedFees: new BigNumber("0"),
553
+ // },
554
+ // },
555
+ {
556
+ name: "tronVoteRequired",
557
+ transaction: (0, transaction_1.fromTransactionRaw)({
558
+ family: "tron",
559
+ recipient: "",
560
+ amount: "0",
561
+ networkInfo: null,
562
+ mode: "vote",
563
+ duration: undefined,
564
+ resource: undefined,
565
+ votes: [],
566
+ }),
567
+ expectedStatus: {
568
+ amount: new bignumber_js_1.BigNumber("0"),
569
+ errors: {
570
+ vote: new errors_2.TronVoteRequired(),
571
+ },
572
+ warnings: {},
573
+ totalSpent: new bignumber_js_1.BigNumber("0"),
574
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
575
+ },
576
+ },
577
+ {
578
+ name: "invalidVoteAddress",
579
+ transaction: (0, transaction_1.fromTransactionRaw)({
580
+ family: "tron",
581
+ recipient: activatedAddress1,
582
+ amount: "0",
583
+ networkInfo: null,
584
+ mode: "vote",
585
+ duration: undefined,
586
+ resource: undefined,
587
+ votes: [
588
+ {
589
+ address: "abcde",
590
+ voteCount: 1,
591
+ },
592
+ ],
593
+ }),
594
+ expectedStatus: {
595
+ amount: new bignumber_js_1.BigNumber("0"),
596
+ errors: {
597
+ vote: new errors_1.InvalidAddress(),
598
+ },
599
+ warnings: {},
600
+ totalSpent: new bignumber_js_1.BigNumber("0"),
601
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
602
+ },
603
+ },
604
+ {
605
+ name: "tronInvalidVoteCount",
606
+ transaction: (0, transaction_1.fromTransactionRaw)({
607
+ family: "tron",
608
+ recipient: activatedAddress1,
609
+ amount: "0",
610
+ networkInfo: null,
611
+ mode: "vote",
612
+ duration: undefined,
613
+ resource: undefined,
614
+ votes: [
615
+ {
616
+ address: "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
617
+ voteCount: 0,
618
+ },
619
+ ],
620
+ }),
621
+ expectedStatus: {
622
+ amount: new bignumber_js_1.BigNumber("0"),
623
+ errors: {
624
+ vote: new errors_2.TronInvalidVoteCount(),
625
+ },
626
+ warnings: {},
627
+ totalSpent: new bignumber_js_1.BigNumber("0"),
628
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
629
+ },
630
+ },
631
+ {
632
+ name: "tronNotEnoughTronPower",
633
+ transaction: (0, transaction_1.fromTransactionRaw)({
634
+ family: "tron",
635
+ recipient: "",
636
+ amount: "0",
637
+ networkInfo: null,
638
+ mode: "vote",
639
+ duration: undefined,
640
+ resource: undefined,
641
+ votes: [
642
+ {
643
+ address: "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
644
+ voteCount: 5,
645
+ },
646
+ {
647
+ address: "TGj1Ej1qRzL9feLTLhjwgxXF4Ct6GTWg2U",
648
+ voteCount: 5,
649
+ },
650
+ ],
651
+ }),
652
+ expectedStatus: {
653
+ amount: new bignumber_js_1.BigNumber("0"),
654
+ errors: {
655
+ vote: new errors_2.TronNotEnoughTronPower(),
656
+ },
657
+ warnings: {},
658
+ totalSpent: new bignumber_js_1.BigNumber("0"),
659
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
660
+ },
661
+ },
662
+ {
663
+ name: "tronNoReward",
664
+ transaction: (0, transaction_1.fromTransactionRaw)({
665
+ family: "tron",
666
+ recipient: "",
667
+ amount: "0",
668
+ networkInfo: null,
669
+ mode: "claimReward",
670
+ duration: undefined,
671
+ resource: undefined,
672
+ votes: [],
673
+ }),
674
+ expectedStatus: {
675
+ amount: new bignumber_js_1.BigNumber("0"),
676
+ errors: {
677
+ reward: new errors_2.TronNoReward(),
678
+ },
679
+ warnings: {},
680
+ totalSpent: new bignumber_js_1.BigNumber("0"),
681
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
682
+ },
683
+ },
684
+ ],
685
+ raw: {
686
+ id: "js:2:tron:THAe4BNVxp293qgyQEqXEkHMpPcqtG73bi:",
687
+ seedIdentifier: "THAe4BNVxp293qgyQEqXEkHMpPcqtG73bi",
688
+ name: "Tron 2",
689
+ derivationMode: "",
690
+ index: 1,
691
+ freshAddress: "THAe4BNVxp293qgyQEqXEkHMpPcqtG73bi",
692
+ freshAddressPath: "44'/195'/0'/0/0",
693
+ pendingOperations: [],
694
+ currencyId: "tron",
695
+ balance: "10006000",
696
+ spendableBalance: "1606000",
697
+ subAccounts: [],
698
+ operations: [],
699
+ lastSyncDate: "",
700
+ blockHeight: 0,
701
+ tronResources: {
702
+ frozen: { bandwidth: undefined, energy: undefined },
703
+ delegatedFrozen: { bandwidth: undefined, energy: undefined },
704
+ unFrozen: { bandwidth: [], energy: [] },
705
+ legacyFrozen: {
706
+ bandwidth: { amount: "2000000", expiredAt: "2022-05-23T08:20:39.000Z" },
707
+ energy: { amount: "1000000", expiredAt: "2022-05-22T12:51:12.000Z" },
708
+ },
709
+ votes: [],
710
+ tronPower: 3,
711
+ energy: "12",
712
+ bandwidth: {
713
+ freeUsed: "0",
714
+ freeLimit: "600",
715
+ gainedUsed: "0",
716
+ gainedLimit: "2",
717
+ },
718
+ unwithdrawnReward: "0",
719
+ lastWithdrawnRewardDate: undefined,
720
+ lastVotedDate: undefined,
721
+ cacheTransactionInfoById: {},
722
+ },
723
+ },
724
+ },
725
+ {
726
+ transactions: [
727
+ {
728
+ name: "claimRewardSuccess",
729
+ transaction: (0, transaction_1.fromTransactionRaw)({
730
+ family: "tron",
731
+ recipient: "",
732
+ amount: "0",
733
+ networkInfo: null,
734
+ mode: "claimReward",
735
+ duration: undefined,
736
+ resource: undefined,
737
+ votes: [],
738
+ }),
739
+ expectedStatus: {
740
+ amount: new bignumber_js_1.BigNumber("0"),
741
+ errors: {},
742
+ warnings: {},
743
+ totalSpent: new bignumber_js_1.BigNumber("0"),
744
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
745
+ },
746
+ },
747
+ {
748
+ name: "tronNoFrozenForBandwidth",
749
+ transaction: (0, transaction_1.fromTransactionRaw)({
750
+ family: "tron",
751
+ recipient: "TBsyKdNsCKNXLgvneeUJ3rbXgWSgk6paTM",
752
+ amount: "1000000",
753
+ networkInfo: null,
754
+ mode: "unfreeze",
755
+ duration: undefined,
756
+ resource: "BANDWIDTH",
757
+ votes: [],
758
+ }),
759
+ expectedStatus: {
760
+ amount: new bignumber_js_1.BigNumber("0"),
761
+ errors: {
762
+ resource: new errors_2.TronNoFrozenForBandwidth(),
763
+ },
764
+ warnings: {},
765
+ totalSpent: new bignumber_js_1.BigNumber("0"),
766
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
767
+ },
768
+ },
769
+ ],
770
+ FIXME_tests: [
771
+ /**
772
+ Error:
773
+ - Expected
774
+ + Received
775
+ - "26003017"
776
+ + "26000197"
777
+ The live-common ignore all unsupported tokens (by the nano app) transactions.
778
+
779
+ Difference of 2820 (0.00282 TRX) is due to an unsupported tr10 transaction which have fee:
780
+ https://tronscan.org/#/transaction/6fe0b288e0cce30396afe40b365ee57642be44146acc847672fe3d328309d2b0
781
+ To re-enable when the support will be done.
782
+ */
783
+ "balance is sum of ops",
784
+ ],
785
+ raw: {
786
+ id: "js:2:tron:TRqkRnAj6ceJFYAn2p1eE7aWrgBBwtdhS9:",
787
+ seedIdentifier: activatedAddress1,
788
+ name: "Tron 1",
789
+ derivationMode: "",
790
+ index: 0,
791
+ freshAddress: activatedAddress1,
792
+ freshAddressPath: "44'/195'/0'/0/0",
793
+ pendingOperations: [],
794
+ currencyId: "tron",
795
+ balance: "26000197",
796
+ spendableBalance: "197",
797
+ subAccounts: [],
798
+ operations: [],
799
+ lastSyncDate: "",
800
+ blockHeight: 0,
801
+ tronResources: {
802
+ frozen: { bandwidth: undefined, energy: undefined },
803
+ delegatedFrozen: { bandwidth: undefined, energy: undefined },
804
+ unFrozen: { bandwidth: [], energy: [] },
805
+ legacyFrozen: {
806
+ bandwidth: undefined,
807
+ energy: { amount: "26000000", expiredAt: "2020-02-01T16:04:51.000Z" },
808
+ },
809
+ votes: [
810
+ { address: "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH", voteCount: 15 },
811
+ { address: "TGj1Ej1qRzL9feLTLhjwgxXF4Ct6GTWg2U", voteCount: 1 },
812
+ { address: "TCZvvbn4SCVyNhCAt1L8Kp1qk5rtMiKdBB", voteCount: 2 },
813
+ ],
814
+ tronPower: 26,
815
+ energy: "326",
816
+ bandwidth: {
817
+ freeUsed: "0",
818
+ freeLimit: "600",
819
+ gainedUsed: "0",
820
+ gainedLimit: "0",
821
+ },
822
+ unwithdrawnReward: "1336847",
823
+ lastWithdrawnRewardDate: "2022-05-19T12:45:36.000Z",
824
+ lastVotedDate: "2022-05-19T12:43:42.000Z",
825
+ cacheTransactionInfoById: {},
826
+ },
827
+ },
828
+ },
829
+ {
830
+ transactions: [
831
+ {
832
+ name: "FreezeEnergySuccess",
833
+ transaction: (0, transaction_1.fromTransactionRaw)({
834
+ amount: "1000000",
835
+ recipient: "",
836
+ useAllAmount: false,
837
+ subAccountId: null,
838
+ networkInfo: {
839
+ family: "tron",
840
+ freeNetUsed: "0",
841
+ freeNetLimit: "600",
842
+ netUsed: "271",
843
+ netLimit: "584",
844
+ energyUsed: "0",
845
+ energyLimit: "214",
846
+ },
847
+ family: "tron",
848
+ mode: "freeze",
849
+ resource: "ENERGY",
850
+ duration: 3,
851
+ votes: [],
852
+ }),
853
+ expectedStatus: {
854
+ errors: {},
855
+ warnings: {},
856
+ amount: (0, bignumber_js_1.BigNumber)("1000000"),
857
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
858
+ totalSpent: (0, bignumber_js_1.BigNumber)("1000000"),
859
+ },
860
+ },
861
+ {
862
+ name: "NotEnoughBalanceToFreeze",
863
+ transaction: (0, transaction_1.fromTransactionRaw)({
864
+ amount: "100000000000000000",
865
+ recipient: "",
866
+ useAllAmount: false,
867
+ subAccountId: null,
868
+ networkInfo: {
869
+ family: "tron",
870
+ freeNetUsed: "0",
871
+ freeNetLimit: "600",
872
+ netUsed: "271",
873
+ netLimit: "584",
874
+ energyUsed: "0",
875
+ energyLimit: "214",
876
+ },
877
+ family: "tron",
878
+ mode: "freeze",
879
+ resource: "ENERGY",
880
+ duration: 3,
881
+ votes: [],
882
+ }),
883
+ expectedStatus: {
884
+ errors: {
885
+ amount: new errors_1.NotEnoughBalance(),
886
+ },
887
+ warnings: {},
888
+ amount: (0, bignumber_js_1.BigNumber)("100000000000000000"),
889
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
890
+ totalSpent: (0, bignumber_js_1.BigNumber)("100000000000000000"),
891
+ },
892
+ },
893
+ {
894
+ name: "FreezeBandwidthSuccess",
895
+ transaction: (0, transaction_1.fromTransactionRaw)({
896
+ amount: "1000000",
897
+ recipient: "",
898
+ useAllAmount: false,
899
+ subAccountId: null,
900
+ networkInfo: {
901
+ family: "tron",
902
+ freeNetUsed: "0",
903
+ freeNetLimit: "600",
904
+ netUsed: "271",
905
+ netLimit: "584",
906
+ energyUsed: "0",
907
+ energyLimit: "214",
908
+ },
909
+ family: "tron",
910
+ mode: "freeze",
911
+ resource: "BANDWIDTH",
912
+ duration: 3,
913
+ votes: [],
914
+ }),
915
+ expectedStatus: {
916
+ errors: {},
917
+ warnings: {},
918
+ amount: (0, bignumber_js_1.BigNumber)("1000000"),
919
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
920
+ totalSpent: (0, bignumber_js_1.BigNumber)("1000000"),
921
+ },
922
+ },
923
+ {
924
+ name: "UnfreezeEnergySuccess",
925
+ transaction: (0, transaction_1.fromTransactionRaw)({
926
+ amount: "1000000",
927
+ recipient: "",
928
+ useAllAmount: false,
929
+ subAccountId: null,
930
+ networkInfo: {
931
+ family: "tron",
932
+ freeNetUsed: "0",
933
+ freeNetLimit: "600",
934
+ netUsed: "271",
935
+ netLimit: "584",
936
+ energyUsed: "0",
937
+ energyLimit: "214",
938
+ },
939
+ family: "tron",
940
+ mode: "unfreeze",
941
+ resource: "ENERGY",
942
+ duration: 3,
943
+ votes: [],
944
+ }),
945
+ expectedStatus: {
946
+ errors: {},
947
+ warnings: {},
948
+ amount: (0, bignumber_js_1.BigNumber)("0"),
949
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
950
+ totalSpent: (0, bignumber_js_1.BigNumber)("0"),
951
+ },
952
+ },
953
+ {
954
+ name: "NotEnoughEnergyUnfreeze",
955
+ transaction: (0, transaction_1.fromTransactionRaw)({
956
+ amount: "10000000000",
957
+ recipient: "",
958
+ useAllAmount: false,
959
+ subAccountId: null,
960
+ networkInfo: {
961
+ family: "tron",
962
+ freeNetUsed: "0",
963
+ freeNetLimit: "600",
964
+ netUsed: "271",
965
+ netLimit: "584",
966
+ energyUsed: "0",
967
+ energyLimit: "214",
968
+ },
969
+ family: "tron",
970
+ mode: "unfreeze",
971
+ resource: "ENERGY",
972
+ duration: 3,
973
+ votes: [],
974
+ }),
975
+ expectedStatus: {
976
+ errors: {
977
+ resource: new errors_2.TronNoFrozenForEnergy(),
978
+ },
979
+ warnings: {},
980
+ amount: (0, bignumber_js_1.BigNumber)("0"),
981
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
982
+ totalSpent: (0, bignumber_js_1.BigNumber)("0"),
983
+ },
984
+ },
985
+ {
986
+ name: "UnfreezeBandwidthSuccess",
987
+ transaction: (0, transaction_1.fromTransactionRaw)({
988
+ amount: "1000000",
989
+ recipient: "",
990
+ useAllAmount: false,
991
+ subAccountId: null,
992
+ networkInfo: {
993
+ family: "tron",
994
+ freeNetUsed: "0",
995
+ freeNetLimit: "600",
996
+ netUsed: "272",
997
+ netLimit: "584",
998
+ energyUsed: "0",
999
+ energyLimit: "214",
1000
+ },
1001
+ family: "tron",
1002
+ mode: "unfreeze",
1003
+ resource: "BANDWIDTH",
1004
+ duration: 3,
1005
+ votes: [],
1006
+ }),
1007
+ expectedStatus: {
1008
+ errors: {},
1009
+ warnings: {},
1010
+ amount: (0, bignumber_js_1.BigNumber)("0"),
1011
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
1012
+ totalSpent: (0, bignumber_js_1.BigNumber)("0"),
1013
+ },
1014
+ },
1015
+ {
1016
+ name: "withdrawExpireUnfreezeSuccess",
1017
+ transaction: (0, transaction_1.fromTransactionRaw)({
1018
+ amount: "0",
1019
+ recipient: "",
1020
+ useAllAmount: false,
1021
+ subAccountId: null,
1022
+ networkInfo: {
1023
+ family: "tron",
1024
+ freeNetUsed: "0",
1025
+ freeNetLimit: "600",
1026
+ netUsed: "274",
1027
+ netLimit: "584",
1028
+ energyUsed: "0",
1029
+ energyLimit: "214",
1030
+ },
1031
+ family: "tron",
1032
+ mode: "withdrawExpireUnfreeze",
1033
+ resource: null,
1034
+ duration: 3,
1035
+ votes: [],
1036
+ }),
1037
+ expectedStatus: {
1038
+ errors: {},
1039
+ warnings: {},
1040
+ amount: (0, bignumber_js_1.BigNumber)("0"),
1041
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
1042
+ totalSpent: (0, bignumber_js_1.BigNumber)("0"),
1043
+ },
1044
+ },
1045
+ {
1046
+ name: "UndelegateResourceSuccess",
1047
+ transaction: (0, transaction_1.fromTransactionRaw)({
1048
+ amount: "1000000",
1049
+ recipient: "TKc4RbfcDf6MrHXENfRAG23ue8YYgaTh8U",
1050
+ useAllAmount: false,
1051
+ subAccountId: null,
1052
+ networkInfo: {
1053
+ family: "tron",
1054
+ freeNetUsed: "0",
1055
+ freeNetLimit: "600",
1056
+ netUsed: "268",
1057
+ netLimit: "584",
1058
+ energyUsed: "0",
1059
+ energyLimit: "214",
1060
+ },
1061
+ family: "tron",
1062
+ mode: "unDelegateResource",
1063
+ resource: "ENERGY",
1064
+ duration: 3,
1065
+ votes: [],
1066
+ }),
1067
+ expectedStatus: {
1068
+ errors: {},
1069
+ warnings: {},
1070
+ amount: (0, bignumber_js_1.BigNumber)("0"),
1071
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
1072
+ totalSpent: (0, bignumber_js_1.BigNumber)("0"),
1073
+ },
1074
+ },
1075
+ {
1076
+ name: "AddressIsAlsoSourceUndelegateResourceError",
1077
+ transaction: (0, transaction_1.fromTransactionRaw)({
1078
+ amount: "1000",
1079
+ recipient: "TUxd6v64YTWkfpFpNDdtgc5Ps4SfGxwizT",
1080
+ useAllAmount: false,
1081
+ subAccountId: null,
1082
+ networkInfo: {
1083
+ family: "tron",
1084
+ freeNetUsed: "0",
1085
+ freeNetLimit: "600",
1086
+ netUsed: "268",
1087
+ netLimit: "584",
1088
+ energyUsed: "0",
1089
+ energyLimit: "214",
1090
+ },
1091
+ family: "tron",
1092
+ mode: "unDelegateResource",
1093
+ resource: "ENERGY",
1094
+ duration: 3,
1095
+ votes: [],
1096
+ }),
1097
+ expectedStatus: {
1098
+ errors: {
1099
+ recipient: new errors_1.InvalidAddressBecauseDestinationIsAlsoSource(),
1100
+ },
1101
+ warnings: {},
1102
+ amount: (0, bignumber_js_1.BigNumber)("0"),
1103
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
1104
+ totalSpent: (0, bignumber_js_1.BigNumber)("0"),
1105
+ },
1106
+ },
1107
+ {
1108
+ name: "UndelegateResourceError",
1109
+ transaction: (0, transaction_1.fromTransactionRaw)({
1110
+ amount: "1000000000",
1111
+ recipient: "TKc4RbfcDf6MrHXENfRAG23ue8YYgaTh8U",
1112
+ useAllAmount: false,
1113
+ subAccountId: null,
1114
+ networkInfo: {
1115
+ family: "tron",
1116
+ freeNetUsed: "0",
1117
+ freeNetLimit: "600",
1118
+ netUsed: "268",
1119
+ netLimit: "584",
1120
+ energyUsed: "0",
1121
+ energyLimit: "214",
1122
+ },
1123
+ family: "tron",
1124
+ mode: "unDelegateResource",
1125
+ resource: "ENERGY",
1126
+ duration: 3,
1127
+ votes: [],
1128
+ }),
1129
+ expectedStatus: {
1130
+ errors: {
1131
+ resource: new errors_2.TronInvalidUnDelegateResourceAmount(),
1132
+ },
1133
+ warnings: {},
1134
+ amount: (0, bignumber_js_1.BigNumber)("0"),
1135
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
1136
+ totalSpent: (0, bignumber_js_1.BigNumber)("0"),
1137
+ },
1138
+ },
1139
+ {
1140
+ name: "unfreezeLegacyNoFrozenForBandwidth",
1141
+ transaction: (0, transaction_1.fromTransactionRaw)({
1142
+ family: "tron",
1143
+ recipient: "",
1144
+ amount: "1000000",
1145
+ networkInfo: null,
1146
+ mode: "legacyUnfreeze",
1147
+ duration: undefined,
1148
+ resource: "BANDWIDTH",
1149
+ votes: [],
1150
+ }),
1151
+ expectedStatus: {
1152
+ amount: new bignumber_js_1.BigNumber("0"),
1153
+ errors: {
1154
+ resource: new errors_2.TronNoFrozenForBandwidth(),
1155
+ },
1156
+ warnings: {},
1157
+ totalSpent: new bignumber_js_1.BigNumber("0"),
1158
+ estimatedFees: new bignumber_js_1.BigNumber("0"),
1159
+ },
1160
+ },
1161
+ ],
1162
+ FIXME_tests: ["balance is sum of ops"],
1163
+ raw: {
1164
+ id: "js:2:tron:TUxd6v64YTWkfpFpNDdtgc5Ps4SfGxwizT:",
1165
+ seedIdentifier: "0416c02ea5e939eed995f75c44667a66b9c8dfddede8c6d54211f64b1dace9e1c40bcbbd5341480f43a5f37c7ab3a0c53f9cccff57d59bb0368d1e744135d7f68a",
1166
+ name: "Tron 1",
1167
+ used: true,
1168
+ derivationMode: "",
1169
+ index: 0,
1170
+ freshAddress: "TUxd6v64YTWkfpFpNDdtgc5Ps4SfGxwizT",
1171
+ freshAddressPath: "44'/195'/0'/0/0",
1172
+ blockHeight: 57509444,
1173
+ creationDate: "2023-10-31T14:27:27.000Z",
1174
+ operationsCount: 96,
1175
+ operations: [],
1176
+ pendingOperations: [],
1177
+ currencyId: "tron",
1178
+ lastSyncDate: "2023-12-21T12:28:03.177Z",
1179
+ balance: "859005207",
1180
+ spendableBalance: "252128207",
1181
+ subAccounts: [],
1182
+ // @ts-expect-error expected
1183
+ tronResources: {
1184
+ frozen: { bandwidth: { amount: "539000000" }, energy: { amount: "14877000" } },
1185
+ delegatedFrozen: { energy: { amount: "38000000" } },
1186
+ unFrozen: {
1187
+ bandwidth: [{ amount: "1000000", expireTime: "2023-12-20T17:22:36.000Z" }],
1188
+ energy: [
1189
+ { amount: "10000000", expireTime: "2023-12-25T19:24:54.000Z" },
1190
+ { amount: "4000000", expireTime: "2023-12-25T19:25:09.000Z" },
1191
+ ],
1192
+ },
1193
+ legacyFrozen: {},
1194
+ votes: [{ address: "TAQpCTFeJvwdWf6MQZtXXkzWrTS9aymshb", voteCount: 100 }],
1195
+ tronPower: 591,
1196
+ energy: "214",
1197
+ bandwidth: { freeUsed: "0", freeLimit: "600", gainedUsed: "274", gainedLimit: "584" },
1198
+ unwithdrawnReward: "321945",
1199
+ lastWithdrawnRewardDate: "2023-11-24T16:58:09.000Z",
1200
+ lastVotedDate: "2023-12-06T17:24:48.000Z",
1201
+ cacheTransactionInfoById: {},
1202
+ },
1203
+ swapHistory: [],
1204
+ },
1205
+ },
1206
+ {
1207
+ name: "Tron account with only frozen bandwidth",
1208
+ FIXME_tests: ["balance is sum of ops", "pendingOperations are cleaned up"],
1209
+ raw: {
1210
+ id: "js:2:tron:TY2ksFgpvb82TgGPwUSa7iseqPW5weYQyh:",
1211
+ seedIdentifier: "0416c02ea5e939eed995f75c44667a66b9c8dfddede8c6d54211f64b1dace9e1c40bcbbd5341480f43a5f37c7ab3a0c53f9cccff57d59bb0368d1e744135d7f68a",
1212
+ name: "Tron 3",
1213
+ used: true,
1214
+ derivationMode: "",
1215
+ index: 2,
1216
+ freshAddress: "TY2ksFgpvb82TgGPwUSa7iseqPW5weYQyh",
1217
+ freshAddressPath: "44'/195'/2'/0/0",
1218
+ blockHeight: 59127355,
1219
+ creationDate: "2024-02-15T16:36:06.000Z",
1220
+ operationsCount: 3,
1221
+ operations: [],
1222
+ pendingOperations: [],
1223
+ currencyId: "tron",
1224
+ lastSyncDate: "2024-02-15T17:11:40.339Z",
1225
+ balance: "15000004",
1226
+ spendableBalance: "10000004",
1227
+ subAccounts: [],
1228
+ // @ts-expect-error expected
1229
+ tronResources: {
1230
+ frozen: { bandwidth: { amount: "5000000" } },
1231
+ delegatedFrozen: {},
1232
+ unFrozen: { bandwidth: [], energy: [] },
1233
+ legacyFrozen: {},
1234
+ votes: [],
1235
+ tronPower: 5,
1236
+ energy: "0",
1237
+ bandwidth: { freeUsed: "250", freeLimit: "600", gainedUsed: "0", gainedLimit: "5" },
1238
+ unwithdrawnReward: "0",
1239
+ cacheTransactionInfoById: {},
1240
+ },
1241
+ swapHistory: [],
1242
+ },
1243
+ transactions: [
1244
+ {
1245
+ name: "Successful bandwidth unfreeze with no frozen energy",
1246
+ transaction: (0, transaction_1.fromTransactionRaw)({
1247
+ amount: "1000000",
1248
+ recipient: "",
1249
+ useAllAmount: false,
1250
+ subAccountId: null,
1251
+ networkInfo: {
1252
+ family: "tron",
1253
+ freeNetUsed: "250",
1254
+ freeNetLimit: "600",
1255
+ netUsed: "0",
1256
+ netLimit: "5",
1257
+ energyUsed: "0",
1258
+ energyLimit: "0",
1259
+ },
1260
+ family: "tron",
1261
+ mode: "unfreeze",
1262
+ resource: "BANDWIDTH",
1263
+ duration: 3,
1264
+ votes: [],
1265
+ }),
1266
+ expectedStatus: {
1267
+ errors: {},
1268
+ warnings: {},
1269
+ amount: (0, bignumber_js_1.BigNumber)("0"),
1270
+ estimatedFees: (0, bignumber_js_1.BigNumber)("0"),
1271
+ totalSpent: (0, bignumber_js_1.BigNumber)("0"),
1272
+ },
1273
+ },
1274
+ ],
1275
+ },
1276
+ ],
1277
+ };
1278
+ exports.dataset = {
1279
+ implementations: ["tronjs"],
1280
+ currencies: {
1281
+ tron,
1282
+ },
1283
+ };
1284
+ //# sourceMappingURL=bridgeDatasetTest.js.map