mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 10:16:01 +00:00
Create event
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
parent
941526a7fc
commit
4dca2e9caa
@ -209,6 +209,8 @@
|
|||||||
(def ^:const web3-uninstall-filter "eth_uninstallFilter")
|
(def ^:const web3-uninstall-filter "eth_uninstallFilter")
|
||||||
(def ^:const web3-get-filter-changes "eth_getFilterChanges")
|
(def ^:const web3-get-filter-changes "eth_getFilterChanges")
|
||||||
|
|
||||||
|
(def ^:const status-create-address "status_createaddress")
|
||||||
|
|
||||||
(def ^:const event-transfer-hash
|
(def ^:const event-transfer-hash
|
||||||
(ethereum/sha3 "Transfer(address,address,uint256)"))
|
(ethereum/sha3 "Transfer(address,address,uint256)"))
|
||||||
|
|
||||||
|
@ -535,6 +535,10 @@
|
|||||||
:data? :string
|
:data? :string
|
||||||
:on-success :event
|
:on-success :event
|
||||||
:on-failure? :event}}
|
:on-failure? :event}}
|
||||||
|
'ethereum/create-address
|
||||||
|
{:permissions [:read]
|
||||||
|
:value :extensions/ethereum-create-address
|
||||||
|
:arguments {:on-result :event}}
|
||||||
'ethereum/send-transaction
|
'ethereum/send-transaction
|
||||||
{:permissions [:read]
|
{:permissions [:read]
|
||||||
:value :extensions/ethereum-send-transaction
|
:value :extensions/ethereum-send-transaction
|
||||||
|
@ -344,6 +344,18 @@
|
|||||||
:method constants/web3-personal-sign})}
|
:method constants/web3-personal-sign})}
|
||||||
(navigation/navigate-to-cofx :wallet-sign-message-modal nil)))))
|
(navigation/navigate-to-cofx :wallet-sign-message-modal nil)))))
|
||||||
|
|
||||||
|
(handlers/register-handler-fx
|
||||||
|
:extensions/ethereum-create-address
|
||||||
|
(fn [_ [_ _ {:keys [on-result]}]]
|
||||||
|
(let [args {:jsonrpc "2.0"
|
||||||
|
:method constants/status-create-address}
|
||||||
|
payload (types/clj->json args)]
|
||||||
|
(status/call-private-rpc payload #(let [{:keys [error result]} (types/json->clj %1)
|
||||||
|
response (if error {:result result :error error}
|
||||||
|
{:result result})]
|
||||||
|
(re-frame/dispatch (on-result response)))))))
|
||||||
|
|
||||||
|
;; poll logs implementation
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:extensions/ethereum-logs-changes
|
:extensions/ethereum-logs-changes
|
||||||
(fn [_ [_ _ {:keys [id] :as m}]]
|
(fn [_ [_ _ {:keys [id] :as m}]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user