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-get-filter-changes "eth_getFilterChanges")
|
||||
|
||||
(def ^:const status-create-address "status_createaddress")
|
||||
|
||||
(def ^:const event-transfer-hash
|
||||
(ethereum/sha3 "Transfer(address,address,uint256)"))
|
||||
|
||||
|
|
|
@ -535,6 +535,10 @@
|
|||
:data? :string
|
||||
:on-success :event
|
||||
:on-failure? :event}}
|
||||
'ethereum/create-address
|
||||
{:permissions [:read]
|
||||
:value :extensions/ethereum-create-address
|
||||
:arguments {:on-result :event}}
|
||||
'ethereum/send-transaction
|
||||
{:permissions [:read]
|
||||
:value :extensions/ethereum-send-transaction
|
||||
|
|
|
@ -344,6 +344,18 @@
|
|||
:method constants/web3-personal-sign})}
|
||||
(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
|
||||
:extensions/ethereum-logs-changes
|
||||
(fn [_ [_ _ {:keys [id] :as m}]]
|
||||
|
|
Loading…
Reference in New Issue