Skip to content

Spike/pollar wallet integration#25

Open
aleregex wants to merge 27 commits intoTrustless-Work:devfrom
aleregex:spike/pollar-wallet-integration
Open

Spike/pollar wallet integration#25
aleregex wants to merge 27 commits intoTrustless-Work:devfrom
aleregex:spike/pollar-wallet-integration

Conversation

@aleregex
Copy link
Copy Markdown

@aleregex aleregex commented Apr 2, 2026

Pollar × Trustless Work — Spike Results

What worked

  • Google OAuth login via Pollar WalletButton
  • Wallet address retrieval from usePollar()
  • Escrow initialization via Trustless Work API /deployer/single-release
  • XDR signing and submission via signAndSubmitTx()
  • Transaction confirmed on Stellar testnet

What broke / unknowns

  • TW API key must be exposed as NEXT_PUBLIC_API_KEY (client-side fetch, no server route)
  • PollarProvider API uses config.apiKey, not publishableKey
  • signAndSubmitTx compatibility with TW XDR format needs more testing
  • Full escrow lifecycle (milestones, approvals, release) not tested

Recommendation

Pursue — Pollar successfully abstracts wallet creation, OAuth login, and transaction
signing. UX is significantly simpler for non-crypto users.

Next steps

  1. Test full escrow lifecycle — milestones, approvals, and release flow end to end.
  2. Implement PollarWalletAdapter in src/lib/wallet/pollarAdapter.ts and wire it
    to the existing escrow flows so both Pollar and the current Stellar wallet are
    supported interchangeably.
  3. Move the TW API key to a server-side route (/api/trustless-work/...) so
    NEXT_PUBLIC_API_KEY is no longer exposed in the client bundle.
  4. Add error boundary or loading states to PollarWalletProvider for production use.
  5. Evaluate Pollar's embedded wallet flow as an alternative to Freighter/Albedo
    for onboarding non-crypto users.

Setup

  1. npm install
  2. Add to .env.local:
    NEXT_PUBLIC_POLLAR_PUBLISHABLE_KEY=
    NEXT_PUBLIC_API_KEY=
    NEXT_PUBLIC_TW_BASE_URL=https://dev.api.trustlesswork.com
    
  3. npm run dev
  4. Go to /pollar-spike

YAustinXYZ and others added 27 commits February 24, 2026 22:22
…al-dashboard

feat(dashboard): implement financial dashboard for receiver escrows
…tics

feat: Admin Escrow Analytics Dashboard
Implement Recent Payments view component that displays escrows
where the connected wallet is the receiver.

Features:
- Fetches escrows using useGetEscrowsFromIndexerByRole hook
- Displays payment information in responsive card layout
- Shows escrow amount, name, milestone description, and status
- Handles loading, error, empty, and not connected states
- Follows existing UI patterns and design system
Add route for Recent Payments view at /recent-payments.
Renders the RecentPaymentsView component to display
receiver escrow activity.
- Add loading state during wallet hydration to prevent false disconnected state
- Remove USDC fallback assumption for unknown assets, show raw number instead
Add null coalescing operator to prevent runtime errors when
escrow.amount is undefined
- Remove unused Card import from service-provider/page.tsx
- Remove console.error statements from MilestoneDetailDialog validation function
- Remove console.error from both useDetailsEscrow hooks for cleaner production code
- Accept version from main branch
- Reinstall dependencies to ensure consistency
- Lock file regenerated with npm install --legacy-peer-deps
**Unused imports fixed:**
- Remove useEscrowMilestoneProgress from EscrowSummary.tsx
- Remove EscrowMilestoneProgressBar from EscrowsTable by-role (unused import)

**Semantic HTML improvements:**
- Replace orphaned <label> tags with <span> elements in Milestones.tsx for proper semantics

**Type safety enhancements:**
- Widen formatCurrency currency parameter to accept optional values (currency?: string | null)
- Fix dynamic import type in LoadEscrowModal to use LoadEscrowFormProps from correct location

**UI/UX improvements:**
- Replace empty Progress column with visual placeholder "—" in EscrowsTable by-signer
- Prevent rendering of unused EscrowMilestoneProgressBar import in by-role table

**Data calculation fixes:**
- Fix RelatedEscrows amount calculation for multi-release escrows (sum milestone amounts)
- Add helper function getEscrowAmount() to correctly calculate totals
- Update formatCurrency calls to handle optional currency values

**Documentation updates:**
- Document showHeader prop in milestone-progress README
- Update API reference to include showHeader in EscrowMilestoneProgressProps interface
- Add comment documenting RelatedEscrows current scope limitation

**Build:** ✅ Passes without errors
**Progress bar visibility (Major):**
- Remove isMultiRelease guard from EscrowSummary.tsx
- Show approval progress bar for both single-release and multi-release escrows
- Approval mode is supported for all escrow types

**Error handling (Major):**
- Add isError check in RelatedEscrows component
- Handle query failures separately from empty results
- Display meaningful error message when data fetch fails
- Prevents masking backend/indexer problems as zero-results

**Semantic HTML:**
- Change label to span in EscrowSummary progress section

Build: ✅ Passes all checks
…ayments-view

feat: implement Recent Payments view
- Introduced PollarWalletProvider in layout.tsx to support Pollar wallet functionality.
- Updated .env.example to include NEXT_PUBLIC_POLLAR_PUBLISHABLE_KEY.
- Added @pollar/react dependency in package.json and package-lock.json for wallet integration.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 274fd3f2-bfd4-4efb-8d53-544950dce186

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@aleregex
Copy link
Copy Markdown
Author

aleregex commented Apr 2, 2026

Screenshot 2026-04-01 at 10 25 51 PM Screenshot 2026-04-01 at 10 26 20 PM Screenshot 2026-04-01 at 10 26 33 PM Screenshot 2026-04-01 at 10 25 29 PM

@aleregex
Copy link
Copy Markdown
Author

aleregex commented Apr 3, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants