Account API

Standard endpoints

class blockscan.modules.accounts.Accounts[source]
static get_currency_balance(address: str)[source]

Get the Currency balance of an account.

Parameters

address (str) – Target account.

Returns

Its balance as a string. Must be manually cast to float.

Return type

str

static get_currency_balance_multiple(addresses: List[str])[source]

Get the currency balance of multiple accounts.

Note

Max 20 accounts per call are supported.**

Parameters

addresses (List[str]) – List of target accounts.

Returns

Their balances in a list of dictionaries.

Return type

List[dict]

static get_internal_txs_by_address(address: str, startblock: int, endblock: int, sort: str)[source]

Get a list of all internal transactions for an address.

Note

Returns the 10,000 most recent transactions.

Parameters
  • address (str) – Target address.

  • startblock (int) – Start block of the query.

  • endblock (int) – End block of the query.

  • sort (str) – “asc” to return results in ascending order.

Returns

A list of dictionaries of internal transactions.

Return type

List[dict]

static get_internal_txs_by_address_paginated(address: str, page: int, offset: int, startblock: int, endblock: int, sort: str)[source]

Get a list of all internal transactions for an address as numbered pages.

Parameters
  • address (str) – Target address.

  • page (int) – Page number to fetch.

  • offset (int) – Max records to return.

  • startblock (int) – Start block of the query.

  • endblock (int) – End block of the query.

  • sort (str) – “asc” to return results in ascending order.

Returns

All transactions on requested page as a list of dictionaries.

Return type

List[dict]

static get_internal_txs_by_block_range_paginated(startblock: int, endblock: int, page: int, offset: int, sort: str)[source]

Get all internal transactions given for a given block range as numbered pages.

Note

Returns the 10,000 most recent transactions.

Parameters
  • startblock (int) – Start block of the query.

  • endblock (int) – End block of the query.

  • page (int) – Page number to fetch.

  • offset (int) – Max records to return.

  • sort (str) – “asc” to return results in ascending order.

Returns

All internal transactions as a list of dictionaries.

Return type

List[dict]

static get_internal_txs_by_txhash(txhash: str)[source]

Get all internal transactions given for a tx hash.

Note

Returns the 10,000 most recent transactions.

Parameters

txhash (str) – Target tx hash.

Returns

All internal transactions as a list of dictionaries.

Return type

List[dict]

static get_mined_blocks_by_address(address: str)[source]

Get a list of validated blocks by a specific address.

Parameters

address (str) – Target validator address.

Returns

All validated blocks as a list of dictionaries.

Return type

List[dict]

static get_mined_blocks_by_address_paginated(address: str, page: int, offset: int)[source]

Get a list of validated blocks by a specific address as numbered pages.

Parameters
  • address (str) – Target validator address.

  • page (int) – Page number to fetch.

  • offset (int) – Max records to return.

Returns

All validated blocks as list of dictionaries per page.

Return type

List[dict]

static get_nfttx_token_transfer_events_by_address(address: str, startblock: int, endblock: int, sort: str)[source]

Get all BEP721 token transfer events for a given address.

Note

Returns the 10,000 most recent events.

Parameters
  • address (str) – Target address.

  • startblock (int) – Start block of the query.

  • endblock (int) – End block of the query.

  • sort (str) – “asc” to return results in ascending order.

Returns

All token transfers for target address.

Return type

List[dict]

static get_nfttx_token_transfer_events_by_address_and_contract_paginated(contract_address: str, address: str, page: int, offset: int, sort: str)[source]

Get all token transfers for a given BEP721 contract and wallet as numbered pages.

Parameters
  • contract_address (str) – Target contract address.

  • address (str) – Target wallet address.

  • page (int) – Page number to fetch.

  • offset (int) – Max records to return.

  • sort (str) – “asc” to return results in ascending order.

Returns

All token transfers as a list of dictionaries.

Return type

List[dict]

static get_nfttx_token_transfer_events_by_contract_address_paginated(contract_address: str, page: int, offset: int, sort: str)[source]

Get all token transfer events for a given BEP721 contract as numbered pages.

Note

Returns the 10,000 most recent events.

Parameters
  • contract_address (str) – Target contract address.

  • page (int) – Page number to fetch.

  • offset (int) – Max records to return.

  • sort (str) – “asc” to return results in ascending order.

Returns

All token transfers for target contract address.

Return type

List[dict]

static get_normal_txs_by_address(address: str, startblock: int, endblock: int, sort: str)[source]

Get a list of all normal transactions for an address.

Note

Returns the 10,000 most recent transactions.

Parameters
  • address (str) – Target address.

  • startblock (int) – Start block of the query.

  • endblock (int) – End block of the query.

  • sort (str) – “asc” to return results in ascending order.

Returns

A list of dictionaries of normal transactions.

Return type

List[dict]

static get_normal_txs_by_address_paginated(address: str, page: int, offset: int, startblock: int, endblock: int, sort: str)[source]

Get a list of all normal transactions for an address as numbered pages.

Parameters
  • address (str) – Target address.

  • page (int) – Page number to fetch.

  • offset (int) – Max records to return.

  • startblock (int) – Start block of the query.

  • endblock (int) – End block of the query.

  • sort (str) – “asc” to return results in ascending order.

Returns

All transactions on requested page as a list of dictionaries.

Return type

List[dict]

static get_tokentx_token_transfer_events_by_address(address: str, startblock: int, endblock: int, sort: str)[source]

Get all BEP20 token transfer events for a given address.

Note

Returns the 10,000 most recent events.

Parameters
  • address (str) – Target address.

  • startblock (int) – Start block of the query.

  • endblock (int) – End block of the query.

  • sort (str) – “asc” to return results in ascending order.

Returns

All token transfers for target address.

Return type

List[dict]

static get_tokentx_token_transfer_events_by_address_and_contract_paginated(contract_address: str, address: str, page: int, offset: int, sort: str)[source]

Get all token transfers for a given BEP20 contract and wallet as numbered pages.

Parameters
  • contract_address (str) – Target contract address.

  • address (str) – Target wallet address.

  • page (int) – Page number to fetch.

  • offset (int) – Max records to return.

  • sort (str) – “asc” to return results in ascending order.

Returns

All token transfers as a list of dictionaries.

Return type

List[dict]

static get_tokentx_token_transfer_events_by_contract_address_paginated(contract_address: str, page: int, offset: int, sort: str)[source]

Get all token transfer events for a given BEP20 contract as numbered pages.

Note

Returns the 10,000 most recent events.

Parameters
  • contract_address (str) – Target contract address.

  • page (int) – Page number to fetch.

  • offset (int) – Max records to return.

  • sort (str) – “asc” to return results in ascending order.

Returns

All token transfers for target contract address.

Return type

List[dict]

Pro endpoints

class blockscan.modules.accounts.ProAccounts[source]
static get_hist_eth_balance_for_address_by_block_no(address: str, block_no: int) str[source]

Note

Pro API token required

Returns the balance of an address at a certain block height.

Parameters
  • address (str) – the string representing the address to check for balance

  • block_no (int) – the block number to check balance for

Returns

address balance

Return type

str