@bitpay-labs/bitcore-wallet-service 11.5.2

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 (949) hide show
  1. package/.coveralls.yml +1 -0
  2. package/.travis.yml +27 -0
  3. package/DKG-flow.png +0 -0
  4. package/DSG-flow.png +0 -0
  5. package/Dockerfile +18 -0
  6. package/Installation.md +138 -0
  7. package/LICENCE +22 -0
  8. package/Makefile +5 -0
  9. package/README.md +429 -0
  10. package/TSS.md +136 -0
  11. package/bws.example.config.js +451 -0
  12. package/package.json +119 -0
  13. package/scripts/checkCopayerIds.js +118 -0
  14. package/scripts/clean_db.mongodb +5 -0
  15. package/scripts/deleteDupAddresses.mongo +6 -0
  16. package/scripts/deleteWallet.mongo +18 -0
  17. package/scripts/delme.ts +468 -0
  18. package/scripts/findEmail.js +32 -0
  19. package/scripts/fixAddressType.js +98 -0
  20. package/scripts/getSolStats2.js +81 -0
  21. package/scripts/migrateToNamedTestnets.js +191 -0
  22. package/scripts/migrateWalletsNetwork.js +204 -0
  23. package/scripts/preview-email.js +359 -0
  24. package/scripts/purgeNotifications.js +107 -0
  25. package/scripts/resetV8registration.mongo +21 -0
  26. package/scripts/v8tool-list.ts +93 -0
  27. package/scripts/v8tool.ts +82 -0
  28. package/scripts/walletStats.js +290 -0
  29. package/src/app.ts +28 -0
  30. package/src/bcmonitor/bcmonitor.ts +11 -0
  31. package/src/bws.ts +85 -0
  32. package/src/cleanfiatrates/cleanfiatrates.ts +9 -0
  33. package/src/config.ts +540 -0
  34. package/src/db/.empty +0 -0
  35. package/src/deprecated-serverMessages.ts +15 -0
  36. package/src/emailservice/emailservice.ts +11 -0
  37. package/src/externalservices/banxa.ts +261 -0
  38. package/src/externalservices/changelly.ts +371 -0
  39. package/src/externalservices/coingecko.ts +453 -0
  40. package/src/externalservices/moonpay.ts +435 -0
  41. package/src/externalservices/oneInch.ts +169 -0
  42. package/src/externalservices/ramp.ts +259 -0
  43. package/src/externalservices/sardine.ts +237 -0
  44. package/src/externalservices/simplex.ts +281 -0
  45. package/src/externalservices/thorswap.ts +197 -0
  46. package/src/externalservices/transak.ts +320 -0
  47. package/src/externalservices/wyre.ts +131 -0
  48. package/src/fiatrateservice/fiatrateservice.ts +15 -0
  49. package/src/index.ts +9 -0
  50. package/src/lib/bchaddresstranslator.ts +59 -0
  51. package/src/lib/blockchainexplorer.ts +84 -0
  52. package/src/lib/blockchainexplorers/v8/client.ts +177 -0
  53. package/src/lib/blockchainexplorers/v8.ts +730 -0
  54. package/src/lib/blockchainmonitor.ts +423 -0
  55. package/src/lib/chain/arb/index.ts +8 -0
  56. package/src/lib/chain/base/index.ts +8 -0
  57. package/src/lib/chain/bch/index.ts +40 -0
  58. package/src/lib/chain/btc/index.ts +991 -0
  59. package/src/lib/chain/doge/index.ts +387 -0
  60. package/src/lib/chain/eth/abi-erc20.ts +222 -0
  61. package/src/lib/chain/eth/abi-invoice.ts +277 -0
  62. package/src/lib/chain/eth/index.ts +657 -0
  63. package/src/lib/chain/index.ts +178 -0
  64. package/src/lib/chain/ltc/index.ts +9 -0
  65. package/src/lib/chain/matic/index.ts +8 -0
  66. package/src/lib/chain/op/index.ts +8 -0
  67. package/src/lib/chain/sol/index.ts +349 -0
  68. package/src/lib/chain/xrp/index.ts +338 -0
  69. package/src/lib/cleanfiatrates.ts +160 -0
  70. package/src/lib/common/constants.ts +231 -0
  71. package/src/lib/common/defaults.ts +436 -0
  72. package/src/lib/common/index.ts +11 -0
  73. package/src/lib/common/services.ts +43 -0
  74. package/src/lib/common/utils.ts +506 -0
  75. package/src/lib/emailservice.ts +741 -0
  76. package/src/lib/errors/clienterror.ts +44 -0
  77. package/src/lib/errors/errordefinitions.ts +158 -0
  78. package/src/lib/expressapp.ts +2415 -0
  79. package/src/lib/fiatrateproviders/bitpay.ts +20 -0
  80. package/src/lib/fiatrateproviders/bitstamp.ts +16 -0
  81. package/src/lib/fiatrateproviders/index.ts +8 -0
  82. package/src/lib/fiatrateproviders/provider.d.ts +10 -0
  83. package/src/lib/fiatrateservice.ts +338 -0
  84. package/src/lib/iconsconfig.ts +31 -0
  85. package/src/lib/index.ts +0 -0
  86. package/src/lib/lock.ts +112 -0
  87. package/src/lib/logger.ts +77 -0
  88. package/src/lib/messagebroker.ts +42 -0
  89. package/src/lib/model/address.ts +226 -0
  90. package/src/lib/model/addressmanager.ts +138 -0
  91. package/src/lib/model/advertisement.ts +84 -0
  92. package/src/lib/model/copayer.ts +162 -0
  93. package/src/lib/model/email.ts +103 -0
  94. package/src/lib/model/index.ts +12 -0
  95. package/src/lib/model/notification.ts +77 -0
  96. package/src/lib/model/preferences.ts +79 -0
  97. package/src/lib/model/pushnotificationsub.ts +50 -0
  98. package/src/lib/model/session.ts +65 -0
  99. package/src/lib/model/tsskeygen.ts +154 -0
  100. package/src/lib/model/tsssign.ts +136 -0
  101. package/src/lib/model/txconfirmationsub.ts +50 -0
  102. package/src/lib/model/txnote.ts +60 -0
  103. package/src/lib/model/txproposal.ts +561 -0
  104. package/src/lib/model/txproposal_legacy.ts +236 -0
  105. package/src/lib/model/txproposalaction.ts +48 -0
  106. package/src/lib/model/wallet.ts +359 -0
  107. package/src/lib/notificationbroadcaster.ts +17 -0
  108. package/src/lib/pushnotificationsservice.ts +802 -0
  109. package/src/lib/routes/helpers/error.ts +51 -0
  110. package/src/lib/routes/helpers/index.ts +1 -0
  111. package/src/lib/routes/middleware/authRequest.ts +117 -0
  112. package/src/lib/routes/middleware/authTssRequest.ts +66 -0
  113. package/src/lib/routes/middleware/createWalletLimiter.ts +21 -0
  114. package/src/lib/routes/middleware/log.ts +63 -0
  115. package/src/lib/routes/middleware/verifyTssMessage.ts +37 -0
  116. package/src/lib/routes/tss.ts +123 -0
  117. package/src/lib/server.ts +5342 -0
  118. package/src/lib/stats.ts +174 -0
  119. package/src/lib/storage.ts +1919 -0
  120. package/src/lib/tss.ts +446 -0
  121. package/src/lib/updatestats.ts +291 -0
  122. package/src/messagebroker/messagebroker.ts +18 -0
  123. package/src/pushnotificationsservice/pushnotificationsservice.ts +11 -0
  124. package/src/serverMessages.ts +30 -0
  125. package/src/types/chain.d.ts +62 -0
  126. package/src/types/emailservice.d.ts +11 -0
  127. package/src/types/expressapp.d.ts +15 -0
  128. package/src/types/externalservices.d.ts +41 -0
  129. package/src/types/notifications.d.ts +8 -0
  130. package/src/types/pushnotificationservice.d.ts +51 -0
  131. package/src/types/server.d.ts +24 -0
  132. package/src/updatestats/updatestats.ts +10 -0
  133. package/start-docker.sh +18 -0
  134. package/start.sh +38 -0
  135. package/static/images/down-arrow-green.png +0 -0
  136. package/static/images/failed-icon.png +0 -0
  137. package/static/images/green-check.png +0 -0
  138. package/static/images/person-plus.png +0 -0
  139. package/static/images/up-arrow-gray.png +0 -0
  140. package/static/images/writing-gray.png +0 -0
  141. package/stop.sh +19 -0
  142. package/templates/en/new_copayer.html +13 -0
  143. package/templates/en/new_copayer.plain +2 -0
  144. package/templates/en/new_incoming_tx.html +11 -0
  145. package/templates/en/new_incoming_tx.plain +2 -0
  146. package/templates/en/new_incoming_tx_testnet.html +13 -0
  147. package/templates/en/new_incoming_tx_testnet.plain +2 -0
  148. package/templates/en/new_outgoing_tx.html +11 -0
  149. package/templates/en/new_outgoing_tx.plain +2 -0
  150. package/templates/en/new_tx_proposal.html +13 -0
  151. package/templates/en/new_tx_proposal.plain +2 -0
  152. package/templates/en/new_zero_outgoing_tx.html +13 -0
  153. package/templates/en/new_zero_outgoing_tx.plain +2 -0
  154. package/templates/en/tx_confirmation.html +13 -0
  155. package/templates/en/tx_confirmation.plain +2 -0
  156. package/templates/en/tx_confirmation_receiver.html +13 -0
  157. package/templates/en/tx_confirmation_receiver.plain +2 -0
  158. package/templates/en/tx_confirmation_sender.html +13 -0
  159. package/templates/en/tx_confirmation_sender.plain +2 -0
  160. package/templates/en/txp_finally_rejected.html +13 -0
  161. package/templates/en/txp_finally_rejected.plain +2 -0
  162. package/templates/en/wallet_complete.html +13 -0
  163. package/templates/en/wallet_complete.plain +2 -0
  164. package/templates/es/new_copayer.html +13 -0
  165. package/templates/es/new_copayer.plain +2 -0
  166. package/templates/es/new_incoming_tx.html +11 -0
  167. package/templates/es/new_incoming_tx.plain +2 -0
  168. package/templates/es/new_incoming_tx_testnet.html +13 -0
  169. package/templates/es/new_incoming_tx_testnet.plain +2 -0
  170. package/templates/es/new_outgoing_tx.html +11 -0
  171. package/templates/es/new_outgoing_tx.plain +2 -0
  172. package/templates/es/new_tx_proposal.html +13 -0
  173. package/templates/es/new_tx_proposal.plain +2 -0
  174. package/templates/es/new_zero_outgoing_tx.html +13 -0
  175. package/templates/es/new_zero_outgoing_tx.plain +2 -0
  176. package/templates/es/tx_confirmation.html +13 -0
  177. package/templates/es/tx_confirmation.plain +2 -0
  178. package/templates/es/tx_confirmation_receiver.html +13 -0
  179. package/templates/es/tx_confirmation_receiver.plain +2 -0
  180. package/templates/es/tx_confirmation_sender.html +13 -0
  181. package/templates/es/tx_confirmation_sender.plain +2 -0
  182. package/templates/es/txp_finally_rejected.html +13 -0
  183. package/templates/es/txp_finally_rejected.plain +2 -0
  184. package/templates/es/wallet_complete.html +13 -0
  185. package/templates/es/wallet_complete.plain +2 -0
  186. package/templates/fr/new_copayer.html +13 -0
  187. package/templates/fr/new_copayer.plain +2 -0
  188. package/templates/fr/new_incoming_tx.html +11 -0
  189. package/templates/fr/new_incoming_tx.plain +2 -0
  190. package/templates/fr/new_incoming_tx_testnet.html +13 -0
  191. package/templates/fr/new_incoming_tx_testnet.plain +2 -0
  192. package/templates/fr/new_outgoing_tx.html +11 -0
  193. package/templates/fr/new_outgoing_tx.plain +2 -0
  194. package/templates/fr/new_tx_proposal.html +13 -0
  195. package/templates/fr/new_tx_proposal.plain +2 -0
  196. package/templates/fr/new_zero_outgoing_tx.html +13 -0
  197. package/templates/fr/new_zero_outgoing_tx.plain +2 -0
  198. package/templates/fr/tx_confirmation.html +13 -0
  199. package/templates/fr/tx_confirmation.plain +2 -0
  200. package/templates/fr/tx_confirmation_receiver.html +13 -0
  201. package/templates/fr/tx_confirmation_receiver.plain +2 -0
  202. package/templates/fr/tx_confirmation_sender.html +13 -0
  203. package/templates/fr/tx_confirmation_sender.plain +2 -0
  204. package/templates/fr/txp_finally_rejected.html +13 -0
  205. package/templates/fr/txp_finally_rejected.plain +2 -0
  206. package/templates/fr/wallet_complete.html +13 -0
  207. package/templates/fr/wallet_complete.plain +2 -0
  208. package/templates/ja/new_copayer.html +13 -0
  209. package/templates/ja/new_copayer.plain +2 -0
  210. package/templates/ja/new_incoming_tx.html +11 -0
  211. package/templates/ja/new_incoming_tx.plain +2 -0
  212. package/templates/ja/new_incoming_tx_testnet.html +13 -0
  213. package/templates/ja/new_incoming_tx_testnet.plain +2 -0
  214. package/templates/ja/new_outgoing_tx.html +11 -0
  215. package/templates/ja/new_outgoing_tx.plain +2 -0
  216. package/templates/ja/new_tx_proposal.html +13 -0
  217. package/templates/ja/new_tx_proposal.plain +2 -0
  218. package/templates/ja/new_zero_outgoing_tx.html +13 -0
  219. package/templates/ja/new_zero_outgoing_tx.plain +2 -0
  220. package/templates/ja/tx_confirmation.html +13 -0
  221. package/templates/ja/tx_confirmation.plain +2 -0
  222. package/templates/ja/tx_confirmation_receiver.html +13 -0
  223. package/templates/ja/tx_confirmation_receiver.plain +2 -0
  224. package/templates/ja/tx_confirmation_sender.html +13 -0
  225. package/templates/ja/tx_confirmation_sender.plain +2 -0
  226. package/templates/ja/txp_finally_rejected.html +13 -0
  227. package/templates/ja/txp_finally_rejected.plain +2 -0
  228. package/templates/ja/wallet_complete.html +13 -0
  229. package/templates/ja/wallet_complete.plain +2 -0
  230. package/templates/master-template.html +494 -0
  231. package/test/bchaddresstranslator.test.ts +50 -0
  232. package/test/blockchainexplorer.test.ts +66 -0
  233. package/test/chain/bch.test.ts +115 -0
  234. package/test/chain/btc.test.ts +331 -0
  235. package/test/chain/doge.test.ts +347 -0
  236. package/test/chain/eth.test.ts +21 -0
  237. package/test/chain/ltc.test.ts +328 -0
  238. package/test/chain/matic.test.ts +21 -0
  239. package/test/chain/xrp.test.ts +206 -0
  240. package/test/expressapp.test.ts +513 -0
  241. package/test/integration/bcmonitor.test.ts +381 -0
  242. package/test/integration/cashAddrMigration.test.ts +127 -0
  243. package/test/integration/data/tss/2of3/index.ts +3 -0
  244. package/test/integration/data/tss/2of3/party0.key.ts +5 -0
  245. package/test/integration/data/tss/2of3/party1.key.ts +5 -0
  246. package/test/integration/data/tss/2of3/party2.key.ts +5 -0
  247. package/test/integration/emailnotifications.test.ts +864 -0
  248. package/test/integration/externalservices/banxa.test.ts +373 -0
  249. package/test/integration/externalservices/changelly.test.ts +515 -0
  250. package/test/integration/externalservices/coinGecko.test.ts +284 -0
  251. package/test/integration/externalservices/moonpay.test.ts +569 -0
  252. package/test/integration/externalservices/oneInch.test.ts +162 -0
  253. package/test/integration/externalservices/ramp.test.ts +475 -0
  254. package/test/integration/externalservices/sardine.test.ts +352 -0
  255. package/test/integration/externalservices/simplex.test.ts +384 -0
  256. package/test/integration/externalservices/thorswap.test.ts +309 -0
  257. package/test/integration/externalservices/transak.test.ts +410 -0
  258. package/test/integration/externalservices/wyre.test.ts +270 -0
  259. package/test/integration/fiatrateservice.test.ts +979 -0
  260. package/test/integration/helpers.ts +694 -0
  261. package/test/integration/history.test.ts +1142 -0
  262. package/test/integration/hugetx.ts +6986 -0
  263. package/test/integration/pushNotifications.test.ts +1523 -0
  264. package/test/integration/server.test.ts +10740 -0
  265. package/test/integration/tss.test.ts +340 -0
  266. package/test/lock.test.ts +224 -0
  267. package/test/model/address.test.ts +187 -0
  268. package/test/model/addressmanager.test.ts +146 -0
  269. package/test/model/advertisement.test.ts +31 -0
  270. package/test/model/copayer.test.ts +131 -0
  271. package/test/model/txproposal.test.ts +185 -0
  272. package/test/model/wallet.test.ts +191 -0
  273. package/test/storage.test.ts +430 -0
  274. package/test/test-config.ts +12 -0
  275. package/test/testdata.ts +388 -0
  276. package/test/utils.test.ts +457 -0
  277. package/test/v8.test.ts +332 -0
  278. package/ts_build/package.json +119 -0
  279. package/ts_build/scripts/delme.d.ts +2 -0
  280. package/ts_build/scripts/delme.d.ts.map +1 -0
  281. package/ts_build/scripts/delme.js +453 -0
  282. package/ts_build/scripts/delme.js.map +1 -0
  283. package/ts_build/scripts/v8tool-list.d.ts +3 -0
  284. package/ts_build/scripts/v8tool-list.d.ts.map +1 -0
  285. package/ts_build/scripts/v8tool-list.js +80 -0
  286. package/ts_build/scripts/v8tool-list.js.map +1 -0
  287. package/ts_build/scripts/v8tool.d.ts +3 -0
  288. package/ts_build/scripts/v8tool.d.ts.map +1 -0
  289. package/ts_build/scripts/v8tool.js +69 -0
  290. package/ts_build/scripts/v8tool.js.map +1 -0
  291. package/ts_build/src/app.d.ts +3 -0
  292. package/ts_build/src/app.d.ts.map +1 -0
  293. package/ts_build/src/app.js +29 -0
  294. package/ts_build/src/app.js.map +1 -0
  295. package/ts_build/src/bcmonitor/bcmonitor.d.ts +3 -0
  296. package/ts_build/src/bcmonitor/bcmonitor.d.ts.map +1 -0
  297. package/ts_build/src/bcmonitor/bcmonitor.js +16 -0
  298. package/ts_build/src/bcmonitor/bcmonitor.js.map +1 -0
  299. package/ts_build/src/bws.d.ts +3 -0
  300. package/ts_build/src/bws.d.ts.map +1 -0
  301. package/ts_build/src/bws.js +98 -0
  302. package/ts_build/src/bws.js.map +1 -0
  303. package/ts_build/src/cleanfiatrates/cleanfiatrates.d.ts +3 -0
  304. package/ts_build/src/cleanfiatrates/cleanfiatrates.d.ts.map +1 -0
  305. package/ts_build/src/cleanfiatrates/cleanfiatrates.js +11 -0
  306. package/ts_build/src/cleanfiatrates/cleanfiatrates.js.map +1 -0
  307. package/ts_build/src/config.d.ts +3 -0
  308. package/ts_build/src/config.d.ts.map +1 -0
  309. package/ts_build/src/config.js +256 -0
  310. package/ts_build/src/config.js.map +1 -0
  311. package/ts_build/src/deprecated-serverMessages.d.ts +10 -0
  312. package/ts_build/src/deprecated-serverMessages.d.ts.map +1 -0
  313. package/ts_build/src/deprecated-serverMessages.js +20 -0
  314. package/ts_build/src/deprecated-serverMessages.js.map +1 -0
  315. package/ts_build/src/emailservice/emailservice.d.ts +3 -0
  316. package/ts_build/src/emailservice/emailservice.d.ts.map +1 -0
  317. package/ts_build/src/emailservice/emailservice.js +16 -0
  318. package/ts_build/src/emailservice/emailservice.js.map +1 -0
  319. package/ts_build/src/externalservices/banxa.d.ts +11 -0
  320. package/ts_build/src/externalservices/banxa.d.ts.map +1 -0
  321. package/ts_build/src/externalservices/banxa.js +254 -0
  322. package/ts_build/src/externalservices/banxa.js.map +1 -0
  323. package/ts_build/src/externalservices/changelly.d.ts +18 -0
  324. package/ts_build/src/externalservices/changelly.d.ts.map +1 -0
  325. package/ts_build/src/externalservices/changelly.js +356 -0
  326. package/ts_build/src/externalservices/changelly.js.map +1 -0
  327. package/ts_build/src/externalservices/coingecko.d.ts +43 -0
  328. package/ts_build/src/externalservices/coingecko.d.ts.map +1 -0
  329. package/ts_build/src/externalservices/coingecko.js +416 -0
  330. package/ts_build/src/externalservices/coingecko.js.map +1 -0
  331. package/ts_build/src/externalservices/moonpay.d.ts +19 -0
  332. package/ts_build/src/externalservices/moonpay.d.ts.map +1 -0
  333. package/ts_build/src/externalservices/moonpay.js +397 -0
  334. package/ts_build/src/externalservices/moonpay.js.map +1 -0
  335. package/ts_build/src/externalservices/oneInch.d.ts +11 -0
  336. package/ts_build/src/externalservices/oneInch.d.ts.map +1 -0
  337. package/ts_build/src/externalservices/oneInch.js +179 -0
  338. package/ts_build/src/externalservices/oneInch.js.map +1 -0
  339. package/ts_build/src/externalservices/ramp.d.ts +12 -0
  340. package/ts_build/src/externalservices/ramp.d.ts.map +1 -0
  341. package/ts_build/src/externalservices/ramp.js +256 -0
  342. package/ts_build/src/externalservices/ramp.js.map +1 -0
  343. package/ts_build/src/externalservices/sardine.d.ts +10 -0
  344. package/ts_build/src/externalservices/sardine.d.ts.map +1 -0
  345. package/ts_build/src/externalservices/sardine.js +232 -0
  346. package/ts_build/src/externalservices/sardine.js.map +1 -0
  347. package/ts_build/src/externalservices/simplex.d.ts +11 -0
  348. package/ts_build/src/externalservices/simplex.d.ts.map +1 -0
  349. package/ts_build/src/externalservices/simplex.js +261 -0
  350. package/ts_build/src/externalservices/simplex.js.map +1 -0
  351. package/ts_build/src/externalservices/thorswap.d.ts +9 -0
  352. package/ts_build/src/externalservices/thorswap.d.ts.map +1 -0
  353. package/ts_build/src/externalservices/thorswap.js +206 -0
  354. package/ts_build/src/externalservices/thorswap.js.map +1 -0
  355. package/ts_build/src/externalservices/transak.d.ts +13 -0
  356. package/ts_build/src/externalservices/transak.d.ts.map +1 -0
  357. package/ts_build/src/externalservices/transak.js +311 -0
  358. package/ts_build/src/externalservices/transak.js.map +1 -0
  359. package/ts_build/src/externalservices/wyre.d.ts +7 -0
  360. package/ts_build/src/externalservices/wyre.d.ts.map +1 -0
  361. package/ts_build/src/externalservices/wyre.js +144 -0
  362. package/ts_build/src/externalservices/wyre.js.map +1 -0
  363. package/ts_build/src/fiatrateservice/fiatrateservice.d.ts +3 -0
  364. package/ts_build/src/fiatrateservice/fiatrateservice.d.ts.map +1 -0
  365. package/ts_build/src/fiatrateservice/fiatrateservice.js +20 -0
  366. package/ts_build/src/fiatrateservice/fiatrateservice.js.map +1 -0
  367. package/ts_build/src/index.d.ts +8 -0
  368. package/ts_build/src/index.d.ts.map +1 -0
  369. package/ts_build/src/index.js +11 -0
  370. package/ts_build/src/index.js.map +1 -0
  371. package/ts_build/src/lib/bchaddresstranslator.d.ts +5 -0
  372. package/ts_build/src/lib/bchaddresstranslator.d.ts.map +1 -0
  373. package/ts_build/src/lib/bchaddresstranslator.js +66 -0
  374. package/ts_build/src/lib/bchaddresstranslator.js.map +1 -0
  375. package/ts_build/src/lib/blockchainexplorer.d.ts +3 -0
  376. package/ts_build/src/lib/blockchainexplorer.d.ts.map +1 -0
  377. package/ts_build/src/lib/blockchainexplorer.js +87 -0
  378. package/ts_build/src/lib/blockchainexplorer.js.map +1 -0
  379. package/ts_build/src/lib/blockchainexplorers/v8/client.d.ts +31 -0
  380. package/ts_build/src/lib/blockchainexplorers/v8/client.d.ts.map +1 -0
  381. package/ts_build/src/lib/blockchainexplorers/v8/client.js +191 -0
  382. package/ts_build/src/lib/blockchainexplorers/v8/client.js.map +1 -0
  383. package/ts_build/src/lib/blockchainexplorers/v8.d.ts +91 -0
  384. package/ts_build/src/lib/blockchainexplorers/v8.d.ts.map +1 -0
  385. package/ts_build/src/lib/blockchainexplorers/v8.js +662 -0
  386. package/ts_build/src/lib/blockchainexplorers/v8.js.map +1 -0
  387. package/ts_build/src/lib/blockchainmonitor.d.ts +32 -0
  388. package/ts_build/src/lib/blockchainmonitor.d.ts.map +1 -0
  389. package/ts_build/src/lib/blockchainmonitor.js +413 -0
  390. package/ts_build/src/lib/blockchainmonitor.js.map +1 -0
  391. package/ts_build/src/lib/chain/arb/index.d.ts +5 -0
  392. package/ts_build/src/lib/chain/arb/index.d.ts.map +1 -0
  393. package/ts_build/src/lib/chain/arb/index.js +12 -0
  394. package/ts_build/src/lib/chain/arb/index.js.map +1 -0
  395. package/ts_build/src/lib/chain/base/index.d.ts +5 -0
  396. package/ts_build/src/lib/chain/base/index.d.ts.map +1 -0
  397. package/ts_build/src/lib/chain/base/index.js +12 -0
  398. package/ts_build/src/lib/chain/base/index.js.map +1 -0
  399. package/ts_build/src/lib/chain/bch/index.d.ts +9 -0
  400. package/ts_build/src/lib/chain/bch/index.d.ts.map +1 -0
  401. package/ts_build/src/lib/chain/bch/index.js +43 -0
  402. package/ts_build/src/lib/chain/bch/index.js.map +1 -0
  403. package/ts_build/src/lib/chain/btc/index.d.ts +65 -0
  404. package/ts_build/src/lib/chain/btc/index.d.ts.map +1 -0
  405. package/ts_build/src/lib/chain/btc/index.js +829 -0
  406. package/ts_build/src/lib/chain/btc/index.js.map +1 -0
  407. package/ts_build/src/lib/chain/doge/index.d.ts +9 -0
  408. package/ts_build/src/lib/chain/doge/index.d.ts.map +1 -0
  409. package/ts_build/src/lib/chain/doge/index.js +338 -0
  410. package/ts_build/src/lib/chain/doge/index.js.map +1 -0
  411. package/ts_build/src/lib/chain/eth/abi-erc20.d.ts +39 -0
  412. package/ts_build/src/lib/chain/eth/abi-erc20.d.ts.map +1 -0
  413. package/ts_build/src/lib/chain/eth/abi-erc20.js +226 -0
  414. package/ts_build/src/lib/chain/eth/abi-erc20.js.map +1 -0
  415. package/ts_build/src/lib/chain/eth/abi-invoice.d.ts +42 -0
  416. package/ts_build/src/lib/chain/eth/abi-invoice.d.ts.map +1 -0
  417. package/ts_build/src/lib/chain/eth/abi-invoice.js +281 -0
  418. package/ts_build/src/lib/chain/eth/abi-invoice.js.map +1 -0
  419. package/ts_build/src/lib/chain/eth/index.d.ts +66 -0
  420. package/ts_build/src/lib/chain/eth/index.d.ts.map +1 -0
  421. package/ts_build/src/lib/chain/eth/index.js +516 -0
  422. package/ts_build/src/lib/chain/eth/index.js.map +1 -0
  423. package/ts_build/src/lib/chain/index.d.ts +40 -0
  424. package/ts_build/src/lib/chain/index.d.ts.map +1 -0
  425. package/ts_build/src/lib/chain/index.js +143 -0
  426. package/ts_build/src/lib/chain/index.js.map +1 -0
  427. package/ts_build/src/lib/chain/ltc/index.d.ts +6 -0
  428. package/ts_build/src/lib/chain/ltc/index.d.ts.map +1 -0
  429. package/ts_build/src/lib/chain/ltc/index.js +12 -0
  430. package/ts_build/src/lib/chain/ltc/index.js.map +1 -0
  431. package/ts_build/src/lib/chain/matic/index.d.ts +5 -0
  432. package/ts_build/src/lib/chain/matic/index.d.ts.map +1 -0
  433. package/ts_build/src/lib/chain/matic/index.js +12 -0
  434. package/ts_build/src/lib/chain/matic/index.js.map +1 -0
  435. package/ts_build/src/lib/chain/op/index.d.ts +5 -0
  436. package/ts_build/src/lib/chain/op/index.d.ts.map +1 -0
  437. package/ts_build/src/lib/chain/op/index.js +12 -0
  438. package/ts_build/src/lib/chain/op/index.js.map +1 -0
  439. package/ts_build/src/lib/chain/sol/index.d.ts +52 -0
  440. package/ts_build/src/lib/chain/sol/index.d.ts.map +1 -0
  441. package/ts_build/src/lib/chain/sol/index.js +305 -0
  442. package/ts_build/src/lib/chain/sol/index.js.map +1 -0
  443. package/ts_build/src/lib/chain/xrp/index.d.ts +46 -0
  444. package/ts_build/src/lib/chain/xrp/index.d.ts.map +1 -0
  445. package/ts_build/src/lib/chain/xrp/index.js +300 -0
  446. package/ts_build/src/lib/chain/xrp/index.js.map +1 -0
  447. package/ts_build/src/lib/cleanfiatrates.d.ts +13 -0
  448. package/ts_build/src/lib/cleanfiatrates.d.ts.map +1 -0
  449. package/ts_build/src/lib/cleanfiatrates.js +176 -0
  450. package/ts_build/src/lib/cleanfiatrates.js.map +1 -0
  451. package/ts_build/src/lib/common/constants.d.ts +387 -0
  452. package/ts_build/src/lib/common/constants.d.ts.map +1 -0
  453. package/ts_build/src/lib/common/constants.js +234 -0
  454. package/ts_build/src/lib/common/constants.js.map +1 -0
  455. package/ts_build/src/lib/common/defaults.d.ts +326 -0
  456. package/ts_build/src/lib/common/defaults.d.ts.map +1 -0
  457. package/ts_build/src/lib/common/defaults.js +356 -0
  458. package/ts_build/src/lib/common/defaults.js.map +1 -0
  459. package/ts_build/src/lib/common/index.d.ts +793 -0
  460. package/ts_build/src/lib/common/index.d.ts.map +1 -0
  461. package/ts_build/src/lib/common/index.js +14 -0
  462. package/ts_build/src/lib/common/index.js.map +1 -0
  463. package/ts_build/src/lib/common/services.d.ts +34 -0
  464. package/ts_build/src/lib/common/services.d.ts.map +1 -0
  465. package/ts_build/src/lib/common/services.js +44 -0
  466. package/ts_build/src/lib/common/services.js.map +1 -0
  467. package/ts_build/src/lib/common/utils.d.ts +47 -0
  468. package/ts_build/src/lib/common/utils.d.ts.map +1 -0
  469. package/ts_build/src/lib/common/utils.js +385 -0
  470. package/ts_build/src/lib/common/utils.js.map +1 -0
  471. package/ts_build/src/lib/emailservice.d.ts +62 -0
  472. package/ts_build/src/lib/emailservice.d.ts.map +1 -0
  473. package/ts_build/src/lib/emailservice.js +727 -0
  474. package/ts_build/src/lib/emailservice.js.map +1 -0
  475. package/ts_build/src/lib/errors/clienterror.d.ts +11 -0
  476. package/ts_build/src/lib/errors/clienterror.d.ts.map +1 -0
  477. package/ts_build/src/lib/errors/clienterror.js +46 -0
  478. package/ts_build/src/lib/errors/clienterror.js.map +1 -0
  479. package/ts_build/src/lib/errors/errordefinitions.d.ts +76 -0
  480. package/ts_build/src/lib/errors/errordefinitions.d.ts.map +1 -0
  481. package/ts_build/src/lib/errors/errordefinitions.js +82 -0
  482. package/ts_build/src/lib/errors/errordefinitions.js.map +1 -0
  483. package/ts_build/src/lib/expressapp.d.ts +8 -0
  484. package/ts_build/src/lib/expressapp.d.ts.map +1 -0
  485. package/ts_build/src/lib/expressapp.js +2221 -0
  486. package/ts_build/src/lib/expressapp.js.map +1 -0
  487. package/ts_build/src/lib/fiatrateproviders/bitpay.d.ts +3 -0
  488. package/ts_build/src/lib/fiatrateproviders/bitpay.d.ts.map +1 -0
  489. package/ts_build/src/lib/fiatrateproviders/bitpay.js +22 -0
  490. package/ts_build/src/lib/fiatrateproviders/bitpay.js.map +1 -0
  491. package/ts_build/src/lib/fiatrateproviders/bitstamp.d.ts +3 -0
  492. package/ts_build/src/lib/fiatrateproviders/bitstamp.d.ts.map +1 -0
  493. package/ts_build/src/lib/fiatrateproviders/bitstamp.js +18 -0
  494. package/ts_build/src/lib/fiatrateproviders/bitstamp.js.map +1 -0
  495. package/ts_build/src/lib/fiatrateproviders/index.d.ts +3 -0
  496. package/ts_build/src/lib/fiatrateproviders/index.d.ts.map +1 -0
  497. package/ts_build/src/lib/fiatrateproviders/index.js +8 -0
  498. package/ts_build/src/lib/fiatrateproviders/index.js.map +1 -0
  499. package/ts_build/src/lib/fiatrateservice.d.ts +18 -0
  500. package/ts_build/src/lib/fiatrateservice.d.ts.map +1 -0
  501. package/ts_build/src/lib/fiatrateservice.js +313 -0
  502. package/ts_build/src/lib/fiatrateservice.js.map +1 -0
  503. package/ts_build/src/lib/iconsconfig.d.ts +2 -0
  504. package/ts_build/src/lib/iconsconfig.d.ts.map +1 -0
  505. package/ts_build/src/lib/iconsconfig.js +31 -0
  506. package/ts_build/src/lib/iconsconfig.js.map +1 -0
  507. package/ts_build/src/lib/index.d.ts +1 -0
  508. package/ts_build/src/lib/index.d.ts.map +1 -0
  509. package/ts_build/src/lib/index.js +1 -0
  510. package/ts_build/src/lib/index.js.map +1 -0
  511. package/ts_build/src/lib/lock.d.ts +14 -0
  512. package/ts_build/src/lib/lock.d.ts.map +1 -0
  513. package/ts_build/src/lib/lock.js +55 -0
  514. package/ts_build/src/lib/lock.js.map +1 -0
  515. package/ts_build/src/lib/logger.d.ts +7 -0
  516. package/ts_build/src/lib/logger.d.ts.map +1 -0
  517. package/ts_build/src/lib/logger.js +95 -0
  518. package/ts_build/src/lib/logger.js.map +1 -0
  519. package/ts_build/src/lib/messagebroker.d.ts +11 -0
  520. package/ts_build/src/lib/messagebroker.d.ts.map +1 -0
  521. package/ts_build/src/lib/messagebroker.js +77 -0
  522. package/ts_build/src/lib/messagebroker.js.map +1 -0
  523. package/ts_build/src/lib/model/address.d.ts +47 -0
  524. package/ts_build/src/lib/model/address.d.ts.map +1 -0
  525. package/ts_build/src/lib/model/address.js +158 -0
  526. package/ts_build/src/lib/model/address.js.map +1 -0
  527. package/ts_build/src/lib/model/addressmanager.d.ts +41 -0
  528. package/ts_build/src/lib/model/addressmanager.d.ts.map +1 -0
  529. package/ts_build/src/lib/model/addressmanager.js +103 -0
  530. package/ts_build/src/lib/model/addressmanager.js.map +1 -0
  531. package/ts_build/src/lib/model/advertisement.d.ts +38 -0
  532. package/ts_build/src/lib/model/advertisement.d.ts.map +1 -0
  533. package/ts_build/src/lib/model/advertisement.js +68 -0
  534. package/ts_build/src/lib/model/advertisement.js.map +1 -0
  535. package/ts_build/src/lib/model/copayer.d.ts +48 -0
  536. package/ts_build/src/lib/model/copayer.d.ts.map +1 -0
  537. package/ts_build/src/lib/model/copayer.js +116 -0
  538. package/ts_build/src/lib/model/copayer.js.map +1 -0
  539. package/ts_build/src/lib/model/email.d.ts +23 -0
  540. package/ts_build/src/lib/model/email.d.ts.map +1 -0
  541. package/ts_build/src/lib/model/email.js +84 -0
  542. package/ts_build/src/lib/model/email.js.map +1 -0
  543. package/ts_build/src/lib/model/index.d.ts +13 -0
  544. package/ts_build/src/lib/model/index.d.ts.map +1 -0
  545. package/ts_build/src/lib/model/index.js +28 -0
  546. package/ts_build/src/lib/model/index.js.map +1 -0
  547. package/ts_build/src/lib/model/notification.d.ts +23 -0
  548. package/ts_build/src/lib/model/notification.d.ts.map +1 -0
  549. package/ts_build/src/lib/model/notification.js +40 -0
  550. package/ts_build/src/lib/model/notification.js.map +1 -0
  551. package/ts_build/src/lib/model/preferences.d.ts +37 -0
  552. package/ts_build/src/lib/model/preferences.d.ts.map +1 -0
  553. package/ts_build/src/lib/model/preferences.js +61 -0
  554. package/ts_build/src/lib/model/preferences.js.map +1 -0
  555. package/ts_build/src/lib/model/pushnotificationsub.d.ts +23 -0
  556. package/ts_build/src/lib/model/pushnotificationsub.d.ts.map +1 -0
  557. package/ts_build/src/lib/model/pushnotificationsub.js +40 -0
  558. package/ts_build/src/lib/model/pushnotificationsub.js.map +1 -0
  559. package/ts_build/src/lib/model/session.d.ts +22 -0
  560. package/ts_build/src/lib/model/session.d.ts.map +1 -0
  561. package/ts_build/src/lib/model/session.js +52 -0
  562. package/ts_build/src/lib/model/session.js.map +1 -0
  563. package/ts_build/src/lib/model/tsskeygen.d.ts +67 -0
  564. package/ts_build/src/lib/model/tsskeygen.d.ts.map +1 -0
  565. package/ts_build/src/lib/model/tsskeygen.js +69 -0
  566. package/ts_build/src/lib/model/tsskeygen.js.map +1 -0
  567. package/ts_build/src/lib/model/tsssign.d.ts +70 -0
  568. package/ts_build/src/lib/model/tsssign.d.ts.map +1 -0
  569. package/ts_build/src/lib/model/tsssign.js +54 -0
  570. package/ts_build/src/lib/model/tsssign.js.map +1 -0
  571. package/ts_build/src/lib/model/txconfirmationsub.d.ts +23 -0
  572. package/ts_build/src/lib/model/txconfirmationsub.d.ts.map +1 -0
  573. package/ts_build/src/lib/model/txconfirmationsub.js +40 -0
  574. package/ts_build/src/lib/model/txconfirmationsub.js.map +1 -0
  575. package/ts_build/src/lib/model/txnote.d.ts +23 -0
  576. package/ts_build/src/lib/model/txnote.d.ts.map +1 -0
  577. package/ts_build/src/lib/model/txnote.js +46 -0
  578. package/ts_build/src/lib/model/txnote.js.map +1 -0
  579. package/ts_build/src/lib/model/txproposal.d.ts +196 -0
  580. package/ts_build/src/lib/model/txproposal.d.ts.map +1 -0
  581. package/ts_build/src/lib/model/txproposal.js +382 -0
  582. package/ts_build/src/lib/model/txproposal.js.map +1 -0
  583. package/ts_build/src/lib/model/txproposal_legacy.d.ts +93 -0
  584. package/ts_build/src/lib/model/txproposal_legacy.d.ts.map +1 -0
  585. package/ts_build/src/lib/model/txproposal_legacy.js +185 -0
  586. package/ts_build/src/lib/model/txproposal_legacy.js.map +1 -0
  587. package/ts_build/src/lib/model/txproposalaction.d.ts +21 -0
  588. package/ts_build/src/lib/model/txproposalaction.d.ts.map +1 -0
  589. package/ts_build/src/lib/model/txproposalaction.js +37 -0
  590. package/ts_build/src/lib/model/txproposalaction.js.map +1 -0
  591. package/ts_build/src/lib/model/wallet.d.ts +110 -0
  592. package/ts_build/src/lib/model/wallet.d.ts.map +1 -0
  593. package/ts_build/src/lib/model/wallet.js +224 -0
  594. package/ts_build/src/lib/model/wallet.js.map +1 -0
  595. package/ts_build/src/lib/notificationbroadcaster.d.ts +6 -0
  596. package/ts_build/src/lib/notificationbroadcaster.d.ts.map +1 -0
  597. package/ts_build/src/lib/notificationbroadcaster.js +19 -0
  598. package/ts_build/src/lib/notificationbroadcaster.js.map +1 -0
  599. package/ts_build/src/lib/pushnotificationsservice.d.ts +56 -0
  600. package/ts_build/src/lib/pushnotificationsservice.d.ts.map +1 -0
  601. package/ts_build/src/lib/pushnotificationsservice.js +721 -0
  602. package/ts_build/src/lib/pushnotificationsservice.js.map +1 -0
  603. package/ts_build/src/lib/routes/helpers/error.d.ts +10 -0
  604. package/ts_build/src/lib/routes/helpers/error.d.ts.map +1 -0
  605. package/ts_build/src/lib/routes/helpers/error.js +54 -0
  606. package/ts_build/src/lib/routes/helpers/error.js.map +1 -0
  607. package/ts_build/src/lib/routes/helpers/index.d.ts +2 -0
  608. package/ts_build/src/lib/routes/helpers/index.d.ts.map +1 -0
  609. package/ts_build/src/lib/routes/helpers/index.js +18 -0
  610. package/ts_build/src/lib/routes/helpers/index.js.map +1 -0
  611. package/ts_build/src/lib/routes/middleware/authRequest.d.ts +6 -0
  612. package/ts_build/src/lib/routes/middleware/authRequest.d.ts.map +1 -0
  613. package/ts_build/src/lib/routes/middleware/authRequest.js +106 -0
  614. package/ts_build/src/lib/routes/middleware/authRequest.js.map +1 -0
  615. package/ts_build/src/lib/routes/middleware/authTssRequest.d.ts +3 -0
  616. package/ts_build/src/lib/routes/middleware/authTssRequest.d.ts.map +1 -0
  617. package/ts_build/src/lib/routes/middleware/authTssRequest.js +56 -0
  618. package/ts_build/src/lib/routes/middleware/authTssRequest.js.map +1 -0
  619. package/ts_build/src/lib/routes/middleware/createWalletLimiter.d.ts +4 -0
  620. package/ts_build/src/lib/routes/middleware/createWalletLimiter.d.ts.map +1 -0
  621. package/ts_build/src/lib/routes/middleware/createWalletLimiter.js +28 -0
  622. package/ts_build/src/lib/routes/middleware/createWalletLimiter.js.map +1 -0
  623. package/ts_build/src/lib/routes/middleware/log.d.ts +9 -0
  624. package/ts_build/src/lib/routes/middleware/log.d.ts.map +1 -0
  625. package/ts_build/src/lib/routes/middleware/log.js +52 -0
  626. package/ts_build/src/lib/routes/middleware/log.js.map +1 -0
  627. package/ts_build/src/lib/routes/middleware/verifyTssMessage.d.ts +2 -0
  628. package/ts_build/src/lib/routes/middleware/verifyTssMessage.d.ts.map +1 -0
  629. package/ts_build/src/lib/routes/middleware/verifyTssMessage.js +34 -0
  630. package/ts_build/src/lib/routes/middleware/verifyTssMessage.js.map +1 -0
  631. package/ts_build/src/lib/routes/tss.d.ts +14 -0
  632. package/ts_build/src/lib/routes/tss.d.ts.map +1 -0
  633. package/ts_build/src/lib/routes/tss.js +120 -0
  634. package/ts_build/src/lib/routes/tss.js.map +1 -0
  635. package/ts_build/src/lib/server.d.ts +250 -0
  636. package/ts_build/src/lib/server.d.ts.map +1 -0
  637. package/ts_build/src/lib/server.js +4115 -0
  638. package/ts_build/src/lib/server.js.map +1 -0
  639. package/ts_build/src/lib/stats.d.ts +17 -0
  640. package/ts_build/src/lib/stats.d.ts.map +1 -0
  641. package/ts_build/src/lib/stats.js +203 -0
  642. package/ts_build/src/lib/stats.js.map +1 -0
  643. package/ts_build/src/lib/storage.d.ts +163 -0
  644. package/ts_build/src/lib/storage.d.ts.map +1 -0
  645. package/ts_build/src/lib/storage.js +1513 -0
  646. package/ts_build/src/lib/storage.js.map +1 -0
  647. package/ts_build/src/lib/tss.d.ts +70 -0
  648. package/ts_build/src/lib/tss.d.ts.map +1 -0
  649. package/ts_build/src/lib/tss.js +379 -0
  650. package/ts_build/src/lib/tss.js.map +1 -0
  651. package/ts_build/src/lib/updatestats.d.ts +16 -0
  652. package/ts_build/src/lib/updatestats.d.ts.map +1 -0
  653. package/ts_build/src/lib/updatestats.js +308 -0
  654. package/ts_build/src/lib/updatestats.js.map +1 -0
  655. package/ts_build/src/messagebroker/messagebroker.d.ts +3 -0
  656. package/ts_build/src/messagebroker/messagebroker.d.ts.map +1 -0
  657. package/ts_build/src/messagebroker/messagebroker.js +20 -0
  658. package/ts_build/src/messagebroker/messagebroker.js.map +1 -0
  659. package/ts_build/src/pushnotificationsservice/pushnotificationsservice.d.ts +3 -0
  660. package/ts_build/src/pushnotificationsservice/pushnotificationsservice.d.ts.map +1 -0
  661. package/ts_build/src/pushnotificationsservice/pushnotificationsservice.js +16 -0
  662. package/ts_build/src/pushnotificationsservice/pushnotificationsservice.js.map +1 -0
  663. package/ts_build/src/serverMessages.d.ts +2 -0
  664. package/ts_build/src/serverMessages.d.ts.map +1 -0
  665. package/ts_build/src/serverMessages.js +35 -0
  666. package/ts_build/src/serverMessages.js.map +1 -0
  667. package/ts_build/src/updatestats/updatestats.d.ts +3 -0
  668. package/ts_build/src/updatestats/updatestats.d.ts.map +1 -0
  669. package/ts_build/src/updatestats/updatestats.js +15 -0
  670. package/ts_build/src/updatestats/updatestats.js.map +1 -0
  671. package/ts_build/templates/en/new_copayer.html +13 -0
  672. package/ts_build/templates/en/new_copayer.plain +2 -0
  673. package/ts_build/templates/en/new_incoming_tx.html +11 -0
  674. package/ts_build/templates/en/new_incoming_tx.plain +2 -0
  675. package/ts_build/templates/en/new_incoming_tx_testnet.html +13 -0
  676. package/ts_build/templates/en/new_incoming_tx_testnet.plain +2 -0
  677. package/ts_build/templates/en/new_outgoing_tx.html +11 -0
  678. package/ts_build/templates/en/new_outgoing_tx.plain +2 -0
  679. package/ts_build/templates/en/new_tx_proposal.html +13 -0
  680. package/ts_build/templates/en/new_tx_proposal.plain +2 -0
  681. package/ts_build/templates/en/new_zero_outgoing_tx.html +13 -0
  682. package/ts_build/templates/en/new_zero_outgoing_tx.plain +2 -0
  683. package/ts_build/templates/en/tx_confirmation.html +13 -0
  684. package/ts_build/templates/en/tx_confirmation.plain +2 -0
  685. package/ts_build/templates/en/tx_confirmation_receiver.html +13 -0
  686. package/ts_build/templates/en/tx_confirmation_receiver.plain +2 -0
  687. package/ts_build/templates/en/tx_confirmation_sender.html +13 -0
  688. package/ts_build/templates/en/tx_confirmation_sender.plain +2 -0
  689. package/ts_build/templates/en/txp_finally_rejected.html +13 -0
  690. package/ts_build/templates/en/txp_finally_rejected.plain +2 -0
  691. package/ts_build/templates/en/wallet_complete.html +13 -0
  692. package/ts_build/templates/en/wallet_complete.plain +2 -0
  693. package/ts_build/templates/es/new_copayer.html +13 -0
  694. package/ts_build/templates/es/new_copayer.plain +2 -0
  695. package/ts_build/templates/es/new_incoming_tx.html +11 -0
  696. package/ts_build/templates/es/new_incoming_tx.plain +2 -0
  697. package/ts_build/templates/es/new_incoming_tx_testnet.html +13 -0
  698. package/ts_build/templates/es/new_incoming_tx_testnet.plain +2 -0
  699. package/ts_build/templates/es/new_outgoing_tx.html +11 -0
  700. package/ts_build/templates/es/new_outgoing_tx.plain +2 -0
  701. package/ts_build/templates/es/new_tx_proposal.html +13 -0
  702. package/ts_build/templates/es/new_tx_proposal.plain +2 -0
  703. package/ts_build/templates/es/new_zero_outgoing_tx.html +13 -0
  704. package/ts_build/templates/es/new_zero_outgoing_tx.plain +2 -0
  705. package/ts_build/templates/es/tx_confirmation.html +13 -0
  706. package/ts_build/templates/es/tx_confirmation.plain +2 -0
  707. package/ts_build/templates/es/tx_confirmation_receiver.html +13 -0
  708. package/ts_build/templates/es/tx_confirmation_receiver.plain +2 -0
  709. package/ts_build/templates/es/tx_confirmation_sender.html +13 -0
  710. package/ts_build/templates/es/tx_confirmation_sender.plain +2 -0
  711. package/ts_build/templates/es/txp_finally_rejected.html +13 -0
  712. package/ts_build/templates/es/txp_finally_rejected.plain +2 -0
  713. package/ts_build/templates/es/wallet_complete.html +13 -0
  714. package/ts_build/templates/es/wallet_complete.plain +2 -0
  715. package/ts_build/templates/fr/new_copayer.html +13 -0
  716. package/ts_build/templates/fr/new_copayer.plain +2 -0
  717. package/ts_build/templates/fr/new_incoming_tx.html +11 -0
  718. package/ts_build/templates/fr/new_incoming_tx.plain +2 -0
  719. package/ts_build/templates/fr/new_incoming_tx_testnet.html +13 -0
  720. package/ts_build/templates/fr/new_incoming_tx_testnet.plain +2 -0
  721. package/ts_build/templates/fr/new_outgoing_tx.html +11 -0
  722. package/ts_build/templates/fr/new_outgoing_tx.plain +2 -0
  723. package/ts_build/templates/fr/new_tx_proposal.html +13 -0
  724. package/ts_build/templates/fr/new_tx_proposal.plain +2 -0
  725. package/ts_build/templates/fr/new_zero_outgoing_tx.html +13 -0
  726. package/ts_build/templates/fr/new_zero_outgoing_tx.plain +2 -0
  727. package/ts_build/templates/fr/tx_confirmation.html +13 -0
  728. package/ts_build/templates/fr/tx_confirmation.plain +2 -0
  729. package/ts_build/templates/fr/tx_confirmation_receiver.html +13 -0
  730. package/ts_build/templates/fr/tx_confirmation_receiver.plain +2 -0
  731. package/ts_build/templates/fr/tx_confirmation_sender.html +13 -0
  732. package/ts_build/templates/fr/tx_confirmation_sender.plain +2 -0
  733. package/ts_build/templates/fr/txp_finally_rejected.html +13 -0
  734. package/ts_build/templates/fr/txp_finally_rejected.plain +2 -0
  735. package/ts_build/templates/fr/wallet_complete.html +13 -0
  736. package/ts_build/templates/fr/wallet_complete.plain +2 -0
  737. package/ts_build/templates/ja/new_copayer.html +13 -0
  738. package/ts_build/templates/ja/new_copayer.plain +2 -0
  739. package/ts_build/templates/ja/new_incoming_tx.html +11 -0
  740. package/ts_build/templates/ja/new_incoming_tx.plain +2 -0
  741. package/ts_build/templates/ja/new_incoming_tx_testnet.html +13 -0
  742. package/ts_build/templates/ja/new_incoming_tx_testnet.plain +2 -0
  743. package/ts_build/templates/ja/new_outgoing_tx.html +11 -0
  744. package/ts_build/templates/ja/new_outgoing_tx.plain +2 -0
  745. package/ts_build/templates/ja/new_tx_proposal.html +13 -0
  746. package/ts_build/templates/ja/new_tx_proposal.plain +2 -0
  747. package/ts_build/templates/ja/new_zero_outgoing_tx.html +13 -0
  748. package/ts_build/templates/ja/new_zero_outgoing_tx.plain +2 -0
  749. package/ts_build/templates/ja/tx_confirmation.html +13 -0
  750. package/ts_build/templates/ja/tx_confirmation.plain +2 -0
  751. package/ts_build/templates/ja/tx_confirmation_receiver.html +13 -0
  752. package/ts_build/templates/ja/tx_confirmation_receiver.plain +2 -0
  753. package/ts_build/templates/ja/tx_confirmation_sender.html +13 -0
  754. package/ts_build/templates/ja/tx_confirmation_sender.plain +2 -0
  755. package/ts_build/templates/ja/txp_finally_rejected.html +13 -0
  756. package/ts_build/templates/ja/txp_finally_rejected.plain +2 -0
  757. package/ts_build/templates/ja/wallet_complete.html +13 -0
  758. package/ts_build/templates/ja/wallet_complete.plain +2 -0
  759. package/ts_build/templates/master-template.html +494 -0
  760. package/ts_build/test/bchaddresstranslator.test.d.ts +2 -0
  761. package/ts_build/test/bchaddresstranslator.test.d.ts.map +1 -0
  762. package/ts_build/test/bchaddresstranslator.test.js +76 -0
  763. package/ts_build/test/bchaddresstranslator.test.js.map +1 -0
  764. package/ts_build/test/blockchainexplorer.test.d.ts +2 -0
  765. package/ts_build/test/blockchainexplorer.test.d.ts.map +1 -0
  766. package/ts_build/test/blockchainexplorer.test.js +98 -0
  767. package/ts_build/test/blockchainexplorer.test.js.map +1 -0
  768. package/ts_build/test/chain/bch.test.d.ts +2 -0
  769. package/ts_build/test/chain/bch.test.d.ts.map +1 -0
  770. package/ts_build/test/chain/bch.test.js +135 -0
  771. package/ts_build/test/chain/bch.test.js.map +1 -0
  772. package/ts_build/test/chain/btc.test.d.ts +2 -0
  773. package/ts_build/test/chain/btc.test.d.ts.map +1 -0
  774. package/ts_build/test/chain/btc.test.js +310 -0
  775. package/ts_build/test/chain/btc.test.js.map +1 -0
  776. package/ts_build/test/chain/doge.test.d.ts +2 -0
  777. package/ts_build/test/chain/doge.test.d.ts.map +1 -0
  778. package/ts_build/test/chain/doge.test.js +343 -0
  779. package/ts_build/test/chain/doge.test.js.map +1 -0
  780. package/ts_build/test/chain/eth.test.d.ts +2 -0
  781. package/ts_build/test/chain/eth.test.d.ts.map +1 -0
  782. package/ts_build/test/chain/eth.test.js +51 -0
  783. package/ts_build/test/chain/eth.test.js.map +1 -0
  784. package/ts_build/test/chain/ltc.test.d.ts +2 -0
  785. package/ts_build/test/chain/ltc.test.d.ts.map +1 -0
  786. package/ts_build/test/chain/ltc.test.js +323 -0
  787. package/ts_build/test/chain/ltc.test.js.map +1 -0
  788. package/ts_build/test/chain/matic.test.d.ts +2 -0
  789. package/ts_build/test/chain/matic.test.d.ts.map +1 -0
  790. package/ts_build/test/chain/matic.test.js +51 -0
  791. package/ts_build/test/chain/matic.test.js.map +1 -0
  792. package/ts_build/test/chain/xrp.test.d.ts +2 -0
  793. package/ts_build/test/chain/xrp.test.d.ts.map +1 -0
  794. package/ts_build/test/chain/xrp.test.js +228 -0
  795. package/ts_build/test/chain/xrp.test.js.map +1 -0
  796. package/ts_build/test/expressapp.test.d.ts +2 -0
  797. package/ts_build/test/expressapp.test.d.ts.map +1 -0
  798. package/ts_build/test/expressapp.test.js +523 -0
  799. package/ts_build/test/expressapp.test.js.map +1 -0
  800. package/ts_build/test/integration/bcmonitor.test.d.ts +2 -0
  801. package/ts_build/test/integration/bcmonitor.test.d.ts.map +1 -0
  802. package/ts_build/test/integration/bcmonitor.test.js +375 -0
  803. package/ts_build/test/integration/bcmonitor.test.js.map +1 -0
  804. package/ts_build/test/integration/cashAddrMigration.test.d.ts +2 -0
  805. package/ts_build/test/integration/cashAddrMigration.test.d.ts.map +1 -0
  806. package/ts_build/test/integration/cashAddrMigration.test.js +147 -0
  807. package/ts_build/test/integration/cashAddrMigration.test.js.map +1 -0
  808. package/ts_build/test/integration/data/tss/2of3/index.d.ts +4 -0
  809. package/ts_build/test/integration/data/tss/2of3/index.d.ts.map +1 -0
  810. package/ts_build/test/integration/data/tss/2of3/index.js +20 -0
  811. package/ts_build/test/integration/data/tss/2of3/index.js.map +1 -0
  812. package/ts_build/test/integration/data/tss/2of3/party0.key.d.ts +6 -0
  813. package/ts_build/test/integration/data/tss/2of3/party0.key.d.ts.map +1 -0
  814. package/ts_build/test/integration/data/tss/2of3/party0.key.js +9 -0
  815. package/ts_build/test/integration/data/tss/2of3/party0.key.js.map +1 -0
  816. package/ts_build/test/integration/data/tss/2of3/party1.key.d.ts +6 -0
  817. package/ts_build/test/integration/data/tss/2of3/party1.key.d.ts.map +1 -0
  818. package/ts_build/test/integration/data/tss/2of3/party1.key.js +9 -0
  819. package/ts_build/test/integration/data/tss/2of3/party1.key.js.map +1 -0
  820. package/ts_build/test/integration/data/tss/2of3/party2.key.d.ts +6 -0
  821. package/ts_build/test/integration/data/tss/2of3/party2.key.d.ts.map +1 -0
  822. package/ts_build/test/integration/data/tss/2of3/party2.key.js +9 -0
  823. package/ts_build/test/integration/data/tss/2of3/party2.key.js.map +1 -0
  824. package/ts_build/test/integration/emailnotifications.test.d.ts +2 -0
  825. package/ts_build/test/integration/emailnotifications.test.d.ts.map +1 -0
  826. package/ts_build/test/integration/emailnotifications.test.js +805 -0
  827. package/ts_build/test/integration/emailnotifications.test.js.map +1 -0
  828. package/ts_build/test/integration/externalservices/banxa.test.d.ts +2 -0
  829. package/ts_build/test/integration/externalservices/banxa.test.d.ts.map +1 -0
  830. package/ts_build/test/integration/externalservices/banxa.test.js +382 -0
  831. package/ts_build/test/integration/externalservices/banxa.test.js.map +1 -0
  832. package/ts_build/test/integration/externalservices/changelly.test.d.ts +2 -0
  833. package/ts_build/test/integration/externalservices/changelly.test.d.ts.map +1 -0
  834. package/ts_build/test/integration/externalservices/changelly.test.js +509 -0
  835. package/ts_build/test/integration/externalservices/changelly.test.js.map +1 -0
  836. package/ts_build/test/integration/externalservices/coinGecko.test.d.ts +2 -0
  837. package/ts_build/test/integration/externalservices/coinGecko.test.d.ts.map +1 -0
  838. package/ts_build/test/integration/externalservices/coinGecko.test.js +295 -0
  839. package/ts_build/test/integration/externalservices/coinGecko.test.js.map +1 -0
  840. package/ts_build/test/integration/externalservices/moonpay.test.d.ts +2 -0
  841. package/ts_build/test/integration/externalservices/moonpay.test.d.ts.map +1 -0
  842. package/ts_build/test/integration/externalservices/moonpay.test.js +567 -0
  843. package/ts_build/test/integration/externalservices/moonpay.test.js.map +1 -0
  844. package/ts_build/test/integration/externalservices/oneInch.test.d.ts +2 -0
  845. package/ts_build/test/integration/externalservices/oneInch.test.d.ts.map +1 -0
  846. package/ts_build/test/integration/externalservices/oneInch.test.js +182 -0
  847. package/ts_build/test/integration/externalservices/oneInch.test.js.map +1 -0
  848. package/ts_build/test/integration/externalservices/ramp.test.d.ts +2 -0
  849. package/ts_build/test/integration/externalservices/ramp.test.d.ts.map +1 -0
  850. package/ts_build/test/integration/externalservices/ramp.test.js +459 -0
  851. package/ts_build/test/integration/externalservices/ramp.test.js.map +1 -0
  852. package/ts_build/test/integration/externalservices/sardine.test.d.ts +2 -0
  853. package/ts_build/test/integration/externalservices/sardine.test.d.ts.map +1 -0
  854. package/ts_build/test/integration/externalservices/sardine.test.js +364 -0
  855. package/ts_build/test/integration/externalservices/sardine.test.js.map +1 -0
  856. package/ts_build/test/integration/externalservices/simplex.test.d.ts +2 -0
  857. package/ts_build/test/integration/externalservices/simplex.test.d.ts.map +1 -0
  858. package/ts_build/test/integration/externalservices/simplex.test.js +383 -0
  859. package/ts_build/test/integration/externalservices/simplex.test.js.map +1 -0
  860. package/ts_build/test/integration/externalservices/thorswap.test.d.ts +2 -0
  861. package/ts_build/test/integration/externalservices/thorswap.test.d.ts.map +1 -0
  862. package/ts_build/test/integration/externalservices/thorswap.test.js +316 -0
  863. package/ts_build/test/integration/externalservices/thorswap.test.js.map +1 -0
  864. package/ts_build/test/integration/externalservices/transak.test.d.ts +2 -0
  865. package/ts_build/test/integration/externalservices/transak.test.d.ts.map +1 -0
  866. package/ts_build/test/integration/externalservices/transak.test.js +409 -0
  867. package/ts_build/test/integration/externalservices/transak.test.js.map +1 -0
  868. package/ts_build/test/integration/externalservices/wyre.test.d.ts +2 -0
  869. package/ts_build/test/integration/externalservices/wyre.test.d.ts.map +1 -0
  870. package/ts_build/test/integration/externalservices/wyre.test.js +281 -0
  871. package/ts_build/test/integration/externalservices/wyre.test.js.map +1 -0
  872. package/ts_build/test/integration/fiatrateservice.test.d.ts +2 -0
  873. package/ts_build/test/integration/fiatrateservice.test.d.ts.map +1 -0
  874. package/ts_build/test/integration/fiatrateservice.test.js +838 -0
  875. package/ts_build/test/integration/fiatrateservice.test.js.map +1 -0
  876. package/ts_build/test/integration/helpers.d.ts +57 -0
  877. package/ts_build/test/integration/helpers.d.ts.map +1 -0
  878. package/ts_build/test/integration/helpers.js +633 -0
  879. package/ts_build/test/integration/helpers.js.map +1 -0
  880. package/ts_build/test/integration/history.test.d.ts +2 -0
  881. package/ts_build/test/integration/history.test.d.ts.map +1 -0
  882. package/ts_build/test/integration/history.test.js +1064 -0
  883. package/ts_build/test/integration/history.test.js.map +1 -0
  884. package/ts_build/test/integration/hugetx.d.ts +46 -0
  885. package/ts_build/test/integration/hugetx.d.ts.map +1 -0
  886. package/ts_build/test/integration/hugetx.js +6459 -0
  887. package/ts_build/test/integration/hugetx.js.map +1 -0
  888. package/ts_build/test/integration/pushNotifications.test.d.ts +2 -0
  889. package/ts_build/test/integration/pushNotifications.test.d.ts.map +1 -0
  890. package/ts_build/test/integration/pushNotifications.test.js +1379 -0
  891. package/ts_build/test/integration/pushNotifications.test.js.map +1 -0
  892. package/ts_build/test/integration/server.test.d.ts +2 -0
  893. package/ts_build/test/integration/server.test.d.ts.map +1 -0
  894. package/ts_build/test/integration/server.test.js +9980 -0
  895. package/ts_build/test/integration/server.test.js.map +1 -0
  896. package/ts_build/test/integration/tss.test.d.ts +2 -0
  897. package/ts_build/test/integration/tss.test.d.ts.map +1 -0
  898. package/ts_build/test/integration/tss.test.js +360 -0
  899. package/ts_build/test/integration/tss.test.js.map +1 -0
  900. package/ts_build/test/lock.test.d.ts +2 -0
  901. package/ts_build/test/lock.test.d.ts.map +1 -0
  902. package/ts_build/test/lock.test.js +226 -0
  903. package/ts_build/test/lock.test.js.map +1 -0
  904. package/ts_build/test/model/address.test.d.ts +2 -0
  905. package/ts_build/test/model/address.test.d.ts.map +1 -0
  906. package/ts_build/test/model/address.test.js +209 -0
  907. package/ts_build/test/model/address.test.js.map +1 -0
  908. package/ts_build/test/model/addressmanager.test.d.ts +2 -0
  909. package/ts_build/test/model/addressmanager.test.d.ts.map +1 -0
  910. package/ts_build/test/model/addressmanager.test.js +178 -0
  911. package/ts_build/test/model/addressmanager.test.js.map +1 -0
  912. package/ts_build/test/model/advertisement.test.d.ts +2 -0
  913. package/ts_build/test/model/advertisement.test.d.ts.map +1 -0
  914. package/ts_build/test/model/advertisement.test.js +61 -0
  915. package/ts_build/test/model/advertisement.test.js.map +1 -0
  916. package/ts_build/test/model/copayer.test.d.ts +2 -0
  917. package/ts_build/test/model/copayer.test.d.ts.map +1 -0
  918. package/ts_build/test/model/copayer.test.js +161 -0
  919. package/ts_build/test/model/copayer.test.js.map +1 -0
  920. package/ts_build/test/model/txproposal.test.d.ts +2 -0
  921. package/ts_build/test/model/txproposal.test.d.ts.map +1 -0
  922. package/ts_build/test/model/txproposal.test.js +198 -0
  923. package/ts_build/test/model/txproposal.test.js.map +1 -0
  924. package/ts_build/test/model/wallet.test.d.ts +2 -0
  925. package/ts_build/test/model/wallet.test.d.ts.map +1 -0
  926. package/ts_build/test/model/wallet.test.js +215 -0
  927. package/ts_build/test/model/wallet.test.js.map +1 -0
  928. package/ts_build/test/storage.test.d.ts +2 -0
  929. package/ts_build/test/storage.test.d.ts.map +1 -0
  930. package/ts_build/test/storage.test.js +433 -0
  931. package/ts_build/test/storage.test.js.map +1 -0
  932. package/ts_build/test/test-config.d.ts +8 -0
  933. package/ts_build/test/test-config.d.ts.map +1 -0
  934. package/ts_build/test/test-config.js +14 -0
  935. package/ts_build/test/test-config.js.map +1 -0
  936. package/ts_build/test/testdata.d.ts +91 -0
  937. package/ts_build/test/testdata.d.ts.map +1 -0
  938. package/ts_build/test/testdata.js +304 -0
  939. package/ts_build/test/testdata.js.map +1 -0
  940. package/ts_build/test/utils.test.d.ts +2 -0
  941. package/ts_build/test/utils.test.d.ts.map +1 -0
  942. package/ts_build/test/utils.test.js +450 -0
  943. package/ts_build/test/utils.test.js.map +1 -0
  944. package/ts_build/test/v8.test.d.ts +2 -0
  945. package/ts_build/test/v8.test.d.ts.map +1 -0
  946. package/ts_build/test/v8.test.js +341 -0
  947. package/ts_build/test/v8.test.js.map +1 -0
  948. package/tsconfig.json +43 -0
  949. package/tsconfig.prod.json +6 -0
@@ -0,0 +1,340 @@
1
+ import sinon from 'sinon';
2
+ import * as chai from 'chai';
3
+ import 'chai/register-should';
4
+ import { BitcoreLib } from '@bitpay-labs/crypto-wallet-core';
5
+ import request from 'supertest';
6
+ import * as twoOfThree from './data/tss/2of3';
7
+ import BWS from '../../src/index';
8
+ import helpers from './helpers';
9
+ import { TssKeyGen } from '../../src/lib/tss';
10
+
11
+ const should = chai.should();
12
+
13
+ describe('TSS', function() {
14
+ const vector = {
15
+ m: 2,
16
+ n: 3,
17
+ evmAddress: {
18
+ address: '0xD57cF5ac4CC763D83E0892a07a02fE1BBD123b27'
19
+ },
20
+ party0: {
21
+ seed: Buffer.from('0d18dd84ff2e7e462bdca9fb362dce0590badac80438234a6be4b859d674355d', 'hex'),
22
+ keychain: twoOfThree.party0Key,
23
+ authKey: new BitcoreLib.PrivateKey('ae6101a4bfcae77c59c4c252d2004996e1f614e17feee932eff82d132d3c4cd1'),
24
+ },
25
+ party1: {
26
+ seed: Buffer.from('1cb43de73873a349190d7d0ab5256aa4dba5e8ab1291885086d9db633134ac23', 'hex'),
27
+ keychain: twoOfThree.party1Key,
28
+ authKey: new BitcoreLib.PrivateKey('b45b008ffc057705f9119411c9fd2bad380b03d3295131834a798545fc5ed9da')
29
+ },
30
+ party2: {
31
+ seed: Buffer.from('202b9dcd66c61bdcb523b65332e5bc4f17805ba991374dfb2a3e9347ec6bd170', 'hex'),
32
+ keychain: twoOfThree.party2Key,
33
+ authKey: new BitcoreLib.PrivateKey('c0ad56c56bfae6cad2bdba3d96be498515213eb62fdc4a0ee988514eb639841d')
34
+ },
35
+ keygen: {
36
+ messages: {
37
+ round0: {
38
+ party0: {
39
+ p2pMessages: [],
40
+ broadcastMessages: [{
41
+ from: 0,
42
+ payload: {
43
+ message: 'pGdmcm9tX2lkAGpzZXNzaW9uX2lkmCAYqwkFGO0YMhi6GJMY8RjZGKIYuBiMGHUYKBjjGFYYMhhkGK0GGOYYOBiDGMgYahj8GLoYbBiLGGwYRhgwamNvbW1pdG1lbnSYIBg6GCEYvhiuGNgGGGgYoBgxGHYY+xgcGDcHGH4YuhisGK0YZhi2GDQYqgUYwhgsGC0Yvhh6GJwYOhj+GD1jeF9pmCAY1hiNGMAYJhjPGCoYhBMYbBj7GPIYihgnGLsYsBhXGK4YsRhWAhg4GF8Y9hiaGNAY9xhoGGMYTBjXGJ4YSQ==',
44
+ signature: '304402205ab3bd821993cae4be10abc13f459eec466ebf940c4164478f2c9c3686eaab460220693ece4ce558459241256d2f9109e8f3a6fcb9fbe34899ad919c44a1e0d3fb10'
45
+ },
46
+ signatureR: undefined
47
+ }]
48
+ },
49
+ party1: {
50
+ p2pMessages: [],
51
+ broadcastMessages: [{
52
+ from: 1,
53
+ payload: {
54
+ message: 'pGdmcm9tX2lkAWpzZXNzaW9uX2lkmCAYcA0YhBh1GKwY3hguExiSGKsY8xhZGIMYyRiDGPMYthiuGOMYcxj2GCAYlBjbGGAYHBhbGF8YjBjIGO0YKWpjb21taXRtZW50mCAYqBibGNAYHRisGO0Y0RglGLYYrBgsGLAYsBi+GE4YKRhmGCgYZRjNGPEY8RjUGPkYMRjPGN0YfhjeGFkYeQNjeF9pmCAPGGUYVgYYvBj6GKYYwhjfGHEYYxiAGLAY8xg8GCAYzBg2GIsYbQ4YIRgzGGMLGJMYdRi0Exj5GFMYxg==',
55
+ signature: '3045022100c0c98bc13362a36ee0f7750f378a93717e1e8c820c1bb7b915ce39b3604861e402200781fc0140f84c4aa82d2ef0b8c475f85efa4228e8d0e4eb2c0fa5f012907df6'
56
+ },
57
+ signatureR: undefined
58
+ }]
59
+ },
60
+ party2: {
61
+ p2pMessages: [],
62
+ broadcastMessages: [{
63
+ from: 2,
64
+ payload: {
65
+ message: 'pGdmcm9tX2lkAmpzZXNzaW9uX2lkmCACGI8YJBiRGLIYWRjJGKsY5RhqFBi0GEAYYwEYbRjNGB8YOxiDGMAYRxitGEMYJhg6GN8YNRiVGI8YkBggamNvbW1pdG1lbnSYIBgxGJEYWRgjGPQY/hj3GLYYURg9GNgYjgcYSxjEGLEYWA0YhxgoGCgCGEkY7hjGGJUY/xgxGPkYKxiCGJ5jeF9pmCAYJRj1GLEYrhhmGCoY1hggGIMYORgbGBkY5xIYtBhcGLAYdRjfGIMYPhjCGB0Y5BglGIYRGNEYhBEYjhgs',
66
+ signature: '304402200e21a04f466fbb3b79395a636adfbb0b457fa277bb6a6b03a8e0692d072a3e24022021f0b6da62772c5ac413abf017c7bbea4219ae6ef930215a7d73e7df13ed34c0'
67
+ },
68
+ signatureR: undefined
69
+ }]
70
+ },
71
+ },
72
+ round1: {
73
+ party0: {
74
+ p2pMessages: [{
75
+ from: 0,
76
+ to: 1,
77
+ commitment: '8e5f056658224eb4e6de54bb495b003904dfc1b780f9c02cbf6613bd55df2bb8',
78
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
79
+ }, {
80
+ from: 0,
81
+ to: 2,
82
+ commitment: '8e5f056658224eb4e6de54bb495b003904dfc1b780f9c02cbf6613bd55df2bb8',
83
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
84
+ }],
85
+ broadcastMessages: []
86
+ },
87
+ party1: {
88
+ p2pMessages: [{
89
+ from: 1,
90
+ to: 0,
91
+ commitment: 'b2520ea8672273bf0fb9b98f943ed9ac8a2b0402463dc6635b7ac9f5b3668099',
92
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
93
+ }, {
94
+ from: 1,
95
+ to: 2,
96
+ commitment: 'b2520ea8672273bf0fb9b98f943ed9ac8a2b0402463dc6635b7ac9f5b3668099',
97
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
98
+ }],
99
+ broadcastMessages: []
100
+ },
101
+ party2: {
102
+ p2pMessages: [{
103
+ from: 2,
104
+ to: 0,
105
+ commitment: 'acb1ce48472da67719028bc962742f9fd5cf3c8ee77c217852e874ca7584d07e',
106
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
107
+ }, {
108
+ from: 2,
109
+ to: 1,
110
+ commitment: 'acb1ce48472da67719028bc962742f9fd5cf3c8ee77c217852e874ca7584d07e',
111
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
112
+ }],
113
+ broadcastMessages: []
114
+ }
115
+ },
116
+ round2: {
117
+ party0: {
118
+ p2pMessages: [{
119
+ from: 0,
120
+ to: 1,
121
+ commitment: '8e5f056658224eb4e6de54bb495b003904dfc1b780f9c02cbf6613bd55df2bb8',
122
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
123
+ }, {
124
+ from: 0,
125
+ to: 2,
126
+ commitment: '8e5f056658224eb4e6de54bb495b003904dfc1b780f9c02cbf6613bd55df2bb8',
127
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
128
+ }],
129
+ broadcastMessages: []
130
+ },
131
+ party1: {
132
+ p2pMessages: [{
133
+ from: 1,
134
+ to: 0,
135
+ commitment: 'b2520ea8672273bf0fb9b98f943ed9ac8a2b0402463dc6635b7ac9f5b3668099',
136
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
137
+ }, {
138
+ from: 1,
139
+ to: 2,
140
+ commitment: 'b2520ea8672273bf0fb9b98f943ed9ac8a2b0402463dc6635b7ac9f5b3668099',
141
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
142
+ }],
143
+ broadcastMessages: []
144
+ },
145
+ party2: {
146
+ p2pMessages: [{
147
+ from: 2,
148
+ to: 0,
149
+ commitment: 'acb1ce48472da67719028bc962742f9fd5cf3c8ee77c217852e874ca7584d07e',
150
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
151
+ }, {
152
+ from: 2,
153
+ to: 1,
154
+ commitment: 'acb1ce48472da67719028bc962742f9fd5cf3c8ee77c217852e874ca7584d07e',
155
+ payload: { encryptedMessage: 'variable - test for existence', signature: 'variable - test for existence' }
156
+ }],
157
+ broadcastMessages: []
158
+ }
159
+ },
160
+ round3: {
161
+ party0: {
162
+ p2pMessages: [],
163
+ broadcastMessages: [
164
+ {
165
+ from: 0,
166
+ payload: {
167
+ message: 'pGdmcm9tX2lkAGpwdWJsaWNfa2V5mCEDGLIYNRjfGDMYzhiCGOAY4wAY6hgnGBgYtBg9GEQYmhigGN4YXRiaGHoYrxikGI4YRBjRGJQYwhiZFhjyGENnYmlnX3NfaZghAxi9GJ8YmhiqGGcYIBj2GKUYhxjpGDQYohhYGIAYWwwYpBjHGFkYxBiaGMoY6BjUGPwY2hgmGP0YgBgiExibZXByb29momF0mCEDGMkYQRgkGEcYMRhxGP0Y4xigGJAYSRgpGJAYnBhGGKUYkBifGJkY8Rh+GCsYsxirGIcMGPAYiBjjGLEY9xhMYXOYIBhKGOMYnhi7ERjrGKYYTBIYPRiQGHIYURhLGOkYixicGJMJGLEY7xisGF8YeBicGE0IFwoIGC8YVA==',
168
+ signature: '3045022100e7d1209ab8463ba6af71d0df953eaecd7cf1cbb06f7a5f4f0bacde9cd555cf310220220251083ea1d6453ff376a5520f87b9f6fe2c1fa099d034453aa41b81e54f9c',
169
+ },
170
+ signatureR: undefined,
171
+ },
172
+ ],
173
+ },
174
+ party1: {
175
+ p2pMessages: [],
176
+ broadcastMessages: [
177
+ {
178
+ from: 1,
179
+ payload: {
180
+ message: 'pGdmcm9tX2lkAWpwdWJsaWNfa2V5mCEDGLIYNRjfGDMYzhiCGOAY4wAY6hgnGBgYtBg9GEQYmhigGN4YXRiaGHoYrxikGI4YRBjRGJQYwhiZFhjyGENnYmlnX3NfaZghAxizGJsYlBjXGJkYzRiXGFQYuBg7GOwYVRiuGPkYOhhOGHUYaxgnGK8Y4xi2GCgY/xhWGEYHGOIYIBidGOkAZXByb29momF0mCEDGCgYVhioGKYYUQ0YnRj9GDIYQBiHGMAYvBjOFBhSGJwYohgrGBkYgRibGKsY0RjYGJYYGRjYGJ0YXBgbGCBhc5ggGLkY9hg7GEYYORjIARhwGNQYzhg/GEUYpxiGGOEY+hijGJgYthgjGOEYpRh0CxjRGCASGI8YghjDDxiF',
181
+ signature: '3045022100cde18dafab8cf3ced5a6df4374de498a41b273eeb929c9a5f2d316352cec7d2202200ab38847d3114321edd49a5ec2bb52ab6b27344d4719ef54ae48f98482061f0d',
182
+ },
183
+ signatureR: undefined,
184
+ },
185
+ ],
186
+ },
187
+ party2: {
188
+ p2pMessages: [],
189
+ broadcastMessages: [
190
+ {
191
+ from: 2,
192
+ payload: {
193
+ message: 'pGdmcm9tX2lkAmpwdWJsaWNfa2V5mCEDGLIYNRjfGDMYzhiCGOAY4wAY6hgnGBgYtBg9GEQYmhigGN4YXRiaGHoYrxikGI4YRBjRGJQYwhiZFhjyGENnYmlnX3NfaZghAxjvGIMYqhiPGI8YcRinGPYYXRjMGF0YegcYZxjJGMgKGHoYoRhnGNYYwBiHGOoYlBjvGN8YyBgsGEcYKhgqZXByb29momF0mCEDGPUYzxjiGLkYjxj+GEAYZgkYQxi+GLgYGxgyGEIKGLgYywwKGDEYxRhVGN0YUhigGL8Y+wYYSRguGPxhc5ggGCwYxRieGG0Y3xjwGIkQGDQY1hhJGJ0Y1xgsGNcY8hixGMQY+hiQGJ8Y9xgYGM8YtBhPGG0RGPgYcBgyGJs=',
194
+ signature: '304402203e9ca032e88a0c9e508a2b24fd421a9c84eb227cd9c82acf4f04f623e9318eba02201bb3b907b3a6b6023bed4198217dd9c42a1d9798aae475773a4d48e3870da625',
195
+ },
196
+ signatureR: undefined,
197
+ },
198
+ ],
199
+ }
200
+ }
201
+ }
202
+ },
203
+ signing: [{
204
+ description: 'Sign Ethereum transaction',
205
+ derivationPath: 'm',
206
+ chain: 'ETH',
207
+ rawTx: '0xeb8083030d4782520894145938752bad526cb27f03ffb02775c43973ab8387038d7ea4c68000808205398080',
208
+ messageHash: '516ab037171ee1a7787cbe07c28948dd0252ea60b7f40ee6ffbb7e1271f691ea'
209
+ }]
210
+ };
211
+ const n = 2;
212
+ const m = 3;
213
+
214
+ let app;
215
+ const urlPrefix = '/bws/api';
216
+ const sandbox = sinon.createSandbox();
217
+
218
+ before(async function() {
219
+ await helpers.before();
220
+ });
221
+
222
+ after(async function() {
223
+ await helpers.after();
224
+ });
225
+
226
+ beforeEach(function(done) {
227
+ const storage = helpers.getStorage();
228
+ const blockchainExplorerMock = helpers.getBlockchainExplorer();
229
+
230
+ const expressApp = new BWS.ExpressApp();
231
+ expressApp.start(
232
+ {
233
+ ignoreRateLimiter: true,
234
+ storage: storage,
235
+ blockchainExplorer: blockchainExplorerMock,
236
+ disableLogs: true,
237
+ doNotCheckV8: true
238
+ },
239
+ () => {
240
+ app = request(expressApp.app);
241
+ done();
242
+ }
243
+ );
244
+ });
245
+
246
+ afterEach(function() {
247
+ sandbox.restore();
248
+ });
249
+
250
+ describe('POST /v1/tss/keygen/:id', function() {
251
+ const url = id => `${urlPrefix}/v1/tss/keygen/${id}`;
252
+
253
+ describe('middleware', function() {
254
+ beforeEach(function() {
255
+ sandbox.stub(TssKeyGen, 'processMessage').resolves();
256
+ });
257
+
258
+ it('should verify tss broadcast message', function(done) {
259
+ const message = JSON.parse(JSON.stringify(vector.keygen.messages.round0.party0));
260
+ message.publicKey = vector.party0.authKey.publicKey.toString();
261
+ app.post(url('test'))
262
+ .send({ message })
263
+ .expect(200)
264
+ .end((err, res) => {
265
+ should.not.exist(err);
266
+ done();
267
+ });
268
+ });
269
+
270
+ it('should verify tss p2p message', function(done) {
271
+ const message = JSON.parse(JSON.stringify(vector.keygen.messages.round1.party0));
272
+ message.publicKey = vector.party0.authKey.publicKey.toString();
273
+ app.post(url('test'))
274
+ .send({ message })
275
+ .expect(200)
276
+ .end((err, res) => {
277
+ should.not.exist(err);
278
+ done();
279
+ });
280
+ });
281
+
282
+ it('should error if no publicKey', function(done) {
283
+ app.post(url('test'))
284
+ .send({})
285
+ .expect(200)
286
+ .end((err, res) => {
287
+ should.exist(err);
288
+ res.status.should.equal(400);
289
+ res.body.code.should.equal('TSS_PUBKEY_MISSING');
290
+ done();
291
+ });
292
+ });
293
+
294
+ it('should error if publicKey is bogus', function(done) {
295
+ const message = JSON.parse(JSON.stringify(vector.keygen.messages.round0.party0));
296
+ message.publicKey = 'invalid';
297
+ app.post(url('test'))
298
+ .send({ message })
299
+ .expect(200)
300
+ .end((err, res) => {
301
+ should.exist(err);
302
+ res.status.should.equal(400);
303
+ res.body.code.should.equal('TSS_INVALID_MESSAGE');
304
+ done();
305
+ });
306
+ });
307
+
308
+ it('should error if publicKey cannot verify broadcast message signature', function(done) {
309
+ const message = JSON.parse(JSON.stringify(vector.keygen.messages.round0.party0));
310
+ message.publicKey = new BitcoreLib.PrivateKey().publicKey.toString();
311
+ app.post(url('test'))
312
+ .send({ message })
313
+ .expect(200)
314
+ .end((err, res) => {
315
+ should.exist(err);
316
+ res.status.should.equal(400);
317
+ res.body.code.should.equal('TSS_INVALID_MESSAGE_SIG');
318
+ done();
319
+ });
320
+ });
321
+
322
+ it('should error if messages are empty arrays', function(done) {
323
+ const message = {
324
+ broadcastMessages: [],
325
+ p2pMessages: [],
326
+ publicKey: new BitcoreLib.PrivateKey().publicKey.toString()
327
+ };
328
+ app.post(url('test'))
329
+ .send({ message })
330
+ .expect(200)
331
+ .end((err, res) => {
332
+ should.exist(err);
333
+ res.status.should.equal(400);
334
+ res.body.code.should.equal('TSS_INVALID_MESSAGE');
335
+ done();
336
+ });
337
+ });
338
+ });
339
+ });
340
+ });
@@ -0,0 +1,224 @@
1
+ 'use strict';
2
+
3
+ import * as chai from 'chai';
4
+ import 'chai/register-should';
5
+ import { Lock } from '../src/lib/lock';
6
+ import helpers from './integration/helpers';
7
+ import { type Storage } from '../src/lib/storage';
8
+
9
+ const should = chai.should();
10
+ const expect = chai.expect;
11
+
12
+ describe('Locks', function() {
13
+ let lock: Lock;
14
+ let order = [];
15
+ let storage: Storage;
16
+ const step = 50;
17
+
18
+ before(async function() {
19
+ const res = await helpers.before();
20
+ storage = res.storage;
21
+ });
22
+
23
+
24
+ beforeEach(async function() {
25
+ await helpers.beforeEach();
26
+ lock = new Lock(storage);
27
+ order = [];
28
+ });
29
+
30
+
31
+ afterEach(function() {
32
+ });
33
+
34
+
35
+ function pushEvent(i) {
36
+ order.push(i);
37
+ };
38
+
39
+
40
+ it('should lock tasks using the same token', function(done) {
41
+ pushEvent(0);
42
+
43
+ lock.acquire('123', {}, function(err, release) {
44
+ should.not.exist(err);
45
+ pushEvent(1);
46
+ setTimeout(function() {
47
+ release();
48
+ }, step);
49
+ lock.acquire('123', {}, function(err, release) {
50
+ should.not.exist(err);
51
+ pushEvent(2);
52
+ setTimeout(function() {
53
+ release();
54
+ }, step);
55
+ lock.acquire('123', {}, function(err, release) {
56
+ should.not.exist(err);
57
+ pushEvent(3);
58
+ setTimeout(function() {
59
+ release();
60
+ expect(order).to.deep.equal([0, 4, 1, 5, 2, 6, 3]);
61
+ done();
62
+ }, step);
63
+ });
64
+ pushEvent(6);
65
+ });
66
+ pushEvent(5);
67
+ });
68
+ pushEvent(4);
69
+
70
+ });
71
+
72
+ it('should call waiting tasks', function(done) {
73
+ pushEvent(0);
74
+
75
+ function testDone() {
76
+ if (order.length < 5) return;
77
+ expect([0, 4, 1]).to.deep.equal(order.slice(0, 3));
78
+ // There's a race condition with the setTimeouts, so we just check that 2 and 3 are in the last two positions
79
+ expect(order[3]).to.be.oneOf([2, 3]);
80
+ expect(order[4]).to.be.oneOf([2, 3]);
81
+ pushEvent('done');
82
+ done();
83
+ }
84
+
85
+ lock.acquire('123', {}, function(err, release) {
86
+ should.not.exist(err);
87
+ pushEvent(1);
88
+ setTimeout(function() {
89
+ release();
90
+ }, step);
91
+ }, 1);
92
+ lock.acquire('123', {}, function(err, release) {
93
+ should.not.exist(err);
94
+ pushEvent(2);
95
+ setTimeout(function() {
96
+ release();
97
+ testDone();
98
+ }, step);
99
+ }, 2);
100
+ lock.acquire('123', {}, function(err, release) {
101
+ should.not.exist(err);
102
+ pushEvent(3);
103
+ setTimeout(function() {
104
+ release();
105
+ testDone();
106
+ }, step);
107
+ }, 3);
108
+ pushEvent(4);
109
+ });
110
+
111
+ it('should not lock tasks using different tokens', function(done) {
112
+ pushEvent(0);
113
+
114
+ lock.acquire('123', {}, function(err, release) {
115
+ should.not.exist(err);
116
+ pushEvent(1);
117
+ setTimeout(function() {
118
+ release();
119
+ }, step);
120
+ lock.acquire('123', {}, function(err, release) {
121
+ should.not.exist(err);
122
+ pushEvent(2);
123
+ setTimeout(function() {
124
+ release();
125
+ expect(order.indexOf(3)).to.be.below(order.indexOf(2));
126
+ done();
127
+ }, step);
128
+ });
129
+ });
130
+
131
+ lock.acquire('123', {}, function(err, release) {
132
+ should.not.exist(err);
133
+ pushEvent(3);
134
+ setTimeout(function() {
135
+ release();
136
+ }, step);
137
+ });
138
+ });
139
+
140
+ it('should return error if unable to acquire lock', function(done) {
141
+ pushEvent(0);
142
+
143
+ lock.acquire('123', {}, function(err, release) {
144
+ should.not.exist(err);
145
+ pushEvent(1);
146
+ lock.acquire('123', { waitTime: 1 }, function(err, release2) {
147
+ release();
148
+ expect(err).to.contain('LOCKED');
149
+ done();
150
+ });
151
+ });
152
+ });
153
+
154
+ it('should release lock if acquired for a long time', function(done) {
155
+ lock.acquire('123', { lockTime: 10 }, function(err, release) {
156
+ should.not.exist(err);
157
+ lock.acquire('123', { waitTime: 1000 }, function(err, release) {
158
+ should.not.exist(err);
159
+ done();
160
+ });
161
+ });
162
+ });
163
+
164
+ it('should release lock if acquired for a long time (case 2)', function(done) {
165
+ // no releases
166
+ lock.acquire('123', { lockTime: 10 }, function(err, release) {
167
+ should.not.exist(err);
168
+ });
169
+
170
+ lock.acquire('123', { lockTime: 20 }, function(err, release) {
171
+ should.not.exist(err);
172
+ });
173
+ lock.acquire('123', { lockTime: 30 }, function(err, release) {
174
+ should.not.exist(err);
175
+ lock.acquire('123', { lockTime: 30 }, function(err, release) {
176
+ should.not.exist(err);
177
+ lock.acquire('123', { waitTime: 1000 }, function(err, release) {
178
+ should.not.exist(err);
179
+ done();
180
+ });
181
+ });
182
+ });
183
+ });
184
+
185
+
186
+ describe('#runLocked', () => {
187
+ it('should run a locked function', function(done) {
188
+ let called = 0;
189
+
190
+ function end() {
191
+ called++;
192
+ }
193
+
194
+ function task() {
195
+ setTimeout(() => {
196
+ expect(called).to.equal(0);
197
+ done();
198
+ }, 200);
199
+ }
200
+
201
+ lock.runLocked('123', {}, end, task);
202
+ });
203
+
204
+
205
+ it('should lock locked functions', function(done) {
206
+ let called = 0;
207
+
208
+ function end() {
209
+ called++;
210
+ expect(called).to.equal(1);
211
+ done();
212
+ }
213
+
214
+ function task() {
215
+ lock.runLocked('123', { waitTime: 100 }, end, () => {
216
+ setTimeout(() => {
217
+ }, 200);
218
+ });
219
+ }
220
+
221
+ lock.runLocked('123', {}, end, task);
222
+ });
223
+ });
224
+ });