Module: IPFSEndpoints
- Included in:
- Blockfrostruby::IPFS
- Defined in:
- lib/blockfrostruby/endpoints/ipfs/ipfs_endpoints.rb
Constant Summary
Constants included from Blockfrostruby
Instance Method Summary collapse
-
#add_a_file(filepath) ⇒ Hash
Calls post request on (@url)/ipfs/add.
-
#get_localstorage_pinned_object(ipfs_path) ⇒ Hash
Calls get request on (@url)/ipfs/pin/list/(ipfs_path).
-
#get_localstorage_pinned_objects_list(params = {}) ⇒ Hash
Calls get request on (@url)/ipfs/pin/list.
-
#get_relay_to_ipfs_gateway(ipfs_path) ⇒ Hash
Calls get request on (@url)/ipfs/gateway/(ipfs_path).
-
#pin_an_object(ipfs_path) ⇒ Hash
Calls post request on (@url)/ipfs/pin/add/(ipfs_path).
-
#remove_pinned_object(ipfs_path) ⇒ Hash
Calls post request on (@url)/ipfs//pin/remove/(ipfs_path).
Methods included from Request
get_response, post_file, post_request_cbor, post_request_raw
Methods included from Params
Methods included from Validator
validate_init_params, validate_params
Methods included from Configuration
Instance Method Details
#add_a_file(filepath) ⇒ Hash
Calls post request on (@url)/ipfs/add
39 40 41 |
# File 'lib/blockfrostruby/endpoints/ipfs/ipfs_endpoints.rb', line 39 def add_a_file(filepath) Request.post_file("#{@url}/ipfs/add", @project_id, filepath) end |
#get_localstorage_pinned_object(ipfs_path) ⇒ Hash
Calls get request on (@url)/ipfs/pin/list/(ipfs_path)
23 24 25 |
# File 'lib/blockfrostruby/endpoints/ipfs/ipfs_endpoints.rb', line 23 def get_localstorage_pinned_object(ipfs_path) Request.get_response("#{@url}/ipfs/pin/list/#{ipfs_path}", @project_id) end |
#get_localstorage_pinned_objects_list(params = {}) ⇒ Hash
Calls get request on (@url)/ipfs/pin/list
14 15 16 17 |
# File 'lib/blockfrostruby/endpoints/ipfs/ipfs_endpoints.rb', line 14 def get_localstorage_pinned_objects_list(params = {}) params = Params.define_params(params, @config) Request.get_response("#{@url}/ipfs/pin/list", @project_id, params) end |
#get_relay_to_ipfs_gateway(ipfs_path) ⇒ Hash
Calls get request on (@url)/ipfs/gateway/(ipfs_path)
31 32 33 |
# File 'lib/blockfrostruby/endpoints/ipfs/ipfs_endpoints.rb', line 31 def get_relay_to_ipfs_gateway(ipfs_path) Request.get_response("#{@url}/ipfs/gateway/#{ipfs_path}", @project_id) end |
#pin_an_object(ipfs_path) ⇒ Hash
Calls post request on (@url)/ipfs/pin/add/(ipfs_path)
47 48 49 |
# File 'lib/blockfrostruby/endpoints/ipfs/ipfs_endpoints.rb', line 47 def pin_an_object(ipfs_path) Request.post_request_raw("#{@url}/ipfs/pin/add/#{ipfs_path}", @project_id) end |
#remove_pinned_object(ipfs_path) ⇒ Hash
Calls post request on (@url)/ipfs//pin/remove/(ipfs_path)
55 56 57 |
# File 'lib/blockfrostruby/endpoints/ipfs/ipfs_endpoints.rb', line 55 def remove_pinned_object(ipfs_path) Request.post_request_raw("#{@url}/ipfs/pin/remove/#{ipfs_path}", @project_id) end |