npm.io
1.0.8 • Published 4 years ago

opensea-api

Licence
ISC
Version
1.0.8
Deps
0
Size
40 kB
Vulns
0
Weekly
0

opensea-api

Typescript wrapper for Opensea API v1 . Need to figure out how to get intellisense (autocomplete) to work for it to be super useful.

Install

npm i opensea-api

Usage

const { OpenseaAPI } = require("opensea-api");

const seaport = new OpenseaAPI("API_KEY_HERE");
seaport.getAssets().then(data => console.log(data))

Todo

  • add try catch block
  • test ESM version on FE
  • get intellisense working

Supported functions

getAssets(options?: GetAssetsOptions): Promise<any>;
getEvents(options?: GetEventsOptions): Promise<any>;
getCollections(options?: GetCollectionsOptions): Promise<any>;
getBundles(options?: GetBundlesOptions): Promise<any>;
getSingleAsset(assetContractAddress: string, tokenId: string, options?: GetSingleAssetOptions): Promise<any>;
getSingleAssetListings(assetContractAddress: string, tokenId: string, options?: GetSingleAssetEventOptions): Promise<any>;
getSingleAssetOffers(assetContractAddress: string, tokenId: string, options?: GetSingleAssetEventOptions): Promise<any>;
getSingleContract(assetContractAddress: string): Promise<any>;
getSingleCollection(collectionSlug: string): Promise<any>;
getSingleCollectionStats(collectionSlug: string): Promise<any>;