@tradeport/sui-trading-sdk 0.4.63 → 0.4.64
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/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +31 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/methods/listNfts/listNfts.ts +0 -1
- package/src/methods/sponsorNftListing/addSponsorNftListingTx.ts +14 -12
- package/src/methods/sponsorNftListing/sponsorNftListing.ts +0 -3
package/dist/index.mjs
CHANGED
|
@@ -142,6 +142,7 @@ var TRADEPORT_NFT_STRATEGY_PACKAGE_ID = "0xb7386fc8c6e64ea2b0079e293592b57e98498
|
|
|
142
142
|
var TRADEPORT_NFT_STRATEGY_MANAGER_ID = "0xfb58ee62b3a62a8150f871da950dfdf923cd0d97b153caf99b5219cd4ddda5bd";
|
|
143
143
|
var TRADEPORT_POOL_REGISTRY_ID = "0xcd0a614c4cbbf173f59dee2602c43a1717f283215ed7a0bb1d55d786af16fbcd";
|
|
144
144
|
var TRADEPORT_POOL_VERSIONED_ID = "0x0309b66202e9aaf470081fffee7ffc0fbd50e3b7400d4f56fd06502e4dbbd676";
|
|
145
|
+
var USDC_COIN_TYPE = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
|
|
145
146
|
var COLLECTION_IDS_WITH_ZERO_COMMISSION = [
|
|
146
147
|
""
|
|
147
148
|
];
|
|
@@ -5697,18 +5698,15 @@ async function relistNft({
|
|
|
5697
5698
|
}
|
|
5698
5699
|
|
|
5699
5700
|
// src/methods/sponsorNftListing/addSponsorNftListingTx.ts
|
|
5701
|
+
import { coinWithBalance } from "@mysten/sui/transactions";
|
|
5700
5702
|
var addSponsorListingTx = async ({
|
|
5701
5703
|
tx,
|
|
5702
|
-
coinToSplit,
|
|
5703
5704
|
nftTokenId,
|
|
5704
5705
|
nftType,
|
|
5705
5706
|
sponsorOptions
|
|
5706
5707
|
}) => {
|
|
5707
|
-
const
|
|
5708
|
-
|
|
5709
|
-
new bigNumberConfig_default(sponsorOptions?.usdcFeeAmountPerPeriod)?.times(sponsorOptions?.numOfPeriods).toString()
|
|
5710
|
-
)
|
|
5711
|
-
]);
|
|
5708
|
+
const totalFee = new bigNumberConfig_default(sponsorOptions?.usdcFeeAmountPerPeriod)?.times(sponsorOptions?.numOfPeriods).toString();
|
|
5709
|
+
const sponsorCoin = sponsorOptions.coinToSplit ? tx.splitCoins(sponsorOptions.coinToSplit, [tx.pure.u64(totalFee)])[0] : coinWithBalance({ type: USDC_COIN_TYPE, balance: BigInt(totalFee) });
|
|
5712
5710
|
tx.moveCall({
|
|
5713
5711
|
target: `${TRADEPORT_LISTINGS_PACKAGE}::tradeport_listings::add_sponsored_listing`,
|
|
5714
5712
|
arguments: [
|
|
@@ -5716,7 +5714,7 @@ var addSponsorListingTx = async ({
|
|
|
5716
5714
|
tx.object.clock(),
|
|
5717
5715
|
tx.pure.id(nftTokenId),
|
|
5718
5716
|
tx.pure.u64(sponsorOptions?.numOfPeriods),
|
|
5719
|
-
tx.object(
|
|
5717
|
+
tx.object(sponsorCoin)
|
|
5720
5718
|
],
|
|
5721
5719
|
typeArguments: [nftType]
|
|
5722
5720
|
});
|
|
@@ -5783,7 +5781,6 @@ var listNfts = async ({ nfts, walletAddress, tx: existingTx }, context) => {
|
|
|
5783
5781
|
if (inputNft?.sponsorOptions?.shouldSponsor) {
|
|
5784
5782
|
await addSponsorListingTx({
|
|
5785
5783
|
tx,
|
|
5786
|
-
coinToSplit: inputNft?.sponsorOptions?.coinToSplit,
|
|
5787
5784
|
nftTokenId: nft?.token_id,
|
|
5788
5785
|
nftType,
|
|
5789
5786
|
sponsorOptions: inputNft?.sponsorOptions
|
|
@@ -6751,7 +6748,6 @@ var fetchNftCollectionChainState = gql21`
|
|
|
6751
6748
|
// src/methods/sponsorNftListing/sponsorNftListing.ts
|
|
6752
6749
|
var sponsorNftListing = async ({
|
|
6753
6750
|
tx: existingTx,
|
|
6754
|
-
coinToSplit,
|
|
6755
6751
|
nftTokenId,
|
|
6756
6752
|
options
|
|
6757
6753
|
}) => {
|
|
@@ -6776,7 +6772,6 @@ var sponsorNftListing = async ({
|
|
|
6776
6772
|
const tx = existingTx ?? new Transaction19();
|
|
6777
6773
|
await addSponsorListingTx({
|
|
6778
6774
|
tx,
|
|
6779
|
-
coinToSplit,
|
|
6780
6775
|
nftTokenId,
|
|
6781
6776
|
nftType,
|
|
6782
6777
|
sponsorOptions: options
|