naapi
v1.0.0-beta2
Published
nostr assets api sdk
Downloads
2
Readme
NAAPI
It is an SDK library developed based on the NOSTR ASSET protocol, used to query transactions、balance、tokenEvents.
Support method list
NAAPI.assets
- getBalance
- getTokenList
- getAllowance
- getFundingRecords
- getTokenEvents
- getHolders
- getHolder
- getHolderSummary
- getPayeeList
NAAPI.markets
- getMarketTokenList
- getMarketOrderListing
- getOrderHistory
- getMarketMyOrder
- return
NAAPI.fairmint
- getHoroscopList
- getActivity
- getUserInfo
- getUserList
- getRankingSummary
- getSearchRanking
- getBlockList
- getBlockUserList
NAAPI.lock
- getLockList
Setup
React
install
yarn add naapi
code
import {useCallback} from 'react
import NAAPI from 'naapi'
const naapi = new NAAPI('https://market-api.nostrassets.com') // dev:
https://market-api.unift.xyz,prod:https://market-api.nostrassets.com
const onQueryBalance = useCallback(async()=>{
const res = await naapi.assets.getBalance(owner)
},[])
return <>
{your code}
</>
More Example
tests/*.test.js
License
MIT License
Copyright (c) 2024 Luke
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.