@tradeport/sui-trading-sdk 0.4.39 → 0.4.40
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 +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +310 -160
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +270 -130
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -4
- package/src/SuiTradingClient.ts +18 -4
- package/src/helpers/kiosk/getKioskIdFromKioskTx.ts +1 -1
- package/src/helpers/kiosk/kioskTxWrapper.ts +3 -3
- package/src/helpers/kiosk/lockNftInsideKioskIfNotLocked.ts +1 -1
- package/src/helpers/kiosk/resolveRoyaltyRule.ts +5 -0
- package/src/helpers/kiosk/resolveTransferPolicies.ts +3 -0
- package/src/helpers/kiosk/takeLockedNftFromKiosk.ts +12 -4
- package/src/helpers/swap/swap.ts +147 -0
- package/src/methods/acceptCollectionBid/acceptCollectionBid.ts +1 -1
- package/src/methods/acceptNftBids/acceptNftBids.ts +1 -1
- package/src/methods/buyListings/addBuyListingTxs.ts +5 -0
- package/src/methods/buyListings/buyListings.ts +20 -7
- package/src/methods/cancelNftTransfers/cancelNftTransfers.ts +1 -1
- package/src/methods/claimNfts/claimNfts.ts +1 -1
- package/src/methods/createMultiBid/createMultiBid.ts +6 -7
- package/src/methods/listNfts/listNfts.ts +1 -1
- package/src/methods/migrateNftsFromUnsharedToSharedKiosks/migrateNftsFromUnsharedToSharedKiosks.ts +1 -1
- package/src/methods/placeCollectionBids/placeCollectionBids.ts +28 -8
- package/src/methods/placeNftBids/addPlaceNftBidTxs.ts +8 -7
- package/src/methods/placeNftBids/placeNftBids.ts +27 -8
- package/src/methods/removeCollectionBids/removeCollectionBids.ts +1 -1
- package/src/methods/removeNftBids/removeNftBids.ts +1 -1
- package/src/methods/transferNfts/transferNfts.ts +1 -1
- package/src/methods/unlistListings/unlistListings.ts +1 -2
- package/src/methods/updateMultiBid/updateMultiBid.ts +35 -4
- package/src/methods/withdrawProfitsFromKiosks/withdrawProfitsFromKiosks.ts +3 -3
- package/src/helpers/extractSwapResultCoin.ts +0 -17
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Transaction } from '@mysten/sui/transactions';
|
|
2
2
|
import { GraphQLClient } from 'graphql-request';
|
|
3
3
|
import { KioskTransaction } from '@mysten/kiosk';
|
|
4
|
+
import { Protocol } from '@flowx-finance/sdk';
|
|
5
|
+
import { StringValue } from 'ms';
|
|
6
|
+
import { SuiClient } from '@mysten/sui/client';
|
|
4
7
|
|
|
5
8
|
type AcceptCollectionBid = {
|
|
6
9
|
bidId: string;
|
|
@@ -34,12 +37,22 @@ type BuyAndExerciseShortLocks = {
|
|
|
34
37
|
tx?: Transaction;
|
|
35
38
|
};
|
|
36
39
|
|
|
40
|
+
interface SwapAndPayOptions {
|
|
41
|
+
coinType?: string;
|
|
42
|
+
coinAmount?: string;
|
|
43
|
+
slippage?: number;
|
|
44
|
+
ttl?: StringValue;
|
|
45
|
+
excludeSources?: Protocol[];
|
|
46
|
+
amountToSplitFromSuiBalance?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
37
49
|
type BuyListings = {
|
|
38
50
|
listingIds: string[];
|
|
39
51
|
walletAddress: string;
|
|
40
52
|
tx?: Transaction | string;
|
|
41
53
|
kioskTx?: KioskTransaction;
|
|
42
54
|
coinToSplit?: any;
|
|
55
|
+
swapAndPayOptions?: SwapAndPayOptions;
|
|
43
56
|
beforeResolveKioskTransferRequest?: (transferRequest: any) => void | Promise<void>;
|
|
44
57
|
};
|
|
45
58
|
|
|
@@ -134,6 +147,7 @@ type PlaceCollectionBid = {
|
|
|
134
147
|
multiBidChainId?: any;
|
|
135
148
|
expireAt?: Date;
|
|
136
149
|
tx?: Transaction | string;
|
|
150
|
+
swapAndPayOptions?: SwapAndPayOptions;
|
|
137
151
|
};
|
|
138
152
|
|
|
139
153
|
type PlaceNftBids = {
|
|
@@ -146,6 +160,7 @@ type PlaceNftBids = {
|
|
|
146
160
|
multiBidId?: string;
|
|
147
161
|
multiBidChainId?: any;
|
|
148
162
|
tx?: Transaction | string;
|
|
163
|
+
swapAndPayOptions?: SwapAndPayOptions;
|
|
149
164
|
};
|
|
150
165
|
|
|
151
166
|
type RemoveCollectionBids = {
|
|
@@ -177,6 +192,8 @@ interface UpdateMultiBid {
|
|
|
177
192
|
amountToWithdraw?: bigint;
|
|
178
193
|
tx?: Transaction | string;
|
|
179
194
|
multiBidChainId?: any;
|
|
195
|
+
swapAndPayOptions?: SwapAndPayOptions;
|
|
196
|
+
suiClient?: SuiClient;
|
|
180
197
|
}
|
|
181
198
|
|
|
182
199
|
type WithdrawProfitsFromKiosks = {
|
|
@@ -196,13 +213,13 @@ declare class SuiTradingClient {
|
|
|
196
213
|
private readonly kioskClient;
|
|
197
214
|
private readonly allowedApiUsersForUnsharedKiosksMigration;
|
|
198
215
|
constructor({ apiUser, apiKey, suiNodeUrl, graphQLClient }: ApiConfig);
|
|
199
|
-
buyListings({ listingIds, walletAddress, tx }: BuyListings): Promise<Transaction>;
|
|
216
|
+
buyListings({ listingIds, walletAddress, tx, swapAndPayOptions, }: BuyListings): Promise<Transaction>;
|
|
200
217
|
listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
|
|
201
218
|
unlistListings({ listingIds, walletAddress }: UnlistListings): Promise<Transaction>;
|
|
202
219
|
placeNftBids(data: PlaceNftBids): Promise<Transaction>;
|
|
203
220
|
removeNftBids({ bidIds, tx }: RemoveNftBids): Promise<Transaction>;
|
|
204
221
|
acceptNftBids({ bidIds, walletAddress }: AcceptNftBids): Promise<Transaction>;
|
|
205
|
-
placeCollectionBid({ collectionId, bidAmountInMist, numOfBids, walletAddress, multiBidId, multiBidChainId, expireAt, tx, }: PlaceCollectionBid): Promise<Transaction>;
|
|
222
|
+
placeCollectionBid({ collectionId, bidAmountInMist, numOfBids, walletAddress, multiBidId, multiBidChainId, expireAt, tx, swapAndPayOptions, }: PlaceCollectionBid): Promise<Transaction>;
|
|
206
223
|
acceptCollectionBid({ bidId, nftId, walletAddress }: AcceptCollectionBid): Promise<Transaction>;
|
|
207
224
|
removeCollectionBids({ bidIds, tx }: RemoveCollectionBids): Promise<Transaction>;
|
|
208
225
|
transferNfts({ nftIds, recipientAddress, walletAddress }: TransferNfts): Promise<Transaction>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Transaction } from '@mysten/sui/transactions';
|
|
2
2
|
import { GraphQLClient } from 'graphql-request';
|
|
3
3
|
import { KioskTransaction } from '@mysten/kiosk';
|
|
4
|
+
import { Protocol } from '@flowx-finance/sdk';
|
|
5
|
+
import { StringValue } from 'ms';
|
|
6
|
+
import { SuiClient } from '@mysten/sui/client';
|
|
4
7
|
|
|
5
8
|
type AcceptCollectionBid = {
|
|
6
9
|
bidId: string;
|
|
@@ -34,12 +37,22 @@ type BuyAndExerciseShortLocks = {
|
|
|
34
37
|
tx?: Transaction;
|
|
35
38
|
};
|
|
36
39
|
|
|
40
|
+
interface SwapAndPayOptions {
|
|
41
|
+
coinType?: string;
|
|
42
|
+
coinAmount?: string;
|
|
43
|
+
slippage?: number;
|
|
44
|
+
ttl?: StringValue;
|
|
45
|
+
excludeSources?: Protocol[];
|
|
46
|
+
amountToSplitFromSuiBalance?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
37
49
|
type BuyListings = {
|
|
38
50
|
listingIds: string[];
|
|
39
51
|
walletAddress: string;
|
|
40
52
|
tx?: Transaction | string;
|
|
41
53
|
kioskTx?: KioskTransaction;
|
|
42
54
|
coinToSplit?: any;
|
|
55
|
+
swapAndPayOptions?: SwapAndPayOptions;
|
|
43
56
|
beforeResolveKioskTransferRequest?: (transferRequest: any) => void | Promise<void>;
|
|
44
57
|
};
|
|
45
58
|
|
|
@@ -134,6 +147,7 @@ type PlaceCollectionBid = {
|
|
|
134
147
|
multiBidChainId?: any;
|
|
135
148
|
expireAt?: Date;
|
|
136
149
|
tx?: Transaction | string;
|
|
150
|
+
swapAndPayOptions?: SwapAndPayOptions;
|
|
137
151
|
};
|
|
138
152
|
|
|
139
153
|
type PlaceNftBids = {
|
|
@@ -146,6 +160,7 @@ type PlaceNftBids = {
|
|
|
146
160
|
multiBidId?: string;
|
|
147
161
|
multiBidChainId?: any;
|
|
148
162
|
tx?: Transaction | string;
|
|
163
|
+
swapAndPayOptions?: SwapAndPayOptions;
|
|
149
164
|
};
|
|
150
165
|
|
|
151
166
|
type RemoveCollectionBids = {
|
|
@@ -177,6 +192,8 @@ interface UpdateMultiBid {
|
|
|
177
192
|
amountToWithdraw?: bigint;
|
|
178
193
|
tx?: Transaction | string;
|
|
179
194
|
multiBidChainId?: any;
|
|
195
|
+
swapAndPayOptions?: SwapAndPayOptions;
|
|
196
|
+
suiClient?: SuiClient;
|
|
180
197
|
}
|
|
181
198
|
|
|
182
199
|
type WithdrawProfitsFromKiosks = {
|
|
@@ -196,13 +213,13 @@ declare class SuiTradingClient {
|
|
|
196
213
|
private readonly kioskClient;
|
|
197
214
|
private readonly allowedApiUsersForUnsharedKiosksMigration;
|
|
198
215
|
constructor({ apiUser, apiKey, suiNodeUrl, graphQLClient }: ApiConfig);
|
|
199
|
-
buyListings({ listingIds, walletAddress, tx }: BuyListings): Promise<Transaction>;
|
|
216
|
+
buyListings({ listingIds, walletAddress, tx, swapAndPayOptions, }: BuyListings): Promise<Transaction>;
|
|
200
217
|
listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
|
|
201
218
|
unlistListings({ listingIds, walletAddress }: UnlistListings): Promise<Transaction>;
|
|
202
219
|
placeNftBids(data: PlaceNftBids): Promise<Transaction>;
|
|
203
220
|
removeNftBids({ bidIds, tx }: RemoveNftBids): Promise<Transaction>;
|
|
204
221
|
acceptNftBids({ bidIds, walletAddress }: AcceptNftBids): Promise<Transaction>;
|
|
205
|
-
placeCollectionBid({ collectionId, bidAmountInMist, numOfBids, walletAddress, multiBidId, multiBidChainId, expireAt, tx, }: PlaceCollectionBid): Promise<Transaction>;
|
|
222
|
+
placeCollectionBid({ collectionId, bidAmountInMist, numOfBids, walletAddress, multiBidId, multiBidChainId, expireAt, tx, swapAndPayOptions, }: PlaceCollectionBid): Promise<Transaction>;
|
|
206
223
|
acceptCollectionBid({ bidId, nftId, walletAddress }: AcceptCollectionBid): Promise<Transaction>;
|
|
207
224
|
removeCollectionBids({ bidIds, tx }: RemoveCollectionBids): Promise<Transaction>;
|
|
208
225
|
transferNfts({ nftIds, recipientAddress, walletAddress }: TransferNfts): Promise<Transaction>;
|