diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-04-19 04:39:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-19 04:39:31 +0800 |
commit | 6742a5b2722da7af9320f46b18e9f4b59c5666ba (patch) | |
tree | a967fd6d6bdcc2f163cdf6639f5da915c3aba042 /app/scripts/lib/buy-eth-url.js | |
parent | 061975cd4a92dfcff7c98c2ab34290b8680c5545 (diff) | |
parent | 164f9c4662072dc0960ee5dc2c021545a7b14d8a (diff) | |
download | tangerine-wallet-browser-6742a5b2722da7af9320f46b18e9f4b59c5666ba.tar tangerine-wallet-browser-6742a5b2722da7af9320f46b18e9f4b59c5666ba.tar.gz tangerine-wallet-browser-6742a5b2722da7af9320f46b18e9f4b59c5666ba.tar.bz2 tangerine-wallet-browser-6742a5b2722da7af9320f46b18e9f4b59c5666ba.tar.lz tangerine-wallet-browser-6742a5b2722da7af9320f46b18e9f4b59c5666ba.tar.xz tangerine-wallet-browser-6742a5b2722da7af9320f46b18e9f4b59c5666ba.tar.zst tangerine-wallet-browser-6742a5b2722da7af9320f46b18e9f4b59c5666ba.zip |
Merge pull request #3987 from MetaMask/dm-docs-1
Documentation for various controllers and and lib utils
Diffstat (limited to 'app/scripts/lib/buy-eth-url.js')
-rw-r--r-- | app/scripts/lib/buy-eth-url.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/scripts/lib/buy-eth-url.js b/app/scripts/lib/buy-eth-url.js index b9dde3c28..4e2d0bc79 100644 --- a/app/scripts/lib/buy-eth-url.js +++ b/app/scripts/lib/buy-eth-url.js @@ -1,5 +1,16 @@ module.exports = getBuyEthUrl +/** + * Gives the caller a url at which the user can acquire eth, depending on the network they are in + * + * @param {object} opts Options required to determine the correct url + * @param {string} opts.network The network for which to return a url + * @param {string} opts.amount The amount of ETH to buy on coinbase. Only relevant if network === '1'. + * @param {string} opts.address The address the bought ETH should be sent to. Only relevant if network === '1'. + * @returns {string|undefined} The url at which the user can access ETH, while in the given network. If the passed + * network does not match any of the specified cases, or if no network is given, returns undefined. + * + */ function getBuyEthUrl ({ network, amount, address }) { let url switch (network) { |