valr-typescript-client 1.0.19 → 1.0.21
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/CHECKSUMS.txt +10 -10
- package/dist/index.d.mts +81 -21
- package/dist/index.d.ts +81 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHECKSUMS.txt
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# Package Checksums
|
|
2
2
|
|
|
3
|
-
Generated on:
|
|
4
|
-
Git commit:
|
|
5
|
-
Version: 1.0.
|
|
3
|
+
Generated on: 2026-01-03 09:56:15 UTC
|
|
4
|
+
Git commit: 34da8c1043257a02e67aac96212d578b6e285753
|
|
5
|
+
Version: 1.0.21
|
|
6
6
|
|
|
7
7
|
## Distribution Files (SHA256)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
029fa7f75839d7bf16f71a99704928208e8fcc8fd8c1096cf9c7e6075d7d455b dist/index.js.map
|
|
10
|
+
0af937ec53ccafc2b2ee487c264ffc5100ba80cb7437dba1bbb53532e8ba9436 dist/index.mjs.map
|
|
10
11
|
3275588ac5ec719891a8c35c418d25db8492e953b364409b97fe079971c9e6c1 dist/index.mjs
|
|
12
|
+
5f08ace6957b06df29324b3869848cbc421b53030531c8545c664f1df9cf7384 dist/index.d.mts
|
|
13
|
+
5f08ace6957b06df29324b3869848cbc421b53030531c8545c664f1df9cf7384 dist/index.d.ts
|
|
11
14
|
7e8d73467b1c57397945238dfcf370e7d7f1bd271a13eb9dd14f3612a9cf629f dist/index.js
|
|
12
|
-
a8d906a68147898ac01151fa1e7fb030c37e46c1103555fae85a9efcb566ec9f dist/index.d.mts
|
|
13
|
-
a8d906a68147898ac01151fa1e7fb030c37e46c1103555fae85a9efcb566ec9f dist/index.d.ts
|
|
14
|
-
bca7d628fed0512fc2bfcaab410eb93ab4671eaace7ef8ae6a81b2f223aed926 dist/index.js.map
|
|
15
15
|
|
|
16
16
|
## Source Files (SHA256)
|
|
17
17
|
|
|
@@ -19,6 +19,7 @@ bca7d628fed0512fc2bfcaab410eb93ab4671eaace7ef8ae6a81b2f223aed926 dist/index.js.
|
|
|
19
19
|
0705454404aa0e0f2ce619615600d871c8052ac0afe495bb412219d9a6c032ac src/types/public.ts
|
|
20
20
|
0a9bed00d1ee34300d532c01c86a300d76f51b96d50aea2ebae15750c7c06d94 src/api/account.ts
|
|
21
21
|
0b4530d458e0c3bbadb79566943ef466404215e545f25c4965c72d9bfeee86dc src/api/health.ts
|
|
22
|
+
13c4319ae883c96f779ea57f481c52f2298397e11950213f7d43a05290f42e8a src/api/trading.ts
|
|
22
23
|
15ef50a824d04e4466a4e34c29b54429c4d36e64d15eed1374c7165452da3abf src/api/loans.ts
|
|
23
24
|
174ffc46347008d3f473af1916e8b1b38fb9752e68a69776df831dca676a1342 src/api/public.ts
|
|
24
25
|
392124cca58a1532bd57472ba574bc065052c552ea8f10b7c675c942310c67e8 src/api/wallets.ts
|
|
@@ -37,11 +38,10 @@ bca7d628fed0512fc2bfcaab410eb93ab4671eaace7ef8ae6a81b2f223aed926 dist/index.js.
|
|
|
37
38
|
612b1e543d1bbd97b75e814fa7d9b4ff4b1786f6b3671a03019917049e38a96e src/types/stake.ts
|
|
38
39
|
6ec43e250aca38bc6a9dc4f16e5fe7e6ca25bd831270c5d02c1bc82d79f5731d src/types/loans.ts
|
|
39
40
|
70636220daed500243e5cd40d25748efcd401a9ff50f4237fa200bce1fe3be38 src/errors/ValrError.ts
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
84688ccf1549178fd43927028588f07d348076e4fe5681d61ea05179103c6959 src/types/trading.ts
|
|
42
|
+
9c02d6094465660040c390c199687b0a8200aa86eb5654c4f2077b928cf8546c src/types/index.ts
|
|
42
43
|
a52c483def6de035f7fcf690b6102129ea22cb817bed5a106d3617c8edc7d849 src/api/stake.ts
|
|
43
44
|
c4c0979b4fc9a035bcf0d1bd8b379e5e2e85c8ea39a812cb7d8cd66ba5c04494 src/api/pay.ts
|
|
44
|
-
d8b3405cad342df23aeacaaacde277a4829028699a13bf0d129aea07beb23d68 src/api/trading.ts
|
|
45
45
|
ec209b0ff8de8e662c2ea701feccee22b53e6ed684affb3eacd39e68c3aa725a src/index.ts
|
|
46
46
|
f67a6c69ed003a1606221e792de802592aedb7164cafb7d7d2eab4fac105807a src/utils/constants.ts
|
|
47
47
|
f819d431730bb51a23d2cad32cc6eee83dc9d917e5cb9efd3201ffeb64d76ec5 src/client/AccountWebSocket.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -667,6 +667,12 @@ interface LimitOrderRequest extends BaseOrderRequest {
|
|
|
667
667
|
postOnly?: PostOnly;
|
|
668
668
|
/** Time in force */
|
|
669
669
|
timeInForce?: TimeInForce;
|
|
670
|
+
/** Allow margin trading */
|
|
671
|
+
allowMargin?: string | boolean;
|
|
672
|
+
/** Enable post-only repricing */
|
|
673
|
+
postOnlyReprice?: boolean;
|
|
674
|
+
/** Number of ticks to reprice */
|
|
675
|
+
postOnlyRepriceTicks?: string;
|
|
670
676
|
}
|
|
671
677
|
/**
|
|
672
678
|
* Limit order request (v2)
|
|
@@ -682,6 +688,12 @@ interface LimitOrderRequestV2 extends BaseOrderRequest {
|
|
|
682
688
|
postOnly?: PostOnly;
|
|
683
689
|
/** Time in force */
|
|
684
690
|
timeInForce?: TimeInForce;
|
|
691
|
+
/** Allow margin trading */
|
|
692
|
+
allowMargin?: string | boolean;
|
|
693
|
+
/** Enable post-only repricing */
|
|
694
|
+
postOnlyReprice?: boolean;
|
|
695
|
+
/** Number of ticks to reprice */
|
|
696
|
+
postOnlyRepriceTicks?: string;
|
|
685
697
|
}
|
|
686
698
|
/**
|
|
687
699
|
* Market order request (v1)
|
|
@@ -691,6 +703,8 @@ interface MarketOrderRequest extends BaseOrderRequest {
|
|
|
691
703
|
baseAmount?: string;
|
|
692
704
|
/** Quote amount (optional, either baseAmount or quoteAmount required) */
|
|
693
705
|
quoteAmount?: string;
|
|
706
|
+
/** Allow margin trading */
|
|
707
|
+
allowMargin?: string | boolean;
|
|
694
708
|
}
|
|
695
709
|
/**
|
|
696
710
|
* Market order request (v2)
|
|
@@ -703,6 +717,8 @@ interface MarketOrderRequestV2 extends MarketOrderRequest {
|
|
|
703
717
|
interface StopLimitOrderRequest extends LimitOrderRequest {
|
|
704
718
|
/** Stop price that triggers the order */
|
|
705
719
|
stopPrice: string;
|
|
720
|
+
/** Type of stop order */
|
|
721
|
+
type?: 'STOP_LOSS_LIMIT' | 'TAKE_PROFIT_LIMIT';
|
|
706
722
|
}
|
|
707
723
|
/**
|
|
708
724
|
* Stop-limit order request (v2)
|
|
@@ -710,6 +726,8 @@ interface StopLimitOrderRequest extends LimitOrderRequest {
|
|
|
710
726
|
interface StopLimitOrderRequestV2 extends LimitOrderRequestV2 {
|
|
711
727
|
/** Stop price that triggers the order */
|
|
712
728
|
stopPrice: string;
|
|
729
|
+
/** Type of stop order */
|
|
730
|
+
type?: 'STOP_LOSS_LIMIT' | 'TAKE_PROFIT_LIMIT';
|
|
713
731
|
}
|
|
714
732
|
/**
|
|
715
733
|
* Simple buy/sell quote request
|
|
@@ -769,12 +787,35 @@ interface OrderResponse {
|
|
|
769
787
|
/** Message */
|
|
770
788
|
message?: string;
|
|
771
789
|
}
|
|
790
|
+
/**
|
|
791
|
+
* Batch order operation types
|
|
792
|
+
*/
|
|
793
|
+
type BatchOrderOperationType = 'PLACE_LIMIT' | 'PLACE_MARKET' | 'PLACE_STOP_LIMIT' | 'CANCEL_ORDER';
|
|
794
|
+
/**
|
|
795
|
+
* Individual batch order operation
|
|
796
|
+
*/
|
|
797
|
+
type BatchOrderOperation = {
|
|
798
|
+
type: 'PLACE_LIMIT';
|
|
799
|
+
data: LimitOrderRequest;
|
|
800
|
+
} | {
|
|
801
|
+
type: 'PLACE_MARKET';
|
|
802
|
+
data: MarketOrderRequest;
|
|
803
|
+
} | {
|
|
804
|
+
type: 'PLACE_STOP_LIMIT';
|
|
805
|
+
data: StopLimitOrderRequest;
|
|
806
|
+
} | {
|
|
807
|
+
type: 'CANCEL_ORDER';
|
|
808
|
+
data: {
|
|
809
|
+
orderId: OrderId;
|
|
810
|
+
pair: CurrencyPair;
|
|
811
|
+
};
|
|
812
|
+
};
|
|
772
813
|
/**
|
|
773
814
|
* Batch order request
|
|
774
815
|
*/
|
|
775
816
|
interface BatchOrderRequest {
|
|
776
|
-
/** List of order
|
|
777
|
-
requests:
|
|
817
|
+
/** List of batch order operations (max 10) */
|
|
818
|
+
requests: BatchOrderOperation[];
|
|
778
819
|
}
|
|
779
820
|
/**
|
|
780
821
|
* Batch order response item
|
|
@@ -894,25 +935,23 @@ interface OpenOrder {
|
|
|
894
935
|
status?: OrderStatus;
|
|
895
936
|
}
|
|
896
937
|
/**
|
|
897
|
-
* Conditional order request
|
|
938
|
+
* Conditional order request (for futures TPSL orders)
|
|
898
939
|
*/
|
|
899
940
|
interface ConditionalOrderRequest {
|
|
900
|
-
/** Currency pair */
|
|
941
|
+
/** Currency pair (perpetual futures contract, e.g., BTCUSDTPERP) */
|
|
901
942
|
pair: CurrencyPair;
|
|
902
|
-
/**
|
|
903
|
-
side: OrderSide;
|
|
904
|
-
/** Conditional order type */
|
|
905
|
-
type: ConditionalOrderType;
|
|
906
|
-
/** Trigger price */
|
|
907
|
-
triggerPrice: string;
|
|
908
|
-
/** Trigger type */
|
|
909
|
-
triggerType?: ConditionalOrderTriggerType;
|
|
910
|
-
/** Quantity */
|
|
943
|
+
/** Quantity (0 = close entire position, -1 = close only added quantity, >0 = reduce-only) */
|
|
911
944
|
quantity: string;
|
|
912
|
-
/**
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
|
|
945
|
+
/** Trigger type (LAST_TRADED or MARK_PRICE) */
|
|
946
|
+
triggerType: ConditionalOrderTriggerType;
|
|
947
|
+
/** Take profit trigger price (required for TP, optional for OCO) */
|
|
948
|
+
takeProfitTriggerPrice?: string;
|
|
949
|
+
/** Take profit order price (required for TP, optional for OCO, -1 for market) */
|
|
950
|
+
takeProfitOrderPrice?: string;
|
|
951
|
+
/** Stop loss trigger price (required for SL, optional for OCO) */
|
|
952
|
+
stopLossTriggerPrice?: string;
|
|
953
|
+
/** Stop loss order price (required for SL, optional for OCO, -1 for market) */
|
|
954
|
+
stopLossOrderPrice?: string;
|
|
916
955
|
/** Customer order ID */
|
|
917
956
|
customerOrderId?: CustomerOrderId;
|
|
918
957
|
}
|
|
@@ -925,6 +964,25 @@ interface ConditionalOrderResponse {
|
|
|
925
964
|
/** Customer order ID if provided */
|
|
926
965
|
customerOrderId?: CustomerOrderId;
|
|
927
966
|
}
|
|
967
|
+
/**
|
|
968
|
+
* Modify conditional order request
|
|
969
|
+
*/
|
|
970
|
+
interface ModifyConditionalOrderRequest {
|
|
971
|
+
/** Customer order ID to identify which order to modify */
|
|
972
|
+
customerOrderId: CustomerOrderId;
|
|
973
|
+
/** Currency pair */
|
|
974
|
+
pair: CurrencyPair;
|
|
975
|
+
/** New quantity */
|
|
976
|
+
newQuantity?: string;
|
|
977
|
+
/** New take profit trigger price */
|
|
978
|
+
newTakeProfitTriggerPrice?: string;
|
|
979
|
+
/** New take profit order price */
|
|
980
|
+
newTakeProfitOrderPrice?: string;
|
|
981
|
+
/** New stop loss trigger price */
|
|
982
|
+
newStopLossTriggerPrice?: string;
|
|
983
|
+
/** New stop loss order price */
|
|
984
|
+
newStopLossOrderPrice?: string;
|
|
985
|
+
}
|
|
928
986
|
/**
|
|
929
987
|
* Conditional order status
|
|
930
988
|
*/
|
|
@@ -1016,6 +1074,10 @@ interface OrderHistoryParams extends PaginationParams {
|
|
|
1016
1074
|
startTime?: ISOTimestamp;
|
|
1017
1075
|
/** End time filter */
|
|
1018
1076
|
endTime?: ISOTimestamp;
|
|
1077
|
+
/** Exclude failed orders */
|
|
1078
|
+
excludeFailures?: boolean | 'TRUE' | 'FALSE';
|
|
1079
|
+
/** Include zero-volume cancelled orders */
|
|
1080
|
+
showZeroVolumeCancels?: boolean | 'TRUE' | 'FALSE';
|
|
1019
1081
|
}
|
|
1020
1082
|
/**
|
|
1021
1083
|
* Historical order summary
|
|
@@ -2418,9 +2480,7 @@ declare class TradingAPI {
|
|
|
2418
2480
|
* @param request - Conditional order modification request
|
|
2419
2481
|
* @returns Updated conditional order
|
|
2420
2482
|
*/
|
|
2421
|
-
modifyConditionalOrder(request:
|
|
2422
|
-
id: string;
|
|
2423
|
-
}): Promise<ConditionalOrderResponse>;
|
|
2483
|
+
modifyConditionalOrder(request: ModifyConditionalOrderRequest): Promise<ConditionalOrderResponse>;
|
|
2424
2484
|
/**
|
|
2425
2485
|
* Get a quote for simple buy/sell
|
|
2426
2486
|
* POST /v1/simple/:currencyPair/quote
|
|
@@ -3851,4 +3911,4 @@ declare const HEADERS: {
|
|
|
3851
3911
|
readonly RATE_LIMITED: "x-valr-ratelimited";
|
|
3852
3912
|
};
|
|
3853
3913
|
|
|
3854
|
-
export { API_BASE_URL, AccountAPI, type AccountMarginStatus, type AccountTrade$1 as AccountTrade, AccountWebSocket, type ApiKey, type AutoBuyDepositReference, type Balance, type BalanceUpdate, type BalancesParams, type Bank, type BankAccount, type BaseOrderRequest, type BaseWebSocketMessage, type BatchOrderRequest, type BatchOrderResponse, type BatchOrderResponseItem, type BatchOrderStatus, type BorrowHistoryItem, type Bundle, type BundleComposition, type BundleOrder, BundlesAPI, type BuyBundleRequest, type CancelOrderRequest, type CancelOrderRequestV2, type ChangeLoanRateRequest, type ClosedPosition, type ClosedPositionSummary, type ConditionalOrderRequest, type ConditionalOrderResponse, type ConditionalOrderStatus, type ConditionalOrderTriggerType, type ConditionalOrderType, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateLoanRequest, type CreatePaymentRequest, type CreateSubaccountRequest, type CryptoAddress, type CryptoDepositHistoryItem, type CryptoDepositHistoryParams, type CryptoWithdrawalHistoryItem, type CryptoWithdrawalHistoryParams, type CryptoWithdrawalRequest, type CryptoWithdrawalResponse, type CryptoWithdrawalStatus, type Currency, type CurrencyCode, type CurrencyPair, type CurrencyPairInfo, type CurrencyPairOrderTypes, type CursorPaginationParams, type CustomerOrderId, type DepositAddress, type EarnBalance, type EarnBalancesParams, type EarnHistoryItem, type EarnHistoryParams, type EarnHistoryType, type EarnRate, type EarnRatesParams, type EarnReward, type EarnRewardsParams, type EarnType, type EnableMarginRequest, type FiatDepositReference, type FiatWithdrawalRequest, type FiatWithdrawalResponse, type FundingHistoryParams, type FundingPayment, type FundingRateHistory, FuturesAPI, type FuturesInfo, type FuturesPosition, HEADERS, HealthAPI, type HistoricalOrderDetail, type HistoricalOrderSummary, type ISOTimestamp, type IncreaseLoanRequest, type LeverageInfo, type LeverageOption, type LimitOrderRequest, type LimitOrderRequestV2, type LinkBankAccountRequest, type LoanCreditHistoryItem, type LoanInfo, type LoanRate, LoansAPI, MarginAPI, type MarginInfoV1, type MarginInfoV2, type MarketOrderRequest, type MarketOrderRequestV2, type MarketSummary, type MarketSummaryUpdate, type ModifyOrderRequest, type ModifyOrderRequestV2, type NetworkType, type NewTrade, type OpenLoan, type OpenOrder, type OrderBook, type OrderBookEntry$1 as OrderBookEntry, type OrderBookUpdate, type OrderHistoryParams, type OrderId, type OrderProcessed, type OrderResponse, type OrderSide, type OrderStatus, type OrderStatusDetail, type OrderStatusSummary, type OrderStatusUpdate, type OrderTrade, type OrderType, type OrderTypesParams, type PaginationParams, type PairType, PayAPI, type Payment, type PaymentStatus, type PositionHistoryParams, type PostOnly, type PriceBucket, type PriceBucketsParams, type PriceQuantity, PublicAPI, RATE_LIMITS, RequestSigner, type RequestUnlockRequest, type ServerTime, type ServiceProvider, type SimpleOrderRequest, type SimpleQuoteRequest, type SimpleQuoteResponse, StakeAPI, type StakeRequest, type StopLimitOrderRequest, type StopLimitOrderRequestV2, type Subaccount, type SubaccountId, type Subscription, type SubscriptionRequest, type TimeInForce, type TimeRangeParams, type Trade, type TradeFee, type TradeHistoryParams, TradeWebSocket, TradingAPI, type Transaction, type TransactionHistoryParams, type TransactionType, type TransferRequest, type UnstakeRequest, type UpdateLeverageRequest, ValrApiError, ValrAuthenticationError, ValrClient, type ValrClientConfig, ValrConfigurationError, ValrError, ValrRateLimitError, type ValrStatus, ValrValidationError, ValrWebSocketClient, ValrWebSocketError, WS_ACCOUNT_URL_PATH, WS_BASE_URL, WS_TRADE_URL_PATH, WalletsAPI, type AccountTrade as WebSocketAccountTrade, type WebSocketClientConfig, type WebSocketMessage, type WebSocketMessageType, type WhitelistedAddress, type WithdrawalConfigInfo };
|
|
3914
|
+
export { API_BASE_URL, AccountAPI, type AccountMarginStatus, type AccountTrade$1 as AccountTrade, AccountWebSocket, type ApiKey, type AutoBuyDepositReference, type Balance, type BalanceUpdate, type BalancesParams, type Bank, type BankAccount, type BaseOrderRequest, type BaseWebSocketMessage, type BatchOrderOperation, type BatchOrderOperationType, type BatchOrderRequest, type BatchOrderResponse, type BatchOrderResponseItem, type BatchOrderStatus, type BorrowHistoryItem, type Bundle, type BundleComposition, type BundleOrder, BundlesAPI, type BuyBundleRequest, type CancelOrderRequest, type CancelOrderRequestV2, type ChangeLoanRateRequest, type ClosedPosition, type ClosedPositionSummary, type ConditionalOrderRequest, type ConditionalOrderResponse, type ConditionalOrderStatus, type ConditionalOrderTriggerType, type ConditionalOrderType, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateLoanRequest, type CreatePaymentRequest, type CreateSubaccountRequest, type CryptoAddress, type CryptoDepositHistoryItem, type CryptoDepositHistoryParams, type CryptoWithdrawalHistoryItem, type CryptoWithdrawalHistoryParams, type CryptoWithdrawalRequest, type CryptoWithdrawalResponse, type CryptoWithdrawalStatus, type Currency, type CurrencyCode, type CurrencyPair, type CurrencyPairInfo, type CurrencyPairOrderTypes, type CursorPaginationParams, type CustomerOrderId, type DepositAddress, type EarnBalance, type EarnBalancesParams, type EarnHistoryItem, type EarnHistoryParams, type EarnHistoryType, type EarnRate, type EarnRatesParams, type EarnReward, type EarnRewardsParams, type EarnType, type EnableMarginRequest, type FiatDepositReference, type FiatWithdrawalRequest, type FiatWithdrawalResponse, type FundingHistoryParams, type FundingPayment, type FundingRateHistory, FuturesAPI, type FuturesInfo, type FuturesPosition, HEADERS, HealthAPI, type HistoricalOrderDetail, type HistoricalOrderSummary, type ISOTimestamp, type IncreaseLoanRequest, type LeverageInfo, type LeverageOption, type LimitOrderRequest, type LimitOrderRequestV2, type LinkBankAccountRequest, type LoanCreditHistoryItem, type LoanInfo, type LoanRate, LoansAPI, MarginAPI, type MarginInfoV1, type MarginInfoV2, type MarketOrderRequest, type MarketOrderRequestV2, type MarketSummary, type MarketSummaryUpdate, type ModifyConditionalOrderRequest, type ModifyOrderRequest, type ModifyOrderRequestV2, type NetworkType, type NewTrade, type OpenLoan, type OpenOrder, type OrderBook, type OrderBookEntry$1 as OrderBookEntry, type OrderBookUpdate, type OrderHistoryParams, type OrderId, type OrderProcessed, type OrderResponse, type OrderSide, type OrderStatus, type OrderStatusDetail, type OrderStatusSummary, type OrderStatusUpdate, type OrderTrade, type OrderType, type OrderTypesParams, type PaginationParams, type PairType, PayAPI, type Payment, type PaymentStatus, type PositionHistoryParams, type PostOnly, type PriceBucket, type PriceBucketsParams, type PriceQuantity, PublicAPI, RATE_LIMITS, RequestSigner, type RequestUnlockRequest, type ServerTime, type ServiceProvider, type SimpleOrderRequest, type SimpleQuoteRequest, type SimpleQuoteResponse, StakeAPI, type StakeRequest, type StopLimitOrderRequest, type StopLimitOrderRequestV2, type Subaccount, type SubaccountId, type Subscription, type SubscriptionRequest, type TimeInForce, type TimeRangeParams, type Trade, type TradeFee, type TradeHistoryParams, TradeWebSocket, TradingAPI, type Transaction, type TransactionHistoryParams, type TransactionType, type TransferRequest, type UnstakeRequest, type UpdateLeverageRequest, ValrApiError, ValrAuthenticationError, ValrClient, type ValrClientConfig, ValrConfigurationError, ValrError, ValrRateLimitError, type ValrStatus, ValrValidationError, ValrWebSocketClient, ValrWebSocketError, WS_ACCOUNT_URL_PATH, WS_BASE_URL, WS_TRADE_URL_PATH, WalletsAPI, type AccountTrade as WebSocketAccountTrade, type WebSocketClientConfig, type WebSocketMessage, type WebSocketMessageType, type WhitelistedAddress, type WithdrawalConfigInfo };
|
package/dist/index.d.ts
CHANGED
|
@@ -667,6 +667,12 @@ interface LimitOrderRequest extends BaseOrderRequest {
|
|
|
667
667
|
postOnly?: PostOnly;
|
|
668
668
|
/** Time in force */
|
|
669
669
|
timeInForce?: TimeInForce;
|
|
670
|
+
/** Allow margin trading */
|
|
671
|
+
allowMargin?: string | boolean;
|
|
672
|
+
/** Enable post-only repricing */
|
|
673
|
+
postOnlyReprice?: boolean;
|
|
674
|
+
/** Number of ticks to reprice */
|
|
675
|
+
postOnlyRepriceTicks?: string;
|
|
670
676
|
}
|
|
671
677
|
/**
|
|
672
678
|
* Limit order request (v2)
|
|
@@ -682,6 +688,12 @@ interface LimitOrderRequestV2 extends BaseOrderRequest {
|
|
|
682
688
|
postOnly?: PostOnly;
|
|
683
689
|
/** Time in force */
|
|
684
690
|
timeInForce?: TimeInForce;
|
|
691
|
+
/** Allow margin trading */
|
|
692
|
+
allowMargin?: string | boolean;
|
|
693
|
+
/** Enable post-only repricing */
|
|
694
|
+
postOnlyReprice?: boolean;
|
|
695
|
+
/** Number of ticks to reprice */
|
|
696
|
+
postOnlyRepriceTicks?: string;
|
|
685
697
|
}
|
|
686
698
|
/**
|
|
687
699
|
* Market order request (v1)
|
|
@@ -691,6 +703,8 @@ interface MarketOrderRequest extends BaseOrderRequest {
|
|
|
691
703
|
baseAmount?: string;
|
|
692
704
|
/** Quote amount (optional, either baseAmount or quoteAmount required) */
|
|
693
705
|
quoteAmount?: string;
|
|
706
|
+
/** Allow margin trading */
|
|
707
|
+
allowMargin?: string | boolean;
|
|
694
708
|
}
|
|
695
709
|
/**
|
|
696
710
|
* Market order request (v2)
|
|
@@ -703,6 +717,8 @@ interface MarketOrderRequestV2 extends MarketOrderRequest {
|
|
|
703
717
|
interface StopLimitOrderRequest extends LimitOrderRequest {
|
|
704
718
|
/** Stop price that triggers the order */
|
|
705
719
|
stopPrice: string;
|
|
720
|
+
/** Type of stop order */
|
|
721
|
+
type?: 'STOP_LOSS_LIMIT' | 'TAKE_PROFIT_LIMIT';
|
|
706
722
|
}
|
|
707
723
|
/**
|
|
708
724
|
* Stop-limit order request (v2)
|
|
@@ -710,6 +726,8 @@ interface StopLimitOrderRequest extends LimitOrderRequest {
|
|
|
710
726
|
interface StopLimitOrderRequestV2 extends LimitOrderRequestV2 {
|
|
711
727
|
/** Stop price that triggers the order */
|
|
712
728
|
stopPrice: string;
|
|
729
|
+
/** Type of stop order */
|
|
730
|
+
type?: 'STOP_LOSS_LIMIT' | 'TAKE_PROFIT_LIMIT';
|
|
713
731
|
}
|
|
714
732
|
/**
|
|
715
733
|
* Simple buy/sell quote request
|
|
@@ -769,12 +787,35 @@ interface OrderResponse {
|
|
|
769
787
|
/** Message */
|
|
770
788
|
message?: string;
|
|
771
789
|
}
|
|
790
|
+
/**
|
|
791
|
+
* Batch order operation types
|
|
792
|
+
*/
|
|
793
|
+
type BatchOrderOperationType = 'PLACE_LIMIT' | 'PLACE_MARKET' | 'PLACE_STOP_LIMIT' | 'CANCEL_ORDER';
|
|
794
|
+
/**
|
|
795
|
+
* Individual batch order operation
|
|
796
|
+
*/
|
|
797
|
+
type BatchOrderOperation = {
|
|
798
|
+
type: 'PLACE_LIMIT';
|
|
799
|
+
data: LimitOrderRequest;
|
|
800
|
+
} | {
|
|
801
|
+
type: 'PLACE_MARKET';
|
|
802
|
+
data: MarketOrderRequest;
|
|
803
|
+
} | {
|
|
804
|
+
type: 'PLACE_STOP_LIMIT';
|
|
805
|
+
data: StopLimitOrderRequest;
|
|
806
|
+
} | {
|
|
807
|
+
type: 'CANCEL_ORDER';
|
|
808
|
+
data: {
|
|
809
|
+
orderId: OrderId;
|
|
810
|
+
pair: CurrencyPair;
|
|
811
|
+
};
|
|
812
|
+
};
|
|
772
813
|
/**
|
|
773
814
|
* Batch order request
|
|
774
815
|
*/
|
|
775
816
|
interface BatchOrderRequest {
|
|
776
|
-
/** List of order
|
|
777
|
-
requests:
|
|
817
|
+
/** List of batch order operations (max 10) */
|
|
818
|
+
requests: BatchOrderOperation[];
|
|
778
819
|
}
|
|
779
820
|
/**
|
|
780
821
|
* Batch order response item
|
|
@@ -894,25 +935,23 @@ interface OpenOrder {
|
|
|
894
935
|
status?: OrderStatus;
|
|
895
936
|
}
|
|
896
937
|
/**
|
|
897
|
-
* Conditional order request
|
|
938
|
+
* Conditional order request (for futures TPSL orders)
|
|
898
939
|
*/
|
|
899
940
|
interface ConditionalOrderRequest {
|
|
900
|
-
/** Currency pair */
|
|
941
|
+
/** Currency pair (perpetual futures contract, e.g., BTCUSDTPERP) */
|
|
901
942
|
pair: CurrencyPair;
|
|
902
|
-
/**
|
|
903
|
-
side: OrderSide;
|
|
904
|
-
/** Conditional order type */
|
|
905
|
-
type: ConditionalOrderType;
|
|
906
|
-
/** Trigger price */
|
|
907
|
-
triggerPrice: string;
|
|
908
|
-
/** Trigger type */
|
|
909
|
-
triggerType?: ConditionalOrderTriggerType;
|
|
910
|
-
/** Quantity */
|
|
943
|
+
/** Quantity (0 = close entire position, -1 = close only added quantity, >0 = reduce-only) */
|
|
911
944
|
quantity: string;
|
|
912
|
-
/**
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
|
|
945
|
+
/** Trigger type (LAST_TRADED or MARK_PRICE) */
|
|
946
|
+
triggerType: ConditionalOrderTriggerType;
|
|
947
|
+
/** Take profit trigger price (required for TP, optional for OCO) */
|
|
948
|
+
takeProfitTriggerPrice?: string;
|
|
949
|
+
/** Take profit order price (required for TP, optional for OCO, -1 for market) */
|
|
950
|
+
takeProfitOrderPrice?: string;
|
|
951
|
+
/** Stop loss trigger price (required for SL, optional for OCO) */
|
|
952
|
+
stopLossTriggerPrice?: string;
|
|
953
|
+
/** Stop loss order price (required for SL, optional for OCO, -1 for market) */
|
|
954
|
+
stopLossOrderPrice?: string;
|
|
916
955
|
/** Customer order ID */
|
|
917
956
|
customerOrderId?: CustomerOrderId;
|
|
918
957
|
}
|
|
@@ -925,6 +964,25 @@ interface ConditionalOrderResponse {
|
|
|
925
964
|
/** Customer order ID if provided */
|
|
926
965
|
customerOrderId?: CustomerOrderId;
|
|
927
966
|
}
|
|
967
|
+
/**
|
|
968
|
+
* Modify conditional order request
|
|
969
|
+
*/
|
|
970
|
+
interface ModifyConditionalOrderRequest {
|
|
971
|
+
/** Customer order ID to identify which order to modify */
|
|
972
|
+
customerOrderId: CustomerOrderId;
|
|
973
|
+
/** Currency pair */
|
|
974
|
+
pair: CurrencyPair;
|
|
975
|
+
/** New quantity */
|
|
976
|
+
newQuantity?: string;
|
|
977
|
+
/** New take profit trigger price */
|
|
978
|
+
newTakeProfitTriggerPrice?: string;
|
|
979
|
+
/** New take profit order price */
|
|
980
|
+
newTakeProfitOrderPrice?: string;
|
|
981
|
+
/** New stop loss trigger price */
|
|
982
|
+
newStopLossTriggerPrice?: string;
|
|
983
|
+
/** New stop loss order price */
|
|
984
|
+
newStopLossOrderPrice?: string;
|
|
985
|
+
}
|
|
928
986
|
/**
|
|
929
987
|
* Conditional order status
|
|
930
988
|
*/
|
|
@@ -1016,6 +1074,10 @@ interface OrderHistoryParams extends PaginationParams {
|
|
|
1016
1074
|
startTime?: ISOTimestamp;
|
|
1017
1075
|
/** End time filter */
|
|
1018
1076
|
endTime?: ISOTimestamp;
|
|
1077
|
+
/** Exclude failed orders */
|
|
1078
|
+
excludeFailures?: boolean | 'TRUE' | 'FALSE';
|
|
1079
|
+
/** Include zero-volume cancelled orders */
|
|
1080
|
+
showZeroVolumeCancels?: boolean | 'TRUE' | 'FALSE';
|
|
1019
1081
|
}
|
|
1020
1082
|
/**
|
|
1021
1083
|
* Historical order summary
|
|
@@ -2418,9 +2480,7 @@ declare class TradingAPI {
|
|
|
2418
2480
|
* @param request - Conditional order modification request
|
|
2419
2481
|
* @returns Updated conditional order
|
|
2420
2482
|
*/
|
|
2421
|
-
modifyConditionalOrder(request:
|
|
2422
|
-
id: string;
|
|
2423
|
-
}): Promise<ConditionalOrderResponse>;
|
|
2483
|
+
modifyConditionalOrder(request: ModifyConditionalOrderRequest): Promise<ConditionalOrderResponse>;
|
|
2424
2484
|
/**
|
|
2425
2485
|
* Get a quote for simple buy/sell
|
|
2426
2486
|
* POST /v1/simple/:currencyPair/quote
|
|
@@ -3851,4 +3911,4 @@ declare const HEADERS: {
|
|
|
3851
3911
|
readonly RATE_LIMITED: "x-valr-ratelimited";
|
|
3852
3912
|
};
|
|
3853
3913
|
|
|
3854
|
-
export { API_BASE_URL, AccountAPI, type AccountMarginStatus, type AccountTrade$1 as AccountTrade, AccountWebSocket, type ApiKey, type AutoBuyDepositReference, type Balance, type BalanceUpdate, type BalancesParams, type Bank, type BankAccount, type BaseOrderRequest, type BaseWebSocketMessage, type BatchOrderRequest, type BatchOrderResponse, type BatchOrderResponseItem, type BatchOrderStatus, type BorrowHistoryItem, type Bundle, type BundleComposition, type BundleOrder, BundlesAPI, type BuyBundleRequest, type CancelOrderRequest, type CancelOrderRequestV2, type ChangeLoanRateRequest, type ClosedPosition, type ClosedPositionSummary, type ConditionalOrderRequest, type ConditionalOrderResponse, type ConditionalOrderStatus, type ConditionalOrderTriggerType, type ConditionalOrderType, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateLoanRequest, type CreatePaymentRequest, type CreateSubaccountRequest, type CryptoAddress, type CryptoDepositHistoryItem, type CryptoDepositHistoryParams, type CryptoWithdrawalHistoryItem, type CryptoWithdrawalHistoryParams, type CryptoWithdrawalRequest, type CryptoWithdrawalResponse, type CryptoWithdrawalStatus, type Currency, type CurrencyCode, type CurrencyPair, type CurrencyPairInfo, type CurrencyPairOrderTypes, type CursorPaginationParams, type CustomerOrderId, type DepositAddress, type EarnBalance, type EarnBalancesParams, type EarnHistoryItem, type EarnHistoryParams, type EarnHistoryType, type EarnRate, type EarnRatesParams, type EarnReward, type EarnRewardsParams, type EarnType, type EnableMarginRequest, type FiatDepositReference, type FiatWithdrawalRequest, type FiatWithdrawalResponse, type FundingHistoryParams, type FundingPayment, type FundingRateHistory, FuturesAPI, type FuturesInfo, type FuturesPosition, HEADERS, HealthAPI, type HistoricalOrderDetail, type HistoricalOrderSummary, type ISOTimestamp, type IncreaseLoanRequest, type LeverageInfo, type LeverageOption, type LimitOrderRequest, type LimitOrderRequestV2, type LinkBankAccountRequest, type LoanCreditHistoryItem, type LoanInfo, type LoanRate, LoansAPI, MarginAPI, type MarginInfoV1, type MarginInfoV2, type MarketOrderRequest, type MarketOrderRequestV2, type MarketSummary, type MarketSummaryUpdate, type ModifyOrderRequest, type ModifyOrderRequestV2, type NetworkType, type NewTrade, type OpenLoan, type OpenOrder, type OrderBook, type OrderBookEntry$1 as OrderBookEntry, type OrderBookUpdate, type OrderHistoryParams, type OrderId, type OrderProcessed, type OrderResponse, type OrderSide, type OrderStatus, type OrderStatusDetail, type OrderStatusSummary, type OrderStatusUpdate, type OrderTrade, type OrderType, type OrderTypesParams, type PaginationParams, type PairType, PayAPI, type Payment, type PaymentStatus, type PositionHistoryParams, type PostOnly, type PriceBucket, type PriceBucketsParams, type PriceQuantity, PublicAPI, RATE_LIMITS, RequestSigner, type RequestUnlockRequest, type ServerTime, type ServiceProvider, type SimpleOrderRequest, type SimpleQuoteRequest, type SimpleQuoteResponse, StakeAPI, type StakeRequest, type StopLimitOrderRequest, type StopLimitOrderRequestV2, type Subaccount, type SubaccountId, type Subscription, type SubscriptionRequest, type TimeInForce, type TimeRangeParams, type Trade, type TradeFee, type TradeHistoryParams, TradeWebSocket, TradingAPI, type Transaction, type TransactionHistoryParams, type TransactionType, type TransferRequest, type UnstakeRequest, type UpdateLeverageRequest, ValrApiError, ValrAuthenticationError, ValrClient, type ValrClientConfig, ValrConfigurationError, ValrError, ValrRateLimitError, type ValrStatus, ValrValidationError, ValrWebSocketClient, ValrWebSocketError, WS_ACCOUNT_URL_PATH, WS_BASE_URL, WS_TRADE_URL_PATH, WalletsAPI, type AccountTrade as WebSocketAccountTrade, type WebSocketClientConfig, type WebSocketMessage, type WebSocketMessageType, type WhitelistedAddress, type WithdrawalConfigInfo };
|
|
3914
|
+
export { API_BASE_URL, AccountAPI, type AccountMarginStatus, type AccountTrade$1 as AccountTrade, AccountWebSocket, type ApiKey, type AutoBuyDepositReference, type Balance, type BalanceUpdate, type BalancesParams, type Bank, type BankAccount, type BaseOrderRequest, type BaseWebSocketMessage, type BatchOrderOperation, type BatchOrderOperationType, type BatchOrderRequest, type BatchOrderResponse, type BatchOrderResponseItem, type BatchOrderStatus, type BorrowHistoryItem, type Bundle, type BundleComposition, type BundleOrder, BundlesAPI, type BuyBundleRequest, type CancelOrderRequest, type CancelOrderRequestV2, type ChangeLoanRateRequest, type ClosedPosition, type ClosedPositionSummary, type ConditionalOrderRequest, type ConditionalOrderResponse, type ConditionalOrderStatus, type ConditionalOrderTriggerType, type ConditionalOrderType, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateLoanRequest, type CreatePaymentRequest, type CreateSubaccountRequest, type CryptoAddress, type CryptoDepositHistoryItem, type CryptoDepositHistoryParams, type CryptoWithdrawalHistoryItem, type CryptoWithdrawalHistoryParams, type CryptoWithdrawalRequest, type CryptoWithdrawalResponse, type CryptoWithdrawalStatus, type Currency, type CurrencyCode, type CurrencyPair, type CurrencyPairInfo, type CurrencyPairOrderTypes, type CursorPaginationParams, type CustomerOrderId, type DepositAddress, type EarnBalance, type EarnBalancesParams, type EarnHistoryItem, type EarnHistoryParams, type EarnHistoryType, type EarnRate, type EarnRatesParams, type EarnReward, type EarnRewardsParams, type EarnType, type EnableMarginRequest, type FiatDepositReference, type FiatWithdrawalRequest, type FiatWithdrawalResponse, type FundingHistoryParams, type FundingPayment, type FundingRateHistory, FuturesAPI, type FuturesInfo, type FuturesPosition, HEADERS, HealthAPI, type HistoricalOrderDetail, type HistoricalOrderSummary, type ISOTimestamp, type IncreaseLoanRequest, type LeverageInfo, type LeverageOption, type LimitOrderRequest, type LimitOrderRequestV2, type LinkBankAccountRequest, type LoanCreditHistoryItem, type LoanInfo, type LoanRate, LoansAPI, MarginAPI, type MarginInfoV1, type MarginInfoV2, type MarketOrderRequest, type MarketOrderRequestV2, type MarketSummary, type MarketSummaryUpdate, type ModifyConditionalOrderRequest, type ModifyOrderRequest, type ModifyOrderRequestV2, type NetworkType, type NewTrade, type OpenLoan, type OpenOrder, type OrderBook, type OrderBookEntry$1 as OrderBookEntry, type OrderBookUpdate, type OrderHistoryParams, type OrderId, type OrderProcessed, type OrderResponse, type OrderSide, type OrderStatus, type OrderStatusDetail, type OrderStatusSummary, type OrderStatusUpdate, type OrderTrade, type OrderType, type OrderTypesParams, type PaginationParams, type PairType, PayAPI, type Payment, type PaymentStatus, type PositionHistoryParams, type PostOnly, type PriceBucket, type PriceBucketsParams, type PriceQuantity, PublicAPI, RATE_LIMITS, RequestSigner, type RequestUnlockRequest, type ServerTime, type ServiceProvider, type SimpleOrderRequest, type SimpleQuoteRequest, type SimpleQuoteResponse, StakeAPI, type StakeRequest, type StopLimitOrderRequest, type StopLimitOrderRequestV2, type Subaccount, type SubaccountId, type Subscription, type SubscriptionRequest, type TimeInForce, type TimeRangeParams, type Trade, type TradeFee, type TradeHistoryParams, TradeWebSocket, TradingAPI, type Transaction, type TransactionHistoryParams, type TransactionType, type TransferRequest, type UnstakeRequest, type UpdateLeverageRequest, ValrApiError, ValrAuthenticationError, ValrClient, type ValrClientConfig, ValrConfigurationError, ValrError, ValrRateLimitError, type ValrStatus, ValrValidationError, ValrWebSocketClient, ValrWebSocketError, WS_ACCOUNT_URL_PATH, WS_BASE_URL, WS_TRADE_URL_PATH, WalletsAPI, type AccountTrade as WebSocketAccountTrade, type WebSocketClientConfig, type WebSocketMessage, type WebSocketMessageType, type WhitelistedAddress, type WithdrawalConfigInfo };
|