Skip to content

Commit df2e2b5

Browse files
authored
Merge pull request #15 from blockfrost/develop
Implement endpoints specs
2 parents 0453ec3 + af33fb8 commit df2e2b5

26 files changed

Lines changed: 2038 additions & 81 deletions

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BF_IPFS_PROJECT_ID=
2+
BF_MAINNET_PROJECT_ID=
3+
BF_TESTNET_PROJECT_ID=

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
*.gem
1111
*.lock
12+
*.env
1213

1314
# rspec failure tracking
1415
.rspec_status

.rubocop.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AllCops:
55
# Metrics
66

77
Metrics/BlockLength:
8-
Max: 240
8+
Max: 350
99

1010
Metrics/MethodLength:
1111
Max: 30
@@ -37,3 +37,6 @@ Naming/AccessorMethodName:
3737

3838
Layout/LineLength:
3939
Max: 150
40+
41+
Naming/FileName:
42+
Enabled: false

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ source 'https://rubygems.org'
55
# Specify your gem's dependencies in blockfrostruby.gemspec
66
gemspec
77

8+
gem 'dotenv'
89
gem 'rake', '~> 13.0'
910
gem 'rspec', '~> 3.0'
10-
gem 'webmock'

lib/blockfrost-ruby.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# require 'blockfrost-ruby'
66
# blockfrost = Blockfrostruby::CardanoMainNet.new()
77

8+
require 'dotenv/load'
9+
810
require_relative 'blockfrostruby/version'
911
require_relative 'blockfrostruby/constants'
1012
require_relative 'blockfrostruby/configuration'

lib/blockfrostruby/endpoints/cardano/accounts_endpoints.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get_account_delegations(address, params = {})
5454
# @return [Hash] formatted result with status and body keys.
5555
def get_account_registrations(address, params = {})
5656
params = Params.define_params(params, @config)
57-
Request.get_response("#{@url}/accounts/#{address}/registations", @project_id, params)
57+
Request.get_response("#{@url}/accounts/#{address}/registrations", @project_id, params)
5858
end
5959

6060
# Calls get request on (@url)/accounts/(address)/withdrawals.
@@ -82,9 +82,9 @@ def get_account_mirs(address, params = {})
8282
# @param address [String] will be added to the url for get request.
8383
# @param params [Hash] - params passed by user.
8484
# @return [Hash] formatted result with status and body keys.
85-
def get_account_addresses(address, params = {})
85+
def get_account_assosiated_addresses(address, params = {})
8686
params = Params.define_params(params, @config)
87-
Request.get_response("#{@url}/accounts/#{address}/addresses", @project_id, params, @config)
87+
Request.get_response("#{@url}/accounts/#{address}/addresses", @project_id, params)
8888
end
8989

9090
# Calls get request on (@url)/accounts/(address)/addresses/assets.

lib/blockfrostruby/endpoints/cardano/addresses_endpoints.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module AddressesEndpoints
1313
#
1414
# @param address [String] will be added to the url for get request.
1515
# @return [Hash] formatted result with status and body keys.
16-
def get_address(address)
16+
def get_specific_address(address)
1717
Request.get_response("#{@url}/addresses/#{address}", @project_id)
1818
end
1919

lib/blockfrostruby/endpoints/cardano/assets_endpoints.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ def get_assets(params = {})
2323
# @param asset [String] will be added to the url for get request.
2424
# @param params [Hash] - params passed by user.
2525
# @return [Hash] formatted result with status and body keys.
26-
def get_asset(asset, params = {})
27-
params = Params.define_params(params, @config)
28-
Request.get_response("#{@url}/assets/#{asset}", @project_id, params)
26+
def get_specific_asset(asset)
27+
Request.get_response("#{@url}/assets/#{asset}", @project_id)
2928
end
3029

3130
# Calls get request on (@url)/assets/(asset)/history.

lib/blockfrostruby/endpoints/cardano/epochs_endpoints.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ def get_latest_epoch_parameters
2929
# @param epoch_number [String] will be added to the url for get request.
3030
# @param params [Hash] - params passed by user.
3131
# @return [Hash] formatted result with status and body keys.
32-
def get_epoch(epoch_number, params = {})
33-
params = Params.define_params(params, @config)
34-
Request.get_response("#{@url}/epochs/#{epoch_number}", @project_id, params)
32+
def get_epoch(epoch_number)
33+
Request.get_response("#{@url}/epochs/#{epoch_number}", @project_id)
3534
end
3635

3736
# Calls get request on (@url)/epochs/(epoch_number)/next.

0 commit comments

Comments
 (0)