Module: TransactionsEndpoints

Extended by:
Params, Request
Included in:
Blockfrostruby::CardanoMainNet
Defined in:
lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb

Constant Summary

Constants included from Blockfrostruby

Blockfrostruby::VERSION

Instance Method Summary collapse

Methods included from Request

get_response, post_file, post_request_cbor, post_request_raw

Methods included from Params

define_params

Methods included from Validator

validate_init_params, validate_params

Methods included from Configuration

default_config, define_config

Instance Method Details

#get_transaction(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash).

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



16
17
18
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 16

def get_transaction(hash)
  Request.get_response("#{@url}/txs/#{hash}", @project_id)
end

#get_transaction_delegations(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/delegations.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



40
41
42
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 40

def get_transaction_delegations(hash)
  Request.get_response("#{@url}/txs/#{hash}/delegations", @project_id)
end

#get_transaction_metadata(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/metadata.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



80
81
82
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 80

def (hash)
  Request.get_response("#{@url}/txs/#{hash}/metadata", @project_id)
end

#get_transaction_metadata_in_cbor(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/metadata/cbor.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



88
89
90
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 88

def (hash)
  Request.get_response("#{@url}/txs/#{hash}/metadata/cbor", @project_id)
end

#get_transaction_mirs(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/mirs.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



56
57
58
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 56

def get_transaction_mirs(hash)
  Request.get_response("#{@url}/txs/#{hash}/mirs", @project_id)
end

#get_transaction_pool_retires(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/pool_retires.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



72
73
74
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 72

def get_transaction_pool_retires(hash)
  Request.get_response("#{@url}/txs/#{hash}/pool_retires", @project_id)
end

#get_transaction_pool_updates(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/pool_updates.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



64
65
66
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 64

def get_transaction_pool_updates(hash)
  Request.get_response("#{@url}/txs/#{hash}/pool_updates", @project_id)
end

#get_transaction_stakes(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/stakes.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



32
33
34
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 32

def get_transaction_stakes(hash)
  Request.get_response("#{@url}/txs/#{hash}/stakes", @project_id)
end

#get_transaction_utxos(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/utxos.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



24
25
26
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 24

def get_transaction_utxos(hash)
  Request.get_response("#{@url}/txs/#{hash}/utxos", @project_id)
end

#get_transaction_withdrawals(hash) ⇒ Hash

Calls get request on (@url)/txs/(hash)/withdrawals.

Parameters:

  • hash (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



48
49
50
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 48

def get_transaction_withdrawals(hash)
  Request.get_response("#{@url}/txs/#{hash}/withdrawals", @project_id)
end

#submit_transaction(transaction_data) ⇒ Hash

Calls post request on (@url)/txs/submit.

Parameters:

  • transaction_data (String) —

    will be added to the url for get request.

Returns:

  • (Hash) —

    formatted result with status and body keys.



96
97
98
# File 'lib/blockfrostruby/endpoints/cardano/transactions_endpoints.rb', line 96

def submit_transaction(transaction_data)
  Request.post_request_cbor("#{@url}/tx/submit", @project_id, transaction_data)
end