Skip to content

feat: add smart contract-based premium snippet marketplace#92

Open
Mayorlay wants to merge 1 commit into
SudiptaPaul-31:mainfrom
Mayorlay:feature/marketplace
Open

feat: add smart contract-based premium snippet marketplace#92
Mayorlay wants to merge 1 commit into
SudiptaPaul-31:mainfrom
Mayorlay:feature/marketplace

Conversation

@Mayorlay
Copy link
Copy Markdown

feat: Smart Contract-Based Premium Snippet Marketplace

Summary

Implements a decentralized marketplace where developers can publish and purchase premium code
snippets with payments processed via Stellar assets and secured through escrow logic.

Changes

Database (scripts/add-marketplace.sql)

  • marketplace_listings — snippet listings with price, seller wallet, and status
  • marketplace_purchases — purchase records linking buyers to listings
  • marketplace_escrow — escrow lock/release records per purchase
  • marketplace_audit_logs — immutable on-chain audit trail for all marketplace actions

Types (marketplace.types.ts)

  • Interfaces for listings, purchases, escrow, audit logs, and I/O payloads

Repository (marketplace.repository.ts)

  • CRUD operations for all four tables using NeonDB serverless SQL

Service (marketplace.service.ts)

  • createListing — publishes a snippet with an on-chain memo transaction
  • purchaseListing — verifies buyer wallet signature → locks escrow → releases to seller
    atomically
  • verifyOwnership — confirms ownership via completed purchase record and release tx hash
  • verifyWalletSignature — Ed25519 signature verification using Stellar Keypair
  • Graceful fallback to deterministic mock tx hashes when STELLAR_SECRET_KEY is not set
    (testnet-safe)

Testing

  • Works on testnet without a live secret key (mock tx hashes derived from SHA-256)
  • Set STELLAR_SECRET_KEY to enable real Horizon transactions

Closes #87

- DB migration: marketplace_listings, purchases, escrow, audit_logs tables
- Types and interfaces for all marketplace entities
- Repository layer with neon SQL queries
- Service layer with Stellar escrow logic and wallet signature verification
- Supports listing, purchasing, ownership verification, and audit logging
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

@Mayorlay is attempting to deploy a commit to the Sudipta 's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@Mayorlay 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

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.

Smart Contract-Based Premium Snippet Marketplace

1 participant