@neuraiproject/neurai-rpc 0.4.4 → 0.4.5

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 (1791) hide show
  1. package/DEPIN_EXAMPLES.md +271 -0
  2. package/README.md +49 -4
  3. package/depin.ts +294 -0
  4. package/dist/index.cjs +150 -0
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.mjs +149 -1
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/types.d.ts +61 -1
  9. package/dist/types.d.ts.map +1 -1
  10. package/index.ts +9 -0
  11. package/package.json +1 -1
  12. package/test-depin.ts +187 -0
  13. package/tsconfig.json +26 -0
  14. package/Neurai/.gitattributes +0 -1
  15. package/Neurai/.github/ISSUE_TEMPLATE.md +0 -37
  16. package/Neurai/.github/scripts/00-install-deps.sh +0 -133
  17. package/Neurai/.github/scripts/02-copy-build-dependencies.sh +0 -36
  18. package/Neurai/.github/scripts/03-export-path.sh +0 -26
  19. package/Neurai/.github/scripts/04-configure-build.sh +0 -39
  20. package/Neurai/.github/scripts/05-binary-checks.sh +0 -41
  21. package/Neurai/.github/scripts/06-package.sh +0 -256
  22. package/Neurai/.github/workflows/build-neurai.yml +0 -112
  23. package/Neurai/.pydevproject +0 -5
  24. package/Neurai/.travis.yml +0 -80
  25. package/Neurai/.tx/config +0 -10
  26. package/Neurai/CONTRIBUTING.md +0 -286
  27. package/Neurai/COPYING +0 -22
  28. package/Neurai/INSTALL.md +0 -5
  29. package/Neurai/Makefile.am +0 -313
  30. package/Neurai/README.md +0 -110
  31. package/Neurai/about +0 -35
  32. package/Neurai/assets/asset_metadata_spec.md +0 -99
  33. package/Neurai/assets/tools/README.md +0 -53
  34. package/Neurai/assets/tools/asset_audit.py +0 -179
  35. package/Neurai/assets/tools/blockfacts.py +0 -45
  36. package/Neurai/assets/tools/ipfs_pinner.py +0 -448
  37. package/Neurai/assets/tools/issuebulk.py +0 -162
  38. package/Neurai/assets/tools/signed_promises.py +0 -197
  39. package/Neurai/assets/tools/txfacts.py +0 -120
  40. package/Neurai/autogen.sh +0 -17
  41. package/Neurai/build-aux/m4/ax_boost_base.m4 +0 -291
  42. package/Neurai/build-aux/m4/ax_boost_chrono.m4 +0 -119
  43. package/Neurai/build-aux/m4/ax_boost_filesystem.m4 +0 -119
  44. package/Neurai/build-aux/m4/ax_boost_program_options.m4 +0 -108
  45. package/Neurai/build-aux/m4/ax_boost_system.m4 +0 -122
  46. package/Neurai/build-aux/m4/ax_boost_thread.m4 +0 -150
  47. package/Neurai/build-aux/m4/ax_boost_unit_test_framework.m4 +0 -138
  48. package/Neurai/build-aux/m4/ax_check_compile_flag.m4 +0 -74
  49. package/Neurai/build-aux/m4/ax_check_link_flag.m4 +0 -74
  50. package/Neurai/build-aux/m4/ax_check_preproc_flag.m4 +0 -74
  51. package/Neurai/build-aux/m4/ax_cxx_compile_stdcxx.m4 +0 -951
  52. package/Neurai/build-aux/m4/ax_gcc_func_attribute.m4 +0 -223
  53. package/Neurai/build-aux/m4/ax_pthread.m4 +0 -485
  54. package/Neurai/build-aux/m4/l_atomic.m4 +0 -46
  55. package/Neurai/build-aux/m4/neurai_find_bdb48.m4 +0 -80
  56. package/Neurai/build-aux/m4/neurai_qt.m4 +0 -387
  57. package/Neurai/build-aux/m4/neurai_subdir_to_include.m4 +0 -20
  58. package/Neurai/configure.ac +0 -1359
  59. package/Neurai/contrib/Dockerfile +0 -60
  60. package/Neurai/contrib/README.md +0 -50
  61. package/Neurai/contrib/debian/README.md +0 -21
  62. package/Neurai/contrib/debian/changelog +0 -578
  63. package/Neurai/contrib/debian/compat +0 -1
  64. package/Neurai/contrib/debian/control +0 -70
  65. package/Neurai/contrib/debian/copyright +0 -137
  66. package/Neurai/contrib/debian/examples/neurai.conf +0 -147
  67. package/Neurai/contrib/debian/gbp.conf +0 -5
  68. package/Neurai/contrib/debian/neurai-qt.desktop +0 -13
  69. package/Neurai/contrib/debian/neurai-qt.install +0 -6
  70. package/Neurai/contrib/debian/neurai-qt.lintian-overrides +0 -2
  71. package/Neurai/contrib/debian/neurai-qt.manpages +0 -1
  72. package/Neurai/contrib/debian/neurai-qt.protocol +0 -11
  73. package/Neurai/contrib/debian/neurai-tx.bash-completion +0 -1
  74. package/Neurai/contrib/debian/neurai-tx.install +0 -1
  75. package/Neurai/contrib/debian/neurai-tx.manpages +0 -1
  76. package/Neurai/contrib/debian/neuraid.bash-completion +0 -2
  77. package/Neurai/contrib/debian/neuraid.examples +0 -1
  78. package/Neurai/contrib/debian/neuraid.install +0 -2
  79. package/Neurai/contrib/debian/neuraid.lintian-overrides +0 -2
  80. package/Neurai/contrib/debian/neuraid.manpages +0 -2
  81. package/Neurai/contrib/debian/patches/README +0 -3
  82. package/Neurai/contrib/debian/patches/series +0 -1
  83. package/Neurai/contrib/debian/rules +0 -23
  84. package/Neurai/contrib/debian/source/format +0 -1
  85. package/Neurai/contrib/debian/watch +0 -5
  86. package/Neurai/contrib/devtools/README.md +0 -188
  87. package/Neurai/contrib/devtools/check-doc.py +0 -47
  88. package/Neurai/contrib/devtools/check-rpc-mappings.py +0 -159
  89. package/Neurai/contrib/devtools/clang-format-diff.py +0 -164
  90. package/Neurai/contrib/devtools/commit-script-check.sh +0 -48
  91. package/Neurai/contrib/devtools/copyright_header.py +0 -617
  92. package/Neurai/contrib/devtools/gen-manpages.sh +0 -29
  93. package/Neurai/contrib/devtools/git-subtree-check.sh +0 -79
  94. package/Neurai/contrib/devtools/github-merge.py +0 -330
  95. package/Neurai/contrib/devtools/lint-all.sh +0 -24
  96. package/Neurai/contrib/devtools/lint-whitespace.sh +0 -90
  97. package/Neurai/contrib/devtools/optimize-pngs.py +0 -79
  98. package/Neurai/contrib/devtools/security-check.py +0 -217
  99. package/Neurai/contrib/devtools/split-debug.sh.in +0 -10
  100. package/Neurai/contrib/devtools/symbol-check.py +0 -162
  101. package/Neurai/contrib/devtools/test-security-check.py +0 -63
  102. package/Neurai/contrib/devtools/update-translations.py +0 -208
  103. package/Neurai/contrib/filter-lcov.py +0 -25
  104. package/Neurai/contrib/init/README.md +0 -12
  105. package/Neurai/contrib/init/neuraid.conf +0 -65
  106. package/Neurai/contrib/init/neuraid.init +0 -67
  107. package/Neurai/contrib/init/neuraid.openrc +0 -92
  108. package/Neurai/contrib/init/neuraid.openrcconf +0 -33
  109. package/Neurai/contrib/init/neuraid.service +0 -22
  110. package/Neurai/contrib/init/org.neurai.neuraid.plist +0 -14
  111. package/Neurai/contrib/install_cli.sh +0 -13
  112. package/Neurai/contrib/install_db4.sh +0 -251
  113. package/Neurai/contrib/linearize/README.md +0 -55
  114. package/Neurai/contrib/linearize/example-linearize.cfg +0 -50
  115. package/Neurai/contrib/linearize/linearize-data.py +0 -310
  116. package/Neurai/contrib/linearize/linearize-hashes.py +0 -158
  117. package/Neurai/contrib/macdeploy/LICENSE +0 -674
  118. package/Neurai/contrib/macdeploy/README.md +0 -15
  119. package/Neurai/contrib/macdeploy/background.svg +0 -35
  120. package/Neurai/contrib/macdeploy/custom_dsstore.py +0 -61
  121. package/Neurai/contrib/macdeploy/detached-sig-apply.sh +0 -58
  122. package/Neurai/contrib/macdeploy/detached-sig-create.sh +0 -53
  123. package/Neurai/contrib/macdeploy/extract-osx-sdk.sh +0 -35
  124. package/Neurai/contrib/macdeploy/fancy.plist +0 -32
  125. package/Neurai/contrib/macdeploy/macdeployqtplus +0 -872
  126. package/Neurai/contrib/neurai-cli.bash-completion +0 -156
  127. package/Neurai/contrib/neurai-tx.bash-completion +0 -59
  128. package/Neurai/contrib/neuraid.bash-completion +0 -58
  129. package/Neurai/contrib/qos/README.md +0 -5
  130. package/Neurai/contrib/qos/tc.sh +0 -61
  131. package/Neurai/contrib/rpm/README.md +0 -185
  132. package/Neurai/contrib/rpm/neurai.fc +0 -8
  133. package/Neurai/contrib/rpm/neurai.if +0 -157
  134. package/Neurai/contrib/rpm/neurai.spec +0 -442
  135. package/Neurai/contrib/rpm/neurai.te +0 -81
  136. package/Neurai/contrib/seeds/README.md +0 -19
  137. package/Neurai/contrib/seeds/generate-seeds.py +0 -138
  138. package/Neurai/contrib/seeds/makeseeds.py +0 -173
  139. package/Neurai/contrib/seeds/nodes_main.txt +0 -1
  140. package/Neurai/contrib/seeds/nodes_test.txt +0 -6
  141. package/Neurai/contrib/static-builds/README.md +0 -219
  142. package/Neurai/contrib/static-builds/script.sh +0 -323
  143. package/Neurai/contrib/static-builds/staticbuild.md +0 -483
  144. package/Neurai/contrib/testgen/README.md +0 -8
  145. package/Neurai/contrib/testgen/base58.py +0 -107
  146. package/Neurai/contrib/testgen/gen_base58_test_vectors.py +0 -129
  147. package/Neurai/contrib/tidy_datadir.sh +0 -64
  148. package/Neurai/contrib/verifybinaries/README.md +0 -3
  149. package/Neurai/contrib/verifybinaries/verify.sh +0 -3
  150. package/Neurai/contrib/windeploy/detached-sig-create.sh +0 -36
  151. package/Neurai/contrib/windeploy/win-codesign.cert +0 -99
  152. package/Neurai/contrib/zmq/zmq_sub.py +0 -90
  153. package/Neurai/contrib/zmq/zmq_sub3.4.py +0 -90
  154. package/Neurai/contrib/zmq/zmq_test.py +0 -75
  155. package/Neurai/depends/README.md +0 -84
  156. package/Neurai/depends/builders/darwin.mk +0 -22
  157. package/Neurai/depends/builders/default.mk +0 -20
  158. package/Neurai/depends/builders/linux.mk +0 -2
  159. package/Neurai/depends/config.guess +0 -1466
  160. package/Neurai/depends/config.site.in +0 -119
  161. package/Neurai/depends/config.sub +0 -1836
  162. package/Neurai/depends/description.md +0 -53
  163. package/Neurai/depends/funcs.mk +0 -262
  164. package/Neurai/depends/hosts/darwin.mk +0 -126
  165. package/Neurai/depends/hosts/default.mk +0 -39
  166. package/Neurai/depends/hosts/linux.mk +0 -32
  167. package/Neurai/depends/hosts/mingw32.mk +0 -12
  168. package/Neurai/depends/packages/bdb.mk +0 -31
  169. package/Neurai/depends/packages/boost.mk +0 -45
  170. package/Neurai/depends/packages/dbus.mk +0 -23
  171. package/Neurai/depends/packages/expat.mk +0 -21
  172. package/Neurai/depends/packages/fontconfig.mk +0 -28
  173. package/Neurai/depends/packages/freetype.mk +0 -22
  174. package/Neurai/depends/packages/libICE.mk +0 -23
  175. package/Neurai/depends/packages/libSM.mk +0 -23
  176. package/Neurai/depends/packages/libX11.mk +0 -23
  177. package/Neurai/depends/packages/libXau.mk +0 -23
  178. package/Neurai/depends/packages/libXext.mk +0 -22
  179. package/Neurai/depends/packages/libevent.mk +0 -33
  180. package/Neurai/depends/packages/libxcb.mk +0 -35
  181. package/Neurai/depends/packages/libxkbcommon.mk +0 -32
  182. package/Neurai/depends/packages/miniupnpc.mk +0 -28
  183. package/Neurai/depends/packages/native_b2.mk +0 -20
  184. package/Neurai/depends/packages/native_biplist.mk +0 -20
  185. package/Neurai/depends/packages/native_capnp.mk +0 -18
  186. package/Neurai/depends/packages/native_ccache.mk +0 -25
  187. package/Neurai/depends/packages/native_cctools.mk +0 -38
  188. package/Neurai/depends/packages/native_cdrkit.mk +0 -26
  189. package/Neurai/depends/packages/native_clang.mk +0 -27
  190. package/Neurai/depends/packages/native_ds_store.mk +0 -15
  191. package/Neurai/depends/packages/native_libdmg-hfsplus.mk +0 -24
  192. package/Neurai/depends/packages/native_libtapi.mk +0 -20
  193. package/Neurai/depends/packages/native_mac_alias.mk +0 -18
  194. package/Neurai/depends/packages/native_protobuf.mk +0 -25
  195. package/Neurai/depends/packages/openssl.mk +0 -80
  196. package/Neurai/depends/packages/packages.mk +0 -23
  197. package/Neurai/depends/packages/protobuf.mk +0 -29
  198. package/Neurai/depends/packages/qrencode.mk +0 -22
  199. package/Neurai/depends/packages/qt.mk +0 -285
  200. package/Neurai/depends/packages/xcb_proto.mk +0 -27
  201. package/Neurai/depends/packages/xextproto.mk +0 -21
  202. package/Neurai/depends/packages/xproto.mk +0 -21
  203. package/Neurai/depends/packages/xtrans.mk +0 -22
  204. package/Neurai/depends/packages/zeromq.mk +0 -37
  205. package/Neurai/depends/packages/zlib.mk +0 -27
  206. package/Neurai/depends/packages.md +0 -194
  207. package/Neurai/depends/patches/qt/mac-qmake.conf +0 -26
  208. package/Neurai/doc/Doxyfile.in +0 -2460
  209. package/Neurai/doc/JSON-RPC-interface.md +0 -129
  210. package/Neurai/doc/README.md +0 -594
  211. package/Neurai/doc/README_osx.md +0 -97
  212. package/Neurai/doc/README_windows.txt +0 -23
  213. package/Neurai/doc/REST-interface.md +0 -112
  214. package/Neurai/doc/adr/0001-record-architecture-decisions.md +0 -19
  215. package/Neurai/doc/assets-attribution.md +0 -1
  216. package/Neurai/doc/atomicswaps.md +0 -125
  217. package/Neurai/doc/benchmarking.md +0 -30
  218. package/Neurai/doc/bips.md +0 -35
  219. package/Neurai/doc/bitcoin_logo_doxygen.png +0 -0
  220. package/Neurai/doc/build-docker.md +0 -110
  221. package/Neurai/doc/build-freebsd.md +0 -85
  222. package/Neurai/doc/build-openbsd.md +0 -190
  223. package/Neurai/doc/build-osx.md +0 -136
  224. package/Neurai/doc/build-rasberrypi.md +0 -44
  225. package/Neurai/doc/build-ubuntu.md +0 -287
  226. package/Neurai/doc/build-unix.md +0 -248
  227. package/Neurai/doc/build-windows.md +0 -119
  228. package/Neurai/doc/dependencies.md +0 -43
  229. package/Neurai/doc/developer-notes.md +0 -708
  230. package/Neurai/doc/dnsseed-policy.md +0 -54
  231. package/Neurai/doc/docker/Dockerfile-Linux64-bin +0 -41
  232. package/Neurai/doc/docker/Dockerfile-Node-Linux +0 -53
  233. package/Neurai/doc/docker/Dockerfile-Win64-bin +0 -41
  234. package/Neurai/doc/docker/README.md +0 -5
  235. package/Neurai/doc/files.md +0 -18
  236. package/Neurai/doc/fuzzing.md +0 -72
  237. package/Neurai/doc/init.md +0 -141
  238. package/Neurai/doc/man/Makefile.am +0 -17
  239. package/Neurai/doc/man/neurai-cli.1 +0 -104
  240. package/Neurai/doc/man/neurai-qt.1 +0 -558
  241. package/Neurai/doc/man/neurai-tx.1 +0 -128
  242. package/Neurai/doc/man/neuraid.1 +0 -537
  243. package/Neurai/doc/neurai-conf.md +0 -61
  244. package/Neurai/doc/neurai_logo_doxygen.png +0 -0
  245. package/Neurai/doc/reduce-memory.md +0 -50
  246. package/Neurai/doc/reduce-traffic.md +0 -54
  247. package/Neurai/doc/release-notes/release-notes-0.15.0.1.md +0 -87
  248. package/Neurai/doc/release-notes/release-notes-0.15.0.md +0 -878
  249. package/Neurai/doc/release-notes/release-notes-1.0.0.md +0 -80
  250. package/Neurai/doc/release-notes/release-notes-1.0.2.md +0 -80
  251. package/Neurai/doc/release-notes/release-notes-2.0.4.md +0 -87
  252. package/Neurai/doc/release-notes/release-notes-2.1.0.md +0 -94
  253. package/Neurai/doc/release-notes/release-notes-2.2.2.md +0 -98
  254. package/Neurai/doc/release-notes/release-notes-2.4.0.md +0 -80
  255. package/Neurai/doc/release-notes.md +0 -95
  256. package/Neurai/doc/release-process.md +0 -113
  257. package/Neurai/doc/release_checklist.md +0 -30
  258. package/Neurai/doc/shared-libraries.md +0 -49
  259. package/Neurai/doc/tor.md +0 -125
  260. package/Neurai/doc/translation_process.md +0 -109
  261. package/Neurai/doc/translation_strings_policy.md +0 -109
  262. package/Neurai/doc/zmq.md +0 -114
  263. package/Neurai/img/neurai-title.jpg +0 -0
  264. package/Neurai/libneuraiconsensus.pc.in +0 -11
  265. package/Neurai/scripts/00-install-deps.sh +0 -130
  266. package/Neurai/scripts/02-copy-build-dependencies.sh +0 -68
  267. package/Neurai/scripts/03-export-path.sh +0 -26
  268. package/Neurai/scripts/04-configure-build.sh +0 -39
  269. package/Neurai/scripts/05-binary-checks.sh +0 -41
  270. package/Neurai/scripts/06-package.sh +0 -256
  271. package/Neurai/share/genbuild.sh +0 -54
  272. package/Neurai/share/pixmaps/neurai.BMP +0 -0
  273. package/Neurai/share/pixmaps/neurai.ico +0 -0
  274. package/Neurai/share/pixmaps/neurai.svg +0 -107
  275. package/Neurai/share/pixmaps/neurai128.png +0 -0
  276. package/Neurai/share/pixmaps/neurai128.xpm +0 -818
  277. package/Neurai/share/pixmaps/neurai16.png +0 -0
  278. package/Neurai/share/pixmaps/neurai16.xpm +0 -100
  279. package/Neurai/share/pixmaps/neurai256.png +0 -0
  280. package/Neurai/share/pixmaps/neurai256.xpm +0 -1584
  281. package/Neurai/share/pixmaps/neurai32.png +0 -0
  282. package/Neurai/share/pixmaps/neurai32.xpm +0 -200
  283. package/Neurai/share/pixmaps/neurai64.png +0 -0
  284. package/Neurai/share/pixmaps/neurai64.xpm +0 -301
  285. package/Neurai/share/pixmaps/nsis-header.bmp +0 -0
  286. package/Neurai/share/pixmaps/nsis-wizard.bmp +0 -0
  287. package/Neurai/share/qt/Info.plist.in +0 -109
  288. package/Neurai/share/qt/extract_strings_qt.py +0 -90
  289. package/Neurai/share/rpcuser/README.md +0 -10
  290. package/Neurai/share/rpcuser/rpcuser.py +0 -42
  291. package/Neurai/share/setup.nsi.in +0 -177
  292. package/Neurai/src/.clang-format +0 -51
  293. package/Neurai/src/LibBoolEE.cpp +0 -177
  294. package/Neurai/src/LibBoolEE.h +0 -70
  295. package/Neurai/src/Makefile.am +0 -651
  296. package/Neurai/src/Makefile.bench.include +0 -83
  297. package/Neurai/src/Makefile.leveldb.include +0 -151
  298. package/Neurai/src/Makefile.qt.include +0 -579
  299. package/Neurai/src/Makefile.qttest.include +0 -79
  300. package/Neurai/src/Makefile.test.include +0 -198
  301. package/Neurai/src/addrdb.cpp +0 -148
  302. package/Neurai/src/addrdb.h +0 -104
  303. package/Neurai/src/addressindex.h +0 -409
  304. package/Neurai/src/addrman.cpp +0 -532
  305. package/Neurai/src/addrman.h +0 -607
  306. package/Neurai/src/algo/Lyra2RE.c +0 -110
  307. package/Neurai/src/algo/Lyra2RE.h +0 -15
  308. package/Neurai/src/algo/aes_helper.c +0 -392
  309. package/Neurai/src/algo/blake.c +0 -1120
  310. package/Neurai/src/algo/bmw.c +0 -965
  311. package/Neurai/src/algo/cubehash.c +0 -723
  312. package/Neurai/src/algo/echo.c +0 -1031
  313. package/Neurai/src/algo/extra.c +0 -35
  314. package/Neurai/src/algo/extra.h +0 -4
  315. package/Neurai/src/algo/fugue.c +0 -1208
  316. package/Neurai/src/algo/gost_streebog.c +0 -1023
  317. package/Neurai/src/algo/gost_streebog.h +0 -185
  318. package/Neurai/src/algo/groestl.c +0 -3119
  319. package/Neurai/src/algo/hamsi.c +0 -867
  320. package/Neurai/src/algo/hamsi_helper.c +0 -39648
  321. package/Neurai/src/algo/haval.c +0 -983
  322. package/Neurai/src/algo/haval_helper.c +0 -190
  323. package/Neurai/src/algo/jh.c +0 -1116
  324. package/Neurai/src/algo/keccak.c +0 -1824
  325. package/Neurai/src/algo/luffa.c +0 -1436
  326. package/Neurai/src/algo/lyra2.cpp +0 -382
  327. package/Neurai/src/algo/lyra2.h +0 -44
  328. package/Neurai/src/algo/md_helper.c +0 -347
  329. package/Neurai/src/algo/sha2.c +0 -550
  330. package/Neurai/src/algo/shabal.c +0 -806
  331. package/Neurai/src/algo/shavite.c +0 -1764
  332. package/Neurai/src/algo/simd.c +0 -1799
  333. package/Neurai/src/algo/skein.c +0 -1254
  334. package/Neurai/src/algo/sph_blake.h +0 -327
  335. package/Neurai/src/algo/sph_bmw.h +0 -328
  336. package/Neurai/src/algo/sph_cubehash.h +0 -292
  337. package/Neurai/src/algo/sph_echo.h +0 -320
  338. package/Neurai/src/algo/sph_fugue.h +0 -81
  339. package/Neurai/src/algo/sph_groestl.h +0 -329
  340. package/Neurai/src/algo/sph_hamsi.h +0 -321
  341. package/Neurai/src/algo/sph_haval.h +0 -976
  342. package/Neurai/src/algo/sph_jh.h +0 -298
  343. package/Neurai/src/algo/sph_keccak.h +0 -293
  344. package/Neurai/src/algo/sph_luffa.h +0 -296
  345. package/Neurai/src/algo/sph_md_helper.c +0 -352
  346. package/Neurai/src/algo/sph_sha2.c +0 -690
  347. package/Neurai/src/algo/sph_sha2.h +0 -379
  348. package/Neurai/src/algo/sph_sha2big.c +0 -255
  349. package/Neurai/src/algo/sph_shabal.h +0 -344
  350. package/Neurai/src/algo/sph_shavite.h +0 -314
  351. package/Neurai/src/algo/sph_simd.h +0 -309
  352. package/Neurai/src/algo/sph_skein.h +0 -298
  353. package/Neurai/src/algo/sph_tiger.h +0 -191
  354. package/Neurai/src/algo/sph_types.h +0 -1976
  355. package/Neurai/src/algo/sph_whirlpool.h +0 -218
  356. package/Neurai/src/algo/sponge.cpp +0 -745
  357. package/Neurai/src/algo/sponge.h +0 -108
  358. package/Neurai/src/algo/tiger.cpp +0 -697
  359. package/Neurai/src/algo/whirlpool.c +0 -3480
  360. package/Neurai/src/amount.h +0 -31
  361. package/Neurai/src/arith_uint256.cpp +0 -264
  362. package/Neurai/src/arith_uint256.h +0 -298
  363. package/Neurai/src/assets/assetdb.cpp +0 -395
  364. package/Neurai/src/assets/assetdb.h +0 -99
  365. package/Neurai/src/assets/assets.cpp +0 -5938
  366. package/Neurai/src/assets/assets.h +0 -620
  367. package/Neurai/src/assets/assetsnapshotdb.cpp +0 -151
  368. package/Neurai/src/assets/assetsnapshotdb.h +0 -78
  369. package/Neurai/src/assets/assettypes.cpp +0 -31
  370. package/Neurai/src/assets/assettypes.h +0 -689
  371. package/Neurai/src/assets/messages.cpp +0 -346
  372. package/Neurai/src/assets/messages.h +0 -143
  373. package/Neurai/src/assets/myassetsdb.cpp +0 -344
  374. package/Neurai/src/assets/myassetsdb.h +0 -82
  375. package/Neurai/src/assets/restricteddb.cpp +0 -257
  376. package/Neurai/src/assets/restricteddb.h +0 -64
  377. package/Neurai/src/assets/rewards.cpp +0 -395
  378. package/Neurai/src/assets/rewards.h +0 -171
  379. package/Neurai/src/assets/snapshotrequestdb.cpp +0 -236
  380. package/Neurai/src/assets/snapshotrequestdb.h +0 -117
  381. package/Neurai/src/base58.cpp +0 -347
  382. package/Neurai/src/base58.h +0 -174
  383. package/Neurai/src/bench/Examples.cpp +0 -36
  384. package/Neurai/src/bench/base58.cpp +0 -61
  385. package/Neurai/src/bench/bench.cpp +0 -106
  386. package/Neurai/src/bench/bench.h +0 -82
  387. package/Neurai/src/bench/bench_neurai.cpp +0 -29
  388. package/Neurai/src/bench/ccoins_caching.cpp +0 -88
  389. package/Neurai/src/bench/checkblock.cpp +0 -59
  390. package/Neurai/src/bench/checkqueue.cpp +0 -105
  391. package/Neurai/src/bench/coin_selection.cpp +0 -60
  392. package/Neurai/src/bench/crypto_hash.cpp +0 -105
  393. package/Neurai/src/bench/data/block566553.raw +0 -0
  394. package/Neurai/src/bench/lockedpool.cpp +0 -49
  395. package/Neurai/src/bench/mempool_eviction.cpp +0 -116
  396. package/Neurai/src/bench/perf.cpp +0 -55
  397. package/Neurai/src/bench/perf.h +0 -39
  398. package/Neurai/src/bench/prevector_destructor.cpp +0 -38
  399. package/Neurai/src/bench/rollingbloom.cpp +0 -45
  400. package/Neurai/src/bench/verify_script.cpp +0 -110
  401. package/Neurai/src/blockencodings.cpp +0 -231
  402. package/Neurai/src/blockencodings.h +0 -239
  403. package/Neurai/src/bloom.cpp +0 -313
  404. package/Neurai/src/bloom.h +0 -145
  405. package/Neurai/src/chain.cpp +0 -171
  406. package/Neurai/src/chain.h +0 -524
  407. package/Neurai/src/chainparams.cpp +0 -635
  408. package/Neurai/src/chainparams.h +0 -241
  409. package/Neurai/src/chainparamsbase.cpp +0 -104
  410. package/Neurai/src/chainparamsbase.h +0 -65
  411. package/Neurai/src/chainparamsseeds.h +0 -15
  412. package/Neurai/src/checkpoints.cpp +0 -34
  413. package/Neurai/src/checkpoints.h +0 -29
  414. package/Neurai/src/checkqueue.h +0 -219
  415. package/Neurai/src/clientversion.cpp +0 -104
  416. package/Neurai/src/clientversion.h +0 -55
  417. package/Neurai/src/coins.cpp +0 -539
  418. package/Neurai/src/coins.h +0 -322
  419. package/Neurai/src/compat/byteswap.h +0 -68
  420. package/Neurai/src/compat/endian.h +0 -198
  421. package/Neurai/src/compat/glibc_compat.cpp +0 -76
  422. package/Neurai/src/compat/glibc_sanity.cpp +0 -70
  423. package/Neurai/src/compat/glibcxx_sanity.cpp +0 -63
  424. package/Neurai/src/compat/sanity.h +0 -13
  425. package/Neurai/src/compat/strnlen.cpp +0 -20
  426. package/Neurai/src/compat.h +0 -105
  427. package/Neurai/src/compressor.cpp +0 -187
  428. package/Neurai/src/compressor.h +0 -123
  429. package/Neurai/src/config/.empty +0 -0
  430. package/Neurai/src/consensus/consensus.cpp +0 -29
  431. package/Neurai/src/consensus/consensus.h +0 -55
  432. package/Neurai/src/consensus/merkle.cpp +0 -189
  433. package/Neurai/src/consensus/merkle.h +0 -40
  434. package/Neurai/src/consensus/params.h +0 -84
  435. package/Neurai/src/consensus/tx_verify.cpp +0 -900
  436. package/Neurai/src/consensus/tx_verify.h +0 -93
  437. package/Neurai/src/consensus/validation.h +0 -121
  438. package/Neurai/src/core_io.h +0 -40
  439. package/Neurai/src/core_memusage.h +0 -73
  440. package/Neurai/src/core_read.cpp +0 -191
  441. package/Neurai/src/core_write.cpp +0 -331
  442. package/Neurai/src/crypto/aes.cpp +0 -218
  443. package/Neurai/src/crypto/aes.h +0 -120
  444. package/Neurai/src/crypto/aes_helper.c +0 -392
  445. package/Neurai/src/crypto/blake.c +0 -1120
  446. package/Neurai/src/crypto/bmw.c +0 -965
  447. package/Neurai/src/crypto/chacha20.cpp +0 -182
  448. package/Neurai/src/crypto/chacha20.h +0 -28
  449. package/Neurai/src/crypto/common.h +0 -105
  450. package/Neurai/src/crypto/ctaes/COPYING +0 -21
  451. package/Neurai/src/crypto/ctaes/README.md +0 -41
  452. package/Neurai/src/crypto/ctaes/bench.c +0 -170
  453. package/Neurai/src/crypto/ctaes/ctaes.c +0 -556
  454. package/Neurai/src/crypto/ctaes/ctaes.h +0 -41
  455. package/Neurai/src/crypto/ctaes/test.c +0 -110
  456. package/Neurai/src/crypto/cubehash.c +0 -723
  457. package/Neurai/src/crypto/echo.c +0 -1031
  458. package/Neurai/src/crypto/ethash/helpers.hpp +0 -54
  459. package/Neurai/src/crypto/ethash/include/ethash/ethash.h +0 -131
  460. package/Neurai/src/crypto/ethash/include/ethash/ethash.hpp +0 -172
  461. package/Neurai/src/crypto/ethash/include/ethash/hash_types.h +0 -50
  462. package/Neurai/src/crypto/ethash/include/ethash/hash_types.hpp +0 -15
  463. package/Neurai/src/crypto/ethash/include/ethash/keccak.h +0 -49
  464. package/Neurai/src/crypto/ethash/include/ethash/keccak.hpp +0 -35
  465. package/Neurai/src/crypto/ethash/include/ethash/progpow.hpp +0 -49
  466. package/Neurai/src/crypto/ethash/include/ethash/version.h +0 -18
  467. package/Neurai/src/crypto/ethash/lib/ethash/bit_manipulation.h +0 -81
  468. package/Neurai/src/crypto/ethash/lib/ethash/builtins.h +0 -43
  469. package/Neurai/src/crypto/ethash/lib/ethash/endianness.hpp +0 -106
  470. package/Neurai/src/crypto/ethash/lib/ethash/ethash-internal.hpp +0 -68
  471. package/Neurai/src/crypto/ethash/lib/ethash/ethash.cpp +0 -442
  472. package/Neurai/src/crypto/ethash/lib/ethash/kiss99.hpp +0 -64
  473. package/Neurai/src/crypto/ethash/lib/ethash/managed.cpp +0 -100
  474. package/Neurai/src/crypto/ethash/lib/ethash/primes.c +0 -43
  475. package/Neurai/src/crypto/ethash/lib/ethash/primes.h +0 -25
  476. package/Neurai/src/crypto/ethash/lib/ethash/progpow.cpp +0 -581
  477. package/Neurai/src/crypto/ethash/lib/keccak/keccak.c +0 -129
  478. package/Neurai/src/crypto/ethash/lib/keccak/keccakf1600.c +0 -255
  479. package/Neurai/src/crypto/ethash/lib/keccak/keccakf800.c +0 -253
  480. package/Neurai/src/crypto/ethash/lib/support/attributes.h +0 -33
  481. package/Neurai/src/crypto/ethash/progpow_test_vectors.hpp +0 -64
  482. package/Neurai/src/crypto/groestl.c +0 -3123
  483. package/Neurai/src/crypto/hmac_sha256.cpp +0 -36
  484. package/Neurai/src/crypto/hmac_sha256.h +0 -34
  485. package/Neurai/src/crypto/hmac_sha512.cpp +0 -36
  486. package/Neurai/src/crypto/hmac_sha512.h +0 -34
  487. package/Neurai/src/crypto/jh.c +0 -1116
  488. package/Neurai/src/crypto/keccak.c +0 -1824
  489. package/Neurai/src/crypto/luffa.c +0 -1426
  490. package/Neurai/src/crypto/md_helper.c +0 -346
  491. package/Neurai/src/crypto/ripemd160.cpp +0 -294
  492. package/Neurai/src/crypto/ripemd160.h +0 -30
  493. package/Neurai/src/crypto/sha1.cpp +0 -201
  494. package/Neurai/src/crypto/sha1.h +0 -30
  495. package/Neurai/src/crypto/sha2.c +0 -646
  496. package/Neurai/src/crypto/sha256.cpp +0 -251
  497. package/Neurai/src/crypto/sha256.h +0 -36
  498. package/Neurai/src/crypto/sha256_sse4.cpp +0 -1508
  499. package/Neurai/src/crypto/sha512.cpp +0 -209
  500. package/Neurai/src/crypto/sha512.h +0 -30
  501. package/Neurai/src/crypto/shavite.c +0 -1764
  502. package/Neurai/src/crypto/simd.c +0 -1799
  503. package/Neurai/src/crypto/skein.c +0 -1254
  504. package/Neurai/src/crypto/sph_blake.h +0 -327
  505. package/Neurai/src/crypto/sph_bmw.h +0 -328
  506. package/Neurai/src/crypto/sph_cubehash.h +0 -292
  507. package/Neurai/src/crypto/sph_echo.h +0 -320
  508. package/Neurai/src/crypto/sph_fugue.c +0 -1208
  509. package/Neurai/src/crypto/sph_fugue.h +0 -81
  510. package/Neurai/src/crypto/sph_groestl.h +0 -329
  511. package/Neurai/src/crypto/sph_hamsi.c +0 -867
  512. package/Neurai/src/crypto/sph_hamsi.h +0 -321
  513. package/Neurai/src/crypto/sph_hamsi_helper.c +0 -39648
  514. package/Neurai/src/crypto/sph_jh.h +0 -298
  515. package/Neurai/src/crypto/sph_keccak.h +0 -293
  516. package/Neurai/src/crypto/sph_luffa.h +0 -296
  517. package/Neurai/src/crypto/sph_sha2.c +0 -701
  518. package/Neurai/src/crypto/sph_sha2.h +0 -378
  519. package/Neurai/src/crypto/sph_sha512.c +0 -247
  520. package/Neurai/src/crypto/sph_shabal.c +0 -808
  521. package/Neurai/src/crypto/sph_shabal.h +0 -343
  522. package/Neurai/src/crypto/sph_shavite.h +0 -314
  523. package/Neurai/src/crypto/sph_simd.h +0 -309
  524. package/Neurai/src/crypto/sph_skein.h +0 -298
  525. package/Neurai/src/crypto/sph_types.h +0 -1976
  526. package/Neurai/src/crypto/sph_whirlpool.c +0 -3481
  527. package/Neurai/src/crypto/sph_whirlpool.h +0 -217
  528. package/Neurai/src/crypto/whirlpool.c +0 -104
  529. package/Neurai/src/crypto/whirlpoolx.c +0 -69
  530. package/Neurai/src/cuckoocache.h +0 -481
  531. package/Neurai/src/dbwrapper.cpp +0 -246
  532. package/Neurai/src/dbwrapper.h +0 -345
  533. package/Neurai/src/depinecies.cpp +0 -406
  534. package/Neurai/src/depinecies.h +0 -162
  535. package/Neurai/src/depinmcpclient.cpp +0 -380
  536. package/Neurai/src/depinmcpclient.h +0 -101
  537. package/Neurai/src/depinmcpworker.cpp +0 -654
  538. package/Neurai/src/depinmcpworker.h +0 -205
  539. package/Neurai/src/depinmsgpool.cpp +0 -908
  540. package/Neurai/src/depinmsgpool.h +0 -182
  541. package/Neurai/src/depinmsgpoolnet.cpp +0 -1149
  542. package/Neurai/src/depinmsgpoolnet.h +0 -148
  543. package/Neurai/src/fs.cpp +0 -15
  544. package/Neurai/src/fs.h +0 -29
  545. package/Neurai/src/hash.cpp +0 -294
  546. package/Neurai/src/hash.h +0 -613
  547. package/Neurai/src/httprpc.cpp +0 -262
  548. package/Neurai/src/httprpc.h +0 -37
  549. package/Neurai/src/httpserver.cpp +0 -685
  550. package/Neurai/src/httpserver.h +0 -155
  551. package/Neurai/src/indirectmap.h +0 -58
  552. package/Neurai/src/init.cpp +0 -2122
  553. package/Neurai/src/init.h +0 -85
  554. package/Neurai/src/key.cpp +0 -317
  555. package/Neurai/src/key.h +0 -188
  556. package/Neurai/src/keystore.cpp +0 -146
  557. package/Neurai/src/keystore.h +0 -120
  558. package/Neurai/src/leveldb/.travis.yml +0 -13
  559. package/Neurai/src/leveldb/AUTHORS +0 -12
  560. package/Neurai/src/leveldb/CONTRIBUTING.md +0 -36
  561. package/Neurai/src/leveldb/LICENSE +0 -27
  562. package/Neurai/src/leveldb/Makefile +0 -424
  563. package/Neurai/src/leveldb/NEWS +0 -17
  564. package/Neurai/src/leveldb/README.md +0 -174
  565. package/Neurai/src/leveldb/TODO +0 -14
  566. package/Neurai/src/leveldb/WINDOWS.md +0 -39
  567. package/Neurai/src/leveldb/build_detect_platform +0 -259
  568. package/Neurai/src/leveldb/db/autocompact_test.cc +0 -118
  569. package/Neurai/src/leveldb/db/builder.cc +0 -88
  570. package/Neurai/src/leveldb/db/builder.h +0 -34
  571. package/Neurai/src/leveldb/db/c.cc +0 -595
  572. package/Neurai/src/leveldb/db/c_test.c +0 -390
  573. package/Neurai/src/leveldb/db/corruption_test.cc +0 -374
  574. package/Neurai/src/leveldb/db/db_bench.cc +0 -1020
  575. package/Neurai/src/leveldb/db/db_impl.cc +0 -1568
  576. package/Neurai/src/leveldb/db/db_impl.h +0 -211
  577. package/Neurai/src/leveldb/db/db_iter.cc +0 -317
  578. package/Neurai/src/leveldb/db/db_iter.h +0 -28
  579. package/Neurai/src/leveldb/db/db_test.cc +0 -2158
  580. package/Neurai/src/leveldb/db/dbformat.cc +0 -140
  581. package/Neurai/src/leveldb/db/dbformat.h +0 -230
  582. package/Neurai/src/leveldb/db/dbformat_test.cc +0 -112
  583. package/Neurai/src/leveldb/db/dumpfile.cc +0 -225
  584. package/Neurai/src/leveldb/db/fault_injection_test.cc +0 -554
  585. package/Neurai/src/leveldb/db/filename.cc +0 -144
  586. package/Neurai/src/leveldb/db/filename.h +0 -85
  587. package/Neurai/src/leveldb/db/filename_test.cc +0 -123
  588. package/Neurai/src/leveldb/db/leveldbutil.cc +0 -64
  589. package/Neurai/src/leveldb/db/log_format.h +0 -35
  590. package/Neurai/src/leveldb/db/log_reader.cc +0 -284
  591. package/Neurai/src/leveldb/db/log_reader.h +0 -113
  592. package/Neurai/src/leveldb/db/log_test.cc +0 -591
  593. package/Neurai/src/leveldb/db/log_writer.cc +0 -112
  594. package/Neurai/src/leveldb/db/log_writer.h +0 -54
  595. package/Neurai/src/leveldb/db/memtable.cc +0 -145
  596. package/Neurai/src/leveldb/db/memtable.h +0 -88
  597. package/Neurai/src/leveldb/db/recovery_test.cc +0 -324
  598. package/Neurai/src/leveldb/db/repair.cc +0 -461
  599. package/Neurai/src/leveldb/db/skiplist.h +0 -384
  600. package/Neurai/src/leveldb/db/skiplist_test.cc +0 -378
  601. package/Neurai/src/leveldb/db/snapshot.h +0 -67
  602. package/Neurai/src/leveldb/db/table_cache.cc +0 -127
  603. package/Neurai/src/leveldb/db/table_cache.h +0 -61
  604. package/Neurai/src/leveldb/db/version_edit.cc +0 -266
  605. package/Neurai/src/leveldb/db/version_edit.h +0 -107
  606. package/Neurai/src/leveldb/db/version_edit_test.cc +0 -46
  607. package/Neurai/src/leveldb/db/version_set.cc +0 -1535
  608. package/Neurai/src/leveldb/db/version_set.h +0 -398
  609. package/Neurai/src/leveldb/db/version_set_test.cc +0 -179
  610. package/Neurai/src/leveldb/db/write_batch.cc +0 -147
  611. package/Neurai/src/leveldb/db/write_batch_internal.h +0 -50
  612. package/Neurai/src/leveldb/db/write_batch_test.cc +0 -120
  613. package/Neurai/src/leveldb/doc/bench/db_bench_sqlite3.cc +0 -718
  614. package/Neurai/src/leveldb/doc/bench/db_bench_tree_db.cc +0 -528
  615. package/Neurai/src/leveldb/doc/benchmark.html +0 -459
  616. package/Neurai/src/leveldb/doc/impl.md +0 -170
  617. package/Neurai/src/leveldb/doc/index.md +0 -523
  618. package/Neurai/src/leveldb/doc/log_format.md +0 -75
  619. package/Neurai/src/leveldb/doc/table_format.md +0 -107
  620. package/Neurai/src/leveldb/helpers/memenv/memenv.cc +0 -398
  621. package/Neurai/src/leveldb/helpers/memenv/memenv.h +0 -20
  622. package/Neurai/src/leveldb/helpers/memenv/memenv_test.cc +0 -241
  623. package/Neurai/src/leveldb/include/leveldb/c.h +0 -290
  624. package/Neurai/src/leveldb/include/leveldb/cache.h +0 -110
  625. package/Neurai/src/leveldb/include/leveldb/comparator.h +0 -63
  626. package/Neurai/src/leveldb/include/leveldb/db.h +0 -163
  627. package/Neurai/src/leveldb/include/leveldb/dumpfile.h +0 -25
  628. package/Neurai/src/leveldb/include/leveldb/env.h +0 -351
  629. package/Neurai/src/leveldb/include/leveldb/filter_policy.h +0 -70
  630. package/Neurai/src/leveldb/include/leveldb/iterator.h +0 -100
  631. package/Neurai/src/leveldb/include/leveldb/options.h +0 -213
  632. package/Neurai/src/leveldb/include/leveldb/slice.h +0 -109
  633. package/Neurai/src/leveldb/include/leveldb/status.h +0 -112
  634. package/Neurai/src/leveldb/include/leveldb/table.h +0 -85
  635. package/Neurai/src/leveldb/include/leveldb/table_builder.h +0 -92
  636. package/Neurai/src/leveldb/include/leveldb/write_batch.h +0 -64
  637. package/Neurai/src/leveldb/issues/issue178_test.cc +0 -92
  638. package/Neurai/src/leveldb/issues/issue200_test.cc +0 -59
  639. package/Neurai/src/leveldb/port/README +0 -10
  640. package/Neurai/src/leveldb/port/atomic_pointer.h +0 -245
  641. package/Neurai/src/leveldb/port/port.h +0 -21
  642. package/Neurai/src/leveldb/port/port_example.h +0 -145
  643. package/Neurai/src/leveldb/port/port_posix.cc +0 -68
  644. package/Neurai/src/leveldb/port/port_posix.h +0 -161
  645. package/Neurai/src/leveldb/port/port_posix_sse.cc +0 -110
  646. package/Neurai/src/leveldb/port/port_win.cc +0 -158
  647. package/Neurai/src/leveldb/port/port_win.h +0 -177
  648. package/Neurai/src/leveldb/port/thread_annotations.h +0 -60
  649. package/Neurai/src/leveldb/port/win/stdint.h +0 -24
  650. package/Neurai/src/leveldb/table/block.cc +0 -268
  651. package/Neurai/src/leveldb/table/block.h +0 -44
  652. package/Neurai/src/leveldb/table/block_builder.cc +0 -109
  653. package/Neurai/src/leveldb/table/block_builder.h +0 -57
  654. package/Neurai/src/leveldb/table/filter_block.cc +0 -111
  655. package/Neurai/src/leveldb/table/filter_block.h +0 -68
  656. package/Neurai/src/leveldb/table/filter_block_test.cc +0 -128
  657. package/Neurai/src/leveldb/table/format.cc +0 -144
  658. package/Neurai/src/leveldb/table/format.h +0 -108
  659. package/Neurai/src/leveldb/table/iterator.cc +0 -67
  660. package/Neurai/src/leveldb/table/iterator_wrapper.h +0 -66
  661. package/Neurai/src/leveldb/table/merger.cc +0 -197
  662. package/Neurai/src/leveldb/table/merger.h +0 -26
  663. package/Neurai/src/leveldb/table/table.cc +0 -285
  664. package/Neurai/src/leveldb/table/table_builder.cc +0 -270
  665. package/Neurai/src/leveldb/table/table_test.cc +0 -876
  666. package/Neurai/src/leveldb/table/two_level_iterator.cc +0 -182
  667. package/Neurai/src/leveldb/table/two_level_iterator.h +0 -34
  668. package/Neurai/src/leveldb/util/arena.cc +0 -68
  669. package/Neurai/src/leveldb/util/arena.h +0 -68
  670. package/Neurai/src/leveldb/util/arena_test.cc +0 -68
  671. package/Neurai/src/leveldb/util/bloom.cc +0 -95
  672. package/Neurai/src/leveldb/util/bloom_test.cc +0 -162
  673. package/Neurai/src/leveldb/util/cache.cc +0 -405
  674. package/Neurai/src/leveldb/util/cache_test.cc +0 -226
  675. package/Neurai/src/leveldb/util/coding.cc +0 -194
  676. package/Neurai/src/leveldb/util/coding.h +0 -104
  677. package/Neurai/src/leveldb/util/coding_test.cc +0 -196
  678. package/Neurai/src/leveldb/util/comparator.cc +0 -81
  679. package/Neurai/src/leveldb/util/crc32c.cc +0 -354
  680. package/Neurai/src/leveldb/util/crc32c.h +0 -45
  681. package/Neurai/src/leveldb/util/crc32c_test.cc +0 -72
  682. package/Neurai/src/leveldb/util/env.cc +0 -100
  683. package/Neurai/src/leveldb/util/env_posix.cc +0 -698
  684. package/Neurai/src/leveldb/util/env_posix_test.cc +0 -66
  685. package/Neurai/src/leveldb/util/env_posix_test_helper.h +0 -28
  686. package/Neurai/src/leveldb/util/env_test.cc +0 -106
  687. package/Neurai/src/leveldb/util/env_win.cc +0 -898
  688. package/Neurai/src/leveldb/util/filter_policy.cc +0 -11
  689. package/Neurai/src/leveldb/util/hash.cc +0 -52
  690. package/Neurai/src/leveldb/util/hash.h +0 -19
  691. package/Neurai/src/leveldb/util/hash_test.cc +0 -54
  692. package/Neurai/src/leveldb/util/histogram.cc +0 -139
  693. package/Neurai/src/leveldb/util/histogram.h +0 -42
  694. package/Neurai/src/leveldb/util/logging.cc +0 -72
  695. package/Neurai/src/leveldb/util/logging.h +0 -43
  696. package/Neurai/src/leveldb/util/mutexlock.h +0 -41
  697. package/Neurai/src/leveldb/util/options.cc +0 -30
  698. package/Neurai/src/leveldb/util/posix_logger.h +0 -98
  699. package/Neurai/src/leveldb/util/random.h +0 -64
  700. package/Neurai/src/leveldb/util/status.cc +0 -75
  701. package/Neurai/src/leveldb/util/testharness.cc +0 -77
  702. package/Neurai/src/leveldb/util/testharness.h +0 -138
  703. package/Neurai/src/leveldb/util/testutil.cc +0 -51
  704. package/Neurai/src/leveldb/util/testutil.h +0 -63
  705. package/Neurai/src/limitedmap.h +0 -102
  706. package/Neurai/src/memusage.h +0 -171
  707. package/Neurai/src/merkleblock.cpp +0 -166
  708. package/Neurai/src/merkleblock.h +0 -169
  709. package/Neurai/src/miner.cpp +0 -731
  710. package/Neurai/src/miner.h +0 -211
  711. package/Neurai/src/net.cpp +0 -2944
  712. package/Neurai/src/net.h +0 -888
  713. package/Neurai/src/net_processing.cpp +0 -3803
  714. package/Neurai/src/net_processing.h +0 -86
  715. package/Neurai/src/netaddress.cpp +0 -740
  716. package/Neurai/src/netaddress.h +0 -179
  717. package/Neurai/src/netbase.cpp +0 -738
  718. package/Neurai/src/netbase.h +0 -72
  719. package/Neurai/src/netmessagemaker.h +0 -38
  720. package/Neurai/src/neurai-cli-res.rc +0 -35
  721. package/Neurai/src/neurai-cli.cpp +0 -518
  722. package/Neurai/src/neurai-tx-res.rc +0 -35
  723. package/Neurai/src/neurai-tx.cpp +0 -875
  724. package/Neurai/src/neuraid-res.rc +0 -35
  725. package/Neurai/src/neuraid.cpp +0 -204
  726. package/Neurai/src/noui.cpp +0 -60
  727. package/Neurai/src/noui.h +0 -12
  728. package/Neurai/src/policy/feerate.cpp +0 -45
  729. package/Neurai/src/policy/feerate.h +0 -61
  730. package/Neurai/src/policy/fees.cpp +0 -1074
  731. package/Neurai/src/policy/fees.h +0 -305
  732. package/Neurai/src/policy/policy.cpp +0 -274
  733. package/Neurai/src/policy/policy.h +0 -108
  734. package/Neurai/src/policy/rbf.cpp +0 -49
  735. package/Neurai/src/policy/rbf.h +0 -30
  736. package/Neurai/src/pow.cpp +0 -199
  737. package/Neurai/src/pow.h +0 -25
  738. package/Neurai/src/prevector.h +0 -519
  739. package/Neurai/src/primitives/block.cpp +0 -161
  740. package/Neurai/src/primitives/block.h +0 -235
  741. package/Neurai/src/primitives/transaction.cpp +0 -134
  742. package/Neurai/src/primitives/transaction.h +0 -440
  743. package/Neurai/src/protocol.cpp +0 -216
  744. package/Neurai/src/protocol.h +0 -446
  745. package/Neurai/src/pubkey.cpp +0 -301
  746. package/Neurai/src/pubkey.h +0 -252
  747. package/Neurai/src/pubkeyindex.h +0 -76
  748. package/Neurai/src/qt/addressbookpage.cpp +0 -315
  749. package/Neurai/src/qt/addressbookpage.h +0 -88
  750. package/Neurai/src/qt/addresstablemodel.cpp +0 -443
  751. package/Neurai/src/qt/addresstablemodel.h +0 -97
  752. package/Neurai/src/qt/askpassphrasedialog.cpp +0 -277
  753. package/Neurai/src/qt/askpassphrasedialog.h +0 -54
  754. package/Neurai/src/qt/assetcontroldialog.cpp +0 -827
  755. package/Neurai/src/qt/assetcontroldialog.h +0 -129
  756. package/Neurai/src/qt/assetcontroltreewidget.cpp +0 -36
  757. package/Neurai/src/qt/assetcontroltreewidget.h +0 -24
  758. package/Neurai/src/qt/assetfilterproxy.cpp +0 -43
  759. package/Neurai/src/qt/assetfilterproxy.h +0 -30
  760. package/Neurai/src/qt/assetrecord.h +0 -56
  761. package/Neurai/src/qt/assetsdialog.cpp +0 -1068
  762. package/Neurai/src/qt/assetsdialog.h +0 -122
  763. package/Neurai/src/qt/assettablemodel.cpp +0 -274
  764. package/Neurai/src/qt/assettablemodel.h +0 -73
  765. package/Neurai/src/qt/bantablemodel.cpp +0 -184
  766. package/Neurai/src/qt/bantablemodel.h +0 -75
  767. package/Neurai/src/qt/callback.h +0 -30
  768. package/Neurai/src/qt/clientmodel.cpp +0 -342
  769. package/Neurai/src/qt/clientmodel.h +0 -121
  770. package/Neurai/src/qt/coincontroldialog.cpp +0 -738
  771. package/Neurai/src/qt/coincontroldialog.h +0 -114
  772. package/Neurai/src/qt/coincontroltreewidget.cpp +0 -36
  773. package/Neurai/src/qt/coincontroltreewidget.h +0 -24
  774. package/Neurai/src/qt/createassetdialog.cpp +0 -1600
  775. package/Neurai/src/qt/createassetdialog.h +0 -158
  776. package/Neurai/src/qt/csvmodelwriter.cpp +0 -93
  777. package/Neurai/src/qt/csvmodelwriter.h +0 -48
  778. package/Neurai/src/qt/currencyunits.h +0 -33
  779. package/Neurai/src/qt/darkstyle.cpp +0 -90
  780. package/Neurai/src/qt/darkstyle.h +0 -40
  781. package/Neurai/src/qt/editaddressdialog.cpp +0 -146
  782. package/Neurai/src/qt/editaddressdialog.h +0 -59
  783. package/Neurai/src/qt/forms/addressbookpage.ui +0 -159
  784. package/Neurai/src/qt/forms/askpassphrasedialog.ui +0 -160
  785. package/Neurai/src/qt/forms/assetcontroldialog.ui +0 -517
  786. package/Neurai/src/qt/forms/assetsdialog.ui +0 -1305
  787. package/Neurai/src/qt/forms/coincontroldialog.ui +0 -495
  788. package/Neurai/src/qt/forms/createassetdialog.ui +0 -1466
  789. package/Neurai/src/qt/forms/debugwindow.ui +0 -1598
  790. package/Neurai/src/qt/forms/editaddressdialog.ui +0 -112
  791. package/Neurai/src/qt/forms/helpmessagedialog.ui +0 -189
  792. package/Neurai/src/qt/forms/intro.ui +0 -293
  793. package/Neurai/src/qt/forms/mnemonicdialog1.ui +0 -156
  794. package/Neurai/src/qt/forms/mnemonicdialog2.ui +0 -353
  795. package/Neurai/src/qt/forms/mnemonicdialog3.ui +0 -376
  796. package/Neurai/src/qt/forms/modaloverlay.ui +0 -383
  797. package/Neurai/src/qt/forms/openuridialog.ui +0 -118
  798. package/Neurai/src/qt/forms/optionsdialog.ui +0 -923
  799. package/Neurai/src/qt/forms/overviewpage.ui +0 -845
  800. package/Neurai/src/qt/forms/receivecoinsdialog.ui +0 -344
  801. package/Neurai/src/qt/forms/receiverequestdialog.ui +0 -168
  802. package/Neurai/src/qt/forms/reissueassetdialog.ui +0 -1747
  803. package/Neurai/src/qt/forms/restrictedassetsdialog.ui +0 -299
  804. package/Neurai/src/qt/forms/restrictedassignqualifier.ui +0 -165
  805. package/Neurai/src/qt/forms/restrictedfreezeaddress.ui +0 -232
  806. package/Neurai/src/qt/forms/sendassetsentry.ui +0 -1344
  807. package/Neurai/src/qt/forms/sendcoinsdialog.ui +0 -1305
  808. package/Neurai/src/qt/forms/sendcoinsentry.ui +0 -1269
  809. package/Neurai/src/qt/forms/signverifymessagedialog.ui +0 -390
  810. package/Neurai/src/qt/forms/transactiondescdialog.ui +0 -74
  811. package/Neurai/src/qt/guiconstants.h +0 -130
  812. package/Neurai/src/qt/guiutil.cpp +0 -1072
  813. package/Neurai/src/qt/guiutil.h +0 -273
  814. package/Neurai/src/qt/intro.cpp +0 -332
  815. package/Neurai/src/qt/intro.h +0 -80
  816. package/Neurai/src/qt/locale/neurai_af.ts +0 -1072
  817. package/Neurai/src/qt/locale/neurai_af_ZA.ts +0 -840
  818. package/Neurai/src/qt/locale/neurai_ar.ts +0 -2036
  819. package/Neurai/src/qt/locale/neurai_be_BY.ts +0 -1406
  820. package/Neurai/src/qt/locale/neurai_bg.ts +0 -3104
  821. package/Neurai/src/qt/locale/neurai_bg_BG.ts +0 -472
  822. package/Neurai/src/qt/locale/neurai_ca.ts +0 -3218
  823. package/Neurai/src/qt/locale/neurai_ca@valencia.ts +0 -2942
  824. package/Neurai/src/qt/locale/neurai_ca_ES.ts +0 -3242
  825. package/Neurai/src/qt/locale/neurai_cs.ts +0 -3726
  826. package/Neurai/src/qt/locale/neurai_cy.ts +0 -540
  827. package/Neurai/src/qt/locale/neurai_da.ts +0 -3731
  828. package/Neurai/src/qt/locale/neurai_de.ts +0 -5452
  829. package/Neurai/src/qt/locale/neurai_el.ts +0 -256
  830. package/Neurai/src/qt/locale/neurai_el_GR.ts +0 -2099
  831. package/Neurai/src/qt/locale/neurai_en.ts +0 -8344
  832. package/Neurai/src/qt/locale/neurai_en_GB.ts +0 -2522
  833. package/Neurai/src/qt/locale/neurai_eo.ts +0 -1482
  834. package/Neurai/src/qt/locale/neurai_es.ts +0 -4196
  835. package/Neurai/src/qt/locale/neurai_es_AR.ts +0 -220
  836. package/Neurai/src/qt/locale/neurai_es_CL.ts +0 -855
  837. package/Neurai/src/qt/locale/neurai_es_CO.ts +0 -356
  838. package/Neurai/src/qt/locale/neurai_es_DO.ts +0 -1285
  839. package/Neurai/src/qt/locale/neurai_es_ES.ts +0 -3579
  840. package/Neurai/src/qt/locale/neurai_es_MX.ts +0 -668
  841. package/Neurai/src/qt/locale/neurai_es_UY.ts +0 -487
  842. package/Neurai/src/qt/locale/neurai_es_VE.ts +0 -684
  843. package/Neurai/src/qt/locale/neurai_et.ts +0 -1874
  844. package/Neurai/src/qt/locale/neurai_et_EE.ts +0 -812
  845. package/Neurai/src/qt/locale/neurai_eu_ES.ts +0 -860
  846. package/Neurai/src/qt/locale/neurai_fa.ts +0 -1834
  847. package/Neurai/src/qt/locale/neurai_fa_IR.ts +0 -984
  848. package/Neurai/src/qt/locale/neurai_fi.ts +0 -2906
  849. package/Neurai/src/qt/locale/neurai_fr.ts +0 -4062
  850. package/Neurai/src/qt/locale/neurai_fr_CA.ts +0 -204
  851. package/Neurai/src/qt/locale/neurai_fr_FR.ts +0 -1819
  852. package/Neurai/src/qt/locale/neurai_gl.ts +0 -1180
  853. package/Neurai/src/qt/locale/neurai_he.ts +0 -3022
  854. package/Neurai/src/qt/locale/neurai_hi_IN.ts +0 -491
  855. package/Neurai/src/qt/locale/neurai_hr.ts +0 -1110
  856. package/Neurai/src/qt/locale/neurai_hu.ts +0 -1578
  857. package/Neurai/src/qt/locale/neurai_id_ID.ts +0 -2160
  858. package/Neurai/src/qt/locale/neurai_it.ts +0 -3519
  859. package/Neurai/src/qt/locale/neurai_it_IT.ts +0 -252
  860. package/Neurai/src/qt/locale/neurai_ja.ts +0 -3731
  861. package/Neurai/src/qt/locale/neurai_ka.ts +0 -1492
  862. package/Neurai/src/qt/locale/neurai_kk_KZ.ts +0 -368
  863. package/Neurai/src/qt/locale/neurai_ko_KR.ts +0 -5040
  864. package/Neurai/src/qt/locale/neurai_ku_IQ.ts +0 -428
  865. package/Neurai/src/qt/locale/neurai_ky.ts +0 -396
  866. package/Neurai/src/qt/locale/neurai_la.ts +0 -920
  867. package/Neurai/src/qt/locale/neurai_lt.ts +0 -1000
  868. package/Neurai/src/qt/locale/neurai_lv_LV.ts +0 -1232
  869. package/Neurai/src/qt/locale/neurai_mk_MK.ts +0 -614
  870. package/Neurai/src/qt/locale/neurai_mn.ts +0 -616
  871. package/Neurai/src/qt/locale/neurai_ms_MY.ts +0 -550
  872. package/Neurai/src/qt/locale/neurai_nb.ts +0 -4448
  873. package/Neurai/src/qt/locale/neurai_ne.ts +0 -644
  874. package/Neurai/src/qt/locale/neurai_nl.ts +0 -4264
  875. package/Neurai/src/qt/locale/neurai_pl.ts +0 -4802
  876. package/Neurai/src/qt/locale/neurai_pt_BR.ts +0 -4038
  877. package/Neurai/src/qt/locale/neurai_pt_PT.ts +0 -3507
  878. package/Neurai/src/qt/locale/neurai_ro.ts +0 -920
  879. package/Neurai/src/qt/locale/neurai_ro_RO.ts +0 -2414
  880. package/Neurai/src/qt/locale/neurai_ru.ts +0 -3726
  881. package/Neurai/src/qt/locale/neurai_ru_RU.ts +0 -852
  882. package/Neurai/src/qt/locale/neurai_sk.ts +0 -3539
  883. package/Neurai/src/qt/locale/neurai_sl_SI.ts +0 -1914
  884. package/Neurai/src/qt/locale/neurai_sq.ts +0 -832
  885. package/Neurai/src/qt/locale/neurai_sr.ts +0 -745
  886. package/Neurai/src/qt/locale/neurai_sr@latin.ts +0 -482
  887. package/Neurai/src/qt/locale/neurai_sv.ts +0 -3655
  888. package/Neurai/src/qt/locale/neurai_ta.ts +0 -744
  889. package/Neurai/src/qt/locale/neurai_th_TH.ts +0 -922
  890. package/Neurai/src/qt/locale/neurai_tr.ts +0 -6074
  891. package/Neurai/src/qt/locale/neurai_tr_TR.ts +0 -220
  892. package/Neurai/src/qt/locale/neurai_uk.ts +0 -3182
  893. package/Neurai/src/qt/locale/neurai_ur_PK.ts +0 -296
  894. package/Neurai/src/qt/locale/neurai_uz@Cyrl.ts +0 -1228
  895. package/Neurai/src/qt/locale/neurai_vi.ts +0 -212
  896. package/Neurai/src/qt/locale/neurai_vi_VN.ts +0 -1058
  897. package/Neurai/src/qt/locale/neurai_zh.ts +0 -244
  898. package/Neurai/src/qt/locale/neurai_zh_CN.ts +0 -3510
  899. package/Neurai/src/qt/locale/neurai_zh_HK.ts +0 -690
  900. package/Neurai/src/qt/locale/neurai_zh_TW.ts +0 -3731
  901. package/Neurai/src/qt/macdockiconhandler.h +0 -46
  902. package/Neurai/src/qt/macdockiconhandler.mm +0 -136
  903. package/Neurai/src/qt/macnotificationhandler.h +0 -29
  904. package/Neurai/src/qt/macnotificationhandler.mm +0 -79
  905. package/Neurai/src/qt/mnemonicdialog.cpp +0 -253
  906. package/Neurai/src/qt/mnemonicdialog.h +0 -105
  907. package/Neurai/src/qt/modaloverlay.cpp +0 -178
  908. package/Neurai/src/qt/modaloverlay.h +0 -52
  909. package/Neurai/src/qt/myrestrictedassetrecord.cpp +0 -85
  910. package/Neurai/src/qt/myrestrictedassetrecord.h +0 -79
  911. package/Neurai/src/qt/myrestrictedassettablemodel.cpp +0 -551
  912. package/Neurai/src/qt/myrestrictedassettablemodel.h +0 -99
  913. package/Neurai/src/qt/networkstyle.cpp +0 -99
  914. package/Neurai/src/qt/networkstyle.h +0 -37
  915. package/Neurai/src/qt/neurai-qt.config +0 -2
  916. package/Neurai/src/qt/neurai-qt.creator +0 -1
  917. package/Neurai/src/qt/neurai-qt.creator.user +0 -198
  918. package/Neurai/src/qt/neurai-qt.files +0 -118
  919. package/Neurai/src/qt/neurai-qt.includes +0 -2
  920. package/Neurai/src/qt/neurai.cpp +0 -785
  921. package/Neurai/src/qt/neurai.qrc +0 -156
  922. package/Neurai/src/qt/neurai_locale.qrc +0 -89
  923. package/Neurai/src/qt/neuraiaddressvalidator.cpp +0 -99
  924. package/Neurai/src/qt/neuraiaddressvalidator.h +0 -37
  925. package/Neurai/src/qt/neuraiamountfield.cpp +0 -431
  926. package/Neurai/src/qt/neuraiamountfield.h +0 -130
  927. package/Neurai/src/qt/neuraigui.cpp +0 -1958
  928. package/Neurai/src/qt/neuraigui.h +0 -364
  929. package/Neurai/src/qt/neuraistrings.cpp +0 -569
  930. package/Neurai/src/qt/neuraiunits.cpp +0 -288
  931. package/Neurai/src/qt/neuraiunits.h +0 -140
  932. package/Neurai/src/qt/notificator.cpp +0 -262
  933. package/Neurai/src/qt/notificator.h +0 -79
  934. package/Neurai/src/qt/openuridialog.cpp +0 -54
  935. package/Neurai/src/qt/openuridialog.h +0 -36
  936. package/Neurai/src/qt/optionsdialog.cpp +0 -373
  937. package/Neurai/src/qt/optionsdialog.h +0 -76
  938. package/Neurai/src/qt/optionsmodel.cpp +0 -558
  939. package/Neurai/src/qt/optionsmodel.h +0 -120
  940. package/Neurai/src/qt/overviewpage.cpp +0 -730
  941. package/Neurai/src/qt/overviewpage.h +0 -97
  942. package/Neurai/src/qt/paymentrequest.proto +0 -48
  943. package/Neurai/src/qt/paymentrequestplus.cpp +0 -219
  944. package/Neurai/src/qt/paymentrequestplus.h +0 -53
  945. package/Neurai/src/qt/paymentserver.cpp +0 -812
  946. package/Neurai/src/qt/paymentserver.h +0 -150
  947. package/Neurai/src/qt/peertablemodel.cpp +0 -254
  948. package/Neurai/src/qt/peertablemodel.h +0 -87
  949. package/Neurai/src/qt/platformstyle.cpp +0 -288
  950. package/Neurai/src/qt/platformstyle.h +0 -84
  951. package/Neurai/src/qt/qvalidatedlineedit.cpp +0 -129
  952. package/Neurai/src/qt/qvalidatedlineedit.h +0 -45
  953. package/Neurai/src/qt/qvaluecombobox.cpp +0 -33
  954. package/Neurai/src/qt/qvaluecombobox.h +0 -39
  955. package/Neurai/src/qt/receivecoinsdialog.cpp +0 -345
  956. package/Neurai/src/qt/receivecoinsdialog.h +0 -81
  957. package/Neurai/src/qt/receiverequestdialog.cpp +0 -215
  958. package/Neurai/src/qt/receiverequestdialog.h +0 -73
  959. package/Neurai/src/qt/recentrequeststablemodel.cpp +0 -242
  960. package/Neurai/src/qt/recentrequeststablemodel.h +0 -109
  961. package/Neurai/src/qt/reissueassetdialog.cpp +0 -1494
  962. package/Neurai/src/qt/reissueassetdialog.h +0 -145
  963. package/Neurai/src/qt/res/darkstyle/darkstyle.qss +0 -343
  964. package/Neurai/src/qt/res/darkstyle/icon_branch_closed.png +0 -0
  965. package/Neurai/src/qt/res/darkstyle/icon_branch_end.png +0 -0
  966. package/Neurai/src/qt/res/darkstyle/icon_branch_more.png +0 -0
  967. package/Neurai/src/qt/res/darkstyle/icon_branch_open.png +0 -0
  968. package/Neurai/src/qt/res/darkstyle/icon_checkbox_checked.png +0 -0
  969. package/Neurai/src/qt/res/darkstyle/icon_checkbox_checked_disabled.png +0 -0
  970. package/Neurai/src/qt/res/darkstyle/icon_checkbox_checked_pressed.png +0 -0
  971. package/Neurai/src/qt/res/darkstyle/icon_checkbox_indeterminate.png +0 -0
  972. package/Neurai/src/qt/res/darkstyle/icon_checkbox_indeterminate_disabled.png +0 -0
  973. package/Neurai/src/qt/res/darkstyle/icon_checkbox_indeterminate_pressed.png +0 -0
  974. package/Neurai/src/qt/res/darkstyle/icon_checkbox_unchecked.png +0 -0
  975. package/Neurai/src/qt/res/darkstyle/icon_checkbox_unchecked_disabled.png +0 -0
  976. package/Neurai/src/qt/res/darkstyle/icon_checkbox_unchecked_pressed.png +0 -0
  977. package/Neurai/src/qt/res/darkstyle/icon_close.png +0 -0
  978. package/Neurai/src/qt/res/darkstyle/icon_radiobutton_checked.png +0 -0
  979. package/Neurai/src/qt/res/darkstyle/icon_radiobutton_checked_disabled.png +0 -0
  980. package/Neurai/src/qt/res/darkstyle/icon_radiobutton_checked_pressed.png +0 -0
  981. package/Neurai/src/qt/res/darkstyle/icon_radiobutton_unchecked.png +0 -0
  982. package/Neurai/src/qt/res/darkstyle/icon_radiobutton_unchecked_disabled.png +0 -0
  983. package/Neurai/src/qt/res/darkstyle/icon_radiobutton_unchecked_pressed.png +0 -0
  984. package/Neurai/src/qt/res/darkstyle/icon_restore.png +0 -0
  985. package/Neurai/src/qt/res/darkstyle/icon_undock.png +0 -0
  986. package/Neurai/src/qt/res/darkstyle/icon_vline.png +0 -0
  987. package/Neurai/src/qt/res/fonts/OpenSans-Bold.ttf +0 -0
  988. package/Neurai/src/qt/res/fonts/OpenSans-BoldItalic.ttf +0 -0
  989. package/Neurai/src/qt/res/fonts/OpenSans-ExtraBold.ttf +0 -0
  990. package/Neurai/src/qt/res/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  991. package/Neurai/src/qt/res/fonts/OpenSans-Italic.ttf +0 -0
  992. package/Neurai/src/qt/res/fonts/OpenSans-Light.ttf +0 -0
  993. package/Neurai/src/qt/res/fonts/OpenSans-LightItalic.ttf +0 -0
  994. package/Neurai/src/qt/res/fonts/OpenSans-Regular.ttf +0 -0
  995. package/Neurai/src/qt/res/fonts/OpenSans-SemiBold.ttf +0 -0
  996. package/Neurai/src/qt/res/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  997. package/Neurai/src/qt/res/icons/about.png +0 -0
  998. package/Neurai/src/qt/res/icons/about_qt.png +0 -0
  999. package/Neurai/src/qt/res/icons/add.png +0 -0
  1000. package/Neurai/src/qt/res/icons/address-book.png +0 -0
  1001. package/Neurai/src/qt/res/icons/asset_administrator.png +0 -0
  1002. package/Neurai/src/qt/res/icons/asset_administrator_dark.png +0 -0
  1003. package/Neurai/src/qt/res/icons/asset_create.png +0 -0
  1004. package/Neurai/src/qt/res/icons/asset_create_selected.png +0 -0
  1005. package/Neurai/src/qt/res/icons/asset_manage.png +0 -0
  1006. package/Neurai/src/qt/res/icons/asset_manage_selected.png +0 -0
  1007. package/Neurai/src/qt/res/icons/asset_transfer.png +0 -0
  1008. package/Neurai/src/qt/res/icons/asset_transfer_selected.png +0 -0
  1009. package/Neurai/src/qt/res/icons/chevron.png +0 -0
  1010. package/Neurai/src/qt/res/icons/clock1.png +0 -0
  1011. package/Neurai/src/qt/res/icons/clock2.png +0 -0
  1012. package/Neurai/src/qt/res/icons/clock3.png +0 -0
  1013. package/Neurai/src/qt/res/icons/clock4.png +0 -0
  1014. package/Neurai/src/qt/res/icons/clock5.png +0 -0
  1015. package/Neurai/src/qt/res/icons/configure.png +0 -0
  1016. package/Neurai/src/qt/res/icons/connect0.png +0 -0
  1017. package/Neurai/src/qt/res/icons/connect1.png +0 -0
  1018. package/Neurai/src/qt/res/icons/connect2.png +0 -0
  1019. package/Neurai/src/qt/res/icons/connect3.png +0 -0
  1020. package/Neurai/src/qt/res/icons/connect4.png +0 -0
  1021. package/Neurai/src/qt/res/icons/debugwindow.png +0 -0
  1022. package/Neurai/src/qt/res/icons/edit.png +0 -0
  1023. package/Neurai/src/qt/res/icons/editcopy.png +0 -0
  1024. package/Neurai/src/qt/res/icons/editpaste.png +0 -0
  1025. package/Neurai/src/qt/res/icons/export.png +0 -0
  1026. package/Neurai/src/qt/res/icons/external_link.png +0 -0
  1027. package/Neurai/src/qt/res/icons/external_link_dark.png +0 -0
  1028. package/Neurai/src/qt/res/icons/eye.png +0 -0
  1029. package/Neurai/src/qt/res/icons/eye_minus.png +0 -0
  1030. package/Neurai/src/qt/res/icons/eye_plus.png +0 -0
  1031. package/Neurai/src/qt/res/icons/filesave.png +0 -0
  1032. package/Neurai/src/qt/res/icons/fontbigger.png +0 -0
  1033. package/Neurai/src/qt/res/icons/fontsmaller.png +0 -0
  1034. package/Neurai/src/qt/res/icons/hd_disabled.png +0 -0
  1035. package/Neurai/src/qt/res/icons/hd_enabled.png +0 -0
  1036. package/Neurai/src/qt/res/icons/hd_enabled_44.png +0 -0
  1037. package/Neurai/src/qt/res/icons/history.png +0 -0
  1038. package/Neurai/src/qt/res/icons/history_selected.png +0 -0
  1039. package/Neurai/src/qt/res/icons/info.png +0 -0
  1040. package/Neurai/src/qt/res/icons/key.png +0 -0
  1041. package/Neurai/src/qt/res/icons/lock_closed.png +0 -0
  1042. package/Neurai/src/qt/res/icons/lock_open.png +0 -0
  1043. package/Neurai/src/qt/res/icons/network_disabled.png +0 -0
  1044. package/Neurai/src/qt/res/icons/neurai.icns +0 -0
  1045. package/Neurai/src/qt/res/icons/neurai.ico +0 -0
  1046. package/Neurai/src/qt/res/icons/neurai.png +0 -0
  1047. package/Neurai/src/qt/res/icons/neurai_testnet.ico +0 -0
  1048. package/Neurai/src/qt/res/icons/neuraitext.png +0 -0
  1049. package/Neurai/src/qt/res/icons/open.png +0 -0
  1050. package/Neurai/src/qt/res/icons/overview.png +0 -0
  1051. package/Neurai/src/qt/res/icons/overview_selected.png +0 -0
  1052. package/Neurai/src/qt/res/icons/quit.png +0 -0
  1053. package/Neurai/src/qt/res/icons/receive.png +0 -0
  1054. package/Neurai/src/qt/res/icons/receive_selected.png +0 -0
  1055. package/Neurai/src/qt/res/icons/refresh.png +0 -0
  1056. package/Neurai/src/qt/res/icons/remove.png +0 -0
  1057. package/Neurai/src/qt/res/icons/restricted_asset.png +0 -0
  1058. package/Neurai/src/qt/res/icons/restricted_asset_selected.png +0 -0
  1059. package/Neurai/src/qt/res/icons/send.png +0 -0
  1060. package/Neurai/src/qt/res/icons/send_selected.png +0 -0
  1061. package/Neurai/src/qt/res/icons/synced.png +0 -0
  1062. package/Neurai/src/qt/res/icons/transaction0.png +0 -0
  1063. package/Neurai/src/qt/res/icons/transaction2.png +0 -0
  1064. package/Neurai/src/qt/res/icons/transaction_abandoned.png +0 -0
  1065. package/Neurai/src/qt/res/icons/transaction_conflicted.png +0 -0
  1066. package/Neurai/src/qt/res/icons/tx_asset_input.png +0 -0
  1067. package/Neurai/src/qt/res/icons/tx_asset_output.png +0 -0
  1068. package/Neurai/src/qt/res/icons/tx_atomic_swap.png +0 -0
  1069. package/Neurai/src/qt/res/icons/tx_inout.png +0 -0
  1070. package/Neurai/src/qt/res/icons/tx_input.png +0 -0
  1071. package/Neurai/src/qt/res/icons/tx_mined.png +0 -0
  1072. package/Neurai/src/qt/res/icons/tx_output.png +0 -0
  1073. package/Neurai/src/qt/res/icons/verify.png +0 -0
  1074. package/Neurai/src/qt/res/icons/warning.png +0 -0
  1075. package/Neurai/src/qt/res/icons/xnatext.png +0 -0
  1076. package/Neurai/src/qt/res/movies/makespinner.sh +0 -13
  1077. package/Neurai/src/qt/res/movies/spinner-000.png +0 -0
  1078. package/Neurai/src/qt/res/movies/spinner-001.png +0 -0
  1079. package/Neurai/src/qt/res/movies/spinner-002.png +0 -0
  1080. package/Neurai/src/qt/res/movies/spinner-003.png +0 -0
  1081. package/Neurai/src/qt/res/movies/spinner-004.png +0 -0
  1082. package/Neurai/src/qt/res/movies/spinner-005.png +0 -0
  1083. package/Neurai/src/qt/res/movies/spinner-006.png +0 -0
  1084. package/Neurai/src/qt/res/movies/spinner-007.png +0 -0
  1085. package/Neurai/src/qt/res/movies/spinner-008.png +0 -0
  1086. package/Neurai/src/qt/res/movies/spinner-009.png +0 -0
  1087. package/Neurai/src/qt/res/movies/spinner-010.png +0 -0
  1088. package/Neurai/src/qt/res/movies/spinner-011.png +0 -0
  1089. package/Neurai/src/qt/res/movies/spinner-012.png +0 -0
  1090. package/Neurai/src/qt/res/movies/spinner-013.png +0 -0
  1091. package/Neurai/src/qt/res/movies/spinner-014.png +0 -0
  1092. package/Neurai/src/qt/res/movies/spinner-015.png +0 -0
  1093. package/Neurai/src/qt/res/movies/spinner-016.png +0 -0
  1094. package/Neurai/src/qt/res/movies/spinner-017.png +0 -0
  1095. package/Neurai/src/qt/res/movies/spinner-018.png +0 -0
  1096. package/Neurai/src/qt/res/movies/spinner-019.png +0 -0
  1097. package/Neurai/src/qt/res/movies/spinner-020.png +0 -0
  1098. package/Neurai/src/qt/res/movies/spinner-021.png +0 -0
  1099. package/Neurai/src/qt/res/movies/spinner-022.png +0 -0
  1100. package/Neurai/src/qt/res/movies/spinner-023.png +0 -0
  1101. package/Neurai/src/qt/res/movies/spinner-024.png +0 -0
  1102. package/Neurai/src/qt/res/movies/spinner-025.png +0 -0
  1103. package/Neurai/src/qt/res/movies/spinner-026.png +0 -0
  1104. package/Neurai/src/qt/res/movies/spinner-027.png +0 -0
  1105. package/Neurai/src/qt/res/movies/spinner-028.png +0 -0
  1106. package/Neurai/src/qt/res/movies/spinner-029.png +0 -0
  1107. package/Neurai/src/qt/res/movies/spinner-030.png +0 -0
  1108. package/Neurai/src/qt/res/movies/spinner-031.png +0 -0
  1109. package/Neurai/src/qt/res/movies/spinner-032.png +0 -0
  1110. package/Neurai/src/qt/res/movies/spinner-033.png +0 -0
  1111. package/Neurai/src/qt/res/movies/spinner-034.png +0 -0
  1112. package/Neurai/src/qt/res/movies/spinner-035.png +0 -0
  1113. package/Neurai/src/qt/res/neurai-qt-res.rc +0 -38
  1114. package/Neurai/src/qt/res/src/clock_0.svg +0 -14
  1115. package/Neurai/src/qt/res/src/clock_1.svg +0 -15
  1116. package/Neurai/src/qt/res/src/clock_2.svg +0 -13
  1117. package/Neurai/src/qt/res/src/clock_3.svg +0 -15
  1118. package/Neurai/src/qt/res/src/clock_4.svg +0 -23
  1119. package/Neurai/src/qt/res/src/connect-0.svg +0 -66
  1120. package/Neurai/src/qt/res/src/connect-1.svg +0 -69
  1121. package/Neurai/src/qt/res/src/connect-2.svg +0 -59
  1122. package/Neurai/src/qt/res/src/connect-3.svg +0 -72
  1123. package/Neurai/src/qt/res/src/connect-4.svg +0 -65
  1124. package/Neurai/src/qt/res/src/hd_disabled.svg +0 -26
  1125. package/Neurai/src/qt/res/src/hd_enabled.svg +0 -13
  1126. package/Neurai/src/qt/res/src/mine.svg +0 -12
  1127. package/Neurai/src/qt/res/src/network_disabled.svg +0 -49
  1128. package/Neurai/src/qt/res/src/neurai.svg +0 -37
  1129. package/Neurai/src/qt/res/src/qt.svg +0 -26
  1130. package/Neurai/src/qt/res/src/spinner.png +0 -0
  1131. package/Neurai/src/qt/res/src/transaction0.svg +0 -35
  1132. package/Neurai/src/qt/res/src/tx_in.svg +0 -9
  1133. package/Neurai/src/qt/res/src/tx_inout.svg +0 -11
  1134. package/Neurai/src/qt/res/src/verify.svg +0 -14
  1135. package/Neurai/src/qt/restrictedassetsdialog.cpp +0 -468
  1136. package/Neurai/src/qt/restrictedassetsdialog.h +0 -77
  1137. package/Neurai/src/qt/restrictedassignqualifier.cpp +0 -221
  1138. package/Neurai/src/qt/restrictedassignqualifier.h +0 -67
  1139. package/Neurai/src/qt/restrictedfreezeaddress.cpp +0 -240
  1140. package/Neurai/src/qt/restrictedfreezeaddress.h +0 -68
  1141. package/Neurai/src/qt/rpcconsole.cpp +0 -1287
  1142. package/Neurai/src/qt/rpcconsole.h +0 -174
  1143. package/Neurai/src/qt/sendassetsentry.cpp +0 -571
  1144. package/Neurai/src/qt/sendassetsentry.h +0 -96
  1145. package/Neurai/src/qt/sendcoinsdialog.cpp +0 -1015
  1146. package/Neurai/src/qt/sendcoinsdialog.h +0 -128
  1147. package/Neurai/src/qt/sendcoinsentry.cpp +0 -293
  1148. package/Neurai/src/qt/sendcoinsentry.h +0 -75
  1149. package/Neurai/src/qt/signverifymessagedialog.cpp +0 -280
  1150. package/Neurai/src/qt/signverifymessagedialog.h +0 -55
  1151. package/Neurai/src/qt/splashscreen.cpp +0 -258
  1152. package/Neurai/src/qt/splashscreen.h +0 -59
  1153. package/Neurai/src/qt/test/compattests.cpp +0 -25
  1154. package/Neurai/src/qt/test/compattests.h +0 -21
  1155. package/Neurai/src/qt/test/paymentrequestdata.h +0 -462
  1156. package/Neurai/src/qt/test/paymentservertests.cpp +0 -213
  1157. package/Neurai/src/qt/test/paymentservertests.h +0 -37
  1158. package/Neurai/src/qt/test/rpcnestedtests.cpp +0 -135
  1159. package/Neurai/src/qt/test/rpcnestedtests.h +0 -27
  1160. package/Neurai/src/qt/test/test_main.cpp +0 -116
  1161. package/Neurai/src/qt/test/uritests.cpp +0 -68
  1162. package/Neurai/src/qt/test/uritests.h +0 -21
  1163. package/Neurai/src/qt/test/wallettests.cpp +0 -265
  1164. package/Neurai/src/qt/test/wallettests.h +0 -15
  1165. package/Neurai/src/qt/trafficgraphwidget.cpp +0 -178
  1166. package/Neurai/src/qt/trafficgraphwidget.h +0 -50
  1167. package/Neurai/src/qt/transactiondesc.cpp +0 -478
  1168. package/Neurai/src/qt/transactiondesc.h +0 -35
  1169. package/Neurai/src/qt/transactiondescdialog.cpp +0 -30
  1170. package/Neurai/src/qt/transactiondescdialog.h +0 -33
  1171. package/Neurai/src/qt/transactionfilterproxy.cpp +0 -126
  1172. package/Neurai/src/qt/transactionfilterproxy.h +0 -71
  1173. package/Neurai/src/qt/transactionrecord.cpp +0 -543
  1174. package/Neurai/src/qt/transactionrecord.h +0 -151
  1175. package/Neurai/src/qt/transactiontablemodel.cpp +0 -857
  1176. package/Neurai/src/qt/transactiontablemodel.h +0 -125
  1177. package/Neurai/src/qt/transactionview.cpp +0 -690
  1178. package/Neurai/src/qt/transactionview.h +0 -126
  1179. package/Neurai/src/qt/utilitydialog.cpp +0 -201
  1180. package/Neurai/src/qt/utilitydialog.h +0 -53
  1181. package/Neurai/src/qt/walletframe.cpp +0 -243
  1182. package/Neurai/src/qt/walletframe.h +0 -109
  1183. package/Neurai/src/qt/walletmodel.cpp +0 -924
  1184. package/Neurai/src/qt/walletmodel.h +0 -372
  1185. package/Neurai/src/qt/walletmodeltransaction.cpp +0 -100
  1186. package/Neurai/src/qt/walletmodeltransaction.h +0 -50
  1187. package/Neurai/src/qt/walletview.cpp +0 -454
  1188. package/Neurai/src/qt/walletview.h +0 -160
  1189. package/Neurai/src/qt/winshutdownmonitor.cpp +0 -72
  1190. package/Neurai/src/qt/winshutdownmonitor.h +0 -31
  1191. package/Neurai/src/random.cpp +0 -469
  1192. package/Neurai/src/random.h +0 -170
  1193. package/Neurai/src/rest.cpp +0 -597
  1194. package/Neurai/src/reverse_iterator.h +0 -39
  1195. package/Neurai/src/reverselock.h +0 -36
  1196. package/Neurai/src/rpc/assets.cpp +0 -3404
  1197. package/Neurai/src/rpc/blockchain.cpp +0 -1938
  1198. package/Neurai/src/rpc/blockchain.h +0 -45
  1199. package/Neurai/src/rpc/client.cpp +0 -307
  1200. package/Neurai/src/rpc/client.h +0 -24
  1201. package/Neurai/src/rpc/messages.cpp +0 -1653
  1202. package/Neurai/src/rpc/mining.cpp +0 -1299
  1203. package/Neurai/src/rpc/mining.h +0 -25
  1204. package/Neurai/src/rpc/misc.cpp +0 -1414
  1205. package/Neurai/src/rpc/net.cpp +0 -674
  1206. package/Neurai/src/rpc/protocol.cpp +0 -158
  1207. package/Neurai/src/rpc/protocol.h +0 -106
  1208. package/Neurai/src/rpc/rawtransaction.cpp +0 -2220
  1209. package/Neurai/src/rpc/register.h +0 -43
  1210. package/Neurai/src/rpc/rewards.cpp +0 -503
  1211. package/Neurai/src/rpc/safemode.cpp +0 -14
  1212. package/Neurai/src/rpc/safemode.h +0 -14
  1213. package/Neurai/src/rpc/server.cpp +0 -674
  1214. package/Neurai/src/rpc/server.h +0 -205
  1215. package/Neurai/src/rpc/test.json +0 -45
  1216. package/Neurai/src/scheduler.cpp +0 -211
  1217. package/Neurai/src/scheduler.h +0 -115
  1218. package/Neurai/src/script/interpreter.cpp +0 -1756
  1219. package/Neurai/src/script/interpreter.h +0 -193
  1220. package/Neurai/src/script/ismine.cpp +0 -205
  1221. package/Neurai/src/script/ismine.h +0 -43
  1222. package/Neurai/src/script/neuraiconsensus.cpp +0 -131
  1223. package/Neurai/src/script/neuraiconsensus.h +0 -85
  1224. package/Neurai/src/script/script.cpp +0 -601
  1225. package/Neurai/src/script/script.h +0 -742
  1226. package/Neurai/src/script/script_error.cpp +0 -99
  1227. package/Neurai/src/script/script_error.h +0 -76
  1228. package/Neurai/src/script/sigcache.cpp +0 -96
  1229. package/Neurai/src/script/sigcache.h +0 -58
  1230. package/Neurai/src/script/sign.cpp +0 -482
  1231. package/Neurai/src/script/sign.h +0 -86
  1232. package/Neurai/src/script/standard.cpp +0 -414
  1233. package/Neurai/src/script/standard.h +0 -162
  1234. package/Neurai/src/secp256k1/.travis.yml +0 -108
  1235. package/Neurai/src/secp256k1/COPYING +0 -19
  1236. package/Neurai/src/secp256k1/Makefile.am +0 -164
  1237. package/Neurai/src/secp256k1/README.md +0 -104
  1238. package/Neurai/src/secp256k1/SECURITY.md +0 -15
  1239. package/Neurai/src/secp256k1/autogen.sh +0 -3
  1240. package/Neurai/src/secp256k1/build-aux/compile +0 -351
  1241. package/Neurai/src/secp256k1/build-aux/config.guess +0 -1815
  1242. package/Neurai/src/secp256k1/build-aux/config.sub +0 -2354
  1243. package/Neurai/src/secp256k1/build-aux/depcomp +0 -792
  1244. package/Neurai/src/secp256k1/build-aux/install-sh +0 -541
  1245. package/Neurai/src/secp256k1/build-aux/ltmain.sh +0 -11523
  1246. package/Neurai/src/secp256k1/build-aux/m4/ax_prog_cc_for_build.m4 +0 -125
  1247. package/Neurai/src/secp256k1/build-aux/m4/bitcoin_secp.m4 +0 -89
  1248. package/Neurai/src/secp256k1/build-aux/m4/libtool.m4 +0 -8513
  1249. package/Neurai/src/secp256k1/build-aux/m4/ltoptions.m4 +0 -467
  1250. package/Neurai/src/secp256k1/build-aux/m4/ltsugar.m4 +0 -124
  1251. package/Neurai/src/secp256k1/build-aux/m4/ltversion.m4 +0 -24
  1252. package/Neurai/src/secp256k1/build-aux/m4/lt~obsolete.m4 +0 -99
  1253. package/Neurai/src/secp256k1/build-aux/missing +0 -236
  1254. package/Neurai/src/secp256k1/build-aux/test-driver +0 -160
  1255. package/Neurai/src/secp256k1/configure.ac +0 -529
  1256. package/Neurai/src/secp256k1/contrib/lax_der_parsing.c +0 -149
  1257. package/Neurai/src/secp256k1/contrib/lax_der_parsing.h +0 -91
  1258. package/Neurai/src/secp256k1/contrib/lax_der_privatekey_parsing.c +0 -113
  1259. package/Neurai/src/secp256k1/contrib/lax_der_privatekey_parsing.h +0 -90
  1260. package/Neurai/src/secp256k1/contrib/travis.sh +0 -68
  1261. package/Neurai/src/secp256k1/include/secp256k1.h +0 -764
  1262. package/Neurai/src/secp256k1/include/secp256k1_ecdh.h +0 -62
  1263. package/Neurai/src/secp256k1/include/secp256k1_extrakeys.h +0 -236
  1264. package/Neurai/src/secp256k1/include/secp256k1_preallocated.h +0 -128
  1265. package/Neurai/src/secp256k1/include/secp256k1_recovery.h +0 -110
  1266. package/Neurai/src/secp256k1/include/secp256k1_schnorrsig.h +0 -111
  1267. package/Neurai/src/secp256k1/libsecp256k1.pc.in +0 -13
  1268. package/Neurai/src/secp256k1/sage/gen_exhaustive_groups.sage +0 -129
  1269. package/Neurai/src/secp256k1/sage/group_prover.sage +0 -322
  1270. package/Neurai/src/secp256k1/sage/secp256k1.sage +0 -306
  1271. package/Neurai/src/secp256k1/sage/weierstrass_prover.sage +0 -264
  1272. package/Neurai/src/secp256k1/src/asm/field_10x26_arm.s +0 -913
  1273. package/Neurai/src/secp256k1/src/assumptions.h +0 -80
  1274. package/Neurai/src/secp256k1/src/basic-config.h +0 -34
  1275. package/Neurai/src/secp256k1/src/bench.h +0 -133
  1276. package/Neurai/src/secp256k1/src/bench_ecdh.c +0 -59
  1277. package/Neurai/src/secp256k1/src/bench_ecmult.c +0 -214
  1278. package/Neurai/src/secp256k1/src/bench_internal.c +0 -431
  1279. package/Neurai/src/secp256k1/src/bench_recover.c +0 -62
  1280. package/Neurai/src/secp256k1/src/bench_schnorrsig.c +0 -102
  1281. package/Neurai/src/secp256k1/src/bench_sign.c +0 -58
  1282. package/Neurai/src/secp256k1/src/bench_verify.c +0 -115
  1283. package/Neurai/src/secp256k1/src/ecdsa.h +0 -21
  1284. package/Neurai/src/secp256k1/src/ecdsa_impl.h +0 -315
  1285. package/Neurai/src/secp256k1/src/eckey.h +0 -25
  1286. package/Neurai/src/secp256k1/src/eckey_impl.h +0 -96
  1287. package/Neurai/src/secp256k1/src/ecmult.h +0 -46
  1288. package/Neurai/src/secp256k1/src/ecmult_const.h +0 -20
  1289. package/Neurai/src/secp256k1/src/ecmult_const_impl.h +0 -254
  1290. package/Neurai/src/secp256k1/src/ecmult_gen.h +0 -50
  1291. package/Neurai/src/secp256k1/src/ecmult_gen_impl.h +0 -208
  1292. package/Neurai/src/secp256k1/src/ecmult_impl.h +0 -1083
  1293. package/Neurai/src/secp256k1/src/field.h +0 -134
  1294. package/Neurai/src/secp256k1/src/field_10x26.h +0 -50
  1295. package/Neurai/src/secp256k1/src/field_10x26_impl.h +0 -1167
  1296. package/Neurai/src/secp256k1/src/field_5x52.h +0 -55
  1297. package/Neurai/src/secp256k1/src/field_5x52_asm_impl.h +0 -502
  1298. package/Neurai/src/secp256k1/src/field_5x52_impl.h +0 -501
  1299. package/Neurai/src/secp256k1/src/field_5x52_int128_impl.h +0 -279
  1300. package/Neurai/src/secp256k1/src/field_impl.h +0 -320
  1301. package/Neurai/src/secp256k1/src/gen_context.c +0 -88
  1302. package/Neurai/src/secp256k1/src/group.h +0 -151
  1303. package/Neurai/src/secp256k1/src/group_impl.h +0 -693
  1304. package/Neurai/src/secp256k1/src/hash.h +0 -41
  1305. package/Neurai/src/secp256k1/src/hash_impl.h +0 -297
  1306. package/Neurai/src/secp256k1/src/libsecp256k1-config.h.in +0 -139
  1307. package/Neurai/src/secp256k1/src/modules/ecdh/Makefile.am.include +0 -8
  1308. package/Neurai/src/secp256k1/src/modules/ecdh/main_impl.h +0 -71
  1309. package/Neurai/src/secp256k1/src/modules/ecdh/tests_impl.h +0 -132
  1310. package/Neurai/src/secp256k1/src/modules/extrakeys/Makefile.am.include +0 -4
  1311. package/Neurai/src/secp256k1/src/modules/extrakeys/main_impl.h +0 -251
  1312. package/Neurai/src/secp256k1/src/modules/extrakeys/tests_exhaustive_impl.h +0 -68
  1313. package/Neurai/src/secp256k1/src/modules/extrakeys/tests_impl.h +0 -524
  1314. package/Neurai/src/secp256k1/src/modules/recovery/Makefile.am.include +0 -9
  1315. package/Neurai/src/secp256k1/src/modules/recovery/main_impl.h +0 -160
  1316. package/Neurai/src/secp256k1/src/modules/recovery/tests_exhaustive_impl.h +0 -149
  1317. package/Neurai/src/secp256k1/src/modules/recovery/tests_impl.h +0 -393
  1318. package/Neurai/src/secp256k1/src/modules/schnorrsig/Makefile.am.include +0 -9
  1319. package/Neurai/src/secp256k1/src/modules/schnorrsig/main_impl.h +0 -239
  1320. package/Neurai/src/secp256k1/src/modules/schnorrsig/tests_exhaustive_impl.h +0 -206
  1321. package/Neurai/src/secp256k1/src/modules/schnorrsig/tests_impl.h +0 -806
  1322. package/Neurai/src/secp256k1/src/num.h +0 -74
  1323. package/Neurai/src/secp256k1/src/num_gmp.h +0 -20
  1324. package/Neurai/src/secp256k1/src/num_gmp_impl.h +0 -288
  1325. package/Neurai/src/secp256k1/src/num_impl.h +0 -24
  1326. package/Neurai/src/secp256k1/src/scalar.h +0 -117
  1327. package/Neurai/src/secp256k1/src/scalar_4x64.h +0 -19
  1328. package/Neurai/src/secp256k1/src/scalar_4x64_impl.h +0 -958
  1329. package/Neurai/src/secp256k1/src/scalar_8x32.h +0 -19
  1330. package/Neurai/src/secp256k1/src/scalar_8x32_impl.h +0 -734
  1331. package/Neurai/src/secp256k1/src/scalar_impl.h +0 -516
  1332. package/Neurai/src/secp256k1/src/scalar_low.h +0 -17
  1333. package/Neurai/src/secp256k1/src/scalar_low_impl.h +0 -128
  1334. package/Neurai/src/secp256k1/src/scratch.h +0 -42
  1335. package/Neurai/src/secp256k1/src/scratch_impl.h +0 -99
  1336. package/Neurai/src/secp256k1/src/secp256k1.c +0 -774
  1337. package/Neurai/src/secp256k1/src/selftest.h +0 -32
  1338. package/Neurai/src/secp256k1/src/testrand.h +0 -47
  1339. package/Neurai/src/secp256k1/src/testrand_impl.h +0 -158
  1340. package/Neurai/src/secp256k1/src/tests.c +0 -5737
  1341. package/Neurai/src/secp256k1/src/tests_exhaustive.c +0 -454
  1342. package/Neurai/src/secp256k1/src/util.h +0 -273
  1343. package/Neurai/src/secp256k1/src/valgrind_ctime_test.c +0 -157
  1344. package/Neurai/src/serialize.h +0 -979
  1345. package/Neurai/src/spentindex.h +0 -98
  1346. package/Neurai/src/streams.h +0 -711
  1347. package/Neurai/src/support/allocators/secure.h +0 -61
  1348. package/Neurai/src/support/allocators/zeroafterfree.h +0 -50
  1349. package/Neurai/src/support/cleanse.cpp +0 -41
  1350. package/Neurai/src/support/cleanse.h +0 -16
  1351. package/Neurai/src/support/events.h +0 -58
  1352. package/Neurai/src/support/lockedpool.cpp +0 -392
  1353. package/Neurai/src/support/lockedpool.h +0 -233
  1354. package/Neurai/src/sync.cpp +0 -182
  1355. package/Neurai/src/sync.h +0 -291
  1356. package/Neurai/src/test/DoS_tests.cpp +0 -286
  1357. package/Neurai/src/test/README.md +0 -84
  1358. package/Neurai/src/test/addrman_tests.cpp +0 -560
  1359. package/Neurai/src/test/allocator_tests.cpp +0 -255
  1360. package/Neurai/src/test/amount_tests.cpp +0 -118
  1361. package/Neurai/src/test/arith_uint256_tests.cpp +0 -629
  1362. package/Neurai/src/test/assets/asset_reissue_tests.cpp +0 -207
  1363. package/Neurai/src/test/assets/asset_tests.cpp +0 -735
  1364. package/Neurai/src/test/assets/asset_tx_tests.cpp +0 -610
  1365. package/Neurai/src/test/assets/cache_tests.cpp +0 -41
  1366. package/Neurai/src/test/assets/messaging_tests.cpp +0 -82
  1367. package/Neurai/src/test/assets/null_asset_data_tests.cpp +0 -77
  1368. package/Neurai/src/test/assets/qualifier_tests.cpp +0 -122
  1369. package/Neurai/src/test/assets/restricted_tests.cpp +0 -188
  1370. package/Neurai/src/test/assets/serialization_tests.cpp +0 -179
  1371. package/Neurai/src/test/assets/unique_tests.cpp +0 -65
  1372. package/Neurai/src/test/assets/verifier_string_tests.cpp +0 -371
  1373. package/Neurai/src/test/base32_tests.cpp +0 -29
  1374. package/Neurai/src/test/base58_tests.cpp +0 -282
  1375. package/Neurai/src/test/base64_tests.cpp +0 -29
  1376. package/Neurai/src/test/bech32_tests.cpp +0 -75
  1377. package/Neurai/src/test/bip32_tests.cpp +0 -179
  1378. package/Neurai/src/test/bip39_tests.cpp +0 -67
  1379. package/Neurai/src/test/blockencodings_tests.cpp +0 -360
  1380. package/Neurai/src/test/bloom_tests.cpp +0 -574
  1381. package/Neurai/src/test/bswap_tests.cpp +0 -30
  1382. package/Neurai/src/test/checkqueue_tests.cpp +0 -554
  1383. package/Neurai/src/test/coins_tests.cpp +0 -949
  1384. package/Neurai/src/test/compress_tests.cpp +0 -72
  1385. package/Neurai/src/test/crypto_tests.cpp +0 -599
  1386. package/Neurai/src/test/cuckoocache_tests.cpp +0 -406
  1387. package/Neurai/src/test/data/README.md +0 -12
  1388. package/Neurai/src/test/data/base58_encode_decode.json +0 -14
  1389. package/Neurai/src/test/data/base58_keys_invalid.json +0 -152
  1390. package/Neurai/src/test/data/base58_keys_valid.json +0 -452
  1391. package/Neurai/src/test/data/bip39_vectors.json +0 -146
  1392. package/Neurai/src/test/data/script_tests.json +0 -2607
  1393. package/Neurai/src/test/data/sighash.json +0 -503
  1394. package/Neurai/src/test/data/tx_invalid.json +0 -344
  1395. package/Neurai/src/test/data/tx_valid.json +0 -514
  1396. package/Neurai/src/test/dbwrapper_tests.cpp +0 -365
  1397. package/Neurai/src/test/getarg_tests.cpp +0 -173
  1398. package/Neurai/src/test/hash_tests.cpp +0 -185
  1399. package/Neurai/src/test/kawpow_tests.cpp +0 -142
  1400. package/Neurai/src/test/key_tests.cpp +0 -169
  1401. package/Neurai/src/test/limitedmap_tests.cpp +0 -112
  1402. package/Neurai/src/test/main_tests.cpp +0 -91
  1403. package/Neurai/src/test/mempool_tests.cpp +0 -601
  1404. package/Neurai/src/test/merkle_tests.cpp +0 -152
  1405. package/Neurai/src/test/merkleblock_tests.cpp +0 -84
  1406. package/Neurai/src/test/miner_tests.cpp +0 -661
  1407. package/Neurai/src/test/multisig_tests.cpp +0 -240
  1408. package/Neurai/src/test/net_tests.cpp +0 -202
  1409. package/Neurai/src/test/netbase_tests.cpp +0 -318
  1410. package/Neurai/src/test/pmt_tests.cpp +0 -139
  1411. package/Neurai/src/test/policyestimator_tests.cpp +0 -209
  1412. package/Neurai/src/test/pow_tests.cpp +0 -100
  1413. package/Neurai/src/test/prevector_tests.cpp +0 -321
  1414. package/Neurai/src/test/raii_event_tests.cpp +0 -102
  1415. package/Neurai/src/test/random_tests.cpp +0 -98
  1416. package/Neurai/src/test/reverselock_tests.cpp +0 -68
  1417. package/Neurai/src/test/rpc_tests.cpp +0 -393
  1418. package/Neurai/src/test/sanity_tests.cpp +0 -24
  1419. package/Neurai/src/test/scheduler_tests.cpp +0 -127
  1420. package/Neurai/src/test/script_P2PKH_tests.cpp +0 -65
  1421. package/Neurai/src/test/script_P2PK_tests.cpp +0 -52
  1422. package/Neurai/src/test/script_P2SH_tests.cpp +0 -392
  1423. package/Neurai/src/test/script_standard_tests.cpp +0 -802
  1424. package/Neurai/src/test/script_tests.cpp +0 -1650
  1425. package/Neurai/src/test/scriptnum10.h +0 -222
  1426. package/Neurai/src/test/scriptnum_tests.cpp +0 -207
  1427. package/Neurai/src/test/serialize_tests.cpp +0 -439
  1428. package/Neurai/src/test/sighash_tests.cpp +0 -225
  1429. package/Neurai/src/test/sigopcount_tests.cpp +0 -242
  1430. package/Neurai/src/test/skiplist_tests.cpp +0 -207
  1431. package/Neurai/src/test/streams_tests.cpp +0 -129
  1432. package/Neurai/src/test/test_neurai.cpp +0 -183
  1433. package/Neurai/src/test/test_neurai.h +0 -164
  1434. package/Neurai/src/test/test_neurai_fuzzy.cpp +0 -339
  1435. package/Neurai/src/test/test_neurai_hash.cpp +0 -39
  1436. package/Neurai/src/test/test_neurai_main.cpp +0 -28
  1437. package/Neurai/src/test/timedata_tests.cpp +0 -41
  1438. package/Neurai/src/test/torcontrol_tests.cpp +0 -204
  1439. package/Neurai/src/test/transaction_tests.cpp +0 -867
  1440. package/Neurai/src/test/txvalidationcache_tests.cpp +0 -398
  1441. package/Neurai/src/test/uint256_tests.cpp +0 -279
  1442. package/Neurai/src/test/univalue_tests.cpp +0 -347
  1443. package/Neurai/src/test/util_tests.cpp +0 -674
  1444. package/Neurai/src/test/versionbits_tests.cpp +0 -392
  1445. package/Neurai/src/threadinterrupt.cpp +0 -43
  1446. package/Neurai/src/threadinterrupt.h +0 -36
  1447. package/Neurai/src/threadsafety.h +0 -57
  1448. package/Neurai/src/timedata.cpp +0 -122
  1449. package/Neurai/src/timedata.h +0 -80
  1450. package/Neurai/src/timestampindex.h +0 -131
  1451. package/Neurai/src/tinyformat.h +0 -1056
  1452. package/Neurai/src/torcontrol.cpp +0 -779
  1453. package/Neurai/src/torcontrol.h +0 -22
  1454. package/Neurai/src/txdb.cpp +0 -654
  1455. package/Neurai/src/txdb.h +0 -158
  1456. package/Neurai/src/txmempool.cpp +0 -1520
  1457. package/Neurai/src/txmempool.h +0 -850
  1458. package/Neurai/src/ui_interface.cpp +0 -31
  1459. package/Neurai/src/ui_interface.h +0 -130
  1460. package/Neurai/src/uint256.cpp +0 -81
  1461. package/Neurai/src/uint256.h +0 -180
  1462. package/Neurai/src/undo.h +0 -124
  1463. package/Neurai/src/univalue/.travis.yml +0 -52
  1464. package/Neurai/src/univalue/COPYING +0 -19
  1465. package/Neurai/src/univalue/Makefile.am +0 -116
  1466. package/Neurai/src/univalue/README.md +0 -32
  1467. package/Neurai/src/univalue/TODO +0 -10
  1468. package/Neurai/src/univalue/autogen.sh +0 -9
  1469. package/Neurai/src/univalue/build-aux/compile +0 -351
  1470. package/Neurai/src/univalue/build-aux/config.guess +0 -1815
  1471. package/Neurai/src/univalue/build-aux/config.sub +0 -2354
  1472. package/Neurai/src/univalue/build-aux/depcomp +0 -792
  1473. package/Neurai/src/univalue/build-aux/install-sh +0 -541
  1474. package/Neurai/src/univalue/build-aux/ltmain.sh +0 -11523
  1475. package/Neurai/src/univalue/build-aux/m4/libtool.m4 +0 -8513
  1476. package/Neurai/src/univalue/build-aux/m4/ltoptions.m4 +0 -467
  1477. package/Neurai/src/univalue/build-aux/m4/ltsugar.m4 +0 -124
  1478. package/Neurai/src/univalue/build-aux/m4/ltversion.m4 +0 -24
  1479. package/Neurai/src/univalue/build-aux/m4/lt~obsolete.m4 +0 -99
  1480. package/Neurai/src/univalue/build-aux/missing +0 -236
  1481. package/Neurai/src/univalue/build-aux/test-driver +0 -160
  1482. package/Neurai/src/univalue/configure.ac +0 -69
  1483. package/Neurai/src/univalue/gen/gen.cpp +0 -85
  1484. package/Neurai/src/univalue/include/univalue.h +0 -305
  1485. package/Neurai/src/univalue/lib/univalue.cpp +0 -244
  1486. package/Neurai/src/univalue/lib/univalue_escapes.h +0 -262
  1487. package/Neurai/src/univalue/lib/univalue_get.cpp +0 -198
  1488. package/Neurai/src/univalue/lib/univalue_read.cpp +0 -451
  1489. package/Neurai/src/univalue/lib/univalue_utffilter.h +0 -119
  1490. package/Neurai/src/univalue/lib/univalue_write.cpp +0 -115
  1491. package/Neurai/src/univalue/pc/libunivalue-uninstalled.pc.in +0 -9
  1492. package/Neurai/src/univalue/pc/libunivalue.pc.in +0 -10
  1493. package/Neurai/src/univalue/test/fail1.json +0 -1
  1494. package/Neurai/src/univalue/test/fail10.json +0 -1
  1495. package/Neurai/src/univalue/test/fail11.json +0 -1
  1496. package/Neurai/src/univalue/test/fail12.json +0 -1
  1497. package/Neurai/src/univalue/test/fail13.json +0 -1
  1498. package/Neurai/src/univalue/test/fail14.json +0 -1
  1499. package/Neurai/src/univalue/test/fail15.json +0 -1
  1500. package/Neurai/src/univalue/test/fail16.json +0 -1
  1501. package/Neurai/src/univalue/test/fail17.json +0 -1
  1502. package/Neurai/src/univalue/test/fail18.json +0 -1
  1503. package/Neurai/src/univalue/test/fail19.json +0 -1
  1504. package/Neurai/src/univalue/test/fail2.json +0 -1
  1505. package/Neurai/src/univalue/test/fail20.json +0 -1
  1506. package/Neurai/src/univalue/test/fail21.json +0 -1
  1507. package/Neurai/src/univalue/test/fail22.json +0 -1
  1508. package/Neurai/src/univalue/test/fail23.json +0 -1
  1509. package/Neurai/src/univalue/test/fail24.json +0 -1
  1510. package/Neurai/src/univalue/test/fail25.json +0 -1
  1511. package/Neurai/src/univalue/test/fail26.json +0 -1
  1512. package/Neurai/src/univalue/test/fail27.json +0 -2
  1513. package/Neurai/src/univalue/test/fail28.json +0 -2
  1514. package/Neurai/src/univalue/test/fail29.json +0 -1
  1515. package/Neurai/src/univalue/test/fail3.json +0 -1
  1516. package/Neurai/src/univalue/test/fail30.json +0 -1
  1517. package/Neurai/src/univalue/test/fail31.json +0 -1
  1518. package/Neurai/src/univalue/test/fail32.json +0 -1
  1519. package/Neurai/src/univalue/test/fail33.json +0 -1
  1520. package/Neurai/src/univalue/test/fail34.json +0 -1
  1521. package/Neurai/src/univalue/test/fail35.json +0 -1
  1522. package/Neurai/src/univalue/test/fail36.json +0 -1
  1523. package/Neurai/src/univalue/test/fail37.json +0 -1
  1524. package/Neurai/src/univalue/test/fail38.json +0 -1
  1525. package/Neurai/src/univalue/test/fail39.json +0 -1
  1526. package/Neurai/src/univalue/test/fail4.json +0 -1
  1527. package/Neurai/src/univalue/test/fail40.json +0 -1
  1528. package/Neurai/src/univalue/test/fail41.json +0 -1
  1529. package/Neurai/src/univalue/test/fail42.json +0 -0
  1530. package/Neurai/src/univalue/test/fail44.json +0 -1
  1531. package/Neurai/src/univalue/test/fail5.json +0 -1
  1532. package/Neurai/src/univalue/test/fail6.json +0 -1
  1533. package/Neurai/src/univalue/test/fail7.json +0 -1
  1534. package/Neurai/src/univalue/test/fail8.json +0 -1
  1535. package/Neurai/src/univalue/test/fail9.json +0 -1
  1536. package/Neurai/src/univalue/test/no_nul.cpp +0 -8
  1537. package/Neurai/src/univalue/test/object.cpp +0 -397
  1538. package/Neurai/src/univalue/test/pass1.json +0 -58
  1539. package/Neurai/src/univalue/test/pass2.json +0 -1
  1540. package/Neurai/src/univalue/test/pass3.json +0 -6
  1541. package/Neurai/src/univalue/test/round1.json +0 -1
  1542. package/Neurai/src/univalue/test/round2.json +0 -1
  1543. package/Neurai/src/univalue/test/round3.json +0 -1
  1544. package/Neurai/src/univalue/test/round4.json +0 -1
  1545. package/Neurai/src/univalue/test/round5.json +0 -1
  1546. package/Neurai/src/univalue/test/round6.json +0 -1
  1547. package/Neurai/src/univalue/test/round7.json +0 -1
  1548. package/Neurai/src/univalue/test/test_json.cpp +0 -24
  1549. package/Neurai/src/univalue/test/unitester.cpp +0 -170
  1550. package/Neurai/src/univalue/univalue-config.h.in +0 -63
  1551. package/Neurai/src/util.cpp +0 -955
  1552. package/Neurai/src/util.h +0 -366
  1553. package/Neurai/src/utilmoneystr.cpp +0 -79
  1554. package/Neurai/src/utilmoneystr.h +0 -26
  1555. package/Neurai/src/utilstrencodings.cpp +0 -736
  1556. package/Neurai/src/utilstrencodings.h +0 -160
  1557. package/Neurai/src/utiltime.cpp +0 -89
  1558. package/Neurai/src/utiltime.h +0 -34
  1559. package/Neurai/src/validation.cpp +0 -5949
  1560. package/Neurai/src/validation.h +0 -620
  1561. package/Neurai/src/validationinterface.cpp +0 -146
  1562. package/Neurai/src/validationinterface.h +0 -115
  1563. package/Neurai/src/version.h +0 -64
  1564. package/Neurai/src/versionbits.cpp +0 -244
  1565. package/Neurai/src/versionbits.h +0 -84
  1566. package/Neurai/src/wallet/bip39.cpp +0 -236
  1567. package/Neurai/src/wallet/bip39.h +0 -67
  1568. package/Neurai/src/wallet/bip39_chinese_simplified.h +0 -2074
  1569. package/Neurai/src/wallet/bip39_chinese_traditional.h +0 -2074
  1570. package/Neurai/src/wallet/bip39_english.h +0 -2074
  1571. package/Neurai/src/wallet/bip39_french.h +0 -2074
  1572. package/Neurai/src/wallet/bip39_italian.h +0 -2074
  1573. package/Neurai/src/wallet/bip39_japanese.h +0 -2074
  1574. package/Neurai/src/wallet/bip39_korean.h +0 -2074
  1575. package/Neurai/src/wallet/bip39_spanish.h +0 -2074
  1576. package/Neurai/src/wallet/coincontrol.h +0 -134
  1577. package/Neurai/src/wallet/crypter.cpp +0 -413
  1578. package/Neurai/src/wallet/crypter.h +0 -208
  1579. package/Neurai/src/wallet/db.cpp +0 -728
  1580. package/Neurai/src/wallet/db.h +0 -373
  1581. package/Neurai/src/wallet/feebumper.cpp +0 -292
  1582. package/Neurai/src/wallet/feebumper.h +0 -63
  1583. package/Neurai/src/wallet/fees.cpp +0 -91
  1584. package/Neurai/src/wallet/fees.h +0 -36
  1585. package/Neurai/src/wallet/init.cpp +0 -288
  1586. package/Neurai/src/wallet/init.h +0 -45
  1587. package/Neurai/src/wallet/rpcdump.cpp +0 -1363
  1588. package/Neurai/src/wallet/rpcwallet.cpp +0 -3589
  1589. package/Neurai/src/wallet/rpcwallet.h +0 -30
  1590. package/Neurai/src/wallet/test/accounting_tests.cpp +0 -142
  1591. package/Neurai/src/wallet/test/crypto_tests.cpp +0 -136
  1592. package/Neurai/src/wallet/test/wallet_test_fixture.cpp +0 -37
  1593. package/Neurai/src/wallet/test/wallet_test_fixture.h +0 -22
  1594. package/Neurai/src/wallet/test/wallet_tests.cpp +0 -720
  1595. package/Neurai/src/wallet/wallet.cpp +0 -4998
  1596. package/Neurai/src/wallet/wallet.h +0 -1307
  1597. package/Neurai/src/wallet/walletdb.cpp +0 -1049
  1598. package/Neurai/src/wallet/walletdb.h +0 -292
  1599. package/Neurai/src/warnings.cpp +0 -85
  1600. package/Neurai/src/warnings.h +0 -29
  1601. package/Neurai/src/zmq/zmqabstractnotifier.cpp +0 -29
  1602. package/Neurai/src/zmq/zmqabstractnotifier.h +0 -48
  1603. package/Neurai/src/zmq/zmqconfig.h +0 -26
  1604. package/Neurai/src/zmq/zmqnotificationinterface.cpp +0 -202
  1605. package/Neurai/src/zmq/zmqnotificationinterface.h +0 -43
  1606. package/Neurai/src/zmq/zmqpublishnotifier.cpp +0 -209
  1607. package/Neurai/src/zmq/zmqpublishnotifier.h +0 -64
  1608. package/Neurai/test/README.md +0 -187
  1609. package/Neurai/test/config.ini.in +0 -20
  1610. package/Neurai/test/functional/README.md +0 -102
  1611. package/Neurai/test/functional/combine_logs.py +0 -123
  1612. package/Neurai/test/functional/combined_log_template.html +0 -40
  1613. package/Neurai/test/functional/create_cache.py +0 -30
  1614. package/Neurai/test/functional/example_test.py +0 -194
  1615. package/Neurai/test/functional/feature_assets.py +0 -365
  1616. package/Neurai/test/functional/feature_assets_mempool.py +0 -153
  1617. package/Neurai/test/functional/feature_assets_reorg.py +0 -154
  1618. package/Neurai/test/functional/feature_assumevalid.py +0 -199
  1619. package/Neurai/test/functional/feature_bip68_sequence.py +0 -387
  1620. package/Neurai/test/functional/feature_cltv.py +0 -164
  1621. package/Neurai/test/functional/feature_dbcrash.py +0 -284
  1622. package/Neurai/test/functional/feature_dersig.py +0 -155
  1623. package/Neurai/test/functional/feature_fee_estimation.py +0 -265
  1624. package/Neurai/test/functional/feature_listmyassets.py +0 -56
  1625. package/Neurai/test/functional/feature_loadblock.py +0 -89
  1626. package/Neurai/test/functional/feature_maxreorgdepth.py +0 -138
  1627. package/Neurai/test/functional/feature_maxuploadtarget.py +0 -183
  1628. package/Neurai/test/functional/feature_messaging.py +0 -139
  1629. package/Neurai/test/functional/feature_minchainwork.py +0 -91
  1630. package/Neurai/test/functional/feature_notifications.py +0 -90
  1631. package/Neurai/test/functional/feature_nulldummy.py +0 -137
  1632. package/Neurai/test/functional/feature_proxy.py +0 -200
  1633. package/Neurai/test/functional/feature_pruning.py +0 -457
  1634. package/Neurai/test/functional/feature_raw_restricted_assets.py +0 -568
  1635. package/Neurai/test/functional/feature_rawassettransactions.py +0 -1845
  1636. package/Neurai/test/functional/feature_rbf.py +0 -571
  1637. package/Neurai/test/functional/feature_reindex.py +0 -43
  1638. package/Neurai/test/functional/feature_restricted_assets.py +0 -591
  1639. package/Neurai/test/functional/feature_rewards.py +0 -1270
  1640. package/Neurai/test/functional/feature_segwit.py +0 -642
  1641. package/Neurai/test/functional/feature_shutdown.py +0 -36
  1642. package/Neurai/test/functional/feature_uacomment.py +0 -37
  1643. package/Neurai/test/functional/feature_unique_assets.py +0 -144
  1644. package/Neurai/test/functional/feature_versionbits_warning.py +0 -131
  1645. package/Neurai/test/functional/interface_http.py +0 -110
  1646. package/Neurai/test/functional/interface_neurai_cli.py +0 -59
  1647. package/Neurai/test/functional/interface_rest.py +0 -329
  1648. package/Neurai/test/functional/interface_rpc.py +0 -77
  1649. package/Neurai/test/functional/interface_zmq.py +0 -125
  1650. package/Neurai/test/functional/mempool_limit.py +0 -68
  1651. package/Neurai/test/functional/mempool_packages.py +0 -245
  1652. package/Neurai/test/functional/mempool_persist.py +0 -112
  1653. package/Neurai/test/functional/mempool_reorg.py +0 -98
  1654. package/Neurai/test/functional/mempool_resurrect.py +0 -70
  1655. package/Neurai/test/functional/mempool_spend_coinbase.py +0 -54
  1656. package/Neurai/test/functional/mining_basic.py +0 -136
  1657. package/Neurai/test/functional/mining_getblocktemplate_longpoll.py +0 -72
  1658. package/Neurai/test/functional/mining_prioritisetransaction.py +0 -130
  1659. package/Neurai/test/functional/p2p_compactblocks.py +0 -939
  1660. package/Neurai/test/functional/p2p_disconnect_ban.py +0 -104
  1661. package/Neurai/test/functional/p2p_feefilter.py +0 -103
  1662. package/Neurai/test/functional/p2p_fingerprint.py +0 -151
  1663. package/Neurai/test/functional/p2p_leak.py +0 -149
  1664. package/Neurai/test/functional/p2p_leak_tx.py +0 -58
  1665. package/Neurai/test/functional/p2p_mempool.py +0 -40
  1666. package/Neurai/test/functional/p2p_segwit.py +0 -1988
  1667. package/Neurai/test/functional/p2p_sendheaders.py +0 -554
  1668. package/Neurai/test/functional/p2p_timeouts.py +0 -85
  1669. package/Neurai/test/functional/p2p_unrequested_blocks.py +0 -250
  1670. package/Neurai/test/functional/rpc_addressindex.py +0 -349
  1671. package/Neurai/test/functional/rpc_assettransfer.py +0 -138
  1672. package/Neurai/test/functional/rpc_bind.py +0 -108
  1673. package/Neurai/test/functional/rpc_blockchain.py +0 -220
  1674. package/Neurai/test/functional/rpc_decodescript.py +0 -210
  1675. package/Neurai/test/functional/rpc_deprecated.py +0 -26
  1676. package/Neurai/test/functional/rpc_fundrawtransaction.py +0 -716
  1677. package/Neurai/test/functional/rpc_getchaintips.py +0 -66
  1678. package/Neurai/test/functional/rpc_invalidateblock.py +0 -67
  1679. package/Neurai/test/functional/rpc_misc.py +0 -57
  1680. package/Neurai/test/functional/rpc_named_arguments.py +0 -35
  1681. package/Neurai/test/functional/rpc_net.py +0 -95
  1682. package/Neurai/test/functional/rpc_preciousblock.py +0 -113
  1683. package/Neurai/test/functional/rpc_rawtransaction.py +0 -225
  1684. package/Neurai/test/functional/rpc_setban.py +0 -50
  1685. package/Neurai/test/functional/rpc_signmessage.py +0 -40
  1686. package/Neurai/test/functional/rpc_signrawtransaction.py +0 -144
  1687. package/Neurai/test/functional/rpc_spentindex.py +0 -141
  1688. package/Neurai/test/functional/rpc_timestampindex.py +0 -60
  1689. package/Neurai/test/functional/rpc_txindex.py +0 -73
  1690. package/Neurai/test/functional/rpc_txoutproof.py +0 -85
  1691. package/Neurai/test/functional/rpc_uptime.py +0 -31
  1692. package/Neurai/test/functional/rpc_users.py +0 -154
  1693. package/Neurai/test/functional/test_framework/__init__.py +0 -0
  1694. package/Neurai/test/functional/test_framework/address.py +0 -81
  1695. package/Neurai/test/functional/test_framework/authproxy.py +0 -201
  1696. package/Neurai/test/functional/test_framework/bignum.py +0 -58
  1697. package/Neurai/test/functional/test_framework/blocktools.py +0 -116
  1698. package/Neurai/test/functional/test_framework/coverage.py +0 -113
  1699. package/Neurai/test/functional/test_framework/key.py +0 -389
  1700. package/Neurai/test/functional/test_framework/messages.py +0 -1648
  1701. package/Neurai/test/functional/test_framework/mininode.py +0 -481
  1702. package/Neurai/test/functional/test_framework/netutil.py +0 -167
  1703. package/Neurai/test/functional/test_framework/script.py +0 -707
  1704. package/Neurai/test/functional/test_framework/siphash.py +0 -64
  1705. package/Neurai/test/functional/test_framework/socks5.py +0 -161
  1706. package/Neurai/test/functional/test_framework/test_framework.py +0 -448
  1707. package/Neurai/test/functional/test_framework/test_node.py +0 -231
  1708. package/Neurai/test/functional/test_framework/util.py +0 -737
  1709. package/Neurai/test/functional/test_framework/wallet_util.py +0 -3563
  1710. package/Neurai/test/functional/test_runner.py +0 -733
  1711. package/Neurai/test/functional/wallet_abandonconflict.py +0 -153
  1712. package/Neurai/test/functional/wallet_backup.py +0 -198
  1713. package/Neurai/test/functional/wallet_basic.py +0 -426
  1714. package/Neurai/test/functional/wallet_bip44.py +0 -148
  1715. package/Neurai/test/functional/wallet_bip44_multilanguage.py +0 -195
  1716. package/Neurai/test/functional/wallet_bumpfee.py +0 -302
  1717. package/Neurai/test/functional/wallet_coinbase_category.py +0 -56
  1718. package/Neurai/test/functional/wallet_create_tx.py +0 -76
  1719. package/Neurai/test/functional/wallet_disable.py +0 -37
  1720. package/Neurai/test/functional/wallet_dump.py +0 -110
  1721. package/Neurai/test/functional/wallet_encryption.py +0 -59
  1722. package/Neurai/test/functional/wallet_groups.py +0 -89
  1723. package/Neurai/test/functional/wallet_hd.py +0 -122
  1724. package/Neurai/test/functional/wallet_import_rescan.py +0 -193
  1725. package/Neurai/test/functional/wallet_import_with_label.py +0 -86
  1726. package/Neurai/test/functional/wallet_importmulti.py +0 -453
  1727. package/Neurai/test/functional/wallet_importprunedfunds.py +0 -118
  1728. package/Neurai/test/functional/wallet_keypool.py +0 -86
  1729. package/Neurai/test/functional/wallet_keypool_topup.py +0 -75
  1730. package/Neurai/test/functional/wallet_labels.py +0 -135
  1731. package/Neurai/test/functional/wallet_listreceivedby.py +0 -146
  1732. package/Neurai/test/functional/wallet_listsinceblock.py +0 -250
  1733. package/Neurai/test/functional/wallet_listtransactions.py +0 -207
  1734. package/Neurai/test/functional/wallet_multiwallet.py +0 -91
  1735. package/Neurai/test/functional/wallet_reorgsrestore.py +0 -97
  1736. package/Neurai/test/functional/wallet_resendtransactions.py +0 -31
  1737. package/Neurai/test/functional/wallet_txn_clone.py +0 -159
  1738. package/Neurai/test/functional/wallet_txn_doublespend.py +0 -140
  1739. package/Neurai/test/functional/wallet_zapwallettxes.py +0 -78
  1740. package/Neurai/test/util/data/blanktxv1.hex +0 -1
  1741. package/Neurai/test/util/data/blanktxv1.json +0 -13
  1742. package/Neurai/test/util/data/blanktxv2.hex +0 -1
  1743. package/Neurai/test/util/data/blanktxv2.json +0 -13
  1744. package/Neurai/test/util/data/neurai-util-test.json +0 -410
  1745. package/Neurai/test/util/data/tt-delin1-out.hex +0 -1
  1746. package/Neurai/test/util/data/tt-delin1-out.json +0 -219
  1747. package/Neurai/test/util/data/tt-delout1-out.hex +0 -1
  1748. package/Neurai/test/util/data/tt-delout1-out.json +0 -215
  1749. package/Neurai/test/util/data/tt-locktime317000-out.hex +0 -1
  1750. package/Neurai/test/util/data/tt-locktime317000-out.json +0 -228
  1751. package/Neurai/test/util/data/tx394b54bb.hex +0 -1
  1752. package/Neurai/test/util/data/txcreate1.hex +0 -1
  1753. package/Neurai/test/util/data/txcreate1.json +0 -66
  1754. package/Neurai/test/util/data/txcreate2.hex +0 -1
  1755. package/Neurai/test/util/data/txcreate2.json +0 -22
  1756. package/Neurai/test/util/data/txcreatedata1.hex +0 -1
  1757. package/Neurai/test/util/data/txcreatedata1.json +0 -44
  1758. package/Neurai/test/util/data/txcreatedata2.hex +0 -1
  1759. package/Neurai/test/util/data/txcreatedata2.json +0 -44
  1760. package/Neurai/test/util/data/txcreatedata_seq0.hex +0 -1
  1761. package/Neurai/test/util/data/txcreatedata_seq0.json +0 -35
  1762. package/Neurai/test/util/data/txcreatedata_seq1.hex +0 -1
  1763. package/Neurai/test/util/data/txcreatedata_seq1.json +0 -44
  1764. package/Neurai/test/util/data/txcreatemultisig1.hex +0 -1
  1765. package/Neurai/test/util/data/txcreatemultisig1.json +0 -28
  1766. package/Neurai/test/util/data/txcreatemultisig2.hex +0 -1
  1767. package/Neurai/test/util/data/txcreatemultisig2.json +0 -26
  1768. package/Neurai/test/util/data/txcreatemultisig3.hex +0 -1
  1769. package/Neurai/test/util/data/txcreatemultisig3.json +0 -22
  1770. package/Neurai/test/util/data/txcreatemultisig4.hex +0 -1
  1771. package/Neurai/test/util/data/txcreatemultisig4.json +0 -26
  1772. package/Neurai/test/util/data/txcreatemultisig5.json +0 -26
  1773. package/Neurai/test/util/data/txcreateoutpubkey1.hex +0 -1
  1774. package/Neurai/test/util/data/txcreateoutpubkey1.json +0 -26
  1775. package/Neurai/test/util/data/txcreateoutpubkey2.hex +0 -1
  1776. package/Neurai/test/util/data/txcreateoutpubkey2.json +0 -22
  1777. package/Neurai/test/util/data/txcreateoutpubkey3.hex +0 -1
  1778. package/Neurai/test/util/data/txcreateoutpubkey3.json +0 -26
  1779. package/Neurai/test/util/data/txcreatescript1.hex +0 -1
  1780. package/Neurai/test/util/data/txcreatescript1.json +0 -22
  1781. package/Neurai/test/util/data/txcreatescript2.hex +0 -1
  1782. package/Neurai/test/util/data/txcreatescript2.json +0 -26
  1783. package/Neurai/test/util/data/txcreatescript3.hex +0 -1
  1784. package/Neurai/test/util/data/txcreatescript3.json +0 -22
  1785. package/Neurai/test/util/data/txcreatescript4.hex +0 -1
  1786. package/Neurai/test/util/data/txcreatescript4.json +0 -26
  1787. package/Neurai/test/util/data/txcreatesignv1.hex +0 -1
  1788. package/Neurai/test/util/data/txcreatesignv1.json +0 -35
  1789. package/Neurai/test/util/data/txcreatesignv2.hex +0 -1
  1790. package/Neurai/test/util/neurai-util-test.py +0 -186
  1791. package/test-getpubkey.js +0 -149
@@ -1,3589 +0,0 @@
1
- // Copyright (c) 2010 Satoshi Nakamoto
2
- // Copyright (c) 2009-2016 The Bitcoin Core developers
3
- // Copyright (c) 2017-2020 The Neurai developers
4
- // Distributed under the MIT software license, see the accompanying
5
- // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6
-
7
- #include "amount.h"
8
- #include "base58.h"
9
- #include "chain.h"
10
- #include "consensus/validation.h"
11
- #include "core_io.h"
12
- #include "httpserver.h"
13
- #include "validation.h"
14
- #include "net.h"
15
- #include "policy/feerate.h"
16
- #include "policy/fees.h"
17
- #include "policy/policy.h"
18
- #include "policy/rbf.h"
19
- #include "rpc/mining.h"
20
- #include "rpc/safemode.h"
21
- #include "rpc/server.h"
22
- #include "script/sign.h"
23
- #include "timedata.h"
24
- #include "util.h"
25
- #include "utiltime.h"
26
- #include "utilmoneystr.h"
27
- #include "wallet/coincontrol.h"
28
- #include "wallet/feebumper.h"
29
- #include "wallet/wallet.h"
30
- #include "wallet/walletdb.h"
31
-
32
- #include <init.h> // For StartShutdown
33
-
34
- #include <stdint.h>
35
-
36
- #include <univalue.h>
37
-
38
- static const std::string WALLET_ENDPOINT_BASE = "/wallet/";
39
-
40
- CWallet *GetWalletForJSONRPCRequest(const JSONRPCRequest& request)
41
- {
42
- if (request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) {
43
- // wallet endpoint was used
44
- std::string requestedWallet = urlDecode(request.URI.substr(WALLET_ENDPOINT_BASE.size()));
45
- for (CWalletRef pwallet : ::vpwallets) {
46
- if (pwallet->GetName() == requestedWallet) {
47
- return pwallet;
48
- }
49
- }
50
- throw JSONRPCError(RPC_WALLET_NOT_FOUND, "Requested wallet does not exist or is not loaded");
51
- }
52
- return ::vpwallets.size() == 1 || (request.fHelp && ::vpwallets.size() > 0) ? ::vpwallets[0] : nullptr;
53
- }
54
-
55
-
56
- std::string HelpRequiringPassphrase(CWallet * const pwallet)
57
- {
58
- return pwallet && pwallet->IsCrypted()
59
- ? "\nRequires wallet passphrase to be set with walletpassphrase call."
60
- : "";
61
- }
62
-
63
- bool EnsureWalletIsAvailable(CWallet * const pwallet, bool avoidException)
64
- {
65
- if (pwallet) return true;
66
- if (avoidException) return false;
67
- if (::vpwallets.empty()) {
68
- // Note: It isn't currently possible to trigger this error because
69
- // wallet RPC methods aren't registered unless a wallet is loaded. But
70
- // this error is being kept as a precaution, because it's possible in
71
- // the future that wallet RPC methods might get or remain registered
72
- // when no wallets are loaded.
73
- throw JSONRPCError(
74
- RPC_METHOD_NOT_FOUND, "Method not found (wallet method is disabled because no wallet is loaded)");
75
- }
76
- throw JSONRPCError(RPC_WALLET_NOT_SPECIFIED,
77
- "Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).");
78
- }
79
-
80
- void EnsureWalletIsUnlocked(CWallet * const pwallet)
81
- {
82
- if (pwallet->IsLocked()) {
83
- throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
84
- }
85
- }
86
-
87
- void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
88
- {
89
- int confirms = wtx.GetDepthInMainChain();
90
- entry.push_back(Pair("confirmations", confirms));
91
- if (wtx.IsCoinBase())
92
- entry.push_back(Pair("generated", true));
93
- if (confirms > 0)
94
- {
95
- entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
96
- entry.push_back(Pair("blockindex", wtx.nIndex));
97
- entry.push_back(Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime()));
98
- } else {
99
- entry.push_back(Pair("trusted", wtx.IsTrusted()));
100
- }
101
- uint256 hash = wtx.GetHash();
102
- entry.push_back(Pair("txid", hash.GetHex()));
103
- UniValue conflicts(UniValue::VARR);
104
- for (const uint256& conflict : wtx.GetConflicts())
105
- conflicts.push_back(conflict.GetHex());
106
- entry.push_back(Pair("walletconflicts", conflicts));
107
- entry.push_back(Pair("time", wtx.GetTxTime()));
108
- entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived));
109
-
110
- // Add opt-in RBF status
111
- std::string rbfStatus = "no";
112
- // if (confirms <= 0) {
113
- // LOCK(mempool.cs);
114
- // RBFTransactionState rbfState = IsRBFOptIn(wtx, mempool);
115
- // if (rbfState == RBF_TRANSACTIONSTATE_UNKNOWN)
116
- // rbfStatus = "unknown";
117
- // else if (rbfState == RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125)
118
- // rbfStatus = "yes";
119
- // }
120
- entry.push_back(Pair("bip125-replaceable", rbfStatus));
121
-
122
- for (const std::pair<std::string, std::string>& item : wtx.mapValue)
123
- entry.push_back(Pair(item.first, item.second));
124
- }
125
-
126
- std::string AccountFromValue(const UniValue& value)
127
- {
128
- std::string strAccount = value.get_str();
129
- if (strAccount == "*")
130
- throw JSONRPCError(RPC_WALLET_INVALID_ACCOUNT_NAME, "Invalid account name");
131
- return strAccount;
132
- }
133
-
134
- UniValue getmywords(const JSONRPCRequest& request)
135
- {
136
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
137
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
138
- return NullUniValue;
139
- }
140
-
141
- if (request.fHelp || request.params.size() > 1)
142
- throw std::runtime_error(
143
- "getmywords ( \"account\" )\n"
144
- "\nReturns the 12 words and passphrase used by BIP39 to generate the wallets private keys\n"
145
- "Only returns value if wallet was created by the 12 words import/generation\n"
146
-
147
- "\nResult:\n"
148
- "\"word_list:\" (string) A string of words separated by spaces\n"
149
- "\"passphrase:\" (optional) Only show if passphrase was used when creating the wallet\n"
150
- "\nExamples:\n"
151
- + HelpExampleCli("getmywords", "")
152
- + HelpExampleRpc("getmywords", "")
153
- );
154
-
155
- LOCK2(cs_main, pwallet->cs_wallet);
156
-
157
- EnsureWalletIsUnlocked(pwallet);
158
-
159
- if (!pwallet->GetHDChain().IsBip44()) {
160
- throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet doesn't have 12 words. Only new wallets generated by the mnemonic phrase will have 12 words");
161
- }
162
-
163
- std::vector<unsigned char> vchWords;
164
- std::vector<unsigned char> vchPassphrase;
165
- std::vector<unsigned char> vchSeed;
166
- uint256 hash;
167
-
168
- pwallet->GetBip39Data(hash, vchWords, vchPassphrase, vchSeed);
169
-
170
- UniValue ret(UniValue::VOBJ);
171
-
172
- ret.pushKV("word_list", std::string(vchWords.begin(), vchWords.end()));
173
- if (vchPassphrase.size())
174
- ret.pushKV("passphrase", std::string(vchPassphrase.begin(), vchPassphrase.end()));
175
-
176
- return ret;
177
- }
178
-
179
-
180
- UniValue getnewaddress(const JSONRPCRequest& request)
181
- {
182
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
183
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
184
- return NullUniValue;
185
- }
186
-
187
- if (request.fHelp || request.params.size() > 1)
188
- throw std::runtime_error(
189
- "getnewaddress ( \"account\" )\n"
190
- "\nReturns a new Neurai address for receiving payments.\n"
191
- "If 'account' is specified (DEPRECATED), it is added to the address book \n"
192
- "so payments received with the address will be credited to 'account'.\n"
193
- "\nArguments:\n"
194
- "1. \"account\" (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account \"\" is used. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.\n"
195
- "\nResult:\n"
196
- "\"address\" (string) The new neurai address\n"
197
- "\nExamples:\n"
198
- + HelpExampleCli("getnewaddress", "")
199
- + HelpExampleRpc("getnewaddress", "")
200
- );
201
-
202
- LOCK2(cs_main, pwallet->cs_wallet);
203
-
204
- // Parse the account first so we don't generate a key if there's an error
205
- std::string strAccount;
206
- if (!request.params[0].isNull())
207
- strAccount = AccountFromValue(request.params[0]);
208
-
209
- if (!pwallet->IsLocked()) {
210
- pwallet->TopUpKeyPool();
211
- }
212
-
213
- // Generate a new key that is added to wallet
214
- CPubKey newKey;
215
- if (!pwallet->GetKeyFromPool(newKey)) {
216
- throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
217
- }
218
- CKeyID keyID = newKey.GetID();
219
-
220
- pwallet->SetAddressBook(keyID, strAccount, "receive");
221
-
222
- return EncodeDestination(keyID);
223
- }
224
-
225
-
226
- CTxDestination GetAccountAddress(CWallet* const pwallet, std::string strAccount, bool bForceNew=false)
227
- {
228
- CPubKey pubKey;
229
- if (!pwallet->GetAccountPubkey(pubKey, strAccount, bForceNew)) {
230
- throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
231
- }
232
-
233
- return pubKey.GetID();
234
- }
235
-
236
- UniValue getaccountaddress(const JSONRPCRequest& request)
237
- {
238
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
239
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
240
- return NullUniValue;
241
- }
242
-
243
- if (request.fHelp || request.params.size() != 1)
244
- throw std::runtime_error(
245
- "getaccountaddress \"account\"\n"
246
- "\nDEPRECATED. Returns the current Neurai address for receiving payments to this account.\n"
247
- "\nArguments:\n"
248
- "1. \"account\" (string, required) The account name for the address. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name.\n"
249
- "\nResult:\n"
250
- "\"address\" (string) The account neurai address\n"
251
- "\nExamples:\n"
252
- + HelpExampleCli("getaccountaddress", "")
253
- + HelpExampleCli("getaccountaddress", "\"\"")
254
- + HelpExampleCli("getaccountaddress", "\"myaccount\"")
255
- + HelpExampleRpc("getaccountaddress", "\"myaccount\"")
256
- );
257
-
258
- LOCK2(cs_main, pwallet->cs_wallet);
259
-
260
- // Parse the account first so we don't generate a key if there's an error
261
- std::string strAccount = AccountFromValue(request.params[0]);
262
-
263
- UniValue ret(UniValue::VSTR);
264
-
265
- ret = EncodeDestination(GetAccountAddress(pwallet, strAccount));
266
- return ret;
267
- }
268
-
269
-
270
- UniValue getrawchangeaddress(const JSONRPCRequest& request)
271
- {
272
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
273
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
274
- return NullUniValue;
275
- }
276
-
277
- if (request.fHelp || request.params.size() > 0)
278
- throw std::runtime_error(
279
- "getrawchangeaddress\n"
280
- "\nReturns a new Neurai address, for receiving change.\n"
281
- "This is for use with raw transactions, NOT normal use.\n"
282
- "\nResult:\n"
283
- "\"address\" (string) The address\n"
284
- "\nExamples:\n"
285
- + HelpExampleCli("getrawchangeaddress", "")
286
- + HelpExampleRpc("getrawchangeaddress", "")
287
- );
288
-
289
- LOCK2(cs_main, pwallet->cs_wallet);
290
-
291
- if (!pwallet->IsLocked()) {
292
- pwallet->TopUpKeyPool();
293
- }
294
-
295
- CReserveKey reservekey(pwallet);
296
- CPubKey vchPubKey;
297
- if (!reservekey.GetReservedKey(vchPubKey, true))
298
- throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
299
-
300
- reservekey.KeepKey();
301
-
302
- CKeyID keyID = vchPubKey.GetID();
303
-
304
- return EncodeDestination(keyID);
305
- }
306
-
307
-
308
- UniValue setaccount(const JSONRPCRequest& request)
309
- {
310
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
311
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
312
- return NullUniValue;
313
- }
314
-
315
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
316
- throw std::runtime_error(
317
- "setaccount \"address\" \"account\"\n"
318
- "\nDEPRECATED. Sets the account associated with the given address.\n"
319
- "\nArguments:\n"
320
- "1. \"address\" (string, required) The neurai address to be associated with an account.\n"
321
- "2. \"account\" (string, required) The account to assign the address to.\n"
322
- "\nExamples:\n"
323
- + HelpExampleCli("setaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"tabby\"")
324
- + HelpExampleRpc("setaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"tabby\"")
325
- );
326
-
327
- LOCK2(cs_main, pwallet->cs_wallet);
328
-
329
- CTxDestination dest = DecodeDestination(request.params[0].get_str());
330
- if (!IsValidDestination(dest)) {
331
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Neurai address");
332
- }
333
-
334
- std::string strAccount;
335
- if (!request.params[1].isNull())
336
- strAccount = AccountFromValue(request.params[1]);
337
-
338
- // Only add the account if the address is yours.
339
- if (IsMine(*pwallet, dest)) {
340
- // Detect when changing the account of an address that is the 'unused current key' of another account:
341
- if (pwallet->mapAddressBook.count(dest)) {
342
- std::string strOldAccount = pwallet->mapAddressBook[dest].name;
343
- if (dest == GetAccountAddress(pwallet, strOldAccount)) {
344
- GetAccountAddress(pwallet, strOldAccount, true);
345
- }
346
- }
347
- pwallet->SetAddressBook(dest, strAccount, "receive");
348
- }
349
- else
350
- throw JSONRPCError(RPC_MISC_ERROR, "setaccount can only be used with own address");
351
-
352
- return NullUniValue;
353
- }
354
-
355
-
356
- UniValue getaccount(const JSONRPCRequest& request)
357
- {
358
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
359
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
360
- return NullUniValue;
361
- }
362
-
363
- if (request.fHelp || request.params.size() != 1)
364
- throw std::runtime_error(
365
- "getaccount \"address\"\n"
366
- "\nDEPRECATED. Returns the account associated with the given address.\n"
367
- "\nArguments:\n"
368
- "1. \"address\" (string, required) The neurai address for account lookup.\n"
369
- "\nResult:\n"
370
- "\"accountname\" (string) the account address\n"
371
- "\nExamples:\n"
372
- + HelpExampleCli("getaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"")
373
- + HelpExampleRpc("getaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"")
374
- );
375
-
376
- LOCK2(cs_main, pwallet->cs_wallet);
377
-
378
- CTxDestination dest = DecodeDestination(request.params[0].get_str());
379
- if (!IsValidDestination(dest)) {
380
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Neurai address");
381
- }
382
-
383
- std::string strAccount;
384
- std::map<CTxDestination, CAddressBookData>::iterator mi = pwallet->mapAddressBook.find(dest);
385
- if (mi != pwallet->mapAddressBook.end() && !(*mi).second.name.empty()) {
386
- strAccount = (*mi).second.name;
387
- }
388
- return strAccount;
389
- }
390
-
391
-
392
- UniValue getaddressesbyaccount(const JSONRPCRequest& request)
393
- {
394
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
395
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
396
- return NullUniValue;
397
- }
398
-
399
- if (request.fHelp || request.params.size() != 1)
400
- throw std::runtime_error(
401
- "getaddressesbyaccount \"account\"\n"
402
- "\nDEPRECATED. Returns the list of addresses for the given account.\n"
403
- "\nArguments:\n"
404
- "1. \"account\" (string, required) The account name.\n"
405
- "\nResult:\n"
406
- "[ (json array of string)\n"
407
- " \"address\" (string) a neurai address associated with the given account\n"
408
- " ,...\n"
409
- "]\n"
410
- "\nExamples:\n"
411
- + HelpExampleCli("getaddressesbyaccount", "\"tabby\"")
412
- + HelpExampleRpc("getaddressesbyaccount", "\"tabby\"")
413
- );
414
-
415
- LOCK2(cs_main, pwallet->cs_wallet);
416
-
417
- std::string strAccount = AccountFromValue(request.params[0]);
418
-
419
- // Find all addresses that have the given account
420
- UniValue ret(UniValue::VARR);
421
- for (const std::pair<CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook) {
422
- const CTxDestination& dest = item.first;
423
- const std::string& strName = item.second.name;
424
- if (strName == strAccount) {
425
- ret.push_back(EncodeDestination(dest));
426
- }
427
- }
428
- return ret;
429
- }
430
-
431
- static void SendMoney(CWallet * const pwallet, const CTxDestination &address, CAmount nValue, bool fSubtractFeeFromAmount, CWalletTx& wtxNew, const CCoinControl& coin_control)
432
- {
433
- CAmount curBalance = pwallet->GetBalance();
434
-
435
- // Check amount
436
- if (nValue <= 0)
437
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid amount (2)");
438
-
439
- if (nValue > curBalance)
440
- throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds");
441
-
442
- if (pwallet->GetBroadcastTransactions() && !g_connman) {
443
- throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
444
- }
445
-
446
- // Parse Neurai address
447
- CScript scriptPubKey = GetScriptForDestination(address);
448
-
449
- // Create and send the transaction
450
- CReserveKey reservekey(pwallet);
451
- CAmount nFeeRequired;
452
- std::string strError;
453
- std::vector<CRecipient> vecSend;
454
- int nChangePosRet = -1;
455
- CRecipient recipient = {scriptPubKey, nValue, fSubtractFeeFromAmount};
456
- vecSend.push_back(recipient);
457
- if (!pwallet->CreateTransaction(vecSend, wtxNew, reservekey, nFeeRequired, nChangePosRet, strError, coin_control)) {
458
- if (!fSubtractFeeFromAmount && nValue + nFeeRequired > curBalance)
459
- strError = strprintf("Error: This transaction requires a transaction fee of at least %s", FormatMoney(nFeeRequired));
460
- throw JSONRPCError(RPC_WALLET_ERROR, strError);
461
- }
462
- CValidationState state;
463
- if (!pwallet->CommitTransaction(wtxNew, reservekey, g_connman.get(), state)) {
464
- strError = strprintf("Error: The transaction was rejected! Reason given: %s", state.GetRejectReason());
465
- throw JSONRPCError(RPC_WALLET_ERROR, strError);
466
- }
467
- }
468
-
469
- UniValue sendtoaddress(const JSONRPCRequest& request)
470
- {
471
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
472
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
473
- return NullUniValue;
474
- }
475
-
476
- if (request.fHelp || request.params.size() < 2 || request.params.size() > 7)
477
- throw std::runtime_error(
478
- "sendtoaddress \"address\" amount ( \"comment\" \"comment_to\" subtractfeefromamount replaceable conf_target \"estimate_mode\")\n"
479
- "\nSend an amount to a given address.\n"
480
- + HelpRequiringPassphrase(pwallet) +
481
- "\nArguments:\n"
482
- "1. \"address\" (string, required) The neurai address to send to.\n"
483
- "2. \"amount\" (numeric or string, required) The amount in " + CURRENCY_UNIT + " to send. eg 0.1\n"
484
- "3. \"comment\" (string, optional) A comment used to store what the transaction is for. \n"
485
- " This is not part of the transaction, just kept in your wallet.\n"
486
- "4. \"comment_to\" (string, optional) A comment to store the name of the person or organization \n"
487
- " to which you're sending the transaction. This is not part of the \n"
488
- " transaction, just kept in your wallet.\n"
489
- "5. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent.\n"
490
- " The recipient will receive less neurais than you enter in the amount field.\n"
491
- // "6. replaceable (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees via BIP 125\n"
492
- "6. conf_target (numeric, optional) Confirmation target (in blocks)\n"
493
- "7. \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n"
494
- " \"UNSET\"\n"
495
- " \"ECONOMICAL\"\n"
496
- " \"CONSERVATIVE\"\n"
497
- "\nResult:\n"
498
- "\"txid\" (string) The transaction id.\n"
499
- "\nExamples:\n"
500
- + HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1")
501
- + HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"donation\" \"seans outpost\"")
502
- + HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true")
503
- + HelpExampleRpc("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"donation\", \"seans outpost\"")
504
- );
505
-
506
- ObserveSafeMode();
507
- LOCK2(cs_main, pwallet->cs_wallet);
508
-
509
- CTxDestination dest = DecodeDestination(request.params[0].get_str());
510
- if (!IsValidDestination(dest)) {
511
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address");
512
- }
513
-
514
- // Amount
515
- CAmount nAmount = AmountFromValue(request.params[1]);
516
- if (nAmount <= 0)
517
- throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send");
518
-
519
- // Wallet comments
520
- CWalletTx wtx;
521
- if (!request.params[2].isNull() && !request.params[2].get_str().empty())
522
- wtx.mapValue["comment"] = request.params[2].get_str();
523
- if (!request.params[3].isNull() && !request.params[3].get_str().empty())
524
- wtx.mapValue["to"] = request.params[3].get_str();
525
-
526
- bool fSubtractFeeFromAmount = false;
527
- if (!request.params[4].isNull()) {
528
- fSubtractFeeFromAmount = request.params[4].get_bool();
529
- }
530
-
531
- CCoinControl coin_control;
532
- // if (!request.params[5].isNull()) {
533
- // coin_control.signalRbf = request.params[5].get_bool();
534
- // }
535
-
536
- if (!request.params[5].isNull()) {
537
- coin_control.m_confirm_target = ParseConfirmTarget(request.params[6]);
538
- }
539
-
540
- if (!request.params[6].isNull()) {
541
- if (!FeeModeFromString(request.params[7].get_str(), coin_control.m_fee_mode)) {
542
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid estimate_mode parameter");
543
- }
544
- }
545
-
546
-
547
- EnsureWalletIsUnlocked(pwallet);
548
-
549
- SendMoney(pwallet, dest, nAmount, fSubtractFeeFromAmount, wtx, coin_control);
550
-
551
- return wtx.GetHash().GetHex();
552
- }
553
-
554
- UniValue sendfromaddress(const JSONRPCRequest& request)
555
- {
556
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
557
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
558
- return NullUniValue;
559
- }
560
-
561
- if (request.fHelp || request.params.size() < 3 || request.params.size() > 8)
562
- throw std::runtime_error(
563
- "sendfromaddress \"from_address\" \"to_address\" amount ( \"comment\" \"comment_to\" subtractfeefromamount replaceable conf_target \"estimate_mode\")\n"
564
- "\nSend an amount from a specific address to a given address. All xna change will get sent back to the from_address\n"
565
- + HelpRequiringPassphrase(pwallet) +
566
- "\nArguments:\n"
567
- "1. \"from_address\" (string, required) The neurai address to send from.\n"
568
- "2. \"to_address\" (string, required) The neurai address to send to.\n"
569
- "3. \"amount\" (numeric or string, required) The amount in " + CURRENCY_UNIT + " to send. eg 0.1\n"
570
- "4. \"comment\" (string, optional) A comment used to store what the transaction is for. \n"
571
- " This is not part of the transaction, just kept in your wallet.\n"
572
- "5. \"comment_to\" (string, optional) A comment to store the name of the person or organization \n"
573
- " to which you're sending the transaction. This is not part of the \n"
574
- " transaction, just kept in your wallet.\n"
575
- "6. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent.\n"
576
- " The recipient will receive less neurais than you enter in the amount field.\n"
577
- "7. conf_target (numeric, optional) Confirmation target (in blocks)\n"
578
- "8. \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n"
579
- " \"UNSET\"\n"
580
- " \"ECONOMICAL\"\n"
581
- " \"CONSERVATIVE\"\n"
582
- "\nResult:\n"
583
- "\"txid\" (string) The transaction id.\n"
584
- "\nExamples:\n"
585
- + HelpExampleCli("sendfromaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1")
586
- + HelpExampleCli("sendfromaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"donation\" \"seans outpost\"")
587
- + HelpExampleCli("sendfromaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true")
588
- + HelpExampleRpc("sendfromaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"donation\", \"seans outpost\"")
589
- );
590
-
591
- ObserveSafeMode();
592
- LOCK2(cs_main, pwallet->cs_wallet);
593
-
594
- CCoinControl coin_control;
595
-
596
- std::string from_address = request.params[0].get_str();
597
- CTxDestination from_dest = DecodeDestination(from_address);
598
- if (!IsValidDestination(from_dest)) {
599
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid from address");
600
- }
601
- coin_control.destChange = from_dest;
602
-
603
- CTxDestination dest = DecodeDestination(request.params[1].get_str());
604
- if (!IsValidDestination(dest)) {
605
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address");
606
- }
607
-
608
- // Amount
609
- CAmount nAmount = AmountFromValue(request.params[2]);
610
- if (nAmount <= 0)
611
- throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send");
612
-
613
- // Get the coins that belong to the from address
614
- std::vector<COutput> coins;
615
- pwallet->AvailableCoins(coins);
616
-
617
- CAmount nAmountFromCoins = 0;
618
- for (auto out : coins) {
619
- // Get the address that the coin resides in, because to send a valid message. You need to send it to the same address that it currently resides in.
620
- CTxDestination coin_dest;
621
- CAmount nCoinAmount = out.tx->tx->vout[out.i].nValue;
622
- ExtractDestination(out.tx->tx->vout[out.i].scriptPubKey, coin_dest);
623
-
624
- if (nCoinAmount <= 0)
625
- continue;
626
-
627
- if (from_address != EncodeDestination(coin_dest))
628
- continue;
629
-
630
- coin_control.Select(COutPoint(out.tx->GetHash(), out.i));
631
- nAmountFromCoins += out.tx->tx->vout[out.i].nValue;
632
-
633
- if (nAmountFromCoins >= nAmount)
634
- break;
635
- }
636
-
637
- if (nAmountFromCoins < nAmount)
638
- throw JSONRPCError(RPC_TYPE_ERROR, "From Address doesn't contain enough funds");
639
-
640
- // Wallet comments
641
- CWalletTx wtx;
642
- if (!request.params[3].isNull() && !request.params[2].get_str().empty())
643
- wtx.mapValue["comment"] = request.params[2].get_str();
644
- if (!request.params[4].isNull() && !request.params[3].get_str().empty())
645
- wtx.mapValue["to"] = request.params[3].get_str();
646
-
647
- bool fSubtractFeeFromAmount = false;
648
- if (!request.params[5].isNull()) {
649
- fSubtractFeeFromAmount = request.params[4].get_bool();
650
- }
651
-
652
- if (!request.params[6].isNull()) {
653
- coin_control.m_confirm_target = ParseConfirmTarget(request.params[6]);
654
- }
655
-
656
- if (!request.params[7].isNull()) {
657
- if (!FeeModeFromString(request.params[8].get_str(), coin_control.m_fee_mode)) {
658
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid estimate_mode parameter");
659
- }
660
- }
661
-
662
- EnsureWalletIsUnlocked(pwallet);
663
-
664
- SendMoney(pwallet, dest, nAmount, fSubtractFeeFromAmount, wtx, coin_control);
665
-
666
- return wtx.GetHash().GetHex();
667
- }
668
-
669
-
670
-
671
- UniValue listaddressgroupings(const JSONRPCRequest& request)
672
- {
673
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
674
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
675
- return NullUniValue;
676
- }
677
-
678
- if (request.fHelp || request.params.size() != 0)
679
- throw std::runtime_error(
680
- "listaddressgroupings\n"
681
- "\nLists groups of addresses which have had their common ownership\n"
682
- "made public by common use as inputs or as the resulting change\n"
683
- "in past transactions\n"
684
- "\nResult:\n"
685
- "[\n"
686
- " [\n"
687
- " [\n"
688
- " \"address\", (string) The neurai address\n"
689
- " amount, (numeric) The amount in " + CURRENCY_UNIT + "\n"
690
- " \"account\" (string, optional) DEPRECATED. The account\n"
691
- " ]\n"
692
- " ,...\n"
693
- " ]\n"
694
- " ,...\n"
695
- "]\n"
696
- "\nExamples:\n"
697
- + HelpExampleCli("listaddressgroupings", "")
698
- + HelpExampleRpc("listaddressgroupings", "")
699
- );
700
-
701
- ObserveSafeMode();
702
- LOCK2(cs_main, pwallet->cs_wallet);
703
-
704
- UniValue jsonGroupings(UniValue::VARR);
705
- std::map<CTxDestination, CAmount> balances = pwallet->GetAddressBalances();
706
- for (const std::set<CTxDestination>& grouping : pwallet->GetAddressGroupings()) {
707
- UniValue jsonGrouping(UniValue::VARR);
708
- for (const CTxDestination& address : grouping)
709
- {
710
- UniValue addressInfo(UniValue::VARR);
711
- addressInfo.push_back(EncodeDestination(address));
712
- addressInfo.push_back(ValueFromAmount(balances[address]));
713
- {
714
- if (pwallet->mapAddressBook.find(address) != pwallet->mapAddressBook.end()) {
715
- addressInfo.push_back(pwallet->mapAddressBook.find(address)->second.name);
716
- }
717
- }
718
- jsonGrouping.push_back(addressInfo);
719
- }
720
- jsonGroupings.push_back(jsonGrouping);
721
- }
722
- return jsonGroupings;
723
- }
724
-
725
- UniValue signmessage(const JSONRPCRequest& request)
726
- {
727
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
728
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
729
- return NullUniValue;
730
- }
731
-
732
- if (request.fHelp || request.params.size() != 2)
733
- throw std::runtime_error(
734
- "signmessage \"address\" \"message\"\n"
735
- "\nSign a message with the private key of an address"
736
- + HelpRequiringPassphrase(pwallet) + "\n"
737
- "\nArguments:\n"
738
- "1. \"address\" (string, required) The neurai address to use for the private key.\n"
739
- "2. \"message\" (string, required) The message to create a signature of.\n"
740
- "\nResult:\n"
741
- "\"signature\" (string) The signature of the message encoded in base 64\n"
742
- "\nExamples:\n"
743
- "\nUnlock the wallet for 30 seconds\n"
744
- + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") +
745
- "\nCreate the signature\n"
746
- + HelpExampleCli("signmessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"my message\"") +
747
- "\nVerify the signature\n"
748
- + HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"") +
749
- "\nAs json rpc\n"
750
- + HelpExampleRpc("signmessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"my message\"")
751
- );
752
-
753
- LOCK2(cs_main, pwallet->cs_wallet);
754
-
755
- EnsureWalletIsUnlocked(pwallet);
756
-
757
- std::string strAddress = request.params[0].get_str();
758
- std::string strMessage = request.params[1].get_str();
759
-
760
- CTxDestination dest = DecodeDestination(strAddress);
761
- if (!IsValidDestination(dest)) {
762
- throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
763
- }
764
-
765
- const CKeyID *keyID = boost::get<CKeyID>(&dest);
766
- if (!keyID) {
767
- throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
768
- }
769
-
770
- CKey key;
771
- if (!pwallet->GetKey(*keyID, key)) {
772
- throw JSONRPCError(RPC_WALLET_ERROR, "Private key not available");
773
- }
774
-
775
- CHashWriter ss(SER_GETHASH, 0);
776
- ss << strMessageMagic;
777
- ss << strMessage;
778
-
779
- std::vector<unsigned char> vchSig;
780
- if (!key.SignCompact(ss.GetHash(), vchSig))
781
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed");
782
-
783
- return EncodeBase64(vchSig.data(), vchSig.size());
784
- }
785
-
786
- UniValue getreceivedbyaddress(const JSONRPCRequest& request)
787
- {
788
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
789
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
790
- return NullUniValue;
791
- }
792
-
793
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
794
- throw std::runtime_error(
795
- "getreceivedbyaddress \"address\" ( minconf )\n"
796
- "\nReturns the total amount received by the given address in transactions with at least minconf confirmations.\n"
797
- "\nArguments:\n"
798
- "1. \"address\" (string, required) The neurai address for transactions.\n"
799
- "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n"
800
- "\nResult:\n"
801
- "amount (numeric) The total amount in " + CURRENCY_UNIT + " received at this address.\n"
802
- "\nExamples:\n"
803
- "\nThe amount from transactions with at least 1 confirmation\n"
804
- + HelpExampleCli("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"") +
805
- "\nThe amount including unconfirmed transactions, zero confirmations\n"
806
- + HelpExampleCli("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 0") +
807
- "\nThe amount with at least 6 confirmations\n"
808
- + HelpExampleCli("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 6") +
809
- "\nAs a json rpc call\n"
810
- + HelpExampleRpc("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", 6")
811
- );
812
-
813
- ObserveSafeMode();
814
- LOCK2(cs_main, pwallet->cs_wallet);
815
-
816
- // Neurai address
817
- CTxDestination dest = DecodeDestination(request.params[0].get_str());
818
- if (!IsValidDestination(dest)) {
819
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Neurai address");
820
- }
821
- CScript scriptPubKey = GetScriptForDestination(dest);
822
- if (!IsMine(*pwallet, scriptPubKey)) {
823
- return ValueFromAmount(0);
824
- }
825
-
826
- // Minimum confirmations
827
- int nMinDepth = 1;
828
- if (!request.params[1].isNull())
829
- nMinDepth = request.params[1].get_int();
830
-
831
- // Tally
832
- CAmount nAmount = 0;
833
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
834
- const CWalletTx& wtx = pairWtx.second;
835
- if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))
836
- continue;
837
-
838
- for (const CTxOut& txout : wtx.tx->vout)
839
- if (txout.scriptPubKey == scriptPubKey)
840
- if (wtx.GetDepthInMainChain() >= nMinDepth)
841
- nAmount += txout.nValue;
842
- }
843
-
844
- return ValueFromAmount(nAmount);
845
- }
846
-
847
-
848
- UniValue getreceivedbyaccount(const JSONRPCRequest& request)
849
- {
850
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
851
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
852
- return NullUniValue;
853
- }
854
-
855
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
856
- throw std::runtime_error(
857
- "getreceivedbyaccount \"account\" ( minconf )\n"
858
- "\nDEPRECATED. Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.\n"
859
- "\nArguments:\n"
860
- "1. \"account\" (string, required) The selected account, may be the default account using \"\".\n"
861
- "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n"
862
- "\nResult:\n"
863
- "amount (numeric) The total amount in " + CURRENCY_UNIT + " received for this account.\n"
864
- "\nExamples:\n"
865
- "\nAmount received by the default account with at least 1 confirmation\n"
866
- + HelpExampleCli("getreceivedbyaccount", "\"\"") +
867
- "\nAmount received at the tabby account including unconfirmed amounts with zero confirmations\n"
868
- + HelpExampleCli("getreceivedbyaccount", "\"tabby\" 0") +
869
- "\nThe amount with at least 6 confirmations\n"
870
- + HelpExampleCli("getreceivedbyaccount", "\"tabby\" 6") +
871
- "\nAs a json rpc call\n"
872
- + HelpExampleRpc("getreceivedbyaccount", "\"tabby\", 6")
873
- );
874
-
875
- ObserveSafeMode();
876
- LOCK2(cs_main, pwallet->cs_wallet);
877
-
878
- // Minimum confirmations
879
- int nMinDepth = 1;
880
- if (!request.params[1].isNull())
881
- nMinDepth = request.params[1].get_int();
882
-
883
- // Get the set of pub keys assigned to account
884
- std::string strAccount = AccountFromValue(request.params[0]);
885
- std::set<CTxDestination> setAddress = pwallet->GetAccountAddresses(strAccount);
886
-
887
- // Tally
888
- CAmount nAmount = 0;
889
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
890
- const CWalletTx& wtx = pairWtx.second;
891
- if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))
892
- continue;
893
-
894
- for (const CTxOut& txout : wtx.tx->vout)
895
- {
896
- CTxDestination address;
897
- if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*pwallet, address) && setAddress.count(address)) {
898
- if (wtx.GetDepthInMainChain() >= nMinDepth)
899
- nAmount += txout.nValue;
900
- }
901
- }
902
- }
903
-
904
- return ValueFromAmount(nAmount);
905
- }
906
-
907
-
908
- UniValue getbalance(const JSONRPCRequest& request)
909
- {
910
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
911
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
912
- return NullUniValue;
913
- }
914
-
915
- if (request.fHelp || request.params.size() > 3)
916
- throw std::runtime_error(
917
- "getbalance ( \"account\" minconf include_watchonly )\n"
918
- "\nIf account is not specified, returns the server's total available balance.\n"
919
- "If account is specified (DEPRECATED), returns the balance in the account.\n"
920
- "Note that the account \"\" is not the same as leaving the parameter out.\n"
921
- "The server total may be different to the balance in the default \"\" account.\n"
922
- "\nArguments:\n"
923
- "1. \"account\" (string, optional) DEPRECATED. The account string may be given as a\n"
924
- " specific account name to find the balance associated with wallet keys in\n"
925
- " a named account, or as the empty string (\"\") to find the balance\n"
926
- " associated with wallet keys not in any named account, or as \"*\" to find\n"
927
- " the balance associated with all wallet keys regardless of account.\n"
928
- " When this option is specified, it calculates the balance in a different\n"
929
- " way than when it is not specified, and which can count spends twice when\n"
930
- " there are conflicting pending transactions (such as those created by\n"
931
- " the bumpfee command), temporarily resulting in low or even negative\n"
932
- " balances. In general, account balance calculation is not considered\n"
933
- " reliable and has resulted in confusing outcomes, so it is recommended to\n"
934
- " avoid passing this argument.\n"
935
- "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n"
936
- "3. include_watchonly (bool, optional, default=false) Also include balance in watch-only addresses (see 'importaddress')\n"
937
- "\nResult:\n"
938
- "amount (numeric) The total amount in " + CURRENCY_UNIT + " received for this account.\n"
939
- "\nExamples:\n"
940
- "\nThe total amount in the wallet with 1 or more confirmations\n"
941
- + HelpExampleCli("getbalance", "") +
942
- "\nThe total amount in the wallet at least 6 blocks confirmed\n"
943
- + HelpExampleCli("getbalance", "\"*\" 6") +
944
- "\nAs a json rpc call\n"
945
- + HelpExampleRpc("getbalance", "\"*\", 6")
946
- );
947
-
948
- ObserveSafeMode();
949
- LOCK2(cs_main, pwallet->cs_wallet);
950
-
951
- const UniValue& account_value = request.params[0];
952
- const UniValue& minconf = request.params[1];
953
- const UniValue& include_watchonly = request.params[2];
954
-
955
- if (account_value.isNull()) {
956
- if (!minconf.isNull()) {
957
- throw JSONRPCError(RPC_INVALID_PARAMETER,
958
- "getbalance minconf option is only currently supported if an account is specified");
959
- }
960
- if (!include_watchonly.isNull()) {
961
- throw JSONRPCError(RPC_INVALID_PARAMETER,
962
- "getbalance include_watchonly option is only currently supported if an account is specified");
963
- }
964
- return ValueFromAmount(pwallet->GetBalance());
965
- }
966
-
967
- const std::string& account_param = account_value.get_str();
968
- const std::string* account = account_param != "*" ? &account_param : nullptr;
969
-
970
- int nMinDepth = 1;
971
- if (!minconf.isNull())
972
- nMinDepth = minconf.get_int();
973
- isminefilter filter = ISMINE_SPENDABLE;
974
- if(!include_watchonly.isNull())
975
- if(include_watchonly.get_bool())
976
- filter = filter | ISMINE_WATCH_ONLY;
977
-
978
- return ValueFromAmount(pwallet->GetLegacyBalance(filter, nMinDepth, account));
979
- }
980
-
981
- UniValue getunconfirmedbalance(const JSONRPCRequest &request)
982
- {
983
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
984
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
985
- return NullUniValue;
986
- }
987
-
988
- if (request.fHelp || request.params.size() > 0)
989
- throw std::runtime_error(
990
- "getunconfirmedbalance\n"
991
- "Returns the server's total unconfirmed balance\n");
992
-
993
- ObserveSafeMode();
994
- LOCK2(cs_main, pwallet->cs_wallet);
995
-
996
- return ValueFromAmount(pwallet->GetUnconfirmedBalance());
997
- }
998
-
999
-
1000
- UniValue movecmd(const JSONRPCRequest& request)
1001
- {
1002
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1003
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1004
- return NullUniValue;
1005
- }
1006
-
1007
- if (request.fHelp || request.params.size() < 3 || request.params.size() > 5)
1008
- throw std::runtime_error(
1009
- "move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n"
1010
- "\nDEPRECATED. Move a specified amount from one account in your wallet to another.\n"
1011
- "\nArguments:\n"
1012
- "1. \"fromaccount\" (string, required) The name of the account to move funds from. May be the default account using \"\".\n"
1013
- "2. \"toaccount\" (string, required) The name of the account to move funds to. May be the default account using \"\".\n"
1014
- "3. amount (numeric) Quantity of " + CURRENCY_UNIT + " to move between accounts.\n"
1015
- "4. (dummy) (numeric, optional) Ignored. Remains for backward compatibility.\n"
1016
- "5. \"comment\" (string, optional) An optional comment, stored in the wallet only.\n"
1017
- "\nResult:\n"
1018
- "true|false (boolean) true if successful.\n"
1019
- "\nExamples:\n"
1020
- "\nMove 0.01 " + CURRENCY_UNIT + " from the default account to the account named tabby\n"
1021
- + HelpExampleCli("move", "\"\" \"tabby\" 0.01") +
1022
- "\nMove 0.01 " + CURRENCY_UNIT + " timotei to akiko with a comment and funds have 6 confirmations\n"
1023
- + HelpExampleCli("move", "\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") +
1024
- "\nAs a json rpc call\n"
1025
- + HelpExampleRpc("move", "\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"")
1026
- );
1027
-
1028
- ObserveSafeMode();
1029
- LOCK2(cs_main, pwallet->cs_wallet);
1030
-
1031
- std::string strFrom = AccountFromValue(request.params[0]);
1032
- std::string strTo = AccountFromValue(request.params[1]);
1033
- CAmount nAmount = AmountFromValue(request.params[2]);
1034
- if (nAmount <= 0)
1035
- throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send");
1036
- if (!request.params[3].isNull())
1037
- // unused parameter, used to be nMinDepth, keep type-checking it though
1038
- (void)request.params[3].get_int();
1039
- std::string strComment;
1040
- if (!request.params[4].isNull())
1041
- strComment = request.params[4].get_str();
1042
-
1043
- if (!pwallet->AccountMove(strFrom, strTo, nAmount, strComment)) {
1044
- throw JSONRPCError(RPC_DATABASE_ERROR, "database error");
1045
- }
1046
-
1047
- return true;
1048
- }
1049
-
1050
-
1051
- UniValue sendfrom(const JSONRPCRequest& request)
1052
- {
1053
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1054
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1055
- return NullUniValue;
1056
- }
1057
-
1058
- if (request.fHelp || request.params.size() < 3 || request.params.size() > 6)
1059
- throw std::runtime_error(
1060
- "sendfrom \"fromaccount\" \"toaddress\" amount ( minconf \"comment\" \"comment_to\" )\n"
1061
- "\nDEPRECATED (use sendtoaddress). Sent an amount from an account to a neurai address."
1062
- + HelpRequiringPassphrase(pwallet) + "\n"
1063
- "\nArguments:\n"
1064
- "1. \"fromaccount\" (string, required) The name of the account to send funds from. May be the default account using \"\".\n"
1065
- " Specifying an account does not influence coin selection, but it does associate the newly created\n"
1066
- " transaction with the account, so the account's balance computation and transaction history can reflect\n"
1067
- " the spend.\n"
1068
- "2. \"toaddress\" (string, required) The neurai address to send funds to.\n"
1069
- "3. amount (numeric or string, required) The amount in " + CURRENCY_UNIT + " (transaction fee is added on top).\n"
1070
- "4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n"
1071
- "5. \"comment\" (string, optional) A comment used to store what the transaction is for. \n"
1072
- " This is not part of the transaction, just kept in your wallet.\n"
1073
- "6. \"comment_to\" (string, optional) An optional comment to store the name of the person or organization \n"
1074
- " to which you're sending the transaction. This is not part of the transaction, \n"
1075
- " it is just kept in your wallet.\n"
1076
- "\nResult:\n"
1077
- "\"txid\" (string) The transaction id.\n"
1078
- "\nExamples:\n"
1079
- "\nSend 0.01 " + CURRENCY_UNIT + " from the default account to the address, must have at least 1 confirmation\n"
1080
- + HelpExampleCli("sendfrom", "\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") +
1081
- "\nSend 0.01 from the tabby account to the given address, funds must have at least 6 confirmations\n"
1082
- + HelpExampleCli("sendfrom", "\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01 6 \"donation\" \"seans outpost\"") +
1083
- "\nAs a json rpc call\n"
1084
- + HelpExampleRpc("sendfrom", "\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.01, 6, \"donation\", \"seans outpost\"")
1085
- );
1086
-
1087
- ObserveSafeMode();
1088
- LOCK2(cs_main, pwallet->cs_wallet);
1089
-
1090
- std::string strAccount = AccountFromValue(request.params[0]);
1091
- CTxDestination dest = DecodeDestination(request.params[1].get_str());
1092
- if (!IsValidDestination(dest)) {
1093
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Neurai address");
1094
- }
1095
- CAmount nAmount = AmountFromValue(request.params[2]);
1096
- if (nAmount <= 0)
1097
- throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send");
1098
- int nMinDepth = 1;
1099
- if (!request.params[3].isNull())
1100
- nMinDepth = request.params[3].get_int();
1101
-
1102
- CWalletTx wtx;
1103
- wtx.strFromAccount = strAccount;
1104
- if (!request.params[4].isNull() && !request.params[4].get_str().empty())
1105
- wtx.mapValue["comment"] = request.params[4].get_str();
1106
- if (!request.params[5].isNull() && !request.params[5].get_str().empty())
1107
- wtx.mapValue["to"] = request.params[5].get_str();
1108
-
1109
- EnsureWalletIsUnlocked(pwallet);
1110
-
1111
- // Check funds
1112
- CAmount nBalance = pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, &strAccount);
1113
- if (nAmount > nBalance)
1114
- throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
1115
-
1116
- CCoinControl no_coin_control; // This is a deprecated API
1117
- SendMoney(pwallet, dest, nAmount, false, wtx, no_coin_control);
1118
-
1119
- return wtx.GetHash().GetHex();
1120
- }
1121
-
1122
-
1123
- UniValue sendmany(const JSONRPCRequest& request)
1124
- {
1125
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1126
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1127
- return NullUniValue;
1128
- }
1129
-
1130
- if (request.fHelp || request.params.size() < 2 || request.params.size() > 8)
1131
- throw std::runtime_error(
1132
- "sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] replaceable conf_target \"estimate_mode\")\n"
1133
- "\nSend multiple times. Amounts are double-precision floating point numbers."
1134
- + HelpRequiringPassphrase(pwallet) + "\n"
1135
- "\nArguments:\n"
1136
- "1. \"fromaccount\" (string, required) DEPRECATED. The account to send the funds from. Should be \"\" for the default account\n"
1137
- "2. \"amounts\" (string, required) A json object with addresses and amounts\n"
1138
- " {\n"
1139
- " \"address\":amount (numeric or string) The neurai address is the key, the numeric amount (can be string) in " + CURRENCY_UNIT + " is the value\n"
1140
- " ,...\n"
1141
- " }\n"
1142
- "3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.\n"
1143
- "4. \"comment\" (string, optional) A comment\n"
1144
- "5. subtractfeefrom (array, optional) A json array with addresses.\n"
1145
- " The fee will be equally deducted from the amount of each selected address.\n"
1146
- " Those recipients will receive less neurais than you enter in their corresponding amount field.\n"
1147
- " If no addresses are specified here, the sender pays the fee.\n"
1148
- " [\n"
1149
- " \"address\" (string) Subtract fee from this address\n"
1150
- " ,...\n"
1151
- " ]\n"
1152
- // "6. replaceable (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees via BIP 125\n"
1153
- "6. conf_target (numeric, optional) Confirmation target (in blocks)\n"
1154
- "7. \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n"
1155
- " \"UNSET\"\n"
1156
- " \"ECONOMICAL\"\n"
1157
- " \"CONSERVATIVE\"\n"
1158
- "\nResult:\n"
1159
- "\"txid\" (string) The transaction id for the send. Only 1 transaction is created regardless of \n"
1160
- " the number of addresses.\n"
1161
- "\nExamples:\n"
1162
- "\nSend two amounts to two different addresses:\n"
1163
- + HelpExampleCli("sendmany", "\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"") +
1164
- "\nSend two amounts to two different addresses setting the confirmation and comment:\n"
1165
- + HelpExampleCli("sendmany", "\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 6 \"testing\"") +
1166
- "\nSend two amounts to two different addresses, subtract fee from amount:\n"
1167
- + HelpExampleCli("sendmany", "\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 1 \"\" \"[\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\",\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\"]\"") +
1168
- "\nAs a json rpc call\n"
1169
- + HelpExampleRpc("sendmany", "\"\", \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\", 6, \"testing\"")
1170
- );
1171
-
1172
- ObserveSafeMode();
1173
- LOCK2(cs_main, pwallet->cs_wallet);
1174
-
1175
- if (pwallet->GetBroadcastTransactions() && !g_connman) {
1176
- throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
1177
- }
1178
-
1179
- std::string strAccount = AccountFromValue(request.params[0]);
1180
- UniValue sendTo = request.params[1].get_obj();
1181
- int nMinDepth = 1;
1182
- if (!request.params[2].isNull())
1183
- nMinDepth = request.params[2].get_int();
1184
-
1185
- CWalletTx wtx;
1186
- wtx.strFromAccount = strAccount;
1187
- if (!request.params[3].isNull() && !request.params[3].get_str().empty())
1188
- wtx.mapValue["comment"] = request.params[3].get_str();
1189
-
1190
- UniValue subtractFeeFromAmount(UniValue::VARR);
1191
- if (!request.params[4].isNull())
1192
- subtractFeeFromAmount = request.params[4].get_array();
1193
-
1194
- CCoinControl coin_control;
1195
- // if (!request.params[5].isNull()) {
1196
- // coin_control.signalRbf = request.params[5].get_bool();
1197
- // }
1198
-
1199
- if (!request.params[5].isNull()) {
1200
- coin_control.m_confirm_target = ParseConfirmTarget(request.params[6]);
1201
- }
1202
-
1203
- if (!request.params[6].isNull()) {
1204
- if (!FeeModeFromString(request.params[7].get_str(), coin_control.m_fee_mode)) {
1205
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid estimate_mode parameter");
1206
- }
1207
- }
1208
-
1209
- std::set<CTxDestination> destinations;
1210
- std::vector<CRecipient> vecSend;
1211
-
1212
- CAmount totalAmount = 0;
1213
- std::vector<std::string> keys = sendTo.getKeys();
1214
- for (const std::string& name_ : keys) {
1215
- CTxDestination dest = DecodeDestination(name_);
1216
- if (!IsValidDestination(dest)) {
1217
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string("Invalid Neurai address: ") + name_);
1218
- }
1219
-
1220
- if (destinations.count(dest)) {
1221
- throw JSONRPCError(RPC_INVALID_PARAMETER, std::string("Invalid parameter, duplicated address: ") + name_);
1222
- }
1223
- destinations.insert(dest);
1224
-
1225
- CScript scriptPubKey = GetScriptForDestination(dest);
1226
- CAmount nAmount = AmountFromValue(sendTo[name_]);
1227
- if (nAmount <= 0)
1228
- throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send");
1229
- totalAmount += nAmount;
1230
-
1231
- bool fSubtractFeeFromAmount = false;
1232
- for (unsigned int idx = 0; idx < subtractFeeFromAmount.size(); idx++) {
1233
- const UniValue& addr = subtractFeeFromAmount[idx];
1234
- if (addr.get_str() == name_)
1235
- fSubtractFeeFromAmount = true;
1236
- }
1237
-
1238
- CRecipient recipient = {scriptPubKey, nAmount, fSubtractFeeFromAmount};
1239
- vecSend.push_back(recipient);
1240
- }
1241
-
1242
- EnsureWalletIsUnlocked(pwallet);
1243
-
1244
- // Check funds
1245
- CAmount nBalance = pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, &strAccount);
1246
- if (totalAmount > nBalance)
1247
- throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
1248
-
1249
- // Send
1250
- CReserveKey keyChange(pwallet);
1251
- CAmount nFeeRequired = 0;
1252
- int nChangePosRet = -1;
1253
- std::string strFailReason;
1254
- bool fCreated = pwallet->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, nChangePosRet, strFailReason, coin_control);
1255
- if (!fCreated)
1256
- throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, strFailReason);
1257
- CValidationState state;
1258
- if (!pwallet->CommitTransaction(wtx, keyChange, g_connman.get(), state)) {
1259
- strFailReason = strprintf("Transaction commit failed:: %s", state.GetRejectReason());
1260
- throw JSONRPCError(RPC_WALLET_ERROR, strFailReason);
1261
- }
1262
-
1263
- return wtx.GetHash().GetHex();
1264
- }
1265
-
1266
- // Defined in rpc/misc.cpp
1267
- extern CScript _createmultisig_redeemScript(CWallet * const pwallet, const UniValue& params);
1268
-
1269
- UniValue addmultisigaddress(const JSONRPCRequest& request)
1270
- {
1271
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1272
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1273
- return NullUniValue;
1274
- }
1275
-
1276
- if (request.fHelp || request.params.size() < 2 || request.params.size() > 3)
1277
- {
1278
- std::string msg = "addmultisigaddress nrequired [\"key\",...] ( \"account\" )\n"
1279
- "\nAdd a nrequired-to-sign multisignature address to the wallet.\n"
1280
- "Each key is a Neurai address or hex-encoded public key.\n"
1281
- "If 'account' is specified (DEPRECATED), assign address to that account.\n"
1282
-
1283
- "\nArguments:\n"
1284
- "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n"
1285
- "2. \"keys\" (string, required) A json array of neurai addresses or hex-encoded public keys\n"
1286
- " [\n"
1287
- " \"address\" (string) neurai address or hex-encoded public key\n"
1288
- " ...,\n"
1289
- " ]\n"
1290
- "3. \"account\" (string, optional) DEPRECATED. An account to assign the addresses to.\n"
1291
-
1292
- "\nResult:\n"
1293
- "\"address\" (string) A neurai address associated with the keys.\n"
1294
-
1295
- "\nExamples:\n"
1296
- "\nAdd a multisig address from 2 addresses\n"
1297
- + HelpExampleCli("addmultisigaddress", "2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
1298
- "\nAs json rpc call\n"
1299
- + HelpExampleRpc("addmultisigaddress", "2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"")
1300
- ;
1301
- throw std::runtime_error(msg);
1302
- }
1303
-
1304
- LOCK2(cs_main, pwallet->cs_wallet);
1305
-
1306
- std::string strAccount;
1307
- if (!request.params[2].isNull())
1308
- strAccount = AccountFromValue(request.params[2]);
1309
-
1310
- // Construct using pay-to-script-hash:
1311
- CScript inner = _createmultisig_redeemScript(pwallet, request.params);
1312
- CScriptID innerID(inner);
1313
- pwallet->AddCScript(inner);
1314
-
1315
- pwallet->SetAddressBook(innerID, strAccount, "send");
1316
- return EncodeDestination(innerID);
1317
- }
1318
-
1319
- class Witnessifier : public boost::static_visitor<bool>
1320
- {
1321
- public:
1322
- CWallet * const pwallet;
1323
- CScriptID result;
1324
-
1325
- explicit Witnessifier(CWallet *_pwallet) : pwallet(_pwallet) {}
1326
-
1327
- bool operator()(const CNoDestination &dest) const { return false; }
1328
-
1329
- bool operator()(const CKeyID &keyID) {
1330
- if (pwallet) {
1331
- CScript basescript = GetScriptForDestination(keyID);
1332
- CScript witscript = GetScriptForWitness(basescript);
1333
- SignatureData sigs;
1334
- // This check is to make sure that the script we created can actually be solved for and signed by us
1335
- // if we were to have the private keys. This is just to make sure that the script is valid and that,
1336
- // if found in a transaction, we would still accept and relay that transaction.
1337
- if (!ProduceSignature(DummySignatureCreator(pwallet), witscript, sigs) ||
1338
- !VerifyScript(sigs.scriptSig, witscript, &sigs.scriptWitness, MANDATORY_SCRIPT_VERIFY_FLAGS | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, DummySignatureCreator(pwallet).Checker())) {
1339
- return false;
1340
- }
1341
- pwallet->AddCScript(witscript);
1342
- result = CScriptID(witscript);
1343
- return true;
1344
- }
1345
- return false;
1346
- }
1347
-
1348
- bool operator()(const CScriptID &scriptID) {
1349
- CScript subscript;
1350
- if (pwallet && pwallet->GetCScript(scriptID, subscript)) {
1351
- int witnessversion;
1352
- std::vector<unsigned char> witprog;
1353
- if (subscript.IsWitnessProgram(witnessversion, witprog)) {
1354
- result = scriptID;
1355
- return true;
1356
- }
1357
- CScript witscript = GetScriptForWitness(subscript);
1358
- SignatureData sigs;
1359
- // This check is to make sure that the script we created can actually be solved for and signed by us
1360
- // if we were to have the private keys. This is just to make sure that the script is valid and that,
1361
- // if found in a transaction, we would still accept and relay that transaction.
1362
- if (!ProduceSignature(DummySignatureCreator(pwallet), witscript, sigs) ||
1363
- !VerifyScript(sigs.scriptSig, witscript, &sigs.scriptWitness, MANDATORY_SCRIPT_VERIFY_FLAGS | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, DummySignatureCreator(pwallet).Checker())) {
1364
- return false;
1365
- }
1366
- pwallet->AddCScript(witscript);
1367
- result = CScriptID(witscript);
1368
- return true;
1369
- }
1370
- return false;
1371
- }
1372
- };
1373
-
1374
- UniValue addwitnessaddress(const JSONRPCRequest& request)
1375
- {
1376
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1377
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1378
- return NullUniValue;
1379
- }
1380
-
1381
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 1)
1382
- {
1383
- std::string msg = "addwitnessaddress \"address\"\n"
1384
- "\nAdd a witness address for a script (with pubkey or redeemscript known).\n"
1385
- "It returns the witness script.\n"
1386
-
1387
- "\nArguments:\n"
1388
- "1. \"address\" (string, required) An address known to the wallet\n"
1389
-
1390
- "\nResult:\n"
1391
- "\"witnessaddress\", (string) The value of the new address (P2SH of witness script).\n"
1392
- "}\n"
1393
- ;
1394
- throw std::runtime_error(msg);
1395
- }
1396
-
1397
- {
1398
- LOCK(cs_main);
1399
- if (!IsWitnessEnabled(chainActive.Tip(), GetParams().GetConsensus()) && !gArgs.GetBoolArg("-walletprematurewitness", false)) {
1400
- throw JSONRPCError(RPC_WALLET_ERROR, "Segregated witness not enabled on network");
1401
- }
1402
- }
1403
-
1404
- CTxDestination dest = DecodeDestination(request.params[0].get_str());
1405
- if (!IsValidDestination(dest)) {
1406
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Neurai address");
1407
- }
1408
-
1409
- Witnessifier w(pwallet);
1410
- bool ret = boost::apply_visitor(w, dest);
1411
- if (!ret) {
1412
- throw JSONRPCError(RPC_WALLET_ERROR, "Public key or redeemscript not known to wallet, or the key is uncompressed");
1413
- }
1414
-
1415
- pwallet->SetAddressBook(w.result, "", "receive");
1416
-
1417
- return EncodeDestination(w.result);
1418
- }
1419
-
1420
- struct tallyitem
1421
- {
1422
- CAmount nAmount;
1423
- int nConf;
1424
- std::vector<uint256> txids;
1425
- bool fIsWatchonly;
1426
- tallyitem()
1427
- {
1428
- nAmount = 0;
1429
- nConf = std::numeric_limits<int>::max();
1430
- fIsWatchonly = false;
1431
- }
1432
- };
1433
-
1434
- UniValue ListReceived(CWallet * const pwallet, const UniValue& params, bool fByAccounts)
1435
- {
1436
- // Minimum confirmations
1437
- int nMinDepth = 1;
1438
- if (!params[0].isNull())
1439
- nMinDepth = params[0].get_int();
1440
-
1441
- // Whether to include empty accounts
1442
- bool fIncludeEmpty = false;
1443
- if (!params[1].isNull())
1444
- fIncludeEmpty = params[1].get_bool();
1445
-
1446
- isminefilter filter = ISMINE_SPENDABLE;
1447
- if(!params[2].isNull())
1448
- if(params[2].get_bool())
1449
- filter = filter | ISMINE_WATCH_ONLY;
1450
-
1451
- // Tally
1452
- std::map<CTxDestination, tallyitem> mapTally;
1453
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
1454
- const CWalletTx& wtx = pairWtx.second;
1455
-
1456
- if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))
1457
- continue;
1458
-
1459
- int nDepth = wtx.GetDepthInMainChain();
1460
- if (nDepth < nMinDepth)
1461
- continue;
1462
-
1463
- for (const CTxOut& txout : wtx.tx->vout)
1464
- {
1465
- CTxDestination address;
1466
- if (!ExtractDestination(txout.scriptPubKey, address))
1467
- continue;
1468
-
1469
- isminefilter mine = IsMine(*pwallet, address);
1470
- if(!(mine & filter))
1471
- continue;
1472
-
1473
- tallyitem& item = mapTally[address];
1474
- item.nAmount += txout.nValue;
1475
- item.nConf = std::min(item.nConf, nDepth);
1476
- item.txids.push_back(wtx.GetHash());
1477
- if (mine & ISMINE_WATCH_ONLY)
1478
- item.fIsWatchonly = true;
1479
- }
1480
- }
1481
-
1482
- // Reply
1483
- UniValue ret(UniValue::VARR);
1484
- std::map<std::string, tallyitem> mapAccountTally;
1485
- for (const std::pair<CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook) {
1486
- const CTxDestination& dest = item.first;
1487
- const std::string& strAccount = item.second.name;
1488
- std::map<CTxDestination, tallyitem>::iterator it = mapTally.find(dest);
1489
- if (it == mapTally.end() && !fIncludeEmpty)
1490
- continue;
1491
-
1492
- CAmount nAmount = 0;
1493
- int nConf = std::numeric_limits<int>::max();
1494
- bool fIsWatchonly = false;
1495
- if (it != mapTally.end())
1496
- {
1497
- nAmount = (*it).second.nAmount;
1498
- nConf = (*it).second.nConf;
1499
- fIsWatchonly = (*it).second.fIsWatchonly;
1500
- }
1501
-
1502
- if (fByAccounts)
1503
- {
1504
- tallyitem& _item = mapAccountTally[strAccount];
1505
- _item.nAmount += nAmount;
1506
- _item.nConf = std::min(_item.nConf, nConf);
1507
- _item.fIsWatchonly = fIsWatchonly;
1508
- }
1509
- else
1510
- {
1511
- UniValue obj(UniValue::VOBJ);
1512
- if(fIsWatchonly)
1513
- obj.push_back(Pair("involvesWatchonly", true));
1514
- obj.push_back(Pair("address", EncodeDestination(dest)));
1515
- obj.push_back(Pair("account", strAccount));
1516
- obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
1517
- obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
1518
- if (!fByAccounts)
1519
- obj.push_back(Pair("label", strAccount));
1520
- UniValue transactions(UniValue::VARR);
1521
- if (it != mapTally.end())
1522
- {
1523
- for (const uint256& _item : (*it).second.txids)
1524
- {
1525
- transactions.push_back(_item.GetHex());
1526
- }
1527
- }
1528
- obj.push_back(Pair("txids", transactions));
1529
- ret.push_back(obj);
1530
- }
1531
- }
1532
-
1533
- if (fByAccounts)
1534
- {
1535
- for (std::map<std::string, tallyitem>::iterator it = mapAccountTally.begin(); it != mapAccountTally.end(); ++it)
1536
- {
1537
- CAmount nAmount = (*it).second.nAmount;
1538
- int nConf = (*it).second.nConf;
1539
- UniValue obj(UniValue::VOBJ);
1540
- if((*it).second.fIsWatchonly)
1541
- obj.push_back(Pair("involvesWatchonly", true));
1542
- obj.push_back(Pair("account", (*it).first));
1543
- obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
1544
- obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
1545
- ret.push_back(obj);
1546
- }
1547
- }
1548
-
1549
- return ret;
1550
- }
1551
-
1552
- UniValue listreceivedbyaddress(const JSONRPCRequest& request)
1553
- {
1554
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1555
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1556
- return NullUniValue;
1557
- }
1558
-
1559
- if (request.fHelp || request.params.size() > 3)
1560
- throw std::runtime_error(
1561
- "listreceivedbyaddress ( minconf include_empty include_watchonly)\n"
1562
- "\nList balances by receiving address.\n"
1563
- "\nArguments:\n"
1564
- "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n"
1565
- "2. include_empty (bool, optional, default=false) Whether to include addresses that haven't received any payments.\n"
1566
- "3. include_watchonly (bool, optional, default=false) Whether to include watch-only addresses (see 'importaddress').\n"
1567
-
1568
- "\nResult:\n"
1569
- "[\n"
1570
- " {\n"
1571
- " \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n"
1572
- " \"address\" : \"receivingaddress\", (string) The receiving address\n"
1573
- " \"account\" : \"accountname\", (string) DEPRECATED. The account of the receiving address. The default account is \"\".\n"
1574
- " \"amount\" : x.xxx, (numeric) The total amount in " + CURRENCY_UNIT + " received by the address\n"
1575
- " \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n"
1576
- " \"label\" : \"label\", (string) A comment for the address/transaction, if any\n"
1577
- " \"txids\": [\n"
1578
- " n, (numeric) The ids of transactions received with the address \n"
1579
- " ...\n"
1580
- " ]\n"
1581
- " }\n"
1582
- " ,...\n"
1583
- "]\n"
1584
-
1585
- "\nExamples:\n"
1586
- + HelpExampleCli("listreceivedbyaddress", "")
1587
- + HelpExampleCli("listreceivedbyaddress", "6 true")
1588
- + HelpExampleRpc("listreceivedbyaddress", "6, true, true")
1589
- );
1590
-
1591
- ObserveSafeMode();
1592
- LOCK2(cs_main, pwallet->cs_wallet);
1593
-
1594
- return ListReceived(pwallet, request.params, false);
1595
- }
1596
-
1597
- UniValue listreceivedbyaccount(const JSONRPCRequest& request)
1598
- {
1599
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1600
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1601
- return NullUniValue;
1602
- }
1603
-
1604
- if (request.fHelp || request.params.size() > 3)
1605
- throw std::runtime_error(
1606
- "listreceivedbyaccount ( minconf include_empty include_watchonly)\n"
1607
- "\nDEPRECATED. List balances by account.\n"
1608
- "\nArguments:\n"
1609
- "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n"
1610
- "2. include_empty (bool, optional, default=false) Whether to include accounts that haven't received any payments.\n"
1611
- "3. include_watchonly (bool, optional, default=false) Whether to include watch-only addresses (see 'importaddress').\n"
1612
-
1613
- "\nResult:\n"
1614
- "[\n"
1615
- " {\n"
1616
- " \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n"
1617
- " \"account\" : \"accountname\", (string) The account name of the receiving account\n"
1618
- " \"amount\" : x.xxx, (numeric) The total amount received by addresses with this account\n"
1619
- " \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n"
1620
- " \"label\" : \"label\" (string) A comment for the address/transaction, if any\n"
1621
- " }\n"
1622
- " ,...\n"
1623
- "]\n"
1624
-
1625
- "\nExamples:\n"
1626
- + HelpExampleCli("listreceivedbyaccount", "")
1627
- + HelpExampleCli("listreceivedbyaccount", "6 true")
1628
- + HelpExampleRpc("listreceivedbyaccount", "6, true, true")
1629
- );
1630
-
1631
- ObserveSafeMode();
1632
- LOCK2(cs_main, pwallet->cs_wallet);
1633
-
1634
- return ListReceived(pwallet, request.params, true);
1635
- }
1636
-
1637
- static void MaybePushAddress(UniValue & entry, const CTxDestination &dest)
1638
- {
1639
- if (IsValidDestination(dest)) {
1640
- entry.push_back(Pair("address", EncodeDestination(dest)));
1641
- }
1642
- }
1643
-
1644
- /**
1645
- * List transactions based on the given criteria.
1646
- *
1647
- * @param pwallet The wallet.
1648
- * @param wtx The wallet transaction.
1649
- * @param strAccount The account, if any, or "*" for all.
1650
- * @param nMinDepth The minimum confirmation depth.
1651
- * @param fLong Whether to include the JSON version of the transaction.
1652
- * @param ret The UniValue into which the result is stored.
1653
- * @param filter The "is mine" filter bool.
1654
- */
1655
- void ListTransactions(CWallet* const pwallet, const CWalletTx& wtx, const std::string& strAccount, int nMinDepth, bool fLong, UniValue& ret, UniValue& retAssets, const isminefilter& filter)
1656
- {
1657
- CAmount nFee;
1658
- std::string strSentAccount;
1659
- std::list<COutputEntry> listReceived;
1660
- std::list<COutputEntry> listSent;
1661
-
1662
- std::list<CAssetOutputEntry> listAssetsReceived;
1663
- std::list<CAssetOutputEntry> listAssetsSent;
1664
-
1665
- wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, filter, listAssetsReceived, listAssetsSent);
1666
-
1667
- bool fAllAccounts = (strAccount == std::string("*"));
1668
- bool involvesWatchonly = wtx.IsFromMe(ISMINE_WATCH_ONLY);
1669
-
1670
- // Sent
1671
- if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
1672
- {
1673
- for (const COutputEntry& s : listSent)
1674
- {
1675
- UniValue entry(UniValue::VOBJ);
1676
- if (involvesWatchonly || (::IsMine(*pwallet, s.destination) & ISMINE_WATCH_ONLY)) {
1677
- entry.push_back(Pair("involvesWatchonly", true));
1678
- }
1679
- entry.push_back(Pair("account", strSentAccount));
1680
- MaybePushAddress(entry, s.destination);
1681
- entry.push_back(Pair("category", "send"));
1682
- entry.push_back(Pair("amount", ValueFromAmount(-s.amount)));
1683
- if (pwallet->mapAddressBook.count(s.destination)) {
1684
- entry.push_back(Pair("label", pwallet->mapAddressBook[s.destination].name));
1685
- }
1686
- entry.push_back(Pair("vout", s.vout));
1687
- entry.push_back(Pair("fee", ValueFromAmount(-nFee)));
1688
- if (fLong)
1689
- WalletTxToJSON(wtx, entry);
1690
- entry.push_back(Pair("abandoned", wtx.isAbandoned()));
1691
- ret.push_back(entry);
1692
- }
1693
- }
1694
-
1695
- // Received
1696
- if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth)
1697
- {
1698
- for (const COutputEntry& r : listReceived)
1699
- {
1700
- std::string account;
1701
- if (pwallet->mapAddressBook.count(r.destination)) {
1702
- account = pwallet->mapAddressBook[r.destination].name;
1703
- }
1704
- if (fAllAccounts || (account == strAccount))
1705
- {
1706
- UniValue entry(UniValue::VOBJ);
1707
- if (involvesWatchonly || (::IsMine(*pwallet, r.destination) & ISMINE_WATCH_ONLY)) {
1708
- entry.push_back(Pair("involvesWatchonly", true));
1709
- }
1710
- entry.push_back(Pair("account", account));
1711
- MaybePushAddress(entry, r.destination);
1712
- if (wtx.IsCoinBase())
1713
- {
1714
- if (wtx.GetDepthInMainChain() < 1)
1715
- entry.push_back(Pair("category", "orphan"));
1716
- else if (wtx.GetBlocksToMaturity() > 0)
1717
- entry.push_back(Pair("category", "immature"));
1718
- else
1719
- entry.push_back(Pair("category", "generate"));
1720
- }
1721
- else
1722
- {
1723
- entry.push_back(Pair("category", "receive"));
1724
- }
1725
- entry.push_back(Pair("amount", ValueFromAmount(r.amount)));
1726
- if (pwallet->mapAddressBook.count(r.destination)) {
1727
- entry.push_back(Pair("label", account));
1728
- }
1729
- entry.push_back(Pair("vout", r.vout));
1730
- if (fLong)
1731
- WalletTxToJSON(wtx, entry);
1732
- ret.push_back(entry);
1733
- }
1734
- }
1735
- }
1736
-
1737
- /** XNA START */
1738
- if (AreAssetsDeployed()) {
1739
- if (listAssetsReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth) {
1740
- for (const CAssetOutputEntry &data : listAssetsReceived){
1741
- UniValue entry(UniValue::VOBJ);
1742
-
1743
- if (involvesWatchonly || (::IsMine(*pwallet, data.destination) & ISMINE_WATCH_ONLY)) {
1744
- entry.push_back(Pair("involvesWatchonly", true));
1745
- }
1746
-
1747
- entry.push_back(Pair("asset_type", GetTxnOutputType(data.type)));
1748
- entry.push_back(Pair("asset_name", data.assetName));
1749
- entry.push_back(Pair("amount", ValueFromAmount(data.nAmount)));
1750
- entry.push_back(Pair("message", EncodeAssetData(data.message)));
1751
- if (!data.message.empty() && data.expireTime > 0)
1752
- entry.push_back(Pair("message_expires", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", data.expireTime)));
1753
- entry.push_back(Pair("destination", EncodeDestination(data.destination)));
1754
- entry.push_back(Pair("vout", data.vout));
1755
- entry.push_back(Pair("category", "receive"));
1756
- if (fLong)
1757
- WalletTxToJSON(wtx, entry);
1758
- entry.push_back(Pair("abandoned", wtx.isAbandoned()));
1759
- retAssets.push_back(entry);
1760
- }
1761
- }
1762
-
1763
- if ((!listAssetsSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount)) {
1764
- for (const CAssetOutputEntry &data : listAssetsSent) {
1765
- UniValue entry(UniValue::VOBJ);
1766
-
1767
- if (involvesWatchonly || (::IsMine(*pwallet, data.destination) & ISMINE_WATCH_ONLY)) {
1768
- entry.push_back(Pair("involvesWatchonly", true));
1769
- }
1770
-
1771
- entry.push_back(Pair("asset_type", GetTxnOutputType(data.type)));
1772
- entry.push_back(Pair("asset_name", data.assetName));
1773
- entry.push_back(Pair("amount", ValueFromAmount(data.nAmount)));
1774
- entry.push_back(Pair("message", EncodeAssetData(data.message)));
1775
- if (!data.message.empty() && data.expireTime > 0)
1776
- entry.push_back(Pair("message_expires", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", data.expireTime)));
1777
- entry.push_back(Pair("destination", EncodeDestination(data.destination)));
1778
- entry.push_back(Pair("vout", data.vout));
1779
- entry.push_back(Pair("category", "send"));
1780
- if (fLong)
1781
- WalletTxToJSON(wtx, entry);
1782
- entry.push_back(Pair("abandoned", wtx.isAbandoned()));
1783
- retAssets.push_back(entry);
1784
- }
1785
- }
1786
- }
1787
- /** XNA END */
1788
- }
1789
-
1790
- void ListTransactions(CWallet* const pwallet, const CWalletTx& wtx, const std::string& strAccount, int nMinDepth, bool fLong, UniValue& ret, const isminefilter& filter)
1791
- {
1792
- UniValue assetDetails(UniValue::VARR);
1793
-
1794
- ListTransactions(pwallet, wtx, strAccount, nMinDepth, fLong, ret, assetDetails, filter);
1795
- }
1796
-
1797
- void AcentryToJSON(const CAccountingEntry& acentry, const std::string& strAccount, UniValue& ret)
1798
- {
1799
- bool fAllAccounts = (strAccount == std::string("*"));
1800
-
1801
- if (fAllAccounts || acentry.strAccount == strAccount)
1802
- {
1803
- UniValue entry(UniValue::VOBJ);
1804
- entry.push_back(Pair("account", acentry.strAccount));
1805
- entry.push_back(Pair("category", "move"));
1806
- entry.push_back(Pair("time", acentry.nTime));
1807
- entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit)));
1808
- entry.push_back(Pair("otheraccount", acentry.strOtherAccount));
1809
- entry.push_back(Pair("comment", acentry.strComment));
1810
- ret.push_back(entry);
1811
- }
1812
- }
1813
-
1814
- UniValue listtransactions(const JSONRPCRequest& request)
1815
- {
1816
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1817
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1818
- return NullUniValue;
1819
- }
1820
-
1821
- if (request.fHelp || request.params.size() > 4)
1822
- throw std::runtime_error(
1823
- "listtransactions ( \"account\" count skip include_watchonly)\n"
1824
- "\nReturns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.\n"
1825
- "\nArguments:\n"
1826
- "1. \"account\" (string, optional) DEPRECATED. The account name. Should be \"*\".\n"
1827
- "2. count (numeric, optional, default=10) The number of transactions to return\n"
1828
- "3. skip (numeric, optional, default=0) The number of transactions to skip\n"
1829
- "4. include_watchonly (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')\n"
1830
- "\nResult:\n"
1831
- "[\n"
1832
- " {\n"
1833
- " \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. \n"
1834
- " It will be \"\" for the default account.\n"
1835
- " \"address\":\"address\", (string) The neurai address of the transaction. Not present for \n"
1836
- " move transactions (category = move).\n"
1837
- " \"category\":\"send|receive|move\", (string) The transaction category. 'move' is a local (off blockchain)\n"
1838
- " transaction between accounts, and not associated with an address,\n"
1839
- " transaction id or block. 'send' and 'receive' transactions are \n"
1840
- " associated with an address, transaction id and block details\n"
1841
- " \"amount\": x.xxx, (numeric) The amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and for the\n"
1842
- " 'move' category for moves outbound. It is positive for the 'receive' category,\n"
1843
- " and for the 'move' category for inbound funds.\n"
1844
- " \"label\": \"label\", (string) A comment for the address/transaction, if any\n"
1845
- " \"vout\": n, (numeric) the vout value\n"
1846
- " \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
1847
- " 'send' category of transactions.\n"
1848
- " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n"
1849
- " 'receive' category of transactions. Negative confirmations indicate the\n"
1850
- " transaction conflicts with the block chain\n"
1851
- " \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n"
1852
- " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive'\n"
1853
- " category of transactions.\n"
1854
- " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive'\n"
1855
- " category of transactions.\n"
1856
- " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n"
1857
- " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n"
1858
- " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n"
1859
- " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n"
1860
- " for 'send' and 'receive' category of transactions.\n"
1861
- " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n"
1862
- " \"otheraccount\": \"accountname\", (string) DEPRECATED. For the 'move' category of transactions, the account the funds came \n"
1863
- " from (for receiving funds, positive amounts), or went to (for sending funds,\n"
1864
- " negative amounts).\n"
1865
- " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n"
1866
- " may be unknown for unconfirmed transactions not in the mempool\n"
1867
- " \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
1868
- " 'send' category of transactions.\n"
1869
- " }\n"
1870
- "]\n"
1871
-
1872
- "\nExamples:\n"
1873
- "\nList the most recent 10 transactions in the systems\n"
1874
- + HelpExampleCli("listtransactions", "") +
1875
- "\nList transactions 100 to 120\n"
1876
- + HelpExampleCli("listtransactions", "\"*\" 20 100") +
1877
- "\nAs a json rpc call\n"
1878
- + HelpExampleRpc("listtransactions", "\"*\", 20, 100")
1879
- );
1880
-
1881
- ObserveSafeMode();
1882
- LOCK2(cs_main, pwallet->cs_wallet);
1883
-
1884
- std::string strAccount = "*";
1885
- if (!request.params[0].isNull())
1886
- strAccount = request.params[0].get_str();
1887
- int nCount = 10;
1888
- if (!request.params[1].isNull())
1889
- nCount = request.params[1].get_int();
1890
- int nFrom = 0;
1891
- if (!request.params[2].isNull())
1892
- nFrom = request.params[2].get_int();
1893
- isminefilter filter = ISMINE_SPENDABLE;
1894
- if(!request.params[3].isNull())
1895
- if(request.params[3].get_bool())
1896
- filter = filter | ISMINE_WATCH_ONLY;
1897
-
1898
- if (nCount < 0)
1899
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative count");
1900
- if (nFrom < 0)
1901
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative from");
1902
-
1903
- UniValue ret(UniValue::VARR);
1904
-
1905
- const CWallet::TxItems & txOrdered = pwallet->wtxOrdered;
1906
-
1907
- // iterate backwards until we have nCount items to return:
1908
- for (CWallet::TxItems::const_reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
1909
- {
1910
- CWalletTx *const pwtx = (*it).second.first;
1911
- if (pwtx != nullptr)
1912
- ListTransactions(pwallet, *pwtx, strAccount, 0, true, ret, filter);
1913
- CAccountingEntry *const pacentry = (*it).second.second;
1914
- if (pacentry != nullptr)
1915
- AcentryToJSON(*pacentry, strAccount, ret);
1916
-
1917
- if ((int)ret.size() >= (nCount+nFrom)) break;
1918
- }
1919
- // ret is newest to oldest
1920
-
1921
- if (nFrom > (int)ret.size())
1922
- nFrom = ret.size();
1923
- if ((nFrom + nCount) > (int)ret.size())
1924
- nCount = ret.size() - nFrom;
1925
-
1926
- std::vector<UniValue> arrTmp = ret.getValues();
1927
-
1928
- std::vector<UniValue>::iterator first = arrTmp.begin();
1929
- std::advance(first, nFrom);
1930
- std::vector<UniValue>::iterator last = arrTmp.begin();
1931
- std::advance(last, nFrom+nCount);
1932
-
1933
- if (last != arrTmp.end()) arrTmp.erase(last, arrTmp.end());
1934
- if (first != arrTmp.begin()) arrTmp.erase(arrTmp.begin(), first);
1935
-
1936
- std::reverse(arrTmp.begin(), arrTmp.end()); // Return oldest to newest
1937
-
1938
- ret.clear();
1939
- ret.setArray();
1940
- ret.push_backV(arrTmp);
1941
-
1942
- return ret;
1943
- }
1944
-
1945
- UniValue listaccounts(const JSONRPCRequest& request)
1946
- {
1947
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
1948
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
1949
- return NullUniValue;
1950
- }
1951
-
1952
- if (request.fHelp || request.params.size() > 2)
1953
- throw std::runtime_error(
1954
- "listaccounts ( minconf include_watchonly)\n"
1955
- "\nDEPRECATED. Returns Object that has account names as keys, account balances as values.\n"
1956
- "\nArguments:\n"
1957
- "1. minconf (numeric, optional, default=1) Only include transactions with at least this many confirmations\n"
1958
- "2. include_watchonly (bool, optional, default=false) Include balances in watch-only addresses (see 'importaddress')\n"
1959
- "\nResult:\n"
1960
- "{ (json object where keys are account names, and values are numeric balances\n"
1961
- " \"account\": x.xxx, (numeric) The property name is the account name, and the value is the total balance for the account.\n"
1962
- " ...\n"
1963
- "}\n"
1964
- "\nExamples:\n"
1965
- "\nList account balances where there at least 1 confirmation\n"
1966
- + HelpExampleCli("listaccounts", "") +
1967
- "\nList account balances including zero confirmation transactions\n"
1968
- + HelpExampleCli("listaccounts", "0") +
1969
- "\nList account balances for 6 or more confirmations\n"
1970
- + HelpExampleCli("listaccounts", "6") +
1971
- "\nAs json rpc call\n"
1972
- + HelpExampleRpc("listaccounts", "6")
1973
- );
1974
-
1975
- ObserveSafeMode();
1976
- LOCK2(cs_main, pwallet->cs_wallet);
1977
-
1978
- int nMinDepth = 1;
1979
- if (!request.params[0].isNull())
1980
- nMinDepth = request.params[0].get_int();
1981
- isminefilter includeWatchonly = ISMINE_SPENDABLE;
1982
- if(!request.params[1].isNull())
1983
- if(request.params[1].get_bool())
1984
- includeWatchonly = includeWatchonly | ISMINE_WATCH_ONLY;
1985
-
1986
- std::map<std::string, CAmount> mapAccountBalances;
1987
- for (const std::pair<CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook) {
1988
- if (IsMine(*pwallet, entry.first) & includeWatchonly) { // This address belongs to me
1989
- mapAccountBalances[entry.second.name] = 0;
1990
- }
1991
- }
1992
-
1993
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
1994
- const CWalletTx& wtx = pairWtx.second;
1995
- CAmount nFee;
1996
- std::string strSentAccount;
1997
- std::list<COutputEntry> listReceived;
1998
- std::list<COutputEntry> listSent;
1999
- int nDepth = wtx.GetDepthInMainChain();
2000
- if (wtx.GetBlocksToMaturity() > 0 || nDepth < 0)
2001
- continue;
2002
- wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, includeWatchonly);
2003
- mapAccountBalances[strSentAccount] -= nFee;
2004
- for (const COutputEntry& s : listSent)
2005
- mapAccountBalances[strSentAccount] -= s.amount;
2006
- if (nDepth >= nMinDepth)
2007
- {
2008
- for (const COutputEntry& r : listReceived)
2009
- if (pwallet->mapAddressBook.count(r.destination)) {
2010
- mapAccountBalances[pwallet->mapAddressBook[r.destination].name] += r.amount;
2011
- }
2012
- else
2013
- mapAccountBalances[""] += r.amount;
2014
- }
2015
- }
2016
-
2017
- const std::list<CAccountingEntry>& acentries = pwallet->laccentries;
2018
- for (const CAccountingEntry& entry : acentries)
2019
- mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
2020
-
2021
- UniValue ret(UniValue::VOBJ);
2022
- for (const std::pair<std::string, CAmount>& accountBalance : mapAccountBalances) {
2023
- ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second)));
2024
- }
2025
- return ret;
2026
- }
2027
-
2028
- UniValue listsinceblock(const JSONRPCRequest& request)
2029
- {
2030
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2031
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2032
- return NullUniValue;
2033
- }
2034
-
2035
- if (request.fHelp || request.params.size() > 4)
2036
- throw std::runtime_error(
2037
- "listsinceblock ( \"blockhash\" target_confirmations include_watchonly include_removed )\n"
2038
- "\nGet all transactions in blocks since block [blockhash], or all transactions if omitted.\n"
2039
- "If \"blockhash\" is no longer a part of the main chain, transactions from the fork point onward are included.\n"
2040
- "Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.\n"
2041
- "\nArguments:\n"
2042
- "1. \"blockhash\" (string, optional) The block hash to list transactions since\n"
2043
- "2. target_confirmations: (numeric, optional, default=1) Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value\n"
2044
- "3. include_watchonly: (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')\n"
2045
- "4. include_removed: (bool, optional, default=true) Show transactions that were removed due to a reorg in the \"removed\" array\n"
2046
- " (not guaranteed to work on pruned nodes)\n"
2047
- "\nResult:\n"
2048
- "{\n"
2049
- " \"transactions\": [\n"
2050
- " \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. Will be \"\" for the default account.\n"
2051
- " \"address\":\"address\", (string) The neurai address of the transaction. Not present for move transactions (category = move).\n"
2052
- " \"category\":\"send|receive\", (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\n"
2053
- " \"amount\": x.xxx, (numeric) The amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and for the 'move' category for moves \n"
2054
- " outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\n"
2055
- " \"vout\" : n, (numeric) the vout value\n"
2056
- " \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the 'send' category of transactions.\n"
2057
- " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n"
2058
- " When it's < 0, it means the transaction conflicted that many blocks ago.\n"
2059
- " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n"
2060
- " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions.\n"
2061
- " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n"
2062
- " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n"
2063
- " \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n"
2064
- " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\n"
2065
- " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n"
2066
- " may be unknown for unconfirmed transactions not in the mempool\n"
2067
- " \"abandoned\": xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\n"
2068
- " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n"
2069
- " \"label\" : \"label\" (string) A comment for the address/transaction, if any\n"
2070
- " \"to\": \"...\", (string) If a comment to is associated with the transaction.\n"
2071
- " ],\n"
2072
- " \"removed\": [\n"
2073
- " <structure is the same as \"transactions\" above, only present if include_removed=true>\n"
2074
- " Note: transactions that were readded in the active chain will appear as-is in this array, and may thus have a positive confirmation count.\n"
2075
- " ],\n"
2076
- " \"lastblock\": \"lastblockhash\" (string) The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones\n"
2077
- "}\n"
2078
- "\nExamples:\n"
2079
- + HelpExampleCli("listsinceblock", "")
2080
- + HelpExampleCli("listsinceblock", "\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6")
2081
- + HelpExampleRpc("listsinceblock", "\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\", 6")
2082
- );
2083
-
2084
- ObserveSafeMode();
2085
- LOCK2(cs_main, pwallet->cs_wallet);
2086
-
2087
- const CBlockIndex* pindex = nullptr; // Block index of the specified block or the common ancestor, if the block provided was in a deactivated chain.
2088
- const CBlockIndex* paltindex = nullptr; // Block index of the specified block, even if it's in a deactivated chain.
2089
- int target_confirms = 1;
2090
- isminefilter filter = ISMINE_SPENDABLE;
2091
-
2092
- if (!request.params[0].isNull()) {
2093
- uint256 blockId;
2094
-
2095
- blockId.SetHex(request.params[0].get_str());
2096
- BlockMap::iterator it = mapBlockIndex.find(blockId);
2097
- if (it != mapBlockIndex.end()) {
2098
- paltindex = pindex = it->second;
2099
- if (chainActive[pindex->nHeight] != pindex) {
2100
- // the block being asked for is a part of a deactivated chain;
2101
- // we don't want to depend on its perceived height in the block
2102
- // chain, we want to instead use the last common ancestor
2103
- pindex = chainActive.FindFork(pindex);
2104
- }
2105
- }
2106
- }
2107
-
2108
- if (!request.params[1].isNull()) {
2109
- target_confirms = request.params[1].get_int();
2110
-
2111
- if (target_confirms < 1) {
2112
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter");
2113
- }
2114
- }
2115
-
2116
- if (!request.params[2].isNull() && request.params[2].get_bool()) {
2117
- filter = filter | ISMINE_WATCH_ONLY;
2118
- }
2119
-
2120
- bool include_removed = (request.params[3].isNull() || request.params[3].get_bool());
2121
-
2122
- int depth = pindex ? (1 + chainActive.Height() - pindex->nHeight) : -1;
2123
-
2124
- UniValue transactions(UniValue::VARR);
2125
- UniValue assetTransactions(UniValue::VARR);
2126
-
2127
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
2128
- CWalletTx tx = pairWtx.second;
2129
-
2130
- if (depth == -1 || tx.GetDepthInMainChain() < depth) {
2131
- ListTransactions(pwallet, tx, "*", 0, true, transactions, assetTransactions, filter);
2132
- }
2133
- }
2134
-
2135
- // when a reorg'd block is requested, we also list any relevant transactions
2136
- // in the blocks of the chain that was detached
2137
- UniValue removed(UniValue::VARR);
2138
- UniValue assetRemoved(UniValue::VARR);
2139
- while (include_removed && paltindex && paltindex != pindex) {
2140
- CBlock block;
2141
- if (!ReadBlockFromDisk(block, paltindex, GetParams().GetConsensus())) {
2142
- throw JSONRPCError(RPC_INTERNAL_ERROR, "Can't read block from disk");
2143
- }
2144
- for (const CTransactionRef& tx : block.vtx) {
2145
- auto it = pwallet->mapWallet.find(tx->GetHash());
2146
- if (it != pwallet->mapWallet.end()) {
2147
- // We want all transactions regardless of confirmation count to appear here,
2148
- // even negative confirmation ones, hence the big negative.
2149
- ListTransactions(pwallet, it->second, "*", -100000000, true, removed, assetRemoved, filter);
2150
- }
2151
- }
2152
- paltindex = paltindex->pprev;
2153
- }
2154
-
2155
- CBlockIndex *pblockLast = chainActive[chainActive.Height() + 1 - target_confirms];
2156
- uint256 lastblock = pblockLast ? pblockLast->GetBlockHash() : uint256();
2157
-
2158
- UniValue ret(UniValue::VOBJ);
2159
- ret.push_back(Pair("transactions", transactions));
2160
- ret.push_back(Pair("asset_transactions", assetTransactions));
2161
- if (include_removed) {
2162
- ret.push_back(Pair("removed", removed));
2163
- ret.push_back(Pair("assets_removed", assetRemoved));
2164
- }
2165
- ret.push_back(Pair("lastblock", lastblock.GetHex()));
2166
-
2167
- return ret;
2168
- }
2169
-
2170
- UniValue gettransaction(const JSONRPCRequest& request)
2171
- {
2172
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2173
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2174
- return NullUniValue;
2175
- }
2176
-
2177
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
2178
- throw std::runtime_error(
2179
- "gettransaction \"txid\" ( include_watchonly )\n"
2180
- "\nGet detailed information about in-wallet transaction <txid>\n"
2181
- "\nArguments:\n"
2182
- "1. \"txid\" (string, required) The transaction id\n"
2183
- "2. \"include_watchonly\" (bool, optional, default=false) Whether to include watch-only addresses in balance calculation and details[]\n"
2184
- "\nResult:\n"
2185
- "{\n"
2186
- " \"amount\" : x.xxx, (numeric) The transaction amount in " + CURRENCY_UNIT + "\n"
2187
- " \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
2188
- " 'send' category of transactions.\n"
2189
- " \"confirmations\" : n, (numeric) The number of confirmations\n"
2190
- " \"blockhash\" : \"hash\", (string) The block hash\n"
2191
- " \"blockindex\" : xx, (numeric) The index of the transaction in the block that includes it\n"
2192
- " \"blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n"
2193
- " \"txid\" : \"transactionid\", (string) The transaction id.\n"
2194
- " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n"
2195
- " \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n"
2196
- " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n"
2197
- " may be unknown for unconfirmed transactions not in the mempool\n"
2198
- " \"details\" : [\n"
2199
- " {\n"
2200
- " \"account\" : \"accountname\", (string) DEPRECATED. The account name involved in the transaction, can be \"\" for the default account.\n"
2201
- " \"address\" : \"address\", (string) The neurai address involved in the transaction\n"
2202
- " \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n"
2203
- " \"amount\" : x.xxx, (numeric) The amount in " + CURRENCY_UNIT + "\n"
2204
- " \"label\" : \"label\", (string) A comment for the address/transaction, if any\n"
2205
- " \"vout\" : n, (numeric) the vout value\n"
2206
- " \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
2207
- " 'send' category of transactions.\n"
2208
- " \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
2209
- " 'send' category of transactions.\n"
2210
- " }\n"
2211
- " ,...\n"
2212
- " ],\n"
2213
- " \"asset_details\" : [\n"
2214
- " {\n"
2215
- " \"asset_type\" : \"new_asset|transfer_asset|reissue_asset\", (string) The type of asset transaction\n"
2216
- " \"asset_name\" : \"asset_name\", (string) The name of the asset\n"
2217
- " \"amount\" : x.xxx, (numeric) The amount in " + CURRENCY_UNIT + "\n"
2218
- " \"address\" : \"address\", (string) The neurai address involved in the transaction\n"
2219
- " \"vout\" : n, (numeric) the vout value\n"
2220
- " \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n"
2221
- " }\n"
2222
- " ,...\n"
2223
- " ],\n"
2224
-
2225
- " \"hex\" : \"data\" (string) Raw data for transaction\n"
2226
- "}\n"
2227
-
2228
- "\nExamples:\n"
2229
- + HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
2230
- + HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true")
2231
- + HelpExampleRpc("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
2232
- );
2233
-
2234
- ObserveSafeMode();
2235
- LOCK2(cs_main, pwallet->cs_wallet);
2236
-
2237
- uint256 hash;
2238
- hash.SetHex(request.params[0].get_str());
2239
-
2240
- isminefilter filter = ISMINE_SPENDABLE;
2241
- if(!request.params[1].isNull())
2242
- if(request.params[1].get_bool())
2243
- filter = filter | ISMINE_WATCH_ONLY;
2244
-
2245
- UniValue entry(UniValue::VOBJ);
2246
- auto it = pwallet->mapWallet.find(hash);
2247
- if (it == pwallet->mapWallet.end()) {
2248
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id");
2249
- }
2250
- const CWalletTx& wtx = it->second;
2251
-
2252
- CAmount nCredit = wtx.GetCredit(filter);
2253
- CAmount nDebit = wtx.GetDebit(filter);
2254
- CAmount nNet = nCredit - nDebit;
2255
- CAmount nFee = (wtx.IsFromMe(filter) ? wtx.tx->GetValueOut(AreEnforcedValuesDeployed()) - nDebit : 0);
2256
-
2257
- entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee)));
2258
- if (wtx.IsFromMe(filter))
2259
- entry.push_back(Pair("fee", ValueFromAmount(nFee)));
2260
-
2261
- WalletTxToJSON(wtx, entry);
2262
-
2263
- UniValue details(UniValue::VARR);
2264
- UniValue assetDetails(UniValue::VARR);
2265
- ListTransactions(pwallet, wtx, "*", 0, false, details, assetDetails, filter);
2266
- entry.push_back(Pair("details", details));
2267
- entry.push_back(Pair("asset_details", assetDetails));
2268
-
2269
- std::string strHex = EncodeHexTx(static_cast<CTransaction>(wtx), RPCSerializationFlags());
2270
- entry.push_back(Pair("hex", strHex));
2271
-
2272
- return entry;
2273
- }
2274
-
2275
- UniValue abandontransaction(const JSONRPCRequest& request)
2276
- {
2277
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2278
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2279
- return NullUniValue;
2280
- }
2281
-
2282
- if (request.fHelp || request.params.size() != 1)
2283
- throw std::runtime_error(
2284
- "abandontransaction \"txid\"\n"
2285
- "\nMark in-wallet transaction <txid> as abandoned\n"
2286
- "This will mark this transaction and all its in-wallet descendants as abandoned which will allow\n"
2287
- "for their inputs to be respent. It can be used to replace \"stuck\" or evicted transactions.\n"
2288
- "It only works on transactions which are not included in a block and are not currently in the mempool.\n"
2289
- "It has no effect on transactions which are already conflicted or abandoned.\n"
2290
- "\nArguments:\n"
2291
- "1. \"txid\" (string, required) The transaction id\n"
2292
- "\nResult:\n"
2293
- "\nExamples:\n"
2294
- + HelpExampleCli("abandontransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
2295
- + HelpExampleRpc("abandontransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
2296
- );
2297
-
2298
- ObserveSafeMode();
2299
- LOCK2(cs_main, pwallet->cs_wallet);
2300
-
2301
- uint256 hash;
2302
- hash.SetHex(request.params[0].get_str());
2303
-
2304
- if (!pwallet->mapWallet.count(hash)) {
2305
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id");
2306
- }
2307
- if (!pwallet->AbandonTransaction(hash)) {
2308
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not eligible for abandonment");
2309
- }
2310
-
2311
- return NullUniValue;
2312
- }
2313
-
2314
-
2315
- UniValue backupwallet(const JSONRPCRequest& request)
2316
- {
2317
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2318
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2319
- return NullUniValue;
2320
- }
2321
-
2322
- if (request.fHelp || request.params.size() != 1)
2323
- throw std::runtime_error(
2324
- "backupwallet \"destination\"\n"
2325
- "\nSafely copies current wallet file to destination, which can be a directory or a path with filename.\n"
2326
- "\nArguments:\n"
2327
- "1. \"destination\" (string) The destination directory or file\n"
2328
- "\nExamples:\n"
2329
- + HelpExampleCli("backupwallet", "\"backup.dat\"")
2330
- + HelpExampleRpc("backupwallet", "\"backup.dat\"")
2331
- );
2332
-
2333
- LOCK2(cs_main, pwallet->cs_wallet);
2334
-
2335
- std::string strDest = request.params[0].get_str();
2336
- if (!pwallet->BackupWallet(strDest)) {
2337
- throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet backup failed!");
2338
- }
2339
-
2340
- return NullUniValue;
2341
- }
2342
-
2343
-
2344
- UniValue keypoolrefill(const JSONRPCRequest& request)
2345
- {
2346
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2347
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2348
- return NullUniValue;
2349
- }
2350
-
2351
- if (request.fHelp || request.params.size() > 1)
2352
- throw std::runtime_error(
2353
- "keypoolrefill ( newsize )\n"
2354
- "\nFills the keypool."
2355
- + HelpRequiringPassphrase(pwallet) + "\n"
2356
- "\nArguments\n"
2357
- "1. newsize (numeric, optional, default=100) The new keypool size\n"
2358
- "\nExamples:\n"
2359
- + HelpExampleCli("keypoolrefill", "")
2360
- + HelpExampleRpc("keypoolrefill", "")
2361
- );
2362
-
2363
- LOCK2(cs_main, pwallet->cs_wallet);
2364
-
2365
- // 0 is interpreted by TopUpKeyPool() as the default keypool size given by -keypool
2366
- unsigned int kpSize = 0;
2367
- if (!request.params[0].isNull()) {
2368
- if (request.params[0].get_int() < 0)
2369
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected valid size.");
2370
- kpSize = (unsigned int)request.params[0].get_int();
2371
- }
2372
-
2373
- EnsureWalletIsUnlocked(pwallet);
2374
- pwallet->TopUpKeyPool(kpSize);
2375
-
2376
- if (pwallet->GetKeyPoolSize() < kpSize) {
2377
- throw JSONRPCError(RPC_WALLET_ERROR, "Error refreshing keypool.");
2378
- }
2379
-
2380
- return NullUniValue;
2381
- }
2382
-
2383
-
2384
- static void LockWallet(CWallet* pWallet)
2385
- {
2386
- LOCK(pWallet->cs_wallet);
2387
- pWallet->nRelockTime = 0;
2388
- pWallet->Lock();
2389
- }
2390
-
2391
- UniValue walletpassphrase(const JSONRPCRequest& request)
2392
- {
2393
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2394
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2395
- return NullUniValue;
2396
- }
2397
-
2398
- if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 2)) {
2399
- throw std::runtime_error(
2400
- "walletpassphrase \"passphrase\" timeout\n"
2401
- "\nStores the wallet decryption key in memory for 'timeout' seconds.\n"
2402
- "This is needed prior to performing transactions related to private keys such as sending neurais\n"
2403
- "\nArguments:\n"
2404
- "1. \"passphrase\" (string, required) The wallet passphrase\n"
2405
- "2. timeout (numeric, required) The time to keep the decryption key in seconds.\n"
2406
- "\nNote:\n"
2407
- "Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock\n"
2408
- "time that overrides the old one.\n"
2409
- "\nExamples:\n"
2410
- "\nUnlock the wallet for 60 seconds\n"
2411
- + HelpExampleCli("walletpassphrase", "\"my pass phrase\" 60") +
2412
- "\nLock the wallet again (before 60 seconds)\n"
2413
- + HelpExampleCli("walletlock", "") +
2414
- "\nAs json rpc call\n"
2415
- + HelpExampleRpc("walletpassphrase", "\"my pass phrase\", 60")
2416
- );
2417
- }
2418
-
2419
- LOCK2(cs_main, pwallet->cs_wallet);
2420
-
2421
- if (request.fHelp)
2422
- return true;
2423
- if (!pwallet->IsCrypted()) {
2424
- throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrase was called.");
2425
- }
2426
-
2427
- // Note that the walletpassphrase is stored in request.params[0] which is not mlock()ed
2428
- SecureString strWalletPass;
2429
- strWalletPass.reserve(100);
2430
- // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
2431
- // Alternately, find a way to make request.params[0] mlock()'d to begin with.
2432
- strWalletPass = request.params[0].get_str().c_str();
2433
-
2434
- if (strWalletPass.length() > 0)
2435
- {
2436
- if (!pwallet->Unlock(strWalletPass)) {
2437
- throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
2438
- }
2439
- }
2440
- else
2441
- throw std::runtime_error(
2442
- "walletpassphrase <passphrase> <timeout>\n"
2443
- "Stores the wallet decryption key in memory for <timeout> seconds.");
2444
-
2445
- pwallet->TopUpKeyPool();
2446
-
2447
- int64_t nSleepTime = request.params[1].get_int64();
2448
- pwallet->nRelockTime = GetTime() + nSleepTime;
2449
- RPCRunLater(strprintf("lockwallet(%s)", pwallet->GetName()), boost::bind(LockWallet, pwallet), nSleepTime);
2450
-
2451
- return NullUniValue;
2452
- }
2453
-
2454
-
2455
- UniValue walletpassphrasechange(const JSONRPCRequest& request)
2456
- {
2457
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2458
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2459
- return NullUniValue;
2460
- }
2461
-
2462
- if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 2)) {
2463
- throw std::runtime_error(
2464
- "walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n"
2465
- "\nChanges the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.\n"
2466
- "\nArguments:\n"
2467
- "1. \"oldpassphrase\" (string) The current passphrase\n"
2468
- "2. \"newpassphrase\" (string) The new passphrase\n"
2469
- "\nExamples:\n"
2470
- + HelpExampleCli("walletpassphrasechange", "\"old one\" \"new one\"")
2471
- + HelpExampleRpc("walletpassphrasechange", "\"old one\", \"new one\"")
2472
- );
2473
- }
2474
-
2475
- LOCK2(cs_main, pwallet->cs_wallet);
2476
-
2477
- if (request.fHelp)
2478
- return true;
2479
- if (!pwallet->IsCrypted()) {
2480
- throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrasechange was called.");
2481
- }
2482
-
2483
- // TODO: get rid of these .c_str() calls by implementing SecureString::operator=(std::string)
2484
- // Alternately, find a way to make request.params[0] mlock()'d to begin with.
2485
- SecureString strOldWalletPass;
2486
- strOldWalletPass.reserve(100);
2487
- strOldWalletPass = request.params[0].get_str().c_str();
2488
-
2489
- SecureString strNewWalletPass;
2490
- strNewWalletPass.reserve(100);
2491
- strNewWalletPass = request.params[1].get_str().c_str();
2492
-
2493
- if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1)
2494
- throw std::runtime_error(
2495
- "walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
2496
- "Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
2497
-
2498
- if (!pwallet->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass)) {
2499
- throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
2500
- }
2501
-
2502
- return NullUniValue;
2503
- }
2504
-
2505
-
2506
- UniValue walletlock(const JSONRPCRequest& request)
2507
- {
2508
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2509
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2510
- return NullUniValue;
2511
- }
2512
-
2513
- if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 0)) {
2514
- throw std::runtime_error(
2515
- "walletlock\n"
2516
- "\nRemoves the wallet encryption key from memory, locking the wallet.\n"
2517
- "After calling this method, you will need to call walletpassphrase again\n"
2518
- "before being able to call any methods which require the wallet to be unlocked.\n"
2519
- "\nExamples:\n"
2520
- "\nSet the passphrase for 2 minutes to perform a transaction\n"
2521
- + HelpExampleCli("walletpassphrase", "\"my pass phrase\" 120") +
2522
- "\nPerform a send (requires passphrase set)\n"
2523
- + HelpExampleCli("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 1.0") +
2524
- "\nClear the passphrase since we are done before 2 minutes is up\n"
2525
- + HelpExampleCli("walletlock", "") +
2526
- "\nAs json rpc call\n"
2527
- + HelpExampleRpc("walletlock", "")
2528
- );
2529
- }
2530
-
2531
- LOCK2(cs_main, pwallet->cs_wallet);
2532
-
2533
- if (request.fHelp)
2534
- return true;
2535
- if (!pwallet->IsCrypted()) {
2536
- throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletlock was called.");
2537
- }
2538
-
2539
- pwallet->Lock();
2540
- pwallet->nRelockTime = 0;
2541
-
2542
- return NullUniValue;
2543
- }
2544
-
2545
-
2546
- UniValue encryptwallet(const JSONRPCRequest& request)
2547
- {
2548
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2549
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2550
- return NullUniValue;
2551
- }
2552
-
2553
- if (!pwallet->IsCrypted() && (request.fHelp || request.params.size() != 1)) {
2554
- throw std::runtime_error(
2555
- "encryptwallet \"passphrase\"\n"
2556
- "\nEncrypts the wallet with 'passphrase'. This is for first time encryption.\n"
2557
- "After this, any calls that interact with private keys such as sending or signing \n"
2558
- "will require the passphrase to be set prior the making these calls.\n"
2559
- "Use the walletpassphrase call for this, and then walletlock call.\n"
2560
- "If the wallet is already encrypted, use the walletpassphrasechange call.\n"
2561
- "Note that this will shutdown the server.\n"
2562
- "\nArguments:\n"
2563
- "1. \"passphrase\" (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.\n"
2564
- "\nExamples:\n"
2565
- "\nEncrypt your wallet\n"
2566
- + HelpExampleCli("encryptwallet", "\"my pass phrase\"") +
2567
- "\nNow set the passphrase to use the wallet, such as for signing or sending neurai\n"
2568
- + HelpExampleCli("walletpassphrase", "\"my pass phrase\"") +
2569
- "\nNow we can do something like sign\n"
2570
- + HelpExampleCli("signmessage", "\"address\" \"test message\"") +
2571
- "\nNow lock the wallet again by removing the passphrase\n"
2572
- + HelpExampleCli("walletlock", "") +
2573
- "\nAs a json rpc call\n"
2574
- + HelpExampleRpc("encryptwallet", "\"my pass phrase\"")
2575
- );
2576
- }
2577
-
2578
- LOCK2(cs_main, pwallet->cs_wallet);
2579
-
2580
- if (request.fHelp)
2581
- return true;
2582
- if (pwallet->IsCrypted()) {
2583
- throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an encrypted wallet, but encryptwallet was called.");
2584
- }
2585
-
2586
- // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
2587
- // Alternately, find a way to make request.params[0] mlock()'d to begin with.
2588
- SecureString strWalletPass;
2589
- strWalletPass.reserve(100);
2590
- strWalletPass = request.params[0].get_str().c_str();
2591
-
2592
- if (strWalletPass.length() < 1)
2593
- throw std::runtime_error(
2594
- "encryptwallet <passphrase>\n"
2595
- "Encrypts the wallet with <passphrase>.");
2596
-
2597
- if (!pwallet->EncryptWallet(strWalletPass)) {
2598
- throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, "Error: Failed to encrypt the wallet.");
2599
- }
2600
-
2601
- // BDB seems to have a bad habit of writing old data into
2602
- // slack space in .dat files; that is bad if the old data is
2603
- // unencrypted private keys. So:
2604
- StartShutdown();
2605
- return "wallet encrypted; Neurai server stopping, restart to run with encrypted wallet. The keypool has been flushed and a new HD seed was generated (if you are using HD). You need to make a new backup.";
2606
- }
2607
-
2608
- UniValue lockunspent(const JSONRPCRequest& request)
2609
- {
2610
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2611
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2612
- return NullUniValue;
2613
- }
2614
-
2615
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
2616
- throw std::runtime_error(
2617
- "lockunspent unlock ([{\"txid\":\"txid\",\"vout\":n},...])\n"
2618
- "\nUpdates list of temporarily unspendable outputs.\n"
2619
- "Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.\n"
2620
- "If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.\n"
2621
- "A locked transaction output will not be chosen by automatic coin selection, when spending neurais.\n"
2622
- "Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list\n"
2623
- "is always cleared (by virtue of process exit) when a node stops or fails.\n"
2624
- "Also see the listunspent call\n"
2625
- "\nArguments:\n"
2626
- "1. unlock (boolean, required) Whether to unlock (true) or lock (false) the specified transactions\n"
2627
- "2. \"transactions\" (string, optional) A json array of objects. Each object the txid (string) vout (numeric)\n"
2628
- " [ (json array of json objects)\n"
2629
- " {\n"
2630
- " \"txid\":\"id\", (string) The transaction id\n"
2631
- " \"vout\": n (numeric) The output number\n"
2632
- " }\n"
2633
- " ,...\n"
2634
- " ]\n"
2635
-
2636
- "\nResult:\n"
2637
- "true|false (boolean) Whether the command was successful or not\n"
2638
-
2639
- "\nExamples:\n"
2640
- "\nList the unspent transactions\n"
2641
- + HelpExampleCli("listunspent", "") +
2642
- "\nLock an unspent transaction\n"
2643
- + HelpExampleCli("lockunspent", "false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2644
- "\nList the locked transactions\n"
2645
- + HelpExampleCli("listlockunspent", "") +
2646
- "\nUnlock the transaction again\n"
2647
- + HelpExampleCli("lockunspent", "true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2648
- "\nAs a json rpc call\n"
2649
- + HelpExampleRpc("lockunspent", "false, \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"")
2650
- );
2651
-
2652
- LOCK2(cs_main, pwallet->cs_wallet);
2653
-
2654
- RPCTypeCheckArgument(request.params[0], UniValue::VBOOL);
2655
-
2656
- bool fUnlock = request.params[0].get_bool();
2657
-
2658
- if (request.params[1].isNull()) {
2659
- if (fUnlock)
2660
- pwallet->UnlockAllCoins();
2661
- return true;
2662
- }
2663
-
2664
- RPCTypeCheckArgument(request.params[1], UniValue::VARR);
2665
-
2666
- UniValue outputs = request.params[1].get_array();
2667
- for (unsigned int idx = 0; idx < outputs.size(); idx++) {
2668
- const UniValue& output = outputs[idx];
2669
- if (!output.isObject())
2670
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected object");
2671
- const UniValue& o = output.get_obj();
2672
-
2673
- RPCTypeCheckObj(o,
2674
- {
2675
- {"txid", UniValueType(UniValue::VSTR)},
2676
- {"vout", UniValueType(UniValue::VNUM)},
2677
- });
2678
-
2679
- std::string txid = find_value(o, "txid").get_str();
2680
- if (!IsHex(txid))
2681
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected hex txid");
2682
-
2683
- int nOutput = find_value(o, "vout").get_int();
2684
- if (nOutput < 0)
2685
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout must be positive");
2686
-
2687
- COutPoint outpt(uint256S(txid), nOutput);
2688
-
2689
- if (fUnlock)
2690
- pwallet->UnlockCoin(outpt);
2691
- else
2692
- pwallet->LockCoin(outpt);
2693
- }
2694
-
2695
- return true;
2696
- }
2697
-
2698
- UniValue listlockunspent(const JSONRPCRequest& request)
2699
- {
2700
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2701
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2702
- return NullUniValue;
2703
- }
2704
-
2705
- if (request.fHelp || request.params.size() > 0)
2706
- throw std::runtime_error(
2707
- "listlockunspent\n"
2708
- "\nReturns list of temporarily unspendable outputs.\n"
2709
- "See the lockunspent call to lock and unlock transactions for spending.\n"
2710
- "\nResult:\n"
2711
- "[\n"
2712
- " {\n"
2713
- " \"txid\" : \"transactionid\", (string) The transaction id locked\n"
2714
- " \"vout\" : n (numeric) The vout value\n"
2715
- " }\n"
2716
- " ,...\n"
2717
- "]\n"
2718
- "\nExamples:\n"
2719
- "\nList the unspent transactions\n"
2720
- + HelpExampleCli("listunspent", "") +
2721
- "\nLock an unspent transaction\n"
2722
- + HelpExampleCli("lockunspent", "false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2723
- "\nList the locked transactions\n"
2724
- + HelpExampleCli("listlockunspent", "") +
2725
- "\nUnlock the transaction again\n"
2726
- + HelpExampleCli("lockunspent", "true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2727
- "\nAs a json rpc call\n"
2728
- + HelpExampleRpc("listlockunspent", "")
2729
- );
2730
-
2731
- ObserveSafeMode();
2732
- LOCK2(cs_main, pwallet->cs_wallet);
2733
-
2734
- std::vector<COutPoint> vOutpts;
2735
- pwallet->ListLockedCoins(vOutpts);
2736
-
2737
- UniValue ret(UniValue::VARR);
2738
-
2739
- for (COutPoint &outpt : vOutpts) {
2740
- UniValue o(UniValue::VOBJ);
2741
-
2742
- o.push_back(Pair("txid", outpt.hash.GetHex()));
2743
- o.push_back(Pair("vout", (int)outpt.n));
2744
- ret.push_back(o);
2745
- }
2746
-
2747
- return ret;
2748
- }
2749
-
2750
- UniValue settxfee(const JSONRPCRequest& request)
2751
- {
2752
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2753
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2754
- return NullUniValue;
2755
- }
2756
-
2757
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 1)
2758
- throw std::runtime_error(
2759
- "settxfee amount\n"
2760
- "\nSet the transaction fee per kB. Overwrites the paytxfee parameter.\n"
2761
- "\nArguments:\n"
2762
- "1. amount (numeric or string, required) The transaction fee in " + CURRENCY_UNIT + "/kB\n"
2763
- "\nResult\n"
2764
- "true|false (boolean) Returns true if successful\n"
2765
- "\nExamples:\n"
2766
- + HelpExampleCli("settxfee", "0.00001")
2767
- + HelpExampleRpc("settxfee", "0.00001")
2768
- );
2769
-
2770
- LOCK2(cs_main, pwallet->cs_wallet);
2771
-
2772
- // Amount
2773
- CAmount nAmount = AmountFromValue(request.params[0]);
2774
-
2775
- payTxFee = CFeeRate(nAmount, 1000);
2776
- return true;
2777
- }
2778
-
2779
- UniValue getwalletinfo(const JSONRPCRequest& request)
2780
- {
2781
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2782
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2783
- return NullUniValue;
2784
- }
2785
-
2786
- if (request.fHelp || request.params.size() != 0)
2787
- throw std::runtime_error(
2788
- "getwalletinfo\n"
2789
- "Returns an object containing various wallet state info.\n"
2790
- "\nResult:\n"
2791
- "{\n"
2792
- " \"walletname\": xxxxx, (string) the wallet name\n"
2793
- " \"walletversion\": xxxxx, (numeric) the wallet version\n"
2794
- " \"balance\": xxxxxxx, (numeric) the total confirmed balance of the wallet in " + CURRENCY_UNIT + "\n"
2795
- " \"unconfirmed_balance\": xxx, (numeric) the total unconfirmed balance of the wallet in " + CURRENCY_UNIT + "\n"
2796
- " \"immature_balance\": xxxxxx, (numeric) the total immature balance of the wallet in " + CURRENCY_UNIT + "\n"
2797
- " \"txcount\": xxxxxxx, (numeric) the total number of transactions in the wallet\n"
2798
- " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool\n"
2799
- " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated (only counts external keys)\n"
2800
- " \"keypoolsize_hd_internal\": xxxx, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)\n"
2801
- " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n"
2802
- " \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in " + CURRENCY_UNIT + "/kB\n"
2803
- " \"hdseedid\": \"<hash160>\" (string, optional) the Hash160 of the HD seed (only present when HD is enabled)\n"
2804
- " \"hdmasterkeyid\": \"<hash160>\" (string, optional) alias for hdseedid retained for backwards-compatibility. Will be removed in V0.18.\n"
2805
- "}\n"
2806
- "\nExamples:\n"
2807
- + HelpExampleCli("getwalletinfo", "")
2808
- + HelpExampleRpc("getwalletinfo", "")
2809
- );
2810
-
2811
- ObserveSafeMode();
2812
- LOCK2(cs_main, pwallet->cs_wallet);
2813
-
2814
- UniValue obj(UniValue::VOBJ);
2815
-
2816
- size_t kpExternalSize = pwallet->KeypoolCountExternalKeys();
2817
- obj.push_back(Pair("walletname", pwallet->GetName()));
2818
- obj.push_back(Pair("walletversion", pwallet->GetVersion()));
2819
- obj.push_back(Pair("balance", ValueFromAmount(pwallet->GetBalance())));
2820
- obj.push_back(Pair("unconfirmed_balance", ValueFromAmount(pwallet->GetUnconfirmedBalance())));
2821
- obj.push_back(Pair("immature_balance", ValueFromAmount(pwallet->GetImmatureBalance())));
2822
- obj.push_back(Pair("txcount", (int)pwallet->mapWallet.size()));
2823
- obj.push_back(Pair("keypoololdest", pwallet->GetOldestKeyPoolTime()));
2824
- obj.push_back(Pair("keypoolsize", (int64_t)kpExternalSize));
2825
- CKeyID seed_id = pwallet->GetHDChain().seed_id;
2826
- if (!seed_id.IsNull() && pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) {
2827
- obj.push_back(Pair("keypoolsize_hd_internal", (int64_t)(pwallet->GetKeyPoolSize() - kpExternalSize)));
2828
- }
2829
- if (pwallet->IsCrypted()) {
2830
- obj.push_back(Pair("unlocked_until", pwallet->nRelockTime));
2831
- }
2832
- obj.push_back(Pair("paytxfee", ValueFromAmount(payTxFee.GetFeePerK())));
2833
- if (!seed_id.IsNull()) {
2834
- obj.push_back(Pair("hdseedid", seed_id.GetHex()));
2835
- obj.push_back(Pair("hdmasterkeyid", seed_id.GetHex()));
2836
- }
2837
- return obj;
2838
- }
2839
-
2840
- UniValue listwallets(const JSONRPCRequest& request)
2841
- {
2842
- if (request.fHelp || request.params.size() != 0)
2843
- throw std::runtime_error(
2844
- "listwallets\n"
2845
- "Returns a list of currently loaded wallets.\n"
2846
- "For full information on the wallet, use \"getwalletinfo\"\n"
2847
- "\nResult:\n"
2848
- "[ (json array of strings)\n"
2849
- " \"walletname\" (string) the wallet name\n"
2850
- " ...\n"
2851
- "]\n"
2852
- "\nExamples:\n"
2853
- + HelpExampleCli("listwallets", "")
2854
- + HelpExampleRpc("listwallets", "")
2855
- );
2856
-
2857
- UniValue obj(UniValue::VARR);
2858
-
2859
- for (CWalletRef pwallet : vpwallets) {
2860
-
2861
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2862
- return NullUniValue;
2863
- }
2864
-
2865
- LOCK(pwallet->cs_wallet);
2866
-
2867
- obj.push_back(pwallet->GetName());
2868
- }
2869
-
2870
- return obj;
2871
- }
2872
-
2873
- UniValue resendwallettransactions(const JSONRPCRequest& request)
2874
- {
2875
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2876
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2877
- return NullUniValue;
2878
- }
2879
-
2880
- if (request.fHelp || request.params.size() != 0)
2881
- throw std::runtime_error(
2882
- "resendwallettransactions\n"
2883
- "Immediately re-broadcast unconfirmed wallet transactions to all peers.\n"
2884
- "Intended only for testing; the wallet code periodically re-broadcasts\n"
2885
- "automatically.\n"
2886
- "Returns an RPC error if -walletbroadcast is set to false.\n"
2887
- "Returns array of transaction ids that were re-broadcast.\n"
2888
- );
2889
-
2890
- if (!g_connman)
2891
- throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
2892
-
2893
- LOCK2(cs_main, pwallet->cs_wallet);
2894
-
2895
- if (!pwallet->GetBroadcastTransactions()) {
2896
- throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast");
2897
- }
2898
-
2899
- std::vector<uint256> txids = pwallet->ResendWalletTransactionsBefore(GetTime(), g_connman.get());
2900
- UniValue result(UniValue::VARR);
2901
- for (const uint256& txid : txids)
2902
- {
2903
- result.push_back(txid.ToString());
2904
- }
2905
- return result;
2906
- }
2907
-
2908
- UniValue listunspent(const JSONRPCRequest& request)
2909
- {
2910
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
2911
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
2912
- return NullUniValue;
2913
- }
2914
-
2915
- if (request.fHelp || request.params.size() > 5)
2916
- throw std::runtime_error(
2917
- "listunspent ( minconf maxconf [\"addresses\",...] [include_unsafe] [query_options])\n"
2918
- "\nReturns array of unspent transaction outputs\n"
2919
- "with between minconf and maxconf (inclusive) confirmations.\n"
2920
- "Optionally filter to only include txouts paid to specified addresses.\n"
2921
- "\nArguments:\n"
2922
- "1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n"
2923
- "2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n"
2924
- "3. \"addresses\" (string) A json array of neurai addresses to filter\n"
2925
- " [\n"
2926
- " \"address\" (string) neurai address\n"
2927
- " ,...\n"
2928
- " ]\n"
2929
- "4. include_unsafe (bool, optional, default=true) Include outputs that are not safe to spend\n"
2930
- " See description of \"safe\" attribute below.\n"
2931
- "5. query_options (json, optional) JSON with query options\n"
2932
- " {\n"
2933
- " \"minimumAmount\" (numeric or string, default=0) Minimum value of each UTXO in " + CURRENCY_UNIT + "\n"
2934
- " \"maximumAmount\" (numeric or string, default=unlimited) Maximum value of each UTXO in " + CURRENCY_UNIT + "\n"
2935
- " \"maximumCount\" (numeric or string, default=unlimited) Maximum number of UTXOs\n"
2936
- " \"minimumSumAmount\" (numeric or string, default=unlimited) Minimum sum value of all UTXOs in " + CURRENCY_UNIT + "\n"
2937
- " }\n"
2938
- "\nResult\n"
2939
- "[ (array of json object)\n"
2940
- " {\n"
2941
- " \"txid\" : \"txid\", (string) the transaction id \n"
2942
- " \"vout\" : n, (numeric) the vout value\n"
2943
- " \"address\" : \"address\", (string) the neurai address\n"
2944
- " \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n"
2945
- " \"scriptPubKey\" : \"key\", (string) the script key\n"
2946
- " \"amount\" : x.xxx, (numeric) the transaction output amount in " + CURRENCY_UNIT + "\n"
2947
- " \"confirmations\" : n, (numeric) The number of confirmations\n"
2948
- " \"redeemScript\" : n (string) The redeemScript if scriptPubKey is P2SH\n"
2949
- " \"spendable\" : xxx, (bool) Whether we have the private keys to spend this output\n"
2950
- " \"solvable\" : xxx, (bool) Whether we know how to spend this output, ignoring the lack of keys\n"
2951
- " \"safe\" : xxx (bool) Whether this output is considered safe to spend. Unconfirmed transactions\n"
2952
- " from outside keys and unconfirmed replacement transactions are considered unsafe\n"
2953
- " and are not eligible for spending by fundrawtransaction and sendtoaddress.\n"
2954
- " }\n"
2955
- " ,...\n"
2956
- "]\n"
2957
-
2958
- "\nExamples\n"
2959
- + HelpExampleCli("listunspent", "")
2960
- + HelpExampleCli("listunspent", "6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
2961
- + HelpExampleRpc("listunspent", "6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
2962
- + HelpExampleCli("listunspent", "6 9999999 '[]' true '{ \"minimumAmount\": 0.005 }'")
2963
- + HelpExampleRpc("listunspent", "6, 9999999, [] , true, { \"minimumAmount\": 0.005 } ")
2964
- );
2965
-
2966
- ObserveSafeMode();
2967
-
2968
- int nMinDepth = 1;
2969
- if (!request.params[0].isNull()) {
2970
- RPCTypeCheckArgument(request.params[0], UniValue::VNUM);
2971
- nMinDepth = request.params[0].get_int();
2972
- }
2973
-
2974
- int nMaxDepth = 9999999;
2975
- if (!request.params[1].isNull()) {
2976
- RPCTypeCheckArgument(request.params[1], UniValue::VNUM);
2977
- nMaxDepth = request.params[1].get_int();
2978
- }
2979
-
2980
- std::set<CTxDestination> destinations;
2981
- if (!request.params[2].isNull()) {
2982
- RPCTypeCheckArgument(request.params[2], UniValue::VARR);
2983
- UniValue inputs = request.params[2].get_array();
2984
- for (unsigned int idx = 0; idx < inputs.size(); idx++) {
2985
- const UniValue& input = inputs[idx];
2986
- CTxDestination dest = DecodeDestination(input.get_str());
2987
- if (!IsValidDestination(dest)) {
2988
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string("Invalid Neurai address: ") + input.get_str());
2989
- }
2990
- if (!destinations.insert(dest).second) {
2991
- throw JSONRPCError(RPC_INVALID_PARAMETER, std::string("Invalid parameter, duplicated address: ") + input.get_str());
2992
- }
2993
- }
2994
- }
2995
-
2996
- bool include_unsafe = true;
2997
- if (!request.params[3].isNull()) {
2998
- RPCTypeCheckArgument(request.params[3], UniValue::VBOOL);
2999
- include_unsafe = request.params[3].get_bool();
3000
- }
3001
-
3002
- CAmount nMinimumAmount = 0;
3003
- CAmount nMaximumAmount = MAX_MONEY;
3004
- CAmount nMinimumSumAmount = MAX_MONEY;
3005
- uint64_t nMaximumCount = 0;
3006
-
3007
- if (!request.params[4].isNull()) {
3008
- const UniValue& options = request.params[4].get_obj();
3009
-
3010
- if (options.exists("minimumAmount"))
3011
- nMinimumAmount = AmountFromValue(options["minimumAmount"]);
3012
-
3013
- if (options.exists("maximumAmount"))
3014
- nMaximumAmount = AmountFromValue(options["maximumAmount"]);
3015
-
3016
- if (options.exists("minimumSumAmount"))
3017
- nMinimumSumAmount = AmountFromValue(options["minimumSumAmount"]);
3018
-
3019
- if (options.exists("maximumCount"))
3020
- nMaximumCount = options["maximumCount"].get_int64();
3021
- }
3022
-
3023
- UniValue results(UniValue::VARR);
3024
- std::vector<COutput> vecOutputs;
3025
- assert(pwallet != nullptr);
3026
- LOCK2(cs_main, pwallet->cs_wallet);
3027
-
3028
- pwallet->AvailableCoins(vecOutputs, !include_unsafe, nullptr, nMinimumAmount, nMaximumAmount, nMinimumSumAmount, nMaximumCount, nMinDepth, nMaxDepth);
3029
- for (const COutput& out : vecOutputs) {
3030
- CTxDestination address;
3031
- const CScript& scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey;
3032
- bool fValidAddress = ExtractDestination(scriptPubKey, address);
3033
-
3034
- if (destinations.size() && (!fValidAddress || !destinations.count(address)))
3035
- continue;
3036
-
3037
- UniValue entry(UniValue::VOBJ);
3038
- entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
3039
- entry.push_back(Pair("vout", out.i));
3040
-
3041
- if (fValidAddress) {
3042
- entry.push_back(Pair("address", EncodeDestination(address)));
3043
-
3044
- if (pwallet->mapAddressBook.count(address)) {
3045
- entry.push_back(Pair("account", pwallet->mapAddressBook[address].name));
3046
- }
3047
-
3048
- if (scriptPubKey.IsPayToScriptHash()) {
3049
- const CScriptID& hash = boost::get<CScriptID>(address);
3050
- CScript redeemScript;
3051
- if (pwallet->GetCScript(hash, redeemScript)) {
3052
- entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));
3053
- }
3054
- }
3055
- }
3056
-
3057
- entry.push_back(Pair("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end())));
3058
- entry.push_back(Pair("amount", ValueFromAmount(out.tx->tx->vout[out.i].nValue)));
3059
- entry.push_back(Pair("confirmations", out.nDepth));
3060
- entry.push_back(Pair("spendable", out.fSpendable));
3061
- entry.push_back(Pair("solvable", out.fSolvable));
3062
- entry.push_back(Pair("safe", out.fSafe));
3063
- results.push_back(entry);
3064
- }
3065
-
3066
- return results;
3067
- }
3068
-
3069
- UniValue fundrawtransaction(const JSONRPCRequest& request)
3070
- {
3071
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
3072
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
3073
- return NullUniValue;
3074
- }
3075
-
3076
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
3077
- throw std::runtime_error(
3078
- "fundrawtransaction \"hexstring\" ( options )\n"
3079
- "\nAdd inputs to a transaction until it has enough in value to meet its out value.\n"
3080
- "This will not modify existing inputs, and will add at most one change output to the outputs.\n"
3081
- "No existing outputs will be modified unless \"subtractFeeFromOutputs\" is specified.\n"
3082
- "Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.\n"
3083
- "The inputs added will not be signed, use signrawtransaction for that.\n"
3084
- "Note that all existing inputs must have their previous output transaction be in the wallet.\n"
3085
- "Note that all inputs selected must be of standard form and P2SH scripts must be\n"
3086
- "in the wallet using importaddress or addmultisigaddress (to calculate fees).\n"
3087
- "You can see whether this is the case by checking the \"solvable\" field in the listunspent output.\n"
3088
- "Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only\n"
3089
- "\nArguments:\n"
3090
- "1. \"hexstring\" (string, required) The hex string of the raw transaction\n"
3091
- "2. options (object, optional)\n"
3092
- " {\n"
3093
- " \"changeAddress\" (string, optional, default pool address) The neurai address to receive the change\n"
3094
- " \"changePosition\" (numeric, optional, default random) The index of the change output\n"
3095
- " \"includeWatching\" (boolean, optional, default false) Also select inputs which are watch only\n"
3096
- " \"lockUnspents\" (boolean, optional, default false) Lock selected unspent outputs\n"
3097
- " \"feeRate\" (numeric, optional, default not set: makes wallet determine the fee) Set a specific fee rate in " + CURRENCY_UNIT + "/kB\n"
3098
- " \"subtractFeeFromOutputs\" (array, optional) A json array of integers.\n"
3099
- " The fee will be equally deducted from the amount of each specified output.\n"
3100
- " The outputs are specified by their zero-based index, before any change output is added.\n"
3101
- " Those recipients will receive less neurais than you enter in their corresponding amount field.\n"
3102
- " If no outputs are specified here, the sender pays the fee.\n"
3103
- " [vout_index,...]\n"
3104
- // " \"replaceable\" (boolean, optional) Marks this transaction as BIP125 replaceable.\n"
3105
- " Allows this transaction to be replaced by a transaction with higher fees\n"
3106
- " \"conf_target\" (numeric, optional) Confirmation target (in blocks)\n"
3107
- " \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n"
3108
- " \"UNSET\"\n"
3109
- " \"ECONOMICAL\"\n"
3110
- " \"CONSERVATIVE\"\n"
3111
- " }\n"
3112
- " for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n"
3113
- "\nResult:\n"
3114
- "{\n"
3115
- " \"hex\": \"value\", (string) The resulting raw transaction (hex-encoded string)\n"
3116
- " \"fee\": n, (numeric) Fee in " + CURRENCY_UNIT + " the resulting transaction pays\n"
3117
- " \"changepos\": n (numeric) The position of the added change output, or -1\n"
3118
- "}\n"
3119
- "\nExamples:\n"
3120
- "\nCreate a transaction with no inputs\n"
3121
- + HelpExampleCli("createrawtransaction", "\"[]\" \"{\\\"myaddress\\\":0.01}\"") +
3122
- "\nAdd sufficient unsigned inputs to meet the output value\n"
3123
- + HelpExampleCli("fundrawtransaction", "\"rawtransactionhex\"") +
3124
- "\nSign the transaction\n"
3125
- + HelpExampleCli("signrawtransaction", "\"fundedtransactionhex\"") +
3126
- "\nSend the transaction\n"
3127
- + HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"")
3128
- );
3129
-
3130
- ObserveSafeMode();
3131
- RPCTypeCheck(request.params, {UniValue::VSTR});
3132
-
3133
- CCoinControl coinControl;
3134
- int changePosition = -1;
3135
- bool lockUnspents = false;
3136
- UniValue subtractFeeFromOutputs;
3137
- std::set<int> setSubtractFeeFromOutputs;
3138
-
3139
- if (!request.params[1].isNull()) {
3140
- if (request.params[1].type() == UniValue::VBOOL) {
3141
- // backward compatibility bool only fallback
3142
- coinControl.fAllowWatchOnly = request.params[1].get_bool();
3143
- }
3144
- else {
3145
- RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VOBJ});
3146
-
3147
- UniValue options = request.params[1];
3148
-
3149
- RPCTypeCheckObj(options,
3150
- {
3151
- {"changeAddress", UniValueType(UniValue::VSTR)},
3152
- {"changePosition", UniValueType(UniValue::VNUM)},
3153
- {"includeWatching", UniValueType(UniValue::VBOOL)},
3154
- {"lockUnspents", UniValueType(UniValue::VBOOL)},
3155
- {"reserveChangeKey", UniValueType(UniValue::VBOOL)}, // DEPRECATED (and ignored), should be removed in 0.16 or so.
3156
- {"feeRate", UniValueType()}, // will be checked below
3157
- {"subtractFeeFromOutputs", UniValueType(UniValue::VARR)},
3158
- // {"replaceable", UniValueType(UniValue::VBOOL)},
3159
- {"conf_target", UniValueType(UniValue::VNUM)},
3160
- {"estimate_mode", UniValueType(UniValue::VSTR)},
3161
- },
3162
- true, true);
3163
-
3164
- if (options.exists("changeAddress")) {
3165
- CTxDestination dest = DecodeDestination(options["changeAddress"].get_str());
3166
-
3167
- if (!IsValidDestination(dest)) {
3168
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "changeAddress must be a valid neurai address");
3169
- }
3170
-
3171
- coinControl.destChange = dest;
3172
- }
3173
-
3174
- if (options.exists("changePosition"))
3175
- changePosition = options["changePosition"].get_int();
3176
-
3177
- if (options.exists("includeWatching"))
3178
- coinControl.fAllowWatchOnly = options["includeWatching"].get_bool();
3179
-
3180
- if (options.exists("lockUnspents"))
3181
- lockUnspents = options["lockUnspents"].get_bool();
3182
-
3183
- if (options.exists("feeRate"))
3184
- {
3185
- coinControl.m_feerate = CFeeRate(AmountFromValue(options["feeRate"]));
3186
- coinControl.fOverrideFeeRate = true;
3187
- }
3188
-
3189
- if (options.exists("subtractFeeFromOutputs"))
3190
- subtractFeeFromOutputs = options["subtractFeeFromOutputs"].get_array();
3191
-
3192
- // if (options.exists("replaceable")) {
3193
- // coinControl.signalRbf = options["replaceable"].get_bool();
3194
- // }
3195
- if (options.exists("conf_target")) {
3196
- if (options.exists("feeRate")) {
3197
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot specify both conf_target and feeRate");
3198
- }
3199
- coinControl.m_confirm_target = ParseConfirmTarget(options["conf_target"]);
3200
- }
3201
- if (options.exists("estimate_mode")) {
3202
- if (options.exists("feeRate")) {
3203
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot specify both estimate_mode and feeRate");
3204
- }
3205
- if (!FeeModeFromString(options["estimate_mode"].get_str(), coinControl.m_fee_mode)) {
3206
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid estimate_mode parameter");
3207
- }
3208
- }
3209
- }
3210
- }
3211
-
3212
- // parse hex string from parameter
3213
- CMutableTransaction tx;
3214
- if (!DecodeHexTx(tx, request.params[0].get_str(), true))
3215
- throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
3216
-
3217
- if (tx.vout.size() == 0)
3218
- throw JSONRPCError(RPC_INVALID_PARAMETER, "TX must have at least one output");
3219
-
3220
- if (changePosition != -1 && (changePosition < 0 || (unsigned int)changePosition > tx.vout.size()))
3221
- throw JSONRPCError(RPC_INVALID_PARAMETER, "changePosition out of bounds");
3222
-
3223
- for (unsigned int idx = 0; idx < subtractFeeFromOutputs.size(); idx++) {
3224
- int pos = subtractFeeFromOutputs[idx].get_int();
3225
- if (setSubtractFeeFromOutputs.count(pos))
3226
- throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid parameter, duplicated position: %d", pos));
3227
- if (pos < 0)
3228
- throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid parameter, negative position: %d", pos));
3229
- if (pos >= int(tx.vout.size()))
3230
- throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid parameter, position too large: %d", pos));
3231
- setSubtractFeeFromOutputs.insert(pos);
3232
- }
3233
-
3234
- CAmount nFeeOut;
3235
- std::string strFailReason;
3236
-
3237
- if (!pwallet->FundTransaction(tx, nFeeOut, changePosition, strFailReason, lockUnspents, setSubtractFeeFromOutputs, coinControl)) {
3238
- throw JSONRPCError(RPC_WALLET_ERROR, strFailReason);
3239
- }
3240
-
3241
- UniValue result(UniValue::VOBJ);
3242
- result.push_back(Pair("hex", EncodeHexTx(tx)));
3243
- result.push_back(Pair("changepos", changePosition));
3244
- result.push_back(Pair("fee", ValueFromAmount(nFeeOut)));
3245
-
3246
- return result;
3247
- }
3248
-
3249
- UniValue bumpfee(const JSONRPCRequest& request)
3250
- {
3251
- throw std::runtime_error("bumpfee has been deprecated on the XNA Wallet.");
3252
-
3253
- // CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
3254
- //
3255
- // if (!EnsureWalletIsAvailable(pwallet, request.fHelp))
3256
- // return NullUniValue;
3257
- //
3258
- // if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) {
3259
- // throw std::runtime_error(
3260
- // "bumpfee \"txid\" ( options ) \n"
3261
- // "\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\n"
3262
- // "An opt-in RBF transaction with the given txid must be in the wallet.\n"
3263
- // "The command will pay the additional fee by decreasing (or perhaps removing) its change output.\n"
3264
- // "If the change output is not big enough to cover the increased fee, the command will currently fail\n"
3265
- // "instead of adding new inputs to compensate. (A future implementation could improve this.)\n"
3266
- // "The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n"
3267
- // "By default, the new fee will be calculated automatically using estimatefee.\n"
3268
- // "The user can specify a confirmation target for estimatefee.\n"
3269
- // "Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.\n"
3270
- // "At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n"
3271
- // "returned by getnetworkinfo) to enter the node's mempool.\n"
3272
- // "\nArguments:\n"
3273
- // "1. txid (string, required) The txid to be bumped\n"
3274
- // "2. options (object, optional)\n"
3275
- // " {\n"
3276
- // " \"confTarget\" (numeric, optional) Confirmation target (in blocks)\n"
3277
- // " \"totalFee\" (numeric, optional) Total fee (NOT feerate) to pay, in satoshis.\n"
3278
- // " In rare cases, the actual fee paid might be slightly higher than the specified\n"
3279
- // " totalFee if the tx change output has to be removed because it is too close to\n"
3280
- // " the dust threshold.\n"
3281
- // " \"replaceable\" (boolean, optional, default true) Whether the new transaction should still be\n"
3282
- // " marked bip-125 replaceable. If true, the sequence numbers in the transaction will\n"
3283
- // " be left unchanged from the original. If false, any input sequence numbers in the\n"
3284
- // " original transaction that were less than 0xfffffffe will be increased to 0xfffffffe\n"
3285
- // " so the new transaction will not be explicitly bip-125 replaceable (though it may\n"
3286
- // " still be replaceable in practice, for example if it has unconfirmed ancestors which\n"
3287
- // " are replaceable).\n"
3288
- // " \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n"
3289
- // " \"UNSET\"\n"
3290
- // " \"ECONOMICAL\"\n"
3291
- // " \"CONSERVATIVE\"\n"
3292
- // " }\n"
3293
- // "\nResult:\n"
3294
- // "{\n"
3295
- // " \"txid\": \"value\", (string) The id of the new transaction\n"
3296
- // " \"origfee\": n, (numeric) Fee of the replaced transaction\n"
3297
- // " \"fee\": n, (numeric) Fee of the new transaction\n"
3298
- // " \"errors\": [ str... ] (json array of strings) Errors encountered during processing (may be empty)\n"
3299
- // "}\n"
3300
- // "\nExamples:\n"
3301
- // "\nBump the fee, get the new transaction\'s txid\n" +
3302
- // HelpExampleCli("bumpfee", "<txid>"));
3303
- // }
3304
- //
3305
- // RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VOBJ});
3306
- // uint256 hash;
3307
- // hash.SetHex(request.params[0].get_str());
3308
- //
3309
- // // optional parameters
3310
- // CAmount totalFee = 0;
3311
- // CCoinControl coin_control;
3312
- // coin_control.signalRbf = true;
3313
- // if (!request.params[1].isNull()) {
3314
- // UniValue options = request.params[1];
3315
- // RPCTypeCheckObj(options,
3316
- // {
3317
- // {"confTarget", UniValueType(UniValue::VNUM)},
3318
- // {"totalFee", UniValueType(UniValue::VNUM)},
3319
- // {"replaceable", UniValueType(UniValue::VBOOL)},
3320
- // {"estimate_mode", UniValueType(UniValue::VSTR)},
3321
- // },
3322
- // true, true);
3323
- //
3324
- // if (options.exists("confTarget") && options.exists("totalFee")) {
3325
- // throw JSONRPCError(RPC_INVALID_PARAMETER, "confTarget and totalFee options should not both be set. Please provide either a confirmation target for fee estimation or an explicit total fee for the transaction.");
3326
- // } else if (options.exists("confTarget")) { // TODO: alias this to conf_target
3327
- // coin_control.m_confirm_target = ParseConfirmTarget(options["confTarget"]);
3328
- // } else if (options.exists("totalFee")) {
3329
- // totalFee = options["totalFee"].get_int64();
3330
- // if (totalFee <= 0) {
3331
- // throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid totalFee %s (must be greater than 0)", FormatMoney(totalFee)));
3332
- // }
3333
- // }
3334
- //
3335
- // if (options.exists("replaceable")) {
3336
- // coin_control.signalRbf = options["replaceable"].get_bool();
3337
- // }
3338
- // if (options.exists("estimate_mode")) {
3339
- // if (!FeeModeFromString(options["estimate_mode"].get_str(), coin_control.m_fee_mode)) {
3340
- // throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid estimate_mode parameter");
3341
- // }
3342
- // }
3343
- // }
3344
- //
3345
- // LOCK2(cs_main, pwallet->cs_wallet);
3346
- // EnsureWalletIsUnlocked(pwallet);
3347
- //
3348
- // CFeeBumper feeBump(pwallet, hash, coin_control, totalFee);
3349
- // BumpFeeResult res = feeBump.getResult();
3350
- // if (res != BumpFeeResult::OK)
3351
- // {
3352
- // switch(res) {
3353
- // case BumpFeeResult::INVALID_ADDRESS_OR_KEY:
3354
- // throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, feeBump.getErrors()[0]);
3355
- // break;
3356
- // case BumpFeeResult::INVALID_REQUEST:
3357
- // throw JSONRPCError(RPC_INVALID_REQUEST, feeBump.getErrors()[0]);
3358
- // break;
3359
- // case BumpFeeResult::INVALID_PARAMETER:
3360
- // throw JSONRPCError(RPC_INVALID_PARAMETER, feeBump.getErrors()[0]);
3361
- // break;
3362
- // case BumpFeeResult::WALLET_ERROR:
3363
- // throw JSONRPCError(RPC_WALLET_ERROR, feeBump.getErrors()[0]);
3364
- // break;
3365
- // default:
3366
- // throw JSONRPCError(RPC_MISC_ERROR, feeBump.getErrors()[0]);
3367
- // break;
3368
- // }
3369
- // }
3370
- //
3371
- // // sign bumped transaction
3372
- // if (!feeBump.signTransaction(pwallet)) {
3373
- // throw JSONRPCError(RPC_WALLET_ERROR, "Can't sign transaction.");
3374
- // }
3375
- // // commit the bumped transaction
3376
- // if(!feeBump.commit(pwallet)) {
3377
- // throw JSONRPCError(RPC_WALLET_ERROR, feeBump.getErrors()[0]);
3378
- // }
3379
- // UniValue result(UniValue::VOBJ);
3380
- // result.push_back(Pair("txid", feeBump.getBumpedTxId().GetHex()));
3381
- // result.push_back(Pair("origfee", ValueFromAmount(feeBump.getOldFee())));
3382
- // result.push_back(Pair("fee", ValueFromAmount(feeBump.getNewFee())));
3383
- // UniValue errors(UniValue::VARR);
3384
- // for (const std::string& err: feeBump.getErrors())
3385
- // errors.push_back(err);
3386
- // result.push_back(Pair("errors", errors));
3387
- //
3388
- // return result;
3389
- }
3390
-
3391
- UniValue generate(const JSONRPCRequest& request)
3392
- {
3393
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
3394
-
3395
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
3396
- return NullUniValue;
3397
- }
3398
-
3399
- if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) {
3400
- throw std::runtime_error(
3401
- "generate nblocks ( maxtries )\n"
3402
- "\nMine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.\n"
3403
- "\nArguments:\n"
3404
- "1. nblocks (numeric, required) How many blocks are generated immediately.\n"
3405
- "2. maxtries (numeric, optional) How many iterations to try (default = 1000000).\n"
3406
- "\nResult:\n"
3407
- "[ blockhashes ] (array) hashes of blocks generated\n"
3408
- "\nExamples:\n"
3409
- "\nGenerate 11 blocks\n"
3410
- + HelpExampleCli("generate", "11")
3411
- );
3412
- }
3413
-
3414
- int num_generate = request.params[0].get_int();
3415
- uint64_t max_tries = 1000000;
3416
- if (!request.params[1].isNull()) {
3417
- max_tries = request.params[1].get_int();
3418
- }
3419
-
3420
- std::shared_ptr<CReserveScript> coinbase_script;
3421
- pwallet->GetScriptForMining(coinbase_script);
3422
-
3423
- // If the keypool is exhausted, no script is returned at all. Catch this.
3424
- if (!coinbase_script) {
3425
- throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
3426
- }
3427
-
3428
- //throw an error if no script was provided
3429
- if (coinbase_script->reserveScript.empty()) {
3430
- throw JSONRPCError(RPC_INTERNAL_ERROR, "No coinbase script available");
3431
- }
3432
-
3433
- return generateBlocks(coinbase_script, num_generate, max_tries, true);
3434
- }
3435
-
3436
- UniValue rescanblockchain(const JSONRPCRequest& request)
3437
- {
3438
- CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
3439
- if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
3440
- return NullUniValue;
3441
- }
3442
-
3443
- if (request.fHelp || request.params.size() > 2) {
3444
- throw std::runtime_error(
3445
- "rescanblockchain (\"start_height\") (\"stop_height\")\n"
3446
- "\nRescan the local blockchain for wallet related transactions.\n"
3447
- "\nArguments:\n"
3448
- "1. \"start_height\" (numeric, optional) block height where the rescan should start\n"
3449
- "2. \"stop_height\" (numeric, optional) the last block height that should be scanned\n"
3450
- "\nResult:\n"
3451
- "{\n"
3452
- " \"start_height\" (numeric) The block height where the rescan has started. If omitted, rescan started from the genesis block.\n"
3453
- " \"stop_height\" (numeric) The height of the last rescanned block. If omitted, rescan stopped at the chain tip.\n"
3454
- "}\n"
3455
- "\nExamples:\n"
3456
- + HelpExampleCli("rescanblockchain", "100000 120000")
3457
- + HelpExampleRpc("rescanblockchain", "100000, 120000")
3458
- );
3459
- }
3460
-
3461
- LOCK2(cs_main, pwallet->cs_wallet);
3462
-
3463
- CBlockIndex *pindexStart = chainActive.Genesis();
3464
- CBlockIndex *pindexStop = nullptr;
3465
- if (!request.params[0].isNull()) {
3466
- pindexStart = chainActive[request.params[0].get_int()];
3467
- if (!pindexStart) {
3468
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid start_height");
3469
- }
3470
- }
3471
-
3472
- if (!request.params[1].isNull()) {
3473
- pindexStop = chainActive[request.params[1].get_int()];
3474
- if (!pindexStop) {
3475
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid stop_height");
3476
- }
3477
- else if (pindexStop->nHeight < pindexStart->nHeight) {
3478
- throw JSONRPCError(RPC_INVALID_PARAMETER, "stop_height must be greater then start_height");
3479
- }
3480
- }
3481
-
3482
- // We can't rescan beyond non-pruned blocks, stop and throw an error
3483
- if (fPruneMode) {
3484
- CBlockIndex *block = pindexStop ? pindexStop : chainActive.Tip();
3485
- while (block && block->nHeight >= pindexStart->nHeight) {
3486
- if (!(block->nStatus & BLOCK_HAVE_DATA)) {
3487
- throw JSONRPCError(RPC_MISC_ERROR, "Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.");
3488
- }
3489
- block = block->pprev;
3490
- }
3491
- }
3492
-
3493
- CBlockIndex *stopBlock = pwallet->ScanForWalletTransactions(pindexStart, pindexStop, true);
3494
- if (!stopBlock) {
3495
- if (pwallet->IsAbortingRescan()) {
3496
- throw JSONRPCError(RPC_MISC_ERROR, "Rescan aborted.");
3497
- }
3498
- // if we got a nullptr returned, ScanForWalletTransactions did rescan up to the requested stopindex
3499
- stopBlock = pindexStop ? pindexStop : chainActive.Tip();
3500
- }
3501
- else {
3502
- throw JSONRPCError(RPC_MISC_ERROR, "Rescan failed. Potentially corrupted data files.");
3503
- }
3504
-
3505
- UniValue response(UniValue::VOBJ);
3506
- response.pushKV("start_height", pindexStart->nHeight);
3507
- response.pushKV("stop_height", stopBlock->nHeight);
3508
- return response;
3509
- }
3510
-
3511
- extern UniValue abortrescan(const JSONRPCRequest& request); // in rpcdump.cpp
3512
- extern UniValue dumpprivkey(const JSONRPCRequest& request); // in rpcdump.cpp
3513
- extern UniValue importprivkey(const JSONRPCRequest& request);
3514
- extern UniValue importaddress(const JSONRPCRequest& request);
3515
- extern UniValue importpubkey(const JSONRPCRequest& request);
3516
- extern UniValue dumpwallet(const JSONRPCRequest& request);
3517
- extern UniValue getmasterkeyinfo(const JSONRPCRequest& request);
3518
- extern UniValue importwallet(const JSONRPCRequest& request);
3519
- extern UniValue importprunedfunds(const JSONRPCRequest& request);
3520
- extern UniValue removeprunedfunds(const JSONRPCRequest& request);
3521
- extern UniValue importmulti(const JSONRPCRequest& request);
3522
- extern UniValue rescanblockchain(const JSONRPCRequest& request);
3523
-
3524
- static const CRPCCommand commands[] =
3525
- { // category name actor (function) argNames
3526
- // --------------------- ------------------------ ----------------------- ----------
3527
- { "rawtransactions", "fundrawtransaction", &fundrawtransaction, {"hexstring","options"} },
3528
- { "hidden", "resendwallettransactions", &resendwallettransactions, {} },
3529
- { "wallet", "abandontransaction", &abandontransaction, {"txid"} },
3530
- { "wallet", "abortrescan", &abortrescan, {} },
3531
- { "wallet", "addmultisigaddress", &addmultisigaddress, {"nrequired","keys","account"} },
3532
- { "wallet", "addwitnessaddress", &addwitnessaddress, {"address"} },
3533
- { "wallet", "backupwallet", &backupwallet, {"destination"} },
3534
- { "wallet", "bumpfee", &bumpfee, {"txid", "options"} },
3535
- { "wallet", "dumpprivkey", &dumpprivkey, {"address"} },
3536
- { "wallet", "dumpwallet", &dumpwallet, {"filename"} },
3537
- { "wallet", "encryptwallet", &encryptwallet, {"passphrase"} },
3538
- { "wallet", "getaccountaddress", &getaccountaddress, {"account"} },
3539
- { "wallet", "getaccount", &getaccount, {"address"} },
3540
- { "wallet", "getaddressesbyaccount", &getaddressesbyaccount, {"account"} },
3541
- { "wallet", "getbalance", &getbalance, {"account","minconf","include_watchonly"} },
3542
- { "wallet", "getmasterkeyinfo", &getmasterkeyinfo, {} },
3543
- { "wallet", "getmywords", &getmywords, {} },
3544
- { "wallet", "getnewaddress", &getnewaddress, {"account"} },
3545
- { "wallet", "getrawchangeaddress", &getrawchangeaddress, {} },
3546
- { "wallet", "getreceivedbyaccount", &getreceivedbyaccount, {"account","minconf"} },
3547
- { "wallet", "getreceivedbyaddress", &getreceivedbyaddress, {"address","minconf"} },
3548
- { "wallet", "gettransaction", &gettransaction, {"txid","include_watchonly"} },
3549
- { "wallet", "getunconfirmedbalance", &getunconfirmedbalance, {} },
3550
- { "wallet", "getwalletinfo", &getwalletinfo, {} },
3551
- { "wallet", "importmulti", &importmulti, {"requests","options"} },
3552
- { "wallet", "importprivkey", &importprivkey, {"privkey","label","rescan"} },
3553
- { "wallet", "importwallet", &importwallet, {"filename"} },
3554
- { "wallet", "importaddress", &importaddress, {"address","label","rescan","p2sh"} },
3555
- { "wallet", "importprunedfunds", &importprunedfunds, {"rawtransaction","txoutproof"} },
3556
- { "wallet", "importpubkey", &importpubkey, {"pubkey","label","rescan"} },
3557
- { "wallet", "keypoolrefill", &keypoolrefill, {"newsize"} },
3558
- { "wallet", "listaccounts", &listaccounts, {"minconf","include_watchonly"} },
3559
- { "wallet", "listaddressgroupings", &listaddressgroupings, {} },
3560
- { "wallet", "listlockunspent", &listlockunspent, {} },
3561
- { "wallet", "listreceivedbyaccount", &listreceivedbyaccount, {"minconf","include_empty","include_watchonly"} },
3562
- { "wallet", "listreceivedbyaddress", &listreceivedbyaddress, {"minconf","include_empty","include_watchonly"} },
3563
- { "wallet", "listsinceblock", &listsinceblock, {"blockhash","target_confirmations","include_watchonly","include_removed"} },
3564
- { "wallet", "listtransactions", &listtransactions, {"account","count","skip","include_watchonly"} },
3565
- { "wallet", "listunspent", &listunspent, {"minconf","maxconf","addresses","include_unsafe","query_options"} },
3566
- { "wallet", "listwallets", &listwallets, {} },
3567
- { "wallet", "lockunspent", &lockunspent, {"unlock","transactions"} },
3568
- { "wallet", "move", &movecmd, {"fromaccount","toaccount","amount","minconf","comment"} },
3569
- { "wallet", "sendfrom", &sendfrom, {"fromaccount","toaddress","amount","minconf","comment","comment_to"} },
3570
- { "wallet", "sendmany", &sendmany, {"fromaccount","amounts","minconf","comment","subtractfeefrom", "conf_target","estimate_mode"} },
3571
- { "wallet", "sendtoaddress", &sendtoaddress, {"address","amount","comment","comment_to","subtractfeefromamount", "conf_target","estimate_mode"} },
3572
- { "wallet", "sendfromaddress", &sendfromaddress, {"from_address","address","amount","comment","comment_to","subtractfeefromamount", "conf_target","estimate_mode"} },
3573
- { "wallet", "setaccount", &setaccount, {"address","account"} },
3574
- { "wallet", "settxfee", &settxfee, {"amount"} },
3575
- { "wallet", "signmessage", &signmessage, {"address","message"} },
3576
- { "wallet", "walletlock", &walletlock, {} },
3577
- { "wallet", "walletpassphrasechange", &walletpassphrasechange, {"oldpassphrase","newpassphrase"} },
3578
- { "wallet", "walletpassphrase", &walletpassphrase, {"passphrase","timeout"} },
3579
- { "wallet", "removeprunedfunds", &removeprunedfunds, {"txid"} },
3580
- { "wallet", "rescanblockchain", &rescanblockchain, {"start_height", "stop_height"} },
3581
-
3582
- { "generating", "generate", &generate, {"nblocks","maxtries"} },
3583
- };
3584
-
3585
- void RegisterWalletRPCCommands(CRPCTable &t)
3586
- {
3587
- for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
3588
- t.appendCommand(commands[vcidx].name, &commands[vcidx]);
3589
- }