21 lines
551 B
JavaScript
21 lines
551 B
JavaScript
|
fetch = require("node-fetch")
|
||
|
|
||
|
config = require("../config.js")
|
||
|
|
||
|
function accountPrice(username){
|
||
|
return new Promise((resolve, reject) => {
|
||
|
fetch(config.avalonNode+"accountPrice/"+username, {
|
||
|
method: 'get',
|
||
|
headers: {
|
||
|
'Accept': 'application/json, text/plain, */*',
|
||
|
'Content-Type': 'application/json'
|
||
|
}
|
||
|
}).then(res => {
|
||
|
resolve(res.text())
|
||
|
}).catch(function(error) {
|
||
|
reject(error)
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
|
||
|
module.exports = accountPrice
|