Read Contract State
Guides

Read Contract State

Querying pools, member allocations, and settled payments via Stellar CLI and SDK.

Query pools, member configurations, payments, and historical distributions without paying transaction fees.

Reading State with Stellar CLI

Because read-only methods do not modify ledger storage, they execute as zero-fee simulations:

CONTRACT="CCOXHXGFTYVRRCJ7U32QZJCWXDTNQLRMDS3IAGW5MGFEWOUEXNYYKLHF"
# Query all members of pool 1
stellar contract invoke --id "$CONTRACT" --source any_account --network testnet -- \
get_pool_members --pool_id 1
# Query payment 1 details
stellar contract invoke --id "$CONTRACT" --source any_account --network testnet -- \
get_payment --payment_id 1
# Query distributions of payment 1
stellar contract invoke --id "$CONTRACT" --source any_account --network testnet -- \
get_distributions --payment_id 1

Reading State with TypeScript Client

typescript
import { splitPayClient } from "@/lib/contract/splitpay";
const pool = await splitPayClient.getPool(1);
const members = await splitPayClient.getPoolMembers(1);
const payment = await splitPayClient.getPayment(1);
const distributions = await splitPayClient.getDistributions(1);