Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.19 KB

README.md

File metadata and controls

54 lines (36 loc) · 1.19 KB

Stellar Horizon SDK Demonstration

Goal: Get account details using Stellar Horizon API Javascript SDK

Uses the Stellar Horizon SDK

Tech Stack

Run Locally

Install dependencies

  yarn

Run the Project

  yarn dev

Go to http://localhost:3000

2. Environment Variables

Create environment variables file

  touch .env

Components

pages/index.tsx

  • Home page Component
  • imports Message.tsx and Button.tsx components

pages/api/auth.ts

  • Next.js API file
  • Making a POST request to http://localhost:3000/api/account using the Stellar SDK to get account details

helpers/store.ts

  • This file sets up our zustand store. Zustand is a "small, fast and scalable bearbones state-management solution using simplified flux principles."

components/Button.tsx

  • Button component that changes depending on the users actions
  • Button onClick functions for each state of the button

components/Message.tsx

  • Message component displays the primary text to the user, which changes depending on the users actions