convert-currency_crypto
v1.0.1
Published
Simple pacakage to convert amounts into crypto
Downloads
4
Maintainers
Readme
convert-currency_crypto
Installation
npm i convert-currency_crypto
Example
const { currencyToCrypto, cryptoToCurrency } = require("convert-currency_crypto");
(async () => {
const conversion1 = await currencyToCrypto({
amount: 10,
currency: "USD",
gateway: "bitcoin"
});
console.log(conversion1);
// -> Object
// {
// conversion: { amount: 10, currency: 'usd', gateway: 'bitcoin' },
// result: 0.00035466
// }
const conversion2 = await currencyToCrypto({
amount: 55,
currency: "eur",
gateway: "ethereum"
});
console.log(conversion2);
// -> Object
// {
// conversion: { amount: 55, currency: 'eur', gateway: 'ethereum' },
// result: 0.03225674
// }
const conversion3 = await cryptoToCurrency({
amount: 0.03142372,
currency: "eur",
gateway: "ethereum"
});
console.log(conversion3);
})()