Created
August 3, 2018 14:54
-
-
Save roniewill/e3bba126deca3ac04ec921a5b81200d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from "axios"; | |
const uriHeroku = "https://waves-ws.herokuapp.com"; | |
const uriWaves = "https://testnode1.wavesnodes.com"; | |
_newWalet = async () => { | |
try { | |
const response = await axios.get(`${uriHeroku}/new`); | |
const wallet = response.data; | |
//console.log(wallet); | |
return wallet; | |
} catch (error) { | |
console.error(error); | |
} | |
}; | |
_getBalance = address => { | |
const response = axios | |
.get(`${uriWaves}/addresses/balance/${address}`) | |
.then(response => response.data); | |
return response; | |
}; | |
_getTransactions = async (address, limit) => { | |
try { | |
const response = await axios.get( | |
`${uriWaves}/addresses/${address}/limit/${limit}` | |
); | |
const transactions = response.data; | |
//console.log(wallet); | |
return transactions; | |
} catch (error) { | |
console.error(error); | |
} | |
}; | |
export { _newWalet, _getBalance, _getTransactions }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment