Skip to content

feat(wallet): comprehensive asset management for Stellar/Soroban tokens (#108) - #258

Merged
ScriptedBro merged 2 commits into
DelegoLabs:mainfrom
mayokun-max:feat/108-asset-management
Sep 6, 2026
Merged

feat(wallet): comprehensive asset management for Stellar/Soroban tokens (#108)#258
ScriptedBro merged 2 commits into
DelegoLabs:mainfrom
mayokun-max:feat/108-asset-management

Conversation

@mayokun-max

Copy link
Copy Markdown
Contributor

Summary

Closes #108 — adds comprehensive asset management for Stellar/Soroban tokens to the wallet backend: trustlines, real-time balances, SEP-1 token metadata, spam filtering, liquidity pool tokens, a portfolio API, and transfer helpers.

What's included

Trustline management

  • Create / update / delete trustlines via API (apps/backend/wallet/src/assets/trustlines.ts)
  • Supports credit_alphanum4, credit_alphanum12, and Soroban contract tokens
  • Exposes authorized, authorizedToMaintainLiabilities, clawbackEnabled flags

Asset balances & real-time updates

  • Balance tracking in stroops with available / locked breakdowns (balances.ts)
  • Real-time updates pushed over the existing websocket layer (websocket/server.ts, websocket/types.ts)
  • Queue integration for reliable balance refresh (queue/txQueue.ts, transactions/index.ts)

Token metadata & discovery

  • SEP-1 / stellar.toml metadata resolution (discovery.ts, metadata.ts) — name, symbol, decimals, logo, description, website
  • Asset flags: authRequired, authRevocable, authImmutable

Spam filtering

  • Configurable spam asset filter (spamFilter.ts, config.ts) with env-driven configuration (see .env.example)

Liquidity pool tokens & portfolio API

  • liquidity_pool asset type support
  • Portfolio endpoint (portfolio.ts) — native balance + per-asset balances, targeting < 200ms
  • Shared types in packages/types/src/assets.ts

Transfer helpers

  • Helpers for all asset types, including Soroban contract tokens (transfers.ts, submitter.ts)

Tests

  • 8 new test files covering trustlines, balances, transfers, portfolio, spam filter, config, and utils (~1,069 lines of tests)
  • Full wallet suite: 285 tests, 0 failures

Notes for reviewers

  • pnpm install --frozen-lockfile previously failed because the feature commit added a smol-toml importer entry to pnpm-lock.yaml without declaring the package in apps/backend/wallet/package.json (it's unused in code — SEP-1 resolution uses StellarToml.Resolver from @stellar/stellar-sdk). This PR removes the orphaned specifier.
  • Two pre-existing repo-wide issues exist on upstream main (not touched here): merge-conflict markers committed in packages/utils/src/index.ts and an unclosed block in apps/backend/payments/src/routes.ts. Both predate this branch.

Files

31 files changed, ~3,570 insertions: asset module under apps/backend/wallet/src/assets/, types in packages/types/, websocket + queue integration, docs in docs/assets-management.md.

mayokun-max and others added 2 commits September 3, 2026 05:55
Add Stellar asset management to the wallet service:
- balances and trustline mapping from Horizon, real-time BalanceTracker
  with WebSocket balances_updated push events
- asset discovery (issuer flags, SAC contract ids, curated catalog) and
  SEP-1 metadata resolution
- trustline operations (changeTrust, setTrustLineFlags) and transfers
  (classic payments, SAC Soroban, path payments, LP deposit/withdraw)
- cached portfolio aggregation with configurable spam filtering
- shared Asset/Trustline/Portfolio types in @delegolabs/types
- ASSET_* env config, .env.example, and vitest coverage
- docs: assets-management.md + docs index link
The asset management commit added a smol-toml importer entry to the
lockfile, but the package was never declared in the wallet's
package.json nor used in code (SEP-1 resolution uses
@stellar/stellar-sdk's StellarToml). Remove the orphaned specifier so
`pnpm install --frozen-lockfile` passes again.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Sep 3, 2026

Copy link
Copy Markdown

@mayokun-max 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! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 885a0a91-7380-499b-95eb-ac0635dbcbc1


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.

@ScriptedBro
ScriptedBro merged commit 711e57f into DelegoLabs:main Sep 6, 2026
1 check passed
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.

[Wallet] Build comprehensive asset management for Stellar tokens

2 participants