1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 02:58:09 +01:00
metamask-extension/app/scripts/lib/auto-faucet.js

13 lines
418 B
JavaScript
Raw Normal View History

2016-11-03 18:42:34 +01:00
const uri = 'https://faucet.metamask.io/'
const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
2016-11-03 19:22:10 +01:00
const env = process.env.METAMASK_ENV
2016-06-21 22:18:32 +02:00
module.exports = function (address) {
2016-11-03 19:22:10 +01:00
if (METAMASK_DEBUG || env === 'test') return // Don't faucet in development or test
var http = new XMLHttpRequest()
var data = address
http.open('POST', uri, true)
http.setRequestHeader('Content-type', 'application/rawdata')
http.send(data)
}