
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
This is the Ruby API client for the BankExchange service. Please read the official documentation to get further information http://bank.exchange/documentation
gem install bank_exchange_api
BankExchangeApi::Config.api_token = "33f411e7-cebe-4f7e-a8f3-24bfc8ecca6e"
BankExchangeApi::Config.logger = Logger.new(STDOUT)
# @option api_token [String]
# @option logger [Logger,StringIO]
@cli = BankExchangeApi::Cli.new(api_token: '33f411e7-cebe-4f7e-a8f3-24bfc8ecca6e')
# @return [Boolean]
@cli.ping #=> true
request = @cli.banks(countries: ['US'])
response = request.json
response.data # root-data of the endpoint
response.body # whole response data
reponse.params # request params in response
response.pagination # pagination params
response.next_page_url # next page URL if resource is paginatable
response.paginatable? # if resource is paginatable and next page exists
response.not_paginatable?
response.success? #=> true if response status code is 2xx
# @option countries [Array]
# @option countries [Array]
request = @cli.banks(countries: ['US'])
request.currencies = ['USD']
response = request.json
# @return [Hash]
response.params
{"countries"=>["US"], "currencies"=>["USD"]}
# @return [Hash]
response.data
[{"swift"=>"XXXXXXXX", "name"=>"Board of Governors of the Federal Reserve System", "country"=>"US", "currency"=>"USD", "website"=>"http://www.federalreserve.gov"}]
# @return [Hash]
response.body
{params: {"countries"=>["US"], "currencies"=>["USD"]}, banks: [{"swift"=>"XXXXXXXX", "name"=>"Board of Governors of the Federal Reserve System", "country"=>"US", "currency"=>"USD", "website"=>"http://www.federalreserve.gov"}]}
# @param swift [String]
# @option iso_to [Array]
# @option date [Date,String]
# @option fallback_days [Integer]
response = @cli.bank("XXXXXXXX", date: Date.today, iso_to: ['EUR']).json
response.params
{"swift"=>"XXXXXXXX", "iso_to"=>["EUR"], "date"=>"2016-03-22", "fallback_days"=>5}
response.data
[{"iso_from"=>"USD", "iso_to"=>"EUR", "rate"=>0.885582713425434, "inverse_rate"=>1.1292, "date"=>"2016-03-18"}]
response.body
{"params"=>{"swift"=>"XXXXXXXX", "iso_to"=>["EUR"], "date"=>"2016-03-22", "fallback_days"=>4}, "bank"=>{"swift"=>"XXXXXXXX", "name"=>"Board of Governors of the Federal Reserve System", "country"=>"US", "currency"=>"USD", "website"=>"http://www.federalreserve.gov"}, "rates"=>[{"iso_from"=>"USD", "iso_to"=>"EUR", "rate"=>0.885582713425434, "inverse_rate"=>1.1292, "date"=>"2016-03-18"}]}
response.pagination
{"current_page"=>1, "last_page"=>true, "per_page"=>200, "next_page_url"=>nil}
:warning: Please use pagination by providing a block. Otherwise first page returns.
data = []
@cli.bank("XXXXXXXX").json{ |response| data.concat(response.data) }
# @param swift [Array]
# @option iso_from [Array]
# @option iso_to [Array]
# @option date [Date,String]
# @option fallback_days [Integer]
response = @cli.rates(date: Date.today, iso_from: ['BYR'], iso_to: ['USD']).json
response.params
{"date"=>"2016-03-24", "swift"=>[], "iso_from"=>["BYR"], "iso_to"=>["USD"], "fallback_days"=>5}
response.data
[{"iso_from"=>"BYR", "iso_to"=>"USD", "rate"=>4.96007142502852e-05, "inverse_rate"=>20161.0, "swift"=>"NBRBBY2X", "date"=>"2016-03-24"}]
response.data
{"params"=>{"date"=>"2016-03-24", "swift"=>[], "iso_from"=>["BYR"], "iso_to"=>["USD"], "fallback_days"=>5}, "rates"=>[{"iso_from"=>"BYR", "iso_to"=>"USD", "rate"=>4.96007142502852e-05, "inverse_rate"=>20161.0, "swift"=>"NBRBBY2X", "date"=>"2016-03-24"}]}
response.pagination
{"current_page"=>1, "last_page"=>false, "per_page"=>200, "next_page_url"=>"http://api.bank.exchange/rates?iso_from=&iso_to=&page=2&swift="}
:warning: Please use pagination by providing a block. Otherwise first page returns.
data = []
@cli.rates.json{ |response| data.concat(response.data) }
# @param iso_code [String]
# @option iso_from [Array]
# @option iso_to [Array]
# @option date [Date,String]
# @option fallback_days [Integer]
response = @cli.rate('BYR', date: Date.today, iso_from: ['BYR'], iso_to: ['RUB']).json
response.params
{"iso_code"=>"BYR", "date"=>"2016-03-25", "iso_from"=>["BYR"], "iso_to"=>["RUB"], "fallback_days"=>5}
response.data
[{"iso_from"=>"BYR", "iso_to"=>"RUB", "rate"=>0.00340193910529002, "inverse_rate"=>293.95, "swift"=>"NBRBBY2X", "date"=>"2016-03-25"}]
response.body
{"params"=>{"iso_code"=>"BYR", "date"=>"2016-03-25", "iso_from"=>["BYR"], "iso_to"=>["RUB"], "fallback_days"=>5}, "rates"=>[{"iso_from"=>"BYR", "iso_to"=>"RUB", "rate"=>0.00340193910529002, "inverse_rate"=>293.95, "swift"=>"NBRBBY2X", "date"=>"2016-03-25"}]}
response.pagination
{"current_page"=>1, "last_page"=>true, "per_page"=>200, "next_page_url"=>nil}
:warning: Please use pagination by providing a block. Otherwise first page returns.
data = []
@cli.rate('BYR').json{ |response| data.concat(response.data) }
FAQs
Unknown package
We found that bank_exchange_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.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.