[#12535] Human Readable data display when signing using eth_signTypedData_v3

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2022-01-10 12:44:07 +01:00
parent 130308fa8a
commit c466f96326
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
2 changed files with 6 additions and 1 deletions

View File

@ -236,7 +236,9 @@
:signing/sign {:type (cond pinless? :pinless
keycard-multiaccount? :keycard
:else :password)
:formatted-data (if typed? (types/json->clj data) (ethereum/hex->text data))
:formatted-data (if typed?
(types/js->pretty-json (types/json->js data))
(ethereum/hex->text data))
:keycard-step (when pinless? :connect)})
:show-signing-sheet nil}
#(when-not wallet-set-up-passed?

View File

@ -13,6 +13,9 @@
(defn clj->pretty-json [data spaces]
(.stringify js/JSON (clj-bean/->js data) nil spaces))
(defn js->pretty-json [data]
(.stringify js/JSON data nil 2))
(defn clj->json [data]
(clj->pretty-json data 0))