How sahilprg/monad-payment-links works
Paperplane is a web app for sending money as a shareable, revocable link, with optional recipient addressing and a collection safety hold. The main workflow is email sign-in, sender deposit, link sharing, and recipient claim; senders can also inspect or cancel pending transfers, and the app funds new accounts with test tokens. The graph captures documented contract and gatekeeper behavior plus source-visible web calls. Solidity implementation files are absent from the supplied tree, so contract internals are represented at the documented boundary; unshown wiring is omitted.
Main entry points: SendDesk.tsx Send desk · contracts LinkEscrow · SentList.tsx Sent transfers · page.tsx Claim screen
Components 22
Web experience
- Send desk
web/src/components/SendDesk.tsx - Sent transfers
web/src/components/SentList.tsx - Claim screen
web/src/app/claim/page.tsx - Email sign-in
web/src/app/providers.tsx - App shell
web/src/components/Shell.tsx
Transfer lifecycle
- Link and key logic
web/src/lib/paymentLink.ts - Chain configuration
web/src/lib/config.ts - Embedded wallet
web/src/lib/wallet.ts - RPC transport
web/src/lib/transport.ts
Server services
- Claim gatekeeper
web/src/app/api/claim/route.ts - Privy verification
web/src/lib/privyServer.ts - Relayer
web/src/lib/relayer.ts - Account funding
web/src/app/api/fund/route.ts - RPC proxy
web/src/app/api/rpc/route.ts - Monad endpoints
web/src/lib/upstreams.ts
Monad contracts
- LinkEscrow
contracts - MockUSD
contracts
Other components
- Sender
- Recipient
- Privy
- Monad testnet
- Messaging channel
Connections 30
- Sender → Send desk: uses
- Recipient → Claim screen: opens link
- Send desk → Embedded wallet: gets signer
web/src/components/SendDesk.tsx - Send desk → Chain configuration: reads chain
web/src/components/SendDesk.tsx - Send desk → MockUSD: checks balance
web/src/components/SendDesk.tsx - Send desk → MockUSD: approves token
web/src/components/SendDesk.tsx - Send desk → Link and key logic: creates claim key
web/src/components/SendDesk.tsx - Send desk → LinkEscrow: deposits funds
web/src/components/SendDesk.tsx - Send desk → Messaging channel: shares link
- Send desk → Sent transfers: renders
web/src/components/SendDesk.tsx - Sent transfers → Chain configuration: reads transfer status
web/src/components/SentList.tsx - Sent transfers → Embedded wallet: gets signer
web/src/components/SentList.tsx - Sent transfers → LinkEscrow: cancels transfer
web/src/components/SentList.tsx - Claim screen → Link and key logic: reads and signs link
- Claim screen → Claim gatekeeper: requests gate signature
- Claim screen → LinkEscrow: submits claim
- Claim gatekeeper → Privy verification: verifies account
web/src/lib/privyServer.ts - Privy verification → Privy: verifies token
web/src/lib/privyServer.ts - Claim gatekeeper → Relayer: requests claim relay
- Relayer → LinkEscrow: submits claim
- Account funding → Relayer: requests funding
- Send desk → Account funding: requests test funds
web/src/components/SendDesk.tsx - RPC transport → RPC proxy: proxies browser calls
web/src/lib/transport.ts - RPC proxy → Monad endpoints: selects endpoints
- Monad endpoints → Monad testnet: connects to
- App shell → Email sign-in: uses sign-in state
web/src/components/Shell.tsx - Email sign-in → Privy: authenticates users
- LinkEscrow → MockUSD: holds and releases tokens
- LinkEscrow → Recipient: pays on claim
- LinkEscrow → Sender: refunds or cancels