Types Reference
Reference

Types Reference

Complete Rust and TypeScript type mappings for all contract structures.

Type mappings between Rust Soroban contract definitions and client TypeScript interfaces.

Rust Contract Types

rustcontracts/splitpay/src/types.rs
pub enum PoolStatus { Active = 1, Inactive = 2 }
pub enum PaymentStatus { Pending = 1, Settled = 2 }
pub struct Pool {
pub id: u64,
pub owner: Address,
pub asset: Address,
pub status: PoolStatus,
pub created_at: u64,
}
pub struct Member {
pub pool_id: u64,
pub address: Address,
pub share_bps: u32,
}
pub struct Payment {
pub id: u64,
pub pool_id: u64,
pub payer: Address,
pub asset: Address,
pub amount: i128,
pub status: PaymentStatus,
pub created_at: u64,
}
pub struct Distribution {
pub payment_id: u64,
pub recipient: Address,
pub amount: i128,
pub share_bps: u32,
}

TypeScript Client Types

typescriptsplitpay-web/types/index.ts
export enum PoolStatus { Active = 1, Inactive = 2 }
export enum PaymentStatus { Pending = 1, Settled = 2 }
export interface Pool {
id: string;
owner: string;
asset: string;
status: PoolStatus;
createdAt: number;
}
export interface Member {
poolId: string;
address: string;
shareBps: number;
}
export interface Payment {
id: string;
poolId: string;
payer: string;
asset: string;
amount: bigint;
status: PaymentStatus;
createdAt: number;
}
export interface Distribution {
paymentId: string;
recipient: string;
amount: bigint;
shareBps: number;
}