Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_signatures_for_address is missing min_context_slot param #425

Open
don1989 opened this issue Apr 29, 2024 · 2 comments
Open

get_signatures_for_address is missing min_context_slot param #425

don1989 opened this issue Apr 29, 2024 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@don1989
Copy link

don1989 commented Apr 29, 2024

Hello

The min_context_slot param is missing in the get_signatures_for_address method. I noticed that it is present in the config object that we send in the request:

class RpcSignaturesForAddressConfig:
    def __init__(
        self,
        before: Optional[Signature] = None,
        until: Optional[Signature] = None,
        limit: Optional[int] = None,
        commitment: Optional[CommitmentLevel] = None,
        min_context_slot: Optional[int] = None,
    ): ...

However, I don't understand why min_context_slot is missing in get_signatures_for_address and why we're not passing it to the config:

  def _get_signatures_for_address_body(
      self,
      address: Pubkey,
      before: Optional[Signature],
      until: Optional[Signature],
      limit: Optional[int],
      commitment: Optional[Commitment],
  ) -> GetSignaturesForAddress:
      commitment_to_use = _COMMITMENT_TO_SOLDERS[commitment or self._commitment]
      config = RpcSignaturesForAddressConfig(before=before, until=until, limit=limit, commitment=commitment_to_use)
      return GetSignaturesForAddress(address, config)

Is it possible to add it in the next release?

For reference: https://solana.com/docs/rpc/http/getsignaturesforaddress

Thanks

@michaelhly michaelhly added help wanted Extra attention is needed good first issue Good for newcomers labels Apr 29, 2024
@don1989
Copy link
Author

don1989 commented Apr 30, 2024

Its simple enough that I can do a PR. Can I be granted the relevant permissions @michaelhly please?

@michaelhly
Copy link
Owner

michaelhly commented Apr 30, 2024

@don1989 Yes. Just add the min_context_slot as an optional argument to the function signature in the following places:

def get_signatures_for_address(

async def get_signatures_for_address(

def _get_signatures_for_address_body(

and then fix any relevant tests, lint and formatting issues.

Please fork this repo and contribute a pull request pointing to michaelhly/solana-py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants