From 15c4b8f8475fb499d530f793abbeab59deae9769 Mon Sep 17 00:00:00 2001 From: Ben Lebherz Date: Sat, 13 Aug 2022 17:12:05 +0200 Subject: [PATCH] improve tokenID parsing --- internal/subscriptions/listings.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/subscriptions/listings.go b/internal/subscriptions/listings.go index b05ea40..b6b3569 100644 --- a/internal/subscriptions/listings.go +++ b/internal/subscriptions/listings.go @@ -4,6 +4,7 @@ import ( "math/big" "regexp" "strconv" + "strings" "sync/atomic" "time" @@ -38,6 +39,8 @@ func StreamListingsHandler(workerID int, gOwnCollections *collections.Collection tokenIDRaw := patternTokenID.ReplaceAllString(event.Payload.Item.Metadata.Name, "$2") gbl.Log.Debugf("tokenIDRaw: %+v", tokenIDRaw) + tokenIDRaw = strings.TrimPrefix(tokenIDRaw, "#") + tokenID, err := strconv.ParseInt(tokenIDRaw, 10, 64) if err != nil { gbl.Log.Infof("error parsing tokenIDRaw to big.int: %s | %s | %s", event.Payload.Item.Metadata.Name, tokenIDRaw, err.Error())