Skip to content

Commit

Permalink
add option to filter by token type (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaidliadon authored May 17, 2024
1 parent 806ad32 commit b42b0d6
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 129 deletions.
4 changes: 4 additions & 0 deletions _examples/basic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"flag"
"log/slog"
"net/http"
"os"
"time"

Expand Down Expand Up @@ -31,10 +32,13 @@ func main() {

logger.Info("go-tokendirectory example starting...")

provider := tokendirectory.NewProvider(http.DefaultClient, tokendirectory.SourceTypeERC1155)

options := []tokendirectory.Option{
tokendirectory.WithUpdateFuncs(updateFunc),
tokendirectory.WithUpdateInterval(time.Minute),
tokendirectory.WithLogger(logger),
tokendirectory.WithProviders(provider),
}

tokenDirectory, err := tokendirectory.NewTokenDirectory(options...)
Expand Down
Loading

0 comments on commit b42b0d6

Please sign in to comment.