@tradeport/sui-trading-sdk 0.3.8 → 0.4.0

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.d.mts +38 -2
  3. package/dist/index.d.ts +38 -2
  4. package/dist/index.js +409 -350
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +409 -350
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/src/SuiTradingClient.ts +23 -2
  10. package/src/constants.ts +11 -0
  11. package/src/graphql/queries/fetchBidsById.ts +1 -0
  12. package/src/graphql/queries/fetchCollectionBidById.ts +1 -0
  13. package/src/graphql/queries/fetchCollectionBidsAtSamePrice.ts +1 -0
  14. package/src/graphql/queries/fetchMultibidById.ts +10 -0
  15. package/src/helpers/isSIngleBid.ts +13 -0
  16. package/src/helpers/kiosk/getKioskTransferPolicies.ts +7 -0
  17. package/src/helpers/kiosk/kioskTxWrapper.ts +8 -5
  18. package/src/methods/acceptCollectionBid/acceptCollectionBid.ts +2 -0
  19. package/src/methods/acceptCollectionBid/addAcceptCollectionBIdTxs.ts +10 -1
  20. package/src/methods/acceptNftBids/acceptNftBids.ts +3 -0
  21. package/src/methods/acceptNftBids/addAcceptNftBidTxs.ts +94 -1
  22. package/src/methods/cancelMultiBid/cancelMultiBid.ts +35 -0
  23. package/src/methods/createMultiBid/createMultiBid.ts +35 -0
  24. package/src/methods/placeCollectionBids/placeCollectionBids.ts +26 -11
  25. package/src/methods/placeNftBids/addPlaceNftBidTxs.ts +100 -230
  26. package/src/methods/placeNftBids/placeNftBids.ts +21 -14
  27. package/src/methods/removeCollectionBids/addRemoveCollectionBidsTxs.ts +10 -1
  28. package/src/methods/removeNftBids/addRemoveNftBidTxs.ts +30 -0
  29. package/src/methods/removeNftBids/removeNftBids.ts +2 -0
  30. package/src/methods/updateMultiBid/updateMultiBid.ts +59 -0
  31. package/src/tests/SuiWallet.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @tradeport/sui-trading-sdk
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f120eee: Added multibids
8
+
9
+ ## 0.3.9
10
+
11
+ ### Patch Changes
12
+
13
+ - f4e68de: Added personal kiosk creation when required
14
+
3
15
  ## 0.3.8
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -118,6 +118,10 @@ type PlaceCollectionBid = {
118
118
  bidAmountInMist: number;
119
119
  numOfBids: number;
120
120
  walletAddress: string;
121
+ multiBidId?: string;
122
+ multiBidChainId?: any;
123
+ expireAt?: Date;
124
+ tx?: Transaction;
121
125
  };
122
126
 
123
127
  type PlaceNftBids = {
@@ -126,6 +130,10 @@ type PlaceNftBids = {
126
130
  bidAmountInMist: number;
127
131
  }>;
128
132
  walletAddress: string;
133
+ multiBidId?: string;
134
+ multiBidChainId?: any;
135
+ expireAt?: Date;
136
+ tx?: Transaction;
129
137
  };
130
138
 
131
139
  type RemoveCollectionBids = {
@@ -153,6 +161,28 @@ type WithdrawProfitsFromKiosks = {
153
161
  walletAddress: string;
154
162
  };
155
163
 
164
+ interface CreateMultiBid {
165
+ walletAddress: string;
166
+ name?: string;
167
+ amount?: bigint;
168
+ tx?: Transaction;
169
+ }
170
+
171
+ interface CancelMultiBid {
172
+ walletAddress: string;
173
+ multiBidId: string;
174
+ }
175
+
176
+ interface UpdateMultiBid {
177
+ walletAddress: string;
178
+ multiBidId?: string;
179
+ name?: string;
180
+ amount?: bigint;
181
+ amountToWithdraw?: bigint;
182
+ tx?: Transaction;
183
+ multiBidChainId?: any;
184
+ }
185
+
156
186
  type ApiConfig = {
157
187
  apiUser: string;
158
188
  apiKey: string;
@@ -169,10 +199,10 @@ declare class SuiTradingClient {
169
199
  buyListings({ listingIds, walletAddress, tx }: BuyListings): Promise<Transaction>;
170
200
  listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
171
201
  unlistListings({ listingIds, walletAddress }: UnlistListings): Promise<Transaction>;
172
- placeNftBids({ nfts, walletAddress }: PlaceNftBids): Promise<Transaction>;
202
+ placeNftBids(data: PlaceNftBids): Promise<Transaction>;
173
203
  removeNftBids({ bidIds, tx }: RemoveNftBids): Promise<Transaction>;
174
204
  acceptNftBids({ bidIds, walletAddress }: AcceptNftBids): Promise<Transaction>;
175
- placeCollectionBid({ collectionId, bidAmountInMist, numOfBids, walletAddress, }: PlaceCollectionBid): Promise<Transaction>;
205
+ placeCollectionBid({ collectionId, bidAmountInMist, numOfBids, walletAddress, multiBidId, multiBidChainId, expireAt, }: PlaceCollectionBid): Promise<Transaction>;
176
206
  acceptCollectionBid({ bidId, nftId, walletAddress }: AcceptCollectionBid): Promise<Transaction>;
177
207
  removeCollectionBids({ bidIds, tx }: RemoveCollectionBids): Promise<Transaction>;
178
208
  transferNfts({ nftIds, recipientAddress, walletAddress }: TransferNfts): Promise<Transaction>;
@@ -188,6 +218,12 @@ declare class SuiTradingClient {
188
218
  buyAndExerciseShortLocks(args: BuyAndExerciseShortLocks): Promise<Transaction>;
189
219
  withdrawProfitsFromKiosks(args: WithdrawProfitsFromKiosks): Promise<Transaction>;
190
220
  migrateNftsFromUnsharedToSharedKiosks(args: MigrateNftsFromUnsharedToSharedKiosks): Promise<Transaction>;
221
+ createMultiBid(args: CreateMultiBid): Promise<{
222
+ multiBidChainId: any;
223
+ tx: Transaction;
224
+ }>;
225
+ cancelMultiBid(args: CancelMultiBid): Promise<Transaction>;
226
+ updateMultiBid(args: UpdateMultiBid): Promise<Transaction>;
191
227
  }
192
228
 
193
229
  export { SuiTradingClient };
package/dist/index.d.ts CHANGED
@@ -118,6 +118,10 @@ type PlaceCollectionBid = {
118
118
  bidAmountInMist: number;
119
119
  numOfBids: number;
120
120
  walletAddress: string;
121
+ multiBidId?: string;
122
+ multiBidChainId?: any;
123
+ expireAt?: Date;
124
+ tx?: Transaction;
121
125
  };
122
126
 
123
127
  type PlaceNftBids = {
@@ -126,6 +130,10 @@ type PlaceNftBids = {
126
130
  bidAmountInMist: number;
127
131
  }>;
128
132
  walletAddress: string;
133
+ multiBidId?: string;
134
+ multiBidChainId?: any;
135
+ expireAt?: Date;
136
+ tx?: Transaction;
129
137
  };
130
138
 
131
139
  type RemoveCollectionBids = {
@@ -153,6 +161,28 @@ type WithdrawProfitsFromKiosks = {
153
161
  walletAddress: string;
154
162
  };
155
163
 
164
+ interface CreateMultiBid {
165
+ walletAddress: string;
166
+ name?: string;
167
+ amount?: bigint;
168
+ tx?: Transaction;
169
+ }
170
+
171
+ interface CancelMultiBid {
172
+ walletAddress: string;
173
+ multiBidId: string;
174
+ }
175
+
176
+ interface UpdateMultiBid {
177
+ walletAddress: string;
178
+ multiBidId?: string;
179
+ name?: string;
180
+ amount?: bigint;
181
+ amountToWithdraw?: bigint;
182
+ tx?: Transaction;
183
+ multiBidChainId?: any;
184
+ }
185
+
156
186
  type ApiConfig = {
157
187
  apiUser: string;
158
188
  apiKey: string;
@@ -169,10 +199,10 @@ declare class SuiTradingClient {
169
199
  buyListings({ listingIds, walletAddress, tx }: BuyListings): Promise<Transaction>;
170
200
  listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
171
201
  unlistListings({ listingIds, walletAddress }: UnlistListings): Promise<Transaction>;
172
- placeNftBids({ nfts, walletAddress }: PlaceNftBids): Promise<Transaction>;
202
+ placeNftBids(data: PlaceNftBids): Promise<Transaction>;
173
203
  removeNftBids({ bidIds, tx }: RemoveNftBids): Promise<Transaction>;
174
204
  acceptNftBids({ bidIds, walletAddress }: AcceptNftBids): Promise<Transaction>;
175
- placeCollectionBid({ collectionId, bidAmountInMist, numOfBids, walletAddress, }: PlaceCollectionBid): Promise<Transaction>;
205
+ placeCollectionBid({ collectionId, bidAmountInMist, numOfBids, walletAddress, multiBidId, multiBidChainId, expireAt, }: PlaceCollectionBid): Promise<Transaction>;
176
206
  acceptCollectionBid({ bidId, nftId, walletAddress }: AcceptCollectionBid): Promise<Transaction>;
177
207
  removeCollectionBids({ bidIds, tx }: RemoveCollectionBids): Promise<Transaction>;
178
208
  transferNfts({ nftIds, recipientAddress, walletAddress }: TransferNfts): Promise<Transaction>;
@@ -188,6 +218,12 @@ declare class SuiTradingClient {
188
218
  buyAndExerciseShortLocks(args: BuyAndExerciseShortLocks): Promise<Transaction>;
189
219
  withdrawProfitsFromKiosks(args: WithdrawProfitsFromKiosks): Promise<Transaction>;
190
220
  migrateNftsFromUnsharedToSharedKiosks(args: MigrateNftsFromUnsharedToSharedKiosks): Promise<Transaction>;
221
+ createMultiBid(args: CreateMultiBid): Promise<{
222
+ multiBidChainId: any;
223
+ tx: Transaction;
224
+ }>;
225
+ cancelMultiBid(args: CancelMultiBid): Promise<Transaction>;
226
+ updateMultiBid(args: UpdateMultiBid): Promise<Transaction>;
191
227
  }
192
228
 
193
229
  export { SuiTradingClient };