Skip to content

Add Stellar Trustline Verification and Automated Trustline Addition Modal #386

Description

@Cjay-Cyber-2

Description — what to implement and the why/impact.

Settling expenses in custom Stellar assets like USDC requires the receiving account to have an established trustline. When users attempt to settle or receive payments in assets without trustlines, transactions fail on-chain. This issue introduces an automated trustline check and a guided modal to build and submit trustline transactions via Freighter.

Context & Requirements — background, constraints, design references, edge cases; grounded in the actual repo (real files, stack, conventions).

Using @stellar/stellar-sdk and @stellar/freighter-api, check the user's account balances and trustlines for supported assets. If a trustline is missing, prompt the user with a modal explaining the requirement and invoke Freighter to sign the change trust transaction.

Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".

  • Create a trustline validation utility leveraging @stellar/stellar-sdk.
  • Build TrustlineModal.tsx in src/components/wallet/ to guide users through adding trustlines.
  • Handle Freighter signing errors and display success or failure toasts via sonner.
  • Pass npm run typecheck and npm test.

Implementation Guidance — likely files/modules to touch (use real paths from the repo context) and a suggested approach, without over-prescribing.

  • Check wallet and Stellar integration helpers in src/lib/.
  • Integrate with existing wallet connection hooks and modals.

Testing & Validation — how the contributor should prove it works (tests to add/run, manual checks, screenshots for UI).

  • Unit test the trustline check logic against mock Stellar server responses.
  • Run npm test to confirm all tests pass successfully.

Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting; follow the repo's existing style and conventions.


Wave complexity: Medium

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomplexity: mediumModerate scope, some designfeaturestellarTouches Stellar / SEP flows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions