diff --git a/exp/lighthorizon/services/main.go b/exp/lighthorizon/services/main.go index fa8160f69a..f7dd3a4e01 100644 --- a/exp/lighthorizon/services/main.go +++ b/exp/lighthorizon/services/main.go @@ -15,11 +15,23 @@ import ( ) type LightHorizon struct { - Archive archive.Archive + AccountService, + TransactionService, + Archive archive.Archive Passphrase string IndexStore index.Store } +type AccountService interface { + GetOperationsByAccount(ctx context.Context, cursor int64, limit int64, accountId string) ([]common.Operation, error) + GetOperations(ctx context.Context, cursor int64, limit int64) ([]common.Operation, error) +} + +type TransactionService interface { + GetTransactionsByAccount(ctx context.Context, cursor int64, limit int64, accountId string) ([]common.Transaction, error) + GetTransactions(ctx context.Context, cursor int64, limit int64) ([]common.Transaction, error) +} + func (lh *LightHorizon) GetOperationsByAccount(ctx context.Context, cursor int64, limit int64, accountId string) ([]common.Operation, error) { ops := []common.Operation{} // Skip the cursor ahead to the next active checkpoint for this account