Skip to content

Commit

Permalink
Fix object content field type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
JaydenLink committed Oct 25, 2023
1 parent 7902e81 commit 1dafee5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions models/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ type SuiObjectInfo struct {
}

type SuiMoveObject struct {
Type string
Fields map[string]interface{}
HasPublicTransfer bool
Type string `json:"type"`
Fields map[string]interface{} `json:"fields"`
HasPublicTransfer bool `json:"hasPublicTransfer"`
}

type SuiMovePackage struct {
Disassembled string `json:"disassembled"`
}

type SuiMoveModuleId struct {
Address string
Name string
Address string `json:"address"`
Name string `json:"name"`
}

type SuiMoveNormalizedModule struct {
Expand Down
26 changes: 13 additions & 13 deletions models/read_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ type PaginatedObjectsResponse struct {
}

type SuiObjectResponse struct {
Data SuiObjectData `json:"data"`
Error SuiObjectResponseError `json:"error"`
Data SuiObjectData `json:"data"`
Error *SuiObjectResponseError `json:"error,omitempty"`
}

type SuiObjectResponseError struct {
Expand Down Expand Up @@ -108,8 +108,8 @@ type SuiRawMoveObject struct {
}

type DisplayFieldsResponse struct {
Data any `json:"data,omitempty"`
Error SuiObjectResponseError `json:"error,omitempty"`
Data any `json:"data"`
Error *SuiObjectResponseError `json:"error"`
}

type Display interface {
Expand Down Expand Up @@ -165,15 +165,15 @@ type SuiParsedData struct {
}

type SuiObjectData struct {
ObjectId string `json:"objectId"`
Version string `json:"version"`
Digest string `json:"digest"`
Type string `json:"type"`
Owner interface{} `json:"owner"`
PreviousTransaction string `json:"previousTransaction"`
Display DisplayFieldsResponse `json:"display"`
Content SuiParsedData `json:"content"`
Bcs SuiRawData `json:"bcs"`
ObjectId string `json:"objectId"`
Version string `json:"version"`
Digest string `json:"digest"`
Type string `json:"type"`
Owner interface{} `json:"owner"`
PreviousTransaction string `json:"previousTransaction,omitempty"`
Display *DisplayFieldsResponse `json:"display,omitempty"`
Content *SuiParsedData `json:"content,omitempty"`
Bcs *SuiRawData `json:"bcs,omitempty"`
}

type SuiMultiGetObjectsRequest struct {
Expand Down

0 comments on commit 1dafee5

Please sign in to comment.