feat: support SAC and XLM in import_contract! - #64
Merged
Conversation
pselle
force-pushed
the
feat/import-contract-sac-xlm
branch
from
September 10, 2026 17:01
72421d2 to
be1ec46
Compare
… (D14) `import_contract!` now accepts an asset name — `xlm`/`native`, or `"CODE:ISSUER"` — resolving the Stellar Asset Contract id offline (reusing import_asset!'s existing logic) and binding the SDK's standard token client, with no registry lookup or cache files needed. A registered name that itself resolves to a SAC (e.g. "circle/usdc") is also handled: `stellar contract fetch` always fails for a SAC address (it has no downloadable wasm), so that specific failure is now recognized and falls back to the same token client instead of erroring, caching the outcome so repeat builds don't re-fetch. Adds a demo fixture (xlm_tip_jar) showing both the production `import_contract!(env, xlm)` pattern and the in-test counterpart using `Env::register_stellar_asset_contract_v2`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ny6dgiM5jPjW4yJ78UkDnd
pselle
force-pushed
the
feat/import-contract-sac-xlm
branch
from
September 10, 2026 17:37
be1ec46 to
7deb51b
Compare
pselle
marked this pull request as ready for review
September 10, 2026 17:51
chadoh
previously approved these changes
Sep 10, 2026
chadoh
left a comment
Member
There was a problem hiding this comment.
goddamn this shit's so slick
coupla tiny notes below, and of course ideally @willemneal would also take a look at this before we merge, but aside from my minor notes below this looks great! The tip jar test 💯
- Extract the SAC-marker write into `record_sac_marker`, with a comment explaining why its error is dropped (it's just a cache; a rebuild just redoes the work) — per willemneal's suggestions. - Add an inline comment on the fallback match arm explaining why it's reachable at all (a registered name can itself resolve to a SAC) — per chadoh's suggestion. - Trim the `expand_token_client` doc comment's aside about the deprecated `token::Client` alias to one line — per chadoh's comment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ny6dgiM5jPjW4yJ78UkDnd
chadoh
previously approved these changes
Sep 11, 2026
chadoh
left a comment
Member
There was a problem hiding this comment.
💐
love how fast this came together 👏🏼
Trim the record_sac_marker doc comment and the fallback match-arm comment down to their essential point, per feedback that the previous versions ran long. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ny6dgiM5jPjW4yJ78UkDnd
chadoh
approved these changes
Sep 11, 2026
Contributor
Author
|
@chadoh Thank you for the speedy reviews! I'm done clanking (simplifying comments) so I'll merge when the tests come back green. |
Merged
pselle
pushed a commit
that referenced
this pull request
Sep 11, 2026
## 🤖 New release * `stellar-registry-macro`: 0.1.0 -> 0.1.1 * `stellar-registry`: 0.1.0 -> 0.1.1 * `stellar-registry-cli`: 0.1.0 -> 0.1.1 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> ## `stellar-registry-macro` <blockquote> ## [0.1.1](stellar-registry-macro-v0.1.0...stellar-registry-macro-v0.1.1) - 2026-09-11 ### Added - support SAC and XLM in import_contract! ([#64](#64)) </blockquote> ## `stellar-registry` <blockquote> ## [0.1.1](stellar-registry-v0.1.0...stellar-registry-v0.1.1) - 2026-09-11 ### Added - support SAC and XLM in import_contract! ([#64](#64)) </blockquote> ## `stellar-registry-cli` <blockquote> ## [0.1.1](stellar-registry-cli-v0.1.0...stellar-registry-cli-v0.1.1) - 2026-09-11 ### Other - test fetch_contract_id default fails for flagged ([#60](#60)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: aha-release-plz[bot] <211513279+aha-release-plz[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for assets in import_contract, such as
import_contract!(env, xlm)orimport_contract!(env, "circle/usdc")stellar contract fetchxlm_tip_jarfixture demonstrates the pattern plus the in-test counterpart (Env::register_stellar_asset_contract_v2).