@mysten/kiosk 0.0.0-experimental-20230925133202 → 0.0.0-experimental-20230928164140

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@mysten/kiosk",
3
3
  "author": "Mysten Labs <build@mystenlabs.com>",
4
4
  "description": "Sui Kiosk library",
5
- "version": "0.0.0-experimental-20230925133202",
5
+ "version": "0.0.0-experimental-20230928164140",
6
6
  "license": "Apache-2.0",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.mjs",
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@mysten/sui.js": "0.42.0"
27
+ "@mysten/sui.js": "0.0.0-experimental-20230928164140"
28
28
  },
29
29
  "devDependencies": {
30
30
  "cross-env": "^7.0.3",
package/src/bcs.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { bcs } from '@mysten/sui.js/bcs';
5
+
5
6
  import {
6
7
  KIOSK_PURCHASE_CAP,
7
8
  KIOSK_TYPE,
@@ -2,29 +2,30 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { type SuiClient } from '@mysten/sui.js/client';
5
- import { fetchKiosk, getOwnedKiosks } from '../query/kiosk';
6
- import {
7
- type FetchKioskOptions,
8
- type KioskData,
9
- type OwnedKiosks,
10
- Network,
11
- type KioskClientOptions,
12
- } from '../types';
5
+
13
6
  import {
14
- type TransferPolicyRule,
15
- type BaseRulePackageIds,
16
- PERSONAL_KIOSK_RULE_ADDRESS,
17
- rules,
7
+ FLOOR_PRICE_RULE_ADDRESS,
18
8
  getBaseRules,
19
- ROYALTY_RULE_ADDRESS,
20
9
  KIOSK_LOCK_RULE_ADDRESS,
21
- FLOOR_PRICE_RULE_ADDRESS,
10
+ PERSONAL_KIOSK_RULE_ADDRESS,
11
+ ROYALTY_RULE_ADDRESS,
12
+ rules,
13
+ type BaseRulePackageIds,
14
+ type TransferPolicyRule,
22
15
  } from '../constants';
16
+ import { fetchKiosk, getOwnedKiosks } from '../query/kiosk';
23
17
  import {
24
18
  queryOwnedTransferPolicies,
25
19
  queryTransferPolicy,
26
20
  queryTransferPolicyCapsByType,
27
21
  } from '../query/transfer-policy';
22
+ import {
23
+ Network,
24
+ type FetchKioskOptions,
25
+ type KioskClientOptions,
26
+ type KioskData,
27
+ type OwnedKiosks,
28
+ } from '../types';
28
29
 
29
30
  /**
30
31
  * A Client that allows you to interact with kiosk.
@@ -2,7 +2,10 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { type TransactionArgument, type TransactionBlock } from '@mysten/sui.js/transactions';
5
- import { type KioskClient } from './kiosk-client';
5
+
6
+ import * as kioskTx from '../tx/kiosk';
7
+ import { convertToPersonalTx, transferPersonalCapTx } from '../tx/personal-kiosk';
8
+ import { confirmRequest } from '../tx/transfer-policy';
6
9
  import {
7
10
  ItemId,
8
11
  ItemReference,
@@ -13,9 +16,7 @@ import {
13
16
  PurchaseOptions,
14
17
  } from '../types';
15
18
  import { getNormalizedRuleType, objArg } from '../utils';
16
- import * as kioskTx from '../tx/kiosk';
17
- import { confirmRequest } from '../tx/transfer-policy';
18
- import { convertToPersonalTx, transferPersonalCapTx } from '../tx/personal-kiosk';
19
+ import { type KioskClient } from './kiosk-client';
19
20
 
20
21
  export type KioskTransactionParams = {
21
22
  /** The TransactionBlock for this run */
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { TransactionArgument, type TransactionBlock } from '@mysten/sui.js/transactions';
5
+
5
6
  import {
6
7
  attachFloorPriceRuleTx,
7
8
  attachKioskLockRuleTx,
@@ -15,7 +16,7 @@ import {
15
16
  shareTransferPolicy,
16
17
  withdrawFromPolicy,
17
18
  } from '../tx/transfer-policy';
18
- import { type ObjectArgument, TransferPolicyCap } from '../types';
19
+ import { TransferPolicyCap, type ObjectArgument } from '../types';
19
20
  import { KioskClient } from './kiosk-client';
20
21
 
21
22
  export type TransferPolicyBaseParams = {
@@ -1,8 +1,22 @@
1
1
  // Copyright (c) Mysten Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { SuiObjectData, SuiObjectDataFilter, SuiObjectResponse } from '@mysten/sui.js/client';
4
+ import {
5
+ PaginationArguments,
6
+ SuiClient,
7
+ SuiObjectData,
8
+ SuiObjectDataFilter,
9
+ SuiObjectResponse,
10
+ } from '@mysten/sui.js/client';
5
11
  import { isValidSuiAddress } from '@mysten/sui.js/utils';
12
+
13
+ import {
14
+ FetchKioskOptions,
15
+ KIOSK_OWNER_CAP,
16
+ KioskListing,
17
+ OwnedKiosks,
18
+ PagedKioskData,
19
+ } from '../types';
6
20
  import {
7
21
  attachListingsAndPrices,
8
22
  attachLockedItems,
@@ -12,14 +26,6 @@ import {
12
26
  getAllObjects,
13
27
  getKioskObject,
14
28
  } from '../utils';
15
- import {
16
- FetchKioskOptions,
17
- KIOSK_OWNER_CAP,
18
- KioskListing,
19
- OwnedKiosks,
20
- PagedKioskData,
21
- } from '../types';
22
- import { SuiClient, PaginationArguments } from '@mysten/sui.js/client';
23
29
 
24
30
  export async function fetchKiosk(
25
31
  client: SuiClient,
@@ -2,6 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { SuiClient } from '@mysten/sui.js/client';
5
+ import { isValidSuiAddress } from '@mysten/sui.js/utils';
6
+
5
7
  import { bcs } from '../bcs';
6
8
  import {
7
9
  TRANSFER_POLICY_CAP_TYPE,
@@ -10,7 +12,6 @@ import {
10
12
  TransferPolicy,
11
13
  TransferPolicyCap,
12
14
  } from '../types';
13
- import { isValidSuiAddress } from '@mysten/sui.js/utils';
14
15
  import { getAllOwnedObjects, parseTransferPolicyCapObject } from '../utils';
15
16
 
16
17
  /**
package/src/tx/kiosk.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  // Copyright (c) Mysten Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions';
4
+ import { TransactionArgument, TransactionBlock } from '@mysten/sui.js/transactions';
5
5
 
6
- import { objArg } from '../utils';
7
6
  import { KIOSK_MODULE, KIOSK_TYPE, ObjectArgument } from '../types';
7
+ import { objArg } from '../utils';
8
8
 
9
9
  /**
10
10
  * Create a new shared Kiosk and returns the [kiosk, kioskOwnerCap] tuple.
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { TransactionArgument, TransactionBlock } from '@mysten/sui.js/transactions';
5
+
5
6
  import { ObjectArgument } from '../types';
6
7
  import { objArg } from '../utils';
7
8
 
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { type TransactionBlock } from '@mysten/sui.js/transactions';
5
+
5
6
  import { type ObjectArgument } from '../../types';
6
7
  import { objArg } from '../../utils';
7
8
 
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) Mysten Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
+ import { type RuleResolvingParams } from '../../types';
4
5
  import { objArg } from '../../utils';
5
6
  import { lock } from '../kiosk';
6
- import { type RuleResolvingParams } from '../../types';
7
7
 
8
8
  /**
9
9
  * A helper to resolve the royalty rule.
@@ -1,9 +1,10 @@
1
1
  // Copyright (c) Mysten Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions';
5
- import { objArg } from '../utils';
4
+ import { TransactionArgument, TransactionBlock } from '@mysten/sui.js/transactions';
5
+
6
6
  import { ObjectArgument, TRANSFER_POLICY_MODULE, TRANSFER_POLICY_TYPE } from '../types';
7
+ import { objArg } from '../utils';
7
8
 
8
9
  /**
9
10
  * Call the `transfer_policy::new` function to create a new transfer policy.
@@ -4,6 +4,7 @@
4
4
  import { type SharedObjectRef } from '@mysten/sui.js/bcs';
5
5
  import { type SuiClient, type SuiObjectRef } from '@mysten/sui.js/client';
6
6
  import { type TransactionArgument } from '@mysten/sui.js/transactions';
7
+
7
8
  import { BaseRulePackageIds } from '../constants';
8
9
 
9
10
  export * from './kiosk';
@@ -7,6 +7,7 @@ import {
7
7
  SuiObjectDataOptions,
8
8
  } from '@mysten/sui.js/client';
9
9
  import { TransactionArgument } from '@mysten/sui.js/transactions';
10
+
10
11
  import { ObjectArgument } from '.';
11
12
 
12
13
  /** The Kiosk module. */
@@ -1,8 +1,9 @@
1
1
  // Copyright (c) Mysten Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { TransactionArgument, type TransactionBlock } from '@mysten/sui.js/transactions';
5
4
  import { type ObjectOwner } from '@mysten/sui.js/client';
5
+ import { TransactionArgument, type TransactionBlock } from '@mysten/sui.js/transactions';
6
+
6
7
  import { ObjectArgument } from '.';
7
8
 
8
9
  /** The Transfer Policy module. */
package/src/utils.ts CHANGED
@@ -3,25 +3,27 @@
3
3
 
4
4
  import { SharedObjectRef } from '@mysten/sui.js/bcs';
5
5
  import {
6
+ PaginationArguments,
7
+ SuiClient,
6
8
  SuiObjectData,
7
9
  SuiObjectDataFilter,
8
10
  SuiObjectDataOptions,
9
11
  SuiObjectRef,
10
12
  SuiObjectResponse,
13
+ type DynamicFieldInfo,
11
14
  } from '@mysten/sui.js/client';
12
- import { TransactionBlock, TransactionArgument } from '@mysten/sui.js/transactions';
13
- import { type DynamicFieldInfo } from '@mysten/sui.js/client';
15
+ import { TransactionArgument, TransactionBlock } from '@mysten/sui.js/transactions';
16
+ import { normalizeSuiAddress } from '@mysten/sui.js/utils';
17
+
14
18
  import { bcs } from './bcs';
15
19
  import {
16
- KIOSK_TYPE,
17
20
  Kiosk,
21
+ KIOSK_TYPE,
18
22
  KioskData,
19
23
  KioskListing,
20
24
  TRANSFER_POLICY_CAP_TYPE,
21
25
  TransferPolicyCap,
22
26
  } from './types';
23
- import { SuiClient, PaginationArguments } from '@mysten/sui.js/client';
24
- import { normalizeSuiAddress } from '@mysten/sui.js/utils';
25
27
 
26
28
  const DEFAULT_QUERY_LIMIT = 50;
27
29