[Feat] Simplify Shield Swap setup and upgrade snarkVM - #72
Open
iamalwaysuncomfortable wants to merge 13 commits into
Open
iamalwaysuncomfortable wants to merge 13 commits into
iamalwaysuncomfortable wants to merge 13 commits into
Conversation
iamalwaysuncomfortable
marked this pull request as ready for review
September 25, 2026 19:29
This branch has not been deployed
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.
Include a runnable first-swap example in the checkout and release wheel. The example authenticates an account, confirms a testnet airdrop, looks up USDCx and ETH, quotes one pool, submits one swap, waits for successful confirmation, and submits one claim.
SDK changes
account.from_private_key()import sets an unset default account. Subsequent imports preserve the current default, in both sync and async clients.confirm_airdrop()requests tokens and polls the faucet job. It returns settled per-token outcomes or an initial rate-limit response; other failures propagate. A timeout carries the job ID.get_token(symbol)resolves exact symbols and rejects unknown or ambiguous matches.swap()converts string and Decimal token amounts internally, including the quoted output. Integers remain base units. Conversion rejects floats, excess precision, non-finite values, and u128 overflow.record_wait_secondsoptionally waits for a covering scanner record before reserving a counter or submitting. Sync and async callers default to no wait; the example allows 120 seconds. Provider errors propagate, and transaction submissions are never retried.Example and packaging
SHIELD_SWAP_PRIVATE_KEYcan supply an account. Otherwise the SDK profile saves a generated key with owner-only permissions and reuses it.ENABLE_JOURNALremains optional and only controls the swap journal; both settings use the same client and record scanner. The example has no custom helper functions or console logging.The wheel includes the example and README and requires
aleo-sdk>=0.5.1. Run from the checkout or withpython -m aleo_shield_swap.examples.first_swap.swapafter installing a release containing it.snarkVM
Upgrade both
sdkandsdk-abifrom crates.io snarkVM 4.9.1 to 4.10.0. Both lockfiles resolve all 58 snarkVM crates to 4.10.0. The pinned Leo revision remains compatible, and its ABI-only features remain isolated. No binding-source changes were required.Validation
Keep this PR in draft pending a complete live Python swap and claim. The scanner 422 was reproduced as "UUID not registered with the service"; registration succeeded on retry and a subsequent records query succeeded. SDK-created sync and async scanners now re-register on an owned-record 422 and retry the read once, preserving registration errors. The example checks initial registration success. An additional 89 targeted scanner, facade, account-example, and package tests pass. No release has been published.