Closes #1125 Implemented Soroban Transaction Service - #146
Open
p3ris0n wants to merge 25 commits into
Open
Conversation
Contributor
|
@p3ris0n kindly resolve ci |
Contributor
|
@p3ris0n, kindly resolve the failed CI check |
|
@p3ris0n Nice job but pls fix conflicts and make sure ci is passing |
martinvibes
requested changes
Aug 25, 2026
martinvibes
left a comment
There was a problem hiding this comment.
@p3ris0n pls remove the test_snapshots/test folder
|
remove pnpm-lock.yaml file too |
… feat/rpc-transact=service # Conflicts: # contract/src/base/errors.rs # contract/src/base/events.rs # contract/src/lib.rs # contract/src/test_schedule.rs # contract/test_snapshots/test/test_distribute_requires_auth.1.json
Co-authored-by: Cursor <cursoragent@cursor.com>
pnpm 8 ignored lockfileVersion 9.0 and failed frozen-lockfile installs. Co-authored-by: Cursor <cursoragent@cursor.com>
CI no longer depends on lockfileVersion matching the runner pnpm. Co-authored-by: Cursor <cursoragent@cursor.com>
… feat/rpc-transact=service # Conflicts: # backend/.env.example # backend/src/services/contractReader.ts
…t with package.json
Degrade indexer health when the cursor query fails, use in-memory groups in test, and align OpenAPI/auth/schema tests with node:test, SEP-10, and Zod. Co-authored-by: Cursor <cursoragent@cursor.com>
@noble/ed25519 used by Keypair.random() requires crypto.getRandomValues, which is not global on Node 18. Co-authored-by: Cursor <cursoragent@cursor.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.
Description
This PR implements the backend proxy and transaction assembly service for the AutoShare Soroban contract (Closes #125).
Because the backend server never holds a user's secret key, it cannot directly sign Soroban smart contract invocations. Instead, we've implemented a robust "prepare-sign-submit" lifecycle where the backend acts as an RPC gateway: it simulates the transaction, calculates fees, assembles the XDR, and relies on the frontend client for wallet signatures before safely submitting the transaction back to the network.
Key Features & Changes
SOROBAN_RPC_URL,SOROBAN_NETWORK_PASSPHRASE, andAUTOSHARE_CONTRACT_ID. The backend will fail-fast at boot if these are missing.services/soroban.ts):@stellar/stellar-sdkv16rpc.Server.prepareTransactionto simulate smart contract calls, calculate resource footprints, and build an assembledTransactionwith an automatic 1.2x resource fee multiplier.submitTransactionwhich safely submits the signed XDR to the network and implements robust exponential backoff polling (getTransaction) to verify execution.SorobanSimulationErrorwhich intercepts raw VM errors and elegantly maps Soroban Error Codes (1-20) back into our human-readableAutoShareErrorvariants (e.g.,GroupAlreadyExists,InsufficientBalance).routes/contract.ts):POST /api/contract/groups/:id/distribute/prepare: Secured endpoint that ensures only the Group Creator can initialize a distribution. Returns the unsigned XDR.POST /api/contract/tx/submit: Endpoint to accept the wallet-signed XDR payload and pipe it through the Soroban Service. Returns standardized400errors for malformed XDR or simulated VM errors, and503for retriable timeouts.utils/scval.ts):xdr.ScValtypes forAddress,u32,i128(as strings to prevent precision loss), and mapping our customAutoShareDetailsandGroupMemberstructs.scval.test.ts,soroban.test.ts(mocked RPC transport), andcontract.test.ts(Supertest API integration).clippylints and redundantcfg(test)declarations in thecontract/workspace that were blocking pre-push hooks.Verification
pnpm --filter backend test)cargo fmt,cargo clippy,eslint,tsc)txBadSeqwithout hanging.Next Steps
Following this merge, the frontend interface can be updated to consume
/prepare, sign the XDR payload with Freighter, and push to/submit.