Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

main#200

Merged
JosueBrenes merged 21 commits intomainfrom
develop
Jul 5, 2025
Merged

main#200
JosueBrenes merged 21 commits intomainfrom
develop

Conversation

@JosueBrenes
Copy link
Contributor

No description provided.

JosueBrenes and others added 21 commits June 28, 2025 08:27
Merge pull request #194 from trustbridgecr/develop
- Add complete marketplace interface at /dashboard/marketplace
- Implement pool deployment functionality using Blend PoolFactoryContract
- Add USDC borrowing flow with real-time health factor calculation
- Create BorrowModal with amount input, collateral estimates, and transaction signing
- Configure proper Stellar testnet contract addresses and network settings
- Add comprehensive pool configuration with USDC, XLM, and TBRG reserves
- Integrate Freighter wallet for transaction signing
- Add pool deployment helper functions with complete workflow
- Update dashboard layout with marketplace navigation
- Fix all TypeScript linter errors and import issues
- Update README with detailed usage instructions and API examples

Closes #176
- Remove sidebar completely from dashboard layout
- Add marketplace link to header navigation with shopping cart icon
- Update mobile dropdown menu to include marketplace
- Increase header max-width to accommodate additional navigation
- Simplify layout structure for better UX
…data hooks, and UI components

- Add SupplyUSDCModal, BorrowModal, SupplyXLMCollateralModal components
- Implement usePoolData hook for fetching pool information
- Update MarketplacePage with transaction handling
- Configure contracts and wallet kit for Blend integration
- Add pool deployment helper and validation scripts
- Update user provider with lending/borrowing actions

Note: Contract error #1206 still needs investigation - wallet signing issues
- Add specific error handling for Error #1206 in all modals (Supply USDC, Supply XLM Collateral, Borrow)
- Provide clear user-friendly messages explaining pool activation issues
- Add pool status warning alert with diagnostic button on marketplace page
- Implement pool status check function to help users diagnose issues
- Guide users about pool needing admin activation or backstop funding

This addresses the contract simulation failures users are experiencing and provides
helpful guidance instead of generic error messages.
- Add diagnose-and-fix-pool.ts with detailed pool analysis using Blend SDK
- Add attempt-pool-fixes.ts to automatically fix common pool issues
- Update MarketplacePage with Advanced Diagnosis button
- Enhance pool status warning with both quick check and deep diagnosis
- Include pool status, reserves, oracle, and backstop checks
- Attempt automatic pool activation and functionality testing
- Provide detailed recommendations for manual fixes

This provides users and developers with tools to:
1. Diagnose exactly what's causing Error #1206
2. Automatically fix issues they have permissions for
3. Get specific guidance on what needs admin intervention
- Fix ORACLE_ID to use official Blend testnet oracle (CCYHURAC5VTN2ZU663UUS5F24S4GURDPO4FHZ75JLN5DMLRTLCG44H44)
- Fix POOL_FACTORY_ID to use official poolFactoryV2 (CDIE73IJJKOWXWCPU5GWQ745FUKWCSH3YKZRF5IQW7GE3G7YAZ773MYK)
- Add BACKSTOP_ID for official backstopV2 contract
- Fix SUPPORTED_ASSETS to use correct Blend testnet addresses
- Update diagnostic script to properly handle Soroban contract addresses
- Remove getAccount() call for contract addresses (fixes 'invalid version byte' error)
- Use Pool.load() directly to verify contract existence and functionality

This fixes the 'invalid version byte. expected 48, got 16' error that was preventing
the diagnostic script from running properly.
- Remove unsupported min_collateral field from DEFAULT_POOL_CONFIG
- Add specific error detection for min_collateral SDK compatibility issue
- Provide clear diagnostic message explaining Error #1206 is caused by SDK version mismatch
- Add fallback contract existence check using getContractData instead of getContract
- Explain that pool was deployed with incompatible configuration field

This should now properly diagnose the root cause of Error #1206 and provide
actionable guidance for resolving the SDK compatibility issue.
…ration-176

feat: implement TrustBridge marketplace with Blend SDK integration
- Add ProvideLiquidityModal component with complete deposit functionality
- Integrate with Blend JS SDK using RequestType.Deposit
- Support multi-asset deposits (USDC, XLM, TBRG)
- Implement real-time bTokens estimation and gas-less simulation
- Add comprehensive error handling for all failure scenarios
- Include responsive design for mobile devices (min-width 320px)
- Add live balance checking and preset amount buttons
- Integrate transaction signing with existing Stellar Wallet Kit
- Follow existing design patterns and Tailwind tokens
- Add proper wallet connection and pool deployment validation

Features:
✅ Asset selection with APY display
✅ Live transaction preview with bTokens estimation
✅ Preset percentage buttons (25%, 50%, 75%, MAX)
✅ Professional error handling and user feedback
✅ Mobile responsive modal design
✅ BigInt arithmetic for precision
✅ Accessibility features and keyboard navigation
- Fix build error: RequestType.Deposit does not exist
- Use RequestType.Supply instead, which is the correct enum value for providing liquidity
- Build now passes successfully with all TypeScript checks
- Confirmed compatible with Blend SDK v2.2.0

Available RequestType values in Blend SDK:
- RequestType.Supply (0) - for depositing/providing liquidity ✅
- RequestType.Withdraw (1) - for withdrawing deposits
- RequestType.SupplyCollateral (2) - for collateral supply
- RequestType.WithdrawCollateral (3) - for collateral withdrawal
- RequestType.Borrow (4) - for borrowing assets
- RequestType.Repay (5) - for repaying loans
…-175

feat: implement Provide Liquidity modal and deposit flow (#175)
- Add SupplyXLMCollateralModal with full Blend SDK integration
- Implement BorrowModal and SupplyUSDCModal functionality
- Add proper error handling for Blend protocol errors
- Update wallet integration for transaction signing
- Add pool activation helper functionality
- Clean up deprecated scripts and add new activation script
- Update dependencies for Blend SDK and Stellar SDK
- Keep HEAD version with advanced features
- Maintain SupplyUSDCModal and SupplyXLMCollateralModal integration
- Preserve real-time pool data functionality
- Keep enhanced pool deployment with TrustBridge integration
…ration-176

Feature/marketplace blend integration
@vercel
Copy link

vercel bot commented Jul 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dapp-trustbridge ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 5, 2025 4:12am

@JosueBrenes JosueBrenes merged commit 36c9b3a into main Jul 5, 2025
3 checks passed
JosueBrenes added a commit that referenced this pull request Jul 5, 2025
Merge pull request #200 from trustbridgecr/develop
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments