@mysten/kiosk 1.3.13 → 1.4.0

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.
@@ -21,12 +21,8 @@ import { queryEvents } from './client-utils.js';
21
21
  * and the caller needs to filter the results accordingly (ie single owner can not
22
22
  * be accessed by anyone but the owner).
23
23
  *
24
- * This method requires event querying support (JSON-RPC or GraphQL clients).
25
- * gRPC clients do not support event querying and will throw an error.
26
- *
27
- * @param client - The Sui client (must support event querying)
24
+ * @param client - A Sui client with the Core API
28
25
  * @param type - The type of the asset (e.g., "0x123::nft::NFT")
29
- * @throws Error if the client doesn't support event querying
30
26
  */
31
27
  export async function queryTransferPolicy(
32
28
  client: KioskCompatibleClient,
@@ -1,12 +1,10 @@
1
1
  // Copyright (c) Mysten Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { SuiClientTypes } from '@mysten/sui/client';
4
+ import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client';
5
5
  import type { TransactionObjectArgument } from '@mysten/sui/transactions';
6
6
 
7
7
  import type { BaseRulePackageIds } from '../constants.js';
8
- import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
9
- import { SuiGraphQLClient } from '@mysten/sui/graphql';
10
8
 
11
9
  export * from './kiosk.js';
12
10
  export * from './transfer-policy.js';
@@ -25,4 +23,9 @@ export type KioskClientOptions = {
25
23
  packageIds?: BaseRulePackageIds;
26
24
  };
27
25
 
28
- export type KioskCompatibleClient = SuiJsonRpcClient | SuiGraphQLClient;
26
+ export type KioskCompatibleClient = ClientWithCoreApi;
27
+
28
+ export type KioskPaginationArguments = {
29
+ cursor?: string | null;
30
+ limit?: number | null;
31
+ };
package/src/utils.ts CHANGED
@@ -2,12 +2,17 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { bcs } from '@mysten/sui/bcs';
5
- import { PaginationArguments } from '@mysten/sui/jsonRpc';
6
5
  import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client';
7
6
  import { normalizeStructTag, normalizeSuiAddress, parseStructTag } from '@mysten/sui/utils';
8
7
 
9
8
  import { Item, Listing, Lock, Kiosk as KioskStruct } from './contracts/0x2/kiosk.js';
10
- import type { Kiosk, KioskData, KioskListing, ObjectWithDisplay } from './types/index.js';
9
+ import type {
10
+ Kiosk,
11
+ KioskData,
12
+ KioskListing,
13
+ KioskPaginationArguments,
14
+ ObjectWithDisplay,
15
+ } from './types/index.js';
11
16
 
12
17
  export type DynamicFieldInfo = SuiClientTypes.ListDynamicFieldsResponse['dynamicFields'][number];
13
18
 
@@ -176,7 +181,7 @@ export function attachLockedItems(kioskData: KioskData, lockedItemIds: string[])
176
181
  export async function getAllDynamicFields(
177
182
  client: ClientWithCoreApi,
178
183
  parentId: string,
179
- pagination: PaginationArguments<string>,
184
+ pagination: KioskPaginationArguments,
180
185
  ): Promise<DynamicFieldInfo[]> {
181
186
  let hasNextPage = true;
182
187
  let cursor: string | null = null;