@tradeport/sui-trading-sdk 0.1.83 → 0.1.84

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tradeport/sui-trading-sdk
2
2
 
3
+ ## 0.1.84
4
+
5
+ ### Patch Changes
6
+
7
+ - d511ec4: Tidied up locking nft if not locked for accept bid
8
+
3
9
  ## 0.1.83
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -734,9 +734,11 @@ var lockNftInsideKioskIfNotLocked = async ({
734
734
  nftType,
735
735
  transferPolicyId
736
736
  }) => {
737
- const res = await kioskClient.getKiosk({ id: sellerKiosk });
738
- const isLocked = res?.items?.find((i) => i.objectId === nftTokenId)?.isLocked;
739
- if (!isLocked) {
737
+ try {
738
+ const res = await kioskClient.getKiosk({ id: sellerKiosk });
739
+ const isLocked = res?.items?.find((i) => i.objectId === nftTokenId)?.isLocked;
740
+ if (isLocked)
741
+ return;
740
742
  const item = kioskTx.take({
741
743
  itemId: nftTokenId,
742
744
  itemType: nftType
@@ -751,6 +753,8 @@ var lockNftInsideKioskIfNotLocked = async ({
751
753
  tx.object(item)
752
754
  ]
753
755
  });
756
+ } catch (e) {
757
+ console.log("error attempting to lock nft inside kiosk if not locked", e);
754
758
  }
755
759
  };
756
760