The INVORA SDK enables developers to integrate invoice issuance, credit access, and loan execution into their applications with a simple, type-safe API.
The INVORA SDK is currently under active development. Check back soon for the official release.
The INVORA SDK provides a comprehensive toolkit for integrating digital invoice management and invoice-backed credit into any application. Built with TypeScript, the SDK offers full type safety, extensive documentation, and a developer-friendly API.
Whether you're building a business management platform, an accounting system, or a financial services application, the INVORA SDK handles all the complexity of blockchain interactions, credit evaluations, and loan management behind a clean, intuitive interface.
Create, update, and manage digital invoices with full on-chain verification. The SDK handles all blockchain interactions, signature requirements, and validation logic.
const invoice = await invoraClient.createInvoice({amount: 1000,recipient: "wallet_address",dueDate: Date.now() + 30 * 24 * 60 * 60 * 1000})Submit invoices for credit evaluation and receive real-time creditworthiness assessments. Access detailed scoring breakdowns and eligible loan terms.
const evaluation = await invoraClient.evaluateCredit({invoiceId})// Returns: { score, loanAmount, interestRate, terms }Execute loan requests against verified invoices with a single function call. The SDK manages transaction signing, error handling, and confirmation tracking.
const loan = await invoraClient.requestLoan({invoiceId,amount: 800,terms: "30_days"})Seamless integration with Solana wallet adapters. The SDK automatically handles wallet connection, transaction signing, and user authorization flows.
const client = new InvoraClient({wallet,network: "mainnet"})// All operations require wallet signatureMonitor active loans, track repayment schedules, and receive real-time updates on loan status. Subscribe to events for automated notifications.
const loans = await invoraClient.getActiveLoans()loans.forEach(loan => {console.log(loan.status, loan.dueDate)})The main client class for interacting with the INVORA protocol. All operations require a connected Solana wallet.
new InvoraClient(config: InvoraConfig)Configuration parameters:
wallet- WalletContextState | Wallet adapter instancenetwork- "mainnet-beta" | "devnet" | "testnet"rpcEndpoint?- Custom RPC endpoint (optional)programId?- Custom program ID (optional)createInvoice(params: CreateInvoiceParams): Promise<Invoice>Creates a new on-chain invoice with verification.
interface CreateInvoiceParams {amount: numberrecipient: string // Wallet addressdueDate: number // Unix timestampdescription: stringmetadata?: Record<string, any>currency?: "USDC" | "SOL"}getInvoice(invoiceId: string): Promise<Invoice>Retrieves invoice details by ID from the blockchain.
listInvoices(filters?: InvoiceFilters): Promise<Invoice[]>Lists all invoices for the connected wallet with optional filters.
cancelInvoice(invoiceId: string): Promise<Transaction>Cancels an unpaid invoice. Only invoice issuer can cancel.
evaluateCredit(params: CreditEvalParams): Promise<CreditEvaluation>Evaluates creditworthiness for an invoice or wallet address.
interface CreditEvaluation {score: number // 0-1000grade: "AAA" | "AA" | "A" | "BBB" | "BB" | "B" | "C"maxLoanAmount: numberinterestRate: number // Annual percentageloanToValueRatio: numberfactors: CreditFactorstimestamp: number}getCreditScore(walletAddress?: string): Promise<CreditScore>Gets the credit score for a wallet. Uses connected wallet if address not provided.
getCreditHistory(): Promise<CreditHistory[]>Retrieves complete credit history including all evaluations and score changes.
requestLoan(params: LoanRequestParams): Promise<Loan>Requests a loan against a verified invoice.
interface LoanRequestParams {invoiceId: stringamount: numberterm: number // DaysinterestRate?: number // Override suggested ratecollateralAmount?: number}getActiveLoans(): Promise<Loan[]>Lists all active loans for the connected wallet.
getLoanDetails(loanId: string): Promise<LoanDetails>Gets comprehensive details for a specific loan including payment schedule.
repayLoan(loanId: string, amount?: number): Promise<Transaction>Makes a payment towards a loan. Pays full amount if not specified.
getLoanHistory(): Promise<Loan[]>Retrieves complete loan history including closed and defaulted loans.
on(event: string, callback: Function): voidSubscribe to protocol events for real-time updates.
// Available eventsclient.on('invoice:created', callback)client.on('invoice:paid', callback)client.on('loan:approved', callback)client.on('loan:repaid', callback)client.on('credit:updated', callback)Full example showing invoice creation, credit evaluation, and loan request execution.
import { InvoraClient } from '@invora/sdk'import { useWallet } from '@solana/wallet-adapter-react'async function processInvoiceFinancing() {const { wallet } = useWallet()const client = new InvoraClient({ wallet, network: 'mainnet-beta' })// Step 1: Create invoiceconst invoice = await client.createInvoice({amount: 5000,recipient: 'recipient_wallet',dueDate: Date.now() + 30 * 24 * 60 * 60 * 1000,description: 'Q1 Consulting Services',currency: 'USDC'})// Step 2: Evaluate creditconst evaluation = await client.evaluateCredit({invoiceId: invoice.id})// Step 3: Request loan if qualifiedif (evaluation.score > 600) {const loan = await client.requestLoan({invoiceId: invoice.id,amount: evaluation.maxLoanAmount * 0.8, // 80% LTVterm: 30})console.log('Loan approved:', loan.id)}}Subscribe to protocol events for instant notifications and UI updates.
const client = new InvoraClient({ wallet, network: 'mainnet-beta' })// Listen for invoice paymentsclient.on('invoice:paid', (event) => {console.log('Invoice paid:', event.invoiceId)notifyUser('Payment received!')})// Listen for loan approvalsclient.on('loan:approved', (event) => {updateDashboard(event.loanDetails)})// Listen for credit score updatesclient.on('credit:updated', (event) => {refreshCreditScore(event.newScore)})Robust error handling for production applications with user-friendly messages.
try {const loan = await client.requestLoan(params)} catch (error) {if (error instanceof InsufficientCreditError) {// Credit score too lowshowMessage('Credit score insufficient for this loan amount')} else if (error instanceof WalletNotConnectedError) {// User needs to connect walletpromptWalletConnection()} else if (error instanceof InsufficientFundsError) {// Protocol liquidity issueshowMessage('Insufficient protocol liquidity. Try again later.')} else {// Generic errorconsole.error('Loan request failed:', error)showMessage('Transaction failed. Please try again.')}}Custom React hooks for seamless integration in React applications.
import { useInvora } from '@invora/sdk/react'function InvoiceManager() {const { client,connected,createInvoice,getActiveLoans} = useInvora()const handleCreate = async () => {const invoice = await createInvoice({amount: 1000,recipient: recipientAddress,dueDate: Date.now() + 2592000000})}return <div>...</div>}The SDK supports both testnet and devnet for development. Use devnet for rapid iteration and testnet for pre-production testing.
const client = new InvoraClient({wallet,network: 'devnet', // or 'testnet'rpcEndpoint: 'https://api.devnet.solana.com'})The SDK includes mock providers for unit testing without blockchain interactions.
import { MockInvoraClient } from '@invora/sdk/testing'describe('Invoice Flow', () => {it('creates invoice successfully', async () => {const client = new MockInvoraClient()const invoice = await client.createInvoice(params)expect(invoice.id).toBeDefined()})})Best practices for deploying INVORA-integrated applications to production.
Once available, the SDK will be distributed via npm and can be installed with your preferred package manager:
npm install @invora/sdkyarn add @invora/sdkpnpm add @invora/sdk