@tradeport/sui-trading-sdk 0.1.69 → 0.1.70

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,12 @@
1
1
  # @tradeport/sui-trading-sdk
2
2
 
3
+ ## 0.1.70
4
+
5
+ ### Patch Changes
6
+
7
+ - d06bedf: Allowed cancel transfer and unlist when unshared kiosk
8
+ - 4ecd1a5: Excluded nfts claimable by offer-transfer for migrating to shared kiosks
9
+
3
10
  ## 0.1.69
4
11
 
5
12
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1316,6 +1316,7 @@ async function addTradePortUnlistTxHandler(txData) {
1316
1316
  kioskClient: txData?.kioskClient,
1317
1317
  kioskOwner: txData?.seller,
1318
1318
  kiosk: txData?.sellerKiosk,
1319
+ shouldUseNftUnsharedKiosk: true,
1319
1320
  async runCommands(kioskTx) {
1320
1321
  await addTradePortKioskUnlistTx({
1321
1322
  ...txData,
@@ -1336,6 +1337,7 @@ async function addHyperspaceUnlistTxHandler(txData) {
1336
1337
  kioskClient: txData?.kioskClient,
1337
1338
  kioskOwner: txData?.seller,
1338
1339
  kiosk: txData?.sellerKiosk,
1340
+ shouldUseNftUnsharedKiosk: true,
1339
1341
  async runCommands(kioskTx) {
1340
1342
  await addHyperspaceKioskUnlistTx({
1341
1343
  ...txData,
@@ -1355,6 +1357,7 @@ async function addBluemoveUnlistTxHandler(txData) {
1355
1357
  kioskClient: txData?.kioskClient,
1356
1358
  kioskOwner: txData?.seller,
1357
1359
  kiosk: txData?.sellerKiosk,
1360
+ shouldUseNftUnsharedKiosk: true,
1358
1361
  async runCommands(kioskTx) {
1359
1362
  await addBluemoveKioskUnlistTx({
1360
1363
  ...txData,
@@ -3076,11 +3079,22 @@ var cancelNftTransfers = async ({ nftIds, walletAddress }, context) => {
3076
3079
  if (!txData.senderKiosk || isSenderKioskOriginByte) {
3077
3080
  throw new Error("NFT is not inside a native kiosk, cannot cancel transfer");
3078
3081
  }
3082
+ const res2 = await gqlChainRequest({
3083
+ chain: "sui",
3084
+ query: fetchKiosksByOwner,
3085
+ variables: { ownerAddress: addLeadingZerosAfter0x(walletAddress) }
3086
+ });
3087
+ const kiosks = res2?.kiosks;
3088
+ let shouldUseNftUnsharedKiosk = false;
3089
+ if (kiosks?.filter((k) => k.id === txData?.senderKiosk)?.[0]?.is_shared === false) {
3090
+ shouldUseNftUnsharedKiosk = true;
3091
+ }
3079
3092
  await kioskTxWrapper({
3080
3093
  tx: txData?.tx,
3081
3094
  kioskClient: context.kioskClient,
3082
3095
  kioskOwner: txData?.senderAddress,
3083
3096
  kiosk: txData?.senderKiosk,
3097
+ shouldUseNftUnsharedKiosk,
3084
3098
  async runCommands(kioskTx) {
3085
3099
  await addTradeportKioskCancelNftTransferTx({ ...txData, kioskTx });
3086
3100
  }
@@ -3827,6 +3841,8 @@ var fetchNftsByKioskId = import_graphql_request18.gql`
3827
3841
  token_id
3828
3842
  properties
3829
3843
  chain_state
3844
+ collection_id
3845
+ claimable_reason
3830
3846
  contract {
3831
3847
  properties
3832
3848
  }
@@ -3907,6 +3923,12 @@ async function migrateNftsFromUnsharedToSharedKiosks({ walletAddress }, context)
3907
3923
  if (nft?.chain_state?.claimable_trade_id) {
3908
3924
  continue;
3909
3925
  }
3926
+ if (nft?.claimable_reason === "offer-transfer") {
3927
+ continue;
3928
+ }
3929
+ if (nft?.collection_id === "67ded9ed-4dcc-4d15-9e6f-04dded46f419") {
3930
+ continue;
3931
+ }
3910
3932
  const nftType = getNftTypeFromNft(nft);
3911
3933
  const nftTokenId = nft?.token_id;
3912
3934
  if (sharedOBKiosk) {