Skip to content

721tools/stream-api-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenSea stream API unofficial implement in Go

https://docs.opensea.io/reference/using-stream-api-without-sdk

How to use

package main

import (
	"encoding/json"
	"fmt"
	"time"
	"github.com/721tools/stream-api-go/sdk"
)

func main() {
	api_token := "YOUR-API-TOKEN-HERE"
	ns := sdk.NewNotifyService(sdk.MAIN_NET, api_token)

	ns.Subscribe("*", sdk.ITEM_LISTED, func(msg *sdk.Message) error {
		t, _ := json.Marshal(msg)
		fmt.Printf("recv msg %s \n", string(t))
		return nil
	})

	go ns.Start()

	time.Sleep(time.Second * 100)
}


// ns.Stop()

About

OpenSea stream API unofficial implement in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages