class Cardano
Public Instance Methods
get(endpoint)
click to toggle source
get Takes an endpoint string and a JSON body
# File lib/cardano.rb, line 108 def get(endpoint) uri = URI(@@root_url + endpoint) # Send the request response = Net::HTTP.get(uri) return response end
getBlockSummary(block)
click to toggle source
Returns the summary of a given block Takes a block hash as a string
# File lib/cardano.rb, line 24 def getBlockSummary(block) return JSON.parse(get('/api/blocks/summary/' + block))['Right'] end
getBlockTransactionSummary(txs)
click to toggle source
Returns the summary of a given transaction Takes a block hash as a string
# File lib/cardano.rb, line 30 def getBlockTransactionSummary(txs) return JSON.parse(get('/api/blocks/txs/' + txs))['Right'] end
getEpochPages(epoch)
click to toggle source
Returns all paged slots in a specified epoch Takes an epoch as a string
# File lib/cardano.rb, line 40 def getEpochPages(epoch) return JSON.parse(get('/api/epochs/' + epoch))['Right'] end
getEpochSlot(epoch, slot)
click to toggle source
Returns information about a specified slot in an epoch Takes an epoch and a slot as strings
# File lib/cardano.rb, line 46 def getEpochSlot(epoch, slot) return JSON.parse(get('/api/epochs/' + epoch + '/' + slot))['Right'] end
getGenesisAddress()
click to toggle source
Returns address information of the genesis block
# File lib/cardano.rb, line 55 def getGenesisAddress() return JSON.parse(get('/api/genesis/address'))['Right'] end
getGenesisPages()
click to toggle source
Returns the total pages of the genesis block
# File lib/cardano.rb, line 65 def getGenesisPages() return JSON.parse(get('/api/genesis/address/pages/total'))['Right'] end
getGenesisSummary()
click to toggle source
Returns a summary of the genesis block
# File lib/cardano.rb, line 60 def getGenesisSummary() return JSON.parse(get('/api/genesis/summary'))['Right'] end
getLastTransactions()
click to toggle source
Returns information about the last N transactions
# File lib/cardano.rb, line 92 def getLastTransactions() return JSON.parse(get('/api/txs/last'))['Right'] end
getPages()
click to toggle source
Returns the list of blocks, contained in pages
# File lib/cardano.rb, line 13 def getPages() return JSON.parse(get('/api/blocks/pages'))['Right'] end
getStats()
click to toggle source
Returns transaction stats
# File lib/cardano.rb, line 74 def getStats() return JSON.parse(get('/api/stats/txs'))['Right'] end
getSupply()
click to toggle source
Returns the total ADA supply
# File lib/cardano.rb, line 83 def getSupply() return JSON.parse(get('/api/supply/ada'))['Right'] end
getTotalPages()
click to toggle source
Returns the list of total pages
# File lib/cardano.rb, line 18 def getTotalPages() return JSON.parse(get('/api/blocks/pages/total'))['Right'] end
getTransactionSummary(txid)
click to toggle source
Returns a summary of a specific transaction Takes a transaction ID as a string
# File lib/cardano.rb, line 98 def getTransactionSummary(txid) return JSON.parse(get('/api/txs/summary/' + txid))['Right'] end