diff --git a/cmd/soroban-rpc/internal/config/options.go b/cmd/soroban-rpc/internal/config/options.go index df503200..d9099dd4 100644 --- a/cmd/soroban-rpc/internal/config/options.go +++ b/cmd/soroban-rpc/internal/config/options.go @@ -247,6 +247,28 @@ func (cfg *Config) options() ConfigOptions { return nil }, }, + { + Name: "max-transactions-limit", + Usage: "Maximum amount of transactions allowed in a single getTransactions response", + ConfigKey: &cfg.MaxTransactionsLimit, + DefaultValue: uint(10000), + }, + { + Name: "default-transactions-limit", + Usage: "Default cap on the amount of transactions included in a single getTransactions response", + ConfigKey: &cfg.DefaultTransactionsLimit, + DefaultValue: uint(100), + Validate: func(co *ConfigOption) error { + if cfg.DefaultTransactionsLimit > cfg.MaxTransactionsLimit { + return fmt.Errorf( + "default-transactions-limit (%v) cannot exceed max-transactions-limit (%v)", + cfg.DefaultTransactionsLimit, + cfg.MaxTransactionsLimit, + ) + } + return nil + }, + }, { Name: "max-healthy-ledger-latency", Usage: "maximum ledger latency (i.e. time elapsed since the last known ledger closing time) considered to be healthy" + diff --git a/cmd/soroban-rpc/internal/methods/get_transactions.go b/cmd/soroban-rpc/internal/methods/get_transactions.go index e5b764a6..4a78bee6 100644 --- a/cmd/soroban-rpc/internal/methods/get_transactions.go +++ b/cmd/soroban-rpc/internal/methods/get_transactions.go @@ -18,14 +18,6 @@ type TransactionsPaginationOptions struct { Limit uint `json:"limit,omitempty"` } -// Range defines a [Start, End] interval of ledgers. -type Range struct { - // Start defines the (inclusive) start of the range. - Start transactions.Cursor - // End defines the (inclusive) end of the range. - End transactions.Cursor -} - type GetTransactionsRequest struct { StartLedger uint32 `json:"startLedger"` EndLedger uint32 `json:"endLedger"`