@tradeport/sui-trading-sdk 0.1.31 → 0.1.33
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 +17 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/SuiTradingClient.ts +2 -2
- package/src/helpers/kiosk/kioskTxWrapper.ts +14 -1
- package/src/methods/claimNfts/claimNfts.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -449,7 +449,8 @@ var kioskTxWrapper = async ({
|
|
|
449
449
|
kioskOwner,
|
|
450
450
|
kiosk,
|
|
451
451
|
runCommands,
|
|
452
|
-
shouldConvertToPersonalKiosk
|
|
452
|
+
shouldConvertToPersonalKiosk,
|
|
453
|
+
kioskStrategy
|
|
453
454
|
}) => {
|
|
454
455
|
if (kioskTx) {
|
|
455
456
|
await runCommands(kioskTx);
|
|
@@ -462,7 +463,17 @@ var kioskTxWrapper = async ({
|
|
|
462
463
|
})).kiosks ?? [];
|
|
463
464
|
kiosks = kiosks?.filter((k) => !k.is_origin_byte);
|
|
464
465
|
if (kiosk) {
|
|
465
|
-
|
|
466
|
+
let filteredKiosks = [];
|
|
467
|
+
switch (kioskStrategy ?? "include") {
|
|
468
|
+
case "include":
|
|
469
|
+
filteredKiosks = kiosks.filter((k) => k?.id === kiosk);
|
|
470
|
+
break;
|
|
471
|
+
case "exclude":
|
|
472
|
+
filteredKiosks = kiosks.filter((k) => k?.id !== kiosk);
|
|
473
|
+
break;
|
|
474
|
+
default:
|
|
475
|
+
throw new Error(`Unsupported kiosk strategy ${kioskStrategy}`);
|
|
476
|
+
}
|
|
466
477
|
if (filteredKiosks.length > 0) {
|
|
467
478
|
kiosks = filteredKiosks;
|
|
468
479
|
}
|
|
@@ -3031,6 +3042,7 @@ var claimNfts = async ({ nftIds, walletAddress, tx: existingTx }, context, useOl
|
|
|
3031
3042
|
tx,
|
|
3032
3043
|
kioskOwner: txData?.claimer,
|
|
3033
3044
|
kiosk: txData?.sellerKiosk,
|
|
3045
|
+
kioskStrategy: "exclude",
|
|
3034
3046
|
async runCommands(kioskTx) {
|
|
3035
3047
|
await addClaimTransferredNftTx({ ...txData, kioskTx });
|
|
3036
3048
|
}
|
|
@@ -3040,6 +3052,7 @@ var claimNfts = async ({ nftIds, walletAddress, tx: existingTx }, context, useOl
|
|
|
3040
3052
|
tx,
|
|
3041
3053
|
kioskOwner: txData?.claimer,
|
|
3042
3054
|
kiosk: txData?.sellerKiosk,
|
|
3055
|
+
kioskStrategy: "exclude",
|
|
3043
3056
|
async runCommands(kioskTx) {
|
|
3044
3057
|
await addClaimTransferredNftWithPurchaseCapTx({ ...txData, kioskTx });
|
|
3045
3058
|
}
|
|
@@ -4543,7 +4556,7 @@ var SuiTradingClient = class {
|
|
|
4543
4556
|
apiKey: this.apiKey
|
|
4544
4557
|
};
|
|
4545
4558
|
try {
|
|
4546
|
-
const tx = await claimNfts({ nftIds, walletAddress }, context);
|
|
4559
|
+
const tx = await claimNfts({ nftIds, walletAddress }, context, true);
|
|
4547
4560
|
tx.setSenderIfNotSet(addLeadingZerosAfter0x(walletAddress));
|
|
4548
4561
|
const rawTransaction = await tx.build({ client: suiClient_default });
|
|
4549
4562
|
await suiClient_default.dryRunTransactionBlock({
|
|
@@ -4551,7 +4564,7 @@ var SuiTradingClient = class {
|
|
|
4551
4564
|
});
|
|
4552
4565
|
return tx;
|
|
4553
4566
|
} catch (err) {
|
|
4554
|
-
return claimNfts({ nftIds, walletAddress }, context
|
|
4567
|
+
return claimNfts({ nftIds, walletAddress }, context);
|
|
4555
4568
|
}
|
|
4556
4569
|
}
|
|
4557
4570
|
async createLongLocks(args) {
|