You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Effort: L — Estimate: 10-14 h — Dependencies: none (pairs with #36) — Unlocks:#36 (real data source), #41 (vault dashboard)
Context
The session/holder layer (already merged) is complete, but the connector underneath is a mock. apps/credit-history/src/session/wallet-connector.ts always resolves to a fixed address:
constMOCK_ADDRESS='GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5';// SEAM: … return a connector based on Freighter / Stellar Wallets Kit (address G… + signTransaction)
The UI (SessionProvider, useSession, the header WalletButton) must not change — only this factory and the concrete connector class.
Goal
Clicking "Connect" opens a real wallet (Freighter via Stellar Wallets Kit), returns the holder's real G… address, exposes signTransaction, and the DID is derived from it with didStellar (#34).
Step by step
Add the dependency to the app: pnpm --filter @acta-products/credit-history add @creit.tech/stellar-wallets-kit (or the Freighter API directly — justify the choice in the PR; verify Next 16 / React 19 compatibility).
Implement a RealWalletConnector implements WalletConnector that: detects the wallet, requests access, returns { address }, and provides signTransaction(xdr, { networkPassphrase }). Extend the WalletConnector interface with signTransaction (kept optional if needed for Secure presentation links (signed/encrypted, not plaintext base64) #39).
Make getWalletConnector() return the real connector, with a fallback to the mock when the wallet is unavailable (gate on an env flag, e.g. NEXT_PUBLIC_WALLET=real|mock, mock as default so CI/dev without an extension still works).
Read the network from NEXT_PUBLIC_STELLAR_NETWORK (same var as ActaProvider) and pass the right networkPassphrase. Handle user-rejected and wallet-not-installed errors with friendly UI states.
Verify session persistence still works after refresh (localStorage key acta:session:address).
Context
The session/holder layer (already merged) is complete, but the connector underneath is a mock.
apps/credit-history/src/session/wallet-connector.tsalways resolves to a fixed address:The UI (
SessionProvider,useSession, the headerWalletButton) must not change — only this factory and the concrete connector class.Goal
Clicking "Connect" opens a real wallet (Freighter via Stellar Wallets Kit), returns the holder's real
G…address, exposessignTransaction, and the DID is derived from it withdidStellar(#34).Step by step
pnpm --filter @acta-products/credit-history add @creit.tech/stellar-wallets-kit(or the Freighter API directly — justify the choice in the PR; verify Next 16 / React 19 compatibility).RealWalletConnector implements WalletConnectorthat: detects the wallet, requests access, returns{ address }, and providessignTransaction(xdr, { networkPassphrase }). Extend theWalletConnectorinterface withsignTransaction(kept optional if needed for Secure presentation links (signed/encrypted, not plaintext base64) #39).getWalletConnector()return the real connector, with a fallback to the mock when the wallet is unavailable (gate on an env flag, e.g.NEXT_PUBLIC_WALLET=real|mock, mock as default so CI/dev without an extension still works).NEXT_PUBLIC_STELLAR_NETWORK(same var asActaProvider) and pass the rightnetworkPassphrase. Handle user-rejected and wallet-not-installed errors with friendly UI states.acta:session:address).Out of scope
Acceptance criteria
G…address; DID showsdid:stellar:{network}:{G…}.SessionProvider/useSession/WalletButtonare unchanged (only the connector/factory changed).NEXT_PUBLIC_WALLETis notreal.pnpm lint && pnpm typecheck && pnpm buildpass.