Skip to content
This repository has been archived by the owner on Apr 26, 2019. It is now read-only.

MetaMask: Use web3.currentProvider instead of window.web3 #242 #455

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion macchiato-app/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[macchiato/core "0.2.2"]
[macchiato/env "0.0.6"]
[mount "0.1.11"]
[cljs-web3 "0.19.0-0-7"]
[cljs-web3 "0.19.0-011"]
[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.908"]]
:min-lein-version "2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
[akiroz.re-frame/storage "0.1.2"]
[cljsjs/chartjs "2.6.0-0"]
[org.web3j/core "2.3.1"]
[cljs-web3 "0.19.0-0-7"]]
[cljs-web3 "0.19.0-0-11"]]

:min-lein-version "2.0.0"
:source-paths ["src/clj" "src/cljc"]
Expand Down
8 changes: 6 additions & 2 deletions src/cljs/commiteth/common.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
[goog.i18n.DateTimePatterns :as DateTimePatterns])
(:import (goog.i18n DateTimeFormat)))

(defn web3 []
(gobj/get js/window "web3"))
(defn web3
"Return the web3 instance injected via Mist or Metamask"
[]
(new (goog.object/getValueByKeys js/window "web3" "constructor")
(current-provider
(goog.object/get js/window "web3"))))

(defn input [val-ratom props]
(fn []
Expand Down