v0.5.3-pre.003

This commit is contained in:
2026-08-12 11:00:59 +02:00
parent 8448ad1079
commit 400ced4832
313 changed files with 7773 additions and 2623 deletions

View File

@@ -0,0 +1,17 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_core_account_keys.sql
-- version: 1
-- Create the PostgreSQL k_sol_core_account_keys table when absent.
CREATE TABLE IF NOT EXISTS k_sol_core_account_keys (
id BIGSERIAL,
transaction_id BIGINT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
account_index INTEGER NOT NULL,
account_key TEXT NOT NULL,
source TEXT NOT NULL,
writable BOOLEAN NOT NULL,
signer BOOLEAN NOT NULL,
executable BOOLEAN,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,18 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_core_account_states.sql
-- version: 1
-- Create the PostgreSQL k_sol_core_account_states table when absent.
CREATE TABLE IF NOT EXISTS k_sol_core_account_states (
id BIGSERIAL,
source_observation_id BIGINT NOT NULL,
account_key TEXT NOT NULL,
slot BIGINT NOT NULL,
owner TEXT NOT NULL,
lamports NUMERIC(20,0) NOT NULL,
executable BOOLEAN NOT NULL,
rent_epoch NUMERIC(20,0) NOT NULL,
space BIGINT NOT NULL,
data_base64 TEXT NOT NULL,
data_hash TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,20 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_core_balance_changes.sql
-- version: 1
-- Create the PostgreSQL k_sol_core_balance_changes table when absent.
CREATE TABLE IF NOT EXISTS k_sol_core_balance_changes (
id BIGSERIAL,
transaction_id BIGINT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
balance_change_index INTEGER NOT NULL,
balance_kind TEXT NOT NULL,
account_index INTEGER,
account_key TEXT,
mint TEXT,
owner TEXT,
pre_balance_json JSONB,
post_balance_json JSONB,
delta_json JSONB,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,23 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_core_inner_instructions.sql
-- version: 1
-- Create the PostgreSQL k_sol_core_inner_instructions table when absent.
CREATE TABLE IF NOT EXISTS k_sol_core_inner_instructions (
id BIGSERIAL,
transaction_id BIGINT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
parent_instruction_path TEXT NOT NULL,
instruction_path TEXT NOT NULL,
program_id TEXT NOT NULL,
stack_height INTEGER,
accounts_json JSONB NOT NULL,
payload_json JSONB,
payload_json_hash TEXT,
processing_state TEXT NOT NULL DEFAULT 'pending',
processor_name TEXT,
processor_version TEXT,
lifecycle_reason TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,22 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_core_instructions.sql
-- version: 1
-- Create the PostgreSQL k_sol_core_instructions table when absent.
CREATE TABLE IF NOT EXISTS k_sol_core_instructions (
id BIGSERIAL,
transaction_id BIGINT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
instruction_path TEXT NOT NULL,
program_id TEXT NOT NULL,
stack_height INTEGER,
accounts_json JSONB NOT NULL,
payload_json JSONB,
payload_json_hash TEXT,
processing_state TEXT NOT NULL DEFAULT 'pending',
processor_name TEXT,
processor_version TEXT,
lifecycle_reason TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,16 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_core_logs.sql
-- version: 1
-- Create the PostgreSQL k_sol_core_logs table when absent.
CREATE TABLE IF NOT EXISTS k_sol_core_logs (
id BIGSERIAL,
transaction_id BIGINT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
log_index INTEGER NOT NULL,
instruction_path TEXT,
program_id TEXT,
log_text TEXT,
log_text_hash TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,13 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_core_return_data.sql
-- version: 1
-- Create the PostgreSQL k_sol_core_return_data table when absent.
CREATE TABLE IF NOT EXISTS k_sol_core_return_data (
id BIGSERIAL,
transaction_id BIGINT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
program_id TEXT NOT NULL,
data_base64 TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,15 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_core_transactions.sql
-- version: 1
-- Create the PostgreSQL k_sol_core_transactions table when absent.
CREATE TABLE IF NOT EXISTS k_sol_core_transactions (
id BIGSERIAL,
raw_transaction_id BIGINT,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
block_time BIGINT,
failed BOOLEAN NOT NULL DEFAULT FALSE,
err_json JSONB,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,17 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_decode_coverage_declarations.sql
-- version: 1
-- Create the PostgreSQL k_sol_decode_coverage_declarations table when absent.
CREATE TABLE IF NOT EXISTS k_sol_decode_coverage_declarations (
id BIGSERIAL,
processor_name TEXT NOT NULL,
processor_version TEXT NOT NULL,
program_id TEXT NOT NULL,
surface_code TEXT,
entry_kind TEXT NOT NULL,
entry_code TEXT NOT NULL,
discriminator_hex TEXT,
historical BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,26 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_decode_coverage_observations.sql
-- version: 1
-- Create the PostgreSQL k_sol_decode_coverage_observations table when absent.
CREATE TABLE IF NOT EXISTS k_sol_decode_coverage_observations (
id BIGSERIAL,
processor_name TEXT NOT NULL,
processor_version TEXT NOT NULL,
input_key TEXT NOT NULL,
input_hash TEXT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
instruction_path TEXT NOT NULL,
program_id TEXT NOT NULL,
surface_code TEXT,
entry_code TEXT,
discriminator_hex TEXT,
status TEXT NOT NULL,
recognized BOOLEAN NOT NULL,
decoded_count INTEGER NOT NULL DEFAULT 0,
materialized_count INTEGER NOT NULL DEFAULT 0,
error_count INTEGER NOT NULL DEFAULT 0,
transaction_failed BOOLEAN NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,35 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_decode_events.sql
-- version: 1
-- Create the PostgreSQL k_sol_decode_events table when absent.
CREATE TABLE IF NOT EXISTS k_sol_decode_events (
id BIGSERIAL,
processor_name TEXT NOT NULL,
processor_version TEXT NOT NULL,
input_key TEXT NOT NULL,
input_hash TEXT NOT NULL,
event_key TEXT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
instruction_path TEXT NOT NULL,
program_id TEXT NOT NULL,
protocol_code TEXT NOT NULL,
surface_code TEXT NOT NULL,
event_code TEXT NOT NULL,
event_name TEXT NOT NULL,
event_family TEXT NOT NULL,
source_kind TEXT NOT NULL,
confidence TEXT NOT NULL,
proof_kind TEXT NOT NULL,
proof_jsonb JSONB NOT NULL,
payload_jsonb JSONB NOT NULL,
schema_kind TEXT,
schema_id TEXT,
schema_version TEXT,
schema_hash TEXT,
transaction_failed BOOLEAN NOT NULL,
transaction_error_jsonb JSONB,
observation_committed BOOLEAN NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,22 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_mat_outputs.sql
-- version: 1
-- Create the PostgreSQL k_sol_mat_outputs table when absent.
CREATE TABLE IF NOT EXISTS k_sol_mat_outputs (
id BIGSERIAL,
processor_name TEXT NOT NULL,
processor_version TEXT NOT NULL,
input_key TEXT NOT NULL,
input_hash TEXT NOT NULL,
output_key TEXT NOT NULL,
source_event_key TEXT NOT NULL,
source_decoder_name TEXT NOT NULL,
source_decoder_version TEXT NOT NULL,
source_decode_input_key TEXT NOT NULL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
materialized_family TEXT NOT NULL,
payload_jsonb JSONB NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,34 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_obs_account_observations.sql
-- version: 1
-- Create the PostgreSQL k_sol_obs_account_observations table when absent.
CREATE TABLE IF NOT EXISTS k_sol_obs_account_observations (
id BIGSERIAL,
observation_key TEXT NOT NULL,
account_key TEXT NOT NULL,
context_slot BIGINT NOT NULL,
owner TEXT,
lamports NUMERIC(20,0),
executable BOOLEAN,
rent_epoch NUMERIC(20,0),
space BIGINT,
data_base64 TEXT,
data_hash TEXT,
provider TEXT NOT NULL,
endpoint_code TEXT,
protocol TEXT NOT NULL,
acquisition_method TEXT NOT NULL,
commitment TEXT,
capture_session_id TEXT,
filter_code TEXT,
origin TEXT NOT NULL,
detected_at TIMESTAMPTZ,
received_at TIMESTAMPTZ NOT NULL,
normalized_at TIMESTAMPTZ,
persisted_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
payload_size_bytes BIGINT,
source_payload_hash TEXT,
status TEXT NOT NULL DEFAULT 'received',
error_code TEXT,
error_message TEXT
);

View File

@@ -0,0 +1,28 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_obs_transaction_observations.sql
-- version: 1
-- Create the PostgreSQL k_sol_obs_transaction_observations table when absent.
CREATE TABLE IF NOT EXISTS k_sol_obs_transaction_observations (
id BIGSERIAL,
raw_transaction_id BIGINT,
observation_key TEXT NOT NULL,
signature TEXT,
slot BIGINT,
provider TEXT NOT NULL,
endpoint_code TEXT,
protocol TEXT NOT NULL,
acquisition_method TEXT NOT NULL,
origin TEXT NOT NULL,
commitment TEXT,
capture_session_id TEXT,
filter_code TEXT,
detected_at TIMESTAMPTZ,
received_at TIMESTAMPTZ NOT NULL,
normalized_at TIMESTAMPTZ,
persisted_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
payload_size_bytes BIGINT,
source_payload_hash TEXT,
status TEXT NOT NULL DEFAULT 'received',
error_code TEXT,
error_message TEXT
);

View File

@@ -0,0 +1,20 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_ops_processing_ledger.sql
-- version: 1
-- Create the PostgreSQL k_sol_ops_processing_ledger table when absent.
CREATE TABLE IF NOT EXISTS k_sol_ops_processing_ledger (
id BIGSERIAL,
stage TEXT NOT NULL,
processor_name TEXT NOT NULL,
processor_version TEXT NOT NULL,
input_key TEXT NOT NULL,
input_hash TEXT NOT NULL,
status TEXT NOT NULL,
attempt_count INTEGER NOT NULL DEFAULT 0,
started_at TIMESTAMPTZ,
finished_at TIMESTAMPTZ,
error_code TEXT,
error_message TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,18 @@
-- file: migrations/postgres/schema/tables/create_table_if_not_exists_k_sol_raw_transactions.sql
-- version: 1
-- Create the PostgreSQL k_sol_raw_transactions table when absent.
CREATE TABLE IF NOT EXISTS k_sol_raw_transactions (
id BIGSERIAL,
signature TEXT NOT NULL,
slot BIGINT NOT NULL,
block_time BIGINT,
canonical_json JSONB,
canonical_json_hash TEXT,
canonical_format_version INTEGER NOT NULL DEFAULT 1,
retention_state TEXT NOT NULL DEFAULT 'full',
processing_state TEXT NOT NULL DEFAULT 'received',
lifecycle_reason TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);