@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,802 @@
1
+ import * as fs from 'fs';
2
+ import path from 'path';
3
+ import * as async from 'async';
4
+ import _ from 'lodash';
5
+ import 'source-map-support/register';
6
+ import Mustache from 'mustache';
7
+ import request from 'request';
8
+ import defaultRequest from 'request';
9
+ import sjcl from 'sjcl';
10
+ import config from '../config';
11
+ import { Common } from './common';
12
+ import logger from './logger';
13
+ import { MessageBroker } from './messagebroker';
14
+ import { INotification, IPreferences, Preferences } from './model';
15
+ import { Storage } from './storage';
16
+
17
+ const Utils = Common.Utils;
18
+ const Defaults = Common.Defaults;
19
+ const Constants = Common.Constants;
20
+
21
+ const PUSHNOTIFICATIONS_TYPES = {
22
+ NewCopayer: {
23
+ filename: 'new_copayer'
24
+ },
25
+ WalletComplete: {
26
+ filename: 'wallet_complete'
27
+ },
28
+ NewTxProposal: {
29
+ filename: 'new_tx_proposal'
30
+ },
31
+ NewOutgoingTx: {
32
+ filename: ['new_outgoing_tx', 'new_zero_outgoing_tx']
33
+ },
34
+ NewIncomingTx: {
35
+ filename: ['new_incoming_tx']
36
+ },
37
+ TxProposalFinallyRejected: {
38
+ filename: 'txp_finally_rejected'
39
+ },
40
+ TxConfirmation: {
41
+ filename: ['tx_confirmation_sender', 'tx_confirmation_receiver']
42
+ },
43
+ NewAddress: {
44
+ dataOnly: true
45
+ },
46
+ ScanFinished: {
47
+ dataOnly: true,
48
+ broadcastToActiveUsers: true
49
+ },
50
+ NewBlock: {
51
+ dataOnly: true,
52
+ broadcastToActiveUsers: true
53
+ },
54
+ TxProposalAcceptedBy: {
55
+ dataOnly: true
56
+ },
57
+ TxProposalFinallyAccepted: {
58
+ dataOnly: true
59
+ },
60
+ TxProposalRejectedBy: {
61
+ dataOnly: true
62
+ },
63
+ TxProposalRemoved: {
64
+ dataOnly: true
65
+ }
66
+ };
67
+
68
+ export interface IPushNotificationService {
69
+ templatePath: string;
70
+ defaultLanguage: string;
71
+ defaultUnit: string;
72
+ subjectPrefix: string;
73
+ pushServerUrl: string;
74
+ pushServerUrlBraze: string;
75
+ availableLanguages: string;
76
+ authorizationKey: string;
77
+ authorizationKeyBraze: string;
78
+ messageBroker: any;
79
+ }
80
+
81
+ export class PushNotificationsService {
82
+ request: request.RequestAPI<any, any, any>;
83
+ templatePath: string;
84
+ defaultLanguage: string;
85
+ defaultUnit: string;
86
+ subjectPrefix: string;
87
+ pushServerUrl: string;
88
+ pushServerUrlBraze: string;
89
+ availableLanguages: string;
90
+ authorizationKey: string;
91
+ authorizationKeyBraze: string;
92
+ storage: Storage;
93
+ messageBroker: any;
94
+
95
+ start(opts, cb) {
96
+ opts = opts || {};
97
+ this.request = opts.request || defaultRequest;
98
+
99
+ const _readDirectories = (basePath, cb) => {
100
+ fs.readdir(basePath, (err, files) => {
101
+ if (err) return cb(err);
102
+ async.filter(
103
+ files,
104
+ (file, next: (err: boolean) => void) => {
105
+ fs.stat(path.join(basePath, file), (err, stats) => {
106
+ return next(!err && stats.isDirectory());
107
+ });
108
+ },
109
+ dirs => {
110
+ return cb(null, dirs);
111
+ }
112
+ );
113
+ });
114
+ };
115
+
116
+ this.templatePath = path.normalize(
117
+ (opts.pushNotificationsOpts.templatePath || __dirname + '../../templates') + '/'
118
+ );
119
+ this.defaultLanguage = opts.pushNotificationsOpts.defaultLanguage || 'en';
120
+ this.defaultUnit = opts.pushNotificationsOpts.defaultUnit || 'btc';
121
+ this.subjectPrefix = opts.pushNotificationsOpts.subjectPrefix || '';
122
+ this.pushServerUrl = opts.pushNotificationsOpts.pushServerUrl;
123
+ this.authorizationKey = opts.pushNotificationsOpts.authorizationKey;
124
+ this.pushServerUrlBraze = opts.pushNotificationsOpts.pushServerUrlBraze;
125
+ this.authorizationKeyBraze = opts.pushNotificationsOpts.authorizationKeyBraze;
126
+
127
+ if (!this.authorizationKey && !this.authorizationKeyBraze)
128
+ return cb(new Error('Missing authorizationKey attribute in configuration.'));
129
+
130
+ async.parallel(
131
+ [
132
+ done => {
133
+ _readDirectories(this.templatePath, (err, res) => {
134
+ this.availableLanguages = res;
135
+ done(err);
136
+ });
137
+ },
138
+ done => {
139
+ if (opts.storage) {
140
+ this.storage = opts.storage;
141
+ done();
142
+ } else {
143
+ this.storage = new Storage();
144
+ this.storage.connect(opts.storageOpts, done);
145
+ }
146
+ },
147
+ done => {
148
+ this.messageBroker = opts.messageBroker || new MessageBroker(opts.messageBrokerOpts);
149
+ this.messageBroker.onMessage(_.bind(this._sendPushNotifications, this));
150
+ done();
151
+ }
152
+ ],
153
+ err => {
154
+ if (err) {
155
+ logger.error('ERROR:' + err);
156
+ }
157
+ return cb(err);
158
+ }
159
+ );
160
+ }
161
+
162
+ _sendPushNotifications(notification, cb) {
163
+ cb = cb || function() {};
164
+
165
+ const notifType = _.cloneDeep(PUSHNOTIFICATIONS_TYPES[notification?.type]);
166
+ if (!notifType) return cb();
167
+
168
+ if (notification.type === 'NewIncomingTx') {
169
+ notifType.filename = notifType.filename[0];
170
+ if (notification.data.network && notification.data.network !== 'mainnet') {
171
+ notification.data.networkStr = ' on ' + notification.data.network;
172
+ } else {
173
+ notification.data.networkStr = '';
174
+ }
175
+ } else if (notification.type === 'NewOutgoingTx') {
176
+ // Handle zero amount ETH transactions to contract addresses
177
+ notifType.filename = notification.data.amount !== 0 ? notifType.filename[0] : notifType.filename[1];
178
+ } else if (notification.type === 'TxConfirmation') {
179
+ if (notification.data && !notification.data.amount) {
180
+ // backward compatibility
181
+ notifType.filename = 'tx_confirmation';
182
+ } else {
183
+ notifType.filename = notification.isCreator ? notifType.filename[0] : notifType.filename[1];
184
+ }
185
+ }
186
+
187
+ logger.debug('Notification received: ' + notification.type);
188
+ logger.debug(JSON.stringify(notification));
189
+
190
+ this._checkShouldSendNotif(notification, (err, should) => {
191
+ if (err) return cb(err);
192
+
193
+ logger.debug('Should send notification: ' + should);
194
+ if (!should) return cb();
195
+
196
+ this._getRecipientsList(notification, notifType, (err, recipientsList) => {
197
+ if (err) return cb(err);
198
+
199
+ async.waterfall(
200
+ [
201
+ next => {
202
+ this._readAndApplyTemplates(notification, notifType, recipientsList, next);
203
+ },
204
+ (contents, next) => {
205
+ this._getSubscriptions(notification, notifType, recipientsList, contents, next);
206
+ },
207
+ (subs, next) => {
208
+ const notifications = _.map(subs, sub => {
209
+ if (notification.type === 'NewTxProposal' && sub.copayerId === notification.creatorId) return;
210
+
211
+ const tokenAddress =
212
+ notification.data && notification.data.tokenAddress ? notification.data.tokenAddress : null;
213
+ const multisigContractAddress =
214
+ notification.data && notification.data.multisigContractAddress
215
+ ? notification.data.multisigContractAddress
216
+ : null;
217
+
218
+ let notificationData: any;
219
+
220
+ const walletId = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(notification.walletId || sub.walletId));
221
+ const copayerId = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(sub.copayerId));
222
+ const notification_type = notification.type;
223
+ // chain and network are needed for NewBlock notifications
224
+ const chain = notification?.data?.chain || notification?.data?.coin;
225
+ const coin = chain; // backwards compatibility
226
+ const network = notification?.data?.network ? Utils.getNetworkName(chain, notification.data.network) : null;
227
+
228
+ if (sub.token) {
229
+ notificationData = {
230
+ to: sub.token,
231
+ priority: 'high',
232
+ restricted_package_name: sub.packageName,
233
+ data: {
234
+ walletId,
235
+ tokenAddress,
236
+ multisigContractAddress,
237
+ copayerId,
238
+ notification_type,
239
+ coin, // not really coin value it's chain
240
+ chain,
241
+ network
242
+ }
243
+ };
244
+
245
+ if (!notifType.dataOnly) {
246
+ notificationData.data.title = sub?.plain?.subject;
247
+ notificationData.data.body = sub?.plain?.body;
248
+ notificationData.notification = {
249
+ title: sub?.plain?.subject,
250
+ body: sub?.plain?.body,
251
+ sound: 'default',
252
+ click_action: 'FCM_PLUGIN_ACTIVITY',
253
+ icon: 'fcm_push_icon'
254
+ };
255
+ }
256
+ }
257
+
258
+ if (sub.externalUserId) {
259
+ const title = sub?.plain?.subject;
260
+ const body = sub?.plain?.body;
261
+ const extras = {
262
+ walletId,
263
+ copayerId,
264
+ notification_type,
265
+ coin, // not really coin value it's chain
266
+ chain,
267
+ network,
268
+ tokenAddress,
269
+ multisigContractAddress,
270
+ title,
271
+ body
272
+ };
273
+ const custom_uri = `bitpay://wallet?walletId=${walletId}&tokenAddress=${tokenAddress}&multisigContractAddress=${multisigContractAddress}&copayerId=${copayerId}&coin=${coin}&chain=${chain}&network=${network}&notification_type=${notification_type}&title=${title}&body=${body}`;
274
+ notificationData = {
275
+ external_user_ids: [sub.externalUserId],
276
+ messages: {
277
+ apple_push: {
278
+ alert: {
279
+ title,
280
+ body
281
+ },
282
+ extra: extras,
283
+ custom_uri
284
+ },
285
+ android_push: {
286
+ alert: body,
287
+ title,
288
+ extra: extras,
289
+ custom_uri
290
+ }
291
+ }
292
+ };
293
+ if (notifType.dataOnly) {
294
+ notificationData.messages.apple_push['content-available'] = true;
295
+ notificationData.messages.android_push['send_to_sync'] = true;
296
+ }
297
+ }
298
+ return notificationData;
299
+ });
300
+
301
+ if (
302
+ notifications &&
303
+ notifications[0] &&
304
+ notifications[0].notification &&
305
+ subs.length > Defaults.PUSH_NOTIFICATION_LIMIT
306
+ ) {
307
+ logger.warn(
308
+ `The recipient list for this push notification is greater than the established limit (${Defaults.PUSH_NOTIFICATION_LIMIT})`
309
+ );
310
+ }
311
+ return next(err, notifications);
312
+ },
313
+ (notifications, next) => {
314
+ async.each(
315
+ notifications,
316
+ (notification: any, next) => {
317
+ if (notification && notification.external_user_ids) {
318
+ this._makeBrazeRequest(notification, (err, response) => {
319
+ if (err) logger.error('An error occurred making a braze push notification request:' + err);
320
+ if (response) {
321
+ // logger.debug('Request status: ' + response.statusCode);
322
+ // logger.debug('Request message: ' + response.statusMessage);
323
+ // logger.debug('Request body: ' + response.request.body);
324
+ }
325
+ next();
326
+ });
327
+
328
+ // if external_user_ids is not set use old version firebase token
329
+ } else if (notification && notification.to) {
330
+ this._makeRequest(notification, (err, response) => {
331
+ if (err) logger.error('An error occurred making a firebase push notification request:' + err);
332
+ if (response) {
333
+ // logger.debug('Request status: ' + response.statusCode);
334
+ // logger.debug('Request message: ' + response.statusMessage);
335
+ // logger.debug('Request body: ' + response.request.body);
336
+ }
337
+ next();
338
+ });
339
+ }
340
+ },
341
+ err => {
342
+ return next(err);
343
+ }
344
+ );
345
+ }
346
+ ],
347
+ err => {
348
+ if (err) {
349
+ logger.error('An error ocurred generating notification:' + err);
350
+ }
351
+ return cb(err);
352
+ }
353
+ );
354
+ });
355
+ });
356
+ }
357
+
358
+ _checkShouldSendNotif(notification, cb) {
359
+ if (notification.type != 'NewTxProposal') return cb(null, true);
360
+ this.storage.fetchWallet(notification.walletId, (err, wallet) => {
361
+ return cb(err, wallet && wallet.m > 1);
362
+ });
363
+ }
364
+
365
+ _getRecipientsList(notification, notificationType, cb) {
366
+ if (notificationType.broadcastToActiveUsers) return cb(null, []);
367
+
368
+ this.storage.fetchWallet(notification.walletId, (err, wallet) => {
369
+ if (err) return cb(err);
370
+ if (!wallet) return cb(null, []);
371
+
372
+ let unit;
373
+ if (wallet.coin != Defaults.COIN) {
374
+ switch (wallet.coin) {
375
+ case 'pax':
376
+ unit = 'usdp'; // backwards compatibility
377
+ break;
378
+ default:
379
+ unit = wallet.coin;
380
+ }
381
+ }
382
+
383
+ this.storage.fetchPreferences<Preferences[]>(notification.walletId, null, (err, preferences) => {
384
+ if (err) logger.error('%o', err);
385
+ if (_.isEmpty(preferences)) preferences = [];
386
+
387
+ const recipientPreferences = _.compact(
388
+ _.map(preferences, p => {
389
+ if (!_.includes(this.availableLanguages, p.language)) {
390
+ if (p.language) logger.warn('Language for notifications "' + p.language + '" not available.');
391
+ p.language = this.defaultLanguage;
392
+ }
393
+
394
+ return {
395
+ copayerId: p.copayerId,
396
+ language: p.language || this.defaultLanguage,
397
+ unit: unit || p.unit || this.defaultUnit
398
+ };
399
+ })
400
+ );
401
+
402
+ const copayers = _.keyBy(recipientPreferences, 'copayerId');
403
+
404
+ const recipientsList = _.compact(
405
+ _.map(wallet.copayers, copayer => {
406
+ const p = copayers[copayer.id] || {
407
+ language: this.defaultLanguage,
408
+ unit: this.defaultUnit
409
+ };
410
+ return {
411
+ walletId: notification.walletId,
412
+ copayerId: copayer.id,
413
+ language: p.language || this.defaultLanguage,
414
+ unit: unit || p.unit || this.defaultUnit
415
+ };
416
+ })
417
+ );
418
+ return cb(null, recipientsList);
419
+ });
420
+ });
421
+ }
422
+
423
+ _readAndApplyTemplates(notification, notifType, recipientsList, cb) {
424
+ if (!notifType.filename) return cb(null, []);
425
+
426
+ async.map(
427
+ recipientsList,
428
+ (recipient: { language: string }, next) => {
429
+ async.waterfall(
430
+ [
431
+ next => {
432
+ this._getDataForTemplate(notification, recipient, next);
433
+ },
434
+ (data, next) => {
435
+ async.map(
436
+ ['plain', 'html'],
437
+ (type, next) => {
438
+ this._loadTemplate(notifType, recipient, '.' + type, (err, template) => {
439
+ if (err && type == 'html') return next();
440
+ if (err) return next(err);
441
+
442
+ this._applyTemplate(template, data, (err, res) => {
443
+ return next(err, [type, res]);
444
+ });
445
+ });
446
+ },
447
+ (err, res) => {
448
+ return next(err, _.fromPairs(res.filter(Boolean) as any[]));
449
+ }
450
+ );
451
+ },
452
+ (result, next) => {
453
+ next(null, result);
454
+ }
455
+ ],
456
+ (err, res) => {
457
+ next(err, [recipient.language, res]);
458
+ }
459
+ );
460
+ },
461
+ (err, res) => {
462
+ return cb(err, _.fromPairs(res.filter(Boolean) as any[]));
463
+ }
464
+ );
465
+ }
466
+
467
+ async _getDataForTemplate(notification: INotification, recipient, cb) {
468
+ const UNIT_LABELS = {
469
+ btc: 'BTC',
470
+ bit: 'bits',
471
+ bch: 'BCH',
472
+ eth: 'ETH',
473
+ matic: 'MATIC',
474
+ xrp: 'XRP',
475
+ doge: 'DOGE',
476
+ ltc: 'LTC',
477
+ usdc: 'USDC',
478
+ pyusd: 'PYUSD',
479
+ usdp: 'USDP',
480
+ gusd: 'GUSD',
481
+ busd: 'BUSD',
482
+ dai: 'DAI',
483
+ wbtc: 'WBTC',
484
+ shib: 'SHIB',
485
+ ape: 'APE',
486
+ euroc: 'EUROC',
487
+ usdt: 'USDT',
488
+ weth: 'WETH',
489
+ 'usdc.e': 'USDC.e',
490
+ sol: 'SOL'
491
+ };
492
+ const data = _.cloneDeep(notification.data);
493
+ data.subjectPrefix = _.trim(this.subjectPrefix + ' ');
494
+ if (data.amount) {
495
+ try {
496
+ let unit = recipient.unit.toLowerCase();
497
+ let label = UNIT_LABELS[unit];
498
+ const opts = {} as any;
499
+ if (data.tokenAddress) {
500
+ const tokenAddress = data.tokenAddress.toLowerCase();
501
+ if (Constants.ETH_TOKEN_OPTS[tokenAddress]) {
502
+ unit = Constants.ETH_TOKEN_OPTS[tokenAddress].symbol.toLowerCase();
503
+ label = UNIT_LABELS[unit];
504
+ } else if (Constants.MATIC_TOKEN_OPTS[tokenAddress]) {
505
+ unit = Constants.MATIC_TOKEN_OPTS[tokenAddress].symbol.toLowerCase();
506
+ label = UNIT_LABELS[unit];
507
+ } else if (Constants.ARB_TOKEN_OPTS[tokenAddress]) {
508
+ unit = Constants.ARB_TOKEN_OPTS[tokenAddress].symbol.toLowerCase();
509
+ label = UNIT_LABELS[unit];
510
+ } else if (Constants.OP_TOKEN_OPTS[tokenAddress]) {
511
+ unit = Constants.OP_TOKEN_OPTS[tokenAddress].symbol.toLowerCase();
512
+ label = UNIT_LABELS[unit];
513
+ } else if (Constants.BASE_TOKEN_OPTS[tokenAddress]) {
514
+ unit = Constants.BASE_TOKEN_OPTS[tokenAddress].symbol.toLowerCase();
515
+ label = UNIT_LABELS[unit];
516
+ } else if (Constants.SOL_TOKEN_OPTS[tokenAddress]) {
517
+ unit = Constants.SOL_TOKEN_OPTS[tokenAddress].symbol.toLowerCase();
518
+ label = UNIT_LABELS[unit];
519
+ } else {
520
+ let customTokensData;
521
+ let tokenData;
522
+ try {
523
+ customTokensData = await this.getTokenData(data.address.coin);
524
+ tokenData = customTokensData.find(t => t.address === tokenAddress);
525
+ } catch {
526
+ return cb(new Error('Could not get custom tokens data'));
527
+ }
528
+ if (tokenData) {
529
+ // check for eth tokens
530
+ unit = tokenData.symbol.toLowerCase();
531
+ label = unit.toUpperCase();
532
+ opts.toSatoshis = 10 ** tokenData.decimals;
533
+ opts.decimals = {
534
+ maxDecimals: 6,
535
+ minDecimals: 2
536
+ };
537
+ } else {
538
+ return cb(new Error(`Push notifications for unsupported tokens are not allowed: ${tokenAddress}`));
539
+ }
540
+ }
541
+ }
542
+ data.amount = Utils.formatAmount(+data.amount, unit, opts) + ' ' + label;
543
+ } catch (ex) {
544
+ return cb(new Error('Could not format amount' + ex));
545
+ }
546
+ }
547
+
548
+ this.storage.fetchWallet(notification.walletId, (err, wallet) => {
549
+ if (err || !wallet) return cb(err);
550
+
551
+ data.walletId = wallet.id;
552
+ data.walletName = wallet.name;
553
+ data.walletM = wallet.m;
554
+ data.walletN = wallet.n;
555
+
556
+ const copayer = wallet.copayers.find(c => c.id === notification.creatorId);
557
+ /*
558
+ *var copayer = _.find(wallet.copayers, {
559
+ * id: notification.creatorId
560
+ *});
561
+ */
562
+
563
+ if (copayer) {
564
+ data.copayerId = copayer.id;
565
+ data.copayerName = copayer.name;
566
+ }
567
+
568
+ if (notification.type == 'TxProposalFinallyRejected' && data.rejectedBy) {
569
+ const rejectors = _.map(data.rejectedBy, copayerId => {
570
+ return wallet.copayers.find(c => c.id === copayerId).name;
571
+ });
572
+ data.rejectorsNames = rejectors.join(', ');
573
+ }
574
+
575
+ return cb(null, data);
576
+ });
577
+ }
578
+
579
+ _applyTemplate(template, data, cb) {
580
+ if (!data) return cb(new Error('Could not apply template to empty data'));
581
+
582
+ let error;
583
+ const result = _.mapValues(template, t => {
584
+ try {
585
+ return Mustache.render(t, data);
586
+ } catch (e) {
587
+ logger.error('Could not apply data to template: %o', e);
588
+ error = e;
589
+ }
590
+ });
591
+
592
+ if (error) return cb(error);
593
+ return cb(null, result);
594
+ }
595
+
596
+ _loadTemplate(notifType, recipient, extension, cb) {
597
+ this._readTemplateFile(recipient.language, notifType.filename + extension, (err, template) => {
598
+ if (err) return cb(err);
599
+ return cb(null, this._compileTemplate(template, extension));
600
+ });
601
+ }
602
+
603
+ _readTemplateFile(language, filename, cb) {
604
+ const fullFilename = path.join(this.templatePath, language, filename);
605
+ fs.readFile(fullFilename, 'utf8', (err, template) => {
606
+ if (err) {
607
+ return cb(new Error('Could not read template file ' + fullFilename + err));
608
+ }
609
+ return cb(null, template);
610
+ });
611
+ }
612
+
613
+ _compileTemplate(template, extension) {
614
+ const lines = template.split('\n');
615
+ if (extension == '.html') {
616
+ lines.unshift('');
617
+ }
618
+ return {
619
+ subject: lines[0],
620
+ body: _.tail(lines).join('\n')
621
+ };
622
+ }
623
+
624
+ _getSubscriptions(notification, notifType, recipientsList, contents, cb) {
625
+ if (notifType.broadcastToActiveUsers) {
626
+ this.storage.fetchLatestPushNotificationSubs((err, subs) => {
627
+ if (err) return cb(err);
628
+
629
+ const allSubsWithToken = _.uniqBy(
630
+ _.reject(subs, sub => !sub.walletId || sub.externalUserId),
631
+ 'token'
632
+ );
633
+ const allSubsWithExternalId = _.uniqBy(
634
+ _.reject(subs, sub => !sub.walletId || sub.token),
635
+ 'externalUserId'
636
+ );
637
+ // if copayerid is associated to externalUserId use Braze subscriptions
638
+ // avoid multiple notifications
639
+ const allSubs = allSubsWithExternalId.length > 0 ? allSubsWithExternalId : allSubsWithToken;
640
+ const chainOrCoin = notification.data.chain || notification.data.coin;
641
+ const networkInfo = notification.data.network;
642
+ const hasChainNetworkInfo = chainOrCoin && networkInfo;
643
+ const chainNetworkMessage = hasChainNetworkInfo ? ` [${chainOrCoin}/${networkInfo}]` : '';
644
+
645
+ logger.info(
646
+ `Sending ${notification.type}${chainNetworkMessage} notifications to: ${allSubs.length} devices`
647
+ );
648
+ return cb(null, allSubs);
649
+ });
650
+ } else {
651
+ async.map(
652
+ recipientsList,
653
+ (recipient: IPreferences, next) => {
654
+ const content = contents ? contents[recipient.language] : null;
655
+
656
+ this.storage.fetchPushNotificationSubs(recipient.copayerId, (err, subs) => {
657
+ if (err) return next(err);
658
+
659
+ const subscriptions = subs && subs.length ? subs.map(obj => ({ ...obj, plain: content?.plain })) : subs;
660
+ const allSubsWithToken = _.uniqBy(
661
+ _.reject(subscriptions, sub => !sub.walletId || sub.externalUserId),
662
+ 'token'
663
+ );
664
+ const allSubsWithExternalId = _.uniqBy(
665
+ _.reject(subscriptions, sub => !sub.walletId || sub.token),
666
+ 'externalUserId'
667
+ );
668
+ // if copayerid is associated to externalUserId use Braze subscriptions
669
+ // avoid multiple notifications
670
+ const allSubs = allSubsWithExternalId.length > 0 ? allSubsWithExternalId : allSubsWithToken;
671
+ return next(err, allSubs);
672
+ });
673
+ },
674
+ (err, allSubs) => {
675
+ if (err) return cb(err);
676
+ return cb(null, _.flatten(allSubs));
677
+ }
678
+ );
679
+ }
680
+ }
681
+
682
+ _makeRequest(opts, cb) {
683
+ this.request(
684
+ {
685
+ url: this.pushServerUrl + '/send',
686
+ method: 'POST',
687
+ json: true,
688
+ headers: {
689
+ 'Content-Type': 'application/json',
690
+ Authorization: 'key=' + this.authorizationKey
691
+ },
692
+ body: opts
693
+ },
694
+ cb
695
+ );
696
+ }
697
+
698
+ _makeBrazeRequest(opts, cb) {
699
+ this.request(
700
+ {
701
+ url: this.pushServerUrlBraze + '/messages/send',
702
+ method: 'POST',
703
+ json: true,
704
+ headers: {
705
+ 'Content-Type': 'application/json',
706
+ Authorization: 'Bearer ' + this.authorizationKeyBraze
707
+ },
708
+ body: opts
709
+ },
710
+ cb
711
+ );
712
+ }
713
+
714
+ private coinGeckoGetCredentials() {
715
+ if (!config.coinGecko) throw new Error('coinGecko missing credentials');
716
+
717
+ const credentials = {
718
+ API: config.coinGecko.api,
719
+ API_KEY: config.coinGecko.apiKey,
720
+ };
721
+
722
+ return credentials;
723
+ }
724
+
725
+ getTokenData(chain: string): Promise<Array<{
726
+ chainId: number;
727
+ address: string;
728
+ symbol: string;
729
+ name: string;
730
+ decimals: number;
731
+ logoURI: string;
732
+ }>> {
733
+ return new Promise((resolve, reject) => {
734
+ const cacheKey = `cgTokenList:${chain}`;
735
+ const credentials = this.coinGeckoGetCredentials();
736
+
737
+ this.storage.checkAndUseGlobalCache(cacheKey, Defaults.COIN_GECKO_CACHE_DURATION, (err, values, oldvalues) => {
738
+ if (err) logger.warn('Cache check failed', err);
739
+ if (values) return resolve(values);
740
+
741
+ const assetPlatformMap = {
742
+ eth: 'ethereum',
743
+ matic: 'polygon-pos',
744
+ pol: 'polygon-pos',
745
+ arb: 'arbitrum-one',
746
+ base: 'base',
747
+ op: 'optimistic-ethereum',
748
+ sol: 'solana',
749
+ };
750
+
751
+ const assetId = assetPlatformMap[chain];
752
+ if (!assetId) return reject(new Error(`Unsupported chain '${chain}'`));
753
+
754
+ const URL: string = `${credentials.API}/v3/token_lists/${assetId}/all.json`;
755
+ const headers = {
756
+ 'Content-Type': 'application/json',
757
+ 'Accept': 'application/json',
758
+ 'x-cg-pro-api-key': credentials.API_KEY
759
+ };
760
+
761
+ this.request.get(
762
+ URL,
763
+ {
764
+ headers,
765
+ json: true
766
+ },
767
+ (err, data) => {
768
+ const tokens = data?.body?.tokens;
769
+ const status = data?.body?.status;
770
+ if (err) {
771
+ logger.warn('An error occured while retrieving the token list', err);
772
+ if (oldvalues) {
773
+ logger.warn('Using old cached values');
774
+ return resolve(oldvalues);
775
+ }
776
+ return reject(err.body ?? err);
777
+ } else if (status?.error_code === 429 && oldvalues) {
778
+ return resolve(oldvalues);
779
+ } else {
780
+ if (!tokens) {
781
+ if (oldvalues) {
782
+ logger.warn('No token list available... using old cached values');
783
+ return resolve(oldvalues);
784
+ }
785
+ return reject(new Error(`Could not get tokens list. Code: ${status?.error_code}. Error: ${status?.error_message || 'Unknown error'}`));
786
+ }
787
+ const updatedTokens = tokens.map(token => {
788
+ if (token.logoURI?.includes('/thumb/')) {
789
+ token.logoURI = token.logoURI.replace('/thumb/', '/large/');
790
+ }
791
+ return token;
792
+ });
793
+ this.storage.storeGlobalCache(cacheKey, updatedTokens, storeErr => {
794
+ if (storeErr) logger.warn('Could not cache token list', storeErr);
795
+ return resolve(updatedTokens);
796
+ });
797
+ }
798
+ });
799
+ });
800
+ });
801
+ }
802
+ }