Skip to content

Commit

Permalink
[#12365] Spin of death on adding custom NFT token contract
Browse files Browse the repository at this point in the history
Signed-off-by: andrey <[email protected]>
  • Loading branch information
flexsurfer committed Nov 24, 2021
1 parent 4000abf commit c9c8263
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/status_im/wallet/custom_tokens/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
{:contract contract
:method "decimals()"
:outputs ["uint256"]
:on-error #(re-frame/dispatch [:wallet.custom-token/not-supported])
:on-success
(fn [[contract-decimals]]
(re-frame/dispatch [:wallet.custom-token/decimals-result
Expand All @@ -31,6 +32,7 @@
{:contract contract
:method "symbol()"
:outputs ["string"]
:on-error #(re-frame/dispatch [:wallet.custom-token/not-supported])
:on-success
(fn [[contract-symbol]]
(re-frame/dispatch [:wallet.custom-token/symbol-result
Expand Down Expand Up @@ -58,6 +60,7 @@
{:contract contract
:method "name()"
:outputs ["string"]
:on-error #(re-frame/dispatch [:wallet.custom-token/not-supported])
:on-success
(fn [[contract-name]]
(re-frame/dispatch [:wallet.custom-token/name-result
Expand Down Expand Up @@ -149,6 +152,12 @@
(update db :wallet/custom-token-screen merge {:name token-name})
:wallet.custom-token/get-symbol contract})

(fx/defn not-supported
{:events [:wallet.custom-token/not-supported]}
[{:keys [db]}]
{:db (assoc-in db [:wallet/custom-token-screen :in-progress?] nil)
:utils/show-popup {:content (i18n/label :t/contract-isnt-supported)}})

(fx/defn balance-result
{:events [:wallet.custom-token/balance-result]}
[{:keys [db]} contract balance]
Expand Down
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,7 @@
"wrong-card": "Wrong card",
"wrong-card-text": "Tapped card does not correspond to the keys you selected",
"wrong-contract": "Wrong contract",
"contract-isnt-supported": "Contract is not supported",
"wrong-keycard-text": "The Keycard you tapped is not associated with this phone",
"wrong-keycard-title": "Looks like you’ve tapped \na wrong keycard",
"wrong-password": "Wrong password",
Expand Down

0 comments on commit c9c8263

Please sign in to comment.