feat: galoy account setup
This commit is contained in:
parent
f870b9f563
commit
688ec0bcbc
8 changed files with 87 additions and 7 deletions
23
lib/admin/schemas/gajoy.json
Normal file
23
lib/admin/schemas/gajoy.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"code": "galoy",
|
||||
"display": "Galoy",
|
||||
"fields": [
|
||||
{
|
||||
"code": "apiKey",
|
||||
"display": "API Key",
|
||||
"fieldType": "string",
|
||||
"secret": true,
|
||||
"required": true,
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"code": "walletId",
|
||||
"display": "Wallet ID",
|
||||
"fieldType": "password",
|
||||
"secret": true,
|
||||
"required": true,
|
||||
"value": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -25,7 +25,8 @@ const SECRET_FIELDS = [
|
|||
'binance.privateKey',
|
||||
'twilio.authToken',
|
||||
'telnyx.apiKey',
|
||||
'vonage.apiSecret'
|
||||
'vonage.apiSecret',
|
||||
'galoy.walletId'
|
||||
]
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
const { COINS } = require('@lamassu/coins')
|
||||
const _ = require('lodash/fp')
|
||||
const { utils: coinUtils } = require('@lamassu/coins')
|
||||
|
||||
const kraken = require('../exchange/kraken')
|
||||
const bitstamp = require('../exchange/bitstamp')
|
||||
|
|
@ -27,15 +28,16 @@ const ALL = {
|
|||
}
|
||||
|
||||
function buildMarket (fiatCode, cryptoCode, serviceName) {
|
||||
if (!_.includes(cryptoCode, ALL[serviceName].CRYPTO)) {
|
||||
throw new Error('Unsupported crypto: ' + cryptoCode)
|
||||
const externalCryptoCode = coinUtils.getExternalCryptoCode(cryptoCode)
|
||||
if (!_.includes(externalCryptoCode, ALL[serviceName].CRYPTO)) {
|
||||
throw new Error('Unsupported crypto: ' + externalCryptoCode)
|
||||
}
|
||||
const fiatSupported = ALL[serviceName].FIAT
|
||||
if (fiatSupported !== 'ALL_CURRENCIES' && !_.includes(fiatCode, fiatSupported)) {
|
||||
logger.info('Building a market for an unsupported fiat. Defaulting to EUR market')
|
||||
return cryptoCode + '/' + 'EUR'
|
||||
}
|
||||
return cryptoCode + '/' + fiatCode
|
||||
return externalCryptoCode + '/' + fiatCode
|
||||
}
|
||||
|
||||
function verifyFiatSupport (fiatCode, serviceName) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue