Lnfi Network
  • β­•Overview
    • πŸ”°Key Features
    • πŸ€–Technology
      • ❓How Does It Work?
  • πŸ”°Hybrid Custody and Security
  • πŸ”€Deposit & Withdraw
  • πŸ”…Transfer Assets
  • ✨Importing Assets
  • πŸ”ŽPublicly Viewable Data
  • πŸ’¬Natural Language Commands
  • 🟒Marketplace
    • Marketplace Commands
  • πŸ”—Official Links
  • ⚠️Terms of Use
  • πŸ—ΊοΈRoadmap & Progress
  • 🧑Brand Kit
  • Lnfi Products
    • 🌟LN Node
      • LN Node User Guide
      • Channel Mining
      • LN Link
      • Terms of Service
    • ⚑LN Starter
      • LN Launchpad
      • LN Launchpool
        • Phase 1 Rules
        • Phase 2 Rules
        • Phase 3 Rules
    • πŸš₯LN Bridge
      • LN Bridge User Guide
      • Steps to Verify TA-USDT
    • πŸ”“Lock Assets
    • 🎁LN Gift
  • Ecosystem
    • ♾️LN Ecosystem & LN Alliance
  • User Guides
    • Desktop Users
    • Token Pocket
    • OKX Wallet
    • OneKey
  • Lnfi Network SDK & API
    • API
    • SDK
Powered by GitBook
On this page
  • LNAPI - Lnfi Network API Guide
  • Introduction
  • Features
  • Support Method List
  • LNAPI.assets
  • LNAPI.markets
  • LNAPI.fairmint
  • LNAPI.lock
  • Setup
  • Installation
  • Conclusion
  1. Lnfi Network SDK & API

API

PreviousOneKeyNextSDK

Last updated 8 months ago

LNAPI - Lnfi Network API Guide

Link to Github:

Introduction

Lnfi Network API (LNAPI) is a powerful SDK library developed on Nostr. It enables developers to interact with various functionalities such as querying transactions, balances, and token events effortlessly.

Features

  • Query Transactions

  • Check Balance

  • Retrieve Token Lists

  • Get Allowance

  • Fetch Funding Records

  • Access Token Events

  • Retrieve Market-Related Information

  • Explore Fairmint Functionalities

  • Manage Locks


Support Method List

LNAPI.assets

  • getBalance(owner)

    Retrieve the balance for a specified owner (npub address)

  • getTokenList()

    Get a list of tokens

  • getAllowance() Check the allowance. (asset quantity authorized to another npub address such as operator/marketplace etc)

  • getFundingRecords()

    Fetch funding records (Send / Receive history)

  • getTokenEvents()

    Access token events such as Asset Transfers, Approve, etc

  • getHolders()

    Retrieve the token holders list

  • getHolder()

    Retrieve token holder information

  • getHolderSummary()

    Retrieve summary of a token holder

  • getPayeeList()

    Get a list of approved withdrawal channels

LNAPI.markets

  • getMarketTokenList()

    Retrieve tokens available in the market.

  • getMarketOrderListing()

    Get order listing(s) for a market.

  • getOrderHistory()

    Retrieve order history.

  • getMarketMyOrder()

    Retrieve orders for a user.

LNAPI.fairmint

  • getHoroscopeList()

    Retrieve horoscope launch pool list.

  • getActivity()

    Get user activity.

  • getUserInfo()

    Retrieve user information.

  • getUserList()

    Get user list.

  • getRankingSummary()

    Retrieve ranking summary.

  • getSearchRanking()

    Get search ranking.

  • getBlockList()

    Retrieve block list.

  • getBlockUserList()

    Get block user list.

LNAPI.lock

  • getLockList(): Retrieve lock list.


Setup

To start using LNAPI SDK in your React project, follow these simple steps:

Installation

Using yarn, run the following command to install the LNAPI SDK:

yarn add lnapi

Code Integration

import { useCallback } from 'react';
import LNAPI from 'naapi';

const naapi = new LNAPI('https://market-api.nostrassets.com'); // Replace with appropriate URL

const onQueryBalance = useCallback(async () => {
    const res = await lnapi.assets.getBalance(owner);
}, []);

return (
    <>
        {/* Your code here */}
    </>
);

Conclusion

With the LNAPI SDK, developers can seamlessly integrate various functionalities of the Lnfi into their applications. Start building innovative solutions today!

Reference:

Reference:

https://github.com/lnfi-network/naapi
Lightning Starter Fairmint
Lock Assets