diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic/versions/c79044e047fe_declarative_indexes.py b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/c79044e047fe_declarative_indexes.py new file mode 100644 index 000000000..5ad92dc36 --- /dev/null +++ b/moonstreamdb-v3/moonstreamdbv3/alembic/versions/c79044e047fe_declarative_indexes.py @@ -0,0 +1,147 @@ +"""declarative indexes + +Revision ID: c79044e047fe +Revises: dae735afc98f +Create Date: 2025-02-10 13:43:05.099092 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision: str = 'c79044e047fe' +down_revision: Union[str, None] = 'dae735afc98f' +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + + op.create_index('ix_amoy_labels_label_addr_name', 'amoy_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_arbitrum_nova_labels_label_addr_name', 'arbitrum_nova_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_arbitrum_one_labels_label_addr_name', 'arbitrum_one_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_arbitrum_sepolia_labels_addr_block_ts', 'arbitrum_sepolia_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_arbitrum_sepolia_labels_label_addr_name', 'arbitrum_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_avalanche_fuji_labels_addr_block_ts', 'avalanche_fuji_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_avalanche_fuji_labels_label_addr_name', 'avalanche_fuji_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_avalanche_labels_addr_block_ts', 'avalanche_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_avalanche_labels_label_addr_name', 'avalanche_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_b3_labels_label_addr_name', 'b3_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_b3_sepolia_labels_label_addr_name', 'b3_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_base_labels_addr_block_ts', 'base_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_base_labels_label_addr_name', 'base_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_blast_labels_label_addr_name', 'blast_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_blast_sepolia_labels_label_addr_name', 'blast_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_ethereum_labels_addr_block_ts', 'ethereum_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_ethereum_labels_label_addr_name', 'ethereum_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_game7_labels_label_addr_name', 'game7_labels', ['label', 'address', 'label_name'], unique=False) + op.drop_index('ix_g7o_arbitrum_sepolia_labels_addr_block_num', table_name='game7_orbit_arbitrum_sepolia_labels') + op.drop_index('ix_g7o_arbitrum_sepolia_labels_addr_block_ts', table_name='game7_orbit_arbitrum_sepolia_labels') + op.drop_index('uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt', table_name='game7_orbit_arbitrum_sepolia_labels', postgresql_where="(((label)::text = 'seer'::text) AND ((label_type)::text = 'event'::text))") + op.drop_index('uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw', table_name='game7_orbit_arbitrum_sepolia_labels', postgresql_where="(((label)::text = 'seer-raw'::text) AND ((label_type)::text = 'event'::text))") + op.drop_index('uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call', table_name='game7_orbit_arbitrum_sepolia_labels', postgresql_where="(((label)::text = 'seer'::text) AND ((label_type)::text = 'tx_call'::text))") + op.drop_index('uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call_raw', table_name='game7_orbit_arbitrum_sepolia_labels', postgresql_where="(((label)::text = 'seer-raw'::text) AND ((label_type)::text = 'tx_call'::text))") + op.create_index('ix_game7_orbit_arbitrum_sepolia_labels_addr_block_num', 'game7_orbit_arbitrum_sepolia_labels', ['address', 'block_number'], unique=False) + op.create_index('ix_game7_orbit_arbitrum_sepolia_labels_addr_block_ts', 'game7_orbit_arbitrum_sepolia_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_game7_orbit_arbitrum_sepolia_labels_label_addr_name', 'game7_orbit_arbitrum_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('uk_game7_orbit_arbitrum_sepolia_labels_tx_hash_log_idx_evt', 'game7_orbit_arbitrum_sepolia_labels', ['transaction_hash', 'log_index'], unique=True, postgresql_where=sa.text("label='seer' and label_type='event'")) + op.create_index('uk_game7_orbit_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw', 'game7_orbit_arbitrum_sepolia_labels', ['transaction_hash', 'log_index'], unique=True, postgresql_where=sa.text("label='seer-raw' and label_type='event'")) + op.create_index('uk_game7_orbit_arbitrum_sepolia_labels_tx_hash_tx_call', 'game7_orbit_arbitrum_sepolia_labels', ['transaction_hash'], unique=True, postgresql_where=sa.text("label='seer' and label_type='tx_call'")) + op.create_index('uk_game7_orbit_arbitrum_sepolia_labels_tx_hash_tx_call_raw', 'game7_orbit_arbitrum_sepolia_labels', ['transaction_hash'], unique=True, postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'")) + op.create_index('ix_game7_testnet_labels_label_addr_name', 'game7_testnet_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_imx_zkevm_labels_label_addr_name', 'imx_zkevm_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_imx_zkevm_sepolia_labels_label_addr_name', 'imx_zkevm_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_mantle_labels_label_addr_name', 'mantle_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_mantle_sepolia_labels_label_addr_name', 'mantle_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_mumbai_labels_addr_block_ts', 'mumbai_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_mumbai_labels_label_addr_name', 'mumbai_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_polygon_labels_addr_block_ts', 'polygon_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_polygon_labels_label_addr_name', 'polygon_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_proofofplay_apex_labels_label_addr_name', 'proofofplay_apex_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_ronin_labels_label_addr_name', 'ronin_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_ronin_saigon_labels_label_addr_name', 'ronin_saigon_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_sepolia_labels_addr_block_ts', 'sepolia_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_sepolia_labels_label_addr_name', 'sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_starknet_labels_addr_block_ts', 'starknet_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_starknet_labels_label_addr_name', 'starknet_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_starknet_sepolia_labels_addr_block_ts', 'starknet_sepolia_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_starknet_sepolia_labels_label_addr_name', 'starknet_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_xai_labels_addr_block_ts', 'xai_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_xai_labels_label_addr_name', 'xai_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_xai_sepolia_labels_addr_block_ts', 'xai_sepolia_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_xai_sepolia_labels_label_addr_name', 'xai_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_xdai_labels_addr_block_ts', 'xdai_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_xdai_labels_label_addr_name', 'xdai_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_zksync_era_labels_addr_block_ts', 'zksync_era_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_zksync_era_labels_label_addr_name', 'zksync_era_labels', ['label', 'address', 'label_name'], unique=False) + op.create_index('ix_zksync_era_sepolia_labels_addr_block_ts', 'zksync_era_sepolia_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_zksync_era_sepolia_labels_label_addr_name', 'zksync_era_sepolia_labels', ['label', 'address', 'label_name'], unique=False) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index('ix_zksync_era_sepolia_labels_label_addr_name', table_name='zksync_era_sepolia_labels') + op.drop_index('ix_zksync_era_sepolia_labels_addr_block_ts', table_name='zksync_era_sepolia_labels') + op.drop_index('ix_zksync_era_labels_label_addr_name', table_name='zksync_era_labels') + op.drop_index('ix_zksync_era_labels_addr_block_ts', table_name='zksync_era_labels') + op.drop_index('ix_xdai_labels_label_addr_name', table_name='xdai_labels') + op.drop_index('ix_xdai_labels_addr_block_ts', table_name='xdai_labels') + op.drop_index('ix_xai_sepolia_labels_label_addr_name', table_name='xai_sepolia_labels') + op.drop_index('ix_xai_sepolia_labels_addr_block_ts', table_name='xai_sepolia_labels') + op.drop_index('ix_xai_labels_label_addr_name', table_name='xai_labels') + op.drop_index('ix_xai_labels_addr_block_ts', table_name='xai_labels') + op.drop_index('ix_starknet_sepolia_labels_label_addr_name', table_name='starknet_sepolia_labels') + op.drop_index('ix_starknet_sepolia_labels_addr_block_ts', table_name='starknet_sepolia_labels') + op.drop_index('ix_starknet_labels_label_addr_name', table_name='starknet_labels') + op.drop_index('ix_starknet_labels_addr_block_ts', table_name='starknet_labels') + op.drop_index('ix_sepolia_labels_label_addr_name', table_name='sepolia_labels') + op.drop_index('ix_sepolia_labels_addr_block_ts', table_name='sepolia_labels') + op.drop_index('ix_ronin_saigon_labels_label_addr_name', table_name='ronin_saigon_labels') + op.drop_index('ix_ronin_labels_label_addr_name', table_name='ronin_labels') + op.drop_index('ix_proofofplay_apex_labels_label_addr_name', table_name='proofofplay_apex_labels') + op.drop_index('ix_polygon_labels_label_addr_name', table_name='polygon_labels') + op.drop_index('ix_polygon_labels_addr_block_ts', table_name='polygon_labels') + op.drop_index('ix_mumbai_labels_label_addr_name', table_name='mumbai_labels') + op.drop_index('ix_mumbai_labels_addr_block_ts', table_name='mumbai_labels') + op.drop_index('ix_mantle_sepolia_labels_label_addr_name', table_name='mantle_sepolia_labels') + op.drop_index('ix_mantle_labels_label_addr_name', table_name='mantle_labels') + op.drop_index('ix_imx_zkevm_sepolia_labels_label_addr_name', table_name='imx_zkevm_sepolia_labels') + op.drop_index('ix_imx_zkevm_labels_label_addr_name', table_name='imx_zkevm_labels') + op.drop_index('ix_game7_testnet_labels_label_addr_name', table_name='game7_testnet_labels') + op.drop_index('uk_game7_orbit_arbitrum_sepolia_labels_tx_hash_tx_call_raw', table_name='game7_orbit_arbitrum_sepolia_labels', postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'")) + op.drop_index('uk_game7_orbit_arbitrum_sepolia_labels_tx_hash_tx_call', table_name='game7_orbit_arbitrum_sepolia_labels', postgresql_where=sa.text("label='seer' and label_type='tx_call'")) + op.drop_index('uk_game7_orbit_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw', table_name='game7_orbit_arbitrum_sepolia_labels', postgresql_where=sa.text("label='seer-raw' and label_type='event'")) + op.drop_index('uk_game7_orbit_arbitrum_sepolia_labels_tx_hash_log_idx_evt', table_name='game7_orbit_arbitrum_sepolia_labels', postgresql_where=sa.text("label='seer' and label_type='event'")) + op.drop_index('ix_game7_orbit_arbitrum_sepolia_labels_label_addr_name', table_name='game7_orbit_arbitrum_sepolia_labels') + op.drop_index('ix_game7_orbit_arbitrum_sepolia_labels_addr_block_ts', table_name='game7_orbit_arbitrum_sepolia_labels') + op.drop_index('ix_game7_orbit_arbitrum_sepolia_labels_addr_block_num', table_name='game7_orbit_arbitrum_sepolia_labels') + op.create_index('uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call_raw', 'game7_orbit_arbitrum_sepolia_labels', ['transaction_hash'], unique=True, postgresql_where="(((label)::text = 'seer-raw'::text) AND ((label_type)::text = 'tx_call'::text))") + op.create_index('uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call', 'game7_orbit_arbitrum_sepolia_labels', ['transaction_hash'], unique=True, postgresql_where="(((label)::text = 'seer'::text) AND ((label_type)::text = 'tx_call'::text))") + op.create_index('uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw', 'game7_orbit_arbitrum_sepolia_labels', ['transaction_hash', 'log_index'], unique=True, postgresql_where="(((label)::text = 'seer-raw'::text) AND ((label_type)::text = 'event'::text))") + op.create_index('uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt', 'game7_orbit_arbitrum_sepolia_labels', ['transaction_hash', 'log_index'], unique=True, postgresql_where="(((label)::text = 'seer'::text) AND ((label_type)::text = 'event'::text))") + op.create_index('ix_g7o_arbitrum_sepolia_labels_addr_block_ts', 'game7_orbit_arbitrum_sepolia_labels', ['address', 'block_timestamp'], unique=False) + op.create_index('ix_g7o_arbitrum_sepolia_labels_addr_block_num', 'game7_orbit_arbitrum_sepolia_labels', ['address', 'block_number'], unique=False) + op.drop_index('ix_game7_labels_label_addr_name', table_name='game7_labels') + op.drop_index('ix_ethereum_labels_label_addr_name', table_name='ethereum_labels') + op.drop_index('ix_ethereum_labels_addr_block_ts', table_name='ethereum_labels') + op.drop_index('ix_blast_sepolia_labels_label_addr_name', table_name='blast_sepolia_labels') + op.drop_index('ix_blast_labels_label_addr_name', table_name='blast_labels') + op.drop_index('ix_base_labels_label_addr_name', table_name='base_labels') + op.drop_index('ix_base_labels_addr_block_ts', table_name='base_labels') + op.drop_index('ix_b3_sepolia_labels_label_addr_name', table_name='b3_sepolia_labels') + op.drop_index('ix_b3_labels_label_addr_name', table_name='b3_labels') + op.drop_index('ix_avalanche_labels_label_addr_name', table_name='avalanche_labels') + op.drop_index('ix_avalanche_labels_addr_block_ts', table_name='avalanche_labels') + op.drop_index('ix_avalanche_fuji_labels_label_addr_name', table_name='avalanche_fuji_labels') + op.drop_index('ix_avalanche_fuji_labels_addr_block_ts', table_name='avalanche_fuji_labels') + op.drop_index('ix_arbitrum_sepolia_labels_label_addr_name', table_name='arbitrum_sepolia_labels') + op.drop_index('ix_arbitrum_sepolia_labels_addr_block_ts', table_name='arbitrum_sepolia_labels') + op.drop_index('ix_arbitrum_one_labels_label_addr_name', table_name='arbitrum_one_labels') + op.drop_index('ix_arbitrum_nova_labels_label_addr_name', table_name='arbitrum_nova_labels') + op.drop_index('ix_amoy_labels_label_addr_name', table_name='amoy_labels') + # ### end Alembic commands ### diff --git a/moonstreamdb-v3/moonstreamdbv3/models.py b/moonstreamdb-v3/moonstreamdbv3/models.py index 646f0d80d..d60a1d354 100644 --- a/moonstreamdb-v3/moonstreamdbv3/models.py +++ b/moonstreamdb-v3/moonstreamdbv3/models.py @@ -31,7 +31,7 @@ ) from sqlalchemy.dialects.postgresql import JSONB, UUID from sqlalchemy.ext.compiler import compiles -from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.sql import expression, text """ @@ -74,6 +74,42 @@ def pg_utcnow(element, compiler, **kwargs): class EvmBasedLabel(Base): # type: ignore __abstract__ = True + @declared_attr + def __table_args__(cls): + return ( + Index( + f"ix_{cls.__tablename__}_addr_block_num", + "address", "block_number", unique=False + ), + Index( + f"ix_{cls.__tablename__}_addr_block_ts", + "address", "block_timestamp", unique=False + ), + Index( + f"ix_{cls.__tablename__}_label_addr_name", + "label", "address", "label_name", unique=False + ), + Index( + f"uk_{cls.__tablename__}_tx_hash_tx_call", + "transaction_hash", unique=True, + postgresql_where=text("label='seer' and label_type='tx_call'") + ), + Index( + f"uk_{cls.__tablename__}_tx_hash_log_idx_evt", + "transaction_hash", "log_index", unique=True, + postgresql_where=text("label='seer' and label_type='event'") + ), + Index( + f"uk_{cls.__tablename__}_tx_hash_tx_call_raw", + "transaction_hash", unique=True, + postgresql_where=text("label='seer-raw' and label_type='tx_call'") + ), + Index( + f"uk_{cls.__tablename__}_tx_hash_log_idx_evt_raw", + "transaction_hash", "log_index", unique=True, + postgresql_where=text("label='seer-raw' and label_type='event'") + ) + ) id = Column( UUID(as_uuid=True), primary_key=True, @@ -127,1438 +163,96 @@ class EvmBasedLabel(Base): # type: ignore class EthereumLabel(EvmBasedLabel): # type: ignore __tablename__ = "ethereum_labels" - __table_args__ = ( - Index( - "ix_ethereum_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_ethereum_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_ethereum_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_ethereum_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_ethereum_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_ethereum_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class SepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "sepolia_labels" - __table_args__ = ( - Index( - "ix_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class PolygonLabel(EvmBasedLabel): # type: ignore __tablename__ = "polygon_labels" - __table_args__ = ( - Index( - "ix_polygon_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_polygon_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_polygon_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_polygon_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_polygon_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_polygon_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class MumbaiLabel(EvmBasedLabel): # type: ignore __tablename__ = "mumbai_labels" - __table_args__ = ( - Index( - "ix_mumbai_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_mumbai_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_mumbai_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_mumbai_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_mumbai_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_mumbai_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class AmoyLabel(EvmBasedLabel): # type: ignore __tablename__ = "amoy_labels" - __table_args__ = ( - Index( - "ix_amoy_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_amoy_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_amoy_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_amoy_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_amoy_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_amoy_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class XDaiLabel(EvmBasedLabel): # type: ignore __tablename__ = "xdai_labels" - __table_args__ = ( - Index( - "ix_xdai_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_xdai_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_xdai_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_xdai_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_xdai_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_xdai_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class ZkSyncEraLabel(EvmBasedLabel): # type: ignore __tablename__ = "zksync_era_labels" - __table_args__ = ( - Index( - "ix_zksync_era_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_zksync_era_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_zksync_era_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_zksync_era_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_zksync_era_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_zksync_era_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class ZkSyncEraSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "zksync_era_sepolia_labels" - __table_args__ = ( - Index( - "ix_zksync_era_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_zksync_era_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_zksync_era_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_zksync_era_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_zksync_era_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_zksync_era_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class BaseLabel(EvmBasedLabel): # type: ignore __tablename__ = "base_labels" - __table_args__ = ( - Index( - "ix_base_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_base_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_base_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_base_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_base_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_base_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class ArbitrumNovaLabel(EvmBasedLabel): # type: ignore __tablename__ = "arbitrum_nova_labels" - __table_args__ = ( - Index( - "ix_arbitrum_nova_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_arbitrum_nova_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_arbitrum_nova_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_arbitrum_nova_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_arbitrum_nova_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_arbitrum_nova_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class ArbitrumOneLabel(EvmBasedLabel): # type: ignore __tablename__ = "arbitrum_one_labels" - __table_args__ = ( - Index( - "ix_arbitrum_one_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_arbitrum_one_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_arbitrum_one_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_arbitrum_one_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_arbitrum_one_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_arbitrum_one_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class ArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "arbitrum_sepolia_labels" - __table_args__ = ( - Index( - "ix_arbitrum_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_arbitrum_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_arbitrum_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_arbitrum_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_arbitrum_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class Game7OrbitArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "game7_orbit_arbitrum_sepolia_labels" - __table_args__ = ( - Index( - "ix_g7o_arbitrum_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_g7o_arbitrum_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_g7o_arbitrum_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_g7o_arbitrum_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class XaiLabel(EvmBasedLabel): # type: ignore __tablename__ = "xai_labels" - __table_args__ = ( - Index( - "ix_xai_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_xai_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_xai_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_xai_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_xai_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_xai_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class XaiSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "xai_sepolia_labels" - __table_args__ = ( - Index( - "ix_xai_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_xai_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_xai_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_xai_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_xai_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_xai_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class AvalancheLabel(EvmBasedLabel): # type: ignore __tablename__ = "avalanche_labels" - __table_args__ = ( - Index( - "ix_avalanche_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_avalanche_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_avalanche_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_avalanche_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_avalanche_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_avalanche_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class AvalancheFujiLabel(EvmBasedLabel): # type: ignore __tablename__ = "avalanche_fuji_labels" - __table_args__ = ( - Index( - "ix_avalanche_fuji_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_avalanche_fuji_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_avalanche_fuji_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_avalanche_fuji_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_avalanche_fuji_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_avalanche_fuji_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class BlastLabel(EvmBasedLabel): # type: ignore __tablename__ = "blast_labels" - __table_args__ = ( - Index( - "ix_blast_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_blast_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_blast_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_blast_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_blast_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_blast_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class BlastSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "blast_sepolia_labels" - __table_args__ = ( - Index( - "ix_blast_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_blast_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_blast_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_blast_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_blast_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_blast_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class ProofOfPlayApexLabel(EvmBasedLabel): # type: ignore __tablename__ = "proofofplay_apex_labels" - __table_args__ = ( - Index( - "ix_proofofplay_apex_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_proofofplay_apex_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_proofofplay_apex_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_proofofplay_apex_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_proofofplay_apex_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_proofofplay_apex_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class StarknetLabel(EvmBasedLabel): # type: ignore __tablename__ = "starknet_labels" - __table_args__ = ( - Index( - "ix_starknet_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_starknet_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_starknet_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_starknet_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_starknet_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_starknet_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class StarknetSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "starknet_sepolia_labels" - __table_args__ = ( - Index( - "ix_starknet_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_starknet_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_starknet_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_starknet_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_starknet_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_starknet_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class MantleLabel(EvmBasedLabel): # type: ignore __tablename__ = "mantle_labels" - __table_args__ = ( - Index( - "ix_mantle_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_mantle_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_mantle_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_mantle_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_mantle_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_mantle_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class MantleSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "mantle_sepolia_labels" - __table_args__ = ( - Index( - "ix_mantle_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_mantle_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_mantle_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_mantle_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_mantle_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_mantle_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class ImxZkevmLabel(EvmBasedLabel): # type: ignore __tablename__ = "imx_zkevm_labels" - __table_args__ = ( - Index( - "ix_imx_zkevm_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_imx_zkevm_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_imx_zkevm_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_imx_zkevm_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_imx_zkevm_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_imx_zkevm_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class ImxZkevmSepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "imx_zkevm_sepolia_labels" - __table_args__ = ( - Index( - "ix_imx_zkevm_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_imx_zkevm_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_imx_zkevm_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_imx_zkevm_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_imx_zkevm_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_imx_zkevm_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class Game7Label(EvmBasedLabel): # type: ignore __tablename__ = "game7_labels" - __table_args__ = ( - Index( - "ix_game7_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_game7_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_game7_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_game7_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_game7_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_game7_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class Game7TestnetLabel(EvmBasedLabel): # type: ignore __tablename__ = "game7_testnet_labels" - __table_args__ = ( - Index( - "ix_game7_testnet_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_game7_testnet_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_game7_testnet_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_game7_testnet_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_game7_testnet_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_game7_testnet_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class B3Label(EvmBasedLabel): # type: ignore __tablename__ = "b3_labels" - __table_args__ = ( - Index( - "ix_b3_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_b3_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_b3_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_b3_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_b3_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_b3_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class B3SepoliaLabel(EvmBasedLabel): # type: ignore __tablename__ = "b3_sepolia_labels" - __table_args__ = ( - Index( - "ix_b3_sepolia_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_b3_sepolia_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_b3_sepolia_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_b3_sepolia_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_b3_sepolia_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_b3_sepolia_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class RoninLabel(EvmBasedLabel): # type: ignore __tablename__ = "ronin_labels" - __table_args__ = ( - Index( - "ix_ronin_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_ronin_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_ronin_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_ronin_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_ronin_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_ronin_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) - - class RoninSaigonLabel(EvmBasedLabel): # type: ignore __tablename__ = "ronin_saigon_labels" - __table_args__ = ( - Index( - "ix_ronin_saigon_labels_addr_block_num", - "address", - "block_number", - unique=False, - ), - Index( - "ix_ronin_saigon_labels_addr_block_ts", - "address", - "block_timestamp", - unique=False, - ), - Index( - "uk_ronin_saigon_labels_tx_hash_tx_call", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer' and label_type='tx_call'"), - ), - Index( - "uk_ronin_saigon_labels_tx_hash_log_idx_evt", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer' and label_type='event'"), - ), - Index( - "uk_ronin_saigon_labels_tx_hash_tx_call_raw", - "transaction_hash", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='tx_call'"), - ), - Index( - "uk_ronin_saigon_labels_tx_hash_log_idx_evt_raw", - "transaction_hash", - "log_index", - unique=True, - postgresql_where=text("label='seer-raw' and label_type='event'"), - ), - ) diff --git a/moonstreamdb-v3/moonstreamdbv3/version.txt b/moonstreamdb-v3/moonstreamdbv3/version.txt index 446ba66e7..def9a0154 100644 --- a/moonstreamdb-v3/moonstreamdbv3/version.txt +++ b/moonstreamdb-v3/moonstreamdbv3/version.txt @@ -1 +1 @@ -0.1.4 \ No newline at end of file +0.1.5 \ No newline at end of file