diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-04-05 15:30:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 15:30:07 +0800 |
commit | dd6b4505f41b80a4f4cd3654412349b262c3cd76 (patch) | |
tree | 571a16459cffbe85f757e35df9c81a601959756b /app/scripts/lib | |
parent | 5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb (diff) | |
parent | 1aac162b462424f5b6ce6685f337670368bd10b5 (diff) | |
download | tangerine-wallet-browser-dd6b4505f41b80a4f4cd3654412349b262c3cd76.tar tangerine-wallet-browser-dd6b4505f41b80a4f4cd3654412349b262c3cd76.tar.gz tangerine-wallet-browser-dd6b4505f41b80a4f4cd3654412349b262c3cd76.tar.bz2 tangerine-wallet-browser-dd6b4505f41b80a4f4cd3654412349b262c3cd76.tar.lz tangerine-wallet-browser-dd6b4505f41b80a4f4cd3654412349b262c3cd76.tar.xz tangerine-wallet-browser-dd6b4505f41b80a4f4cd3654412349b262c3cd76.tar.zst tangerine-wallet-browser-dd6b4505f41b80a4f4cd3654412349b262c3cd76.zip |
Merge pull request #1309 from MetaMask/mascara2
Mascara - various fixes
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/auto-faucet.js | 8 | ||||
-rw-r--r-- | app/scripts/lib/buy-eth-url.js | 19 |
2 files changed, 24 insertions, 3 deletions
diff --git a/app/scripts/lib/auto-faucet.js b/app/scripts/lib/auto-faucet.js index 73b73dfe6..38d54ba5e 100644 --- a/app/scripts/lib/auto-faucet.js +++ b/app/scripts/lib/auto-faucet.js @@ -3,9 +3,11 @@ const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG' const env = process.env.METAMASK_ENV module.exports = function (address) { - if (METAMASK_DEBUG || env === 'test') return // Don't faucet in development or test - let data = address - let headers = new Headers() + // Don't faucet in development or test + if (METAMASK_DEBUG === true || env === 'test') return + global.log.info('auto-fauceting:', address) + const data = address + const headers = new Headers() headers.append('Content-type', 'application/rawdata') fetch(uri, { method: 'POST', diff --git a/app/scripts/lib/buy-eth-url.js b/app/scripts/lib/buy-eth-url.js new file mode 100644 index 000000000..91a1ec322 --- /dev/null +++ b/app/scripts/lib/buy-eth-url.js @@ -0,0 +1,19 @@ +module.exports = getBuyEthUrl + +function getBuyEthUrl({ network, amount, address }){ + let url + switch (network) { + case '1': + url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH` + break + + case '3': + url = 'https://faucet.metamask.io/' + break + + case '42': + url = 'https://github.com/kovan-testnet/faucet' + break + } + return url +}
\ No newline at end of file |