Lnfi Network (Formerly NostrAssets)
  • β­•Overview
    • πŸ”°Key Features
    • πŸ€–Technology
  • ❓How does it work
  • πŸ”°Receive & Send Assets
  • πŸ”…Transfer Nostr Assets
  • ✨Importing Assets
  • πŸ”ŽPublicly Viewable Data
  • ⏩Nostr Assets Commands
  • 🟒Marketplace
    • Marketplace Commands
  • ⚑Lightning Starter: Transparent Unbiased Fair Mint
    • Phase 1 Rules
    • Phase 2 Rules
    • Phase 3 Rules
  • 🎁Lightning Gift
  • πŸ”“Lock Assets
  • 🌟MicroNode (Early Access)
    • MicroNode User Guide (Early Access)
    • MicroNode Connect (MNC)
    • MicroNode Disclaimer
  • πŸ”—Official Links
  • ⚠️Disclaimer
  • πŸ—ΊοΈRoadmap & Progress
  • User Guides (Updated Nov 2023)
    • Desktop Users
    • Desktop Chat-to-Trade
    • Mobile Chat-to-Trade
    • Token Pocket Users
      • How to get your new Nostr account in Token Pocket
      • Marketplace Setup (Token Pocket)
      • How to use Marketplace? (Token Pocket)
    • OKX Wallet
    • OneKey
  • NostrAssets SDK & API
    • API
    • SDK
Powered by GitBook
On this page
  • NAAPI - NostrAssets API Guide
  • Introduction
  • Features
  • Support Method List
  • NAAPI.assets
  • NAAPI.markets
  • NAAPI.fairmint
  • NAAPI.lock
  • Setup
  • Installation
  • Conclusion
  1. NostrAssets SDK & API

API

PreviousOneKeyNextSDK

Last updated 1 year ago

NAAPI - NostrAssets API Guide

Link to Github:

Introduction

NAAPI (NostrAsset API) is a powerful SDK library developed based on the NOSTRASSET protocol. 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

NAAPI.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

NAAPI.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.

NAAPI.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.

NAAPI.lock

  • getLockList(): Retrieve lock list.


Setup

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

Installation

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

yarn add naapi

Code Integration

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

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

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

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

Conclusion

With the NAAPI SDK, developers can seamlessly integrate various functionalities of the NOSTR ASSET protocol into their applications. Start building innovative solutions today!

Reference:

Reference:

https://github.com/nostrassets/naapi
Lightning Starter Fairmint
Lock Assets