
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Currency Layer API is a light wrapper for currencylayer.com for Rubyists.
Install the gem and add to the application's Gemfile by executing:
$ bundle add currency_layer_api
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install currency_layer_api
The API documentation can be found here.
Create an account on currencylayer.com and get your API access key.
Save the access key in an environment variable named CURRENCY_LAYER_ACCESS_KEY
.
Currency Layer does not allow you ssl endpoint unless you have a paid account. By default ssl is enabled. To disable ssl, set the ssl
option to false
.
require 'currency_layer_api'
client = CurrencyLayerApi::Client.new(access_key: ENV['CURRENCY_LAYER_ACCESS_KEY'], ssl: true)
params:
access_key
- Required - String - Your API access key.ssl
- Optional - Boolean - Enable or disable ssl. Default is true
.response:
#<CurrencyLayerApi::Client:0x00007f9b0a0b0a00 @access_key="YOUR_ACCESS_KEY", @ssl=true>
client.list
response:
[
#<CurrencyLayerApi::Currency:0x00007f9b0a0b0a00 @code="AED", @name="United Arab Emirates Dirham">,
#<CurrencyLayerApi::Currency:0x00007f9b0a0b09c0 @code="AFN", @name="Afghan Afghani">,
...
]
client.live(from: "USD", to: ["AED", "EUR"])
params:
from
Required - String - The currency you want to convert from. (default: USD)to
Optional - Array[String] - The currencies you want to convert to. (default: nil)response:
[
#<CurrencyLayerApi::Conversion:0x00007f9b0a0b0a00 @from_code="USD", @to_code="AED", @value=3.6725, @date="2019-01-01">,
#<CurrencyLayerApi::Conversion:0x00007f9b0a0b09c0 @from_code="USD", @to_code="EUR", @value=0.888, @date="2019-01-01">,
]
client.historical(from: "USD", to: ["AED", "EUR"], date: "2019-01-01")
params:
from
Required - String - The currency you want to convert from. (default: USD)to
Optional - Array[String] - The currencies you want to convert to. (default: nil)date
Required - String 'YYYY-MM-DD' - The date you want to get the exchange rates for. (default: nil)response:
[
#<CurrencyLayerApi::Conversion:0x00007f9b0a0b0a00 @from_code="USD", @to_code="AED", @value=3.6725, @date="2019-01-01">,
#<CurrencyLayerApi::Conversion:0x00007f9b0a0b09c0 @from_code="USD", @to_code="EUR", @value=0.888, @date="2019-01-01">,
]
client.convert(from: "USD", to: "AED", amount: 100)
params:
from
Required - String - The currency you want to convert from. (default: USD)to
Required - String - The currency you want to convert to. (default: nil)amount
Required - Int - The amount you want to convert. (default: nil)date
Optional - String 'YYYY-MM-DD' - The date you want to get the exchange rates for. (default: nil)response:
367.25
begin
client.live(from: "USD", to: ["AED", "EUR"])
rescue CurrencyLayerApi::Error => e
puts e.code
puts e.message
end
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/currency_layer_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the CurrencyLayerApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that currency_layer_api 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.