Skip to content

Commit

Permalink
fast hack for banned nft collection
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhar-petukhov committed Nov 22, 2023
1 parent 2e2863c commit a245f92
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/api/nft_converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"strings"

"github.com/tonkeeper/opentonapi/internal/g"
"github.com/tonkeeper/opentonapi/pkg/bath"
Expand Down Expand Up @@ -55,6 +56,12 @@ func convertNFT(ctx context.Context, item core.NftItem, book addressBook, metaCa
}
}
cInfo, _ := metaCache.getCollectionMeta(ctx, *item.CollectionAddress)

// TODO: REMOVE, FAST HACK
if strings.Contains(cInfo.Description, "ton-staker.com") {
cInfo.Description = "SCAM"
}

i.Collection.SetTo(oas.NftItemCollection{
Address: item.CollectionAddress.ToRaw(),
Name: cInfo.Name,
Expand Down Expand Up @@ -97,6 +104,13 @@ func convertNftCollection(collection core.NftCollection, book addressBook) oas.N
metadata := map[string]jx.Raw{}
image := references.Placeholder
for k, v := range collection.Metadata {
// TODO: REMOVE, FAST HACK
if k == "description" {
if value, ok := v.(string); ok && strings.Contains(value, "ton-staker.com") {
v = "SCAM"
}
}

var err error
if k == "image" {
if i, ok := v.(string); ok && i != "" {
Expand Down

0 comments on commit a245f92

Please sign in to comment.