Skip to content

feat: add Router Lockup creation - #4

Merged
Utilitycoder merged 1 commit into
mainfrom
feat/router-lockup
Jul 22, 2026
Merged

feat: add Router Lockup creation#4
Utilitycoder merged 1 commit into
mainfrom
feat/router-lockup

Conversation

@Utilitycoder

@Utilitycoder Utilitycoder commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add chain-neutral CreateLockupInput and Stellar Router mapping
  • validate Lockup schedules, cliffs, unlock amounts, and granularity before simulation
  • add unit and live testnet simulation coverage
  • prepare @fundable/sdk 0.1.0-alpha.3

Verification

  • pnpm test (14 passed)
  • pnpm test:testnet (3 passed)
  • pnpm typecheck
  • pnpm build
  • pnpm pack --pack-destination /tmp

Summary by CodeRabbit

  • New Features

    • Added Router-based Lockup stream creation with configurable schedules, unlock amounts, granularity, and cancellation.
    • Added validation for lockup timing, cliff settings, amounts, and recipients.
    • Added support for router lockup capabilities, Stream NFT reads, and sponsored Paymaster execution.
    • Added examples and guidance for creating NFT-backed flows and lockups.
  • Documentation

    • Updated availability and integration guidance for the new capabilities.
    • Added testnet simulation coverage for Lockup creation.
  • Chores

    • Bumped the SDK version to 0.1.0-alpha.3.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Stellar Router Lockup creation with typed inputs, schedule validation, contract invocation, mocked and testnet simulation coverage, documentation updates, and version 0.1.0-alpha.3.

Changes

Stellar Lockup Router

Layer / File(s) Summary
Lockup inputs and validation
src/core/types.ts, src/stellar/validation.ts, src/core/amounts.ts
Adds CreateLockupInput, non-negative validation, and labeled timestamp validation errors.
Router Lockup execution
src/stellar/router-client.ts, src/stellar/protocol-clients.test.ts, src/stellar/testnet.integration.test.ts
Validates and normalizes Lockup schedules, calls create_lockup_stream, and covers valid and invalid simulation paths.
Release and capability documentation
package.json, src/index.ts, docs/router-paymaster.md, docs/getting-started.md, README.md, docs/generated-bindings.md
Bumps the alpha version and documents Router Lockup availability, examples, configuration, and provenance.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant StellarRouterClient
  participant RouterContract
  Caller->>StellarRouterClient: createLockup(input)
  StellarRouterClient->>StellarRouterClient: validate and normalize schedule
  StellarRouterClient->>RouterContract: create_lockup_stream(params)
  RouterContract-->>StellarRouterClient: simulation result
  StellarRouterClient-->>Caller: transaction result
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding Router Lockup creation support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/router-lockup

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
package.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Utilitycoder
Utilitycoder merged commit 622aad7 into main Jul 22, 2026
1 of 2 checks passed
@Utilitycoder
Utilitycoder deleted the feat/router-lockup branch July 22, 2026 20:10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 47-60: Update the README configuration example preceding the
createLockup call to include a contracts.router contract ID alongside
contracts.flow, ensuring fundable.router is initialized and the example remains
executable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: acf95f34-1c25-4b3f-b3d5-5408d58b1ff5

📥 Commits

Reviewing files that changed from the base of the PR and between 451b34d and 14984ef.

📒 Files selected for processing (12)
  • README.md
  • docs/generated-bindings.md
  • docs/getting-started.md
  • docs/router-paymaster.md
  • package.json
  • src/core/amounts.ts
  • src/core/types.ts
  • src/index.ts
  • src/stellar/protocol-clients.test.ts
  • src/stellar/router-client.ts
  • src/stellar/testnet.integration.test.ts
  • src/stellar/validation.ts

Comment thread README.md
Comment on lines +47 to +60
Create NFT-backed Flow and Lockup streams through the Router:

```ts
const lockup = await fundable.router?.createLockup({
sender: "G...",
recipient: "G...",
token: { address: "C...", decimals: 7 },
totalAmount: 1_000_000_000n,
startTime: new Date(),
endTime: new Date(Date.now() + 30 * 24 * 60 * 60 * 1_000),
cancelable: true,
});
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add the Router contract ID to the README example configuration.

The preceding configuration only supplies contracts.flow, but this example calls fundable.router?.createLockup. Without contracts.router, the optional chain returns undefined instead of a transaction. Add a router contract ID to the setup example or make this example’s configuration self-contained.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 47 - 60, Update the README configuration example
preceding the createLockup call to include a contracts.router contract ID
alongside contracts.flow, ensuring fundable.router is initialized and the
example remains executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant