Skip to content

Instantly share code, notes, and snippets.

@madvas
Last active October 3, 2016 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madvas/9d19f67e9c1f8ffcd5859db8c9a76683 to your computer and use it in GitHub Desktop.
Save madvas/9d19f67e9c1f8ffcd5859db8c9a76683 to your computer and use it in GitHub Desktop.
initialize
(reg-event-fx
:initialize
(fn [_ _]
(merge
{:db db/default-db
:http-xhrio {:method :get
:uri (gstring/format "/contracts/build/%s.abi"
(get-in db/default-db [:contract :name]))
:timeout 6000
:response-format (ajax/json-response-format {:keywords? true})
:on-success [:contract/abi-loaded]
:on-failure [:log-error]}}
(when (:provides-web3? db/default-db)
{:web3-fx.blockchain/fns
{:web3 (:web3 db/default-db)
:fns [[web3-eth/accounts :blockchain/my-addresses-loaded :log-error]]}}))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment