@swapkit/helpers 6.3.0 → 6.4.0

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.
@@ -1,7 +1,7 @@
1
1
  import { type Chain } from "@swapkit/types";
2
2
  import { AssetValue } from "../../modules/assetValue";
3
3
  import type { ProviderName } from "../../types/quotes";
4
- import { type BrokerDepositChannelParams, type NearDepositChannelParams, type PriceRequest, type QuoteRequest, type SearchTokensResponse, type SwapRouteV2Response, type SwapToRequest, type SwapToResponse, type TokenListProvidersResponse, type TokensResponseV2, type TrackingRequest } from "./types";
4
+ import { type BrokerDepositChannelParams, type LimitOrderBuildRequest, type LimitOrderCancelSubmitRequest, type LimitOrderListQuery, type LimitOrderQuoteRequest, type LimitOrderSubmitRequest, type NearDepositChannelParams, type PriceRequest, type QuoteRequest, type SearchTokensResponse, type SwapRouteV2Response, type SwapToRequest, type SwapToResponse, type TokenListProvidersResponse, type TokensResponseV2, type TrackingRequest } from "./types";
5
5
  export declare const SKRequestClient: {
6
6
  extend: (newOptions: RequestInit & {
7
7
  json?: unknown;
@@ -372,4 +372,261 @@ export declare function getNearDepositChannel(body: NearDepositChannelParams): P
372
372
  tx: unknown;
373
373
  deadline?: string | undefined;
374
374
  }>;
375
+ export declare function getLimitOrderTokens(): Promise<{
376
+ crossChain: {
377
+ assets: string[];
378
+ chainIds: (import("@swapkit/types").ChainId | (string & {}))[];
379
+ provider: (string & {}) | ProviderName;
380
+ }[];
381
+ singleChain: {
382
+ assets: string[];
383
+ chainId: import("@swapkit/types").ChainId | (string & {});
384
+ provider: (string & {}) | ProviderName;
385
+ }[];
386
+ }>;
387
+ export declare function getLimitOrderQuote(json: LimitOrderQuoteRequest): Promise<{
388
+ quoteId: string;
389
+ routes: {
390
+ buyAmount: string;
391
+ buyAsset: string;
392
+ effectiveFillPrice: string;
393
+ integratorFeeBps: number;
394
+ limitPrice: string;
395
+ maxExpirationSeconds: number;
396
+ minExpirationSeconds: number;
397
+ provider: (string & {}) | ProviderName;
398
+ routeId: string;
399
+ sellAmount: string;
400
+ sellAsset: string;
401
+ spotPrice: string;
402
+ spotPriceDeviationBps: number;
403
+ takerFeeBps: number;
404
+ fees?: {
405
+ amount: string;
406
+ asset: string;
407
+ chain: string;
408
+ protocol: (string & {}) | ProviderName;
409
+ type: (string & {}) | import("../..").FeeTypeEnum;
410
+ amountBps?: number | undefined;
411
+ }[] | undefined;
412
+ nextActions?: {
413
+ method: string;
414
+ url: string;
415
+ payload?: unknown;
416
+ }[] | undefined;
417
+ warnings?: {
418
+ code: string;
419
+ display: string;
420
+ tooltip?: string | undefined;
421
+ }[] | undefined;
422
+ }[];
423
+ error?: string | undefined;
424
+ providerErrors?: {
425
+ errorCode?: string | undefined;
426
+ message?: string | undefined;
427
+ provider?: (string & {}) | ProviderName | undefined;
428
+ }[] | undefined;
429
+ }>;
430
+ export declare function buildLimitOrder(json: LimitOrderBuildRequest): Promise<{
431
+ nextActions: {
432
+ method: string;
433
+ url: string;
434
+ payload?: unknown;
435
+ }[];
436
+ orderHash: string;
437
+ orderId: string;
438
+ tx: string | Record<string, unknown> | unknown[] | {
439
+ data: string;
440
+ to: string;
441
+ value: string;
442
+ from?: string | undefined;
443
+ gas?: string | undefined;
444
+ gasPrice?: string | undefined;
445
+ maxFeePerGas?: string | undefined;
446
+ maxPriorityFeePerGas?: string | undefined;
447
+ type?: string | undefined;
448
+ } | null;
449
+ txMeta: {
450
+ txType: "evm" | "cardano" | "near" | "psbt" | "ripple" | "solana" | "starknet" | "stellar" | "sui" | "ton" | "tron";
451
+ chainId?: number | undefined;
452
+ memo?: string | undefined;
453
+ } | null;
454
+ typedData: {
455
+ domain: {
456
+ [x: string]: unknown;
457
+ chainId: number;
458
+ name: string;
459
+ verifyingContract: string;
460
+ version: string;
461
+ };
462
+ message: Record<string, unknown>;
463
+ primaryType: string;
464
+ types: Record<string, {
465
+ name: string;
466
+ type: string;
467
+ }[]>;
468
+ } | null;
469
+ approvalTx?: {
470
+ data: string;
471
+ from: string;
472
+ to: string;
473
+ value: string;
474
+ gasLimit?: string | undefined;
475
+ gasPrice?: string | undefined;
476
+ } | undefined;
477
+ depositAddress?: string | undefined;
478
+ depositAmount?: string | undefined;
479
+ depositMemo?: string | undefined;
480
+ isApproved?: boolean | undefined;
481
+ warnings?: {
482
+ code: string;
483
+ display: string;
484
+ tooltip?: string | undefined;
485
+ }[] | undefined;
486
+ }>;
487
+ export declare function submitLimitOrder(json: LimitOrderSubmitRequest): Promise<{
488
+ createdAt: string;
489
+ orderHash: string;
490
+ orderId: string;
491
+ status: (string & {}) | "CANCELLED" | "EXPIRED" | "FAILED" | "FILLED" | "OPEN" | "PARTIAL" | "PENDING" | "SUBMITTED";
492
+ }>;
493
+ export declare function getLimitOrders(query?: LimitOrderListQuery): Promise<{
494
+ orders: {
495
+ buyAmount: string;
496
+ buyAsset: string;
497
+ chainId: import("@swapkit/types").ChainId | (string & {});
498
+ createdAt: string;
499
+ expiresAt: string;
500
+ fees: {
501
+ amount: string;
502
+ asset: string;
503
+ chain: string;
504
+ protocol: (string & {}) | ProviderName;
505
+ type: (string & {}) | import("../..").FeeTypeEnum;
506
+ amountBps?: number | undefined;
507
+ }[];
508
+ filledBuyAmount: string;
509
+ filledSellAmount: string;
510
+ limitPrice: string;
511
+ maker: string;
512
+ orderHash: string;
513
+ orderId: string;
514
+ provider: (string & {}) | ProviderName;
515
+ receiver: string | null;
516
+ sellAmount: string;
517
+ sellAsset: string;
518
+ status: (string & {}) | "CANCELLED" | "EXPIRED" | "FAILED" | "FILLED" | "OPEN" | "PARTIAL" | "PENDING" | "SUBMITTED";
519
+ updatedAt: string;
520
+ cancelRequestedAt?: string | undefined;
521
+ depositHash?: string | undefined;
522
+ txHashes?: {
523
+ chainId: import("@swapkit/types").ChainId | (string & {});
524
+ txHash: string;
525
+ type: "fill" | (string & {}) | "cancel" | "deposit" | "withdraw" | "refund";
526
+ blockNumber?: number | undefined;
527
+ }[] | undefined;
528
+ usdValueClose?: string | null | undefined;
529
+ usdValueOpen?: string | null | undefined;
530
+ withdrawHash?: string | undefined;
531
+ }[];
532
+ nextCursor?: string | undefined;
533
+ }>;
534
+ export declare function getLimitOrder(orderId: string): Promise<{
535
+ buyAmount: string;
536
+ buyAsset: string;
537
+ chainId: import("@swapkit/types").ChainId | (string & {});
538
+ createdAt: string;
539
+ expiresAt: string;
540
+ fees: {
541
+ amount: string;
542
+ asset: string;
543
+ chain: string;
544
+ protocol: (string & {}) | ProviderName;
545
+ type: (string & {}) | import("../..").FeeTypeEnum;
546
+ amountBps?: number | undefined;
547
+ }[];
548
+ filledBuyAmount: string;
549
+ filledSellAmount: string;
550
+ limitPrice: string;
551
+ maker: string;
552
+ orderHash: string;
553
+ orderId: string;
554
+ provider: (string & {}) | ProviderName;
555
+ receiver: string | null;
556
+ sellAmount: string;
557
+ sellAsset: string;
558
+ status: (string & {}) | "CANCELLED" | "EXPIRED" | "FAILED" | "FILLED" | "OPEN" | "PARTIAL" | "PENDING" | "SUBMITTED";
559
+ updatedAt: string;
560
+ cancelRequestedAt?: string | undefined;
561
+ depositHash?: string | undefined;
562
+ txHashes?: {
563
+ chainId: import("@swapkit/types").ChainId | (string & {});
564
+ txHash: string;
565
+ type: "fill" | (string & {}) | "cancel" | "deposit" | "withdraw" | "refund";
566
+ blockNumber?: number | undefined;
567
+ }[] | undefined;
568
+ usdValueClose?: string | null | undefined;
569
+ usdValueOpen?: string | null | undefined;
570
+ withdrawHash?: string | undefined;
571
+ }>;
572
+ export declare function buildLimitOrderCancel(json: {
573
+ orderId: string;
574
+ }): Promise<{
575
+ btcSignaturePreimage: string | null;
576
+ cancelTx: {
577
+ chainId: number;
578
+ data: string;
579
+ from: string;
580
+ to: string;
581
+ value: string;
582
+ } | null;
583
+ nextActions: {
584
+ method: string;
585
+ url: string;
586
+ payload?: unknown;
587
+ }[];
588
+ orderId: string;
589
+ typedData: {
590
+ domain: {
591
+ [x: string]: unknown;
592
+ name: string;
593
+ version: string;
594
+ };
595
+ message: {
596
+ [x: string]: unknown;
597
+ action: "cancel_and_withdraw";
598
+ chain: string;
599
+ expiry: number;
600
+ l1Address: string;
601
+ nonce: number;
602
+ payload: {
603
+ [x: string]: unknown;
604
+ orderId: string;
605
+ };
606
+ };
607
+ primaryType: "CancelAndWithdraw";
608
+ types: {
609
+ [x: string]: unknown;
610
+ CancelAndWithdraw: {
611
+ name: string;
612
+ type: string;
613
+ }[];
614
+ CancelAndWithdrawPayload: {
615
+ name: string;
616
+ type: string;
617
+ }[];
618
+ EIP712Domain: {
619
+ name: string;
620
+ type: string;
621
+ }[];
622
+ };
623
+ } | null;
624
+ }>;
625
+ export declare function submitLimitOrderCancel(json: LimitOrderCancelSubmitRequest): Promise<{
626
+ orderId: string;
627
+ status: (string & {}) | "CANCELLED" | "EXPIRED" | "FAILED" | "FILLED" | "OPEN" | "PARTIAL" | "PENDING" | "SUBMITTED";
628
+ cancelRequestedAt?: string | undefined;
629
+ txHash?: string | undefined;
630
+ withdrawId?: string | undefined;
631
+ }>;
375
632
  export declare function getSwapTo(params: SwapToRequest): Promise<SwapToResponse>;