Skip to content

Commit a2a89dd

Browse files
committed
update getgems verified collection api
1 parent 3ad91f6 commit a2a89dd

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ require (
2121
github.com/prometheus/client_golang v1.14.0
2222
github.com/puzpuzpuz/xsync/v2 v2.4.0
2323
github.com/shopspring/decimal v1.3.1
24-
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29
2524
github.com/sourcegraph/conc v0.3.0
2625
github.com/stretchr/testify v1.9.0
2726
github.com/tonkeeper/scam_backoffice_rules v0.0.0-20241106130559-c44de2d4177b

pkg/addressbook/addressbook.go

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package addressbook
22

33
import (
4-
"context"
54
"encoding/json"
65
"fmt"
76
"github.com/tonkeeper/opentonapi/pkg/core"
@@ -19,7 +18,6 @@ import (
1918
"time"
2019

2120
"github.com/shopspring/decimal"
22-
"github.com/shurcooL/graphql"
2321
"github.com/tonkeeper/tongo"
2422
"go.uber.org/zap"
2523
"golang.org/x/exp/maps"
@@ -489,19 +487,13 @@ func (b *Book) getGGWhitelist() error {
489487
}
490488

491489
func fetchGetGemsVerifiedCollections() ([]tongo.AccountID, error) {
492-
client := graphql.NewClient("https://api.getgems.io/graphql", nil)
493-
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
494-
defer cancel()
495-
var q struct {
496-
GetAddressesOfVerifiedCollections []graphql.String `graphql:"getAddressesOfVerifiedCollections"`
497-
}
498-
err := client.Query(ctx, &q, nil)
490+
res, err := downloadJson[string]("https://api.getgems.io/public/api/verified-collections")
499491
if err != nil {
500492
return nil, err
501493
}
502-
accountIDs := make([]tongo.AccountID, 0, len(q.GetAddressesOfVerifiedCollections))
503-
for _, collection := range q.GetAddressesOfVerifiedCollections {
504-
account, err := tongo.ParseAddress(string(collection))
494+
accountIDs := make([]tongo.AccountID, 0, len(res))
495+
for _, collection := range res {
496+
account, err := tongo.ParseAddress(collection)
505497
if err != nil {
506498
return nil, err
507499
}

0 commit comments

Comments
 (0)