aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-04-05 09:23:46 +0800
committerkumavis <aaron@kumavis.me>2017-04-05 09:23:46 +0800
commit5a91adf7d802097805938e3d54fe7256b19724d1 (patch)
tree9ad83ef345650796822b5462cff0d0bf5eab9b22 /app/scripts/lib
parent5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb (diff)
downloadtangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.gz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.bz2
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.lz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.xz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.zst
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.zip
add platforms to mascara + move buyEther window open to ui
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/auto-faucet.js8
-rw-r--r--app/scripts/lib/buy-eth-url.js19
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..1e059cf73 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 || 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