go-opensea

module
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2022 License: MIT

README

go-opensea

Go Reference

A Go client for the OpenSea API.

Endpoints supported

v1

https://docs.opensea.io/reference/api-overview

  • Retrieving assets (GetAssets)
  • Retrieving events (GetEvents)
  • Retrieving collections (GetCollections)
  • Retrieving bundles (GetBundles)
  • Retrieving a single asset (GetAsset)
  • Retrieving a single contract (GetContract)
  • Retrieving a single collection (GetCollection)
  • Retrieving collection stats (GetCollectionStats)

Example usage

package main

import (
	"github.com/mager/go-opensea/opensea"
)

func main() {
	// Create a new client
	client := opensea.NewOpenSeaClient("")

	// Get all assets
	addy := "0x3b417FaeE9d2ff636701100891DC2755b5321Cc3" // Jay-Z's wallet address
	assets, err := client.GetAssets(addy)
	if err != nil {
		// TODO: Handle error
	}

	// Print the assets
	for _, asset := range assets {
		client.Log.Info(asset.Name)
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL