Sol.College

Structure lesson (licence does not allow quoting code)

Crypto-pay

Original
Abdulraf2001/Crypto-pay
SuperStack fork
Blockchains/Crypto-pay @ 1344012
Stars
0
Last push (original)
2025-10-29
Languages
TypeScript, Rust, Dockerfile, CSS
Detected stack
Anchorweb3.js
Categories
Payments
Licence
none detected: code not quoted on Sol.College

Architecture

26 source files. By extension: .rs ×12, .ts ×9, .tsx ×5.

Top-level directorySource files
programs12
app10
(root)2
migrations1
tests1

On-chain programs: programs/intent_payment

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_intentCreateIntentprograms/intent_payment/src/lib.rs:36
pay_intentPayIntentprograms/intent_payment/src/lib.rs:62
cancel_intentCancelIntentprograms/intent_payment/src/lib.rs:76
refundRefundprograms/intent_payment/src/lib.rs:98

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
app/solana/client/rpc.tsPublicKey, Program, AnchorProvider
app/solana/useProgram.tsPublicKey, Keypair, AnchorProvider, useConnection
app/solana/client/pda.tsPublicKey, seeds, findProgramAddressSync
programs/intent_payment/src/lib.rsAccountInfo, Pubkey
programs/intent_payment/src/instructions/pay_intent.rsAccountInfo, Pubkey, seeds, Program, CpiContext
programs/intent_payment/src/instructions/create_intent.rsPubkey, AccountInfo, seeds, Program
programs/intent_payment/src/instructions/refund.rsAccountInfo, Pubkey, seeds, Program, CpiContext
app/routes/home.tsxWalletMultiButton, useWallet, Program
programs/intent_payment/src/state/intent.rsPubkey
programs/intent_payment/src/instructions/cancel_intent.rsPubkey, AccountInfo, seeds
programs/intent_payment/src/state/receipt.rsPubkey
tests/intent_payment.tsAnchorProvider, PublicKey

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/crypto-pay/. 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
.npm run dev
.npm run start
.npm run build
.anchor build
.anchor test
.anchor run test
.cargo build
.cargo test

What you could build from it