add support for funding
This commit is contained in:
parent
8440fa3b1d
commit
bf0dc3f7f3
15 changed files with 731 additions and 356 deletions
19
lib/coin-utils.js
Normal file
19
lib/coin-utils.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
const coins = {
|
||||
BTC: {unitScale: 8},
|
||||
ETH: {unitScale: 18}
|
||||
}
|
||||
|
||||
const cryptoDisplays = [
|
||||
{cryptoCode: 'BTC', display: 'Bitcoin'},
|
||||
{cryptoCode: 'ETH', display: 'Ethereum'}
|
||||
]
|
||||
|
||||
module.exports = {coins, cryptoDisplays, buildUrl}
|
||||
|
||||
function buildUrl (cryptoCode, address) {
|
||||
switch (cryptoCode) {
|
||||
case 'BTC': return `bitcoin:${address}`
|
||||
case 'ETH': return `ethereum:${address}`
|
||||
default: throw new Error(`Unsupported crypto: ${cryptoCode}`)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue