Skip to content

Instantly share code, notes, and snippets.

@roniewill
Created August 3, 2018 14:54
Show Gist options
  • Save roniewill/e3bba126deca3ac04ec921a5b81200d7 to your computer and use it in GitHub Desktop.
Save roniewill/e3bba126deca3ac04ec921a5b81200d7 to your computer and use it in GitHub Desktop.
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