| title | create_project |
|---|---|
| description | Creates a Project on chain. A Project groups plans together under a merchant. Returns the chain-assigned project_id. |
fn create_project(
env: Env,
merchant: Address,
name: String,
description: String,
) -> u64Creates a Project on chain. A Project groups billing plans together under a single merchant: one merchant can own many projects, and each plan is scoped to exactly one. Returns the chain-assigned project_id (a globally unique u64).
Every plan must reference an existing project, so merchants must create a Project before they can create any plans.
| Name | Type | Description |
|---|---|---|
merchant |
Address |
The merchant's Stellar address. Must sign the transaction. |
name |
String |
Human-readable project name (e.g. "Acme SaaS"). |
description |
String |
Optional longer description shown in the dashboard. Pass "" to skip. |
merchant.require_auth();The merchant address must sign.
u64 — the new project_id.
| Event | Topics | Data |
|---|---|---|
project_created |
"project_created", merchant |
project_id |
```typescript import { VowenaClient, NETWORKS } from "@vowena/sdk";
const client = new VowenaClient({
contractId: NETWORKS.testnet.contractId,
rpcUrl: NETWORKS.testnet.rpcUrl,
networkPassphrase: NETWORKS.testnet.networkPassphrase,
});
const tx = await client.buildCreateProject({
merchant: "GMERCHANT...ADDR",
name: "Acme SaaS",
description: "Recurring billing for Acme's hosted product.",
});
const signedXdr = await signTransaction(tx);
const result = await client.submitTransaction(signedXdr);
// The contract returns the new project_id via the transaction result.
```