Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
google_currency_convert
Advanced tools
currency convert by google finance API
gem install google_currency_convert
GoogleCurrencyConvert.currency_info
=> ["AED United Arab Emirates Dirham (AED)", "AFN Afghan Afghani (AFN)", "ALL Albanian Lek (ALL)", "AMD Armenian Dram (AMD)", "ANG Netherlands Antillean Guilder (ANG)", "AOA Angolan Kwanza (AOA)", "ARS Argentine Peso (ARS)", "AUD Australian Dollar (A$)", "AWG Aruban Florin (AWG)", "AZN Azerbaijani Manat (AZN)", "BAM Bosnia-Herzegovina Convertible Mark (BAM)", "BBD Barbadian Dollar (BBD)", "BDT Bangladeshi Taka (BDT)",....]
You can get the currency code by country name. For example:
GoogleCurrencyConvert.currency_info.select { |i| i.include?("Jap")}
=> ["JPY Japanese Yen (¥)"]
GoogleCurrencyConvert.currency_codes
=> ["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTC", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHF", "CLF", "CLP", "CNH", "CNY", "COP", "CRC", "CUP", "CVE", "CZK", "DEM", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "IEP", "ILS", "INR", "IQD", "IRR", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKG", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XCD", "XDR", "XOF", "XPF", "YER", "ZAR", "ZMK", "ZMW", "ZWL"]
The amount parameter has the default value, so if don't pass the amount, you will get the currency rate.
GoogleCurrencyConvert.currency_convert(from_currency, to_currency, amount = 1)
Convert US Dollar to Chinese Yuan, for example:
GoogleCurrencyConvert.currency_convert("USD", "CNY")
=> 6.2092
Rspec test --format d
GoogleCurrencyConvert
currency info is a non-empty array
currency codes a non-empty array
return error if the currency code is invalid
return error if the currency amount is not a positive integer
get a float if the code and maount are right
Finished in 3.1 seconds (files took 0.32152 seconds to load)
5 examples, 0 failures
FAQs
Unknown package
We found that google_currency_convert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.