@evefrontier/dapp-kit 0.1.2 → 0.1.3

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.
Files changed (211) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/docs/api/assets/hierarchy.js +1 -1
  3. package/docs/api/assets/navigation.js +1 -1
  4. package/docs/api/assets/search.js +1 -1
  5. package/docs/api/classes/WalletNoAccountSelectedError.html +3 -3
  6. package/docs/api/classes/WalletNotConnectedError.html +3 -3
  7. package/docs/api/classes/WalletSponsoredTransactionNotSupportedError.html +3 -3
  8. package/docs/api/enums/ActionTypes.html +2 -2
  9. package/docs/api/enums/Assemblies.html +3 -2
  10. package/docs/api/enums/QueryParams.html +2 -2
  11. package/docs/api/enums/Severity.html +2 -2
  12. package/docs/api/enums/SponsoredTransactionActions.html +3 -3
  13. package/docs/api/enums/State.html +2 -2
  14. package/docs/api/enums/SupportedWallets.html +2 -2
  15. package/docs/api/enums/TYPEIDS.html +3 -3
  16. package/docs/api/functions/EveFrontierProvider.html +2 -2
  17. package/docs/api/functions/NotificationProvider.html +2 -2
  18. package/docs/api/functions/SmartObjectProvider.html +4 -4
  19. package/docs/api/functions/VaultProvider.html +1 -1
  20. package/docs/api/functions/abbreviateAddress.html +2 -2
  21. package/docs/api/functions/assertAssemblyType.html +2 -2
  22. package/docs/api/functions/clickToCopy.html +1 -1
  23. package/docs/api/functions/executeGraphQLQuery.html +2 -2
  24. package/docs/api/functions/findOwnerByAddress.html +2 -2
  25. package/docs/api/functions/formatDuration.html +2 -2
  26. package/docs/api/functions/formatM3.html +2 -2
  27. package/docs/api/functions/getAdjustedBurnRate.html +6 -0
  28. package/docs/api/functions/getAssemblyType.html +2 -2
  29. package/docs/api/functions/getAssemblyTypeApiString.html +2 -2
  30. package/docs/api/functions/getAssemblyWithOwner.html +3 -3
  31. package/docs/api/functions/getCharacterAndOwnedObjects.html +3 -0
  32. package/docs/api/functions/getCharacterOwnedObjects.html +5 -0
  33. package/docs/api/functions/getCharacterOwnedObjectsJson.html +5 -0
  34. package/docs/api/functions/getCharacterOwnerCapType.html +2 -2
  35. package/docs/api/functions/getCharacterPlayerProfileType.html +3 -0
  36. package/docs/api/functions/getCommonItems.html +1 -1
  37. package/docs/api/functions/getDappUrl.html +2 -2
  38. package/docs/api/functions/getDatahubGameInfo.html +2 -2
  39. package/docs/api/functions/getEnergyConfig.html +4 -0
  40. package/docs/api/functions/getEnergyConfigType.html +3 -0
  41. package/docs/api/functions/getEnergyUsageForType.html +5 -0
  42. package/docs/api/functions/getEnv.html +1 -1
  43. package/docs/api/functions/getEveWorldPackageId.html +2 -2
  44. package/docs/api/functions/getFuelEfficiencyConfig.html +4 -0
  45. package/docs/api/functions/getFuelEfficiencyConfigType.html +3 -0
  46. package/docs/api/functions/getFuelEfficiencyForType.html +5 -0
  47. package/docs/api/functions/getObjectByAddress.html +2 -2
  48. package/docs/api/functions/getObjectId.html +2 -2
  49. package/docs/api/functions/getObjectOwnerAndOwnedObjectsByType.html +2 -2
  50. package/docs/api/functions/getObjectOwnerAndOwnedObjectsWithJson.html +7 -0
  51. package/docs/api/functions/getObjectRegistryType.html +2 -2
  52. package/docs/api/functions/getObjectWithDynamicFields.html +2 -2
  53. package/docs/api/functions/getObjectWithJson.html +2 -2
  54. package/docs/api/functions/getObjectsByType.html +2 -2
  55. package/docs/api/functions/getOwnedObjectsByPackage.html +2 -2
  56. package/docs/api/functions/getOwnedObjectsByType.html +2 -2
  57. package/docs/api/functions/getRegistryAddress.html +2 -2
  58. package/docs/api/functions/getSingletonObjectByType.html +2 -2
  59. package/docs/api/functions/getSponsoredTransactionFeature.html +2 -2
  60. package/docs/api/functions/getSuiGraphqlEndpoint.html +2 -2
  61. package/docs/api/functions/getTxUrl.html +2 -2
  62. package/docs/api/functions/getVolumeM3.html +2 -2
  63. package/docs/api/functions/getWalletCharacters.html +3 -0
  64. package/docs/api/functions/hasSponsoredTransactionFeature.html +2 -2
  65. package/docs/api/functions/isOwner.html +3 -3
  66. package/docs/api/functions/parseCharacterFromJson.html +5 -0
  67. package/docs/api/functions/parseErrorFromMessage.html +1 -1
  68. package/docs/api/functions/parseStatus.html +2 -2
  69. package/docs/api/functions/parseURL.html +1 -1
  70. package/docs/api/functions/removeTrailingZeros.html +1 -1
  71. package/docs/api/functions/transformToAssembly.html +2 -2
  72. package/docs/api/functions/transformToCharacter.html +2 -2
  73. package/docs/api/functions/useConnection.html +2 -2
  74. package/docs/api/functions/useNotification.html +2 -2
  75. package/docs/api/functions/useSmartObject.html +2 -2
  76. package/docs/api/functions/useSponsoredTransaction.html +2 -2
  77. package/docs/api/functions/walletSupportsSponsoredTransaction.html +2 -2
  78. package/docs/api/hierarchy.html +1 -1
  79. package/docs/api/index.html +2 -2
  80. package/docs/api/interfaces/AddressOwner.html +2 -2
  81. package/docs/api/interfaces/AddressOwnerWithJson.html +2 -2
  82. package/docs/api/interfaces/AddressWithObjects.html +3 -0
  83. package/docs/api/interfaces/AdjustedBurnRate.html +8 -0
  84. package/docs/api/interfaces/AsMoveObjectRef.html +3 -0
  85. package/docs/api/interfaces/AssemblyProperties.html +6 -3
  86. package/docs/api/interfaces/CharacterAndOwnedObjectsNode.html +2 -0
  87. package/docs/api/interfaces/CharacterInfo.html +3 -3
  88. package/docs/api/interfaces/CharacterOwnerNode.html +3 -0
  89. package/docs/api/interfaces/ConfigExtractDynamicFieldNode.html +3 -0
  90. package/docs/api/interfaces/ContentsBcs.html +2 -0
  91. package/docs/api/interfaces/ContentsJsonAndBcs.html +3 -0
  92. package/docs/api/interfaces/ContentsJsonOnly.html +3 -0
  93. package/docs/api/interfaces/ContentsTypeAndBcs.html +3 -0
  94. package/docs/api/interfaces/ContentsTypeJsonAndBcs.html +4 -0
  95. package/docs/api/interfaces/DatahubGameInfo.html +14 -16
  96. package/docs/api/interfaces/DetailedAssemblyResponse.html +6 -3
  97. package/docs/api/interfaces/DetailedSmartCharacterResponse.html +2 -2
  98. package/docs/api/interfaces/DynamicFieldNode.html +2 -2
  99. package/docs/api/interfaces/EphemeralInventory.html +2 -2
  100. package/docs/api/interfaces/EveFrontierSponsoredTransactionFeature.html +3 -3
  101. package/docs/api/interfaces/ExtractAsMoveObjectNode.html +4 -0
  102. package/docs/api/interfaces/GateModule.html +2 -5
  103. package/docs/api/interfaces/GetCharacterAndOwnedObjectsResponse.html +2 -0
  104. package/docs/api/interfaces/GetObjectAndCharacterOwnerResponse.html +2 -0
  105. package/docs/api/interfaces/GetObjectByAddressResponse.html +2 -2
  106. package/docs/api/interfaces/GetObjectOwnerAndOwnedObjectsResponse.html +2 -2
  107. package/docs/api/interfaces/GetObjectOwnerAndOwnedObjectsWithJsonResponse.html +2 -2
  108. package/docs/api/interfaces/GetObjectResponse.html +2 -2
  109. package/docs/api/interfaces/GetObjectWithJsonResponse.html +2 -2
  110. package/docs/api/interfaces/GetObjectsByTypeResponse.html +2 -2
  111. package/docs/api/interfaces/GetOwnedObjectsByPackageResponse.html +2 -2
  112. package/docs/api/interfaces/GetOwnedObjectsByTypeResponse.html +2 -2
  113. package/docs/api/interfaces/GetSingletonConfigObjectByTypeResponse.html +2 -0
  114. package/docs/api/interfaces/GetSingletonObjectByTypeResponse.html +2 -2
  115. package/docs/api/interfaces/GetWalletCharactersResponse.html +2 -0
  116. package/docs/api/interfaces/GraphQLResponse.html +2 -2
  117. package/docs/api/interfaces/InventoryItem.html +2 -2
  118. package/docs/api/interfaces/ManufacturingModule.html +1 -2
  119. package/docs/api/interfaces/MoveObjectContents.html +2 -2
  120. package/docs/api/interfaces/MoveObjectData.html +2 -2
  121. package/docs/api/interfaces/NetworkNodeModule.html +2 -2
  122. package/docs/api/interfaces/NotificationContextType.html +2 -2
  123. package/docs/api/interfaces/NotificationState.html +2 -2
  124. package/docs/api/interfaces/Notify.html +2 -2
  125. package/docs/api/interfaces/ObjectNodes.html +2 -0
  126. package/docs/api/interfaces/ObjectWithContentsNode.html +2 -2
  127. package/docs/api/interfaces/OwnedObjectAddressNode.html +2 -2
  128. package/docs/api/interfaces/OwnedObjectFullNode.html +2 -2
  129. package/docs/api/interfaces/OwnedObjectNode.html +2 -2
  130. package/docs/api/interfaces/OwnedObjectNodeWithJson.html +2 -2
  131. package/docs/api/interfaces/OwnerCapData.html +3 -3
  132. package/docs/api/interfaces/PageInfo.html +2 -2
  133. package/docs/api/interfaces/PreviousTransaction.html +2 -0
  134. package/docs/api/interfaces/RawCharacterData.html +3 -3
  135. package/docs/api/interfaces/RawSuiObjectData.html +8 -8
  136. package/docs/api/interfaces/RefineryModule.html +1 -2
  137. package/docs/api/interfaces/SmartAssemblyResponse.html +6 -2
  138. package/docs/api/interfaces/SmartObjectContextType.html +4 -4
  139. package/docs/api/interfaces/SponsoredTransactionInput.html +6 -6
  140. package/docs/api/interfaces/SponsoredTransactionOutput.html +5 -5
  141. package/docs/api/interfaces/StorageModule.html +2 -3
  142. package/docs/api/interfaces/SuiObjectResponse.html +2 -2
  143. package/docs/api/interfaces/TransformOptions.html +7 -5
  144. package/docs/api/interfaces/TurretModule.html +1 -2
  145. package/docs/api/interfaces/TypeRepr.html +2 -0
  146. package/docs/api/interfaces/TypeReprWithLayout.html +3 -0
  147. package/docs/api/interfaces/VaultContextType.html +3 -3
  148. package/docs/api/modules.html +1 -1
  149. package/docs/api/types/AssemblyType.html +1 -1
  150. package/docs/api/types/ContentsTypeAndJson.html +2 -0
  151. package/docs/api/types/ErrorType.html +2 -2
  152. package/docs/api/types/MoveObjectRefWithJson.html +2 -0
  153. package/docs/api/types/SendSponsoredTransactionFn.html +1 -1
  154. package/docs/api/types/SponsoredTransactionArgs.html +2 -2
  155. package/docs/api/types/SponsoredTransactionAssemblyType.html +2 -2
  156. package/docs/api/types/SponsoredTransactionMethod.html +2 -2
  157. package/docs/api/types/UseSponsoredTransactionArgs.html +2 -2
  158. package/docs/api/types/UseSponsoredTransactionError.html +2 -2
  159. package/docs/api/types/UseSponsoredTransactionMutationOptions.html +2 -2
  160. package/docs/api/variables/ASSEMBLY_TYPE_API_STRING.html +2 -2
  161. package/docs/api/variables/ERRORS.html +1 -1
  162. package/docs/api/variables/ERROR_MESSAGES.html +1 -1
  163. package/docs/api/variables/EVEFRONTIER_SPONSORED_TRANSACTION.html +2 -2
  164. package/docs/api/variables/EXCLUDED_TYPEIDS.html +1 -1
  165. package/docs/api/variables/GET_OBJECTS_BY_TYPE.html +2 -2
  166. package/docs/api/variables/GET_OBJECT_BY_ADDRESS.html +2 -2
  167. package/docs/api/variables/GET_OBJECT_OWNER_AND_OWNED_OBJECTS_BY_TYPE.html +2 -2
  168. package/docs/api/variables/GET_OBJECT_OWNER_AND_OWNED_OBJECTS_WITH_JSON.html +2 -2
  169. package/docs/api/variables/GET_OBJECT_WITH_DYNAMIC_FIELDS.html +2 -2
  170. package/docs/api/variables/GET_OBJECT_WITH_JSON.html +2 -2
  171. package/docs/api/variables/GET_OWNED_OBJECTS_BY_PACKAGE.html +2 -2
  172. package/docs/api/variables/GET_OWNED_OBJECTS_BY_TYPE.html +2 -2
  173. package/docs/api/variables/GET_SINGLETON_CONFIG_OBJECT_BY_TYPE.html +2 -0
  174. package/docs/api/variables/GET_SINGLETON_OBJECT_BY_TYPE.html +2 -2
  175. package/docs/api/variables/GET_WALLET_CHARACTERS.html +3 -0
  176. package/docs/api/variables/NotificationContext.html +1 -1
  177. package/docs/api/variables/ONE_M3.html +2 -2
  178. package/docs/api/variables/POLLING_INTERVAL.html +2 -2
  179. package/docs/api/variables/STORAGE_KEYS.html +2 -2
  180. package/docs/api/variables/SmartObjectContext.html +1 -1
  181. package/docs/api/variables/VaultContext.html +1 -1
  182. package/docs/api/variables/dAppKit.html +2 -2
  183. package/graphql/client.ts +96 -24
  184. package/graphql/index.ts +5 -39
  185. package/graphql/queries.ts +157 -1
  186. package/graphql/types.ts +188 -155
  187. package/hooks/index.ts +1 -0
  188. package/index.ts +7 -71
  189. package/package.json +1 -1
  190. package/providers/SmartObjectProvider.tsx +17 -17
  191. package/types/contexts.ts +1 -1
  192. package/types/sponsoredTransaction.ts +1 -0
  193. package/types/types.ts +52 -10
  194. package/types/worldApiReturnTypes.ts +13 -37
  195. package/utils/__tests__/burnRate.test.ts +121 -0
  196. package/utils/__tests__/character.test.ts +112 -0
  197. package/utils/__tests__/characterOwnedObjects.test.ts +222 -0
  198. package/utils/__tests__/config.test.ts +424 -0
  199. package/utils/__tests__/mapping.test.ts +2 -2
  200. package/utils/burnRate.ts +46 -0
  201. package/utils/character.ts +46 -0
  202. package/utils/characterOwnedObjects.ts +52 -0
  203. package/utils/config.ts +151 -0
  204. package/utils/constants.ts +39 -5
  205. package/utils/datahub.ts +3 -41
  206. package/utils/errors.ts +1 -1
  207. package/utils/index.ts +10 -1
  208. package/utils/mapping.ts +5 -2
  209. package/utils/transforms.ts +27 -31
  210. package/wallet/features.ts +5 -0
  211. package/docs/api/interfaces/GameTypeResponse.html +0 -13
package/graphql/index.ts CHANGED
@@ -12,7 +12,9 @@ export {
12
12
  getSingletonObjectByType,
13
13
  getObjectsByType,
14
14
  // Character/owner resolution
15
+ getWalletCharacters,
15
16
  getAssemblyWithOwner,
17
+ getCharacterAndOwnedObjects,
16
18
  } from "./client";
17
19
 
18
20
  // Query Strings
@@ -26,48 +28,12 @@ export {
26
28
  GET_OBJECT_OWNER_AND_OWNED_OBJECTS_WITH_JSON,
27
29
  GET_OWNED_OBJECTS_BY_TYPE,
28
30
  GET_OWNED_OBJECTS_BY_PACKAGE,
31
+ GET_WALLET_CHARACTERS,
29
32
  // Singleton & type-based queries
30
33
  GET_SINGLETON_OBJECT_BY_TYPE,
34
+ GET_SINGLETON_CONFIG_OBJECT_BY_TYPE,
31
35
  GET_OBJECTS_BY_TYPE,
32
36
  } from "./queries";
33
37
 
34
38
  // Types
35
- export type {
36
- // Base types
37
- GraphQLResponse,
38
- PageInfo,
39
- // Move object types
40
- MoveObjectContents,
41
- DynamicFieldNode,
42
- MoveObjectData,
43
- // Object response types
44
- SuiObjectResponse,
45
- GetObjectResponse,
46
- // GetObjectByAddress types
47
- GetObjectByAddressResponse,
48
- // GetObjectWithJson types
49
- GetObjectWithJsonResponse,
50
- // Owner & owned objects types
51
- OwnedObjectNode,
52
- AddressOwner,
53
- GetObjectOwnerAndOwnedObjectsResponse,
54
- // Owner & owned objects with JSON types
55
- OwnedObjectNodeWithJson,
56
- AddressOwnerWithJson,
57
- GetObjectOwnerAndOwnedObjectsWithJsonResponse,
58
- // GetOwnedObjectsByType types
59
- OwnedObjectAddressNode,
60
- GetOwnedObjectsByTypeResponse,
61
- // GetOwnedObjectsByPackage types
62
- OwnedObjectFullNode,
63
- GetOwnedObjectsByPackageResponse,
64
- // Singleton & type-based types
65
- GetSingletonObjectByTypeResponse,
66
- ObjectWithContentsNode,
67
- GetObjectsByTypeResponse,
68
- // EVE Frontier specific types
69
- RawSuiObjectData,
70
- OwnerCapData,
71
- RawCharacterData,
72
- CharacterInfo,
73
- } from "./types";
39
+ export * from "./types";
@@ -73,7 +73,7 @@ export const GET_OBJECT_WITH_DYNAMIC_FIELDS = `
73
73
  * @category GraphQL
74
74
  */
75
75
  export const GET_OBJECT_DYNAMICFIELD_CHARACTER_WITH_JSON = `
76
- query GetObjectOwnerCharacterOwnerAndInventory0(
76
+ query GetObjectOwnerCharacterOwnerAndInventory(
77
77
  $objectId: SuiAddress!
78
78
  $characterOwnerType: String!
79
79
  ) {
@@ -122,6 +122,15 @@ query GetObjectOwnerCharacterOwnerAndInventory0(
122
122
  }
123
123
  }
124
124
  }
125
+ destinationGate: extract(path: "linked_gate_id") {
126
+ asAddress {
127
+ asObject {
128
+ asMoveObject {
129
+ contents { bcs json }
130
+ }
131
+ }
132
+ }
133
+ }
125
134
  }
126
135
  dynamicFields {
127
136
  nodes {
@@ -319,6 +328,110 @@ export const GET_OWNED_OBJECTS_BY_PACKAGE = `
319
328
  }
320
329
  `;
321
330
 
331
+ // ============================================================================
332
+ // Character Queries
333
+ // ============================================================================
334
+
335
+ /**
336
+ * Query to get all characters owned by a wallet
337
+ * Returns the characters owned by the wallet
338
+ *
339
+ * @category GraphQL
340
+ */
341
+ export const GET_WALLET_CHARACTERS = `
342
+ query GetWalletCharacters($owner: SuiAddress!, $characterPlayerProfileType: String!) {
343
+ address(
344
+ address: $owner
345
+ ) {
346
+ objects(
347
+ last: 1
348
+ filter: {
349
+ type: $characterPlayerProfileType
350
+ }
351
+ ) {
352
+ nodes {
353
+ contents {
354
+ extract(path: "character_id") {
355
+ asAddress {
356
+ asObject {
357
+ asMoveObject {
358
+ contents {
359
+ type {
360
+ repr
361
+ }
362
+ json
363
+ }
364
+ }
365
+ }
366
+ }
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
372
+ }
373
+ `;
374
+
375
+ /**
376
+ * Query to get character owned by a wallet and objects owned by the character
377
+ * Returns the character and objects owned by the character
378
+ *
379
+ * @category GraphQL
380
+ */
381
+ export const GET_CHARACTER_AND_OWNED_OBJECTS = `
382
+ query GetCharacterAndOwnedObjects($owner: SuiAddress!, $characterPlayerProfileType: String!) {
383
+ address(
384
+ address: $owner
385
+ ) {
386
+ objects(
387
+ last: 1
388
+ filter: {
389
+ type: $characterPlayerProfileType
390
+ }
391
+ ) {
392
+ nodes {
393
+ contents {
394
+ extract(path: "character_id") {
395
+ asAddress {
396
+ asObject {
397
+ asMoveObject {
398
+ contents {
399
+ type {
400
+ repr
401
+ }
402
+ json
403
+ }
404
+ }
405
+ }
406
+ objects {
407
+ nodes {
408
+ contents {
409
+ extract(path: "authorized_object_id") {
410
+ asAddress {
411
+ asObject {
412
+ asMoveObject {
413
+ contents {
414
+ type {
415
+ repr
416
+ }
417
+ json
418
+ }
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }
428
+ }
429
+ }
430
+ }
431
+ }
432
+ }
433
+ `;
434
+
322
435
  // ============================================================================
323
436
  // Singleton & Type-based Queries
324
437
  // ============================================================================
@@ -344,6 +457,49 @@ export const GET_SINGLETON_OBJECT_BY_TYPE = `
344
457
  }
345
458
  `;
346
459
 
460
+ /**
461
+ * Query to get a singleton config object by its type
462
+ *
463
+ * @category GraphQL
464
+ */
465
+ export const GET_SINGLETON_CONFIG_OBJECT_BY_TYPE = `
466
+ query GetSingletonConfigObjectByType($object_type: String!, $table_name: String!) {
467
+ objects(filter: { type: $object_type }, first: 1) {
468
+ nodes {
469
+ address
470
+ asMoveObject {
471
+ contents {
472
+ extract(path: $table_name) {
473
+ extract(path: "id") {
474
+ asAddress {
475
+ addressAt {
476
+ dynamicFields {
477
+ pageInfo {
478
+ hasNextPage
479
+ endCursor
480
+ }
481
+ nodes {
482
+ key: name {
483
+ json
484
+ }
485
+ value: value {
486
+ ... on MoveValue {
487
+ json
488
+ }
489
+ }
490
+ }
491
+ }
492
+ }
493
+ }
494
+ }
495
+ }
496
+ }
497
+ }
498
+ }
499
+ }
500
+ }
501
+ `;
502
+
347
503
  /**
348
504
  * Query to get all objects of a specific type (global search)
349
505
  * Use with caution - may return many results
package/graphql/types.ts CHANGED
@@ -9,9 +9,7 @@
9
9
  /** @category GraphQL */
10
10
  export interface GraphQLResponse<T = unknown> {
11
11
  data?: T;
12
- errors?: Array<{
13
- message: string;
14
- }>;
12
+ errors?: Array<{ message: string }>;
15
13
  }
16
14
 
17
15
  /** @category GraphQL */
@@ -20,6 +18,104 @@ export interface PageInfo {
20
18
  endCursor: string | null;
21
19
  }
22
20
 
21
+ // ============================================================================
22
+ // Shared building blocks (reused across response types)
23
+ // ============================================================================
24
+
25
+ /** @category GraphQL */
26
+ export interface TypeRepr {
27
+ repr: string;
28
+ }
29
+
30
+ /** @category GraphQL */
31
+ export interface TypeReprWithLayout extends TypeRepr {
32
+ layout?: string;
33
+ }
34
+
35
+ /** @category GraphQL */
36
+ export interface ContentsBcs {
37
+ bcs: string;
38
+ }
39
+
40
+ /** @category GraphQL */
41
+ export interface ContentsTypeAndBcs extends ContentsBcs {
42
+ type: TypeRepr;
43
+ }
44
+
45
+ /** @category GraphQL */
46
+ export interface ContentsJsonAndBcs extends ContentsBcs {
47
+ json: Record<string, unknown>;
48
+ }
49
+
50
+ /** @category GraphQL */
51
+ export interface ContentsTypeJsonAndBcs extends ContentsJsonAndBcs {
52
+ type: TypeRepr;
53
+ }
54
+
55
+ /** Contents with type + json only (no bcs). Reuses ContentsTypeJsonAndBcs shape.
56
+ * @category GraphQL
57
+ */
58
+ export type ContentsTypeAndJson = Pick<ContentsTypeJsonAndBcs, "type" | "json">;
59
+
60
+ /** Node shape: contents.extract.asAddress.asObject.asMoveObject.contents.
61
+ * Reusable for any extract-path node whose inner contents are typed as T.
62
+ * @category GraphQL
63
+ */
64
+ export interface ExtractAsMoveObjectNode<T = ContentsTypeAndJson> {
65
+ contents: {
66
+ extract: {
67
+ asAddress: {
68
+ asObject: {
69
+ asMoveObject: {
70
+ contents: T;
71
+ };
72
+ };
73
+ };
74
+ };
75
+ };
76
+ }
77
+
78
+ /** @category GraphQL */
79
+ export interface PreviousTransaction {
80
+ effects?: { timestamp?: string };
81
+ }
82
+
83
+ /** @category GraphQL */
84
+ export interface ObjectNodes<T> {
85
+ nodes: T[];
86
+ }
87
+
88
+ /** @category GraphQL */
89
+ export interface AddressWithObjects<T> {
90
+ address: string;
91
+ objects: ObjectNodes<T>;
92
+ }
93
+
94
+ /** GraphQL asAddress → asObject → asMoveObject ref chain.
95
+ * @category GraphQL
96
+ */
97
+ export interface AsMoveObjectRef<T> {
98
+ asAddress?: {
99
+ asObject?: {
100
+ asMoveObject?: T;
101
+ };
102
+ };
103
+ }
104
+
105
+ /** Contents with only json (optional payload).
106
+ * @category GraphQL
107
+ */
108
+ export interface ContentsJsonOnly {
109
+ json: Record<string, unknown>;
110
+ }
111
+
112
+ /** Move object ref whose contents have json of type T.
113
+ * @category GraphQL
114
+ */
115
+ export type MoveObjectRefWithJson<T> = AsMoveObjectRef<{
116
+ contents: { json: T };
117
+ }>;
118
+
23
119
  // ============================================================================
24
120
  // Move Object Types
25
121
  // ============================================================================
@@ -28,34 +124,25 @@ export interface PageInfo {
28
124
  export interface MoveObjectContents {
29
125
  json?: Record<string, unknown>;
30
126
  bcs?: string;
31
- type?: {
32
- repr: string;
33
- layout?: string;
34
- };
127
+ type?: TypeReprWithLayout;
35
128
  }
36
129
 
37
130
  /** @category GraphQL */
38
131
  export interface DynamicFieldNode {
39
132
  contents: {
40
133
  json: Record<string, unknown>;
41
- type: {
42
- layout: string;
43
- };
134
+ type: { layout: string };
44
135
  };
45
136
  name: {
46
137
  json: unknown;
47
- type: {
48
- repr: string;
49
- };
138
+ type: TypeRepr;
50
139
  };
51
140
  }
52
141
 
53
142
  /** @category GraphQL */
54
143
  export interface MoveObjectData {
55
144
  contents: MoveObjectContents;
56
- dynamicFields?: {
57
- nodes: DynamicFieldNode[];
58
- };
145
+ dynamicFields?: ObjectNodes<DynamicFieldNode>;
59
146
  }
60
147
 
61
148
  // ============================================================================
@@ -75,24 +162,13 @@ export interface GetObjectResponse {
75
162
  object?: SuiObjectResponse;
76
163
  }
77
164
 
78
- // ============================================================================
79
- // GetObjectByAddress Response Types
80
- // ============================================================================
81
-
82
165
  /** @category GraphQL */
83
166
  export interface GetObjectByAddressResponse {
84
167
  object?: {
85
168
  address: string;
86
169
  version: number;
87
170
  digest: string;
88
- asMoveObject: {
89
- contents: {
90
- type: {
91
- repr: string;
92
- };
93
- bcs: string;
94
- };
95
- } | null;
171
+ asMoveObject: { contents: ContentsTypeAndBcs } | null;
96
172
  };
97
173
  }
98
174
 
@@ -102,69 +178,43 @@ export interface GetObjectByAddressResponse {
102
178
 
103
179
  /** @category GraphQL */
104
180
  export interface OwnedObjectNode {
105
- contents: {
106
- bcs: string;
107
- };
108
- previousTransaction?: {
109
- effects?: {
110
- timestamp?: string;
111
- };
112
- };
181
+ contents: ContentsBcs;
182
+ previousTransaction?: PreviousTransaction;
113
183
  }
114
184
 
115
185
  /** @category GraphQL */
116
186
  export interface AddressOwner {
117
- address: {
118
- address: string;
119
- objects: {
120
- nodes: OwnedObjectNode[];
121
- };
122
- };
187
+ address: AddressWithObjects<OwnedObjectNode>;
123
188
  }
124
189
 
125
190
  /** @category GraphQL */
126
191
  export interface GetObjectOwnerAndOwnedObjectsResponse {
127
- object?: {
128
- owner?: {
129
- address?: AddressOwner["address"];
130
- };
131
- };
192
+ object?: { owner?: { address?: AddressOwner["address"] } };
132
193
  }
133
194
 
134
- // ============================================================================
135
- // Owner & Owned Objects with JSON Response Types
136
- // ============================================================================
137
-
138
195
  /** @category GraphQL */
139
196
  export interface OwnedObjectNodeWithJson {
140
197
  address: string;
141
- contents: {
142
- json: Record<string, unknown>;
143
- bcs: string;
144
- };
145
- previousTransaction?: {
146
- effects?: {
147
- timestamp?: string;
148
- };
149
- };
198
+ contents: ContentsJsonAndBcs;
199
+ previousTransaction?: PreviousTransaction;
150
200
  }
151
201
 
152
202
  /** @category GraphQL */
153
203
  export interface AddressOwnerWithJson {
154
- address: {
155
- address: string;
156
- objects: {
157
- nodes: OwnedObjectNodeWithJson[];
158
- };
159
- };
204
+ address: AddressWithObjects<OwnedObjectNodeWithJson>;
160
205
  }
161
206
 
162
207
  /** @category GraphQL */
163
208
  export interface GetObjectOwnerAndOwnedObjectsWithJsonResponse {
164
- object?: {
165
- owner?: {
166
- address?: AddressOwnerWithJson["address"];
167
- };
209
+ object?: { owner?: { address?: AddressOwnerWithJson["address"] } };
210
+ }
211
+
212
+ /** Node shape for owner's objects in GetObjectAndCharacterOwner (authorizedObj → character).
213
+ * @category GraphQL
214
+ */
215
+ export interface CharacterOwnerNode {
216
+ contents: {
217
+ authorizedObj: MoveObjectRefWithJson<RawCharacterData>;
168
218
  };
169
219
  }
170
220
 
@@ -172,84 +222,26 @@ export interface GetObjectOwnerAndOwnedObjectsWithJsonResponse {
172
222
  export interface GetObjectAndCharacterOwnerResponse {
173
223
  object: {
174
224
  asMoveObject: {
175
- contents: {
176
- json: Record<string, unknown>;
177
- bcs: string;
178
- type: {
179
- repr: string;
180
- };
181
- extract?: {
182
- asAddress?: {
183
- asObject?: {
184
- asMoveObject?: {
185
- owner: {
186
- address: {
187
- objects: {
188
- nodes: [
189
- {
190
- contents: {
191
- authorizedObj: {
192
- asAddress: {
193
- asObject: {
194
- asMoveObject: {
195
- contents: {
196
- json: RawCharacterData;
197
- };
198
- };
199
- };
200
- };
201
- };
202
- };
203
- },
204
- ];
205
- };
206
- };
207
- };
208
- contents?: {
209
- json: Record<string, unknown>;
210
- };
211
- };
212
- };
213
- };
214
- } | null;
215
- energySource?: {
216
- asAddress?: {
217
- asObject?: {
218
- asMoveObject?: {
219
- contents?: {
220
- json: Record<string, unknown>;
221
- };
222
- };
223
- };
224
- };
225
- };
226
- };
227
- dynamicFields?: {
228
- nodes: DynamicFieldNode[];
225
+ contents: ContentsTypeJsonAndBcs & {
226
+ extract?: AsMoveObjectRef<{
227
+ owner: { address: AddressWithObjects<CharacterOwnerNode> };
228
+ contents?: ContentsJsonOnly;
229
+ }> | null;
230
+ energySource?: AsMoveObjectRef<{ contents?: ContentsJsonOnly }>;
231
+ destinationGate?: AsMoveObjectRef<{ contents?: ContentsJsonOnly }>;
229
232
  };
233
+ dynamicFields?: ObjectNodes<DynamicFieldNode>;
230
234
  };
231
235
  };
232
236
  }
233
237
 
234
- // ============================================================================
235
- // GetObjectWithJson Response Types
236
- // ============================================================================
237
-
238
238
  /** @category GraphQL */
239
239
  export interface GetObjectWithJsonResponse {
240
240
  object?: {
241
241
  address: string;
242
242
  version: number;
243
243
  digest: string;
244
- asMoveObject: {
245
- contents: {
246
- type: {
247
- repr: string;
248
- };
249
- json: Record<string, unknown>;
250
- bcs: string;
251
- };
252
- } | null;
244
+ asMoveObject: { contents: ContentsTypeJsonAndBcs } | null;
253
245
  };
254
246
  }
255
247
 
@@ -264,11 +256,7 @@ export interface OwnedObjectAddressNode {
264
256
 
265
257
  /** @category GraphQL */
266
258
  export interface GetOwnedObjectsByTypeResponse {
267
- address?: {
268
- objects: {
269
- nodes: OwnedObjectAddressNode[];
270
- };
271
- };
259
+ address?: { objects: ObjectNodes<OwnedObjectAddressNode> };
272
260
  }
273
261
 
274
262
  // ============================================================================
@@ -284,19 +272,72 @@ export interface OwnedObjectFullNode {
284
272
 
285
273
  /** @category GraphQL */
286
274
  export interface GetOwnedObjectsByPackageResponse {
287
- objects: {
288
- nodes: OwnedObjectFullNode[];
275
+ objects: ObjectNodes<OwnedObjectFullNode>;
276
+ }
277
+
278
+ /** @category GraphQL */
279
+ export interface GetWalletCharactersResponse {
280
+ address: AddressWithObjects<ExtractAsMoveObjectNode>;
281
+ }
282
+
283
+ /** @category GraphQL */
284
+ export interface CharacterAndOwnedObjectsNode {
285
+ contents: {
286
+ extract: {
287
+ asAddress: {
288
+ asObject?: {
289
+ asMoveObject?: {
290
+ contents: ContentsTypeAndJson;
291
+ };
292
+ };
293
+ objects: ObjectNodes<ExtractAsMoveObjectNode>;
294
+ };
295
+ };
289
296
  };
290
297
  }
291
298
 
299
+ /** @category GraphQL */
300
+ export interface GetCharacterAndOwnedObjectsResponse {
301
+ address: AddressWithObjects<CharacterAndOwnedObjectsNode>;
302
+ }
303
+
292
304
  // ============================================================================
293
305
  // Singleton & Type-based Query Response Types
294
306
  // ============================================================================
295
307
 
296
308
  /** @category GraphQL */
297
309
  export interface GetSingletonObjectByTypeResponse {
310
+ objects: ObjectNodes<OwnedObjectAddressNode>;
311
+ }
312
+
313
+ /** @category GraphQL */
314
+ export interface ConfigExtractDynamicFieldNode {
315
+ key: { json: string };
316
+ value: { json: string };
317
+ }
318
+
319
+ /** @category GraphQL */
320
+ export interface GetSingletonConfigObjectByTypeResponse {
298
321
  objects: {
299
- nodes: OwnedObjectAddressNode[];
322
+ nodes: Array<{
323
+ address: string;
324
+ asMoveObject: {
325
+ contents: {
326
+ extract: {
327
+ extract: {
328
+ asAddress: {
329
+ addressAt: {
330
+ dynamicFields: {
331
+ pageInfo: PageInfo;
332
+ nodes: ConfigExtractDynamicFieldNode[];
333
+ };
334
+ };
335
+ };
336
+ };
337
+ };
338
+ };
339
+ };
340
+ }>;
300
341
  };
301
342
  }
302
343
 
@@ -305,21 +346,13 @@ export interface ObjectWithContentsNode {
305
346
  address: string;
306
347
  version: number;
307
348
  asMoveObject: {
308
- contents: {
309
- json: Record<string, unknown>;
310
- type: {
311
- repr: string;
312
- };
313
- };
349
+ contents: { json: Record<string, unknown>; type: TypeRepr };
314
350
  } | null;
315
351
  }
316
352
 
317
353
  /** @category GraphQL */
318
354
  export interface GetObjectsByTypeResponse {
319
- objects: {
320
- nodes: ObjectWithContentsNode[];
321
- pageInfo: PageInfo;
322
- };
355
+ objects: ObjectNodes<ObjectWithContentsNode> & { pageInfo: PageInfo };
323
356
  }
324
357
 
325
358
  // ============================================================================