@tradeport/sui-trading-sdk 0.1.15 → 0.1.16
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 +6 -0
- package/dist/index.js +21 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/SuiTradingClient.ts +13 -2
- package/src/methods/claimNfts/claimNfts.ts +9 -8
- /package/src/methods/{cancelLock/cancelLock.ts → cancelLocks/cancelLocks.ts} +0 -0
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -2474,7 +2474,7 @@ var buyListings = async ({ listingIds, walletAddress, tx: existingTx, kioskTx },
|
|
|
2474
2474
|
return import_transactions6.Transaction.from(tx);
|
|
2475
2475
|
};
|
|
2476
2476
|
|
|
2477
|
-
// src/methods/
|
|
2477
|
+
// src/methods/cancelLocks/cancelLocks.ts
|
|
2478
2478
|
var import_transactions7 = require("@mysten/sui/transactions");
|
|
2479
2479
|
async function cancelLocks({ lockIds, walletAddress }) {
|
|
2480
2480
|
const tx = new import_transactions7.Transaction();
|
|
@@ -2650,7 +2650,7 @@ var addClaimTransferredNftWithPurchaseCapTx = async ({
|
|
|
2650
2650
|
};
|
|
2651
2651
|
|
|
2652
2652
|
// src/methods/claimNfts/claimNfts.ts
|
|
2653
|
-
var claimNfts = async ({ nftIds, walletAddress, tx: existingTx }, context) => {
|
|
2653
|
+
var claimNfts = async ({ nftIds, walletAddress, tx: existingTx }, context, useOldClaim) => {
|
|
2654
2654
|
const res = await gqlChainRequest({
|
|
2655
2655
|
chain: "sui",
|
|
2656
2656
|
query: fetchNftsById,
|
|
@@ -2694,22 +2694,22 @@ var claimNfts = async ({ nftIds, walletAddress, tx: existingTx }, context) => {
|
|
|
2694
2694
|
nftTokenId: nft?.token_id,
|
|
2695
2695
|
sellerKiosk: nft?.chain_state?.kiosk_id
|
|
2696
2696
|
};
|
|
2697
|
-
|
|
2697
|
+
if (useOldClaim) {
|
|
2698
2698
|
await kioskTxWrapper({
|
|
2699
2699
|
tx,
|
|
2700
2700
|
kioskOwner: txData?.claimer,
|
|
2701
2701
|
kiosk: txData?.sellerKiosk,
|
|
2702
2702
|
async runCommands(kioskTx) {
|
|
2703
|
-
await
|
|
2703
|
+
await addClaimAcceptedBidNftTx({ ...txData, kioskTx });
|
|
2704
2704
|
}
|
|
2705
2705
|
});
|
|
2706
|
-
}
|
|
2706
|
+
} else {
|
|
2707
2707
|
await kioskTxWrapper({
|
|
2708
2708
|
tx,
|
|
2709
2709
|
kioskOwner: txData?.claimer,
|
|
2710
2710
|
kiosk: txData?.sellerKiosk,
|
|
2711
2711
|
async runCommands(kioskTx) {
|
|
2712
|
-
await
|
|
2712
|
+
await addClaimAcceptedBidNftWithPurchaseCapTx({ ...txData, kioskTx });
|
|
2713
2713
|
}
|
|
2714
2714
|
});
|
|
2715
2715
|
}
|
|
@@ -2724,22 +2724,22 @@ var claimNfts = async ({ nftIds, walletAddress, tx: existingTx }, context) => {
|
|
|
2724
2724
|
nftTokenId: nft?.token_id,
|
|
2725
2725
|
sellerKiosk: nft?.chain_state?.kiosk_id
|
|
2726
2726
|
};
|
|
2727
|
-
|
|
2727
|
+
if (useOldClaim) {
|
|
2728
2728
|
await kioskTxWrapper({
|
|
2729
2729
|
tx,
|
|
2730
2730
|
kioskOwner: txData?.claimer,
|
|
2731
2731
|
kiosk: txData?.sellerKiosk,
|
|
2732
2732
|
async runCommands(kioskTx) {
|
|
2733
|
-
await
|
|
2733
|
+
await addClaimTransferredNftTx({ ...txData, kioskTx });
|
|
2734
2734
|
}
|
|
2735
2735
|
});
|
|
2736
|
-
}
|
|
2736
|
+
} else {
|
|
2737
2737
|
await kioskTxWrapper({
|
|
2738
2738
|
tx,
|
|
2739
2739
|
kioskOwner: txData?.claimer,
|
|
2740
2740
|
kiosk: txData?.sellerKiosk,
|
|
2741
2741
|
async runCommands(kioskTx) {
|
|
2742
|
-
await
|
|
2742
|
+
await addClaimTransferredNftWithPurchaseCapTx({ ...txData, kioskTx });
|
|
2743
2743
|
}
|
|
2744
2744
|
});
|
|
2745
2745
|
}
|
|
@@ -4320,7 +4320,17 @@ var SuiTradingClient = class {
|
|
|
4320
4320
|
apiUser: this.apiUser,
|
|
4321
4321
|
apiKey: this.apiKey
|
|
4322
4322
|
};
|
|
4323
|
-
|
|
4323
|
+
try {
|
|
4324
|
+
const tx = await claimNfts({ nftIds, walletAddress }, context);
|
|
4325
|
+
tx.setSenderIfNotSet(addLeadingZerosAfter0x(walletAddress));
|
|
4326
|
+
const rawTransaction = await tx.build({ client: suiClient_default });
|
|
4327
|
+
await suiClient_default.dryRunTransactionBlock({
|
|
4328
|
+
transactionBlock: rawTransaction
|
|
4329
|
+
});
|
|
4330
|
+
return tx;
|
|
4331
|
+
} catch (err) {
|
|
4332
|
+
return claimNfts({ nftIds, walletAddress }, context, true);
|
|
4333
|
+
}
|
|
4324
4334
|
}
|
|
4325
4335
|
async createLongLocks(args) {
|
|
4326
4336
|
return createLongLocks(args);
|