@tradeport/sui-trading-sdk 0.4.19 → 0.4.20

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/dist/index.js CHANGED
@@ -1295,13 +1295,13 @@ var getRoyaltyRuleModule = (nftType) => normalizedNftType(nftType) === "0xe7e651
1295
1295
  // src/helpers/kiosk/getNativeKioskTransferPolicies.ts
1296
1296
  var getNativeKioskTransferPolicies = (transferPolicies) => {
1297
1297
  let nativeKioskTransferPolicies = transferPolicies?.filter(
1298
- (policy) => !policy?.is_origin_byte && policy?.rules?.filter(
1298
+ (policy) => !policy?.is_origin_byte && !policy?.is_disabled && policy?.rules?.filter(
1299
1299
  (rule) => rule?.type?.includes("royalty_rule") || rule?.type?.includes("kiosk_lock_rule") || rule?.type?.includes("personal_kiosk_rule") || rule?.type?.includes("floor_price_rule")
1300
1300
  )?.length > 0
1301
1301
  );
1302
1302
  if (nativeKioskTransferPolicies?.length === 0 && transferPolicies?.length > 0) {
1303
1303
  nativeKioskTransferPolicies = transferPolicies?.filter(
1304
- (policy) => !policy?.is_origin_byte
1304
+ (policy) => !policy?.is_origin_byte && !policy?.is_disabled
1305
1305
  );
1306
1306
  }
1307
1307
  return nativeKioskTransferPolicies;
@@ -2068,8 +2068,8 @@ var isOriginByteBid = (bidType) => bidType === ORIGIN_BYTE_BID_NONCE_TYPE || bid
2068
2068
 
2069
2069
  // src/helpers/originByte/isOriginByteCollection.ts
2070
2070
  var isOriginByteCollection = (transferPolicies) => {
2071
- const hasOriginBytePolicies = transferPolicies?.filter((policy) => policy?.is_origin_byte)?.length > 0;
2072
- const hasNonOriginBytePoliciesWithRules = transferPolicies?.filter((policy) => !policy?.is_origin_byte)?.some((policy) => policy?.rules?.length > 0);
2071
+ const hasOriginBytePolicies = transferPolicies?.filter((policy) => policy?.is_origin_byte && !policy?.is_disabled)?.length > 0;
2072
+ const hasNonOriginBytePoliciesWithRules = transferPolicies?.filter((policy) => !policy?.is_origin_byte && !policy?.is_disabled)?.some((policy) => policy?.rules?.length > 0);
2073
2073
  return Boolean(hasOriginBytePolicies && !hasNonOriginBytePoliciesWithRules);
2074
2074
  };
2075
2075
 
@@ -5714,7 +5714,7 @@ async function canBeTransferedDirectly(suiClient, collectionChainState) {
5714
5714
  }
5715
5715
  async function getTransferPolicyForDirectTransfer(suiClient, collectionChainState, validateRules = false) {
5716
5716
  const candidatePolicy = collectionChainState?.transfer_policies?.find(
5717
- (policy) => !policy.is_origin_byte && policy.rules.length > 0 && policy.rules?.filter(
5717
+ (policy) => !policy.is_origin_byte && !policy.is_disabled && policy.rules.length > 0 && policy.rules?.filter(
5718
5718
  (rule) => rule.type !== "kiosk_lock_rule" && rule.type !== "royalty_rule"
5719
5719
  ).length === 0
5720
5720
  );
@@ -6618,6 +6618,7 @@ var transferNfts = async ({ nftIds, recipientAddress, walletAddress }, context)
6618
6618
 
6619
6619
  // src/methods/unlistListings/unlistListings.ts
6620
6620
  var import_transactions25 = require("@mysten/sui/transactions");
6621
+ var import_utils12 = require("@mysten/sui/utils");
6621
6622
  var unlistListings = async ({ listingIds, walletAddress }, context) => {
6622
6623
  const res = await gqlChainRequest({
6623
6624
  chain: "sui",
@@ -6633,7 +6634,7 @@ var unlistListings = async ({ listingIds, walletAddress }, context) => {
6633
6634
  if (DELOREAN_TOKEN_IDS_TO_DISABLE?.includes(listing?.nft?.token_id)) {
6634
6635
  throw new Error(DELOREAN_TOKEN_IDS_TO_DISABLE_MESSAGE);
6635
6636
  }
6636
- if (!listing?.listed) {
6637
+ if (!listing?.listed && !(listing?.nonce && listing?.seller && (0, import_utils12.normalizeSuiAddress)(listing?.seller) === (0, import_utils12.normalizeSuiAddress)(walletAddress))) {
6637
6638
  throw new Error(`Listing ${listing?.id} is not listed`);
6638
6639
  }
6639
6640
  const nftType = getNftType({