web3data.handlers.token

This module contains the address subhandler.

class web3data.handlers.token.TokenHandler(initial_headers: Dict[str, str], chain: web3data.chains.Chains)[source]

Bases: web3data.handlers.base.BaseHandler

The subhandler for token-related queries.

holders_historical(address: str, **kwargs) → Dict[source]

Retrieves the historical (time series) token holders for the specified token address.

Parameters

address – The token’s smart contract address

Key holderAddresses

A comma separated list of addresses for which the historical holdings are to be retrieved. (str)

Key timeFormat

The time format to use for the timestamps: milliseconds/ms or iso/iso861. (str)

Key timeFrame

The time frame to return the historical data in: by day (1d, 2d, …, all), by hour (1h, 2h, …, 72h), by minute (1m, 2m, …, 360m) or by tick (1t, 10t, …, 1000t). (str)

Key includePrice

Indicates whether or not to include price data with the results. (bool)

Key currency

The currency of the price information. Options: usd, btc. Only used in conjunction with includePrice. (str)

Returns

The API response parsed into a dict

holders_latest(address: str, **kwargs) → Dict[source]

Retrieves the token holders for the specified address.

Parameters

address – The token’s smart contract address

Key numTokens

Filter by token holders who own the specified amount of tokens. (int)

Key numTokensGt

Filter by token holders who own more than the specified amount of tokens (int)

Key numTokensGte

Filter by token holders who own more than or equal to the specified amount of tokens (int)

Key numTokensLt

Fitler by token holders who own less than the specified amount of tokens (int)

Key numTokensLte

Filter by token holders who own less than or equal to the specified amount of tokens (int)

Key tokenAddress

Filter by token holders for this token (mandatory) (str)

Key timestampGt

Filter by token holders who started holding the token after the specified date (int)

Key timestampGte

Filter by token holders who started holding the token after or equal to the specified date (int)

Key timestampLt

Filter by token holders who started holding the token before the specified date (int)

Key timestampLte

Filter by token holders who started holding the token before or equal to the specified date (int)

Key includePrice

Indicates whether or not to include price data with the results. Options: true, false. (bool)

Key currency

The currency of the price information (usd or btc.) - only used in conjunction with includePrice. (str)

Key page

The page number to return. (int)

Key size

Number of records per page (int)

Returns

The API response parsed into a dict

supply_historical(address: str, **kwargs) → Dict[source]

Retrieves the historical token supplies (and derivatives) for the specified address.

Parameters
  • address – The token’s smart contract address

  • kwargs – Additional query parameter options

Key timeFormat

The time format to use for the timestamps: milliseconds/ms or iso/iso861. (str)

Key timeInterval

The time interval to return the historical data in: by day (days) or by hour (hours). (str)

Key startDate

Filter by token prices after this date - note that the interval can not exceed 6 months (d), or 30 days (h). (int)

Key endDate

Filter by token prices before this date - note that the interval can not exceed 6 months (d), or 30 days (h). (int)

Returns

The API response parsed into a dict

supply_latest(address: str) → Dict[source]

Retrieves the latest token supplies (and derivatives) for the specified address.

Parameters

address – The token’s smart contract address

Returns

The API response parsed into a dict

transfers(address: str, **kwargs) → Dict[source]

Retrieves all token transfers involving the specified address.

Parameters

address – The token’s smart contract address

Key amount

Filter by token transfers which value is equal to this amount. (int)

Key amountGt

Filter by token transfers which value is greater than this amount. (int)

Key amountGte

Filter by token transfers which value is greater than or equal to this amount. (int)

Key amountLt

Filter by token transfers which value is less than this amount. (int)

Key amountLte

Filter by token transfers which value is less than or equal to this amount (int)

Key blockNumber

Filter by token transfers with this block number. (int)

Key recipientAddress

Filter by token transfers which recipient is the specified address. (str)

Key senderAddress

Filter by token transfers which sender is the specified address. (str)

Key startDate

Filter by token transfers which happened after this date. (int)

Key endDate

Filter by token transfers which happened before this date. (int)

Key tokenAddress

Filter by token transfers for this token. (str)

Key transactionHash

Filter by token transfers for this transaction hash. (str)

Key page

The page number to return. (int)

Key size

Number of records per page. (int)

Key validationMethod

The validation method to be added to the response: none, basic, full. Default: none. (str)

Key includePrice

Indicates whether or not to include price data with the results. Options: true, false. (bool)

Key currency

The currency of the price information. Options: usd, btc. Only used in conjunction with includePrice. (str)

Returns

The API response parsed into a dict

velocity(address: str, **kwargs) → Dict[source]

Retrieves the historical velocity for the specified address.

Parameters

address – The token’s smart contract address

Key timeFormat

The time format to use with the timestamps: milliseconds/ms or iso/iso8611 (str)

Key timeFrame

The time frame to return the historical data in: by day (1d, 2d, …, all), by hour (1h, 2h, …, 72h) or by minute (1m, 2m, …, 360m) (str)

Returns

The API response parsed into a dict

volume(address: str, **kwargs) → Dict[source]

Retrieves the historical number of transfers for the specified address.

Parameters

address – The token’s smart contract address

Key timeFormat

The time format to use with the timestamps: milliseconds/ms or iso/iso8611 (str)

Key timeFrame

The time frame to return the historical data in: by day (1d, 2d, …, all), by hour (1h, 2h, …, 72h) or by minute (1m, 2m, …, 360m) (str)

Returns

The API response parsed into a dict