aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/buy-eth-url.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-04-17 01:08:04 +0800
committerDan <danjm.com@gmail.com>2018-04-17 01:08:04 +0800
commit20a075657f9c8133b65ea9cf6e8f1f633bc8a8e6 (patch)
tree2c07e403438905ec0ab758d55b59922fbd8daeba /app/scripts/lib/buy-eth-url.js
parent8fb1237d6425655b88d0bca6ef000d7b77939617 (diff)
downloadtangerine-wallet-browser-20a075657f9c8133b65ea9cf6e8f1f633bc8a8e6.tar
tangerine-wallet-browser-20a075657f9c8133b65ea9cf6e8f1f633bc8a8e6.tar.gz
tangerine-wallet-browser-20a075657f9c8133b65ea9cf6e8f1f633bc8a8e6.tar.bz2
tangerine-wallet-browser-20a075657f9c8133b65ea9cf6e8f1f633bc8a8e6.tar.lz
tangerine-wallet-browser-20a075657f9c8133b65ea9cf6e8f1f633bc8a8e6.tar.xz
tangerine-wallet-browser-20a075657f9c8133b65ea9cf6e8f1f633bc8a8e6.tar.zst
tangerine-wallet-browser-20a075657f9c8133b65ea9cf6e8f1f633bc8a8e6.zip
Documentation for various controllers and libs
Diffstat (limited to 'app/scripts/lib/buy-eth-url.js')
-rw-r--r--app/scripts/lib/buy-eth-url.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/scripts/lib/buy-eth-url.js b/app/scripts/lib/buy-eth-url.js
index b9dde3c28..c7c7bc33c 100644
--- a/app/scripts/lib/buy-eth-url.js
+++ b/app/scripts/lib/buy-eth-url.js
@@ -1,5 +1,15 @@
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 adderss the bought ETH should be sent to. Only relevant if network === '1'.
+ * @returns {string} The url at which the user can access ETH, while in the given network
+ *
+ */
function getBuyEthUrl ({ network, amount, address }) {
let url
switch (network) {