Versions in this module Expand all Collapse all v0 v0.1.0 Mar 23, 2025 Changes in this version + func DetailsToJSON(details map[string]interface{}) ([]byte, error) + func JSONToDetails(data []byte) (map[string]interface{}, error) + func JSONToParameters(data json.RawMessage) (map[string]interface{}, error) + func ParametersToJSON(parameters map[string]interface{}) (json.RawMessage, error) + type ContractRepository struct + func NewContractRepository(db *sqlx.DB) *ContractRepository + func (r *ContractRepository) Create(ctx context.Context, contract *models.Contract) error + func (r *ContractRepository) CreateVerification(ctx context.Context, verification *models.ContractVerification) error + func (r *ContractRepository) Delete(ctx context.Context, id uuid.UUID) error + func (r *ContractRepository) GetByAddress(ctx context.Context, address, network string) (*models.Contract, error) + func (r *ContractRepository) GetByID(ctx context.Context, id uuid.UUID) (*models.Contract, error) + func (r *ContractRepository) GetByUserID(ctx context.Context, userID int) ([]*models.Contract, error) + func (r *ContractRepository) GetLatestVerification(ctx context.Context, contractID uuid.UUID) (*models.ContractVerification, error) + func (r *ContractRepository) GetVerificationsByContractID(ctx context.Context, contractID uuid.UUID) ([]*models.ContractVerification, error) + func (r *ContractRepository) Update(ctx context.Context, contract *models.Contract) error + type Database struct + func New(cfg *config.DatabaseConfig, log *logger.Logger) (*Database, error) + func (d *Database) Close() error + func (d *Database) DB() *sql.DB + func (d *Database) RunMigrations(migrationsPath string) error + func (d *Database) Transaction(fn func(*sql.Tx) error) error + type EventRepository struct + func NewEventRepository(db *sqlx.DB) *EventRepository + func (r *EventRepository) CountEvents(ctx context.Context, contractAddress string, eventName string, fromBlock int, ...) (int, error) + func (r *EventRepository) CreateEvent(ctx context.Context, event *models.BlockchainEvent) error + func (r *EventRepository) CreateNotification(ctx context.Context, notification *models.EventNotification) error + func (r *EventRepository) CreateSubscription(ctx context.Context, subscription *models.EventSubscription) error + func (r *EventRepository) DeleteSubscription(ctx context.Context, id uuid.UUID) error + func (r *EventRepository) GetActiveSubscriptions(ctx context.Context) ([]*models.EventSubscription, error) + func (r *EventRepository) GetBlockProcessing(ctx context.Context, network string) (*models.BlockProcessing, error) + func (r *EventRepository) GetEventByID(ctx context.Context, id uuid.UUID) (*models.BlockchainEvent, error) + func (r *EventRepository) GetEvents(ctx context.Context, contractAddress string, eventName string, fromBlock int, ...) ([]*models.BlockchainEvent, error) + func (r *EventRepository) GetMatchingSubscriptions(ctx context.Context, contractAddress string, eventName string, blockNumber int) ([]*models.EventSubscription, error) + func (r *EventRepository) GetPendingNotifications(ctx context.Context, limit int) ([]*models.EventNotification, error) + func (r *EventRepository) GetSubscriptionByID(ctx context.Context, id uuid.UUID) (*models.EventSubscription, error) + func (r *EventRepository) GetSubscriptionsByUserID(ctx context.Context, userID int) ([]*models.EventSubscription, error) + func (r *EventRepository) UpdateBlockProcessing(ctx context.Context, blockProcessing *models.BlockProcessing) error + func (r *EventRepository) UpdateNotification(ctx context.Context, notification *models.EventNotification) error + func (r *EventRepository) UpdateSubscription(ctx context.Context, subscription *models.EventSubscription) error + type Function struct + CreatedAt time.Time + Description string + ID string + Name string + SecretsAccess []string + SourceCode string + TriggerType string + UpdatedAt time.Time + UserID int + type FunctionExecution struct + Duration int64 + EndTime time.Time + Error string + FunctionID string + ID string + InputParams string + Result string + StartTime time.Time + Status string + UserID int + type FunctionRepository struct + func NewFunctionRepository(db *sqlx.DB, cacheManager *cache.Manager, logger zerolog.Logger) *FunctionRepository + func (r *FunctionRepository) Create(ctx context.Context, function *Function) error + func (r *FunctionRepository) Delete(ctx context.Context, id string, userID int) error + func (r *FunctionRepository) GetByID(ctx context.Context, id string) (*Function, error) + func (r *FunctionRepository) ListByUserID(ctx context.Context, userID int, page, limit int) ([]Function, int, error) + func (r *FunctionRepository) ListExecutionsByFunctionID(ctx context.Context, functionID string, page, limit int) ([]FunctionExecution, int, error) + func (r *FunctionRepository) Update(ctx context.Context, function *Function) error + type OptimizedTransactionRepository struct + func (r *OptimizedTransactionRepository) AddTransactionEvent(ctx context.Context, event *models.TransactionEvent) error + func (r *OptimizedTransactionRepository) CreateTransaction(ctx context.Context, tx *models.Transaction) error + func (r *OptimizedTransactionRepository) CreateWalletAccount(ctx context.Context, wallet *models.WalletAccount) error + func (r *OptimizedTransactionRepository) DeleteTransaction(ctx context.Context, id uuid.UUID) error + func (r *OptimizedTransactionRepository) DeleteWalletAccount(ctx context.Context, id uuid.UUID) error + func (r *OptimizedTransactionRepository) GetTransactionByHash(ctx context.Context, hash string) (*models.Transaction, error) + func (r *OptimizedTransactionRepository) GetTransactionByID(ctx context.Context, id uuid.UUID) (*models.Transaction, error) + func (r *OptimizedTransactionRepository) GetTransactionEvents(ctx context.Context, transactionID uuid.UUID) ([]models.TransactionEvent, error) + func (r *OptimizedTransactionRepository) GetWalletByAddress(ctx context.Context, address string) (*models.WalletAccount, error) + func (r *OptimizedTransactionRepository) GetWalletByService(ctx context.Context, service string) (*models.WalletAccount, error) + func (r *OptimizedTransactionRepository) ListTransactions(ctx context.Context, service string, status models.TransactionStatus, ...) (*models.TransactionListResponse, error) + func (r *OptimizedTransactionRepository) ListWalletsByService(ctx context.Context, service string) ([]models.WalletAccount, error) + func (r *OptimizedTransactionRepository) UpdateTransactionStatus(ctx context.Context, id uuid.UUID, status models.TransactionStatus, ...) error + type OracleRepository struct + func NewOracleRepository(db *sqlx.DB) *OracleRepository + func (r *OracleRepository) CreateOracle(oracle *models.Oracle) (*models.Oracle, error) + func (r *OracleRepository) CreateOracleRequest(request *models.OracleRequest) (*models.OracleRequest, error) + func (r *OracleRepository) DeleteOracle(id int) error + func (r *OracleRepository) GetOracleByID(id int) (*models.Oracle, error) + func (r *OracleRepository) GetOracleByName(name string) (*models.Oracle, error) + func (r *OracleRepository) GetOracleRequestByID(id int) (*models.OracleRequest, error) + func (r *OracleRepository) GetOracleStatistics() (map[string]interface{}, error) + func (r *OracleRepository) ListOracleRequests(oracleID int, offset, limit int) ([]*models.OracleRequest, error) + func (r *OracleRepository) ListOracles(userID int, offset, limit int) ([]*models.Oracle, error) + func (r *OracleRepository) ListPendingOracleRequests() ([]*models.OracleRequest, error) + func (r *OracleRepository) UpdateOracle(oracle *models.Oracle) (*models.Oracle, error) + func (r *OracleRepository) UpdateOracleRequest(request *models.OracleRequest) (*models.OracleRequest, error) + type PriceFeedRepository struct + func NewPriceFeedRepository(db *sqlx.DB) *PriceFeedRepository + func (r *PriceFeedRepository) CreatePriceData(data *models.PriceData) (*models.PriceData, error) + func (r *PriceFeedRepository) CreatePriceFeed(feed *models.PriceFeed) (*models.PriceFeed, error) + func (r *PriceFeedRepository) CreatePriceSource(source *models.PriceSource) (*models.PriceSource, error) + func (r *PriceFeedRepository) DeletePriceFeed(id int) error + func (r *PriceFeedRepository) DeletePriceSource(id int) error + func (r *PriceFeedRepository) GetLatestPriceData(priceFeedID int) (*models.PriceData, error) + func (r *PriceFeedRepository) GetPriceDataHistory(priceFeedID int, limit int, offset int) ([]*models.PriceData, error) + func (r *PriceFeedRepository) GetPriceFeedByID(id int) (*models.PriceFeed, error) + func (r *PriceFeedRepository) GetPriceFeedByPair(pair string) (*models.PriceFeed, error) + func (r *PriceFeedRepository) GetPriceSourceByID(id int) (*models.PriceSource, error) + func (r *PriceFeedRepository) GetPriceSourceByName(name string) (*models.PriceSource, error) + func (r *PriceFeedRepository) ListPriceFeeds() ([]*models.PriceFeed, error) + func (r *PriceFeedRepository) ListPriceSources() ([]*models.PriceSource, error) + func (r *PriceFeedRepository) UpdatePriceFeed(feed *models.PriceFeed) (*models.PriceFeed, error) + func (r *PriceFeedRepository) UpdatePriceSource(source *models.PriceSource) (*models.PriceSource, error) + type RandomRepository struct + func NewRandomRepository(db *sqlx.DB) *RandomRepository + func (r *RandomRepository) CreateEntropySource(source *models.EntropySource) (*models.EntropySource, error) + func (r *RandomRepository) CreateRequest(req *models.RandomRequest) (*models.RandomRequest, error) + func (r *RandomRepository) GetEntropySourceByID(id int) (*models.EntropySource, error) + func (r *RandomRepository) GetEntropySourceByName(name string) (*models.EntropySource, error) + func (r *RandomRepository) GetRandomStatistics() (map[string]interface{}, error) + func (r *RandomRepository) GetRequestByID(id int) (*models.RandomRequest, error) + func (r *RandomRepository) ListCommittedRequests() ([]*models.RandomRequest, error) + func (r *RandomRepository) ListEntropySources() ([]*models.EntropySource, error) + func (r *RandomRepository) ListPendingRequests() ([]*models.RandomRequest, error) + func (r *RandomRepository) ListRequests(userID int, offset, limit int) ([]*models.RandomRequest, error) + func (r *RandomRepository) UpdateEntropySource(source *models.EntropySource) (*models.EntropySource, error) + func (r *RandomRepository) UpdateRequest(req *models.RandomRequest) (*models.RandomRequest, error) + type RepositoryFactory struct + func NewRepositoryFactory(db *sqlx.DB, logger *zerolog.Logger) *RepositoryFactory + func (f *RepositoryFactory) CreateTransactionRepository(useOptimized bool) TransactionRepository + type SQLTransactionRepository struct + func (r *SQLTransactionRepository) AddTransactionEvent(ctx context.Context, event *models.TransactionEvent) error + func (r *SQLTransactionRepository) CreateTransaction(ctx context.Context, tx *models.Transaction) error + func (r *SQLTransactionRepository) CreateWalletAccount(ctx context.Context, wallet *models.WalletAccount) error + func (r *SQLTransactionRepository) DeleteTransaction(ctx context.Context, id uuid.UUID) error + func (r *SQLTransactionRepository) DeleteWalletAccount(ctx context.Context, id uuid.UUID) error + func (r *SQLTransactionRepository) GetTransactionByHash(ctx context.Context, hash string) (*models.Transaction, error) + func (r *SQLTransactionRepository) GetTransactionByID(ctx context.Context, id uuid.UUID) (*models.Transaction, error) + func (r *SQLTransactionRepository) GetTransactionEvents(ctx context.Context, transactionID uuid.UUID) ([]models.TransactionEvent, error) + func (r *SQLTransactionRepository) GetWalletByAddress(ctx context.Context, address string) (*models.WalletAccount, error) + func (r *SQLTransactionRepository) GetWalletByService(ctx context.Context, service string) (*models.WalletAccount, error) + func (r *SQLTransactionRepository) ListTransactions(ctx context.Context, service string, status models.TransactionStatus, ...) (*models.TransactionListResponse, error) + func (r *SQLTransactionRepository) ListWalletsByService(ctx context.Context, service string) ([]models.WalletAccount, error) + func (r *SQLTransactionRepository) UpdateTransactionStatus(ctx context.Context, id uuid.UUID, status models.TransactionStatus, ...) error + type TransactionRepository interface + AddTransactionEvent func(ctx context.Context, event *models.TransactionEvent) error + CreateTransaction func(ctx context.Context, tx *models.Transaction) error + CreateWalletAccount func(ctx context.Context, wallet *models.WalletAccount) error + DeleteTransaction func(ctx context.Context, id uuid.UUID) error + DeleteWalletAccount func(ctx context.Context, id uuid.UUID) error + GetTransactionByHash func(ctx context.Context, hash string) (*models.Transaction, error) + GetTransactionByID func(ctx context.Context, id uuid.UUID) (*models.Transaction, error) + GetTransactionEvents func(ctx context.Context, transactionID uuid.UUID) ([]models.TransactionEvent, error) + GetWalletByAddress func(ctx context.Context, address string) (*models.WalletAccount, error) + GetWalletByService func(ctx context.Context, service string) (*models.WalletAccount, error) + ListTransactions func(ctx context.Context, service string, status models.TransactionStatus, ...) (*models.TransactionListResponse, error) + ListWalletsByService func(ctx context.Context, service string) ([]models.WalletAccount, error) + UpdateTransactionStatus func(ctx context.Context, id uuid.UUID, status models.TransactionStatus, ...) error + func NewOptimizedTransactionRepository(db *sqlx.DB) TransactionRepository + func NewSQLTransactionRepository(db *sqlx.DB) TransactionRepository