@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.
Files changed (211) hide show
  1. package/README.md +28 -25
  2. package/dist/config/dapp-kit.d.ts +4 -0
  3. package/dist/config/dapp-kit.d.ts.map +1 -0
  4. package/dist/config/dapp-kit.js +14 -0
  5. package/dist/config/index.d.ts +2 -0
  6. package/dist/config/index.d.ts.map +1 -0
  7. package/dist/config/index.js +1 -0
  8. package/dist/graphql/client.d.ts +277 -0
  9. package/dist/graphql/client.d.ts.map +1 -0
  10. package/dist/graphql/client.js +346 -0
  11. package/dist/graphql/index.d.ts +4 -0
  12. package/dist/graphql/index.d.ts.map +1 -0
  13. package/dist/graphql/index.js +16 -0
  14. package/dist/graphql/queries.d.ts +103 -0
  15. package/dist/graphql/queries.d.ts.map +1 -0
  16. package/{graphql/queries.ts → dist/graphql/queries.js} +113 -223
  17. package/dist/graphql/types.d.ts +396 -0
  18. package/dist/graphql/types.d.ts.map +1 -0
  19. package/dist/graphql/types.js +4 -0
  20. package/dist/hooks/index.d.ts +10 -0
  21. package/dist/hooks/index.d.ts.map +1 -0
  22. package/dist/hooks/index.js +8 -0
  23. package/dist/hooks/useCharacterDirectory.d.ts +16 -0
  24. package/dist/hooks/useCharacterDirectory.d.ts.map +1 -0
  25. package/dist/hooks/useCharacterDirectory.js +23 -0
  26. package/dist/hooks/useCharacterSearch.d.ts +24 -0
  27. package/dist/hooks/useCharacterSearch.d.ts.map +1 -0
  28. package/dist/hooks/useCharacterSearch.js +24 -0
  29. package/dist/hooks/useConnection.d.ts +51 -0
  30. package/dist/hooks/useConnection.d.ts.map +1 -0
  31. package/{hooks/useConnection.ts → dist/hooks/useConnection.js} +8 -10
  32. package/dist/hooks/useEntityRole.d.ts +26 -0
  33. package/dist/hooks/useEntityRole.d.ts.map +1 -0
  34. package/dist/hooks/useEntityRole.js +91 -0
  35. package/dist/hooks/useNotification.d.ts +72 -0
  36. package/dist/hooks/useNotification.d.ts.map +1 -0
  37. package/{hooks/useNotification.ts → dist/hooks/useNotification.js} +8 -12
  38. package/dist/hooks/useSmartObject.d.ts +44 -0
  39. package/dist/hooks/useSmartObject.d.ts.map +1 -0
  40. package/dist/hooks/useSmartObject.js +50 -0
  41. package/dist/hooks/useSponsoredTransaction.d.ts +147 -0
  42. package/dist/hooks/useSponsoredTransaction.d.ts.map +1 -0
  43. package/dist/hooks/useSponsoredTransaction.js +240 -0
  44. package/dist/hooks/useTypeNames.d.ts +11 -0
  45. package/dist/hooks/useTypeNames.d.ts.map +1 -0
  46. package/dist/hooks/useTypeNames.js +24 -0
  47. package/dist/index.d.ts +11 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +29 -0
  50. package/dist/providers/EveFrontierProvider.d.ts +23 -0
  51. package/dist/providers/EveFrontierProvider.d.ts.map +1 -0
  52. package/dist/providers/EveFrontierProvider.js +23 -0
  53. package/dist/providers/NotificationProvider.d.ts +14 -0
  54. package/dist/providers/NotificationProvider.d.ts.map +1 -0
  55. package/dist/providers/NotificationProvider.js +66 -0
  56. package/dist/providers/SmartObjectProvider.d.ts +31 -0
  57. package/dist/providers/SmartObjectProvider.d.ts.map +1 -0
  58. package/dist/providers/SmartObjectProvider.js +80 -0
  59. package/dist/providers/VaultProvider.d.ts +10 -0
  60. package/dist/providers/VaultProvider.d.ts.map +1 -0
  61. package/dist/providers/VaultProvider.js +79 -0
  62. package/dist/providers/index.d.ts +5 -0
  63. package/dist/providers/index.d.ts.map +1 -0
  64. package/dist/providers/index.js +4 -0
  65. package/dist/providers/smartObject/useEntityData.d.ts +29 -0
  66. package/dist/providers/smartObject/useEntityData.d.ts.map +1 -0
  67. package/dist/providers/smartObject/useEntityData.js +135 -0
  68. package/dist/providers/smartObject/useEntitySubscription.d.ts +14 -0
  69. package/dist/providers/smartObject/useEntitySubscription.d.ts.map +1 -0
  70. package/dist/providers/smartObject/useEntitySubscription.js +58 -0
  71. package/dist/providers/smartObject/useObjectSelection.d.ts +11 -0
  72. package/dist/providers/smartObject/useObjectSelection.d.ts.map +1 -0
  73. package/dist/providers/smartObject/useObjectSelection.js +27 -0
  74. package/dist/providers/smartObject/usePollingBackstop.d.ts +18 -0
  75. package/dist/providers/smartObject/usePollingBackstop.d.ts.map +1 -0
  76. package/dist/providers/smartObject/usePollingBackstop.js +38 -0
  77. package/dist/types/character.d.ts +21 -0
  78. package/dist/types/character.d.ts.map +1 -0
  79. package/dist/types/character.js +1 -0
  80. package/dist/types/contexts.d.ts +61 -0
  81. package/dist/types/contexts.d.ts.map +1 -0
  82. package/dist/types/contexts.js +6 -0
  83. package/dist/types/entity.d.ts +245 -0
  84. package/dist/types/entity.d.ts.map +1 -0
  85. package/dist/types/entity.js +6 -0
  86. package/dist/types/index.d.ts +6 -0
  87. package/dist/types/index.d.ts.map +1 -0
  88. package/dist/types/index.js +5 -0
  89. package/dist/types/sponsoredTransaction.d.ts +26 -0
  90. package/dist/types/sponsoredTransaction.d.ts.map +1 -0
  91. package/dist/types/sponsoredTransaction.js +10 -0
  92. package/dist/types/types.d.ts +110 -0
  93. package/dist/types/types.d.ts.map +1 -0
  94. package/dist/types/types.js +41 -0
  95. package/dist/types/worldApiReturnTypes.d.ts +68 -0
  96. package/dist/types/worldApiReturnTypes.d.ts.map +1 -0
  97. package/dist/types/worldApiReturnTypes.js +1 -0
  98. package/{utils/burnRate.ts → dist/utils/burnRate.d.ts} +4 -29
  99. package/dist/utils/burnRate.d.ts.map +1 -0
  100. package/dist/utils/burnRate.js +25 -0
  101. package/dist/utils/characters.d.ts +26 -0
  102. package/dist/utils/characters.d.ts.map +1 -0
  103. package/dist/utils/characters.js +84 -0
  104. package/dist/utils/constants.d.ts +153 -0
  105. package/dist/utils/constants.d.ts.map +1 -0
  106. package/dist/utils/constants.js +190 -0
  107. package/dist/utils/datahub.d.ts +40 -0
  108. package/dist/utils/datahub.d.ts.map +1 -0
  109. package/{utils/datahub.ts → dist/utils/datahub.js} +32 -25
  110. package/dist/utils/entity.d.ts +58 -0
  111. package/dist/utils/entity.d.ts.map +1 -0
  112. package/dist/utils/entity.js +386 -0
  113. package/dist/utils/errors.d.ts +18 -0
  114. package/dist/utils/errors.d.ts.map +1 -0
  115. package/dist/utils/errors.js +128 -0
  116. package/dist/utils/events/entityEvents.d.ts +44 -0
  117. package/dist/utils/events/entityEvents.d.ts.map +1 -0
  118. package/dist/utils/events/entityEvents.js +95 -0
  119. package/dist/utils/events/entitySubscription.d.ts +30 -0
  120. package/dist/utils/events/entitySubscription.d.ts.map +1 -0
  121. package/dist/utils/events/entitySubscription.js +84 -0
  122. package/dist/utils/events/graphqlEventStream.d.ts +90 -0
  123. package/dist/utils/events/graphqlEventStream.d.ts.map +1 -0
  124. package/dist/utils/events/graphqlEventStream.js +198 -0
  125. package/dist/utils/events/refetchScheduler.d.ts +30 -0
  126. package/dist/utils/events/refetchScheduler.d.ts.map +1 -0
  127. package/dist/utils/events/refetchScheduler.js +57 -0
  128. package/dist/utils/events/sseClient.d.ts +42 -0
  129. package/dist/utils/events/sseClient.d.ts.map +1 -0
  130. package/dist/utils/events/sseClient.js +97 -0
  131. package/dist/utils/fuel.d.ts +231 -0
  132. package/dist/utils/fuel.d.ts.map +1 -0
  133. package/dist/utils/fuel.js +652 -0
  134. package/dist/utils/grid.d.ts +115 -0
  135. package/dist/utils/grid.d.ts.map +1 -0
  136. package/dist/utils/grid.js +115 -0
  137. package/dist/utils/index.d.ts +15 -0
  138. package/dist/utils/index.d.ts.map +1 -0
  139. package/dist/utils/index.js +22 -0
  140. package/dist/utils/inventory.d.ts +3 -0
  141. package/dist/utils/inventory.d.ts.map +1 -0
  142. package/dist/utils/inventory.js +12 -0
  143. package/dist/utils/logger.d.ts +25 -0
  144. package/dist/utils/logger.d.ts.map +1 -0
  145. package/dist/utils/logger.js +228 -0
  146. package/dist/utils/mapping.d.ts +30 -0
  147. package/dist/utils/mapping.d.ts.map +1 -0
  148. package/dist/utils/mapping.js +73 -0
  149. package/dist/utils/mvr/worldTypes.d.ts +35 -0
  150. package/dist/utils/mvr/worldTypes.d.ts.map +1 -0
  151. package/dist/utils/mvr/worldTypes.js +54 -0
  152. package/dist/utils/role.d.ts +116 -0
  153. package/dist/utils/role.d.ts.map +1 -0
  154. package/dist/utils/role.js +120 -0
  155. package/dist/utils/smartObject.d.ts +24 -0
  156. package/dist/utils/smartObject.d.ts.map +1 -0
  157. package/dist/utils/smartObject.js +24 -0
  158. package/dist/utils/utils.d.ts +133 -0
  159. package/dist/utils/utils.d.ts.map +1 -0
  160. package/dist/utils/utils.js +213 -0
  161. package/dist/wallet/features.d.ts +28 -0
  162. package/dist/wallet/features.d.ts.map +1 -0
  163. package/dist/wallet/features.js +22 -0
  164. package/dist/wallet/index.d.ts +9 -0
  165. package/dist/wallet/index.d.ts.map +1 -0
  166. package/dist/wallet/index.js +9 -0
  167. package/dist/wallet/utils.d.ts +71 -0
  168. package/dist/wallet/utils.d.ts.map +1 -0
  169. package/dist/wallet/utils.js +79 -0
  170. package/package.json +69 -35
  171. package/config/dapp-kit.ts +0 -20
  172. package/config/index.ts +0 -1
  173. package/graphql/client.ts +0 -578
  174. package/graphql/index.ts +0 -39
  175. package/graphql/types.ts +0 -468
  176. package/hooks/index.ts +0 -15
  177. package/hooks/useSmartObject.ts +0 -66
  178. package/hooks/useSponsoredTransaction.ts +0 -442
  179. package/index.ts +0 -88
  180. package/providers/EveFrontierProvider.tsx +0 -41
  181. package/providers/NotificationProvider.tsx +0 -108
  182. package/providers/SmartObjectProvider.tsx +0 -296
  183. package/providers/VaultProvider.tsx +0 -108
  184. package/providers/index.ts +0 -10
  185. package/types/contexts.ts +0 -67
  186. package/types/global.d.ts +0 -7
  187. package/types/index.ts +0 -4
  188. package/types/sponsoredTransaction.ts +0 -70
  189. package/types/types.ts +0 -198
  190. package/types/worldApiReturnTypes.ts +0 -144
  191. package/utils/__tests__/burnRate.test.ts +0 -121
  192. package/utils/__tests__/character.test.ts +0 -112
  193. package/utils/__tests__/characterOwnedObjects.test.ts +0 -225
  194. package/utils/__tests__/config.test.ts +0 -424
  195. package/utils/__tests__/datahub.test.ts +0 -58
  196. package/utils/__tests__/logger.test.ts +0 -145
  197. package/utils/__tests__/mapping.test.ts +0 -439
  198. package/utils/__tests__/utils.test.ts +0 -299
  199. package/utils/character.ts +0 -46
  200. package/utils/characterOwnedObjects.ts +0 -53
  201. package/utils/config.ts +0 -151
  202. package/utils/constants.ts +0 -254
  203. package/utils/errors.ts +0 -171
  204. package/utils/index.ts +0 -47
  205. package/utils/logger.ts +0 -300
  206. package/utils/mapping.ts +0 -118
  207. package/utils/transforms.ts +0 -263
  208. package/utils/utils.ts +0 -270
  209. package/wallet/features.ts +0 -136
  210. package/wallet/index.ts +0 -26
  211. package/wallet/utils.ts +0 -117
package/README.md CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  React SDK for building EVE Frontier dApps on the Sui blockchain.
4
4
 
5
- **Full API documentation (TypeDoc): [http://sui-docs.evefrontier.com/](http://sui-docs.evefrontier.com/)**
5
+ **Full API documentation (TypeDoc): [https://sui-docs.evefrontier.com/](https://sui-docs.evefrontier.com/)**
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- pnpm add @evefrontier/dapp-kit
10
+ bun add @evefrontier/dapp-kit
11
11
  # peer deps
12
- pnpm add @tanstack/react-query react
12
+ bun add @tanstack/react-query react
13
13
  ```
14
14
 
15
- > Keep your app’s versions of **react**, **@mysten/dapp-kit-react**, and **@mysten/sui** in sync with the versions used by this package to avoid type or runtime mismatches. Check `package.json` for the current ranges.
15
+ > Keep your app’s versions of **react**, **@mysten/dapp-kit-core**, **@mysten/dapp-kit-react**, and **@mysten/sui** in sync with the versions used by this package to avoid type or runtime mismatches. Check `package.json` for the current ranges.
16
16
 
17
17
  ## Quick start
18
18
 
@@ -20,46 +20,49 @@ pnpm add @tanstack/react-query react
20
20
  2. Use `useConnection`, `useSmartObject`, `useNotification`, and `useSponsoredTransaction` as needed.
21
21
 
22
22
  ```tsx
23
- import { EveFrontierProvider, useConnection, useSmartObject } from "@evefrontier/dapp-kit";
24
- import { QueryClient } from "@tanstack/react-query";
23
+ import {
24
+ EveFrontierProvider,
25
+ useConnection,
26
+ useSmartObject,
27
+ } from '@evefrontier/dapp-kit'
28
+ import { QueryClient } from '@tanstack/react-query'
25
29
 
26
- const queryClient = new QueryClient();
30
+ const queryClient = new QueryClient()
27
31
 
28
32
  function App() {
29
33
  return (
30
34
  <EveFrontierProvider queryClient={queryClient}>
31
35
  <MyDapp />
32
36
  </EveFrontierProvider>
33
- );
37
+ )
34
38
  }
35
39
 
36
40
  function MyDapp() {
37
- const { isConnected, handleConnect } = useConnection();
38
- const { assembly, loading } = useSmartObject();
39
- if (!isConnected) return <button onClick={handleConnect}>Connect</button>;
40
- if (loading) return <div>Loading...</div>;
41
- return <div>{assembly?.name}</div>;
41
+ const { isConnected, handleConnect } = useConnection()
42
+ const { entity, loading } = useSmartObject()
43
+ if (!isConnected) return <button onClick={handleConnect}>Connect</button>
44
+ if (loading) return <div>Loading...</div>
45
+ return <div>{entity?.name}</div>
42
46
  }
43
47
  ```
44
48
 
45
- Configure assembly via env (`VITE_OBJECT_ID`, as Sui Object ID) or URL (`?itemId=...&tenant=...`, derived).
49
+ Configure the world tier via `VITE_EVE_WORLD_TIER` (`dev` | `test` | `uat` | `ptu` | `live`), or override the GraphQL endpoint with `VITE_SUI_GRAPHQL_SUBSCRIPTION_URL`. Choose the object via `VITE_OBJECT_ID` (a Sui object ID) or URL params (`?itemId=...&tenant=...`). `EveFrontierProvider` accepts an optional `updateTransport` prop (`'subscription'` | `'polling'`, default `'subscription'`).
46
50
 
47
51
  Install the package once; then import only what you need via subpaths.
48
52
 
49
- | Subpath | Use when you need |
50
- |--------|--------------------|
51
- | `@evefrontier/dapp-kit` | Default: providers, hooks, types, utils |
52
- | `@evefrontier/dapp-kit/graphql` | GraphQL client, queries, and response types |
53
- | `@evefrontier/dapp-kit/types` | Type definitions only |
54
- | `@evefrontier/dapp-kit/utils` | Utilities (parsing, transforms, config) |
55
- | `@evefrontier/dapp-kit/hooks` | Hooks only |
56
- | `@evefrontier/dapp-kit/providers` | Providers only |
57
- | `@evefrontier/dapp-kit/config` | Config / dApp kit setup |
58
-
53
+ | Subpath | Use when you need |
54
+ | --------------------------------- | ------------------------------------------- |
55
+ | `@evefrontier/dapp-kit` | Default: providers, hooks, types, utils |
56
+ | `@evefrontier/dapp-kit/graphql` | GraphQL client, queries, and response types |
57
+ | `@evefrontier/dapp-kit/types` | Type definitions only |
58
+ | `@evefrontier/dapp-kit/utils` | Utilities (parsing, transforms, config) |
59
+ | `@evefrontier/dapp-kit/hooks` | Hooks only |
60
+ | `@evefrontier/dapp-kit/providers` | Providers only |
61
+ | `@evefrontier/dapp-kit/config` | Config / dApp kit setup |
59
62
 
60
63
  ## More
61
64
 
62
- Hooks, types, GraphQL helpers, utilities, and wallet APIs are documented at **[http://sui-docs.evefrontier.com/](http://sui-docs.evefrontier.com/)**.
65
+ Hooks, types, GraphQL helpers, utilities, and wallet APIs are documented at **[https://sui-docs.evefrontier.com/](https://sui-docs.evefrontier.com/)**.
63
66
 
64
67
  ## License
65
68
 
@@ -0,0 +1,4 @@
1
+ import { SuiGrpcClient } from '@mysten/sui/grpc';
2
+ /** DApp Kit instance for Sui wallet and network. @category Config */
3
+ export declare const dAppKit: import("@mysten/dapp-kit-core").DAppKit<("devnet" | "mainnet" | "testnet")[], SuiGrpcClient>;
4
+ //# sourceMappingURL=dapp-kit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dapp-kit.d.ts","sourceRoot":"","sources":["../../config/dapp-kit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAOhD,qEAAqE;AACrE,eAAO,MAAM,OAAO,8FAQlB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { createDAppKit } from '@mysten/dapp-kit-react';
2
+ import { SuiGrpcClient } from '@mysten/sui/grpc';
3
+ import { SUI_GRPC_URLS } from '../utils/constants.js';
4
+ const SUPPORTED_NETWORKS = Object.keys(SUI_GRPC_URLS);
5
+ /** DApp Kit instance for Sui wallet and network. @category Config */
6
+ export const dAppKit = createDAppKit({
7
+ networks: SUPPORTED_NETWORKS,
8
+ createClient(network) {
9
+ return new SuiGrpcClient({
10
+ network,
11
+ baseUrl: SUI_GRPC_URLS[network],
12
+ });
13
+ },
14
+ });
@@ -0,0 +1,2 @@
1
+ export { dAppKit } from './dapp-kit.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1 @@
1
+ export { dAppKit } from './dapp-kit.js';
@@ -0,0 +1,277 @@
1
+ import type { GetEntityResponse, GetEventsByTypeResponse, GetObjectByAddressResponse, GetObjectLatestVersionResponse, GetObjectOwnerAndOwnedObjectsResponse, GetObjectOwnerAndOwnedObjectsWithJsonResponse, GetObjectOwnerResponse, GetObjectResponse, GetObjectsByTypeResponse, GetObjectWithJsonResponse, GetOwnedObjectsByPackageResponse, GetOwnedObjectsByTypeResponse, GetSingletonObjectByTypeResponse, GetTableEntriesResponse, GraphQLResponse } from './types.js';
2
+ /**
3
+ * Execute a GraphQL query against the Sui blockchain endpoint.
4
+ *
5
+ * This is the low-level function used by all other GraphQL helper functions.
6
+ * Use this when you need to execute custom queries not covered by the helper functions.
7
+ *
8
+ * @category GraphQL Client
9
+ * @typeParam T - The expected response data type
10
+ * @param query - The GraphQL query string
11
+ * @param variables - Variables to pass to the query
12
+ * @returns Promise resolving to the GraphQL response
13
+ * @throws {Error} If the HTTP request fails
14
+ *
15
+ * @example Custom query
16
+ * ```typescript
17
+ * const result = await executeGraphQLQuery<MyResponseType>(
18
+ * `query GetObject($address: SuiAddress!) {
19
+ * object(address: $address) {
20
+ * asMoveObject { contents { json } }
21
+ * }
22
+ * }`,
23
+ * { address: "0x123..." }
24
+ * );
25
+ * console.log(result.data?.object?.asMoveObject?.contents?.json);
26
+ * ```
27
+ */
28
+ export declare function executeGraphQLQuery<T = unknown>(query: string, variables: Record<string, unknown>): Promise<GraphQLResponse<T>>;
29
+ /**
30
+ * Fetch a Sui object by its address with BCS-encoded contents.
31
+ *
32
+ * Use this for low-level object access when you need raw BCS data.
33
+ * For JSON-decoded data, use {@link getObjectWithJson} instead.
34
+ *
35
+ * @category GraphQL Client
36
+ * @param address - The Sui object address (0x...)
37
+ * @returns Promise resolving to object with BCS contents
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const result = await getObjectByAddress("0x123...");
42
+ * const bcsData = result.data?.object?.asMoveObject?.contents?.bcs;
43
+ * ```
44
+ */
45
+ export declare function getObjectByAddress(address: string): Promise<GraphQLResponse<GetObjectByAddressResponse>>;
46
+ /**
47
+ * Fetch a Sui object with its dynamic fields in JSON format.
48
+ *
49
+ * Retrieves the object's contents and all associated dynamic fields,
50
+ * which is useful for assemblies that store data in dynamic fields
51
+ * (e.g., inventory items, configuration).
52
+ *
53
+ * @category GraphQL Client
54
+ * @param objectId - The Sui object ID
55
+ * @returns Promise resolving to object with dynamic fields
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const result = await getObjectWithDynamicFields("0x123...");
60
+ * const dynamicFields = result.data?.object?.asMoveObject?.dynamicFields?.nodes;
61
+ * dynamicFields?.forEach(field => {
62
+ * console.log(field.name.json, field.contents.json);
63
+ * });
64
+ * ```
65
+ */
66
+ export declare function getObjectWithDynamicFields(objectId: string): Promise<GraphQLResponse<GetObjectResponse>>;
67
+ /**
68
+ * Fetch a world entity: latest version, contents, and a page of its dynamic
69
+ * fields (components and action maps).
70
+ *
71
+ * Layout sections and inventory item tables nested in component values are
72
+ * resolved inline, up to `tableFirst` entries each. Page the rest with
73
+ * {@link getTableEntries} using the table id from the component JSON.
74
+ *
75
+ * @category GraphQL Client
76
+ * @param address - The entity's Sui object ID
77
+ * @param options - Pagination options
78
+ * @param options.cursor - Cursor for the next page of the entity's dynamicFields
79
+ * @param options.tableFirst - Max entries per nested table (default: 50)
80
+ * @returns Promise resolving to the entity's version, contents and dynamic fields
81
+ */
82
+ export declare function getEntity(address: string, options?: {
83
+ cursor?: string;
84
+ tableFirst?: number;
85
+ }): Promise<GraphQLResponse<GetEntityResponse>>;
86
+ /**
87
+ * Fetch one page of a Move table's entries by the table's UID.
88
+ *
89
+ * @category GraphQL Client
90
+ * @param tableId - The table's UID (e.g. a Layout's `inner.sections.id`)
91
+ * @param options - Pagination options
92
+ * @param options.first - Number of entries per page (default: 50)
93
+ * @param options.after - Cursor for the next page
94
+ * @returns Promise resolving to a page of table entries
95
+ */
96
+ export declare function getTableEntries(tableId: string, options?: {
97
+ first?: number;
98
+ after?: string;
99
+ }): Promise<GraphQLResponse<GetTableEntriesResponse>>;
100
+ /**
101
+ * Fetch only an object's latest version, to detect changes cheaply.
102
+ *
103
+ * @category GraphQL Client
104
+ * @param address - The Sui object ID
105
+ * @returns Promise resolving to the latest version node
106
+ */
107
+ export declare function getObjectLatestVersion(address: string): Promise<GraphQLResponse<GetObjectLatestVersionResponse>>;
108
+ /**
109
+ * Fetch an object's owner.
110
+ *
111
+ * @category GraphQL Client
112
+ * @param address - The Sui object ID
113
+ * @returns Promise resolving to the owner (`__typename` plus address when owned)
114
+ */
115
+ export declare function getObjectOwner(address: string): Promise<GraphQLResponse<GetObjectOwnerResponse>>;
116
+ /**
117
+ * Fetch a Sui object with JSON-decoded contents.
118
+ *
119
+ * This is the most common way to fetch object data when you need
120
+ * to read the object's fields as JavaScript objects.
121
+ *
122
+ * @category GraphQL Client
123
+ * @param address - The Sui object address
124
+ * @returns Promise resolving to object with JSON contents
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * const result = await getObjectWithJson("0x123...");
129
+ * const json = result.data?.object?.asMoveObject?.contents?.json;
130
+ * console.log(json); // { id: "...", name: "...", ... }
131
+ * ```
132
+ */
133
+ export declare function getObjectWithJson(address: string): Promise<GraphQLResponse<GetObjectWithJsonResponse>>;
134
+ /**
135
+ * Get an object's owner and their owned objects of a specific type.
136
+ *
137
+ * Useful for traversing ownership chains, e.g., finding all assemblies
138
+ * owned by a specific character.
139
+ *
140
+ * @category GraphQL Client
141
+ * @param objectAddress - The Sui object address to query owner of
142
+ * @param ownedObjectType - Optional type filter for owned objects
143
+ * @returns Promise resolving to owner info and owned objects (BCS format)
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * const result = await getObjectOwnerAndOwnedObjectsByType(
148
+ * "0x123...",
149
+ * "0xpackage::module::MyType"
150
+ * );
151
+ * const ownerAddress = result.data?.object?.owner?.address?.address;
152
+ * ```
153
+ * @deprecated Walks `object.owner`, which is empty for shared `Entity` objects. Find a wallet's entities with {@link getOwnedObjectsByType} on the `AccessCap` type instead.
154
+ */
155
+ export declare function getObjectOwnerAndOwnedObjectsByType(objectAddress: string, ownedObjectType?: string): Promise<GraphQLResponse<GetObjectOwnerAndOwnedObjectsResponse>>;
156
+ /**
157
+ * Get an object's owner and their owned objects with JSON data.
158
+ *
159
+ * Similar to {@link getObjectOwnerAndOwnedObjectsByType} but returns
160
+ * JSON-decoded contents for easier consumption.
161
+ *
162
+ * @category GraphQL Client
163
+ * @param objectAddress - The Sui object address
164
+ * @param ownedObjectType - Optional type filter for owned objects
165
+ * @returns Promise resolving to owner info and owned objects (JSON format)
166
+ * @deprecated Walks `object.owner`, which is empty for shared `Entity` objects. Find a wallet's entities with {@link getOwnedObjectsByType} on the `AccessCap` type instead.
167
+ */
168
+ export declare function getObjectOwnerAndOwnedObjectsWithJson(objectAddress: string, ownedObjectType?: string): Promise<GraphQLResponse<GetObjectOwnerAndOwnedObjectsWithJsonResponse>>;
169
+ /**
170
+ * Get all objects of a specific type owned by an address.
171
+ *
172
+ * Returns only object addresses (lightweight). Use this when you need
173
+ * to find objects and will fetch their details separately.
174
+ *
175
+ * @category GraphQL Client
176
+ * @param owner - The owner's Sui address
177
+ * @param objectType - Optional Move type filter (e.g., "0xpkg::module::Type")
178
+ * @returns Promise resolving to list of owned object addresses
179
+ *
180
+ * @example
181
+ * ```typescript
182
+ * const result = await getOwnedObjectsByType(
183
+ * "0xowner...",
184
+ * "0xworld::smart_storage_unit::SmartStorageUnit"
185
+ * );
186
+ * const addresses = result.data?.address?.objects?.nodes.map(n => n.address);
187
+ * ```
188
+ */
189
+ export declare function getOwnedObjectsByType(owner: string, objectType?: string): Promise<GraphQLResponse<GetOwnedObjectsByTypeResponse>>;
190
+ /**
191
+ * Get all objects owned by an address filtered by package.
192
+ *
193
+ * Returns full object data with dynamic fields. Use this when you need
194
+ * all objects from a specific package (e.g., all EVE Frontier objects).
195
+ *
196
+ * @category GraphQL Client
197
+ * @param owner - The owner's Sui address
198
+ * @param packageId - The Move package ID to filter by
199
+ * @returns Promise resolving to full object data including dynamic fields
200
+ *
201
+ * @example
202
+ * ```typescript
203
+ * const result = await getOwnedObjectsByPackage(
204
+ * "0xowner...",
205
+ * "0xworld_package_id..."
206
+ * );
207
+ * const objects = result.data?.objects?.nodes;
208
+ * ```
209
+ */
210
+ export declare function getOwnedObjectsByPackage(owner: string, packageId: string): Promise<GraphQLResponse<GetOwnedObjectsByPackageResponse>>;
211
+ /**
212
+ * Get a singleton object by its Move type.
213
+ *
214
+ * Useful for global/singleton objects where there's only one instance
215
+ * of a particular type on-chain.
216
+ *
217
+ * @category GraphQL Client
218
+ * @param objectType - The full Move type string
219
+ * @returns Promise resolving to the singleton object address
220
+ *
221
+ * @example
222
+ * ```typescript
223
+ * const result = await getSingletonObjectByType("0xpkg::config::GlobalConfig");
224
+ * const address = result.data?.objects?.nodes[0]?.address;
225
+ * ```
226
+ */
227
+ export declare function getSingletonObjectByType(objectType: string): Promise<GraphQLResponse<GetSingletonObjectByTypeResponse>>;
228
+ /**
229
+ * Get all objects of a specific type with pagination.
230
+ *
231
+ * Use with caution as this may return many results. Supports cursor-based
232
+ * pagination for iterating through large result sets.
233
+ *
234
+ * @category GraphQL Client
235
+ * @param objectType - The full Move type string
236
+ * @param options - Pagination options
237
+ * @param options.first - Number of results per page (default: 50)
238
+ * @param options.after - Cursor for next page
239
+ * @returns Promise resolving to paginated object list
240
+ *
241
+ * @example Paginated fetch
242
+ * ```typescript
243
+ * let cursor: string | undefined;
244
+ * do {
245
+ * const result = await getObjectsByType("0xpkg::module::Type", {
246
+ * first: 50,
247
+ * after: cursor
248
+ * });
249
+ * const objects = result.data?.objects?.nodes;
250
+ * cursor = result.data?.objects?.pageInfo?.hasNextPage
251
+ * ? result.data?.objects?.pageInfo?.endCursor
252
+ * : undefined;
253
+ * } while (cursor);
254
+ * ```
255
+ */
256
+ export declare function getObjectsByType(objectType: string, options?: {
257
+ first?: number;
258
+ after?: string;
259
+ }): Promise<GraphQLResponse<GetObjectsByTypeResponse>>;
260
+ /**
261
+ * Get events of a Move event type with pagination, oldest first.
262
+ *
263
+ * Use with caution as this may return many results. Event fields cannot be
264
+ * filtered on, so callers page through every event of the type.
265
+ *
266
+ * @category GraphQL Client
267
+ * @param eventType - The full Move event type string
268
+ * @param options - Pagination options
269
+ * @param options.first - Number of results per page (default: 50)
270
+ * @param options.after - Cursor for next page
271
+ * @returns Promise resolving to paginated event list
272
+ */
273
+ export declare function getEventsByType(eventType: string, options?: {
274
+ first?: number;
275
+ after?: string;
276
+ }): Promise<GraphQLResponse<GetEventsByTypeResponse>>;
277
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../graphql/client.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,8BAA8B,EAC9B,qCAAqC,EACrC,6CAA6C,EAC7C,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,gCAAgC,EAChC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