# Phoebe SDK examples

Runnable examples that demonstrate end-to-end Phoebe usage from a TypeScript
consumer perspective.

| Example | What it shows |
|---------|---------------|
| [`price-aware-vault/`](./price-aware-vault) | Tolk vault that quotes withdrawals against Phoebe's BLS-attested price feed; full sandbox round-trip — deploy stack → push snapshot → withdraw → assert price-quoted callback. |

## Run an example locally

```bash
cd phoebe/sdks/typescript
pnpm install
pnpm test                                      # runs SDK + example tests
# or, target one example:
npx jest examples/price-aware-vault/
```

Each example ships:

- **`README.md`** — what the example does, in 1 paragraph
- **`contracts/<name>.tolk`** — the Tolk consumer source
- **`<Name>.spec.ts`** — sandbox spec exercising the full round-trip via
  `deployPhoebeFixture` from `@titon-network/phoebe-sdk/testing`
- **`<Name>.compile.ts`** + **`<Name>.ts`** — Blueprint compile descriptor
  + TS wrapper for the example contract

## Use an example as a starting point

```bash
# Scaffold the canonical consumer template into your own repo:
npx phoebe scaffold consumer --out contracts/my-consumer.tolk

# Or copy one of the examples wholesale:
cp -r node_modules/@titon-network/phoebe-sdk/examples/price-aware-vault \
      contracts/my-vault
```
