Sol.College

Structure lesson (licence does not allow quoting code)

Solana-Unipay-Card

This repository contains the Solana implementation of the Unipay Card smart contract. The contract enables users to collateralize SOL to obtain a credit limit, allowing them to open a virtual credit card and add credit for real-world spending.

Original
UnipayFI/Solana-Unipay-Card
SuperStack fork
Blockchains/Solana-Unipay-Card @ 5bf5072
Stars
1
Last push (original)
2024-09-30
Languages
Rust, TypeScript, Shell, JavaScript
Detected stack
MetaplexNative Rustweb3.js
Categories
Payments
Licence
NOASSERTION: code not quoted on Sol.College

Architecture

42 source files. By extension: .ts ×21, .rs ×20, .js ×1.

Top-level directorySource files
clients36
programs6

On-chain programs: programs/mpl-project-name

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
Createnative instruction variantprograms/mpl-project-name/src/instruction.rs:13

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
programs/mpl-project-name/src/processor.rsAccountInfo, invoke, Pubkey, Program
programs/mpl-project-name/src/state.rsAccountInfo, Pubkey
clients/rust/tests/create.rsKeypair, Transaction
programs/mpl-project-name/src/entrypoint.rsAccountInfo, Pubkey
clients/js/test/_setup.tscreateUmi
clients/js/test/create.test.tscreateUmi
programs/mpl-project-name/src/error.rsProgram

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/solana-unipay-card/. 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
clients/jsnpm run build
clients/jsnpm run test
clients/jsnpm run lint
.cargo build
.cargo test

What you could build from it