Skip to content

Conversation

@ifropc
Copy link
Contributor

@ifropc ifropc commented Apr 16, 2025

What

Adds ledger entry get implementation that allows to fetch ledger entries. Implements all of the supported ledger entry types

stellar ledger entry fetch account <ACCOUNT>
stellar ledger entry fetch contract <CONTRACT>
stellar ledger entry fetch config <ID>
stellar ledger entry fetch claimable-balance <ID>
stellar ledger entry fetch liquidity-pool <ID>
stellar ledger entry fetch wasm <HASH>

Why

#1916

Known limitations

  1. Depends on changes in rpc-client
  2. Most of the command variations have not been tested !
  3. A command to fetch a key's ttl is not included, based on this commend in the rpc codebase, it looks like directly fetching a TTL entry is not available.
  4. The cargo ban failure should be resolved once Serde ledger entires rs-stellar-rpc-client#26 is merged in and released and this PR is updated to use the newest release.

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Apr 16, 2025
@ifropc ifropc linked an issue Apr 16, 2025 that may be closed by this pull request
@ifropc ifropc requested a review from a team April 17, 2025 22:27
@elizabethengelman elizabethengelman self-assigned this Apr 23, 2025
@elizabethengelman elizabethengelman moved this from Backlog (Not Ready) to In Progress in DevX Apr 30, 2025
…eyAccount

We were previously checking to see if asset, offer or data-name were
also passed in. If not, the LedgerKeyAccount of the given
account was added to the list of keys. However, there is an edge case,
that if the user passes in 'xlm' as the asset, the entries was returning
empty because there is not an xlm trustline so no key was passed in.

As a solution, this PR always include the LedgerKeyAccount in the list
of keys, so the LedgerEntryAccount is always returned when --account is
passed in as an arg
@janewang janewang removed this from DevX May 7, 2025
@elizabethengelman elizabethengelman marked this pull request as ready for review May 8, 2025 20:50
@elizabethengelman elizabethengelman marked this pull request as draft May 8, 2025 20:50
@elizabethengelman
Copy link
Collaborator

the currently failing bindings typescript test should be fixed once #2268 is merged in

@elizabethengelman elizabethengelman enabled auto-merge (squash) November 3, 2025 20:16
@elizabethengelman elizabethengelman merged commit 2f6b95e into main Nov 12, 2025
30 of 31 checks passed
@elizabethengelman elizabethengelman deleted the ledger-entry-get branch November 12, 2025 14:40
@github-project-automation github-project-automation bot moved this from Needs Review to Done in DevX Nov 12, 2025
elizabethengelman added a commit that referenced this pull request Nov 14, 2025
### What

this pr is based off of #2012 

closes #2273

Updates the `ledger entry fetch` command to allow for returning the
contract instance ledger entry by adding an `--instance` option which
will include the contract instance ledger entry to the list of keys
being fetched.

`cargo run ledger entry fetch contract-data --contract hello-world
--network local --instance`

### Why

This way we are able to more easily fetch a contract wasm hash based on
it's contract id/alias.

### Known limitations

[TODO or N/A]

---------

Co-authored-by: Gleb <gleb@stellar.org>
Co-authored-by: Jane Wang <jane.wang@stellar.org>
Co-authored-by: Leigh <351529+leighmcculloch@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

New command stellar ledger entry get --key-xdr <XDR>

5 participants