Command-line interface for common Invoice Liquidity Network contract operations on Stellar.
By participating in this project, you agree to abide by our Code of Conduct.
- Install
- Configuration
- Commands
- Testnet Account Seeding — See SEEDER.md for detailed setup instructions
- Local Integration Testing
npm install -g @invoice-liquidity/cliThis publishes the iln binary.
Create a .iln.json file in your working directory:
{
"network": "testnet",
"contractId": "CD3TE3IAHM737P236XZL2OYU275ZKD6MN7YH7PYYAXYIGEH55OPEWYJC",
"tokenId": "CDUMMYYOURTOKENIDHERE",
"keypairPath": "~/.config/iln/freelancer.secret"
}Supported keys:
network:testnet,mainnet, orstandalonecontractId: ILN contract IDtokenId: default token contract to use forsubmitkeypairPath: path to a file containing a Stellar secret keyrpcUrl: optional RPC overridenetworkPassphrase: optional passphrase override
Environment fallbacks:
ILN_NETWORKILN_CONTRACT_IDILN_TOKEN_IDILN_KEYPAIR_PATHILN_RPC_URLILN_NETWORK_PASSPHRASE
iln dev start
iln dev status
iln dev stop
iln dev resetstartlaunches the local Stellar quickstart Docker container, registers the local network, creates/funds development keys, deploys a built ILN WASM when available, and writes.env.local.stopremoves the local quickstart container.resetremoves local generated state and starts fresh.statusprints node, RPC, contract, and token state.
Requires Docker to be installed and running. Contract deployment also requires the Stellar CLI and a built contract WASM.
iln submit --payer G... --amount 100 --due 2025-12-31 --rate 300--amountuses display units and is converted to Stellar stroops internally.--dueaccepts eitherYYYY-MM-DDor a Unix timestamp.--tokencan override the configuredtokenIdif needed.
iln fund --id 1By default this funds the remaining balance on the invoice. To partially fund:
iln fund --id 1 --amount 25iln pay --id 1iln status --id 1iln list --address G...This lists invoices where the address is the freelancer, payer, or recorded funder.
iln dev seedCreates and funds 3 development accounts (freelancer, payer, liquidity_provider) on testnet with USDC/EURC trustlines configured. Fully idempotent - running multiple times reuses existing accounts.
Output:
- Generates keypairs for 3 accounts
- Funds each via Friendbot with XLM
- Sets up USDC and EURC trustlines
- Saves account details to
.env.testnet.accounts(gitignored)
Requires: Active internet connection and testnet network configuration.
For detailed setup instructions, see SEEDER.md.
The integration suite is designed for the repository's standalone Soroban environment.
- Start the local network:
docker-compose up -d-
Deploy and seed the contract.
-
Export the local fixture values:
export ILN_CLI_LOCAL_CONTRACT_ID=...
export ILN_CLI_LOCAL_TOKEN_ID=...
export ILN_CLI_LOCAL_FREELANCER_SECRET=...
export ILN_CLI_LOCAL_FREELANCER_PUBLIC_KEY=...
export ILN_CLI_LOCAL_PAYER_SECRET=...
export ILN_CLI_LOCAL_PAYER_PUBLIC_KEY=...
export ILN_CLI_LOCAL_FUNDER_SECRET=...- Run the integration suite:
cd cli
npm run test:integrationThe CLI supports advanced automation, piping, and command chaining through standard Unix behaviors:
Pass the global --json option to receive structured, machine-parseable JSON responses from all retrieval and submission/mutation commands.
iln status --id 42 --jsonIf a command (like fund, pay, or status) is executed without the --id option in a non-interactive shell, it automatically attempts to parse standard input. Stdin can be passed either as a raw string ID or as a JSON object containing invoiceId or id (matching the output generated by the --json option).
This enables seamless pipeline chaining:
# Submit an invoice and fund it immediately in a single chain:
iln submit --payer GABC... --amount 100 --due 2026-12-31 --rate 300 --json | iln fund --yes --jsonAll commands return appropriate shell exit codes for error handling in scripts:
0: Command completed successfully.1: Command execution or transaction submission failed.
In JSON mode, if an error is thrown, a JSON error representation is written to stdout:
{
"success": false,
"error": "Error details..."
}