Multichain TypeScript SDK for integrating Fundable token streams and distributions. Stellar is the first implemented chain adapter; the public domain types intentionally contain no Soroban-specific values so an EVM adapter can be added without changing application code.
The
0.xAPI is under active development.
Detailed guides live in docs/:
- Getting started
- Multichain architecture
- Generated binding provenance
- Router, Stream NFT, and Paymaster development
pnpm add @fundable/sdk @stellar/stellar-sdkimport { createFundableClient } from "@fundable/sdk";
const fundable = createFundableClient({
chain: "stellar",
network: "testnet",
rpcUrl: "https://soroban-testnet.stellar.org",
networkPassphrase: "Test SDF Network ; September 2015",
contracts: {
flow: "C...",
},
});The top-level client exposes Flow, Router, Stream NFT, and Paymaster capability groups when their contract IDs are configured:
const stream = await fundable.flows.getStream("42");
const withdrawable = await fundable.flows.getWithdrawableAmount("42");Create NFT-backed Flow and Lockup streams through the Router:
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,
});Read methods return decoded domain values. Flow write methods currently target
the Flow engine contract directly and return the Stellar SDK's
AssembledTransaction, preserving simulation, signing, serialization, and
advanced authorization workflows:
import { parseUnits } from "@fundable/sdk/core";
const transaction = await fundable.flows.deposit({
streamId: "42",
funder: "G...",
amount: parseUnits("100", 7),
});
const sent = await transaction.signAndSend();
console.log(sent.result);Fundable's NFT-backed creation workflow goes through fundable.router. The
fundable.streamNft and fundable.paymaster groups expose NFT ownership and
bounded fee-forwarding operations. See the capability guide for examples.
@fundable/sdk/corecontains chain-neutral inputs, records, errors, and unit helpers.@fundable/sdk/stellarcontains Stellar configuration and transaction types.- Generated Soroban bindings remain internal and do not define the public domain model.
- A future
@fundable/sdk/evmadapter can implement the same capability groups while returning an EVM-native transaction handle.
All on-chain integers use bigint. Use parseUnits and formatUnits; avoid
floating-point arithmetic for token values.