diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-07-08 05:21:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-08 05:21:43 +0800 |
commit | d228f46254783885e9762a2f96ecb9c3077c5fb3 (patch) | |
tree | b0e0fde9f209c3728f7a1e36d3c4417ea7a3852d /app/scripts/metamask-controller.js | |
parent | 51ff6d74e884b599f78b5454b33f2bc1a046f0b2 (diff) | |
parent | 678cfd21755bab430d28a8f0d0fb44a81ecefade (diff) | |
download | tangerine-wallet-browser-d228f46254783885e9762a2f96ecb9c3077c5fb3.tar tangerine-wallet-browser-d228f46254783885e9762a2f96ecb9c3077c5fb3.tar.gz tangerine-wallet-browser-d228f46254783885e9762a2f96ecb9c3077c5fb3.tar.bz2 tangerine-wallet-browser-d228f46254783885e9762a2f96ecb9c3077c5fb3.tar.lz tangerine-wallet-browser-d228f46254783885e9762a2f96ecb9c3077c5fb3.tar.xz tangerine-wallet-browser-d228f46254783885e9762a2f96ecb9c3077c5fb3.tar.zst tangerine-wallet-browser-d228f46254783885e9762a2f96ecb9c3077c5fb3.zip |
Merge branch 'master' into nonce-tracker
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index be64a45c7..573594b39 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -184,7 +184,9 @@ module.exports = class MetamaskController extends EventEmitter { eth_syncing: false, web3_clientVersion: `MetaMask/v${version}`, }, + // rpc data source rpcUrl: this.networkController.getCurrentRpcAddress(), + originHttpHeaderKey: 'X-Metamask-Origin', // account mgmt getAccounts: (cb) => { const isUnlocked = this.keyringController.memStore.getState().isUnlocked @@ -293,6 +295,7 @@ module.exports = class MetamaskController extends EventEmitter { // PreferencesController setSelectedAddress: nodeify(preferencesController.setSelectedAddress).bind(preferencesController), + addToken: nodeify(preferencesController.addToken).bind(preferencesController), setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab).bind(preferencesController), setDefaultRpc: nodeify(this.setDefaultRpc).bind(this), setCustomRpc: nodeify(this.setCustomRpc).bind(this), @@ -355,8 +358,13 @@ module.exports = class MetamaskController extends EventEmitter { } setupProviderConnection (outStream, originDomain) { - streamIntoProvider(outStream, this.provider, logger) - function logger (err, request, response) { + streamIntoProvider(outStream, this.provider, onRequest, onResponse) + // append dapp origin domain to request + function onRequest (request) { + request.origin = originDomain + } + // log rpc activity + function onResponse (err, request, response) { if (err) return console.error(err) if (response.error) { console.error('Error in RPC response:\n', response.error) |