@xoxno/sdk-js 0.1.75-alpha → 0.1.77-alpha

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 (106) hide show
  1. package/dist/711.heavy.bundle.js +2 -0
  2. package/dist/711.heavy.bundle.js.LICENSE.txt +10 -0
  3. package/dist/collection/index.d.ts +13 -5
  4. package/dist/collection/index.d.ts.map +1 -0
  5. package/dist/common/index.d.ts +10 -1
  6. package/dist/common/index.d.ts.map +1 -0
  7. package/dist/index.large.d.ts +1 -0
  8. package/dist/index.large.d.ts.map +1 -0
  9. package/dist/{index.d.ts → index.light.d.ts} +1 -2
  10. package/dist/index.light.d.ts.map +1 -0
  11. package/dist/interactions/index.d.ts +1 -0
  12. package/dist/interactions/index.d.ts.map +1 -0
  13. package/dist/launchpad/index.d.ts +1 -0
  14. package/dist/launchpad/index.d.ts.map +1 -0
  15. package/dist/main.heavy.bundle.js +1 -0
  16. package/dist/main.light.bundle.js +1 -0
  17. package/dist/nft/index.d.ts +1 -0
  18. package/dist/nft/index.d.ts.map +1 -0
  19. package/dist/staking/index.d.ts +1 -0
  20. package/dist/staking/index.d.ts.map +1 -0
  21. package/dist/types/collection.d.ts +34 -6
  22. package/dist/types/collection.d.ts.map +1 -0
  23. package/dist/types/common.d.ts +10 -0
  24. package/dist/types/common.d.ts.map +1 -0
  25. package/dist/types/index.d.ts +1 -0
  26. package/dist/types/index.d.ts.map +1 -0
  27. package/dist/types/interactions.d.ts +1 -0
  28. package/dist/types/interactions.d.ts.map +1 -0
  29. package/dist/types/nft.d.ts +1 -0
  30. package/dist/types/nft.d.ts.map +1 -0
  31. package/dist/types/staking.d.ts +25 -1
  32. package/dist/types/staking.d.ts.map +1 -0
  33. package/dist/types/trading.d.ts +1 -0
  34. package/dist/types/trading.d.ts.map +1 -0
  35. package/dist/types/user.d.ts +60 -0
  36. package/dist/types/user.d.ts.map +1 -0
  37. package/dist/users/index.d.ts +36 -4
  38. package/dist/users/index.d.ts.map +1 -0
  39. package/dist/utils/SmartContractAbis.d.ts +1 -0
  40. package/dist/utils/SmartContractAbis.d.ts.map +1 -0
  41. package/dist/utils/SmartContractService.d.ts +1 -0
  42. package/dist/utils/SmartContractService.d.ts.map +1 -0
  43. package/dist/utils/api.d.ts +1 -0
  44. package/dist/utils/api.d.ts.map +1 -0
  45. package/dist/utils/const.d.ts +1 -0
  46. package/dist/utils/const.d.ts.map +1 -0
  47. package/dist/utils/getActivity.d.ts +2 -1
  48. package/dist/utils/getActivity.d.ts.map +1 -0
  49. package/dist/utils/helpers.d.ts +1 -0
  50. package/dist/utils/helpers.d.ts.map +1 -0
  51. package/dist/utils/regex.d.ts +1 -0
  52. package/dist/utils/regex.d.ts.map +1 -0
  53. package/dist/utils/scCalls.d.ts +1 -0
  54. package/dist/utils/scCalls.d.ts.map +1 -0
  55. package/package.json +28 -8
  56. package/.eslintrc.json +0 -19
  57. package/dist/collection/index.js +0 -660
  58. package/dist/collection/index.js.map +0 -1
  59. package/dist/common/index.js +0 -132
  60. package/dist/common/index.js.map +0 -1
  61. package/dist/index.js +0 -10
  62. package/dist/index.js.map +0 -1
  63. package/dist/index.large.js +0 -3
  64. package/dist/index.large.js.map +0 -1
  65. package/dist/interactions/index.js +0 -619
  66. package/dist/interactions/index.js.map +0 -1
  67. package/dist/launchpad/index.js +0 -140
  68. package/dist/launchpad/index.js.map +0 -1
  69. package/dist/nft/index.js +0 -109
  70. package/dist/nft/index.js.map +0 -1
  71. package/dist/staking/index.js +0 -17
  72. package/dist/staking/index.js.map +0 -1
  73. package/dist/types/collection.js +0 -192
  74. package/dist/types/collection.js.map +0 -1
  75. package/dist/types/common.js +0 -2
  76. package/dist/types/common.js.map +0 -1
  77. package/dist/types/index.js +0 -8
  78. package/dist/types/index.js.map +0 -1
  79. package/dist/types/interactions.js +0 -8
  80. package/dist/types/interactions.js.map +0 -1
  81. package/dist/types/nft.js +0 -2
  82. package/dist/types/nft.js.map +0 -1
  83. package/dist/types/staking.js +0 -12
  84. package/dist/types/staking.js.map +0 -1
  85. package/dist/types/trading.js +0 -49
  86. package/dist/types/trading.js.map +0 -1
  87. package/dist/types/user.js +0 -10
  88. package/dist/types/user.js.map +0 -1
  89. package/dist/users/index.js +0 -324
  90. package/dist/users/index.js.map +0 -1
  91. package/dist/utils/SmartContractAbis.js +0 -84
  92. package/dist/utils/SmartContractAbis.js.map +0 -1
  93. package/dist/utils/SmartContractService.js +0 -9
  94. package/dist/utils/SmartContractService.js.map +0 -1
  95. package/dist/utils/api.js +0 -82
  96. package/dist/utils/api.js.map +0 -1
  97. package/dist/utils/const.js +0 -14
  98. package/dist/utils/const.js.map +0 -1
  99. package/dist/utils/getActivity.js +0 -64
  100. package/dist/utils/getActivity.js.map +0 -1
  101. package/dist/utils/helpers.js +0 -21
  102. package/dist/utils/helpers.js.map +0 -1
  103. package/dist/utils/regex.js +0 -7
  104. package/dist/utils/regex.js.map +0 -1
  105. package/dist/utils/scCalls.js +0 -25
  106. package/dist/utils/scCalls.js.map +0 -1
@@ -1,619 +0,0 @@
1
- import { XOXNOClient } from '../';
2
- import { ContractQueryRunner } from '../utils/scCalls';
3
- import { SmartContractAbis } from '../utils/SmartContractAbis';
4
- import { getSmartContract } from '../utils/SmartContractService';
5
- import { BigUIntType, BigUIntValue, U64Type, U64Value, } from '@multiversx/sdk-core/out/smartcontracts/typesystem/numerical';
6
- import { AuctionType, } from '../types/interactions';
7
- import BigNumber from 'bignumber.js';
8
- import { Struct, StructType, } from '@multiversx/sdk-core/out/smartcontracts/typesystem/struct';
9
- import { TokenIdentifierType, TokenIdentifierValue, } from '@multiversx/sdk-core/out/smartcontracts/typesystem/tokenIdentifier';
10
- import { Field, FieldDefinition, } from '@multiversx/sdk-core/out/smartcontracts/typesystem/fields';
11
- import { BooleanType, BooleanValue, } from '@multiversx/sdk-core/out/smartcontracts/typesystem/boolean';
12
- import { Address } from '@multiversx/sdk-core/out/address';
13
- import { TokenTransfer } from '@multiversx/sdk-core/out/tokens';
14
- export class SCInteraction {
15
- xo;
16
- call;
17
- api;
18
- constructor(marketAbiXOXNO) {
19
- this.xo = marketAbiXOXNO;
20
- this.call = new ContractQueryRunner();
21
- this.api = XOXNOClient.init();
22
- }
23
- static async init() {
24
- const config = XOXNOClient.init().config;
25
- const marketAbiXOXNO = await SmartContractAbis.getMarket();
26
- const xo_abi = getSmartContract(marketAbiXOXNO, config.XO_SC);
27
- return new SCInteraction(xo_abi);
28
- }
29
- async getResult(interaction) {
30
- return await this.call.runQuery(this.xo, interaction);
31
- }
32
- /**
33
- * Gets the percentage of each transaction that will be paid to the marketplace.
34
- *
35
- * @returns The percentage of each transaction that will be paid to the marketplace.
36
- */
37
- getMarketplaceFees = async () => {
38
- const interaction = this.xo.methods.getMarketplaceCutPercentage();
39
- const result = await this.getResult(interaction);
40
- return parseInt(result.firstValue?.valueOf());
41
- };
42
- /**
43
- * Retrieves the list of accepted payment tokens.
44
- * @returns {string[]} A list of accepted payment tokens.
45
- */
46
- getAcceptedPaymentTokens = async () => {
47
- const interaction = this.xo.methods.getAcceptedTokens();
48
- const result = await this.getResult(interaction);
49
- return result.firstValue?.valueOf();
50
- };
51
- /**
52
- * This function returns a list of IDs of global offers.
53
- * @returns {number[]} a list of IDs of global offers.
54
- */
55
- getGlobalOfferIDs = async () => {
56
- const interaction = this.xo.methods.getGlobalOffers();
57
- const result = await this.getResult(interaction);
58
- return result.firstValue?.valueOf().map((id) => parseInt(id));
59
- };
60
- /**
61
- * Gets the balance of a user in a token of a specific pool.
62
- * @param address The address of the user.
63
- * @param token The token address.
64
- * @param nonce The nonce of the pool.
65
- * @returns {number} The balance of the user in the token of the pool.
66
- */
67
- async getUserPoolBalance(address, token, nonce) {
68
- const result = await this.getResult(this.xo.methods.userDeposit([address, token, nonce]));
69
- if (!result?.firstValue) {
70
- return 0;
71
- }
72
- return new BigUIntValue(result.firstValue.valueOf().amount)
73
- .valueOf()
74
- .shiftedBy(-18)
75
- .toNumber();
76
- }
77
- // function to determine if the offer is active
78
- // based on the offer price and user balance
79
- isOfferActive(offer_price, user_balance) {
80
- return offer_price <= user_balance;
81
- }
82
- /**
83
- * Returns the global offer data for the offer with the given id.
84
- *
85
- * @param global_offer_id The id of the global offer for which to return the data.
86
- *
87
- * @returns An object containing the global offer data for the offer with the given id. If the global offer id is invalid, the return value will be null.
88
- */
89
- getGlobalOfferData = async (global_offer_id) => {
90
- const interaction = this.xo.methods.getGlobalOffer([global_offer_id]);
91
- const result = await this.getResult(interaction);
92
- const body = result.firstValue?.valueOf();
93
- body.offer_id = parseInt(body.offer_id.valueOf());
94
- body.marketplace = 'XO';
95
- body.short_price = parseFloat(new BigUIntValue(body.price).valueOf().shiftedBy(-18).toString());
96
- body.new_version = Boolean(body.new_version);
97
- if (!body.new_version) {
98
- body.isActive = this.isOfferActive(body.short_price, await this.getUserPoolBalance(body.owner, body.payment_token, body.payment_nonce));
99
- }
100
- else {
101
- body.isActive = true;
102
- }
103
- body.quantity = parseInt(body.quantity.valueOf());
104
- body.payment_nonce = parseInt(body.payment_nonce.valueOf());
105
- body.price = body.price.valueOf();
106
- body.timestamp = parseInt(body.timestamp.valueOf());
107
- body.owner = body.owner.valueOf().toString();
108
- if (body.attributes) {
109
- body.attributes = JSON.parse(Buffer.from(body.attributes.valueOf().toString(), 'base64').toString('ascii'));
110
- }
111
- return body;
112
- };
113
- /**
114
- * Returns the auction struct for the given id.
115
- *
116
- * @param auctionID The id of the auction for which to return the data.
117
- *
118
- * @returns {Auction} An object containing the auction data for the given id. If the auction id is invalid, the return value will be null.
119
- */
120
- getAuctionInfo = async (auctionID) => {
121
- const interaction = this.xo.methods.getFullAuctionData([auctionID]);
122
- const result = await this.getResult(interaction);
123
- const body = result.firstValue?.valueOf();
124
- if (!body) {
125
- return null;
126
- }
127
- body.auctioned_token_nonce = parseInt(body.auctioned_token_nonce.valueOf());
128
- body.nr_auctioned_tokens = parseInt(body.nr_auctioned_tokens.valueOf());
129
- body.auction_type = body.auction_type.name;
130
- body.payment_token_nonce = parseInt(body.payment_token_nonce.valueOf());
131
- body.min_bid = body.min_bid.valueOf();
132
- body.max_bid = body.max_bid.valueOf();
133
- body.start_time = parseInt(body.start_time.valueOf());
134
- body.deadline = parseInt(body.deadline.valueOf());
135
- body.original_owner = body.original_owner.valueOf().toString();
136
- body.current_winner = body.current_winner.valueOf().toString();
137
- body.current_bid = body.current_bid.valueOf().toString();
138
- body.marketplace_cut_percentage = body.marketplace_cut_percentage.valueOf();
139
- body.creator_royalties_percentage =
140
- body.creator_royalties_percentage.valueOf();
141
- return body;
142
- };
143
- /** Gets the number of listings.
144
- * @returns {number} The number of listings.
145
- * */
146
- async getListingsCount() {
147
- const result = await this.getResult(this.xo.methods.getListingsCount());
148
- const count = parseInt(result.firstValue?.valueOf());
149
- return count;
150
- }
151
- /** Gets the number of custom offers.
152
- * @returns {number} The number of custom offers.
153
- * */
154
- async getOffersCount() {
155
- const result = await this.getResult(this.xo.methods.getOffersCount());
156
- const count = parseInt(result.firstValue?.valueOf());
157
- return count;
158
- }
159
- /** Gets the number of global offers.
160
- * @returns {number} The number of global offers.
161
- * */
162
- async getGlobalOffersCount() {
163
- const result = await this.getResult(this.xo.methods.getGlobalOffersCount());
164
- const count = parseInt(result.firstValue?.valueOf());
165
- return count;
166
- }
167
- /** Gets the number of collections listed.
168
- * @returns {number} The number of collections listed.
169
- * */
170
- async getCollectionsCount() {
171
- const result = await this.getResult(this.xo.methods.getCollectionsCount());
172
- const count = parseInt(result.firstValue?.valueOf());
173
- return count;
174
- }
175
- /**
176
- * Checks whether a collection is listed with at least 1 NFT.
177
- *
178
- * @param collection name of the collection
179
- * @return true if the collection is listed, false otherwise
180
- */
181
- async isCollectionListed(collection) {
182
- const result = await this.getResult(this.xo.methods.isCollectionListed([collection]));
183
- return Boolean(result.firstValue?.valueOf());
184
- }
185
- /** Gets the on sale NFT count of the collection.
186
- *
187
- * @param collection The collection identifier for which one wants to get the on sale NFT count.
188
- *
189
- * @returns {number} The on sale NFT count of the collection.
190
- * */
191
- async getCollectionNFTsOnSaleCount(collection) {
192
- const result = await this.getResult(this.xo.methods.getTokenItemsForSaleCount([collection]));
193
- return parseInt(result.firstValue?.valueOf());
194
- }
195
- /** Gets the active unique auction IDs of collection.
196
- *
197
- * @param collection The collection identifier for which one wants to get the active unique auction IDs.
198
- *
199
- * @returns {number[]} The active unique auction IDs of collection.
200
- * */
201
- async getAuctionIDsForCollection(collection) {
202
- const result = await this.getResult(this.xo.methods.getAuctionsForTicker([collection]));
203
- const ids = result.firstValue?.valueOf().map((id) => parseInt(id));
204
- return ids;
205
- }
206
- /**
207
- * Withdraw auctions from the smart contract.
208
- *
209
- * @param auctionIDs The IDs of the auctions to withdraw from
210
- * @returns {Interaction} The interaction object of the smart contract
211
- */
212
- withdrawAuctions(auctionIDs, senderNonce, market) {
213
- if (market === 'XO') {
214
- const interaction = this.xo.methods.withdraw(auctionIDs);
215
- if (senderNonce.nonce) {
216
- interaction.withNonce(senderNonce.nonce);
217
- }
218
- return interaction
219
- .withChainID(this.api.chain)
220
- .withSender(new Address(senderNonce.address))
221
- .withGasLimit(Math.min(600_000_000, 15_000_000 + auctionIDs.length * 5_000_000));
222
- }
223
- else {
224
- throw new Error('Market not supported');
225
- }
226
- }
227
- /**
228
- * Withdraw global offer from the smart contract.
229
- *
230
- * @param auctionIDs The IDs of the global offer to withdraw
231
- * @returns {Interaction} The interaction object of the smart contract
232
- */
233
- withdrawGlobalOffer(offerID, senderNonce) {
234
- const interaction = this.xo.methods.withdrawGlobalOffer([offerID]);
235
- if (senderNonce.nonce) {
236
- interaction.withNonce(senderNonce.nonce);
237
- }
238
- return interaction
239
- .withChainID(this.api.chain)
240
- .withSender(new Address(senderNonce.address))
241
- .withGasLimit(15_000_000);
242
- }
243
- /**
244
- * Accept a global offer
245
- *
246
- * @param offerID The offer ID
247
- * @returns {Interaction} The interaction object of the smart contract
248
- */
249
- acceptGlobalOffer({ signature, offer_id, auction_id_opt, nft, address, nonce, }) {
250
- const interaction = signature
251
- ? this.xo.methods.acceptGlobalOffer([offer_id, auction_id_opt, signature])
252
- : this.xo.methods.acceptGlobalOffer([offer_id, auction_id_opt]);
253
- interaction.withSender(new Address(address));
254
- if (nft) {
255
- interaction.withSingleESDTNFTTransfer(TokenTransfer.semiFungible(nft.collection, nft.nonce, nft.amount ?? 1));
256
- }
257
- if (nonce) {
258
- interaction.withNonce(nonce);
259
- }
260
- return interaction.withChainID(this.api.chain).withGasLimit(30_000_000);
261
- }
262
- /**
263
- * Send a global offer
264
- * @param payment_token The token used for payment
265
- * @param payment_nonce The nonce of the payment token
266
- * @param price The price of the offer
267
- * @param collection The collection of the NFT
268
- * @param attributes The attributes of the NFT
269
- * @param depositAmount The deposit amount
270
- * @returns {Interaction} The interaction object of the smart contract
271
- * */
272
- sendGlobalOffer({ payment_token, payment_nonce, price, collection, attributes, depositAmount, address, nonce, }) {
273
- const interaction = attributes
274
- ? this.xo.methods.sendGlobalOffer([
275
- payment_token,
276
- payment_nonce,
277
- TokenTransfer.egldFromAmount(price).toString(),
278
- collection,
279
- attributes,
280
- ])
281
- : this.xo.methods.sendGlobalOffer([
282
- payment_token,
283
- payment_nonce,
284
- TokenTransfer.egldFromAmount(price).toString(),
285
- collection,
286
- ]);
287
- if (nonce) {
288
- interaction.withNonce(nonce);
289
- }
290
- interaction.withSender(new Address(address));
291
- if (depositAmount) {
292
- interaction.withValue(TokenTransfer.egldFromAmount(depositAmount));
293
- }
294
- return interaction.withChainID(this.api.chain).withGasLimit(30_000_000);
295
- }
296
- /**
297
- * Send a custom offer
298
- * @param payment_token The token used for payment
299
- * @param payment_nonce The nonce of the payment token
300
- * @param price The price of the offer
301
- * @param deadline The deadline of the offer
302
- * @param nft The NFT to be sold
303
- * @param depositAmount The deposit amount
304
- * @returns {Interaction} The interaction object of the smart contract
305
- * */
306
- sendCustomOffer({ payment_token, payment_nonce, price, deadline, nft, depositAmount, address, nonce, }) {
307
- const interaction = this.xo.methods.sendOffer([
308
- payment_token,
309
- payment_nonce,
310
- TokenTransfer.egldFromAmount(price).toString(),
311
- nft.collection,
312
- nft.nonce,
313
- nft.amount ?? 1,
314
- deadline,
315
- ]);
316
- if (nonce) {
317
- interaction.withNonce(nonce);
318
- }
319
- interaction.withSender(new Address(address));
320
- if (depositAmount) {
321
- interaction.withValue(TokenTransfer.egldFromAmount(depositAmount));
322
- }
323
- return interaction.withChainID(this.api.chain).withGasLimit(30_000_000);
324
- }
325
- /**
326
- * Withdraws a custom offer
327
- *
328
- * @param offerID The offer ID
329
- * @returns {Interaction} The interaction object of the smart contract
330
- */
331
- withdrawCustomOffer(offerID, senderNonce) {
332
- const interaction = this.xo.methods.withdrawOffer([offerID]);
333
- if (senderNonce.nonce) {
334
- interaction.withNonce(senderNonce.nonce);
335
- }
336
- interaction.withSender(new Address(senderNonce.address));
337
- return interaction.withChainID(this.api.chain).withGasLimit(15_000_000);
338
- }
339
- /**
340
- * Decline a custom offer
341
- *
342
- * @param offerID The offer ID
343
- * @returns {Interaction} The interaction object of the smart contract
344
- */
345
- declineCustomOffer(offerID, sender, nft) {
346
- const interaction = this.xo.methods.declineOffer([offerID]);
347
- if (sender.nonce) {
348
- interaction.withNonce(sender.nonce);
349
- }
350
- interaction.withSender(new Address(sender.address));
351
- if (nft) {
352
- interaction.withSingleESDTNFTTransfer(TokenTransfer.semiFungible(nft.collection, nft.nonce, nft.amount ?? 1));
353
- }
354
- return interaction.withChainID(this.api.chain).withGasLimit(20_000_000);
355
- }
356
- /**
357
- * Accept a custom offer
358
- *
359
- * @param offerID The offer ID
360
- * @returns {Interaction} The interaction object of the smart contract
361
- */
362
- acceptCustomOffer(offerID, sender, nft) {
363
- const interaction = this.xo.methods.acceptOffer([offerID]);
364
- if (sender.nonce) {
365
- interaction.withNonce(sender.nonce);
366
- }
367
- interaction.withSender(new Address(sender.address));
368
- if (nft) {
369
- interaction.withSingleESDTNFTTransfer(TokenTransfer.semiFungible(nft.collection, nft.nonce, nft.amount ?? 1));
370
- }
371
- return interaction.withChainID(this.api.chain).withGasLimit(30_000_000);
372
- }
373
- /**
374
- * @public
375
- * @function endAuction
376
- * @param {number} auctionID - The unique identifier of the auction.
377
- * @returns {Interaction} The resulting interaction with the specified chainID and gas limit.
378
- *
379
- * This function allows ending an auction by its auctionID. It takes the following parameter:
380
- * - auctionID (number): The unique identifier of the auction.
381
- *
382
- * The function calls the `endAuction` method on the smart contract with the provided auctionID.
383
- * Finally, it returns the resulting interaction with the specified chainID and gas limit.
384
- */
385
- endAuction(auctionID, sender, market = 'XO') {
386
- if (market == 'XO') {
387
- const interaction = this.xo.methods.endAuction([auctionID]);
388
- if (sender.nonce) {
389
- interaction.withNonce(sender.nonce);
390
- }
391
- interaction.withSender(new Address(sender.address));
392
- return interaction.withChainID(this.api.chain).withGasLimit(15_000_000);
393
- }
394
- else {
395
- throw new Error('Market not supported');
396
- }
397
- }
398
- /**
399
- * Bid on an auction
400
- *
401
- * @param auctionID The auction ID
402
- * @param collection The NFT Collection
403
- * @param nonce The NFT nonce
404
- * @param payment The payment object
405
- * @returns {Interaction} The interaction object of the smart contract
406
- */
407
- bidOnAuctionId(auctionID, collection, nonce, payment, sender) {
408
- const interaction = this.xo.methods.bid([auctionID, collection, nonce]);
409
- if (!payment.amount) {
410
- throw new Error('Payment amount is required');
411
- }
412
- if (sender.nonce) {
413
- interaction.withNonce(sender.nonce);
414
- }
415
- interaction.withSender(new Address(sender.address));
416
- if (payment.collection == 'EGLD' && payment.amount) {
417
- interaction.withValue(TokenTransfer.egldFromAmount(payment.amount));
418
- }
419
- else {
420
- interaction.withSingleESDTTransfer(TokenTransfer.fungibleFromAmount(payment.collection, payment.amount, payment.decimals ?? 18));
421
- }
422
- return interaction.withChainID(this.api.chain).withGasLimit(30_000_000);
423
- }
424
- /**
425
- * Bulk buy auctions
426
- *
427
- * @param auctionIDs The auction IDs
428
- * @param payment The payment object
429
- * @returns {Interaction} The interaction object of the smart contract
430
- */
431
- bulkBuy(auctionIDs, payment, sender) {
432
- const interaction = this.xo.methods.bid(auctionIDs);
433
- if (sender.nonce) {
434
- interaction.withNonce(sender.nonce);
435
- }
436
- interaction.withSender(new Address(sender.address));
437
- if (!payment.amount) {
438
- throw new Error('Payment amount is required');
439
- }
440
- if (payment.collection == 'EGLD' && payment.amount) {
441
- interaction.withValue(TokenTransfer.egldFromAmount(payment.amount));
442
- }
443
- else {
444
- interaction.withSingleESDTTransfer(TokenTransfer.fungibleFromAmount(payment.collection, payment.amount, payment.decimals ?? 18));
445
- }
446
- return interaction
447
- .withChainID(this.api.chain)
448
- .withGasLimit(Math.min(600_000_000, 20_000_000 + auctionIDs.length * 5_000_000));
449
- }
450
- /**
451
- * @public
452
- * @async
453
- * @function buyAuctionById
454
- * @param {Object} options - An object containing the necessary parameters to buy an auction.
455
- * @param {number} options.auctionID - The unique identifier of the auction.
456
- * @param {string} [options.collection] - The collection the auctioned token belongs to (optional).
457
- * @param {number} [options.nonce] - The nonce of the auctioned token (optional).
458
- * @param {number} [options.quantity=1] - The quantity of tokens to buy (default is 1).
459
- * @param {string} [options.token='EGLD'] - The payment token (default is 'EGLD').
460
- * @param {number} [options.paymentAmount] - The payment amount for the auction (optional).
461
- * @param {boolean} [options.withCheck=true] - Whether to check the auction information (default is true).
462
- * @param {boolean} [options.isBigUintPayment=false] - Whether the payment amount is a big integer (default is false).
463
- * @returns {Promise<Interaction>} The resulting interaction with the specified chainID and gas limit.
464
- *
465
- * This function allows a user to buy an auction by its auctionID. It takes an object with the following properties:
466
- * - auctionID (number): The unique identifier of the auction.
467
- * - collection (string, optional): The collection the auctioned token belongs to.
468
- * - nonce (number, optional): The nonce of the auctioned token.
469
- * - quantity (number, optional): The quantity of tokens to buy (default is 1).
470
- * - token (string, optional): The payment token (default is 'EGLD').
471
- * - paymentAmount (number, optional): The payment amount for the auction.
472
- * - withCheck (boolean, optional): Whether to check the auction information (default is true).
473
- * - isBigUintPayment (boolean, optional): Whether the payment amount is a big integer (default is false).
474
- *
475
- * The function first checks if the auction exists and if its type is NFT or SftOnePerPayment. If not, an error is thrown.
476
- * Then, it calculates the payment amount and calls the `buy` method on the smart contract with the provided parameters.
477
- * Finally, the function returns the resulting interaction with the specified chainID and gas limit.
478
- */
479
- async buyAuctionById({ auctionID, collection, nonce, paymentAmount, quantity = 1, token = 'EGLD', withCheck = true, isBigUintPayment = false, address, nonce: senderNonce, isBid = false, decimals = 18, market = 'XO', }) {
480
- if (market !== 'XO') {
481
- throw new Error('Market not supported');
482
- }
483
- if (!auctionID) {
484
- throw new Error('AuctionID not provided');
485
- }
486
- let auction = null;
487
- if (!paymentAmount || !token || !collection || !nonce || withCheck) {
488
- auction = await this.getAuctionInfo(auctionID);
489
- if (auction === null) {
490
- throw new Error('Auction not found');
491
- }
492
- if (auction.auction_type === AuctionType.Nft ||
493
- auction.auction_type === AuctionType.SftOnePerPayment) {
494
- throw new Error('Auction type is not NFT or SftOnePerPayment');
495
- }
496
- }
497
- const paymentToken = auction?.payment_token_type ?? token;
498
- const bigNumber = auction ? true : isBigUintPayment;
499
- let amount = isBid
500
- ? auction?.max_bid ?? paymentAmount
501
- : auction?.min_bid ?? paymentAmount;
502
- if (!amount) {
503
- throw new Error('Payment amount not provided');
504
- }
505
- const interaction = this.xo.methods.buy([
506
- auctionID,
507
- auction?.auctioned_token_type ?? collection,
508
- auction?.auctioned_token_nonce ?? nonce,
509
- quantity ?? 1,
510
- ]);
511
- if (senderNonce) {
512
- interaction.withNonce(senderNonce);
513
- }
514
- interaction.withSender(new Address(address));
515
- if (token === 'EGLD') {
516
- interaction.withValue(bigNumber
517
- ? TokenTransfer.egldFromBigInteger(new BigNumber(amount).multipliedBy(quantity))
518
- : TokenTransfer.egldFromAmount(new BigNumber(amount).multipliedBy(quantity)));
519
- }
520
- else {
521
- if (!bigNumber) {
522
- auction = await this.getAuctionInfo(auctionID);
523
- if (auction === null) {
524
- throw new Error('Auction not found');
525
- }
526
- amount = isBid ? auction.max_bid : auction.min_bid;
527
- }
528
- interaction.withSingleESDTTransfer(TokenTransfer.fungibleFromBigInteger(paymentToken, amount, decimals));
529
- }
530
- return interaction.withChainID(this.api.chain).withGasLimit(20_000_000);
531
- }
532
- /**
533
- * @docutype
534
- * @public
535
- * @async
536
- * @function changeListing
537
- * @param {ChangeListing[]} listings - An array of objects containing the information needed to change a listing.
538
- * @returns {Interaction} The resulting interaction with the specified chainID and gas limit.
539
- *
540
- * This function takes an array of `ChangeListing` objects and constructs `Struct` instances using the provided
541
- * information. Each `ChangeListing` object should have the following properties:
542
- * - paymentToken (string): The identifier of the payment token type.
543
- * - price (BigInt): The new price for the listing.
544
- * - auctionID (number): The unique identifier of the auction.
545
- * - deadline (number): The deadline (in Unix time) for the listing.
546
- *
547
- * The function then calls the `changeListing` method on the smart contract and returns the resulting interaction
548
- * with the specified chainID and gas limit.
549
- */
550
- async changeListing(listings, sender) {
551
- const fooType = new StructType('BulkUpdateListing', [
552
- new FieldDefinition('payment_token_type', '', new TokenIdentifierType()),
553
- new FieldDefinition('new_price', '', new BigUIntType()),
554
- new FieldDefinition('auction_id', '', new U64Type()),
555
- new FieldDefinition('deadline', '', new U64Type()),
556
- ]);
557
- const structs = [];
558
- listings.forEach(({ paymentToken, price, auctionID, deadline }) => {
559
- structs.push(new Struct(fooType, [
560
- new Field(new TokenIdentifierValue(paymentToken), 'payment_token_type'),
561
- new Field(new BigUIntValue(price), 'new_price'),
562
- new Field(new U64Value(auctionID), 'auction_id'),
563
- new Field(new U64Value(deadline), 'deadline'),
564
- ]));
565
- });
566
- const interaction = this.xo.methods.changeListing(structs);
567
- if (sender.nonce) {
568
- interaction.withNonce(sender.nonce);
569
- }
570
- interaction.withSender(new Address(sender.address));
571
- return interaction
572
- .withChainID(this.api.chain)
573
- .withGasLimit(Math.min(600_000_000, 8_000_000 + listings.length * 2_000_000));
574
- }
575
- async listNFTs(listings, sender) {
576
- const fooType = new StructType('BulkListing', [
577
- new FieldDefinition('min_bid', '', new BigUIntType()),
578
- new FieldDefinition('max_bid', '', new BigUIntType()),
579
- new FieldDefinition('deadline', '', new U64Type()),
580
- new FieldDefinition('accepted_payment_token', '', new TokenIdentifierType()),
581
- new FieldDefinition('bid', '', new BooleanType()),
582
- new FieldDefinition('opt_sft_max_one_per_payment', '', new BooleanType()),
583
- new FieldDefinition('opt_start_time', '', new U64Type()),
584
- new FieldDefinition('collection', '', new TokenIdentifierType()),
585
- new FieldDefinition('nonce', '', new U64Type()),
586
- new FieldDefinition('nft_amount', '', new BigUIntType()),
587
- ]);
588
- const structs = [];
589
- const tokens = [];
590
- listings.forEach((listing) => {
591
- const decimals = listing.accepted_payment_token_decimals ?? 18;
592
- const minBID = new BigNumber(listing.min_bid).shiftedBy(decimals);
593
- const maxBID = new BigNumber(listing.max_bid ?? 0).shiftedBy(decimals);
594
- tokens.push(TokenTransfer.semiFungible(listing.collection, listing.nonce, listing.nft_amount));
595
- structs.push(new Struct(fooType, [
596
- new Field(new BigUIntValue(minBID), 'min_bid'),
597
- new Field(new BigUIntValue(maxBID), 'max_bid'),
598
- new Field(new U64Value(new BigNumber(listing.deadline ?? 0)), 'deadline'),
599
- new Field(new TokenIdentifierValue(listing.accepted_payment_token ?? 'EGLD'), 'accepted_payment_token'),
600
- new Field(new BooleanValue(listing.bid ?? false), 'bid'),
601
- new Field(new BooleanValue(listing.isSFTPack ?? false), 'opt_sft_max_one_per_payment'),
602
- new Field(new U64Value(new BigNumber(listing.opt_start_time ? listing.opt_start_time : 0)), 'opt_start_time'),
603
- new Field(new TokenIdentifierValue(listing.collection), 'collection'),
604
- new Field(new U64Value(listing.nonce), 'nonce'),
605
- new Field(new BigUIntValue(new BigNumber(listing.nft_amount)), 'nft_amount'),
606
- ]));
607
- });
608
- const interaction = this.xo.methods.listings(structs);
609
- if (sender.nonce) {
610
- interaction.withNonce(sender.nonce);
611
- }
612
- interaction.withSender(new Address(sender.address));
613
- interaction.withMultiESDTNFTTransfer(tokens);
614
- return interaction
615
- .withChainID(this.api.chain)
616
- .withGasLimit(Math.min(600_000_000, 8_000_000 + listings.length * 2_000_000));
617
- }
618
- }
619
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAGL,WAAW,GAQZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,MAAM,EACN,UAAU,GACX,MAAM,2DAA2D,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EACL,KAAK,EACL,eAAe,GAChB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EACL,WAAW,EACX,YAAY,GACb,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,MAAM,OAAO,aAAa;IAChB,EAAE,CAAgB;IAClB,IAAI,CAAsB;IAC1B,GAAG,CAAc;IACzB,YAAoB,cAA6B;QAC/C,IAAI,CAAC,EAAE,GAAG,cAAc,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,mBAAmB,EAAE,CAAC;QACtC,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAI;QACf,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;QAC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