Skip to content

Latest commit

 

History

History
118 lines (84 loc) · 3.2 KB

File metadata and controls

118 lines (84 loc) · 3.2 KB

OrbitStream Contracts

License: MIT Rust Soroban

On-chain escrow contracts for OrbitStream — a Stripe-like payment gateway for Stellar.

OrbitStream is a developer-friendly payment gateway that brings Stripe-like DX to Stellar's native payment rails. This repo contains the Soroban smart contract for escrow functionality — locking funds for marketplace and freelance transactions until released or refunded.


Contract Functions

Function Auth Description
create_escrow(buyer, seller, token, amount, timeout_seconds) Buyer Lock funds in escrow
release(escrow_id) Seller Release funds to seller
refund(escrow_id) Buyer Refund after timeout
get_escrow(escrow_id) Read escrow details

Data Model

pub struct Escrow {
    pub id: u64,
    pub buyer: Address,
    pub seller: Address,
    pub token: Address,
    pub amount: u128,
    pub status: EscrowStatus,  // Active, Released, Refunded
    pub created_at: u64,
    pub timeout_at: u64,
}

Project Structure

src/
├── lib.rs        # Contract entry point (OrbitStream)
├── escrow.rs     # Escrow struct + EscrowStatus enum
├── storage.rs    # Persistence helpers
├── events.rs     # EscrowCreated, EscrowReleased, EscrowRefunded
└── errors.rs     # Error codes
tests/
├── test_create_escrow.rs
├── test_release.rs
└── test_refund.rs

Build

cargo build --target wasm32-unknown-unknown --release

Or with Soroban CLI:

soroban contract build

Test

cargo test

Deploy

soroban contract deploy --wasm target/wasm/orbitstream-contracts.wasm --network testnet --source <KEY>

Events

Event Fields When
escrow_created escrow_id, buyer, seller, token, amount, timeout_at New escrow created
escrow_released escrow_id, seller, amount Seller releases funds
escrow_refunded escrow_id, buyer, amount Buyer refunds after timeout

OrbitStream Ecosystem

This contract is one piece of the broader OrbitStream platform:

Component Description
JS/React SDK <StellarCheckout amount={25} currency="USDC" /> drop-in widget
Hosted checkout Shareable payment links (like Stripe Payment Links)
Backend API Payment session management, webhook dispatch, ledger monitoring
Merchant dashboard Transaction history, analytics, settings
This contract On-chain escrow for dispute-prone payments

Related Repositories


License

MIT License. Copyright (c) 2026 OrbitStream.