@tradeport/sui-trading-sdk 0.1.47 → 0.1.48

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.48
4
+
5
+ ### Patch Changes
6
+
7
+ - 1fe6458: Disabling placing orginbyte bidding to research potentail exploit
8
+
3
9
  ## 0.1.47
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3677,31 +3677,6 @@ async function addTradePortKioskCollectionBidTx({
3677
3677
  });
3678
3678
  destroyZeroCoin({ tx, coin });
3679
3679
  }
3680
- async function addOriginByteCollectionBidTx({
3681
- tx,
3682
- collectionId,
3683
- nftType,
3684
- bidAmount,
3685
- sharedObjects,
3686
- bidderKiosk
3687
- }) {
3688
- const { orderbook } = sharedObjects;
3689
- const marketFeePrice = getMarketFeePrice({ price: bidAmount, collectionId });
3690
- const [coin] = splitCoins({ tx, amounts: [tx.pure.u64(bidAmount + marketFeePrice)] });
3691
- tx.moveCall({
3692
- target: "0x8534e4cdfd28709c94330a9783c3d5fe6f5daba0bffb69102ce303c5b38aed5a::orderbook::create_bid_with_commission",
3693
- arguments: [
3694
- tx.object(orderbook),
3695
- tx.object(bidderKiosk),
3696
- tx.pure.u64(bidAmount),
3697
- tx.pure.address(TRADEPORT_BENEFICIARY_ADDRESS),
3698
- tx.pure.u64(marketFeePrice),
3699
- tx.object(coin)
3700
- ],
3701
- typeArguments: [nftType, "0x2::sui::SUI"]
3702
- });
3703
- destroyZeroCoin({ tx, coin });
3704
- }
3705
3680
  async function addTradePortPlaceCollectionBidTxHandler(txData) {
3706
3681
  if (await hasRoyaltyRule(txData?.nftType)) {
3707
3682
  const royaltyRuleModule = getRoyaltyRuleModule(txData?.nftType);
@@ -3743,16 +3718,7 @@ var placeCollectionBids = async ({ collections, walletAddress }, context) => {
3743
3718
  };
3744
3719
  const numOfBids = collections?.find((c) => c.id === collection?.id)?.numOfBids;
3745
3720
  if (isOriginByteTx(txData?.sharedObjects) && !ORIGIN_BYTE_NFT_TYPES_MISSING_ORDERBOOK?.includes(normalizedNftType(txData?.nftType))) {
3746
- const { kiosk: bidderKiosk, isNewKiosk: isNewBidderKiosk } = await getOrCreateOBKiosk({
3747
- tx,
3748
- address: txData.bidder
3749
- });
3750
- for (let i = 0; i < numOfBids; i++) {
3751
- await addOriginByteCollectionBidTx({ ...txData, bidderKiosk });
3752
- }
3753
- if (isNewBidderKiosk) {
3754
- await shareOriginByteKiosk({ tx, kiosk: bidderKiosk });
3755
- }
3721
+ throw new Error("OriginByte bidding not supported currently");
3756
3722
  } else {
3757
3723
  for (let i = 0; i < numOfBids; i++) {
3758
3724
  await addTradePortPlaceCollectionBidTxHandler(txData);
@@ -3832,38 +3798,9 @@ async function addTradePortKioskPlaceNftBidTx({
3832
3798
  });
3833
3799
  destroyZeroCoin({ tx, coin: coin1 });
3834
3800
  }
3835
- async function addOriginBytePlaceNftBidTx({
3836
- tx,
3837
- nftTokenId,
3838
- collectionId,
3839
- bidAmount,
3840
- bidder
3841
- }) {
3842
- const { kiosk: bidderKiosk, isNewKiosk: isNewBidderKiosk } = await getOrCreateOBKiosk({
3843
- tx,
3844
- address: bidder,
3845
- createMethod: "create_for_sender"
3846
- });
3847
- const marketFeePrice = getMarketFeePrice({ price: bidAmount, collectionId });
3848
- const [coin] = splitCoins({ tx, amounts: [tx.pure.u64(bidAmount + marketFeePrice)] });
3849
- tx.moveCall({
3850
- target: "0x8534e4cdfd28709c94330a9783c3d5fe6f5daba0bffb69102ce303c5b38aed5a::bidding::create_bid_with_commission",
3851
- arguments: [
3852
- isNewBidderKiosk ? tx.object(bidderKiosk) : tx.pure.address(bidderKiosk),
3853
- tx.pure.address(nftTokenId),
3854
- tx.pure.u64(bidAmount),
3855
- tx.pure.address(TRADEPORT_BENEFICIARY_ADDRESS),
3856
- tx.pure.u64(marketFeePrice),
3857
- tx.object(coin)
3858
- ],
3859
- typeArguments: ["0x2::sui::SUI"]
3860
- });
3861
- destroyZeroCoin({ tx, coin });
3862
- }
3863
3801
  async function addTradePortPlaceNftBidTxHandler(txData) {
3864
3802
  if (isOriginByteTx(txData?.sharedObjects) && !ORIGIN_BYTE_NFT_TYPES_MISSING_ORDERBOOK?.includes(normalizedNftType(txData?.nftType))) {
3865
- await addOriginBytePlaceNftBidTx(txData);
3866
- return;
3803
+ throw new Error("OriginByte bidding not supported currently");
3867
3804
  }
3868
3805
  if (await hasTransferPolicyRules(txData?.nftType) && txData?.sellerKiosk) {
3869
3806
  const royaltyRuleModule = getRoyaltyRuleModule(txData?.nftType);