[#3935] set web3.eth.defaultAccount
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
9442b8d9e7
commit
174aac90c0
|
@ -114,5 +114,6 @@ if (typeof web3 === "undefined") {
|
|||
if (protocol == "https:" || protocol == "http:") {
|
||||
console.log("StatusHttpProvider");
|
||||
web3 = new Web3(new StatusHttpProvider(address));
|
||||
web3.eth.defaultAccount = currentAccountAddress;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@
|
|||
|
||||
(views/defview browser []
|
||||
(views/letsubs [webview (atom nil)
|
||||
{:keys [address]} [:get-current-account]
|
||||
{:keys [dapp? contact url] :as browser} [:get-current-browser]
|
||||
{:keys [can-go-back? can-go-forward?]} [:get :browser/options]
|
||||
extra-js [:web-view-extra-js]
|
||||
|
@ -97,7 +98,7 @@
|
|||
:injected-on-start-loading-java-script (str js-res/web3
|
||||
js-res/jquery
|
||||
(get-inject-js url)
|
||||
(js-res/web3-init rpc-url))
|
||||
(js-res/web3-init rpc-url address))
|
||||
:injected-java-script (str js-res/webview-js extra-js)}]
|
||||
[react/view styles/background
|
||||
[react/text (i18n/label :t/enter-dapp-url)]])
|
||||
|
|
|
@ -37,8 +37,9 @@
|
|||
(def web3 (str "; if (typeof Web3 == 'undefined') {"
|
||||
(slurp "node_modules/web3/dist/web3.min.js")
|
||||
"}"))
|
||||
(defn web3-init [provider-address]
|
||||
(defn web3-init [provider-address current-account-address]
|
||||
(str "var providerAddress = \"" provider-address "\";"
|
||||
"var currentAccountAddress = \"" current-account-address "\";"
|
||||
(slurp "resources/js/web3_init.js")))
|
||||
|
||||
(defn local-storage-data [data]
|
||||
|
|
Loading…
Reference in New Issue