@evefrontier/dapp-kit 0.1.8 → 0.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -25
- package/dist/config/dapp-kit.d.ts +4 -0
- package/dist/config/dapp-kit.d.ts.map +1 -0
- package/dist/config/dapp-kit.js +14 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +1 -0
- package/dist/graphql/client.d.ts +277 -0
- package/dist/graphql/client.d.ts.map +1 -0
- package/dist/graphql/client.js +346 -0
- package/dist/graphql/index.d.ts +4 -0
- package/dist/graphql/index.d.ts.map +1 -0
- package/dist/graphql/index.js +16 -0
- package/dist/graphql/queries.d.ts +103 -0
- package/dist/graphql/queries.d.ts.map +1 -0
- package/{graphql/queries.ts → dist/graphql/queries.js} +113 -223
- package/dist/graphql/types.d.ts +396 -0
- package/dist/graphql/types.d.ts.map +1 -0
- package/dist/graphql/types.js +4 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +8 -0
- package/dist/hooks/useCharacterDirectory.d.ts +16 -0
- package/dist/hooks/useCharacterDirectory.d.ts.map +1 -0
- package/dist/hooks/useCharacterDirectory.js +23 -0
- package/dist/hooks/useCharacterSearch.d.ts +24 -0
- package/dist/hooks/useCharacterSearch.d.ts.map +1 -0
- package/dist/hooks/useCharacterSearch.js +24 -0
- package/dist/hooks/useConnection.d.ts +51 -0
- package/dist/hooks/useConnection.d.ts.map +1 -0
- package/{hooks/useConnection.ts → dist/hooks/useConnection.js} +8 -10
- package/dist/hooks/useEntityRole.d.ts +26 -0
- package/dist/hooks/useEntityRole.d.ts.map +1 -0
- package/dist/hooks/useEntityRole.js +91 -0
- package/dist/hooks/useNotification.d.ts +72 -0
- package/dist/hooks/useNotification.d.ts.map +1 -0
- package/{hooks/useNotification.ts → dist/hooks/useNotification.js} +8 -12
- package/dist/hooks/useSmartObject.d.ts +44 -0
- package/dist/hooks/useSmartObject.d.ts.map +1 -0
- package/dist/hooks/useSmartObject.js +50 -0
- package/dist/hooks/useSponsoredTransaction.d.ts +147 -0
- package/dist/hooks/useSponsoredTransaction.d.ts.map +1 -0
- package/dist/hooks/useSponsoredTransaction.js +240 -0
- package/dist/hooks/useTypeNames.d.ts +11 -0
- package/dist/hooks/useTypeNames.d.ts.map +1 -0
- package/dist/hooks/useTypeNames.js +24 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/providers/EveFrontierProvider.d.ts +23 -0
- package/dist/providers/EveFrontierProvider.d.ts.map +1 -0
- package/dist/providers/EveFrontierProvider.js +23 -0
- package/dist/providers/NotificationProvider.d.ts +14 -0
- package/dist/providers/NotificationProvider.d.ts.map +1 -0
- package/dist/providers/NotificationProvider.js +66 -0
- package/dist/providers/SmartObjectProvider.d.ts +31 -0
- package/dist/providers/SmartObjectProvider.d.ts.map +1 -0
- package/dist/providers/SmartObjectProvider.js +80 -0
- package/dist/providers/VaultProvider.d.ts +10 -0
- package/dist/providers/VaultProvider.d.ts.map +1 -0
- package/dist/providers/VaultProvider.js +79 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +4 -0
- package/dist/providers/smartObject/useEntityData.d.ts +29 -0
- package/dist/providers/smartObject/useEntityData.d.ts.map +1 -0
- package/dist/providers/smartObject/useEntityData.js +135 -0
- package/dist/providers/smartObject/useEntitySubscription.d.ts +14 -0
- package/dist/providers/smartObject/useEntitySubscription.d.ts.map +1 -0
- package/dist/providers/smartObject/useEntitySubscription.js +58 -0
- package/dist/providers/smartObject/useObjectSelection.d.ts +11 -0
- package/dist/providers/smartObject/useObjectSelection.d.ts.map +1 -0
- package/dist/providers/smartObject/useObjectSelection.js +27 -0
- package/dist/providers/smartObject/usePollingBackstop.d.ts +18 -0
- package/dist/providers/smartObject/usePollingBackstop.d.ts.map +1 -0
- package/dist/providers/smartObject/usePollingBackstop.js +38 -0
- package/dist/types/character.d.ts +21 -0
- package/dist/types/character.d.ts.map +1 -0
- package/dist/types/character.js +1 -0
- package/dist/types/contexts.d.ts +61 -0
- package/dist/types/contexts.d.ts.map +1 -0
- package/dist/types/contexts.js +6 -0
- package/dist/types/entity.d.ts +245 -0
- package/dist/types/entity.d.ts.map +1 -0
- package/dist/types/entity.js +6 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/sponsoredTransaction.d.ts +26 -0
- package/dist/types/sponsoredTransaction.d.ts.map +1 -0
- package/dist/types/sponsoredTransaction.js +10 -0
- package/dist/types/types.d.ts +110 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +41 -0
- package/dist/types/worldApiReturnTypes.d.ts +68 -0
- package/dist/types/worldApiReturnTypes.d.ts.map +1 -0
- package/dist/types/worldApiReturnTypes.js +1 -0
- package/{utils/burnRate.ts → dist/utils/burnRate.d.ts} +4 -29
- package/dist/utils/burnRate.d.ts.map +1 -0
- package/dist/utils/burnRate.js +25 -0
- package/dist/utils/characters.d.ts +26 -0
- package/dist/utils/characters.d.ts.map +1 -0
- package/dist/utils/characters.js +84 -0
- package/dist/utils/constants.d.ts +153 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +190 -0
- package/dist/utils/datahub.d.ts +40 -0
- package/dist/utils/datahub.d.ts.map +1 -0
- package/{utils/datahub.ts → dist/utils/datahub.js} +32 -25
- package/dist/utils/entity.d.ts +58 -0
- package/dist/utils/entity.d.ts.map +1 -0
- package/dist/utils/entity.js +386 -0
- package/dist/utils/errors.d.ts +18 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +128 -0
- package/dist/utils/events/entityEvents.d.ts +44 -0
- package/dist/utils/events/entityEvents.d.ts.map +1 -0
- package/dist/utils/events/entityEvents.js +95 -0
- package/dist/utils/events/entitySubscription.d.ts +30 -0
- package/dist/utils/events/entitySubscription.d.ts.map +1 -0
- package/dist/utils/events/entitySubscription.js +84 -0
- package/dist/utils/events/graphqlEventStream.d.ts +90 -0
- package/dist/utils/events/graphqlEventStream.d.ts.map +1 -0
- package/dist/utils/events/graphqlEventStream.js +198 -0
- package/dist/utils/events/refetchScheduler.d.ts +30 -0
- package/dist/utils/events/refetchScheduler.d.ts.map +1 -0
- package/dist/utils/events/refetchScheduler.js +57 -0
- package/dist/utils/events/sseClient.d.ts +42 -0
- package/dist/utils/events/sseClient.d.ts.map +1 -0
- package/dist/utils/events/sseClient.js +97 -0
- package/dist/utils/fuel.d.ts +231 -0
- package/dist/utils/fuel.d.ts.map +1 -0
- package/dist/utils/fuel.js +652 -0
- package/dist/utils/grid.d.ts +115 -0
- package/dist/utils/grid.d.ts.map +1 -0
- package/dist/utils/grid.js +115 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +22 -0
- package/dist/utils/inventory.d.ts +3 -0
- package/dist/utils/inventory.d.ts.map +1 -0
- package/dist/utils/inventory.js +12 -0
- package/dist/utils/logger.d.ts +25 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +228 -0
- package/dist/utils/mapping.d.ts +30 -0
- package/dist/utils/mapping.d.ts.map +1 -0
- package/dist/utils/mapping.js +73 -0
- package/dist/utils/mvr/worldTypes.d.ts +35 -0
- package/dist/utils/mvr/worldTypes.d.ts.map +1 -0
- package/dist/utils/mvr/worldTypes.js +54 -0
- package/dist/utils/role.d.ts +116 -0
- package/dist/utils/role.d.ts.map +1 -0
- package/dist/utils/role.js +120 -0
- package/dist/utils/smartObject.d.ts +24 -0
- package/dist/utils/smartObject.d.ts.map +1 -0
- package/dist/utils/smartObject.js +24 -0
- package/dist/utils/utils.d.ts +133 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +213 -0
- package/dist/wallet/features.d.ts +28 -0
- package/dist/wallet/features.d.ts.map +1 -0
- package/dist/wallet/features.js +22 -0
- package/dist/wallet/index.d.ts +9 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/index.js +9 -0
- package/dist/wallet/utils.d.ts +71 -0
- package/dist/wallet/utils.d.ts.map +1 -0
- package/dist/wallet/utils.js +79 -0
- package/package.json +69 -35
- package/config/dapp-kit.ts +0 -20
- package/config/index.ts +0 -1
- package/graphql/client.ts +0 -578
- package/graphql/index.ts +0 -39
- package/graphql/types.ts +0 -468
- package/hooks/index.ts +0 -15
- package/hooks/useSmartObject.ts +0 -66
- package/hooks/useSponsoredTransaction.ts +0 -442
- package/index.ts +0 -88
- package/providers/EveFrontierProvider.tsx +0 -41
- package/providers/NotificationProvider.tsx +0 -108
- package/providers/SmartObjectProvider.tsx +0 -296
- package/providers/VaultProvider.tsx +0 -108
- package/providers/index.ts +0 -10
- package/types/contexts.ts +0 -67
- package/types/global.d.ts +0 -7
- package/types/index.ts +0 -4
- package/types/sponsoredTransaction.ts +0 -70
- package/types/types.ts +0 -198
- package/types/worldApiReturnTypes.ts +0 -144
- package/utils/__tests__/burnRate.test.ts +0 -121
- package/utils/__tests__/character.test.ts +0 -112
- package/utils/__tests__/characterOwnedObjects.test.ts +0 -225
- package/utils/__tests__/config.test.ts +0 -424
- package/utils/__tests__/datahub.test.ts +0 -58
- package/utils/__tests__/logger.test.ts +0 -145
- package/utils/__tests__/mapping.test.ts +0 -439
- package/utils/__tests__/utils.test.ts +0 -299
- package/utils/character.ts +0 -46
- package/utils/characterOwnedObjects.ts +0 -53
- package/utils/config.ts +0 -151
- package/utils/constants.ts +0 -254
- package/utils/errors.ts +0 -171
- package/utils/index.ts +0 -47
- package/utils/logger.ts +0 -300
- package/utils/mapping.ts +0 -118
- package/utils/transforms.ts +0 -263
- package/utils/utils.ts +0 -270
- package/wallet/features.ts +0 -136
- package/wallet/index.ts +0 -26
- package/wallet/utils.ts +0 -117
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GraphQL queries for fetching Sui objects
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
4
|
// ============================================================================
|
|
6
5
|
// Core Object Queries
|
|
7
6
|
// ============================================================================
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
8
|
* Query for fetching a specific object by address with BCS-encoded contents
|
|
11
9
|
* Use this for low-level object access with raw BCS data
|
|
@@ -29,7 +27,6 @@ export const GET_OBJECT_BY_ADDRESS = `
|
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
`;
|
|
32
|
-
|
|
33
30
|
/**
|
|
34
31
|
* Object by address with JSON contents and dynamic fields (nodes).
|
|
35
32
|
*
|
|
@@ -62,109 +59,123 @@ export const GET_OBJECT_WITH_DYNAMIC_FIELDS = `
|
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
`;
|
|
65
|
-
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// Entity Queries
|
|
64
|
+
// ============================================================================
|
|
66
65
|
/**
|
|
67
|
-
*
|
|
66
|
+
* World entity: latest version, contents, and a page of its dynamic fields
|
|
67
|
+
* (components and action maps). Layout sections and inventory item tables
|
|
68
|
+
* nested in component values are resolved inline; `null` for other components.
|
|
68
69
|
*
|
|
69
70
|
* @category GraphQL Queries
|
|
70
71
|
*/
|
|
71
|
-
export const
|
|
72
|
-
query
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
contents { bcs json }
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
72
|
+
export const GET_ENTITY = `
|
|
73
|
+
query GetEntity($address: SuiAddress!, $cursor: String, $table_first: Int!) {
|
|
74
|
+
latestVersion: objectVersions(last: 1, address: $address) {
|
|
75
|
+
nodes { version }
|
|
76
|
+
}
|
|
77
|
+
object(address: $address) {
|
|
78
|
+
asMoveObject {
|
|
79
|
+
contents { type { repr } json }
|
|
80
|
+
}
|
|
81
|
+
dynamicFields(after: $cursor) {
|
|
82
|
+
pageInfo { hasNextPage endCursor }
|
|
83
|
+
nodes {
|
|
84
|
+
contents {
|
|
85
|
+
name: extract(path: "name") { type { repr } json }
|
|
86
|
+
value: extract(path: "value") {
|
|
87
|
+
type { repr }
|
|
88
|
+
json
|
|
89
|
+
sections: extract(path: "inner.sections.id") {
|
|
90
|
+
asAddress {
|
|
91
|
+
addressAt {
|
|
92
|
+
dynamicFields(first: $table_first) {
|
|
93
|
+
pageInfo { hasNextPage endCursor }
|
|
94
|
+
nodes {
|
|
95
|
+
name { type { repr } json }
|
|
96
|
+
value { ... on MoveValue { type { repr } json } }
|
|
104
97
|
}
|
|
105
98
|
}
|
|
106
99
|
}
|
|
107
100
|
}
|
|
108
101
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
destinationGate: extract(path: "linked_gate_id") {
|
|
122
|
-
asAddress {
|
|
123
|
-
asObject {
|
|
124
|
-
asMoveObject {
|
|
125
|
-
contents { bcs json }
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
dynamicFields {
|
|
132
|
-
nodes {
|
|
133
|
-
contents {
|
|
134
|
-
json
|
|
135
|
-
extract(path: "id") {
|
|
136
|
-
asAddress {
|
|
137
|
-
asObject {
|
|
138
|
-
asMoveObject {
|
|
139
|
-
contents { bcs json }
|
|
102
|
+
items: extract(path: "inner.items.balances.id") {
|
|
103
|
+
asAddress {
|
|
104
|
+
addressAt {
|
|
105
|
+
dynamicFields(first: $table_first) {
|
|
106
|
+
pageInfo { hasNextPage endCursor }
|
|
107
|
+
nodes {
|
|
108
|
+
name { type { repr } json }
|
|
109
|
+
value { ... on MoveValue { type { repr } json } }
|
|
110
|
+
}
|
|
140
111
|
}
|
|
112
|
+
}
|
|
141
113
|
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
name {
|
|
146
|
-
json
|
|
147
|
-
type {
|
|
148
|
-
repr
|
|
149
114
|
}
|
|
150
115
|
}
|
|
151
116
|
}
|
|
152
117
|
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`;
|
|
122
|
+
/**
|
|
123
|
+
* One page of a Move table's entries (the dynamic fields of its UID).
|
|
124
|
+
*
|
|
125
|
+
* @category GraphQL Queries
|
|
126
|
+
*/
|
|
127
|
+
export const GET_TABLE_ENTRIES = `
|
|
128
|
+
query GetTableEntries($address: SuiAddress!, $first: Int!, $after: String) {
|
|
129
|
+
address(address: $address) {
|
|
130
|
+
dynamicFields(first: $first, after: $after) {
|
|
131
|
+
pageInfo { hasNextPage endCursor }
|
|
132
|
+
nodes {
|
|
133
|
+
name { type { repr } json }
|
|
134
|
+
value { ... on MoveValue { type { repr } json } }
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
140
|
+
/**
|
|
141
|
+
* Latest version of an object; a cheap change check before a full fetch.
|
|
142
|
+
*
|
|
143
|
+
* @category GraphQL Queries
|
|
144
|
+
*/
|
|
145
|
+
export const GET_OBJECT_LATEST_VERSION = `
|
|
146
|
+
query GetObjectLatestVersion($address: SuiAddress!) {
|
|
147
|
+
latestVersion: objectVersions(last: 1, address: $address) {
|
|
148
|
+
nodes { version }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`;
|
|
152
|
+
/**
|
|
153
|
+
* Owner of an object. Objects transferred to another object's id (e.g. an
|
|
154
|
+
* AccessCap parked on a Character) report an AddressOwner of that object's id.
|
|
155
|
+
*
|
|
156
|
+
* @category GraphQL Queries
|
|
157
|
+
*/
|
|
158
|
+
export const GET_OBJECT_OWNER = `
|
|
159
|
+
query GetObjectOwner($address: SuiAddress!) {
|
|
160
|
+
object(address: $address) {
|
|
161
|
+
owner {
|
|
162
|
+
__typename
|
|
163
|
+
... on AddressOwner { address { address } }
|
|
164
|
+
... on ObjectOwner { address { address } }
|
|
165
|
+
}
|
|
153
166
|
}
|
|
154
167
|
}
|
|
155
|
-
}
|
|
156
168
|
`;
|
|
157
|
-
|
|
158
169
|
// ============================================================================
|
|
159
170
|
// Owner & Ownership Queries
|
|
160
171
|
// ============================================================================
|
|
161
|
-
|
|
162
172
|
/**
|
|
163
173
|
* Query to get an object's owner and their owned objects of a specific type
|
|
164
174
|
* Useful for finding related objects (e.g., getting a character's assemblies)
|
|
165
175
|
* Returns BCS-encoded data only
|
|
166
176
|
*
|
|
167
177
|
* @category GraphQL Queries
|
|
178
|
+
* @deprecated Walks `object.owner`, which is empty for shared `Entity` objects. Find a wallet's entities with `getOwnedObjectsByType` on the `AccessCap` type instead.
|
|
168
179
|
*/
|
|
169
180
|
export const GET_OBJECT_OWNER_AND_OWNED_OBJECTS_BY_TYPE = `
|
|
170
181
|
query GetObjectOwnerAndOwnedObjectByType($object: SuiAddress!, $owned_object_type: String) {
|
|
@@ -195,12 +206,12 @@ export const GET_OBJECT_OWNER_AND_OWNED_OBJECTS_BY_TYPE = `
|
|
|
195
206
|
}
|
|
196
207
|
}
|
|
197
208
|
`;
|
|
198
|
-
|
|
199
209
|
/**
|
|
200
210
|
* Query to get an object's owner and their owned objects of a specific type
|
|
201
211
|
* Returns both BCS and JSON-decoded data for easier consumption
|
|
202
212
|
*
|
|
203
213
|
* @category GraphQL Queries
|
|
214
|
+
* @deprecated Walks `object.owner`, which is empty for shared `Entity` objects. Find a wallet's entities with `getOwnedObjectsByType` on the `AccessCap` type instead.
|
|
204
215
|
*/
|
|
205
216
|
export const GET_OBJECT_OWNER_AND_OWNED_OBJECTS_WITH_JSON = `
|
|
206
217
|
query GetObjectOwnerAndOwnedObjectWithJson($object: SuiAddress!, $owned_object_type: String) {
|
|
@@ -233,7 +244,6 @@ export const GET_OBJECT_OWNER_AND_OWNED_OBJECTS_WITH_JSON = `
|
|
|
233
244
|
}
|
|
234
245
|
}
|
|
235
246
|
`;
|
|
236
|
-
|
|
237
247
|
/**
|
|
238
248
|
* Query to get full object details with JSON contents
|
|
239
249
|
* Used to fetch character details after getting the character ID from OwnerCap
|
|
@@ -258,7 +268,6 @@ export const GET_OBJECT_WITH_JSON = `
|
|
|
258
268
|
}
|
|
259
269
|
}
|
|
260
270
|
`;
|
|
261
|
-
|
|
262
271
|
/**
|
|
263
272
|
* Query to get all objects of a specific type owned by an address
|
|
264
273
|
* Returns object addresses only (lightweight)
|
|
@@ -280,7 +289,6 @@ export const GET_OWNED_OBJECTS_BY_TYPE = `
|
|
|
280
289
|
}
|
|
281
290
|
}
|
|
282
291
|
`;
|
|
283
|
-
|
|
284
292
|
/**
|
|
285
293
|
* Query for fetching objects owned by an address filtered by package
|
|
286
294
|
* Returns full object data with dynamic fields
|
|
@@ -323,115 +331,41 @@ export const GET_OWNED_OBJECTS_BY_PACKAGE = `
|
|
|
323
331
|
}
|
|
324
332
|
}
|
|
325
333
|
`;
|
|
326
|
-
|
|
327
334
|
// ============================================================================
|
|
328
|
-
//
|
|
335
|
+
// Event Queries
|
|
329
336
|
// ============================================================================
|
|
330
|
-
|
|
331
337
|
/**
|
|
332
|
-
* Query to get
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
* @category GraphQL Queries
|
|
336
|
-
*/
|
|
337
|
-
export const GET_WALLET_CHARACTERS = `
|
|
338
|
-
query GetWalletCharacters($owner: SuiAddress!, $characterPlayerProfileType: String!) {
|
|
339
|
-
address(
|
|
340
|
-
address: $owner
|
|
341
|
-
) {
|
|
342
|
-
objects(
|
|
343
|
-
last: 1
|
|
344
|
-
filter: {
|
|
345
|
-
type: $characterPlayerProfileType
|
|
346
|
-
}
|
|
347
|
-
) {
|
|
348
|
-
nodes {
|
|
349
|
-
contents {
|
|
350
|
-
extract(path: "character_id") {
|
|
351
|
-
asAddress {
|
|
352
|
-
asObject {
|
|
353
|
-
asMoveObject {
|
|
354
|
-
contents {
|
|
355
|
-
type {
|
|
356
|
-
repr
|
|
357
|
-
}
|
|
358
|
-
json
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
`;
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Query to get character owned by a wallet and objects owned by the character
|
|
373
|
-
* Returns the character and objects owned by the character
|
|
338
|
+
* Query to get events of a Move event type, oldest first.
|
|
339
|
+
* Use with caution - may return many results
|
|
374
340
|
*
|
|
375
341
|
* @category GraphQL Queries
|
|
376
342
|
*/
|
|
377
|
-
export const
|
|
378
|
-
query
|
|
379
|
-
|
|
380
|
-
|
|
343
|
+
export const GET_EVENTS_BY_TYPE = `
|
|
344
|
+
query GetEventsByType($event_type: String, $first: Int, $after: String) {
|
|
345
|
+
events(
|
|
346
|
+
filter: {
|
|
347
|
+
type: $event_type
|
|
348
|
+
}
|
|
349
|
+
first: $first
|
|
350
|
+
after: $after
|
|
381
351
|
) {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
) {
|
|
388
|
-
nodes {
|
|
389
|
-
contents {
|
|
390
|
-
extract(path: "character_id") {
|
|
391
|
-
asAddress {
|
|
392
|
-
asObject {
|
|
393
|
-
asMoveObject {
|
|
394
|
-
contents {
|
|
395
|
-
type {
|
|
396
|
-
repr
|
|
397
|
-
}
|
|
398
|
-
json
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
objects {
|
|
403
|
-
nodes {
|
|
404
|
-
contents {
|
|
405
|
-
extract(path: "authorized_object_id") {
|
|
406
|
-
asAddress {
|
|
407
|
-
asObject {
|
|
408
|
-
asMoveObject {
|
|
409
|
-
contents {
|
|
410
|
-
type {
|
|
411
|
-
repr
|
|
412
|
-
}
|
|
413
|
-
json
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
352
|
+
nodes {
|
|
353
|
+
sequenceNumber
|
|
354
|
+
timestamp
|
|
355
|
+
contents {
|
|
356
|
+
json
|
|
426
357
|
}
|
|
358
|
+
}
|
|
359
|
+
pageInfo {
|
|
360
|
+
hasNextPage
|
|
361
|
+
endCursor
|
|
362
|
+
}
|
|
427
363
|
}
|
|
428
|
-
}
|
|
364
|
+
}
|
|
429
365
|
`;
|
|
430
|
-
|
|
431
366
|
// ============================================================================
|
|
432
367
|
// Singleton & Type-based Queries
|
|
433
368
|
// ============================================================================
|
|
434
|
-
|
|
435
369
|
/**
|
|
436
370
|
* Query to get a singleton object by its type
|
|
437
371
|
* Returns the first object of the specified type (useful for global/singleton objects)
|
|
@@ -452,50 +386,6 @@ export const GET_SINGLETON_OBJECT_BY_TYPE = `
|
|
|
452
386
|
}
|
|
453
387
|
}
|
|
454
388
|
`;
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Query to get a singleton config object by its type
|
|
458
|
-
*
|
|
459
|
-
* @category GraphQL Queries
|
|
460
|
-
*/
|
|
461
|
-
export const GET_SINGLETON_CONFIG_OBJECT_BY_TYPE = `
|
|
462
|
-
query GetSingletonConfigObjectByType($object_type: String!, $table_name: String!) {
|
|
463
|
-
objects(filter: { type: $object_type }, first: 1) {
|
|
464
|
-
nodes {
|
|
465
|
-
address
|
|
466
|
-
asMoveObject {
|
|
467
|
-
contents {
|
|
468
|
-
extract(path: $table_name) {
|
|
469
|
-
extract(path: "id") {
|
|
470
|
-
asAddress {
|
|
471
|
-
addressAt {
|
|
472
|
-
dynamicFields {
|
|
473
|
-
pageInfo {
|
|
474
|
-
hasNextPage
|
|
475
|
-
endCursor
|
|
476
|
-
}
|
|
477
|
-
nodes {
|
|
478
|
-
key: name {
|
|
479
|
-
json
|
|
480
|
-
}
|
|
481
|
-
value: value {
|
|
482
|
-
... on MoveValue {
|
|
483
|
-
json
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
`;
|
|
498
|
-
|
|
499
389
|
/**
|
|
500
390
|
* Query to get all objects of a specific type (global search)
|
|
501
391
|
* Use with caution - may return many results
|