Add faucet button in rinkeby
This commit is contained in:
parent
e39519dfb7
commit
8cc6c7c924
|
@ -165,12 +165,12 @@
|
||||||
{:call-get-contract-fx [web3 (:address contract)]})))
|
{:call-get-contract-fx [web3 (:address contract)]})))
|
||||||
|
|
||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
:good-request-ropsten-eth
|
:good-request-testnet-eth
|
||||||
(fn [_ _]
|
(fn [_ _]
|
||||||
(js/alert "Faucet request recieved")))
|
(js/alert "Faucet request recieved")))
|
||||||
|
|
||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
:bad-request-ropsten-eth
|
:bad-request-testnet-eth
|
||||||
(fn [_ _]
|
(fn [_ _]
|
||||||
(js/alert "Faucet request error")))
|
(js/alert "Faucet request error")))
|
||||||
|
|
||||||
|
@ -180,8 +180,17 @@
|
||||||
{:http-xhrio {:method :get
|
{:http-xhrio {:method :get
|
||||||
:uri (str "https://faucet.status.im/donate/" address)
|
:uri (str "https://faucet.status.im/donate/" address)
|
||||||
:response-format (ajax/json-response-format {:keywords? true})
|
:response-format (ajax/json-response-format {:keywords? true})
|
||||||
:on-success [:good-request-ropsten-eth]
|
:on-success [:good-request-testnet-eth]
|
||||||
:on-failure [:bad-request-ropsten-eth]}}))
|
:on-failure [:bad-request-testnet-eth]}}))
|
||||||
|
|
||||||
|
(re-frame/reg-event-fx
|
||||||
|
:request-rinkeby-eth
|
||||||
|
(fn [_ [_ address]]
|
||||||
|
{:http-xhrio {:method :get
|
||||||
|
:uri (str "http://51.15.60.23:3001/donate/" address)
|
||||||
|
:response-format (ajax/json-response-format {:keywords? true})
|
||||||
|
:on-success [:good-request-testnet-eth]
|
||||||
|
:on-failure [:bad-request-testnet-eth]}}))
|
||||||
|
|
||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
:new-contact-callback
|
:new-contact-callback
|
||||||
|
|
|
@ -72,8 +72,8 @@
|
||||||
|
|
||||||
(when (= :assets tab-view)
|
(when (= :assets tab-view)
|
||||||
[react/view
|
[react/view
|
||||||
(if (= "3" network)
|
(case network
|
||||||
[react/view
|
"3" [react/view
|
||||||
;;TODO CORS
|
;;TODO CORS
|
||||||
[ui/button "Request Ropsten ETH" #(re-frame/dispatch [:request-ropsten-eth (str (first accounts))])]
|
[ui/button "Request Ropsten ETH" #(re-frame/dispatch [:request-ropsten-eth (str (first accounts))])]
|
||||||
[ui/asset-button "STT" constants/stt-ropsten-contract]
|
[ui/asset-button "STT" constants/stt-ropsten-contract]
|
||||||
|
@ -82,6 +82,8 @@
|
||||||
[ui/asset-button "ADI" constants/adi-ropsten-contract]
|
[ui/asset-button "ADI" constants/adi-ropsten-contract]
|
||||||
[ui/asset-button "WGN" constants/wgn-ropsten-contract]
|
[ui/asset-button "WGN" constants/wgn-ropsten-contract]
|
||||||
[ui/asset-button "MDS" constants/mds-ropsten-contract]]
|
[ui/asset-button "MDS" constants/mds-ropsten-contract]]
|
||||||
|
"4" [react/view
|
||||||
|
[ui/button "Request Rinkeby ETH" #(re-frame/dispatch [:request-rinkeby-eth (str (first accounts))])]]
|
||||||
[react/text "Assets supported only in Ropsten Testnet"])])
|
[react/text "Assets supported only in Ropsten Testnet"])])
|
||||||
|
|
||||||
(when (= :transactions tab-view)
|
(when (= :transactions tab-view)
|
||||||
|
|
Loading…
Reference in New Issue