Strike bugfix (#122)
This commit is contained in:
parent
bce177c63c
commit
25030fab2a
4 changed files with 33 additions and 8 deletions
8
install
8
install
|
|
@ -160,7 +160,13 @@ cat <<EOF > $CONFIG_DIR/lamassu.json
|
||||||
"lamassuServerPath": "$NODE_MODULES/lamassu-server",
|
"lamassuServerPath": "$NODE_MODULES/lamassu-server",
|
||||||
"migrateStatePath": "$MIGRATE_STATE_PATH",
|
"migrateStatePath": "$MIGRATE_STATE_PATH",
|
||||||
"blockchainDir": "$BLOCKCHAIN_DIR",
|
"blockchainDir": "$BLOCKCHAIN_DIR",
|
||||||
"ofacDataDir": "$OFAC_DATA_DIR"
|
"ofacDataDir": "$OFAC_DATA_DIR",
|
||||||
|
"strike": {
|
||||||
|
"baseUrl": "https://api.strike.acinq.co/api/"
|
||||||
|
},
|
||||||
|
"coinAtmRadar": {
|
||||||
|
"url": "https://coinatmradar.info/api/lamassu/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,10 @@ module.exports = {
|
||||||
cryptoNetwork
|
cryptoNetwork
|
||||||
}
|
}
|
||||||
|
|
||||||
axios.defaults.baseURL = options.strike.baseUrl
|
axios.defaults.baseURL = _.get('strike.baseUrl', options)
|
||||||
|
if (_.isEmpty(axios.defaults.baseURL)) {
|
||||||
|
throw new Error('Missing Strike baseUrl!')
|
||||||
|
}
|
||||||
|
|
||||||
function cryptoNetwork (account, cryptoCode) {
|
function cryptoNetwork (account, cryptoCode) {
|
||||||
return Promise.resolve('test')
|
return Promise.resolve('test')
|
||||||
|
|
@ -34,11 +37,18 @@ function createCharge (account, info) {
|
||||||
currency: 'btc',
|
currency: 'btc',
|
||||||
description: 'Lamassu cryptomat cash-out'
|
description: 'Lamassu cryptomat cash-out'
|
||||||
}
|
}
|
||||||
|
const token = _.get('token', account)
|
||||||
|
if (_.isEmpty(token)) {
|
||||||
|
return Promise.reject(new Error('Missing Strike account token!'))
|
||||||
|
}
|
||||||
|
|
||||||
return axios({
|
return axios({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: 'v1/charges',
|
url: 'v1/charges',
|
||||||
auth: {username: account.token, password: ''},
|
auth: {
|
||||||
|
username: token,
|
||||||
|
password: ''
|
||||||
|
},
|
||||||
data
|
data
|
||||||
}).then(_.get('data'))
|
}).then(_.get('data'))
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +56,6 @@ function createCharge (account, info) {
|
||||||
function newAddress (account, info) {
|
function newAddress (account, info) {
|
||||||
return checkCryptoCode(info.cryptoCode)
|
return checkCryptoCode(info.cryptoCode)
|
||||||
.then(() => createCharge(account, info))
|
.then(() => createCharge(account, info))
|
||||||
.then(_.tap(console.log))
|
|
||||||
.then(r => `strike:${r.id}:${r.payment_hash}:${r.payment_request}`)
|
.then(r => `strike:${r.id}:${r.payment_hash}:${r.payment_request}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
16
package-lock.json
generated
16
package-lock.json
generated
|
|
@ -1186,6 +1186,11 @@
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
||||||
"integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE="
|
"integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE="
|
||||||
|
},
|
||||||
|
"lodash": {
|
||||||
|
"version": "4.17.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
|
||||||
|
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1219,6 +1224,11 @@
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
||||||
"integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE="
|
"integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE="
|
||||||
|
},
|
||||||
|
"lodash": {
|
||||||
|
"version": "4.17.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
|
||||||
|
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -5705,9 +5715,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lodash": {
|
"lodash": {
|
||||||
"version": "4.17.4",
|
"version": "4.17.10",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
||||||
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
|
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
|
||||||
},
|
},
|
||||||
"lodash.clonedeep": {
|
"lodash.clonedeep": {
|
||||||
"version": "4.5.0",
|
"version": "4.5.0",
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
"inquirer": "^5.2.0",
|
"inquirer": "^5.2.0",
|
||||||
"kraken-api": "github:DeX3/npm-kraken-api",
|
"kraken-api": "github:DeX3/npm-kraken-api",
|
||||||
"lnd-async": "^1.2.0",
|
"lnd-async": "^1.2.0",
|
||||||
"lodash": "^4.17.2",
|
"lodash": "^4.17.10",
|
||||||
"longjohn": "^0.2.12",
|
"longjohn": "^0.2.12",
|
||||||
"make-dir": "^1.0.0",
|
"make-dir": "^1.0.0",
|
||||||
"mem": "^1.1.0",
|
"mem": "^1.1.0",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue