@tradeport/sui-trading-sdk 0.1.39 → 0.1.41

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,17 @@
1
1
  # @tradeport/sui-trading-sdk
2
2
 
3
+ ## 0.1.41
4
+
5
+ ### Patch Changes
6
+
7
+ - d085c40: added optional tx arg in buyListings
8
+
9
+ ## 0.1.40
10
+
11
+ ### Patch Changes
12
+
13
+ - 96c4a13: Fixed remove collection bid getting correct nft type
14
+
3
15
  ## 0.1.39
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -143,7 +143,7 @@ declare class SuiTradingClient {
143
143
  private readonly apiUser;
144
144
  private readonly apiKey;
145
145
  constructor({ apiUser, apiKey }: ApiConfig);
146
- buyListings({ listingIds, walletAddress }: BuyListings): Promise<Transaction>;
146
+ buyListings({ listingIds, walletAddress, tx }: BuyListings): Promise<Transaction>;
147
147
  listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
148
148
  unlistListings({ listingIds, walletAddress }: UnlistListings): Promise<Transaction>;
149
149
  placeNftBids({ nfts, walletAddress }: PlaceNftBids): Promise<Transaction>;
package/dist/index.d.ts CHANGED
@@ -143,7 +143,7 @@ declare class SuiTradingClient {
143
143
  private readonly apiUser;
144
144
  private readonly apiKey;
145
145
  constructor({ apiUser, apiKey }: ApiConfig);
146
- buyListings({ listingIds, walletAddress }: BuyListings): Promise<Transaction>;
146
+ buyListings({ listingIds, walletAddress, tx }: BuyListings): Promise<Transaction>;
147
147
  listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
148
148
  unlistListings({ listingIds, walletAddress }: UnlistListings): Promise<Transaction>;
149
149
  placeNftBids({ nfts, walletAddress }: PlaceNftBids): Promise<Transaction>;
package/dist/index.js CHANGED
@@ -4066,28 +4066,12 @@ var removeCollectionBid = async ({ bidId }, context) => {
4066
4066
  const bidsForTracking = [];
4067
4067
  const tx = new import_transactions16.Transaction();
4068
4068
  for (const bid of res.bids) {
4069
- let nftType;
4070
- if ([
4071
- "fa58ae52-b18d-4179-a2d4-c2471ede5f14",
4072
- // S-Card
4073
- "ca37bbb2-4398-46cb-b467-8a834d2d2612",
4074
- // S-Card mint ticket
4075
- "c8e19183-3a9e-4312-939f-c63a1416e344",
4076
- // Panzerdogs
4077
- "819eabe2-1565-4c3a-a9f6-1b5fca48e09a"
4078
- // Panzerdog Tanks
4079
- ]?.includes(bid?.collection_id)) {
4080
- const collectionWithOneNftRes = await gqlChainRequest({
4081
- chain: "sui",
4082
- query: fetchCollectionsByIdWithOneNft,
4083
- variables: { collectionIds: [bid?.collection_id] }
4084
- });
4085
- nftType = getNftTypeFromNft(collectionWithOneNftRes?.collections?.[0]?.nfts?.[0]);
4086
- } else if (bid?.collection_id === "07231735-96de-4710-8e11-52c61a482578") {
4087
- nftType = "0x034c162f6b594cb5a1805264dd01ca5d80ce3eca6522e6ee37fd9ebfb9d3ddca::factory::PrimeMachin";
4088
- } else {
4089
- nftType = bid?.contract?.properties?.nft_type;
4090
- }
4069
+ const collectionWithOneNftRes = await gqlChainRequest({
4070
+ chain: "sui",
4071
+ query: fetchCollectionsByIdWithOneNft,
4072
+ variables: { collectionIds: [bid?.collection_id] }
4073
+ });
4074
+ const nftType = bid?.collection_id === "07231735-96de-4710-8e11-52c61a482578" ? "0x034c162f6b594cb5a1805264dd01ca5d80ce3eca6522e6ee37fd9ebfb9d3ddca::factory::PrimeMachin" : getNftTypeFromNft(collectionWithOneNftRes?.collections?.[0]?.nfts?.[0]) || bid?.contract?.properties?.nft_type;
4091
4075
  const sharedObjects = await getSharedObjects(nftType);
4092
4076
  const txData = {
4093
4077
  tx,
@@ -4447,12 +4431,12 @@ var SuiTradingClient = class {
4447
4431
  "x-api-key": apiKey
4448
4432
  });
4449
4433
  }
4450
- async buyListings({ listingIds, walletAddress }) {
4434
+ async buyListings({ listingIds, walletAddress, tx }) {
4451
4435
  const context = {
4452
4436
  apiUser: this.apiUser,
4453
4437
  apiKey: this.apiKey
4454
4438
  };
4455
- return buyListings({ listingIds, walletAddress }, context);
4439
+ return buyListings({ listingIds, walletAddress, tx }, context);
4456
4440
  }
4457
4441
  async listNfts({ nfts, walletAddress }) {
4458
4442
  const context = {