1.0.1 • Published 1 year ago

convert-currency_crypto v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

convert-currency_crypto

convert-currency_crypto on npm

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);
})()
1.0.1

1 year ago

1.0.0

1 year ago