DERO Web Wallet html/JS source. derowallet.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1095 lines
72KB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <!-- Required meta tags -->
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. <!-- Bootstrap CSS -->
  8. <link rel="stylesheet" href="/static/deps/bootstrap.min.css">
  9. <link rel="stylesheet" href="/static/deps/main.css" type="text/css">
  10. <link rel="stylesheet" href="/static/deps/style.css" type="text/css" title="blackTheme">
  11. <link rel="alternate stylesheet" href="/static/deps/style_white.css" type="text/css" title="whiteTheme" disabled>
  12. <title>DERO Web Wallet</title>
  13. <script src="/static/wasm_exec.js"></script>
  14. <link href="/static/deps/tabulator.min.css" rel="stylesheet">
  15. <link rel="apple-touch-icon" sizes="57x57" href="/static/favicon/apple-icon-57x57.png">
  16. <link rel="apple-touch-icon" sizes="60x60" href="/static/favicon/apple-icon-60x60.png">
  17. <link rel="apple-touch-icon" sizes="72x72" href="/static/favicon/apple-icon-72x72.png">
  18. <link rel="apple-touch-icon" sizes="76x76" href="/static/favicon/apple-icon-76x76.png">
  19. <link rel="apple-touch-icon" sizes="114x114" href="/static/favicon/apple-icon-114x114.png">
  20. <link rel="apple-touch-icon" sizes="120x120" href="/static/favicon/apple-icon-120x120.png">
  21. <link rel="apple-touch-icon" sizes="144x144" href="/static/favicon/apple-icon-144x144.png">
  22. <link rel="apple-touch-icon" sizes="152x152" href="/static/favicon/apple-icon-152x152.png">
  23. <link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-icon-180x180.png">
  24. <link rel="icon" type="image/png" sizes="192x192" href="/static/favicon/android-icon-192x192.png">
  25. <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon/favicon-32x32.png">
  26. <link rel="icon" type="image/png" sizes="96x96" href="/static/favicon/favicon-96x96.png">
  27. <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon/favicon-16x16.png">
  28. <link rel="manifest" href="/static/favicon/manifest.json">
  29. </head>
  30. <body>
  31. <div id="loader-wrapper">
  32. <div id="loader"></div>
  33. <div class="loader-section section-left"></div>
  34. <div class="loader-section section-right"></div>
  35. </div>
  36. <div class="col d-flex align-items-center justify-content-center pl-0 pr-5" id="header">
  37. <div class="row ml-0">
  38. <div class="col-lg-4 col-md-4 col-sm-12 text-center align-self-center">
  39. <div class="row">
  40. <div class="col-lg-6 col-md-12 col-sm-12 logo">
  41. <a href="https://dero.io" target="_blank">
  42. <img src="/static/logo.png" alt="Logo" height="30">
  43. </a>
  44. </div>
  45. <div class="pl-0 col-lg-3 col-md-12 col-sm-12 title">
  46. <span>DERO</span>
  47. <span data-i18n="tr_wallet">Wallet</span>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="col-lg-8 col-md-8 col-sm-12">
  52. <div class="row">
  53. <div class="col-lg-10 col-md-8 col-12">
  54. <div class="row wallet-online">
  55. <div class="col-lg-2 wallet_local_name d-flex justify-content-center">
  56. My_wallet
  57. </div>
  58. <div class="col-lg-7 align-self-center">
  59. <p id="header_address" class="no-m o-h wallet_address clipboard" data-clipboard-action="copy" data-clipboard-target="#header_address">
  60. Loremipsumdolor,sitametconsecteturadipisicingelit...
  61. </p>
  62. </div>
  63. <div class="col-lg-2 d-flex justify-content-center">
  64. <!--<button class="btn btn-b-2 btn-sm btn-copy" data-clipboard-action="copy" data-clipboard-target="#wallet_address_id">
  65. Copy
  66. </button>-->
  67. <p class="no-m">
  68. <button class="btn btn-b-3 btn-sm btn-logout" data-i18n="control_wallet_logout" onClick="promiseWorker.postMessage({cmd:'close_wallet',id:secretid});">
  69. LogOut
  70. </button>
  71. </p>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="d-flex align-items-center p-0 m-0" id="myBlockTheme">
  76. <div id="blackTheme"></div>
  77. <div id="whiteTheme"></div>
  78. </div>
  79. <div class="col-lg-1 col-md-3 col-12 text-center">
  80. <p class="no-m">
  81. <select class="selectpicker mr-sm-2 btn btn-b-2 btn-lang btn-sm" data-width="fit" id="language_picker">
  82. <option class="lang" data-content='<span class="flag-icon flag-icon-us"></span> English' data-lang="en">English</option>
  83. </select>
  84. </p>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <!-- show menu to create/open wallet -->
  91. <div class="p-0 container-fluid d-flex justify-content-between" id="content">
  92. <div class="col-lg-2 col-md-4 col-sm-12 aside pt-5">
  93. <div class="wallet-closed">
  94. <div class="row no-gutters justify-content-center d-flex flex-column">
  95. <ul class="nav flex-column">
  96. <li class="active"><a data-toggle="tab" href="#recoverWallet" class="btn btn-b-2 btn-block btn-radius active" data-i18n="recover_wallet">
  97. Recover wallet
  98. </a>
  99. </li>
  100. <li><a data-toggle="tab" href="#createWallet" class="btn btn-b-2 btn-block btn-radius" data-i18n="front_create_new_wallet">
  101. Create new wallet
  102. </a>
  103. </li>
  104. <li>
  105. <a href="https://dero.io/" target="_blank" class="btn btn-b-2 btn-block btn-radius">DERO Project</a>
  106. </li>
  107. </ul>
  108. </div>
  109. </div>
  110. <div class="wallet-online">
  111. <div class="justify-content-center d-flex flex-column col-12">
  112. <ul class="dash">
  113. <li>
  114. <button href="#" class="btn btn-sm btn-set float-right" onclick="
  115. var x = function() { $('#ModalSettings').modal('show');};verify_password_action( x);"><span>&#x2699;&nbsp;</span><span data-i18n="control_wallet_settings"> Settings</span>
  116. </button>
  117. </li>
  118. <li>
  119. <br>
  120. <br>
  121. </li>
  122. <li class="text-white"><span data-i18n="balance_total"> Total </span> :</li>
  123. <li class="text-white">
  124. <strong><span class="total_balance"></span></strong>
  125. </li>
  126. <li class="text-s-gray"><span data-i18n="balance_locked">Locked</span> :</li>
  127. <li class="text-muted"><span class="locked_balance"></span></li>
  128. <li class="text-s-gray"><span data-i18n="balance_unlocked">Unlocked</span> :</li>
  129. <li class="text-muted"><span class="unlocked_balance"></span></li>
  130. <li class="text-s-gray"><span data-i18n="daemon_address">Daemon Address</span> :</li>
  131. <li class="text-muted"><span class="wallet_daemon_address"></span></li>
  132. <li class="text-s-gray"><span data-i18n="blockchain_height">Blockchain Height</span> :</li>
  133. <li class="text-muted">
  134. <span id="blockchain_height_stats" class="text-danger">
  135. <span class="wallet_topo_height"></span>/<span class="daemon_topo_height"></span>
  136. </span>
  137. </li>
  138. </ul>
  139. <br>
  140. <ul class="nav flex-column">
  141. <li class="active"><a data-toggle="tab" data-i18n="tab_send" href="#send" class="btn btn-b-2 btn-block btn-radius active">SEND</a></li>
  142. <li><a data-toggle="tab" data-i18n="tab_receive" href="#receive" class="btn btn-b-2 btn-block btn-radius">RECEIVE</a></li>
  143. <li><a data-toggle="tab" data-i18n="tab_history" href="#history" class="btn btn-b-2 btn-block btn-radius">TX HISTORY</a></li>
  144. <li><a data-toggle="tab" data-i18n="tab_about" href="#about" class="btn btn-b-2 btn-block btn-radius">ABOUT</a></li>
  145. </ul>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="col-lg-10 col-md-8 col-sm-12 row d-flex flex-row m-0">
  150. <div class="row wallet-closed ml-0 align-items-start justify-content-center col-12">
  151. <div class="col-lg-10 col-md-8 col-sm-12 wrap pt-5 paside">
  152. <div id="id_wallet_can_run" class="text-center">
  153. <h3 data-i18n="no_wasm">Please restart or upgrade your browser to run DERO web wallet.</h3>
  154. </div>
  155. <div class="row">
  156. <div class="col-sm-12 text-center">
  157. <div class="tab-content">
  158. <!-- Recover Wallet Tabs-->
  159. <div id="recoverWallet" class="tab-pane fade in active show">
  160. <h2 class="text-white">
  161. <div data-i18n="tr_title">
  162. Recover your wallet
  163. </div>
  164. </h2>
  165. <div class="row justify-content-center">
  166. <div class="col-sm-12 col-md-8 col-lg-6">
  167. <div id="local_wallet_list_present">
  168. <hr>
  169. <div class="form-group" ida="local_wallet_list_present">
  170. <label class="text-white" for="local_wallet_list_select" data-i18n="front_available_wallet"></label>
  171. <select class="selectpicker btn btn-b-2 w100 btn-lang btn-sm" data-width="fit" id="local_wallet_list_select"></select>
  172. </div>
  173. <div class="btn-toolbar justify-content-between" role="toolbar" aria-label="Toolbar with button groups">
  174. <button class="btn btn-b-5 btn-radius btn-success" data-i18n="front_open_saved_wallet" id="open_saved_wallet_button" onClick="open_saved_wallet();">Open Selected wallet</button>
  175. <button class="btn btn-b-3 btn-radius btn-danger" data-i18n="front_delete_saved_wallet" onClick="delete_saved_wallet();">Delete Selected Wallet</button>
  176. </div>
  177. <hr>
  178. </div>
  179. <button class="btn btn-b-3 btn-block btn-radius" data-i18n="front_recover_seed_wallet" data-toggle="modal" data-target="#ModalRecoverSeedWords">
  180. Using <strong>SEED</strong> word (25 words)
  181. </button>
  182. <button href="#" class="btn btn-b-3 btn-block btn-radius" data-i18n="front_recover_key_wallet" data-toggle="modal" data-target="#ModalRecoverKey">
  183. Using Recovery <strong>key</strong> (64 hex char)
  184. </button>
  185. <button id="btn_wallet_disk_file" href="#" class="btn btn-b-3 btn-block btn-radius" data-i18n="front_upload_wallet">
  186. Upload wallet <strong>from Disk</strong>
  187. </button>
  188. <div class="form-group my-3" style="display: none;">
  189. <input type="file" id="wallet_disk_file" name="selected_files[]" />
  190. </div>
  191. <br>
  192. <button href="#" class="btn btn-b-2 btn-block btn-radius" data-i18n="front_recover_view_wallet" data-toggle="modal" data-target="#ModalRecoverViewKey">
  193. View only
  194. </button>
  195. </div>
  196. </div>
  197. <div class="row">
  198. <div class="col-md-3 col-lg-4"></div>
  199. <div class="col-sm-12 col-md-6 col-lg-4">
  200. </div>
  201. <div class="col-md-3 col-lg-4"></div>
  202. </div>
  203. </div>
  204. <!-- Create Wallet -->
  205. <div id="createWallet" class="tab-pane fade">
  206. <h2 class="text-white">
  207. <div data-i18n="create_new_title">
  208. Create new wallet
  209. </div>
  210. </h2>
  211. <div class="row justify-content-center">
  212. <div class="col-sm-12 col-md-8 col-lg-6">
  213. <div class="form-group">
  214. <label for="i_new_wallet_name" data-i18n="wallet_name">Wallet Name</label>
  215. <input type="text" class="form-control form-b" id="i_new_wallet_name" data-i18n="[placeholder]wallet_name_quick_placeholder" required>
  216. </div>
  217. <div class="form-group">
  218. <label for="i_new_wallet_pwd" data-i18n="tr_password">Password:</label>
  219. <input type="password" class="form-control form-b" id="i_new_wallet_pwd" data-i18n="[placeholder]password_placeholder" required placeholder="Password" oninput="verify_same_password(i_new_wallet_pwd,i_new_wallet_cpwd);">
  220. </div>
  221. <div class="form-group">
  222. <label for="i_new_wallet_cpwd" data-i18n="cpassword">Confirm Password:</label>
  223. <input type="password" class="form-control form-b" data-i18n="[placeholder]cpassword_placeholder" placeholder="Confirm Password" required id="i_new_wallet_cpwd" oninput="verify_same_password(i_new_wallet_pwd,i_new_wallet_cpwd);">
  224. </div>
  225. <br>
  226. <button class="btn btn-b-2 w-b btn-block btn-radius" data-i18n="create_new" onClick="Create_New_Wallet();">
  227. Create New Wallet
  228. </button>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. <div class="row wallet-online ml-0 align-items-start justify-content-center col-12">
  238. <div class="col-lg-10 col-md-8 col-sm-12 wrap p-top25">
  239. <div class="row">
  240. <div class="col-sm-12">
  241. <div class="row online justify-content-center">
  242. <div class="col-md-8 col-lg-4">
  243. <button id="button_online_offline" class="btn btn-b-4 btn-block btn-radius btn-warning" onclick="toggle_online_offline();">
  244. WALLET IS ONLINE ˅
  245. </button>
  246. </div>
  247. </div>
  248. <div class="tab-content">
  249. <!-- Send Tabs-->
  250. <div id="send" class="tab-pane fade in active show">
  251. <h2 class="text-white text-center">
  252. <div data-i18n="tab_send_sendto_label">
  253. Send to DERO Address.
  254. </div>
  255. </h2>
  256. <div class="row">
  257. <div class="col-md-2 col-lg-3"></div>
  258. <div class="col-sm-12 col-md-8 col-lg-6 text-center">
  259. <p class="text-gray">
  260. Please note that sending to another address is irreversible.
  261. </p>
  262. <br>
  263. </div>
  264. <div class="col-md-2 col-lg-3"></div>
  265. </div>
  266. <div class="row justify-content-center">
  267. <div class="col-sm-12 col-md-8 col-lg-6">
  268. <div class="form-group">
  269. <label for="address" data-i18n="tab_send_sendto_label">Recipient wallet address</label> :
  270. <span class="badge badge-info pl-1" id="go" onclick="StartReadingQRCode();">
  271. <svg height="20px" width="20px" enable-background="new 0 0 401.994 401.994" version="1.1" viewBox="0 0 401.994 401.994" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
  272. <path d="m0 401.99h182.72v-182.73h-182.72v182.73zm36.542-146.18h109.64v109.35h-109.64v-109.35z"/>
  273. <rect x="73.089" y="292.36" width="36.544" height="36.549"/>
  274. <rect x="292.35" y="365.45" width="36.553" height="36.545"/>
  275. <rect x="365.44" y="365.45" width="36.552" height="36.545"/>
  276. <polygon points="365.45 255.81 328.9 255.81 328.9 219.26 219.26 219.26 219.26 401.99 255.81 401.99 255.81 292.36 292.35 292.36 292.35 328.9 401.99 328.9 401.99 219.26 401.99 219.26 365.45 219.26"/>
  277. <path d="M0,182.728h182.724V0H0V182.728z M36.542,36.542h109.636v109.636H36.542V36.542z"/>
  278. <rect x="73.089" y="73.089" width="36.544" height="36.547"/>
  279. <path d="m219.26 0v182.73h182.73v-182.73h-182.73zm146.18 146.18h-109.63v-109.64h109.63v109.64z"/>
  280. <rect x="292.35" y="73.089" width="36.553" height="36.547"/>
  281. </svg>
  282. </span>
  283. <input id="send_to_address" type="text" class="form-control form-b" oninput="growtextarea('send_to_address');validate_dero_address();" onchange="growtextarea('send_to_address');validate_dero_address();" required data-i18n="[placeholder]tab_send_sendto_address_placeholder">
  284. <div id="qr_code_reader_div" style="display:none;">
  285. <div class="select">
  286. <label for="videoSource">Video source: </label><select id="videoSource"></select>
  287. </div>
  288. <button onclick="stop_camera_now();">Stop QRcode</button>
  289. <div>
  290. <video style="display: inline-flex; " muted autoplay id="video" playsinline="true"></video>
  291. <canvas id="pcCanvas" width="320" height="320" style="display: none; float: bottom;"></canvas>
  292. <canvas id="mobileCanvas" width="240" height="320" style="display: none; float: bottom;"></canvas>
  293. </div>
  294. </div>
  295. </div>
  296. <div class="form-group">
  297. <label for="amout" data-i18n="tab_send_amount_label">Amount of DERO to send:</label>
  298. <input type="text" class="form-control form-b" oninput="validate_dero_amount();" id="send_to_amount" required data-i18n="[placeholder]tab_send_amount_placeholder">
  299. </div>
  300. <div class="form-group">
  301. <label for="payid" data-i18n="tab_send_paymentid_label">Payment ID (optional):</label>
  302. <input type="text" class="form-control form-b" oninput="validate_dero_paymentid();" id="send_to_paymentid" data-i18n="[placeholder]tab_send_paymentid_placeholder">
  303. </div>
  304. <br>
  305. <button class="btn btn-b-2 w-b btn-block btn-radius" data-i18n="tab_send_send_transaction" onClick="wallet_send_transaction();">
  306. SEND TRANSACTION
  307. </button>
  308. </div>
  309. </div>
  310. </div>
  311. <!--Receive tabs-->
  312. <div id="receive" class="tab-pane fade">
  313. <h2 class="text-white text-center">
  314. <div data-i18n="tab_receive_wallet_address">
  315. Wallet Address
  316. </div>
  317. </h2>
  318. <div class="row justify-content-center">
  319. <div class="col-sm-12 col-md-8 col-lg-6">
  320. <div class="form-group">
  321. <label data-i18n="tab_receive_wallet_address">Wallet Address</label>
  322. <span class="badge badge-light clipboard pl-1" data-clipboard-action="copy" data-clipboard-target="#wallet_address_id">
  323. <svg height="20px" width="20px" enable-background="new 0 0 561 561" version="1.1" viewBox="0 0 561 561" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
  324. <path d="m395.25 0h-306c-28.05 0-51 22.95-51 51v357h51v-357h306v-51zm76.5 102h-280.5c-28.05 0-51 22.95-51 51v357c0 28.05 22.95 51 51 51h280.5c28.05 0 51-22.95 51-51v-357c0-28.05-22.95-51-51-51zm0 408h-280.5v-357h280.5v357z"/>
  325. </svg>
  326. </span>
  327. <span class="badge badge-info ml-2" onClick="$('#ModalQRCode').modal('show'); qrcode.clear(); qrcode_title.value=wallet_address;
  328. qrcode.makeCode(wallet_address);qrcode_title.innerHTML=wallet_address;">
  329. <svg height="20px" width="20px" enable-background="new 0 0 401.994 401.994" version="1.1" viewBox="0 0 401.994 401.994" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
  330. <path d="m0 401.99h182.72v-182.73h-182.72v182.73zm36.542-146.18h109.64v109.35h-109.64v-109.35z"/>
  331. <rect x="73.089" y="292.36" width="36.544" height="36.549"/>
  332. <rect x="292.35" y="365.45" width="36.553" height="36.545"/>
  333. <rect x="365.44" y="365.45" width="36.552" height="36.545"/>
  334. <polygon points="365.45 255.81 328.9 255.81 328.9 219.26 219.26 219.26 219.26 401.99 255.81 401.99 255.81 292.36 292.35 292.36 292.35 328.9 401.99 328.9 401.99 219.26 401.99 219.26 365.45 219.26"/>
  335. <path d="M0,182.728h182.724V0H0V182.728z M36.542,36.542h109.636v109.636H36.542V36.542z"/>
  336. <rect x="73.089" y="73.089" width="36.544" height="36.547"/>
  337. <path d="m219.26 0v182.73h182.73v-182.73h-182.73zm146.18 146.18h-109.63v-109.64h109.63v109.64z"/>
  338. <rect x="292.35" y="73.089" width="36.553" height="36.547"/>
  339. </svg>
  340. </span>
  341. <input id="wallet_address_id" type="text" class="form-control form-b wallet_address" readonly>
  342. </div>
  343. <div class="form-group">
  344. <label data-i18n="tab_receive_i32_address">Integrated 32 Address</label>
  345. <span class="badge badge-light clipboard" data-clipboard-action="copy" data-clipboard-target="#random_i32_address_id">
  346. <svg height="20px" width="20px" enable-background="new 0 0 561 561" version="1.1" viewBox="0 0 561 561" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
  347. <path d="m395.25 0h-306c-28.05 0-51 22.95-51 51v357h51v-357h306v-51zm76.5 102h-280.5c-28.05 0-51 22.95-51 51v357c0 28.05 22.95 51 51 51h280.5c28.05 0 51-22.95 51-51v-357c0-28.05-22.95-51-51-51zm0 408h-280.5v-357h280.5v357z"/>
  348. </svg>
  349. </span>
  350. <span class="badge badge-info ml-2" onClick="$('#ModalQRCode').modal('show'); qrcode.clear(); qrcode.makeCode(random_i32_address);qrcode_title.innerHTML=random_i32_address;">
  351. <svg height="20px" width="20px" enable-background="new 0 0 401.994 401.994" version="1.1" viewBox="0 0 401.994 401.994" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
  352. <path d="m0 401.99h182.72v-182.73h-182.72v182.73zm36.542-146.18h109.64v109.35h-109.64v-109.35z"/>
  353. <rect x="73.089" y="292.36" width="36.544" height="36.549"/>
  354. <rect x="292.35" y="365.45" width="36.553" height="36.545"/>
  355. <rect x="365.44" y="365.45" width="36.552" height="36.545"/>
  356. <polygon points="365.45 255.81 328.9 255.81 328.9 219.26 219.26 219.26 219.26 401.99 255.81 401.99 255.81 292.36 292.35 292.36 292.35 328.9 401.99 328.9 401.99 219.26 401.99 219.26 365.45 219.26"/>
  357. <path d="M0,182.728h182.724V0H0V182.728z M36.542,36.542h109.636v109.636H36.542V36.542z"/>
  358. <rect x="73.089" y="73.089" width="36.544" height="36.547"/>
  359. <path d="m219.26 0v182.73h182.73v-182.73h-182.73zm146.18 146.18h-109.63v-109.64h109.63v109.64z"/>
  360. <rect x="292.35" y="73.089" width="36.553" height="36.547"/>
  361. </svg>
  362. </span>
  363. <input id="random_i32_address_id" type="text" class="form-control form-b random_i32_address" readonly>
  364. </div>
  365. <div class="form-group">
  366. <label data-i18n="tab_receive_i32_paymentid">Integrated 32 Address Payment ID</label>
  367. <input type="text" class="form-control form-b random_i32_address_paymentid" readonly>
  368. </div>
  369. <!-- Currently these are not displayed
  370. <h5> <span data-i18n="tab_receive_i8_address" >Integrated 8 Address </span> :</h5>
  371. <div class="mb-2 bg-secondary text-white">
  372. <div class="d-inline random_i8_address"></div>
  373. </div>
  374. <h6> <span data-i18n="tab_receive_i8_paymentid" > Integrated 8 Address Payment ID</span>:</h6>
  375. <div class="mb-2 bg-secondary text-white">
  376. <div class="d-inline random_i8_address_paymentid"></div>
  377. </div>
  378. -->
  379. <div class="form-group">
  380. <button class="btn btn-b-2 btn-block btn-radius" data-i18n="tab_receive_generate" onClick="promiseWorker.postMessage({cmd:'generate_integrated_address',id:secretid});">Generate Integrated address</button>
  381. </div>
  382. </div>
  383. </div>
  384. </div>
  385. <!-- History tabs -->
  386. <div id="history" class="tab-pane fade">
  387. <div class="d-flex justify-content-center">
  388. <div class="d-inline-flex justify-content-center ">
  389. <button type="button" class="btn btn-b-2 btn-radius" onClick='update_tx_history();' data-i18n="tab_history_load">Load TX history</button>
  390. <button type="button" class="btn btn-b-2 btn-radius" onClick='txtable.download("csv", "data.csv", {delimiter:","});' data-i18n="tab_history_export_csv">Export to CSV</button>
  391. </div>
  392. </div>
  393. <!-- hold transaction table -->
  394. <div id="txtable" class="text-monospace"></div>
  395. </div>
  396. <!-- About tabs -->
  397. <div id="about" class="tab-pane fade">
  398. <h2 class="text-white text-center">
  399. <div data-i18n="tr_DERO">
  400. DERO
  401. </div>
  402. </h2>
  403. <div class="row justify-content-center">
  404. <div class="col-sm-12 col-md-8 col-lg-6">
  405. <p class="text-gray">DERO is decentralized DAG (Directed Acyclic Graph) based blockchain with enhanced reliability, privacy, security and usability.DERO is industry leading and the first blockchain to have bulletproofs, TLS encrypted
  406. network.
  407. </p>
  408. <p class="text-gray">DERO blockchain has the following salient features :</p>
  409. <ul class="text-gray">
  410. <li><span><strong>Extremely fast:</strong> 12 seconds transfer time</span></li>
  411. <li><span><strong>Fast Confirmation:</strong> 2 minutes</span></li>
  412. <li><span><strong>Bulletproofs:</strong> Zero Knowledge Range Proofs (NIZK). No one knows who spent what.</span></li>
  413. <li><span><strong>Ring Signatures:</strong>:No one know who spent when and where.</span></li>
  414. <li><span><strong>SSl/TLS P2P encrypted network</strong></span></li>
  415. <li><span><strong>CryptoNote: Fully encrypted blockchain</strong></span></li>
  416. <li><span><strong>Fully Auditable Supply</strong></span></li>
  417. <li><span><strong>DAG Based:</strong> No orphans, no soft forks</span></li>
  418. <li><span><strong>DERO blockchain is written from scratch in Golang.</strong></span></li>
  419. <li><span><strong>Developed and maintained by original developers.</strong></span></li>
  420. </ul>
  421. <span class="text-center text-gray" style="width: 100%">Please visit <a href="https://dero.io">https://dero.io</a> for more information.</span>
  422. </div>
  423. </div>
  424. </div>
  425. </div>
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. <!-- Footer -->
  431. <div class="row ml-0 align-items-end justify-content-center col-12">
  432. <div class="wrap text-center">
  433. <hr>
  434. <div class="text-secondary">DERO Web wallet is alpha software.</div>
  435. <div class="text-secondary"><span>Core Wallet Version: </span><span class="wallet_version_string"></span><span> &nbsp; UI Version: 0.0.0 </span></div>
  436. <div class="text-secondary">Copyright DERO project </div>
  437. <div class="text-secondary">This project is covered by DERO license.</div>
  438. <div class="text-primary"> <a href="https://dero.io">https://dero.io</a></div>
  439. </div>
  440. </div>
  441. </div>
  442. </div>
  443. <!-- below are all the models used for various views -->
  444. <!-- this model is used to confirm transaction -->
  445. <div class="modal fade" id="ModalConfirmTX">
  446. <div class="modal-dialog modal-dialog-centered modal-lg">
  447. <div class="modal-content">
  448. <!-- Modal Header -->
  449. <div class="modal-header">
  450. <h4 class="modal-title text-center" data-i18n="tx_confirmation">Transfer Confirmation</h4>
  451. <button type="button" class="close" data-dismiss="modal">&times;</button>
  452. </div>
  453. <!-- Modal body -->
  454. <div class="modal-body">
  455. <div class="form-group">
  456. <label style="display:none;" id="transfer_txhex"> </label>
  457. <label class="font-weight-bold">TXID:</label> <label id="transfer_txid"></label> <br/>
  458. <label class="font-weight-bold"><span data-i18n="tx_input_amount">Input Amount</span>:</label> <label id="transfer_inputs_sum"></label><br/>
  459. <label class="font-weight-bold"><span data-i18n="tx_sending_amount">Sending </span> :</label> <label id="transfer_amount"></label><br/>
  460. <label class="font-weight-bold"><span data-i18n="tx_change">Change </span> :</label> <label id="transfer_change"></label><br/>
  461. <label class="font-weight-bold"><span data-i18n="tx_fees">Fees</span>:</label> <label id="transfer_fee"></label> <br/>
  462. <label class="font-weight-bold"><span data-i18n="tx_size">TX Size </span> :</label> <label id="transfer_tx_size"></label><br/>
  463. </div>
  464. </div>
  465. <!-- Modal footer -->
  466. <div class="modal-footer">
  467. <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="relay_tx();" data-i18n="tx_transfer">Transfer</button>
  468. <button type="button" class="btn btn-primary" data-dismiss="modal" data-i18n="tr_close">Close</button>
  469. </div>
  470. </div>
  471. </div>
  472. </div>
  473. <!-- The Modal to recover using seed words -->
  474. <div class="modal fade" id="ModalRecoverSeedWords">
  475. <div class="modal-dialog modal-dialog-centered">
  476. <div class="modal-content">
  477. <!-- Modal Header -->
  478. <div class="modal-header">
  479. <h4 class="modal-title text-center" data-i18n="recover_seed_title">Wallet Recovery using Seed Words</h4>
  480. <button type="button" class="close" data-dismiss="modal">&times;</button>
  481. </div>
  482. <!-- Modal body -->
  483. <div class="modal-body">
  484. <div class="form-group">
  485. <label for="i_seed_wallet_name" data-i18n="wallet_name">Wallet Name</label>
  486. <input type="input" class="form-control form-b" id="i_seed_wallet_name" data-i18n="[placeholder]wallet_name_quick_placeholder" placeholder="Wallet Name for quick reference" required>
  487. </div>
  488. <div class="form-group">
  489. <label for="i_seed" data-i18n="25_seed_words">25 Seed Words:</label>
  490. <textarea class="form-control form-b" oninput="growtextarea('i_seed');" style="overflow: hidden;box-sizing: border-box;" rows="3" id="i_seed" required></textarea>
  491. </div>
  492. <div class="form-group">
  493. <label for="i_seed_pwd" data-i18n="tr_password">Password</label>
  494. <input type="password" class="form-control form-b" id="i_seed_pwd" data-i18n="[placeholder]password_placeholder" oninput="verify_same_password(i_seed_pwd,i_seed_cpwd);" required>
  495. </div>
  496. <div class="form-group">
  497. <label for="i_seed_cpwd" data-i18n="cpassword">Confirm Password:</label>
  498. <input type="password" class="form-control form-b" id="i_seed_cpwd" oninput="verify_same_password(i_seed_pwd,i_seed_cpwd);" data-i18n="[placeholder]cpassword_placeholder" required>
  499. </div>
  500. <div class="form-group">
  501. <label for="i_seed_topoheight" data-i18n="wallet_start_topoheight">Wallet start Topoheight: (optional)</label>
  502. <input type=number class="form-control form-b" id="i_seed_topoheight" value="0" type="number" min="-1" step="1" required>
  503. </div>
  504. </div>
  505. <!-- Modal footer -->
  506. <div class="modal-footer">
  507. <button class="btn btn-b-2 w-b btn-block btn-radius" onclick="Recover_Wallet_Using_Seed_Words();" data-i18n="recover_wallet">Recover Wallet</button>
  508. </div>
  509. </div>
  510. </div>
  511. </div>
  512. <!-- The Modal to recover using Recovery Key -->
  513. <div class="modal fade" id="ModalRecoverKey">
  514. <div class="modal-dialog modal-dialog-centered">
  515. <div class="modal-content">
  516. <!-- Modal Header -->
  517. <div class="modal-header">
  518. <h4 class="modal-title text-center" data-i18n="recover_key">Wallet Recovery using Recovery Key</h4>
  519. <button type="button" class="close" data-dismiss="modal">&times;</button>
  520. </div>
  521. <!-- Modal body -->
  522. <div class="modal-body">
  523. <div class="form-group">
  524. <label for="i_key_wallet_name" data-i18n="wallet_name">Wallet Name</label>
  525. <input type="text" class="form-control form-b" id="i_key_wallet_name" required>
  526. </div>
  527. <div class="form-group">
  528. <label for="i_key" data-i18n="recover_key">Recovery Key (64 hex chars)</label>
  529. <textarea class="form-control form-b" oninput="growtextarea('i_key');validate_recovery_key();" style="overflow: hidden;box-sizing: border-box;" rows="1" id="i_key" required></textarea>
  530. </div>
  531. <div class="form-group">
  532. <label for="i_key_pwd" data-i18n="tr_password">Password:</label>
  533. <input type="password" class="form-control form-b" id="i_key_pwd" oninput="verify_same_password(i_key_pwd,i_key_cpwd);" required data-i18n="[placeholder]password_placeholder" placeholder="Password">
  534. </div>
  535. <div class="form-group">
  536. <label for="i_key_cpwd" data-i18n="cpassword">Confirm Password:</label>
  537. <input type="password" class="form-control form-b" id="i_key_cpwd" oninput="verify_same_password(i_key_pwd,i_key_cpwd);" data-i18n="[placeholder]cpassword_placeholder" placeholder="Confirm Password" required>
  538. </div>
  539. <div class="form-group">
  540. <label for="i_key_topoheight" data-i18n="wallet_start_topoheight">Wallet start height:</label>
  541. <input type=number class="form-control form-b" id="i_key_topoheight" value="-1" type="number" min="-1" step="1">
  542. </div>
  543. </div>
  544. <!-- Modal footer -->
  545. <div class="modal-footer">
  546. <button type="button" class="btn btn-b-2 w-b btn-block btn-radius" data-dismiss="modal" onclick="Recover_Wallet_Using_Recovery_Key();" data-i18n="recover_wallet">Recover Wallet</button>
  547. </div>
  548. </div>
  549. </div>
  550. </div>
  551. <!-- The Modal to recover using View Key -->
  552. <div class="modal fade" id="ModalRecoverViewKey">
  553. <div class="modal-dialog modal-dialog-centered">
  554. <div class="modal-content">
  555. <!-- Modal Header -->
  556. <div class="modal-header">
  557. <h4 class="modal-title text-center" data-i18n="recover_viewkey_title">Wallet Recovery using View Key</h4>
  558. <button type="button" class="close" data-dismiss="modal">&times;</button>
  559. </div>
  560. <!-- Modal body -->
  561. <div class="modal-body">
  562. <div class="form-group">
  563. <label for="i_viewkey_wallet_name" data-i18n="wallet_name">Wallet Name</label>
  564. <input type="text" class="form-control form-b" data-i18n="[placeholder]wallet_name_quick_placeholder" id="i_viewkey_wallet_name" required>
  565. </div>
  566. <div class="form-group">
  567. <label for="i_viewkey" data-i18n="recover_viewkey">View Key (128 hex chars)</label>
  568. <textarea class="form-control form-b" oninput="growtextarea('i_viewkey');validate_viewkey_key();" style="overflow: hidden;box-sizing: border-box;" rows="1" id="i_viewkey" required></textarea>
  569. </div>
  570. <div class="form-group">
  571. <label for="i_viewkey_pwd" data-i18n="tr_password">Password:</label>
  572. <input type="password" class="form-control form-b" data-i18n="[placeholder]password_placeholder" required placeholder="Password" id="i_viewkey_pwd" oninput="verify_same_password(i_viewkey_pwd,i_viewkey_cpwd);">
  573. </div>
  574. <div class="form-group">
  575. <label for="i_viewkey_cpwd" data-i18n="cpassword">Confirm Password:</label>
  576. <input type="password" class="form-control form-b" required data-i18n="[placeholder]cpassword_placeholder" placeholder="Confirm Password" id="i_viewkey_cpwd" oninput="verify_same_password(i_viewkey_pwd,i_viewkey_cpwd);">
  577. </div>
  578. <div class="form-group">
  579. <label for="i_viewkey_topoheight" data-i18n="wallet_start_topoheight">Wallet start height:</label>
  580. <input type=number class="form-control form-b" id="i_viewkey_topoheight" value="0" type="number" min="-1" step="1">
  581. </div>
  582. </div>
  583. <!-- Modal footer -->
  584. <div class="modal-footer">
  585. <button type="button" class="btn btn-b-2 w-b btn-block btn-radius" data-dismiss="modal" onclick="Recover_Wallet_Using_View_Key();" data-i18n="recover_wallet">Recover Wallet</button>
  586. </div>
  587. </div>
  588. </div>
  589. </div>
  590. <!-- The Modal to create wallet tools such as change password,rescan blockchain etc -->
  591. <div class="modal fade" id="ModalSettings">
  592. <div class="modal-dialog modal-dialog-centered modal-lg">
  593. <div class="modal-content">
  594. <!-- Modal Header -->
  595. <div class="modal-header">
  596. <h4 class="modal-title text-center" data-i18n="settings_title">Settings and Tools</h4>
  597. <button type="button" class="close" data-dismiss="modal">&times;</button>
  598. </div>
  599. <!-- Modal body -->
  600. <div class="modal-body">
  601. <div id="accordion">
  602. <div class="card">
  603. <div class="card-header">
  604. <a class="collapsed card-link" data-toggle="collapse" href="#collapsefreq">
  605. Wallet Syncs every <span class="wallet_sync_time"></span> seconds
  606. </a>
  607. </div>
  608. <div id="collapsefreq" class="collapse" data-parent="#accordion">
  609. <div class="card-body">
  610. <form>
  611. <div class="form-group">
  612. <label for="formControlRange">Sync Every <span class="wallet_sync_time"></span> seconds</label>
  613. <input type="range" class="form-control-range" id="formControlRange" min="6" value="6" max="120" oninput="promiseWorker.postMessage({cmd:'set_sync_frequency',id:secretid,syncevery:parseInt(formControlRange.value,10)});">
  614. <div class="d-flex bd-highlight justify-content-between">
  615. <div class="p-2 "><span class="text-left text-gray">High Compute<br/>High Network </span></div>
  616. <div class="p-2 "><span class="text-right text-gray">Less Compute<br/>Less Network </span></div>
  617. </div>
  618. </div>
  619. </form>
  620. </div>
  621. </div>
  622. </div>
  623. <div class="card">
  624. <div class="card-header">
  625. <a class="card-link" data-toggle="collapse" data-i18n="download_wallet_file" href="#collapse0">
  626. Download Wallet as file
  627. </a>
  628. </div>
  629. <div id="collapse0" class="collapse" data-parent="#accordion">
  630. <div class="card-body">
  631. <div class="form-group">
  632. <button type="button" class="btn btn-b-2 w-b btn-block btn-radius" onclick="promiseWorker.postMessage({cmd:'download_wallet',id:secretid}).then(function (response) {
  633. if (response === false) {
  634. alert('Wallet Download Failed');
  635. }else{
  636. var blob = new Blob( [new Uint8Array(response.edb)] , {type: 'application/octet-stream'});
  637. saveAs(blob, response.name + '.bin' );
  638. }
  639. });
  640. " data-i18n="download_wallet">Download Wallet</button>
  641. </div>
  642. </div>
  643. </div>
  644. </div>
  645. <div class="card">
  646. <div class="card-header">
  647. <a class="card-link" data-toggle="collapse" href="#collapse1">
  648. <span data-i18n="rename_wallet">Rename Open Wallet</span> <strong class="wallet_local_name"></strong>
  649. </a>
  650. </div>
  651. <div id="collapse1" class="collapse" data-parent="#accordion">
  652. <div class="card-body">
  653. <div class="form-group">
  654. <input type="text" class="form-control form-b" id="i_settings_wallet_name" data-i18n="[placeholder]rename_wallet_placeholder" placeholder="New wallet name" required>
  655. </div>
  656. <button type="button" class="btn btn-b-2 w-b btn-block btn-radius" data-i18n="rename_wallet" onclick="rename_wallet();">Rename Wallet</button>
  657. </div>
  658. </div>
  659. </div>
  660. <div class="card">
  661. <div class="card-header">
  662. <a class="collapsed card-link" data-toggle="collapse" href="#collapse2" data-i18n="change_wallet_start_topoheight">
  663. Change Wallet Start TopoHeight
  664. </a>
  665. </div>
  666. <div id="collapse2" class="collapse" data-parent="#accordion">
  667. <div class="card-body">
  668. <div class="form-group">
  669. <label data-i18n="change_wallet_start_topoheight_rare">Change Wallet Start TopoHeight (Rare use) Current:<span class="wallet_initial_height"></span></label>
  670. <input type="number" class="form-control form-b" id="i_settings_topoheight" value="0" min="0" step="1">
  671. </div>
  672. <button type="button" class="btn btn-b-2 w-b btn-block btn-radius" onclick="change_wallet_start_height(parseInt(i_settings_topoheight.value,10));" data-i18n="change_wallet_start_topoheight">Change Start Height</button>
  673. </div>
  674. </div>
  675. </div>
  676. <div class="card">
  677. <div class="card-header">
  678. <a class="collapsed card-link" data-toggle="collapse" href="#collapse3" data-i18n="change_wallet_password">
  679. Change Wallet Password
  680. </a>
  681. </div>
  682. <div id="collapse3" class="collapse" data-parent="#accordion">
  683. <div class="card-body">
  684. <div class="form-group">
  685. <label for="i_settings_pwd" data-i18n="new_password">New Password:</label>
  686. <input type="password" class="form-control form-b" id="i_settings_pwd" oninput="verify_same_password(i_settings_pwd,i_settings_cpwd);" data-i18n="[placeholder]new_password" required placeholder=" ">
  687. </div>
  688. <div class="form-group">
  689. <label for="i_settings_cpwd" data-i18n="new_cpassword">Confirm New Password:</label>
  690. <input type="password" class="form-control form-b" data-i18n="[placeholder]new_cpassword" id="i_settings_cpwd" oninput="verify_same_password(i_settings_pwd,i_settings_cpwd);" required placeholder=" ">
  691. </div>
  692. <button type="button" class="btn btn-b-2 w-b btn-block btn-radius" data-i18n="change_wallet_password" onclick="change_wallet_password();">Change Wallet Password</button>
  693. </div>
  694. </div>
  695. </div>
  696. <div class="card">
  697. <div class="card-header">
  698. <a class="collapsed card-link" data-toggle="collapse" href="#collapse4" data-i18n="rescan_blockchain">
  699. Rescan Blockchain from start topoheight
  700. </a>
  701. </div>
  702. <div id="collapse4" class="collapse" data-parent="#accordion">
  703. <div class="card-body">
  704. <label data-i18n="wallet_minimum_topoheight">Wallet may be restored from Topo Height</label>:&nbsp;<label class="wallet_minimum_topo_height"> </label>
  705. <label data-i18n="rescan_blockchain_rare">Never or Rarely required. Wallet gets busy for 20-30 minutes </label>
  706. <button type="button" class="btn btn-b-2 w-b btn-block btn-radius" data-i18n="rescan_blockchain_trigger" onclick="promiseWorker.postMessage({cmd:'rescan_blockchain',id:secretid});alert(i18next.t('success'));;">Trigger Blockchain Rescanning <br/></button>
  707. </div>
  708. </div>
  709. </div>
  710. <div class="card">
  711. <div class="card-header">
  712. <a class="collapsed card-link" data-toggle="collapse" href="#collapse5" data-i18n="transfer_everything">
  713. Transfer Everything to Address(DERO balance)
  714. </a>
  715. </div>
  716. <div id="collapse5" class="collapse" data-parent="#accordion">
  717. <div class="card-body">
  718. <div class="form-group">
  719. <label for="i_settings_send_address" data-i18n="dero_address">DERO address</label>
  720. <input type="text" class="form-control form-b" id="i_settings_send_address" data-i18n="[placeholder]valid_dero_address_placeholder" required placeholder="Enter Valid DERO address">
  721. </div>
  722. <button type="button" class="btn btn-b-2 w-b btn-block btn-radius" onclick="wallet_send_everything_transaction();" data-i18n="send_now">Send Now</button>
  723. </div>
  724. </div>
  725. </div>
  726. <div class="card">
  727. <div class="card-header">
  728. <a class="collapsed card-link" data-toggle="collapse" href="#collapse6" data-i18n="control_wallet_seed">Get your seed</a>
  729. </div>
  730. <div id="collapse6" class="collapse" data-parent="#accordion">
  731. <div class="card-body">
  732. <div class="form-group">
  733. <label class="text-danger" data-i18n="seed1">Your wallet can be recovered using the below seed.</label>
  734. <label class="text-danger" data-i18n="seed2">You must save the SEED in a safe secure location.</label>
  735. <label class="text-danger" data-i18n="seed3">Sharing your SEED is equal to sharing your wallet.If your SEED is lost, consider your wallet as lost.</label>
  736. <div class="form-group">
  737. <label for="sel1" data-i18n="seed_language">Seed Language:</label>
  738. <select class="selectpicker btn btn-b-2 w100 btn-lang btn-sm" id="sseedlanguage" onChange="update_seed(this.value);">
  739. <option>English</option>
  740. <option>日本語</option>
  741. <option>简体中文 (中国)</option>
  742. <option>Nederlands</option>
  743. <option>Esperanto</option>
  744. <option>русский язык</option>
  745. <option>Español</option>
  746. <option>Português</option>
  747. <option>Français</option>
  748. <option>Deutsch</option>
  749. <option>Italiano</option>
  750. </select>
  751. </div>
  752. <label class="label-seed" id="seedbox">SEED</label>
  753. </div>
  754. </div>
  755. </div>
  756. </div>
  757. </div>
  758. </div>
  759. <!-- Modal footer
  760. <div class="modal-footer">
  761. <button type="button" class="btn btn-danger" data-dismiss="modal" data-i18n="tr_close">Close</button>
  762. </div> -->
  763. </div>
  764. </div>
  765. </div>
  766. <!-- The Modal used to display seed seed words -->
  767. <div class="modal fade" id="ModalSeedWords">
  768. <div class="modal-dialog modal-dialog-centered">
  769. <div class="modal-content">
  770. <!-- Modal Header -->
  771. <div class="modal-header">
  772. <h4 class="modal-title text-center" data-i18n="seed_title">Your DERO wallet SEED</h4>
  773. <button type="button" class="close" data-dismiss="modal">&times;</button>
  774. </div>
  775. <!-- Modal body -->
  776. <div class="modal-body">
  777. <div class="form-group">
  778. <label class="text-danger" data-i18n="seed1">Your wallet can be recovered using the below seed.</label>
  779. <label class="text-danger" data-i18n="seed2">You must save the SEED in a safe secure location.</label>
  780. <label class="text-danger" data-i18n="seed3">Sharing your SEED is equal to sharing your wallet.If your SEED is lost, consider your wallet as lost.</label>
  781. <div class="form-group">
  782. <label for="sel1" data-i18n="seed_language">Seed Language:</label>
  783. <select class="selectpicker btn btn-b-2 w100 btn-lang btn-sm" id="sseedlanguage" onChange="update_seed(this.value);">
  784. <option>English</option>
  785. <option>日本語</option>
  786. <option>简体中文 (中国)</option>
  787. <option>Nederlands</option>
  788. <option>Esperanto</option>
  789. <option>русский язык</option>
  790. <option>Español</option>
  791. <option>Português</option>
  792. <option>Français</option>
  793. <option>Deutsch</option>
  794. <option>Italiano</option>
  795. </select>
  796. </div>
  797. <label class="label-seed" id="seedbox">SEED</label>
  798. </div>
  799. </div>
  800. <!-- Modal footer -->
  801. <div class="modal-footer">
  802. <button type="button" class="btn btn-danger" data-dismiss="modal" data-i18n="tr_close">Close</button>
  803. </div>
  804. </div>
  805. </div>
  806. </div>
  807. <!-- The Modal used to display seed seed words -->
  808. <div class="modal fade" id="ModalQRCode">
  809. <div class="modal-dialog modal-dialog-centered">
  810. <div class="modal-content">
  811. <!-- Modal Header -->
  812. <div class="modal-header">
  813. <h4 class="modal-title text-center" data-i18n="enter_password">Password</h4>
  814. <button type="button" class="close" data-dismiss="modal">&times;</button>
  815. </div>
  816. <!-- Modal body -->
  817. <div class="modal-body ">
  818. <div class="d-flex justify-content-center">
  819. <div id="qrcode"></div>
  820. </div>
  821. </div>
  822. <!-- Modal footer -->
  823. <div class="modal-footer">
  824. <button type="button" class="btn btn-danger" data-dismiss="modal" data-i18n="tr_close">Close</button>
  825. </div>
  826. </div>
  827. </div>
  828. </div>
  829. <div class="modal fade" id="ModalPromptPassword">
  830. <div class="modal-dialog modal-dialog-centered">
  831. <div class="modal-content">
  832. <!-- Modal Header -->
  833. <div class="modal-header">
  834. <h4 class="modal-title text-center" data-i18n="enter_password">Password</h4>
  835. <button type="button" class="close" data-dismiss="modal">&times;</button>
  836. </div>
  837. <!-- Modal body -->
  838. <div class="modal-body ">
  839. <div class="form-group">
  840. <input type="password" name="password" class="form-control form-b" required>
  841. <input type="hidden" name="action">
  842. </div>
  843. <div class="form-group">
  844. <button type="button" id="PromptPassword" class="btn btn-b-2 w-b btn-block btn-radius">Submit</button>
  845. </div>
  846. </div>
  847. </div>
  848. </div>
  849. </div>
  850. </body>
  851. <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  852. <!--<script type="text/javascript" src="/static/jquery-3.2.1.slim.min.js" ></script>-->
  853. <script type="text/javascript" src="/static/deps/jquery-3.2.1.js"></script>
  854. <script type="text/javascript" src="/static/deps/js.cookie-2.2.0.min.js"></script>
  855. <script type="text/javascript" src="/static/deps/popper.min.js"></script>
  856. <script type="text/javascript" src="/static/deps/bootstrap.min.js"></script>
  857. <script type="text/javascript" src="/static/deps/i18next_11.9.1.min.js"></script>
  858. <script type="text/javascript" src="/static/deps/jquery-i18next.min.js"></script>
  859. <script type="text/javascript" src="/static/deps/video.js"></script>
  860. <script type="text/javascript" src="/static/translations.js"></script>
  861. <script type="text/javascript" src="/static/deps/clipboard.min.js"></script>
  862. <script type="text/javascript" src='/static/deps/big.js'></script>
  863. <script type="text/javascript" src="/static/deps/FileSaver.js"></script>
  864. <script type="text/javascript" src="/static/deps/tabulator.min.js"></script>
  865. <script type="text/javascript" src="/static/deps/promise-worker.js"></script>
  866. <script type="text/javascript" src="/static/deps/qrcode.js"></script>
  867. <!-- these are for qr code reader from camera -->
  868. <script async src="/static/deps/zxing.js"></script>
  869. <script type="text/javascript" src="/static/wallet.js"></script>
  870. <script type="text/javascript">
  871. // install file select handle
  872. document.getElementById('wallet_disk_file').addEventListener('change', HandleWalletSelect, false);
  873. var customFormatter_dero = function(cell, formatterParams, onRendered) {
  874. //cell - the cell component
  875. //formatterParams - parameters set for the column
  876. //onRendered - function to call when the formatter has been rendered
  877. // return '<div style="text-align: right;">' + cell.getValue() +'</div>'; //return the contents of the cell;
  878. var divisor = new Big("1000000000000");
  879. var x = new Big(cell.getValue());
  880. x = x.div(divisor);
  881. return '<div style="text-align: right;">' + x.toFixed(12) + '</div>';
  882. };
  883. var txtable = new Tabulator("#txtable", {
  884. columns: [{
  885. title: "Time",
  886. field: "time"
  887. }, {
  888. title: "Amount",
  889. field: "amount",
  890. sorter: "number",
  891. formatter: customFormatter_dero
  892. }, {
  893. title: "TXID",
  894. field: "txid",
  895. sortable: false
  896. }, {
  897. title: "Payment ID",
  898. field: "paymentid",
  899. width: "8em"
  900. }, {
  901. title: "BL Height",
  902. field: "height",
  903. sortable: false
  904. }, {
  905. title: "TopoHeight",
  906. field: "topoheight",
  907. sortable: false
  908. }, {
  909. title: "Status",
  910. field: "status"
  911. },
  912. ],
  913. // selectable:true,
  914. layout: "fitDataFill",
  915. responsiveLayout: "collapse", // collapse columns that no longer fit
  916. layoutColumnsOnNewData: true,
  917. // height : "50vh", // show only 20 tx per view, rest must be scrolled
  918. pagination: "local",
  919. paginationSize: 10,
  920. rowFormatter: function(row) {
  921. var data = row.getData();
  922. if (data.status == "1") {
  923. row.getElement().style.backgroundColor = "#ffcccb"; // spent color
  924. } else {
  925. //row.getElement().style.backgroundColor = "#e5ffff"; // incoming color
  926. //row.getElement().css({"background-color":"#A6A6DF"});
  927. // row.getElement().addClass("text-white");
  928. }
  929. },
  930. });
  931. $(document).ready(function() {
  932. $('.wallet-online').hide();
  933. $('#btn_wallet_disk_file').on('click', function() {
  934. $('#wallet_disk_file').click();
  935. });
  936. $('div#blackTheme, div#whiteTheme').on('click', function() {
  937. var id = $(this).attr('id');
  938. if (id == "blackTheme") {
  939. $('link[title="blackTheme"]').prop('disabled', false);
  940. $('link[title="whiteTheme"]').prop('disabled', true);
  941. } else {
  942. $('link[title="whiteTheme"]').prop('disabled', false);
  943. $('link[title="blackTheme"]').prop('disabled', true);
  944. }
  945. Cookies.set('theme', id, {
  946. expires: 3650
  947. });
  948. });
  949. var stored_theme = Cookies.get('theme');
  950. if (typeof(stored_theme) != undefined) {
  951. $('div#'+stored_theme).trigger('click');
  952. }
  953. i18next.init({
  954. // debug: true,
  955. "lng": 'en',
  956. "resources": translations,
  957. "fallbackLng": 'en',
  958. // attributes to translate
  959. translateAttributes: ['placeholder', 'value', 'title', 'alt', 'value#input.type=button', 'value#input.type=submit'],
  960. }, function(t) {
  961. //i18next();
  962. });
  963. jqueryI18next.init(i18next, $, {
  964. tName: 't', // --> appends $.t = i18next.t
  965. i18nName: 'i18n', // --> appends $.i18n = i18next
  966. handleName: 'localize', // --> appends $(selector).localize(opts);
  967. selectorAttr: 'data-i18n', // selector for translating elements
  968. targetAttr: 'i18n-target', // data-() attribute to grab target element to translate (if diffrent then itself)
  969. optionsAttr: 'i18n-options', // data-() attribute that contains options, will load/set if useOptionsAttr = true
  970. useOptionsAttr: false, // see optionsAttr
  971. parseDefaultValueFromContent: true // parses default values from content ele.val or ele.text
  972. });
  973. var stored_lang = Cookies.get('lang')
  974. if (typeof(stored_lang) != undefined) {
  975. // make sure the language reference by cookie is still valid
  976. if (translations[stored_lang] != 'undefined') {
  977. i18next.changeLanguage(stored_lang, (err, t) => {
  978. // Select the real language
  979. $('#language_picker > option[data-lang="' + stored_lang + '"]').attr('selected', 'selected');
  980. if (err) return console.log('something went wrong loading', err);
  981. });
  982. }
  983. } else { // we do not have cookie stored, so time to guess user language
  984. var first_lang = getFirstBrowserLanguage();
  985. // check language exists
  986. if (translations[first_lang] != undefined) {
  987. $('#language_picker > option[data-lang="' + first_lang + '"]').attr('selected', 'selected');
  988. i18next.changeLanguage(first_lang, (err, t) => {
  989. if (err) return console.log('something went wrong loading', err);
  990. });
  991. } else { // extract the first part of tag
  992. parts = first_lang.split("-");
  993. if (parts.length >= 2) {
  994. if (translations[parts[0]] != undefined) {
  995. $('#language_picker > option[data-lang="' + parts[0] + '"]').attr('selected', 'selected');
  996. i18next.changeLanguage(parts[0], (err, t) => {
  997. if (err) return console.log('something went wrong loading', err);
  998. });
  999. }
  1000. }
  1001. }
  1002. }
  1003. console.log(getFirstBrowserLanguage());
  1004. $("body").localize(); // localize first time automatically
  1005. $('#language_picker').on('change', function() {
  1006. var lang = $(this).find('option:selected').attr('data-lang');
  1007. Cookies.set('lang', lang, {
  1008. expires: 3650
  1009. }); // 10 years a long time
  1010. i18next.changeLanguage(lang, (err, t) => {
  1011. if (err) return console.log('something went wrong loading', err);
  1012. });
  1013. $("body").localize();
  1014. });
  1015. setTimeout(function(){
  1016. $('body').addClass('loaded');
  1017. }, 1500);
  1018. });
  1019. // this is for qrcode reader
  1020. var qrcode = new QRCode(document.getElementById("qrcode"), {
  1021. text: "https://dero.io",
  1022. width: 384,
  1023. height: 384,
  1024. colorDark: "#000000",
  1025. colorLight: "#ffffff",
  1026. //correctLevel : QRCode.CorrectLevel.H // ECC highest level, Reading is tough
  1027. correctLevel: QRCode.CorrectLevel.L // ECC lowest level
  1028. });
  1029. var clipboard = new ClipboardJS('.clipboard');
  1030. </script>
  1031. </html>