Skip to content

Commit 84c198a

Browse files
Fix: Tzkt auth
1 parent 4c3a2c1 commit 84c198a

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

tzkt/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (tzkt *API) auth(request *http.Request) error {
151151
return errors.Errorf("you have to set auth data")
152152
}
153153

154-
nonce := time.Now().UnixMicro()
154+
nonce := time.Now().UnixMilli()
155155
key, err := crypto.NewKeyFromBase58(tzkt.privateKey)
156156
if err != nil {
157157
return err

tzkt/api/data.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,9 @@ type AccountMetadata struct {
400400
Medium string `json:"medium"`
401401
}
402402

403-
// AccountType -
404-
type AccountType struct {
405-
Profile AccountMetadata `json:"profile"`
406-
}
407-
408403
// MetadataConstraint -
409404
type MetadataConstraint interface {
410-
AccountType
405+
AccountMetadata
411406
}
412407

413408
// Metadata -

tzkt/api/private.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import "context"
44

55
// GetAccountsMetadata -
66
func (tzkt *API) GetAccountsMetadata(ctx context.Context, filters map[string]string) ([]AccountMetadata, error) {
7-
var data []Metadata[AccountType]
7+
var data []Metadata[AccountMetadata]
88
if err := tzkt.json(ctx, "/v1/metadata/accounts", filters, true, &data); err != nil {
99
return nil, err
1010
}
1111

1212
items := make([]AccountMetadata, len(data))
1313
for i := range data {
14-
items[i] = data[i].Value.Profile
14+
items[i] = data[i].Value
1515
items[i].Address = data[i].Key
1616
}
1717

0 commit comments

Comments
 (0)