Table of Contents

Models reference

Base classes

dipdup.models.CachedModel

class dipdup.models.CachedModel(**kwargs)

Parameters:

kwargs (Any)

dipdup.models.Model

class dipdup.models.Model(**kwargs)

Base class for DipDup project models

Parameters:

kwargs (Any)

Internal models

dipdup.models.ContractMetadata

class dipdup.models.ContractMetadata(**kwargs)

Parameters:

kwargs (Any)

dipdup.models.Head

class dipdup.models.Head(**kwargs)

Parameters:

kwargs (Any)

dipdup.models.TokenMetadata

class dipdup.models.TokenMetadata(**kwargs)

Parameters:

kwargs (Any)

dipdup.models.Contract

class dipdup.models.Contract(**kwargs)

Parameters:

kwargs (Any)

dipdup.models.ContractKind

class dipdup.models.ContractKind(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Mapping for contract kind in

dipdup.models.Index

class dipdup.models.Index(**kwargs)

Parameters:

kwargs (Any)

dipdup.models.IndexStatus

class dipdup.models.IndexStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

dipdup.models.IndexType

class dipdup.models.IndexType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Enum for dipdup.models.Index

dipdup.models.Schema

class dipdup.models.Schema(**kwargs)

Parameters:

kwargs (Any)

dipdup.models.ReindexingAction

class dipdup.models.ReindexingAction(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Action that should be performed on reindexing

Parameters:
  • exception – Raise ReindexingRequiredError exception.
  • wipe – Wipe the database and reindex from scratch. (WARNING: This action is irreversible! All indexed data will be lost!)
  • ignore – Ignore the reindexing cause and continue.

dipdup.models.ReindexingReason

class dipdup.models.ReindexingReason(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Reason that caused reindexing

Parameters:
  • manual – Manual reindexing.
  • migration – Migration of the database schema.
  • rollback – Rollback that couldn’t be handled automatically.
  • config_modified – Index config was modified.
  • schema_modified – Project models or database schema were modified.

dipdup.models.SkipHistory

class dipdup.models.SkipHistory(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Whether to skip indexing big map history and use only current state

Parameters:
  • never – Always index big map historical updates.
  • once – Skip history once after reindexing; process updates as usual on the next resync.
  • always – Always skip big map history.

dipdup.models.Meta

class dipdup.models.Meta(**kwargs)

Parameters:

kwargs (Any)

dipdup.models.ModelUpdate

class dipdup.models.ModelUpdate(**kwargs)

Model update created within versioned transactions

Parameters:

kwargs (Any)

dipdup.models.ModelUpdateAction

class dipdup.models.ModelUpdateAction(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Mapping for actions in model update

Datasource models

EVM

dipdup.models.evm.EvmTransaction

class dipdup.models.evm.EvmTransaction(data: dipdup.models.evm.EvmTransactionData, input: InputT)

Parameters:

dipdup.models.evm.EvmTransactionData

class dipdup.models.evm.EvmTransactionData(access_list: tupledictstr, dipdup.fields.Any, ... | None, block_hash: str, chain_id: int | None, contract_address: str | None, cumulative_gas_used: int | None, effective_gas_price: int | None, from_: str, gas: int, gas_price: int, gas_used: int | None, hash: str, input: str, level: int, max_fee_per_gas: int | None, max_priority_fee_per_gas: int | None, nonce: int, r: str | None, s: str | None, status: int | None, timestamp: int, to: str | None, transaction_index: int | None, type: int | None, value: int | None, v: int | None, y_parity: bool | None)

Parameters:
  • access_list (tuple[dict[str, Any], ...] | None)
  • block_hash (str)
  • chain_id (int | None)
  • contract_address (str | None)
  • cumulative_gas_used (int | None)
  • effective_gas_price (int | None)
  • from_ (str)
  • gas (int)
  • gas_price (int)
  • gas_used (int | None)
  • hash (str)
  • input (str)
  • level (int)
  • max_fee_per_gas (int | None)
  • max_priority_fee_per_gas (int | None)
  • nonce (int)
  • r (str | None)
  • s (str | None)
  • status (int | None)
  • timestamp (int)
  • to (str | None)
  • transaction_index (int | None)
  • type (int | None)
  • value (int | None)
  • v (int | None)
  • y_parity (bool | None)

dipdup.models.evm.EvmEvent

class dipdup.models.evm.EvmEvent(data: dipdup.models.evm.EvmEventData, payload: PayloadT)

Parameters:

dipdup.models.evm.EvmEventData

class dipdup.models.evm.EvmEventData(address: str, block_hash: str, data: str, level: int, log_index: int, removed: bool, timestamp: int, topics: tuplestr, ..., transaction_hash: str, transaction_index: int)

Parameters:
  • address (str)
  • block_hash (str)
  • data (str)
  • level (int)
  • log_index (int)
  • removed (bool)
  • timestamp (int)
  • topics (tuple[str, ...])
  • transaction_hash (str)
  • transaction_index (int)

Starknet

dipdup.models.starknet.StarknetEvent

class dipdup.models.starknet.StarknetEvent(data: dipdup.models.starknet.StarknetEventData, payload: PayloadT)

Parameters:

dipdup.models.starknet.StarknetEventData

class dipdup.models.starknet.StarknetEventData(level: int, block_hash: str, transaction_index: int | None, transaction_hash: str, timestamp: int | None, from_address: str, keys: tuplestr, ..., data: tuplestr, ...)

Parameters:
  • level (int)
  • block_hash (str)
  • transaction_index (int | None)
  • transaction_hash (str)
  • timestamp (int | None)
  • from_address (str)
  • keys (tuple[str, ...])
  • data (tuple[str, ...])

dipdup.models.starknet.StarknetTransactionData

class dipdup.models.starknet.StarknetTransactionData(level: int, block_hash: str, transaction_index: int, transaction_hash: str, timestamp: int, contract_address: str | None, entry_point_selector: str | None, calldata: tuplestr, ... | None, max_fee: str | None, version: str, signature: tuplestr, ... | None, nonce: str | None, type: str, sender_address: str | None, class_hash: str | None, compiled_class_hash: str | None, contract_address_salt: str | None, constructor_calldata: tuplestr, ... | None)

Parameters:
  • level (int)
  • block_hash (str)
  • transaction_index (int)
  • transaction_hash (str)
  • timestamp (int)
  • contract_address (str | None)
  • entry_point_selector (str | None)
  • calldata (tuple[str, ...] | None)
  • max_fee (str | None)
  • version (str)
  • signature (tuple[str, ...] | None)
  • nonce (str | None)
  • type (str)
  • sender_address (str | None)
  • class_hash (str | None)
  • compiled_class_hash (str | None)
  • contract_address_salt (str | None)
  • constructor_calldata (tuple[str, ...] | None)

Tezos

dipdup.models.tezos.TezosBigMapAction

class dipdup.models.tezos.TezosBigMapAction(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Mapping for action in TzKT response

dipdup.models.tezos.TezosBigMapData

class dipdup.models.tezos.TezosBigMapData(id, level, operation_id, timestamp, bigmap, contract_address, path, action, active, key=None, value=None)

Basic structure for big map diffs from TzKT response

Parameters:
  • id (int)
  • level (int)
  • operation_id (int)
  • timestamp (datetime)
  • bigmap (int)
  • contract_address (str)
  • path (str)
  • action (TezosBigMapAction)
  • active (bool)
  • key (Any | None)
  • value (Any | None)

dipdup.models.tezos.TezosBigMapDiff

class dipdup.models.tezos.TezosBigMapDiff(action, data, key, value)

Wrapper for matched big map diff with typed data passed to the handler

Parameters:

dipdup.models.tezos.TezosBlockData

class dipdup.models.tezos.TezosBlockData(level, hash, timestamp, proto, validations, deposit, reward, fees, nonce_revealed, priority=None, baker_address=None, baker_alias=None)

Basic structure for blocks received from TzKT REST API

Parameters:
  • level (int)
  • hash (str)
  • timestamp (datetime)
  • proto (int)
  • validations (int)
  • deposit (int)
  • reward (int)
  • fees (int)
  • nonce_revealed (bool)
  • priority (int | None)
  • baker_address (str | None)
  • baker_alias (str | None)

dipdup.models.tezos.TezosEvent

class dipdup.models.tezos.TezosEvent(data, payload)

Parameters:

dipdup.models.tezos.TezosEventData

class dipdup.models.tezos.TezosEventData(id, level, timestamp, tag, payload, contract_address, contract_alias=None, contract_code_hash=None, transaction_id=None)

Basic structure for events received from TzKT REST API

Parameters:
  • id (int)
  • level (int)
  • timestamp (datetime)
  • tag (str)
  • payload (Any | None)
  • contract_address (str)
  • contract_alias (str | None)
  • contract_code_hash (int | None)
  • transaction_id (int | None)

dipdup.models.tezos.TezosHeadBlockData

class dipdup.models.tezos.TezosHeadBlockData(chain, chain_id, cycle, level, hash, protocol, next_protocol, timestamp, voting_epoch, voting_period, known_level, last_sync, synced, quote_level, quote_btc, quote_eur, quote_usd, quote_cny, quote_jpy, quote_krw, quote_eth, quote_gbp)

Basic structure for head block received from TzKT SignalR API

Parameters:
  • chain (str)
  • chain_id (str)
  • cycle (int)
  • level (int)
  • hash (str)
  • protocol (str)
  • next_protocol (str)
  • timestamp (datetime)
  • voting_epoch (int)
  • voting_period (int)
  • known_level (int)
  • last_sync (datetime)
  • synced (bool)
  • quote_level (int)
  • quote_btc (Decimal)
  • quote_eur (Decimal)
  • quote_usd (Decimal)
  • quote_cny (Decimal)
  • quote_jpy (Decimal)
  • quote_krw (Decimal)
  • quote_eth (Decimal)
  • quote_gbp (Decimal)

dipdup.models.tezos.TezosOperationData

class dipdup.models.tezos.TezosOperationData(type, id, level, timestamp, hash, counter, sender_address, target_address, initiator_address, amount, status, has_internals, storage, diffs=<factory>, block=None, sender_alias=None, nonce=None, target_alias=None, initiator_alias=None, entrypoint=None, parameter_json=None, originated_contract_address=None, originated_contract_alias=None, originated_contract_type_hash=None, originated_contract_code_hash=None, originated_contract_tzips=None, delegate_address=None, delegate_alias=None, target_code_hash=None, sender_code_hash=None, commitment_json=<factory>)

Basic structure for operations from TzKT response

Parameters:
  • type (str)
  • id (int)
  • level (int)
  • timestamp (datetime)
  • hash (str)
  • counter (int)
  • sender_address (str | None)
  • target_address (str | None)
  • initiator_address (str | None)
  • amount (int | None)
  • status (str)
  • has_internals (bool | None)
  • storage (Any)
  • diffs (tuple[dict[str, Any], ...])
  • block (str | None)
  • sender_alias (str | None)
  • nonce (int | None)
  • target_alias (str | None)
  • initiator_alias (str | None)
  • entrypoint (str | None)
  • parameter_json (Any | None)
  • originated_contract_address (str | None)
  • originated_contract_alias (str | None)
  • originated_contract_type_hash (int | None)
  • originated_contract_code_hash (int | None)
  • originated_contract_tzips (tuple[str, ...] | None)
  • delegate_address (str | None)
  • delegate_alias (str | None)
  • target_code_hash (int | None)
  • sender_code_hash (int | None)
  • commitment_json (dict[str, Any])

dipdup.models.tezos.TezosOperationType

class dipdup.models.tezos.TezosOperationType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Type of blockchain operation

Parameters:
  • transaction – transaction
  • origination – origination
  • migration – migration
  • sr_execute – sr_execute
  • sr_cement – sr_cement

dipdup.models.tezos.TezosOrigination

class dipdup.models.tezos.TezosOrigination(data, storage)

Wrapper for matched origination with typed data passed to the handler

Parameters:

dipdup.models.tezos.TezosQuoteData

class dipdup.models.tezos.TezosQuoteData(level, timestamp, btc, eur, usd, cny, jpy, krw, eth, gbp)

Basic structure for quotes received from TzKT REST API

Parameters:
  • level (int)
  • timestamp (datetime)
  • btc (Decimal)
  • eur (Decimal)
  • usd (Decimal)
  • cny (Decimal)
  • jpy (Decimal)
  • krw (Decimal)
  • eth (Decimal)
  • gbp (Decimal)

dipdup.models.tezos.TezosSmartRollupCement

class dipdup.models.tezos.TezosSmartRollupCement(data, commitment)

Wrapper for matched smart rollup cement to the handler

Parameters:

dipdup.models.tezos.TezosSmartRollupCommitment

class dipdup.models.tezos.TezosSmartRollupCommitment(id, initiator_address, initiator_alias, inbox_level, state, hash, ticks, first_level, first_time)

Parameters:
  • id (int)
  • initiator_address (str)
  • initiator_alias (str | None)
  • inbox_level (int)
  • state (str)
  • hash (str | None)
  • ticks (int)
  • first_level (int)
  • first_time (datetime)

dipdup.models.tezos.TezosSmartRollupExecute

class dipdup.models.tezos.TezosSmartRollupExecute(data, commitment)

Wrapper for matched smart rollup execute to the handler

Parameters:

dipdup.models.tezos.TezosTokenBalanceData

class dipdup.models.tezos.TezosTokenBalanceData(id, transfers_count, first_level, first_time, last_level, last_time, account_address=None, account_alias=None, tzkt_token_id=None, contract_address=None, contract_alias=None, token_id=None, standard=None, metadata=None, balance=None, balance_value=None)

Basic structure for token transver received from TzKT SignalR API

Parameters:
  • id (int)
  • transfers_count (int)
  • first_level (int)
  • first_time (datetime)
  • last_level (int)
  • last_time (datetime)
  • account_address (str | None)
  • account_alias (str | None)
  • tzkt_token_id (int | None)
  • contract_address (str | None)
  • contract_alias (str | None)
  • token_id (int | None)
  • standard (TezosTokenStandard | None)
  • metadata (dict[str, Any] | None)
  • balance (str | None)
  • balance_value (float | None)

dipdup.models.tezos.TezosTokenStandard

class dipdup.models.tezos.TezosTokenStandard(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

dipdup.models.tezos.TezosTokenTransferData

class dipdup.models.tezos.TezosTokenTransferData(id, level, timestamp, tzkt_token_id, contract_address=None, contract_alias=None, token_id=None, standard=None, metadata=None, from_alias=None, from_address=None, to_alias=None, to_address=None, amount=None, tzkt_transaction_id=None, tzkt_origination_id=None, tzkt_migration_id=None)

Basic structure for token transver received from TzKT SignalR API

Parameters:
  • id (int)
  • level (int)
  • timestamp (datetime)
  • tzkt_token_id (int)
  • contract_address (str | None)
  • contract_alias (str | None)
  • token_id (int | None)
  • standard (TezosTokenStandard | None)
  • metadata (dict[str, Any] | None)
  • from_alias (str | None)
  • from_address (str | None)
  • to_alias (str | None)
  • to_address (str | None)
  • amount (int | None)
  • tzkt_transaction_id (int | None)
  • tzkt_origination_id (int | None)
  • tzkt_migration_id (int | None)

dipdup.models.tezos.TezosTransaction

class dipdup.models.tezos.TezosTransaction(data, parameter, storage)

Wrapper for matched transaction with typed data passed to the handler

Parameters:

dipdup.models.tezos.TezosUnknownEvent

class dipdup.models.tezos.TezosUnknownEvent(data, payload)

Parameters:

Other

dipdup.models.coinbase.CoinbaseCandleData

class dipdup.models.coinbase.CoinbaseCandleData(timestamp, low, high, open, close, volume)

Parameters:
  • timestamp (datetime)
  • low (Decimal)
  • high (Decimal)
  • open (Decimal)
  • close (Decimal)
  • volume (Decimal)

dipdup.models.coinbase.CoinbaseCandleInterval

class dipdup.models.coinbase.CoinbaseCandleInterval(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

dipdup.models.tzip_metadata.TzipMetadataNetwork

class dipdup.models.tzip_metadata.TzipMetadataNetwork(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Tezos network enum for TZIP-16 metadata.

Parameters:
  • mainnet – mainnet
  • ghostnet – ghostnet
  • nairobinet – nairobinet
  • oxfordnet – oxfordnet
  • parisnet – parisnet
  • quebecnet – quebecnet
Help and tips -> Join our Discord
Ideas or suggestions -> Issue Tracker
GraphQL IDE -> Open Playground
Table of Contents