@tradeport/sui-trading-sdk 0.4.65 → 0.4.66

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 CHANGED
@@ -1,9 +1,6 @@
1
- import * as _mysten_sui_dist_cjs_transactions from '@mysten/sui/dist/cjs/transactions';
2
1
  import { Transaction } from '@mysten/sui/transactions';
3
2
  import { GraphQLClient } from 'graphql-request';
4
3
  import { KioskTransaction } from '@mysten/kiosk';
5
- import { Protocol, Route, Coin, Commission, GetRoutesResult } from '@flowx-finance/sdk';
6
- import { StringValue } from 'ms';
7
4
 
8
5
  type AcceptCollectionBid = {
9
6
  bidId: string;
@@ -26,10 +23,16 @@ type ApplyFtStrategy = {
26
23
  collectionChainState?: Record<string, unknown>;
27
24
  };
28
25
 
26
+ type ApplyNftStrategy = {
27
+ collectionId: string;
28
+ strategyFtType?: string;
29
+ tx?: Transaction;
30
+ };
31
+
29
32
  type BuyListings = {
30
33
  listingIds: string[];
31
34
  walletAddress: string;
32
- tx?: Transaction | string;
35
+ tx?: Transaction;
33
36
  kioskTx?: KioskTransaction;
34
37
  coinToSplit?: any;
35
38
  beforeResolveKioskTransferRequest?: (transferRequest: any) => void | Promise<void>;
@@ -55,20 +58,18 @@ interface CreateMultiBid {
55
58
  walletAddress: string;
56
59
  name?: string;
57
60
  amount?: bigint;
58
- tx?: Transaction | string;
61
+ tx?: Transaction;
59
62
  }
60
63
 
61
64
  type SponsorNftListingOptions = {
62
65
  shouldSponsor?: boolean;
63
66
  numOfPeriods?: number;
64
- slippage?: number;
65
- coinInType?: string;
66
- coinInAmount?: string;
67
67
  usdcFeeAmountPerPeriod?: number;
68
+ coinToSplit?: any;
68
69
  };
69
70
  type SponsorNftListing = {
71
+ tx?: Transaction;
70
72
  nftTokenId: string;
71
- walletAddress: string;
72
73
  options: SponsorNftListingOptions;
73
74
  };
74
75
 
@@ -79,6 +80,7 @@ type ListNfts = {
79
80
  sponsorOptions?: SponsorNftListingOptions;
80
81
  }>;
81
82
  walletAddress: string;
83
+ tx?: Transaction;
82
84
  };
83
85
 
84
86
  type MigrateNftsFromUnsharedToSharedKiosks = {
@@ -94,7 +96,7 @@ type PlaceCollectionBid = {
94
96
  multiBidId?: string;
95
97
  multiBidChainId?: any;
96
98
  expireAt?: Date;
97
- tx?: Transaction | string;
99
+ tx?: Transaction;
98
100
  };
99
101
 
100
102
  type PlaceNftBids = {
@@ -106,7 +108,8 @@ type PlaceNftBids = {
106
108
  walletAddress: string;
107
109
  multiBidId?: string;
108
110
  multiBidChainId?: any;
109
- tx?: Transaction | string;
111
+ tx?: Transaction;
112
+ coinToSplit?: any;
110
113
  };
111
114
 
112
115
  type RemoveCollectionBids = {
@@ -136,46 +139,20 @@ interface UpdateMultiBid {
136
139
  name?: string;
137
140
  amount?: bigint;
138
141
  amountToWithdraw?: bigint;
139
- tx?: Transaction | string;
142
+ tx?: Transaction;
140
143
  multiBidChainId?: any;
144
+ coinToSplit?: any;
141
145
  }
142
146
 
143
147
  type WithdrawProfitsFromKiosks = {
144
148
  walletAddress: string;
145
149
  };
146
150
 
147
- type ApplyNftStrategy = {
148
- collectionId: string;
149
- strategyFtType?: string;
150
- tx?: Transaction;
151
- };
152
-
153
- type SwapCoins = {
154
- walletAddress: string;
155
- coinInType: string;
156
- coinInAmount: string;
157
- coinOutType: string;
158
- slippage?: number;
159
- ttl?: StringValue;
160
- excludeSources?: Protocol[];
161
- routes?: Array<Route<Coin, Coin>>;
162
- commission?: Commission;
163
- tx?: Transaction;
164
- };
165
- type SwapRoutesArgs = {
166
- walletAddress: string;
167
- coinInType: string;
168
- coinOutType: string;
169
- amountToSwap: bigint;
170
- excludeSources?: Protocol[];
171
- commission?: Commission;
172
- };
173
-
174
151
  type ApiConfig = {
175
152
  apiUser: string;
176
153
  apiKey: string;
177
154
  apiUrl?: string;
178
- defiRouterUrl?: string;
155
+ tradeportRouterUrl?: string;
179
156
  apiVercelId?: string;
180
157
  suiNodeUrl?: string;
181
158
  graphQLClient?: GraphQLClient;
@@ -183,13 +160,13 @@ type ApiConfig = {
183
160
  declare class SuiTradingClient {
184
161
  private readonly apiUser;
185
162
  private readonly apiKey;
186
- private readonly defiRouterUrl;
163
+ private readonly tradeportRouterUrl?;
187
164
  private readonly suiClient;
188
165
  private readonly kioskClient;
189
166
  private readonly allowedApiUsersForUnsharedKiosksMigration;
190
- constructor({ apiUser, apiKey, apiVercelId, apiUrl, defiRouterUrl, suiNodeUrl, graphQLClient, }: ApiConfig);
191
- buyListings({ listingIds, walletAddress, tx }: BuyListings): Promise<Transaction>;
192
- listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
167
+ constructor({ apiUser, apiKey, apiVercelId, apiUrl, tradeportRouterUrl, suiNodeUrl, graphQLClient, }: ApiConfig);
168
+ buyListings(args: BuyListings): Promise<Transaction>;
169
+ listNfts({ nfts, walletAddress, tx }: ListNfts): Promise<Transaction>;
193
170
  unlistListings({ listingIds, walletAddress }: UnlistListings): Promise<Transaction>;
194
171
  placeNftBids(data: PlaceNftBids): Promise<Transaction>;
195
172
  removeNftBids({ bidIds, tx }: RemoveNftBids): Promise<Transaction>;
@@ -211,12 +188,6 @@ declare class SuiTradingClient {
211
188
  sponsorNftListing(args: SponsorNftListing): Promise<Transaction>;
212
189
  applyFtStrategy(args: ApplyFtStrategy): Promise<Transaction>;
213
190
  applyTradeportNftStrategy(args: ApplyNftStrategy): Promise<Transaction>;
214
- swapCoins(args: SwapCoins): Promise<{
215
- tx: Transaction;
216
- coinOut: _mysten_sui_dist_cjs_transactions.TransactionResult;
217
- }>;
218
- buildSwapRoutes(args: SwapRoutesArgs): Promise<GetRoutesResult<Coin, Coin>>;
219
- calculateAmountToSwap(args: Pick<SwapCoins, 'coinInType' | 'coinOutType' | 'coinInAmount'>): Promise<bigint>;
220
191
  }
221
192
 
222
193
  export { SuiTradingClient };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,6 @@
1
- import * as _mysten_sui_dist_cjs_transactions from '@mysten/sui/dist/cjs/transactions';
2
1
  import { Transaction } from '@mysten/sui/transactions';
3
2
  import { GraphQLClient } from 'graphql-request';
4
3
  import { KioskTransaction } from '@mysten/kiosk';
5
- import { Protocol, Route, Coin, Commission, GetRoutesResult } from '@flowx-finance/sdk';
6
- import { StringValue } from 'ms';
7
4
 
8
5
  type AcceptCollectionBid = {
9
6
  bidId: string;
@@ -26,10 +23,16 @@ type ApplyFtStrategy = {
26
23
  collectionChainState?: Record<string, unknown>;
27
24
  };
28
25
 
26
+ type ApplyNftStrategy = {
27
+ collectionId: string;
28
+ strategyFtType?: string;
29
+ tx?: Transaction;
30
+ };
31
+
29
32
  type BuyListings = {
30
33
  listingIds: string[];
31
34
  walletAddress: string;
32
- tx?: Transaction | string;
35
+ tx?: Transaction;
33
36
  kioskTx?: KioskTransaction;
34
37
  coinToSplit?: any;
35
38
  beforeResolveKioskTransferRequest?: (transferRequest: any) => void | Promise<void>;
@@ -55,20 +58,18 @@ interface CreateMultiBid {
55
58
  walletAddress: string;
56
59
  name?: string;
57
60
  amount?: bigint;
58
- tx?: Transaction | string;
61
+ tx?: Transaction;
59
62
  }
60
63
 
61
64
  type SponsorNftListingOptions = {
62
65
  shouldSponsor?: boolean;
63
66
  numOfPeriods?: number;
64
- slippage?: number;
65
- coinInType?: string;
66
- coinInAmount?: string;
67
67
  usdcFeeAmountPerPeriod?: number;
68
+ coinToSplit?: any;
68
69
  };
69
70
  type SponsorNftListing = {
71
+ tx?: Transaction;
70
72
  nftTokenId: string;
71
- walletAddress: string;
72
73
  options: SponsorNftListingOptions;
73
74
  };
74
75
 
@@ -79,6 +80,7 @@ type ListNfts = {
79
80
  sponsorOptions?: SponsorNftListingOptions;
80
81
  }>;
81
82
  walletAddress: string;
83
+ tx?: Transaction;
82
84
  };
83
85
 
84
86
  type MigrateNftsFromUnsharedToSharedKiosks = {
@@ -94,7 +96,7 @@ type PlaceCollectionBid = {
94
96
  multiBidId?: string;
95
97
  multiBidChainId?: any;
96
98
  expireAt?: Date;
97
- tx?: Transaction | string;
99
+ tx?: Transaction;
98
100
  };
99
101
 
100
102
  type PlaceNftBids = {
@@ -106,7 +108,8 @@ type PlaceNftBids = {
106
108
  walletAddress: string;
107
109
  multiBidId?: string;
108
110
  multiBidChainId?: any;
109
- tx?: Transaction | string;
111
+ tx?: Transaction;
112
+ coinToSplit?: any;
110
113
  };
111
114
 
112
115
  type RemoveCollectionBids = {
@@ -136,46 +139,20 @@ interface UpdateMultiBid {
136
139
  name?: string;
137
140
  amount?: bigint;
138
141
  amountToWithdraw?: bigint;
139
- tx?: Transaction | string;
142
+ tx?: Transaction;
140
143
  multiBidChainId?: any;
144
+ coinToSplit?: any;
141
145
  }
142
146
 
143
147
  type WithdrawProfitsFromKiosks = {
144
148
  walletAddress: string;
145
149
  };
146
150
 
147
- type ApplyNftStrategy = {
148
- collectionId: string;
149
- strategyFtType?: string;
150
- tx?: Transaction;
151
- };
152
-
153
- type SwapCoins = {
154
- walletAddress: string;
155
- coinInType: string;
156
- coinInAmount: string;
157
- coinOutType: string;
158
- slippage?: number;
159
- ttl?: StringValue;
160
- excludeSources?: Protocol[];
161
- routes?: Array<Route<Coin, Coin>>;
162
- commission?: Commission;
163
- tx?: Transaction;
164
- };
165
- type SwapRoutesArgs = {
166
- walletAddress: string;
167
- coinInType: string;
168
- coinOutType: string;
169
- amountToSwap: bigint;
170
- excludeSources?: Protocol[];
171
- commission?: Commission;
172
- };
173
-
174
151
  type ApiConfig = {
175
152
  apiUser: string;
176
153
  apiKey: string;
177
154
  apiUrl?: string;
178
- defiRouterUrl?: string;
155
+ tradeportRouterUrl?: string;
179
156
  apiVercelId?: string;
180
157
  suiNodeUrl?: string;
181
158
  graphQLClient?: GraphQLClient;
@@ -183,13 +160,13 @@ type ApiConfig = {
183
160
  declare class SuiTradingClient {
184
161
  private readonly apiUser;
185
162
  private readonly apiKey;
186
- private readonly defiRouterUrl;
163
+ private readonly tradeportRouterUrl?;
187
164
  private readonly suiClient;
188
165
  private readonly kioskClient;
189
166
  private readonly allowedApiUsersForUnsharedKiosksMigration;
190
- constructor({ apiUser, apiKey, apiVercelId, apiUrl, defiRouterUrl, suiNodeUrl, graphQLClient, }: ApiConfig);
191
- buyListings({ listingIds, walletAddress, tx }: BuyListings): Promise<Transaction>;
192
- listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
167
+ constructor({ apiUser, apiKey, apiVercelId, apiUrl, tradeportRouterUrl, suiNodeUrl, graphQLClient, }: ApiConfig);
168
+ buyListings(args: BuyListings): Promise<Transaction>;
169
+ listNfts({ nfts, walletAddress, tx }: ListNfts): Promise<Transaction>;
193
170
  unlistListings({ listingIds, walletAddress }: UnlistListings): Promise<Transaction>;
194
171
  placeNftBids(data: PlaceNftBids): Promise<Transaction>;
195
172
  removeNftBids({ bidIds, tx }: RemoveNftBids): Promise<Transaction>;
@@ -211,12 +188,6 @@ declare class SuiTradingClient {
211
188
  sponsorNftListing(args: SponsorNftListing): Promise<Transaction>;
212
189
  applyFtStrategy(args: ApplyFtStrategy): Promise<Transaction>;
213
190
  applyTradeportNftStrategy(args: ApplyNftStrategy): Promise<Transaction>;
214
- swapCoins(args: SwapCoins): Promise<{
215
- tx: Transaction;
216
- coinOut: _mysten_sui_dist_cjs_transactions.TransactionResult;
217
- }>;
218
- buildSwapRoutes(args: SwapRoutesArgs): Promise<GetRoutesResult<Coin, Coin>>;
219
- calculateAmountToSwap(args: Pick<SwapCoins, 'coinInType' | 'coinOutType' | 'coinInAmount'>): Promise<bigint>;
220
191
  }
221
192
 
222
193
  export { SuiTradingClient };