Skip to main content
The VowenaClient is the primary interface for interacting with the Vowena smart contract. Write methods return an assembled XDR string for wallet signing. Read methods query on-chain state directly through Soroban simulation.
Switch testnetmainnet on NETWORKS when Vowena deploys to Stellar mainnet.
Write methods build and simulate a Soroban transaction, returning an assembled XDR string. You sign the XDR with your wallet and then call submitTransaction() to broadcast it.

buildCreateProject

Creates a Project on chain. Every plan must belong to a project, so this is the first call a merchant makes.
Returns: Promise<string> — assembled XDR.

buildCreatePlan

Creates a new subscription plan inside an existing project.
Returns: Promise<string> — assembled XDR.

buildSubscribe

Subscribes a user to a plan and sets the SEP-41 token allowance in a single transaction.
The expirationLedger and allowancePeriods are passed to the contract so the nested token.approve() auth entry is deterministic between simulation and submission. See the subscribe API reference for the full explanation.
Returns: Promise<string> — assembled XDR.

buildCharge

Charges a subscription for the current billing period. Permissionless — anyone can call.

buildCancel

Cancels a subscription. Either the subscriber or the merchant can call.

buildRefund

Issues a refund from the merchant to the subscriber.

buildUpdatePlanAmount

Updates the billing amount for an existing plan. The new amount must stay within the plan’s price ceiling.
The new amount cannot exceed priceCeiling. This protects subscribers from unexpected price increases beyond what they originally authorized.

buildRequestMigration

Flags every active subscription on oldPlanId as “migration pending” to newPlanId. Subscribers must accept individually.

buildAcceptMigration

Subscriber accepts a pending migration. The contract cancels the old subscription, creates one on the new plan, and sets a new allowance — all in one tx.
The allowance options match buildSubscribe. If omitted, the SDK uses the same safe defaults.

buildRejectMigration

Subscriber rejects a pending migration. They stay on the old plan.

buildReactivate

Subscriber reactivates a paused subscription. Re-signs a new allowance and attempts an immediate charge.

buildExtendTtl

Permissionless TTL bump for a plan + subscription entry. Useful for keepers that want to keep long-lived state alive alongside their charge() calls.