Skip to content

Commit

Permalink
add: optional getsigforstatus params
Browse files Browse the repository at this point in the history
  • Loading branch information
GitBolt committed Apr 16, 2024
1 parent 5f82e65 commit fd36a91
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions solathon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def get_recent_performance_samples(self, commitment: Optional[Commitment]=None)
return [RecentPerformanceSamples(sample) for sample in response]
return response

def get_signatures_for_address(self, acct_address: Text) -> RPCResponse[List[TransactionSignatureType]] | List[TransactionSignature]:
def get_signatures_for_address(self, acct_address: Text, limit: Optional[Text], before: Optional[Text], until: Optional[Text]) -> RPCResponse[List[TransactionSignatureType]] | List[TransactionSignature]:
"""
Returns the signatures for the specified account address.
Expand All @@ -470,7 +470,20 @@ def get_signatures_for_address(self, acct_address: Text) -> RPCResponse[List[Tra
Returns:
RPCResponse: The response from the RPC endpoint.
"""
response = self.build_and_send_request("getSignaturesForAddress", [acct_address])
params = [acct_address]
options = {}

if limit is not None:
options["limit"] = limit
if before is not None:
options["before"] = before
if until is not None:
options["until"] = until

if options:
params.append(options)

response = self.build_and_send_request("getSignaturesForAddress", params)
if self.clean_response:
return [TransactionSignature(signature) for signature in response]
return response
Expand Down

0 comments on commit fd36a91

Please sign in to comment.