@swapkit/helpers 6.3.0 → 6.4.1

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