@@ -30,13 +30,57 @@ import SwiftyJSON
3030///
3131/// This enum allows for either a `MoveObjectRaw` or `PackageRaw` data type, capturing
3232/// the raw information for either a Move object or a package object.
33- public enum RawData {
33+ public enum RawData : Equatable {
3434 /// Represents raw data for a Move object. The associated value is a `MoveObjectRaw` containing the Move object's raw data.
3535 case moveObject( MoveObjectRaw )
3636
3737 /// Represents raw data for a package object. The associated value is a `PackageRaw` containing the package object's raw data.
3838 case packageObject( PackageRaw )
3939
40+ public init ( graphql: TryGetPastObjectQuery . Data . Object . AsMoveObject , version: String ) {
41+ self = . moveObject(
42+ MoveObjectRaw (
43+ bcsBytes: JSON ( graphql. ifShowBcs!. contents!. bcs) . stringValue,
44+ hasPublicTransfer: graphql. ifShowBcs!. hasPublicTransfer,
45+ type: graphql. ifShowBcs!. contents!. type. repr,
46+ version: version
47+ )
48+ )
49+ }
50+
51+ public init ( graphql: GetOwnedObjectsQuery . Data . Address . ObjectConnection . Node . AsMoveObject , version: String ) {
52+ self = . moveObject(
53+ MoveObjectRaw (
54+ bcsBytes: JSON ( graphql. ifShowBcs!. contents!. bcs) . stringValue,
55+ hasPublicTransfer: graphql. ifShowBcs!. hasPublicTransfer,
56+ type: graphql. ifShowBcs!. contents!. type. repr,
57+ version: version
58+ )
59+ )
60+ }
61+
62+ public init ( graphql: MultiGetObjectsQuery . Data . ObjectConnection . Node . AsMoveObject , version: String ) {
63+ self = . moveObject(
64+ MoveObjectRaw (
65+ bcsBytes: JSON ( graphql. ifShowBcs!. contents!. bcs) . stringValue,
66+ hasPublicTransfer: graphql. ifShowBcs!. hasPublicTransfer,
67+ type: graphql. ifShowBcs!. contents!. type. repr,
68+ version: version
69+ )
70+ )
71+ }
72+
73+ public init ( graphql: GetObjectQuery . Data . Object . AsMoveObject , version: String ) {
74+ self = . moveObject(
75+ MoveObjectRaw (
76+ bcsBytes: JSON ( graphql. ifShowBcs!. contents!. bcs) . stringValue,
77+ hasPublicTransfer: graphql. ifShowBcs!. hasPublicTransfer,
78+ type: graphql. ifShowBcs!. contents!. type. repr,
79+ version: version
80+ )
81+ )
82+ }
83+
4084 /// Parses a `JSON` object to determine the type of raw data it contains and returns a corresponding `RawData` instance.
4185 ///
4286 /// - Parameters:
0 commit comments