Skip to content

spencerstock/spend-permission-demo

 
 

Repository files navigation

Subscribe Onchain

Getting Started

Environment Variables

Copy our template environment file and fill in missing variables.

cp template.env .env
NEXT_PUBLIC_ONCHAINKIT_CDP_KEY=""
BASE_SEPOLIA_PAYMASTER_URL=""
SUBSCRIPTION_PRIVATE_KEY=""
NEXT_PUBLIC_SUBSCRIPTION_SPENDER=""

First, go to portal.cdp.coinbase.com and sign up for an account.

  • NEXT_PUBLIC_ONCHAINKIT_CDP_KEY: Go to "Onchain Tools" > "OnchainKit" and copy "Client API Key"
  • BASE_SEPOLIA_PAYMASTER_URL: Go to "Onchain Tools" > "Paymaster" > "Configuration" and change the network dropdown on the far right to "Base Testnet (Sepolia)" and copy "Paymaster & Bundler endpoint"

Next, you need to generate a new private key. Foundry's cast wallet new is recommended and you can install Foundry here.

  • SUBSCRIPTION_PRIVATE_KEY: set the output private key from cast wallet new
  • NEXT_PUBLIC_SUBSCRIPTION_SPENDER: set the output address from cast wallet new (note we will actually change this later)

Install and run

npm install
npm run dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.1%
  • CSS 1.2%
  • JavaScript 0.7%