@tradeport/sui-trading-sdk 0.4.21 → 0.4.22

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tradeport/sui-trading-sdk",
3
3
  "license": "MIT",
4
- "version": "0.4.21",
4
+ "version": "0.4.22",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -98,7 +98,25 @@ export const transferNfts = async (
98
98
  transferPolicies,
99
99
  };
100
100
 
101
- // if nft is inside kiosk and has no transfer policy rule, take it out of the kiosk and transfer it directly
101
+ // If NFT is not inside kiosk, transfer the NFT directly
102
+ if (!txData.senderKiosk) {
103
+ tx.transferObjects(
104
+ [tx.object(txData.nftTokenId)],
105
+ tx.pure.address(addLeadingZerosAfter0x(recipientAddress)),
106
+ );
107
+ continue;
108
+ }
109
+
110
+ const isSenderKioskOriginByte = await isOBKiosk(txData.senderAddress, txData.senderKiosk);
111
+
112
+ // If NFT is inside ob kiosk
113
+ if (isSenderKioskOriginByte) {
114
+ await addOriginByteTransferNftTx(txData);
115
+
116
+ continue;
117
+ }
118
+
119
+ // if nft is inside native kiosk and has no transfer policy rules, take it out of the kiosk and transfer it directly
102
120
  if (txData?.senderKiosk && !hasNativeKioskTransferPolicyRules(txData?.transferPolicies)) {
103
121
  await kioskTxWrapper({
104
122
  tx: txData?.tx,
@@ -128,24 +146,6 @@ export const transferNfts = async (
128
146
  continue;
129
147
  }
130
148
 
131
- // If NFT is not inside kiosk, transfer the NFT directly
132
- if (!txData.senderKiosk) {
133
- tx.transferObjects(
134
- [tx.object(txData.nftTokenId)],
135
- tx.pure.address(addLeadingZerosAfter0x(recipientAddress)),
136
- );
137
- continue;
138
- }
139
-
140
- const isSenderKioskOriginByte = await isOBKiosk(txData.senderAddress, txData.senderKiosk);
141
-
142
- // If NFT is inside ob kiosk
143
- if (isSenderKioskOriginByte) {
144
- await addOriginByteTransferNftTx(txData);
145
-
146
- continue;
147
- }
148
-
149
149
  // If NFT is inside native kiosk
150
150
 
151
151
  // If NFT can be transferred directly by creating new kiosk for receiver