Sol.College

Structure lesson (licence does not allow quoting code)

HorizonPay

Trustless, non-custodial stablecoin payment infrastructure on Solana — on-chain vaults, recurring subscriptions, merchant webhooks.

Original
yashwankhade5/HorizonPay
SuperStack fork
Blockchains/HorizonPay @ 910fb1d
Stars
0
Last push (original)
2026-08-29
Languages
TypeScript, Rust, CSS, HTML, Nix
Detected stack
Anchorweb3.js
Categories
DeFiPayments
Licence
none detected: code not quoted on Sol.College

Architecture

172 source files. By extension: .tsx ×85, .ts ×65, .rs ×22.

Top-level directorySource files
frontend92
backend48
horizon-contract32

On-chain programs: horizon-contract/programs/horizon-contract

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
create_merchantCreateMerchanthorizon-contract/programs/horizon-contract/src/lib.rs:40
payPayhorizon-contract/programs/horizon-contract/src/lib.rs:46
withdrawWithdrawhorizon-contract/programs/horizon-contract/src/lib.rs:51
freeze_vaultFreezeVaulthorizon-contract/programs/horizon-contract/src/lib.rs:56
unfreeze_vaultUnfreezeVaulthorizon-contract/programs/horizon-contract/src/lib.rs:61
enable_transferEnableTransferhorizon-contract/programs/horizon-contract/src/lib.rs:66
disable_transferDisableTransferhorizon-contract/programs/horizon-contract/src/lib.rs:70
recurr_payRecurrPayhorizon-contract/programs/horizon-contract/src/lib.rs:86
stop_recurr_payStopRecurrPayhorizon-contract/programs/horizon-contract/src/lib.rs:91

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
backend/src/services/solana.service.tsPublicKey, Transaction, Keypair, findProgramAddressSync, getLatestBlockhash, Connection
backend/src/scripts/createAdmin.tsPublicKey, Keypair, SystemProgram, mintTo, Program, Connection
backend/src/workers/listener.tsPublicKey, Connection, Transaction
horizon-contract/programs/horizon-contract/src/event/mod.rsPubkey
backend/src/scripts/signpay:Tx.tsPublicKey, Connection, Keypair, Transaction, getAssociatedTokenAddressSync, getAssociatedTokenAddress
horizon-contract/tests/06_ recurring.tsPublicKey, AnchorProvider, findProgramAddressSync, createMint, mintTo, SystemProgram
horizon-contract/tests/helpers/setup.tsPublicKey, Program, findProgramAddressSync, AnchorProvider
horizon-contract/tests/03_pay.tsAnchorProvider, PublicKey, createMint, mintTo, findProgramAddressSync
horizon-contract/tests/02_ create_merchant.tsPublicKey, SystemProgram, createMint, findProgramAddressSync, AnchorProvider
frontend/hpayfrontend/src/lib/utils.tsPublicKey, findProgramAddressSync
backend/src/scripts/signTx.tsKeypair, Transaction, getLatestBlockhash
horizon-contract/tests/05_freeze_unfreeze.tstransfer, PublicKey, findProgramAddressSync

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/horizonpay/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
horizon-contractnpm run lint
frontend/hpayfrontendnpm run dev
frontend/hpayfrontendnpm run build
backendnpm run dev
backendnpm run start
backendnpm run build
backendnpm run test
horizon-contractanchor build
horizon-contractanchor test
horizon-contractanchor run test

What you could build from it