2021-08-06 12:05:59 +00:00
|
|
|
import uuid
|
|
|
|
|
2021-07-26 11:03:33 +00:00
|
|
|
from sqlalchemy import (
|
2023-07-12 11:23:00 +00:00
|
|
|
VARCHAR,
|
2021-07-26 11:03:33 +00:00
|
|
|
BigInteger,
|
|
|
|
Column,
|
|
|
|
DateTime,
|
2023-07-12 11:23:00 +00:00
|
|
|
ForeignKey,
|
2022-06-07 10:55:53 +00:00
|
|
|
Index,
|
2021-07-26 11:03:33 +00:00
|
|
|
Integer,
|
|
|
|
MetaData,
|
2021-07-29 17:31:17 +00:00
|
|
|
Numeric,
|
2021-07-26 11:03:33 +00:00
|
|
|
Text,
|
|
|
|
)
|
2021-08-06 12:05:59 +00:00
|
|
|
from sqlalchemy.dialects.postgresql import JSONB, UUID
|
2021-07-26 11:03:33 +00:00
|
|
|
from sqlalchemy.ext.compiler import compiles
|
2023-07-12 11:23:00 +00:00
|
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
|
|
from sqlalchemy.sql import expression
|
2021-07-26 11:03:33 +00:00
|
|
|
|
|
|
|
"""
|
|
|
|
Naming conventions doc
|
|
|
|
https://docs.sqlalchemy.org/en/13/core/constraints.html#configuring-constraint-naming-conventions
|
|
|
|
"""
|
|
|
|
convention = {
|
|
|
|
"ix": "ix_%(column_0_label)s",
|
|
|
|
"uq": "uq_%(table_name)s_%(column_0_name)s",
|
|
|
|
"ck": "ck_%(table_name)s_%(constraint_name)s",
|
|
|
|
"fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
|
|
|
|
"pk": "pk_%(table_name)s",
|
|
|
|
}
|
|
|
|
metadata = MetaData(naming_convention=convention)
|
|
|
|
Base = declarative_base(metadata=metadata)
|
|
|
|
|
|
|
|
"""
|
|
|
|
Creating a utcnow function which runs on the Posgres database server when created_at and updated_at
|
|
|
|
fields are populated.
|
|
|
|
Following:
|
|
|
|
1. https://docs.sqlalchemy.org/en/13/core/compiler.html#utc-timestamp-function
|
|
|
|
2. https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
|
|
|
|
3. https://stackoverflow.com/a/33532154/13659585
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
class utcnow(expression.FunctionElement):
|
2023-03-07 16:34:39 +00:00
|
|
|
type = DateTime # type: ignore
|
2021-07-26 11:03:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
@compiles(utcnow, "postgresql")
|
|
|
|
def pg_utcnow(element, compiler, **kwargs):
|
|
|
|
return "TIMEZONE('utc', statement_timestamp())"
|
|
|
|
|
|
|
|
|
|
|
|
class EthereumBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "ethereum_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
2021-07-29 17:31:17 +00:00
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
2021-07-26 11:03:33 +00:00
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
2021-10-26 09:59:26 +00:00
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
2021-07-29 17:31:17 +00:00
|
|
|
hash = Column(VARCHAR(256), index=True)
|
2021-07-26 11:03:33 +00:00
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class EthereumTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "ethereum_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
2021-07-29 17:31:17 +00:00
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
2021-07-26 11:03:33 +00:00
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("ethereum_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
2021-07-29 17:31:17 +00:00
|
|
|
index=True,
|
2021-07-26 11:03:33 +00:00
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
2021-07-29 17:31:17 +00:00
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
2021-10-26 09:59:26 +00:00
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
2021-07-26 11:03:33 +00:00
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
2021-10-28 12:43:13 +00:00
|
|
|
transaction_type = Column(Integer, nullable=True)
|
2021-07-29 17:31:17 +00:00
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
2021-07-26 11:03:33 +00:00
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
2021-07-29 04:35:49 +00:00
|
|
|
|
2021-08-06 12:05:59 +00:00
|
|
|
class EthereumLabel(Base): # type: ignore
|
|
|
|
"""
|
2021-08-09 14:04:17 +00:00
|
|
|
Example of label_data:
|
|
|
|
{
|
|
|
|
"label": "ERC20",
|
2021-08-09 14:58:48 +00:00
|
|
|
"label_data": {
|
2021-08-09 14:04:17 +00:00
|
|
|
"name": "Uniswap",
|
|
|
|
"symbol": "UNI"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"label": "Exchange"
|
2021-08-09 14:58:48 +00:00
|
|
|
"label_data": {...}
|
2021-08-06 12:05:59 +00:00
|
|
|
}
|
|
|
|
"""
|
|
|
|
|
|
|
|
__tablename__ = "ethereum_labels"
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
2022-06-07 11:05:19 +00:00
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
2021-08-09 14:04:17 +00:00
|
|
|
label_data = Column(JSONB, nullable=True)
|
2021-10-20 15:43:31 +00:00
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
2021-10-19 21:07:55 +00:00
|
|
|
log_index = Column(Integer, nullable=True)
|
2021-08-06 12:05:59 +00:00
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
2021-07-26 11:03:33 +00:00
|
|
|
|
2021-07-29 04:35:49 +00:00
|
|
|
|
2021-11-08 10:51:43 +00:00
|
|
|
class PolygonBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "polygon_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class PolygonTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "polygon_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("polygon_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class PolygonLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "polygon_labels"
|
|
|
|
|
2022-06-07 10:55:53 +00:00
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_polygon_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_polygon_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2022-08-09 12:51:49 +00:00
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class MumbaiBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "mumbai_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class MumbaiTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "mumbai_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("mumbai_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class MumbaiLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "mumbai_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_mumbai_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_mumbai_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2024-04-15 08:05:54 +00:00
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class AmoyBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "amoy_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class AmoyTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "amoy_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("amoy_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class AmoyLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "amoy_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_amoy_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_amoy_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2021-11-08 10:51:43 +00:00
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
2022-06-07 11:05:19 +00:00
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
2021-11-08 10:51:43 +00:00
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2022-05-23 12:17:06 +00:00
|
|
|
class XDaiBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "xdai_blocks"
|
|
|
|
|
2022-05-23 13:30:48 +00:00
|
|
|
author = Column(VARCHAR(128))
|
2022-05-23 12:17:06 +00:00
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
2022-05-23 13:53:34 +00:00
|
|
|
difficulty = Column(VARCHAR(128))
|
2022-05-23 12:17:06 +00:00
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
2022-05-23 13:30:48 +00:00
|
|
|
nonce = Column(VARCHAR(256), nullable=True)
|
2022-05-23 12:17:06 +00:00
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
2022-05-23 13:30:48 +00:00
|
|
|
signature = Column(VARCHAR(256))
|
2022-05-23 12:17:06 +00:00
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
2022-05-23 13:30:48 +00:00
|
|
|
step = Column(BigInteger)
|
2022-05-23 12:17:06 +00:00
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class XDaiTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "xdai_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("xdai_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
2022-05-23 13:30:48 +00:00
|
|
|
data = Column(Text)
|
2022-05-23 12:17:06 +00:00
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class XDaiLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "xdai_labels"
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2023-03-02 12:26:36 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2023-03-06 15:58:25 +00:00
|
|
|
class WyrmBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "wyrm_blocks"
|
2023-03-02 12:26:36 +00:00
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2023-03-06 15:58:25 +00:00
|
|
|
class WyrmTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "wyrm_transactions"
|
2023-03-02 12:26:36 +00:00
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
2023-03-06 15:58:25 +00:00
|
|
|
ForeignKey("wyrm_blocks.block_number", ondelete="CASCADE"),
|
2023-03-02 12:26:36 +00:00
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2023-03-06 15:58:25 +00:00
|
|
|
class WyrmLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "wyrm_labels"
|
2023-03-02 12:26:36 +00:00
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
2023-03-06 15:58:25 +00:00
|
|
|
"ix_wyrm_labels_address_block_number",
|
2023-03-02 12:26:36 +00:00
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
2023-03-06 15:58:25 +00:00
|
|
|
"ix_wyrm_labels_address_block_timestamp",
|
2023-03-02 12:26:36 +00:00
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
id = Column(
|
2023-08-29 00:45:54 +00:00
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ZkSyncEraBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
l1_batch_number = Column(BigInteger, nullable=True)
|
|
|
|
l1_batch_timestamp = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ZkSyncEraTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("zksync_era_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
l1_batch_number = Column(BigInteger, nullable=True)
|
|
|
|
l1_batch_tx_index = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ZkSyncEraLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_zksync_era_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_zksync_era_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
id = Column(
|
2023-03-02 12:26:36 +00:00
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2023-07-12 11:23:00 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ZkSyncEraTestnetBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_testnet_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
2023-07-12 12:30:39 +00:00
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
2023-07-12 11:23:00 +00:00
|
|
|
|
2023-07-12 12:30:39 +00:00
|
|
|
l1_batch_number = Column(BigInteger, nullable=True)
|
|
|
|
l1_batch_timestamp = Column(BigInteger, nullable=True)
|
2023-07-12 11:23:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ZkSyncEraTestnetTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_testnet_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("zksync_era_testnet_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
2023-07-12 12:30:39 +00:00
|
|
|
l1_batch_number = Column(BigInteger, nullable=True)
|
|
|
|
l1_batch_tx_index = Column(BigInteger, nullable=True)
|
2023-07-12 11:23:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ZkSyncEraTestnetLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_testnet_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_zksync_era_testnet_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_zksync_era_testnet_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2024-01-30 13:57:13 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-03-28 12:17:20 +00:00
|
|
|
class ZkSyncEraSepoliaBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_sepolia_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
l1_batch_number = Column(BigInteger, nullable=True)
|
|
|
|
l1_batch_timestamp = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ZkSyncEraSepoliaTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_sepolia_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("zksync_era_sepolia_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
l1_batch_number = Column(BigInteger, nullable=True)
|
|
|
|
l1_batch_tx_index = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ZkSyncEraSepoliaLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "zksync_era_sepolia_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_zksync_era_sepolia_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_zksync_era_sepolia_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-01-30 13:57:13 +00:00
|
|
|
class ArbitrumNovaBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "arbitrum_nova_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
2024-01-31 10:08:05 +00:00
|
|
|
receipt_root = Column(VARCHAR(256))
|
2024-01-30 13:57:13 +00:00
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
|
|
|
l1_block_number = Column(BigInteger, nullable=True)
|
|
|
|
send_count = Column(BigInteger, nullable=True)
|
|
|
|
send_root = Column(VARCHAR(256), nullable=True)
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ArbitrumNovaTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "arbitrum_nova_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("arbitrum_nova_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
y_parity = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ArbitrumNovaLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "arbitrum_nova_labels"
|
|
|
|
|
2024-03-28 12:17:20 +00:00
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_arbitrum_nova_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_arbitrum_nova_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2024-01-30 13:57:13 +00:00
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2024-02-20 12:57:29 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ArbitrumSepoliaBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "arbitrum_sepolia_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
|
|
|
l1_block_number = Column(BigInteger, nullable=True)
|
|
|
|
send_count = Column(BigInteger, nullable=True)
|
|
|
|
send_root = Column(VARCHAR(256), nullable=True)
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ArbitrumSepoliaTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "arbitrum_sepolia_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("arbitrum_sepolia_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
y_parity = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ArbitrumSepoliaLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "arbitrum_sepolia_labels"
|
|
|
|
|
2024-03-28 12:17:20 +00:00
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_arbitrum_sepolia_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_arbitrum_sepolia_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2024-02-20 12:57:29 +00:00
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2024-02-21 01:27:06 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class XaiBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "xai_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
|
|
|
l1_block_number = Column(BigInteger, nullable=True)
|
|
|
|
send_count = Column(BigInteger, nullable=True)
|
|
|
|
send_root = Column(VARCHAR(256), nullable=True)
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class XaiTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "xai_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("xai_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
y_parity = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class XaiLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "xai_labels"
|
|
|
|
|
2024-03-28 15:59:39 +00:00
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_xai_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_xai_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2024-02-21 01:27:06 +00:00
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2024-03-13 22:09:54 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-03-13 22:43:38 +00:00
|
|
|
class XaiSepoliaBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "xai_sepolia_blocks"
|
2024-03-13 22:09:54 +00:00
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
|
|
|
l1_block_number = Column(BigInteger, nullable=True)
|
|
|
|
send_count = Column(BigInteger, nullable=True)
|
|
|
|
send_root = Column(VARCHAR(256), nullable=True)
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
|
2024-03-13 22:43:38 +00:00
|
|
|
class XaiSepoliaTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "xai_sepolia_transactions"
|
2024-03-13 22:09:54 +00:00
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
2024-03-13 22:43:38 +00:00
|
|
|
ForeignKey("xai_sepolia_blocks.block_number", ondelete="CASCADE"),
|
2024-03-13 22:09:54 +00:00
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
y_parity = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
2024-03-13 22:43:38 +00:00
|
|
|
class XaiSepoliaLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "xai_sepolia_labels"
|
2024-03-13 22:09:54 +00:00
|
|
|
|
2024-03-28 15:59:39 +00:00
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_xai_sepolia_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_xai_sepolia_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2024-02-21 01:27:06 +00:00
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2024-03-28 12:17:20 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class AvalancheBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "avalanche_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
2024-04-01 09:54:21 +00:00
|
|
|
block_extra_data = Column(Text, nullable=True)
|
2024-03-28 12:17:20 +00:00
|
|
|
block_gas_cost = Column(VARCHAR(256), nullable=True)
|
|
|
|
ext_data_gas_used = Column(VARCHAR(256), nullable=True)
|
|
|
|
ext_data_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class AvalancheTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "avalanche_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("avalanche_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class AvalancheLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "avalanche_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_avalanche_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_avalanche_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class AvalancheFujiBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "avalanche_fuji_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
block_extra_data = Column(VARCHAR(256), nullable=True)
|
|
|
|
block_gas_cost = Column(VARCHAR(256), nullable=True)
|
|
|
|
ext_data_gas_used = Column(VARCHAR(256), nullable=True)
|
|
|
|
ext_data_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class AvalancheFujiTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "avalanche_fuji_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("avalanche_fuji_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class AvalancheFujiLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "avalanche_fuji_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_avalanche_fuji_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_avalanche_fuji_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2024-03-13 22:09:54 +00:00
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2024-04-10 10:02:19 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class BlastBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "blast_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
|
|
|
withdrawals_root = Column(VARCHAR(256), nullable=True)
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class BlastTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "blast_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("blast_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
y_parity = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class BlastLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "blast_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_blast_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_blast_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class BlastSepoliaBlock(Base): # type: ignore
|
|
|
|
__tablename__ = "blast_sepolia_blocks"
|
|
|
|
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
difficulty = Column(BigInteger)
|
|
|
|
extra_data = Column(VARCHAR(128))
|
|
|
|
gas_limit = Column(BigInteger)
|
|
|
|
gas_used = Column(BigInteger)
|
|
|
|
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
hash = Column(VARCHAR(256), index=True)
|
|
|
|
logs_bloom = Column(VARCHAR(1024))
|
|
|
|
miner = Column(VARCHAR(256))
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
parent_hash = Column(VARCHAR(256))
|
|
|
|
receipt_root = Column(VARCHAR(256))
|
|
|
|
uncles = Column(VARCHAR(256))
|
|
|
|
size = Column(Integer)
|
|
|
|
state_root = Column(VARCHAR(256))
|
|
|
|
timestamp = Column(BigInteger, index=True)
|
|
|
|
total_difficulty = Column(VARCHAR(256))
|
|
|
|
transactions_root = Column(VARCHAR(256))
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
|
|
|
withdrawals_root = Column(VARCHAR(256), nullable=True)
|
|
|
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class BlastSepoliaTransaction(Base): # type: ignore
|
|
|
|
__tablename__ = "blast_sepolia_transactions"
|
|
|
|
|
|
|
|
hash = Column(
|
|
|
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
|
|
|
)
|
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
ForeignKey("blast_sepolia_blocks.block_number", ondelete="CASCADE"),
|
|
|
|
nullable=False,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
from_address = Column(VARCHAR(256), index=True)
|
|
|
|
to_address = Column(VARCHAR(256), index=True)
|
|
|
|
gas = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
|
|
|
input = Column(Text)
|
|
|
|
nonce = Column(VARCHAR(256))
|
|
|
|
transaction_index = Column(BigInteger)
|
|
|
|
transaction_type = Column(Integer, nullable=True)
|
|
|
|
value = Column(Numeric(precision=78, scale=0), index=True)
|
|
|
|
|
|
|
|
indexed_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
y_parity = Column(BigInteger, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class BlastSepoliaLabel(Base): # type: ignore
|
|
|
|
__tablename__ = "blast_sepolia_labels"
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
Index(
|
|
|
|
"ix_blast_sepolia_labels_address_block_number",
|
|
|
|
"address",
|
|
|
|
"block_number",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
Index(
|
|
|
|
"ix_blast_sepolia_labels_address_block_timestamp",
|
|
|
|
"address",
|
|
|
|
"block_timestamp",
|
|
|
|
unique=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
UUID(as_uuid=True),
|
|
|
|
primary_key=True,
|
|
|
|
default=uuid.uuid4,
|
|
|
|
unique=True,
|
|
|
|
nullable=False,
|
|
|
|
)
|
2022-05-23 12:17:06 +00:00
|
|
|
label = Column(VARCHAR(256), nullable=False, index=True)
|
2022-06-07 11:05:19 +00:00
|
|
|
block_number = Column(
|
|
|
|
BigInteger,
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
address = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
|
|
|
transaction_hash = Column(
|
|
|
|
VARCHAR(256),
|
|
|
|
nullable=True,
|
|
|
|
index=True,
|
|
|
|
)
|
2022-05-23 12:17:06 +00:00
|
|
|
label_data = Column(JSONB, nullable=True)
|
|
|
|
block_timestamp = Column(BigInteger, index=True)
|
|
|
|
log_index = Column(Integer, nullable=True)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2021-07-29 04:35:49 +00:00
|
|
|
class ESDFunctionSignature(Base): # type: ignore
|
2021-07-27 07:06:23 +00:00
|
|
|
"""
|
2021-11-08 10:51:43 +00:00
|
|
|
Function signature from blockchain (Ethereum/Polygon) Signature Database.
|
2021-07-27 07:06:23 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
__tablename__ = "esd_function_signatures"
|
|
|
|
|
2021-07-29 17:31:17 +00:00
|
|
|
id = Column(Integer, primary_key=True, unique=True, nullable=False, index=True)
|
2021-07-27 07:06:23 +00:00
|
|
|
text_signature = Column(Text, nullable=False)
|
|
|
|
hex_signature = Column(VARCHAR(10), nullable=False)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2021-07-29 04:35:49 +00:00
|
|
|
class ESDEventSignature(Base): # type: ignore
|
2021-07-27 07:06:23 +00:00
|
|
|
"""
|
2021-11-08 10:51:43 +00:00
|
|
|
Function signature from blockchain (Ethereum/Polygon) Signature Database.
|
2021-07-27 07:06:23 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
__tablename__ = "esd_event_signatures"
|
|
|
|
|
2021-07-29 17:31:17 +00:00
|
|
|
id = Column(Integer, primary_key=True, unique=True, nullable=False, index=True)
|
2021-07-27 07:06:23 +00:00
|
|
|
text_signature = Column(Text, nullable=False)
|
|
|
|
hex_signature = Column(VARCHAR(66), nullable=False)
|
|
|
|
created_at = Column(
|
|
|
|
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
|
|
|
)
|
2021-08-31 14:17:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
class OpenSeaCrawlingState(Base): # type: ignore
|
|
|
|
"""
|
|
|
|
Model for control opeansea crawling state.
|
|
|
|
"""
|
|
|
|
|
|
|
|
__tablename__ = "opensea_crawler_state"
|
|
|
|
|
2021-08-31 15:01:23 +00:00
|
|
|
id = Column(Integer, primary_key=True, unique=True, nullable=False)
|
2021-08-31 14:17:36 +00:00
|
|
|
query = Column(Text, nullable=False)
|
2021-09-02 16:01:57 +00:00
|
|
|
crawled_at = Column(
|
|
|
|
DateTime(timezone=True),
|
|
|
|
server_default=utcnow(),
|
|
|
|
onupdate=utcnow(),
|
|
|
|
nullable=False,
|
2021-08-31 14:17:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
total_count = Column(Integer, nullable=False)
|