@mysten/kiosk 1.3.12 → 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.
- package/CHANGELOG.md +9 -0
- package/dist/client/kiosk-client.d.mts +5 -6
- package/dist/client/kiosk-client.d.mts.map +1 -1
- package/dist/client/kiosk-client.mjs +3 -3
- package/dist/client/kiosk-client.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/query/client-utils.mjs +32 -200
- package/dist/query/client-utils.mjs.map +1 -1
- package/dist/query/kiosk.mjs.map +1 -1
- package/dist/query/transfer-policy.mjs +1 -5
- package/dist/query/transfer-policy.mjs.map +1 -1
- package/dist/types/index.d.mts +7 -5
- package/dist/types/index.d.mts.map +1 -1
- package/dist/utils.d.mts +2 -3
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs.map +1 -1
- package/docs/advanced-examples.md +3 -3
- package/docs/from-v1.md +9 -9
- package/docs/index.md +6 -3
- package/docs/kiosk-client/introduction.md +10 -7
- package/docs/llms-index.md +4 -4
- package/package.json +4 -5
- package/src/client/kiosk-client.ts +5 -5
- package/src/query/client-utils.ts +51 -273
- package/src/query/kiosk.ts +3 -3
- package/src/query/transfer-policy.ts +1 -5
- package/src/types/index.ts +7 -4
- package/src/utils.ts +8 -3
|
@@ -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
|
-
*
|
|
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,
|
package/src/types/index.ts
CHANGED
|
@@ -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 =
|
|
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 {
|
|
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:
|
|
184
|
+
pagination: KioskPaginationArguments,
|
|
180
185
|
): Promise<DynamicFieldInfo[]> {
|
|
181
186
|
let hasNextPage = true;
|
|
182
187
|
let cursor: string | null = null;
|