Skip to content

Dangoz/Packet

Repository files navigation

Tempo + Privy Example Project

A basic example showing how to send tokens with memos on Tempo using Privy for wallet authentication.

Features

  • Transaction Memos: Attach human-readable memos to token transfers
  • Privy Authentication: Embedded wallet creation and social login via Privy
  • Token Transfers: Send alphaUSD tokens to other users

Tech Stack

Getting Started

  1. Install dependencies:
pnpm install
  1. Copy the example environment file and add your Privy credentials:
cp .env.example .env
  1. Run the development server:
pnpm dev
  1. Open http://localhost:3000 in your browser.

Key Implementation Details

How Privy Is Used

Privy provides two key functions in this app:

1. Sender Wallet (always used)

When you log in via email or SMS, Privy automatically creates an embedded wallet for you. No seed phrases or extensions needed. This wallet signs all your transactions.

2. Recipient Lookup (optional)

You can send to recipients in two ways:

Recipient Type Example Privy Used?
Wallet address 0x1234...abcd No - sends directly to address
Email friend@example.com Yes - Privy looks up or creates their wallet
Phone +14155551234 Yes - Privy looks up or creates their wallet

When sending to an email/phone, Privy either finds the recipient's existing wallet or creates a new one. The recipient can then log in with that email/phone to access their funds.

Transaction Memos

Memos are attached to transfers using the memo parameter (TIP-20 feature):

await client.token.transferSync({
  to: recipient,
  amount: parseUnits(amount, metadata.decimals),
  memo: stringToHex(memo),
  token: alphaUsd,
})

Resources

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors