@switch-win/sdk 1.0.8 → 1.0.9
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/package.json +1 -1
- package/src/limit-orders.ts +9 -0
- package/src/types.ts +14 -0
package/package.json
CHANGED
package/src/limit-orders.ts
CHANGED
|
@@ -361,6 +361,8 @@ export interface ListLimitOrdersOptions {
|
|
|
361
361
|
* where the maker is the PLSFlow contract but the user is the recipient.
|
|
362
362
|
*/
|
|
363
363
|
owner?: string;
|
|
364
|
+
/** Filter by partner address */
|
|
365
|
+
partnerAddress?: string;
|
|
364
366
|
/** Filter by input token address */
|
|
365
367
|
tokenIn?: string;
|
|
366
368
|
/** Filter by output token address */
|
|
@@ -393,6 +395,12 @@ export interface ListLimitOrdersOptions {
|
|
|
393
395
|
* tokenOut: "0xPLSXAddress",
|
|
394
396
|
* status: "FILLED",
|
|
395
397
|
* });
|
|
398
|
+
*
|
|
399
|
+
* // Orders attributed to a specific partner
|
|
400
|
+
* const partnerOrders = await fetchLimitOrders({
|
|
401
|
+
* partnerAddress: "0xPartnerAddress",
|
|
402
|
+
* status: "ACTIVE",
|
|
403
|
+
* });
|
|
396
404
|
* ```
|
|
397
405
|
*/
|
|
398
406
|
export async function fetchLimitOrders(
|
|
@@ -402,6 +410,7 @@ export async function fetchLimitOrders(
|
|
|
402
410
|
if (options.status) params.set("status", options.status);
|
|
403
411
|
if (options.maker) params.set("maker", options.maker);
|
|
404
412
|
if (options.owner) params.set("owner", options.owner);
|
|
413
|
+
if (options.partnerAddress) params.set("partnerAddress", options.partnerAddress);
|
|
405
414
|
if (options.tokenIn) params.set("tokenIn", options.tokenIn);
|
|
406
415
|
if (options.tokenOut) params.set("tokenOut", options.tokenOut);
|
|
407
416
|
if (options.pair) params.set("pair", options.pair);
|
package/src/types.ts
CHANGED
|
@@ -363,16 +363,30 @@ export interface LimitOrderRecord {
|
|
|
363
363
|
unwrapOutput: boolean;
|
|
364
364
|
/** Partner address for fee sharing */
|
|
365
365
|
partnerAddress: string;
|
|
366
|
+
/** LO contract address this order targets for cancellation/fill */
|
|
367
|
+
limitOrderContract?: string;
|
|
366
368
|
/** EIP-712 signature */
|
|
367
369
|
signature: string;
|
|
368
370
|
/** Pair key in format `tokenIn:tokenOut` (lowercased) */
|
|
369
371
|
pairKey: string;
|
|
372
|
+
/** Sell tax on input token in basis points, when known */
|
|
373
|
+
tokenInSellTaxBps?: number;
|
|
374
|
+
/** Buy tax on input token in basis points, when known */
|
|
375
|
+
tokenInBuyTaxBps?: number;
|
|
376
|
+
/** Sell tax on output token in basis points, when known */
|
|
377
|
+
tokenOutSellTaxBps?: number;
|
|
378
|
+
/** Buy tax on output token in basis points, when known */
|
|
379
|
+
tokenOutBuyTaxBps?: number;
|
|
370
380
|
/** Current order status */
|
|
371
381
|
status: LimitOrderStatus;
|
|
372
382
|
/** ISO 8601 creation timestamp */
|
|
373
383
|
createdAt: string;
|
|
374
384
|
/** ISO 8601 last update timestamp */
|
|
375
385
|
updatedAt: string;
|
|
386
|
+
/** Filler address for filled orders */
|
|
387
|
+
filler?: string | null;
|
|
388
|
+
/** Filler profit in tokenIn units for filled orders */
|
|
389
|
+
fillerProfit?: string | null;
|
|
376
390
|
/** Block number where the order was filled (if status is FILLED) */
|
|
377
391
|
filledBlock?: number | null;
|
|
378
392
|
/** Transaction hash of the fill (if status is FILLED) */
|