feat: implement Soroban contract call helpers and wallet signing (#8) - #62
Merged
soomtochukwu merged 3 commits intoMar 29, 2026
Merged
Conversation
…akers#8) apps/web/lib/stellar.ts - connectWallet: opens StellarWalletsKit modal, waits for wallet selection, returns the connected public key - signTransaction: passes XDR to the connected wallet (Freighter) with the correct networkPassphrase; returns the signed XDR string apps/web/lib/contracts.ts - Add @stellar/stellar-sdk imports (Contract, TransactionBuilder, nativeToScVal, Address, SorobanServer) - invokeEscrow: shared pipeline — load account, build tx, rpc.prepareTransaction (simulate + assemble footprint), sign via signTransaction(), submit signed XDR, poll until SUCCESS/FAILED, return confirmed tx hash - depositEscrow: validates params (zero amount, missing addresses, milestones < 1) before building XDR; calls escrow.deposit with job_id u64, client/freelancer/token Address, amount i128, milestones u32 - releaseMilestone: derives caller from connected wallet; calls escrow.release_milestone(job_id, caller) - openDispute: derives caller from connected wallet; calls escrow.open_dispute(job_id, caller) apps/web/package.json - Add @stellar/stellar-sdk ^13.0.0 Required env vars: NEXT_PUBLIC_ESCROW_CONTRACT_ID — deployed escrow contract address NEXT_PUBLIC_USDC_CONTRACT_ID — USDC token contract address NEXT_PUBLIC_SOROBAN_RPC_URL — Soroban RPC endpoint (defaults to testnet) NEXT_PUBLIC_STELLAR_NETWORK — network passphrase (defaults to TESTNET) Closes DXmakers#8
|
@aadviksinghdebug Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@aadviksinghdebug, could you look into the CI errors |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ES2020 - Regenerate package-lock.json (was missing transitive deps causing npm ci to fail) - Restore getWalletsKit import that was incorrectly removed (used in getCallerAddress) - Change tsconfig target ES2017→ES2020 to allow BigInt literals Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
@soomtochukwu please review CI is fixed |
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.
apps/web/lib/stellar.ts
apps/web/lib/contracts.ts
apps/web/package.json
Required env vars:
NEXT_PUBLIC_ESCROW_CONTRACT_ID — deployed escrow contract address
NEXT_PUBLIC_USDC_CONTRACT_ID — USDC token contract address
NEXT_PUBLIC_SOROBAN_RPC_URL — Soroban RPC endpoint (defaults to testnet)
NEXT_PUBLIC_STELLAR_NETWORK — network passphrase (defaults to TESTNET)
Closes #8