API Reference
SDK

API Reference

Methods of SplitPayContractClient: simulation, preparation, and submission.

Complete API reference for SplitPayContractClient.

Read Methods (Simulations)

getPool(poolId: string | number): Promise<Pool | null>

Queries details for a specific pool.

getPoolMembers(poolId: string | number): Promise<Member[]>

Returns all configured members and their basis points.

getMember(poolId: string | number, memberAddress: string): Promise<Member | null>

Queries a single member's share in a pool.

getPayment(paymentId: string | number): Promise<Payment | null>

Queries a payment record and its current status (Pending or Settled).

getDistributions(paymentId: string | number): Promise<Distribution[]>

Returns all historical distributions disbursed for a settled payment.

Write Preparation Methods (XDR Generators)

prepareCreatePool(signerAddress, poolId, ownerAddress, assetAddress): Promise<string>

Generates signed-ready XDR to create a pool.

prepareAddMember(signerAddress, poolId, memberAddress, shareBps): Promise<string>

Generates XDR to add a member and basis points allocation.

prepareCreatePayment(signerAddress, paymentId, poolId, payerAddress, amount): Promise<string>

Generates XDR to register a pending payment record on-chain.

prepareSettlePayment(signerAddress, paymentId): Promise<string>

Generates XDR to execute atomic fund distribution.

Submission & Polling Methods

submitSignedTx(signedXdr: string): Promise<{ txHash: string }>

Submits signed XDR to the network and polls until inclusion in a ledger.