Straks Explorer

class pystraksexplorer.StraksExplorer(api_base='https://api.straks.info/v2/')[source]
cmc_ticker(coin='STRAKS', currency='USD')[source]

Fetch current ticker of {coin} in the specified {currency} from coinmarketcap api

Parameters:currency (string) – The currency code to return the results in
Apisource:api.coinmarketcap.com
Endpoint:/v1/ticker/straks/?convert={currency}
Returns:ticker
get_address_balance(address)[source]

Fetch raw address balance

Parameters:address (string) – Wallet address
Endpoint:/addr/{address}/balance
Returns:address balance
get_address_total_received(address)[source]

Fetch raw address total received

Parameters:address (string) – Wallet address
Endpoint:/addr/{address}/totalReceived
Returns:total received
get_address_total_sent(address)[source]

Fetch raw address total sent

Parameters:address (string) – Wallet address
Endpoint:/addr/{address}/totalSent
Returns:total sent
get_block_from_block_hash(block_hash)[source]

Fetch block data for given blockhash

Parameters:block hash (string) – Block hash to lookup
Endpoint:/blocks/{blockHash}
Returns:block
get_block_hash_from_block_height(block_height)[source]

Fetch block hash for given block height

Parameters:block height (int) – Block height to lookup
Endpoint:/blocks-index/{blockHeight}
Returns:block hash
get_blocks(limit, page)[source]

Fetch a list of recent blocks

Parameters:
  • limit (int) – Blocks to return per page
  • page (int) – Page number to return
Endpoint:

/blocks?limit={limit}&page={page}

Returns:

blocks

get_circulating_supply()[source]

Fetch circulating supply

Endpoint:/raw/totalSupply
Returns:the circulating supply
get_difficulty()[source]

Fetch block difficulty

Endpoint:/raw/difficulty
Returns:the current difficulty on the network
get_difficulty_chart(days=1)[source]

Fetch difficulty chart

Parameters:days (string) – Total days to fetch. Default 1 / Max 7
Endpoint:/charts/difficulty?days={days}
Returns:difficulty chart data
get_hashrate_chart(days=1)[source]

Fetch hashrate chart data

Parameters:days (string) – Total days to fetch. Default 1 / Max 7
Endpoint:/charts/hashrate?days={days}
Returns:hashrate chart data
get_latest_block()[source]

Fetch the latest blockchain statistics

Endpoint:/statistics/latest
Returns:latest straks block in json object
get_masternodes(status, page, limit)[source]

Fetch masternodes

Parameters:
  • status (string) – Either enabled, vin_spent, expired or remove. Leave blank for all.
  • page (int) – Page number
  • limit (int) – Records per page
Endpoint:

/masternodes?status={status}&limit={limit}&page={page}

Returns:

masternode list

get_raw_block_from_block_hash(block_hash)[source]

Fetch raw block data for given block hash

Parameters:block_hash (string) – the block height to retrieve a block from
Endpoint:/rawblock/{blockHash}
Returns:raw block
get_raw_block_from_block_height(block_height)[source]

Fetch raw block data for given block height

Parameters:block_height (string) – the block height to retrieve a block from
Endpoint:/rawblock/{blockHeight}
Returns:raw block
get_raw_transaction_data_from_transaction_hash(transaction_hash)[source]

Fetch raw transaction data for given transaction hash

Parameters:transaction_hash (string) – Transaction hash to lookup
Endpoint:/rawtx/{transactionHash}
Returns:raw transaction data
get_richlist(limit=100)[source]

Fetch richlist

Parameters:limit (int) – limit of richlist entries to return
Endpoint:/richlist?limit={limit}
Returns:richlist
get_total_supply()[source]

Fetch coin supply

Endpoint:/raw/totalSupply
Returns:the total supply
get_transaction_chart(days=1)[source]

Fetch transaction chart data

Parameters:days (string) – Total days to fetch. Default 1 / Max 7
Endpoint:/charts/transactions?days={days}
Returns:transaction chart data
get_transactions_from_address(address, page, limit, summary=0)[source]

Fetch all transactions associated with given address

Parameters:
  • address (string) – Address to lookup
  • page (int) – Page number
  • limit (int) – Records per page
  • summary (int) – Ignore inputs/outputs (i.e. fetch transaction header details only)
Endpoint:

/txs?address={address}&pageNum={page}&limit={limit}&summary={summary}

Returns:

transaction data

get_transactions_from_blockhash(block_hash, page, limit, summary=0)[source]

Fetch all transactions associated with given blockhash

Parameters:
  • block_hash (string) – Block hash to lookup
  • page (int) – Page number
  • limit (int) – Records per page
  • summary (int) – Ignore inputs/outputs (i.e. fetch transaction header details only)
Endpoint:

/txs?block={blockHash}&pageNum={page}&limit={limit}&summary={summary}

Returns:

transaction data

get_transcation_data_from_transaction_hash(transaction_hash, summary=0)[source]

Fetch transaction data for given transaction hash

Parameters:
  • transcation_hash (string) – Transaction hash to lookup
  • summary (int) – Group input/output amounts by address / 0 = no, 1 = yes / Default 0
Endpoint:

/tx/{transactionHash}?summary={summary}

Returns:

transaction data