clearledger README

The project's README from github.com/Stellar-Clear/clearledger. As one markdown file: README.md.

ClearLedger

Invoice finance infrastructure, built on Stellar and powered by Soroban.

ClearLedger is an open-source invoice-finance platform built on Stellar. Its Soroban smart contracts coordinate participant verification, invoice lifecycle state, USDC liquidity pools, and settlement flows. The complete stack brings together on-chain contracts, a web application, TypeScript SDK and CLI, and a Go indexer/API.

Launch the Stellar Testnet app · Explore the Soroban contracts · Read the documentation · View Testnet contracts

Built for Stellar

ClearLedger uses Soroban, Stellar’s smart-contract platform, to coordinate business identity, invoice records, pool shares, and USDC flows on Stellar. The TypeScript SDK and web app connect to Soroban contracts, while the Go indexer follows contract events to make network activity available to applications.

The workflow

  1. Onboard participants. Register SME issuers and trade buyers through the participant registry.
  2. Create invoice records. Issuers record invoice terms and progress through explicit on-chain lifecycle states.
  3. Coordinate liquidity. USDC pool contracts account for liquidity, invoice funding, LP shares, and repayment flows.
  4. Follow activity. The Go indexer consumes Soroban events for API access and application views.

The protocol records submitted transaction state. It does not independently verify commercial documents, guarantee that an invoice will be funded, or guarantee repayment or returns.

Project map

Path What lives here
apps/web/ Next.js application and public product experience
packages/sdk/, packages/sdk-react/ TypeScript contract clients and React hooks
packages/cli/ Developer command-line tools
indexer/ Go Soroban event indexer and HTTP API
examples/ SDK and integration examples
docs/ Protocol, user, and developer documentation

Soroban contract source and deployment details live in the companion contracts repository.

Run locally

Requirements: Node.js 20+, pnpm 9+, and Docker for the complete local stack. For wallet interactions, install Freighter and select Stellar Testnet.

pnpm install
cp .env.example .env.local
pnpm dev

The web app starts at http://localhost:3000. For the web app, Go indexer, and PostgreSQL together:

cp .env.docker.example .env.docker
docker compose --env-file .env.docker up --build

The hosted app is a testnet web deployment. The Go API/indexer must be run separately; configure NEXT_PUBLIC_API_BASE_URL for the API endpoint when using API-backed features. For the complete variable reference, see environment configuration.

Development

From the repository root, the main checks are pnpm build, pnpm lint, pnpm typecheck, and pnpm test. Run Go checks from indexer/ with go test ./... and go vet ./....

Start with the local setup guide, architecture overview, and contribution guide. For protocol details, see how it works, the invoice lifecycle, and the economic model.

Network and security

The web application and contracts are currently deployed on Stellar Testnet for evaluation and integration. This is not a mainnet financial service. The contracts have not been formally audited, and testnet assets have no promised redemption value. Do not use real funds. Review the contract limitations and security policy before integrating.

Use testnet wallets and assets only. Never put private keys or recovery phrases in environment files or source control.

clearledger (Stellar-Clear/clearledger)

Searching Database…

这是什么?ClearLedger 是一个基于 Stellar 构建的开源发票融资平台,使用 Soroban 智能合约来协调参与者验证、发票生命周期、USDC 流动性池和结算。
这是一个应用,还是一整套组件?它是一个完整的技术栈:Soroban 链上合约、Next.js 网页应用、TypeScript SDK 和 CLI,以及一个跟随合约事件的独立 Go 索引器/API。
怎么在本地运行?克隆仓库,用 Node.js 20+、pnpm 9+ 和 Docker 运行完整的本地技术栈(网页应用、Go 索引器、PostgreSQL);网页应用随后在本地启动,Go 索引器/API 则单独运行。
除了 Node 和 Docker 还需要装什么?你还需要为 Stellar 测试网配置好 Freighter 浏览器钱包来与合约交互;如果想运行索引器自身的测试,还需要 Go 工具链。
用真钱使用它安全吗?不安全。它目前只运行在 Stellar 测试网上,合约尚未经过正式审计,测试网资产也没有赎回价值,因此绝不应使用真实资金。
Go 索引器实际做什么?它消费 Soroban 合约事件并通过 HTTP API 暴露它们,让应用和网页界面能看到链上的发票和资金池活动。
SDK 和 CLI 能做什么?TypeScript SDK(外加一个 React hooks 包)为你提供 Soroban 合约的类型化客户端,CLI 包则为开发者提供与协议交互的命令行工具。
协议会验证发票是真实的、会被偿还的吗?不会。ClearLedger 只是把提交的交易状态记录到链上;它不会独立核实商业单据,也不保证融资或偿还。
Soroban 合约在哪里?核心应用仓库包含 SDK、CLI、网页应用和索引器,而 Soroban 合约源码和部署细节则放在单独的配套合约仓库中。
Size
2.7 MB
Stars
131
Updated
CommitOct 09
Age
8d
Commits · 90 Days