valr-typescript-client 1.0.21 → 1.0.22

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 CHANGED
@@ -1,17 +1,17 @@
1
1
  # Package Checksums
2
2
 
3
- Generated on: 2026-01-03 09:56:15 UTC
4
- Git commit: 34da8c1043257a02e67aac96212d578b6e285753
5
- Version: 1.0.21
3
+ Generated on: 2026-01-03 10:18:39 UTC
4
+ Git commit: 8dcbf4a37dd0fe8555eedfe091d0c342ed07c4dc
5
+ Version: 1.0.22
6
6
 
7
7
  ## Distribution Files (SHA256)
8
8
 
9
- 029fa7f75839d7bf16f71a99704928208e8fcc8fd8c1096cf9c7e6075d7d455b dist/index.js.map
10
- 0af937ec53ccafc2b2ee487c264ffc5100ba80cb7437dba1bbb53532e8ba9436 dist/index.mjs.map
11
- 3275588ac5ec719891a8c35c418d25db8492e953b364409b97fe079971c9e6c1 dist/index.mjs
12
- 5f08ace6957b06df29324b3869848cbc421b53030531c8545c664f1df9cf7384 dist/index.d.mts
13
- 5f08ace6957b06df29324b3869848cbc421b53030531c8545c664f1df9cf7384 dist/index.d.ts
14
- 7e8d73467b1c57397945238dfcf370e7d7f1bd271a13eb9dd14f3612a9cf629f dist/index.js
9
+ 1ad7d8372ec293272faac50fb84b35965c3929b24d50a77423c722bc1ccef7fe dist/index.mjs.map
10
+ 39577c8273f8a1ca6b66e44709bf7b6c381e1b1c31755ded1ef4bc252904449a dist/index.js
11
+ 4864ea5b0f9f744caba9b4aeca007335a6c5149e73d060c9864345e19bc6da5b dist/index.js.map
12
+ 488b2a9c9dc822a4253c0250c9f7c4a5c7547e8c805dda35e9b28a1f31587c06 dist/index.mjs
13
+ 4e70e0d9ae5ba14eeda706acb5c28eb1e770d914319ae2f48940f337b9aced59 dist/index.d.mts
14
+ 4e70e0d9ae5ba14eeda706acb5c28eb1e770d914319ae2f48940f337b9aced59 dist/index.d.ts
15
15
 
16
16
  ## Source Files (SHA256)
17
17
 
@@ -24,12 +24,12 @@ Version: 1.0.21
24
24
  174ffc46347008d3f473af1916e8b1b38fb9752e68a69776df831dca676a1342 src/api/public.ts
25
25
  392124cca58a1532bd57472ba574bc065052c552ea8f10b7c675c942310c67e8 src/api/wallets.ts
26
26
  39fd4908c74bcca8c4e74a3a4e16de4439dfca781a7644ca9383c5f5096744cf src/types/futures.ts
27
+ 3e5ff90a945e12f321b0e7a5bdef82f95e0b04f6ba794eeed9d4887d80d50323 src/api/pay.ts
27
28
  3ff881e0a329681fecb0eae9ce178e9d1e6e4d6a6d55bfb5eec99a46c85d4e2a src/types/margin.ts
28
29
  40f2245b2685e634bd0f531367561c1c26d174cc083c496c1f914e8c6a9f948a src/client/ValrWebSocketClient.ts
29
30
  4202fe777fda3e43ff944971783116f17031d124395e4a44cb2bf2bec5ff246c src/types/bundles.ts
30
31
  43ce3b42153a2e1a2d290ea893507c820e4461eb2162b1ccfa0d832118468618 src/api/margin.ts
31
32
  4abf3aa146557f6f33f039a03a675cb6588da94f29e885ef97458cb698699425 src/types/common.ts
32
- 5475e829a33f944dec5dd4079066aa621c76c7767ac56f172a322ce110d43f0b src/types/pay.ts
33
33
  551aa287e635dad4d0209502a0410f09c169715a5bac95366a875038c3e50504 src/api/futures.ts
34
34
  5572db3151cd4db275a7ac6e8a8859e3c9048e0bd873a113f445139c0db2017c src/api/bundles.ts
35
35
  562187bbc4b29a68add1fad7d63c73fb1345b45154358fa0276e2e224cfb7e5a src/types/account.ts
@@ -39,9 +39,9 @@ Version: 1.0.21
39
39
  6ec43e250aca38bc6a9dc4f16e5fe7e6ca25bd831270c5d02c1bc82d79f5731d src/types/loans.ts
40
40
  70636220daed500243e5cd40d25748efcd401a9ff50f4237fa200bce1fe3be38 src/errors/ValrError.ts
41
41
  84688ccf1549178fd43927028588f07d348076e4fe5681d61ea05179103c6959 src/types/trading.ts
42
- 9c02d6094465660040c390c199687b0a8200aa86eb5654c4f2077b928cf8546c src/types/index.ts
43
42
  a52c483def6de035f7fcf690b6102129ea22cb817bed5a106d3617c8edc7d849 src/api/stake.ts
44
- c4c0979b4fc9a035bcf0d1bd8b379e5e2e85c8ea39a812cb7d8cd66ba5c04494 src/api/pay.ts
43
+ dc9ef99ff3979f5dd0f0fc7231f9a6b9418dd13e0e8961511af1c9d54200576e src/types/pay.ts
44
+ ea33c7a1b695a352f19757f81304cb22dd446b12ee0ba3a58bfb31f2446bbb70 src/types/index.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
@@ -1821,49 +1821,127 @@ interface EarnHistoryParams {
1821
1821
  }
1822
1822
 
1823
1823
  /**
1824
- * Payment request
1824
+ * Create payment request (P2P payment within VALR)
1825
1825
  */
1826
1826
  interface CreatePaymentRequest {
1827
- /** Merchant ID */
1828
- merchantId: string;
1829
- /** Currency */
1827
+ /** Payment currency */
1830
1828
  currency: CurrencyCode;
1831
- /** Amount */
1832
- amount: string;
1833
- /** Description */
1834
- description?: string;
1835
- /** Return URL after payment */
1836
- returnUrl?: string;
1837
- /** Callback URL for payment notifications */
1838
- callbackUrl?: string;
1829
+ /** Payment amount */
1830
+ amount: number | string;
1831
+ /** Recipient's email address (one of: recipientEmail, recipientCellNumber, or recipientPayId required) */
1832
+ recipientEmail?: string;
1833
+ /** Recipient's cell number (one of: recipientEmail, recipientCellNumber, or recipientPayId required) */
1834
+ recipientCellNumber?: string;
1835
+ /** Recipient's Pay ID (one of: recipientEmail, recipientCellNumber, or recipientPayId required) */
1836
+ recipientPayId?: string;
1837
+ /** Note visible to recipient */
1838
+ recipientNote?: string;
1839
+ /** Private note for sender */
1840
+ senderNote?: string;
1841
+ /** Whether to send payment anonymously */
1842
+ anonymous?: boolean | string;
1843
+ }
1844
+ /**
1845
+ * Payment creation response
1846
+ */
1847
+ interface PaymentResponse {
1848
+ /** Unique payment identifier */
1849
+ identifier: string;
1850
+ /** Transaction ID */
1851
+ transactionId: string;
1839
1852
  }
1840
1853
  /**
1841
- * Payment
1854
+ * Payment status
1842
1855
  */
1843
- interface Payment {
1844
- /** Payment ID */
1845
- id: string;
1846
- /** Merchant ID */
1847
- merchantId: string;
1848
- /** Currency */
1849
- currency: CurrencyCode;
1850
- /** Amount */
1856
+ type PaymentStatusType = 'PENDING' | 'COMPLETE' | 'RETURNED' | 'CANCELLED';
1857
+ /**
1858
+ * Payment direction/type
1859
+ */
1860
+ type PaymentDirection = 'SEND' | 'RECEIVE';
1861
+ /**
1862
+ * Payment transaction type
1863
+ */
1864
+ type PaymentTransactionType = 'DEBIT' | 'CREDIT';
1865
+ /**
1866
+ * Payment status by transaction ID
1867
+ */
1868
+ interface PaymentStatus {
1869
+ /** Payment amount */
1851
1870
  amount: string;
1871
+ /** Transaction timestamp */
1872
+ timestamp: ISOTimestamp;
1873
+ /** Transaction ID */
1874
+ transactionId: string;
1852
1875
  /** Payment status */
1853
- status: 'PENDING' | 'COMPLETED' | 'EXPIRED' | 'CANCELLED';
1854
- /** Payment URL */
1855
- paymentUrl: string;
1856
- /** When created */
1857
- createdAt: ISOTimestamp;
1858
- /** When expires */
1859
- expiresAt: ISOTimestamp;
1860
- /** When completed */
1861
- completedAt?: ISOTimestamp;
1876
+ status: PaymentStatusType;
1877
+ /** Payment direction */
1878
+ direction: PaymentDirection;
1862
1879
  }
1863
1880
  /**
1864
- * Payment status
1881
+ * Payment details
1882
+ */
1883
+ interface PaymentDetails {
1884
+ /** Unique payment identifier */
1885
+ identifier: string;
1886
+ /** Other party identifier (email, phone, or name) */
1887
+ otherPartyIdentifier: string;
1888
+ /** Payment amount */
1889
+ amount: number;
1890
+ /** Payment status */
1891
+ status: PaymentStatusType;
1892
+ /** Transaction timestamp */
1893
+ timestamp: ISOTimestamp;
1894
+ /** Private note from sender (only visible if you're the sender) */
1895
+ senderNote?: string;
1896
+ /** Note from recipient (visible to both parties) */
1897
+ recipientNote?: string;
1898
+ /** Transaction ID */
1899
+ transactionId: string;
1900
+ /** Whether payment was anonymous */
1901
+ anonymous: boolean;
1902
+ /** Transaction type (DEBIT = sent, CREDIT = received) */
1903
+ type: PaymentTransactionType;
1904
+ }
1905
+ /**
1906
+ * Payment history item
1865
1907
  */
1866
- interface PaymentStatus extends Payment {
1908
+ interface PaymentHistoryItem extends PaymentDetails {
1909
+ }
1910
+ /**
1911
+ * Payment limits
1912
+ */
1913
+ interface PaymentLimits {
1914
+ /** Maximum payment amount */
1915
+ maxPaymentAmount: number;
1916
+ /** Minimum payment amount */
1917
+ minPaymentAmount: number;
1918
+ /** Currency for these limits */
1919
+ paymentCurrency: CurrencyCode;
1920
+ /** Type of limit */
1921
+ limitType: string;
1922
+ }
1923
+ /**
1924
+ * Pay ID response
1925
+ */
1926
+ interface PayIdResponse {
1927
+ /** User's Pay ID */
1928
+ payId: string;
1929
+ }
1930
+ /**
1931
+ * Reverse payment request
1932
+ */
1933
+ interface ReversePaymentRequest {
1934
+ /** Transaction ID to reverse */
1935
+ transactionId: string;
1936
+ }
1937
+ /**
1938
+ * Partial reverse payment request
1939
+ */
1940
+ interface PartialReversePaymentRequest {
1941
+ /** Transaction ID to partially reverse */
1942
+ transactionId: string;
1943
+ /** Amount to reverse */
1944
+ amountToReverse: string;
1867
1945
  }
1868
1946
 
1869
1947
  /**
@@ -3357,12 +3435,74 @@ declare class StakeAPI {
3357
3435
 
3358
3436
  /**
3359
3437
  * Pay API methods (requires authentication)
3438
+ * P2P payments within VALR
3360
3439
  */
3361
3440
  declare class PayAPI {
3362
3441
  private http;
3363
3442
  constructor(http: HttpClient);
3364
- createPayment(request: CreatePaymentRequest): Promise<Payment>;
3365
- getPaymentStatus(paymentId: string): Promise<PaymentStatus>;
3443
+ /**
3444
+ * Create a new P2P payment
3445
+ * POST /v1/pay
3446
+ *
3447
+ * @param request - Payment request (must specify one of: recipientEmail, recipientCellNumber, or recipientPayId)
3448
+ * @returns Payment response with identifier and transaction ID
3449
+ */
3450
+ createPayment(request: CreatePaymentRequest): Promise<PaymentResponse>;
3451
+ /**
3452
+ * Reverse a payment completely
3453
+ * PUT /v1/pay/transactionid/:transactionId/reverse
3454
+ *
3455
+ * @param transactionId - Transaction ID to reverse
3456
+ * @returns Reversal confirmation
3457
+ */
3458
+ reversePayment(transactionId: string): Promise<void>;
3459
+ /**
3460
+ * Partially reverse a payment
3461
+ * PUT /v1/pay/transactionid/:transactionId/partial-reverse
3462
+ *
3463
+ * @param transactionId - Transaction ID to partially reverse
3464
+ * @param amountToReverse - Amount to reverse
3465
+ * @returns Partial reversal confirmation
3466
+ */
3467
+ partiallyReversePayment(transactionId: string, amountToReverse: string): Promise<void>;
3468
+ /**
3469
+ * Get payment limits for a currency
3470
+ * GET /v1/pay/limits
3471
+ *
3472
+ * @param currency - Currency code (e.g., "BTC", "ZAR")
3473
+ * @returns Payment limits for the specified currency
3474
+ */
3475
+ getPaymentLimits(currency: CurrencyCode): Promise<PaymentLimits>;
3476
+ /**
3477
+ * Get your Pay ID (unique identifier for receiving payments)
3478
+ * GET /v1/pay/payid
3479
+ *
3480
+ * @returns Your Pay ID
3481
+ */
3482
+ getPayId(): Promise<PayIdResponse>;
3483
+ /**
3484
+ * Get payment history (sent and received payments)
3485
+ * GET /v1/pay/history
3486
+ *
3487
+ * @returns Array of payment history items
3488
+ */
3489
+ getPaymentHistory(): Promise<PaymentHistoryItem[]>;
3490
+ /**
3491
+ * Get payment details by identifier
3492
+ * GET /v1/pay/identifier/:identifier
3493
+ *
3494
+ * @param identifier - Payment identifier
3495
+ * @returns Payment details
3496
+ */
3497
+ getPaymentByIdentifier(identifier: string): Promise<PaymentDetails>;
3498
+ /**
3499
+ * Get payment status by transaction ID
3500
+ * GET /v1/pay/transactionid/:transactionId
3501
+ *
3502
+ * @param transactionId - Transaction ID
3503
+ * @returns Payment status
3504
+ */
3505
+ getPaymentStatus(transactionId: string): Promise<PaymentStatus>;
3366
3506
  }
3367
3507
 
3368
3508
  /**
@@ -3911,4 +4051,4 @@ declare const HEADERS: {
3911
4051
  readonly RATE_LIMITED: "x-valr-ratelimited";
3912
4052
  };
3913
4053
 
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 };
4054
+ 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, type PartialReversePaymentRequest, PayAPI, type PayIdResponse, type PaymentDetails, type PaymentDirection, type PaymentHistoryItem, type PaymentLimits, type PaymentResponse, type PaymentStatus, type PaymentStatusType, type PaymentTransactionType, type PositionHistoryParams, type PostOnly, type PriceBucket, type PriceBucketsParams, type PriceQuantity, PublicAPI, RATE_LIMITS, RequestSigner, type RequestUnlockRequest, type ReversePaymentRequest, 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
@@ -1821,49 +1821,127 @@ interface EarnHistoryParams {
1821
1821
  }
1822
1822
 
1823
1823
  /**
1824
- * Payment request
1824
+ * Create payment request (P2P payment within VALR)
1825
1825
  */
1826
1826
  interface CreatePaymentRequest {
1827
- /** Merchant ID */
1828
- merchantId: string;
1829
- /** Currency */
1827
+ /** Payment currency */
1830
1828
  currency: CurrencyCode;
1831
- /** Amount */
1832
- amount: string;
1833
- /** Description */
1834
- description?: string;
1835
- /** Return URL after payment */
1836
- returnUrl?: string;
1837
- /** Callback URL for payment notifications */
1838
- callbackUrl?: string;
1829
+ /** Payment amount */
1830
+ amount: number | string;
1831
+ /** Recipient's email address (one of: recipientEmail, recipientCellNumber, or recipientPayId required) */
1832
+ recipientEmail?: string;
1833
+ /** Recipient's cell number (one of: recipientEmail, recipientCellNumber, or recipientPayId required) */
1834
+ recipientCellNumber?: string;
1835
+ /** Recipient's Pay ID (one of: recipientEmail, recipientCellNumber, or recipientPayId required) */
1836
+ recipientPayId?: string;
1837
+ /** Note visible to recipient */
1838
+ recipientNote?: string;
1839
+ /** Private note for sender */
1840
+ senderNote?: string;
1841
+ /** Whether to send payment anonymously */
1842
+ anonymous?: boolean | string;
1843
+ }
1844
+ /**
1845
+ * Payment creation response
1846
+ */
1847
+ interface PaymentResponse {
1848
+ /** Unique payment identifier */
1849
+ identifier: string;
1850
+ /** Transaction ID */
1851
+ transactionId: string;
1839
1852
  }
1840
1853
  /**
1841
- * Payment
1854
+ * Payment status
1842
1855
  */
1843
- interface Payment {
1844
- /** Payment ID */
1845
- id: string;
1846
- /** Merchant ID */
1847
- merchantId: string;
1848
- /** Currency */
1849
- currency: CurrencyCode;
1850
- /** Amount */
1856
+ type PaymentStatusType = 'PENDING' | 'COMPLETE' | 'RETURNED' | 'CANCELLED';
1857
+ /**
1858
+ * Payment direction/type
1859
+ */
1860
+ type PaymentDirection = 'SEND' | 'RECEIVE';
1861
+ /**
1862
+ * Payment transaction type
1863
+ */
1864
+ type PaymentTransactionType = 'DEBIT' | 'CREDIT';
1865
+ /**
1866
+ * Payment status by transaction ID
1867
+ */
1868
+ interface PaymentStatus {
1869
+ /** Payment amount */
1851
1870
  amount: string;
1871
+ /** Transaction timestamp */
1872
+ timestamp: ISOTimestamp;
1873
+ /** Transaction ID */
1874
+ transactionId: string;
1852
1875
  /** Payment status */
1853
- status: 'PENDING' | 'COMPLETED' | 'EXPIRED' | 'CANCELLED';
1854
- /** Payment URL */
1855
- paymentUrl: string;
1856
- /** When created */
1857
- createdAt: ISOTimestamp;
1858
- /** When expires */
1859
- expiresAt: ISOTimestamp;
1860
- /** When completed */
1861
- completedAt?: ISOTimestamp;
1876
+ status: PaymentStatusType;
1877
+ /** Payment direction */
1878
+ direction: PaymentDirection;
1862
1879
  }
1863
1880
  /**
1864
- * Payment status
1881
+ * Payment details
1882
+ */
1883
+ interface PaymentDetails {
1884
+ /** Unique payment identifier */
1885
+ identifier: string;
1886
+ /** Other party identifier (email, phone, or name) */
1887
+ otherPartyIdentifier: string;
1888
+ /** Payment amount */
1889
+ amount: number;
1890
+ /** Payment status */
1891
+ status: PaymentStatusType;
1892
+ /** Transaction timestamp */
1893
+ timestamp: ISOTimestamp;
1894
+ /** Private note from sender (only visible if you're the sender) */
1895
+ senderNote?: string;
1896
+ /** Note from recipient (visible to both parties) */
1897
+ recipientNote?: string;
1898
+ /** Transaction ID */
1899
+ transactionId: string;
1900
+ /** Whether payment was anonymous */
1901
+ anonymous: boolean;
1902
+ /** Transaction type (DEBIT = sent, CREDIT = received) */
1903
+ type: PaymentTransactionType;
1904
+ }
1905
+ /**
1906
+ * Payment history item
1865
1907
  */
1866
- interface PaymentStatus extends Payment {
1908
+ interface PaymentHistoryItem extends PaymentDetails {
1909
+ }
1910
+ /**
1911
+ * Payment limits
1912
+ */
1913
+ interface PaymentLimits {
1914
+ /** Maximum payment amount */
1915
+ maxPaymentAmount: number;
1916
+ /** Minimum payment amount */
1917
+ minPaymentAmount: number;
1918
+ /** Currency for these limits */
1919
+ paymentCurrency: CurrencyCode;
1920
+ /** Type of limit */
1921
+ limitType: string;
1922
+ }
1923
+ /**
1924
+ * Pay ID response
1925
+ */
1926
+ interface PayIdResponse {
1927
+ /** User's Pay ID */
1928
+ payId: string;
1929
+ }
1930
+ /**
1931
+ * Reverse payment request
1932
+ */
1933
+ interface ReversePaymentRequest {
1934
+ /** Transaction ID to reverse */
1935
+ transactionId: string;
1936
+ }
1937
+ /**
1938
+ * Partial reverse payment request
1939
+ */
1940
+ interface PartialReversePaymentRequest {
1941
+ /** Transaction ID to partially reverse */
1942
+ transactionId: string;
1943
+ /** Amount to reverse */
1944
+ amountToReverse: string;
1867
1945
  }
1868
1946
 
1869
1947
  /**
@@ -3357,12 +3435,74 @@ declare class StakeAPI {
3357
3435
 
3358
3436
  /**
3359
3437
  * Pay API methods (requires authentication)
3438
+ * P2P payments within VALR
3360
3439
  */
3361
3440
  declare class PayAPI {
3362
3441
  private http;
3363
3442
  constructor(http: HttpClient);
3364
- createPayment(request: CreatePaymentRequest): Promise<Payment>;
3365
- getPaymentStatus(paymentId: string): Promise<PaymentStatus>;
3443
+ /**
3444
+ * Create a new P2P payment
3445
+ * POST /v1/pay
3446
+ *
3447
+ * @param request - Payment request (must specify one of: recipientEmail, recipientCellNumber, or recipientPayId)
3448
+ * @returns Payment response with identifier and transaction ID
3449
+ */
3450
+ createPayment(request: CreatePaymentRequest): Promise<PaymentResponse>;
3451
+ /**
3452
+ * Reverse a payment completely
3453
+ * PUT /v1/pay/transactionid/:transactionId/reverse
3454
+ *
3455
+ * @param transactionId - Transaction ID to reverse
3456
+ * @returns Reversal confirmation
3457
+ */
3458
+ reversePayment(transactionId: string): Promise<void>;
3459
+ /**
3460
+ * Partially reverse a payment
3461
+ * PUT /v1/pay/transactionid/:transactionId/partial-reverse
3462
+ *
3463
+ * @param transactionId - Transaction ID to partially reverse
3464
+ * @param amountToReverse - Amount to reverse
3465
+ * @returns Partial reversal confirmation
3466
+ */
3467
+ partiallyReversePayment(transactionId: string, amountToReverse: string): Promise<void>;
3468
+ /**
3469
+ * Get payment limits for a currency
3470
+ * GET /v1/pay/limits
3471
+ *
3472
+ * @param currency - Currency code (e.g., "BTC", "ZAR")
3473
+ * @returns Payment limits for the specified currency
3474
+ */
3475
+ getPaymentLimits(currency: CurrencyCode): Promise<PaymentLimits>;
3476
+ /**
3477
+ * Get your Pay ID (unique identifier for receiving payments)
3478
+ * GET /v1/pay/payid
3479
+ *
3480
+ * @returns Your Pay ID
3481
+ */
3482
+ getPayId(): Promise<PayIdResponse>;
3483
+ /**
3484
+ * Get payment history (sent and received payments)
3485
+ * GET /v1/pay/history
3486
+ *
3487
+ * @returns Array of payment history items
3488
+ */
3489
+ getPaymentHistory(): Promise<PaymentHistoryItem[]>;
3490
+ /**
3491
+ * Get payment details by identifier
3492
+ * GET /v1/pay/identifier/:identifier
3493
+ *
3494
+ * @param identifier - Payment identifier
3495
+ * @returns Payment details
3496
+ */
3497
+ getPaymentByIdentifier(identifier: string): Promise<PaymentDetails>;
3498
+ /**
3499
+ * Get payment status by transaction ID
3500
+ * GET /v1/pay/transactionid/:transactionId
3501
+ *
3502
+ * @param transactionId - Transaction ID
3503
+ * @returns Payment status
3504
+ */
3505
+ getPaymentStatus(transactionId: string): Promise<PaymentStatus>;
3366
3506
  }
3367
3507
 
3368
3508
  /**
@@ -3911,4 +4051,4 @@ declare const HEADERS: {
3911
4051
  readonly RATE_LIMITED: "x-valr-ratelimited";
3912
4052
  };
3913
4053
 
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 };
4054
+ 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, type PartialReversePaymentRequest, PayAPI, type PayIdResponse, type PaymentDetails, type PaymentDirection, type PaymentHistoryItem, type PaymentLimits, type PaymentResponse, type PaymentStatus, type PaymentStatusType, type PaymentTransactionType, type PositionHistoryParams, type PostOnly, type PriceBucket, type PriceBucketsParams, type PriceQuantity, PublicAPI, RATE_LIMITS, RequestSigner, type RequestUnlockRequest, type ReversePaymentRequest, 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.js CHANGED
@@ -1901,12 +1901,93 @@ var PayAPI = class {
1901
1901
  constructor(http) {
1902
1902
  this.http = http;
1903
1903
  }
1904
+ /**
1905
+ * Create a new P2P payment
1906
+ * POST /v1/pay
1907
+ *
1908
+ * @param request - Payment request (must specify one of: recipientEmail, recipientCellNumber, or recipientPayId)
1909
+ * @returns Payment response with identifier and transaction ID
1910
+ */
1904
1911
  async createPayment(request) {
1905
- const response = await this.http.post("/v1/pay/payment", request);
1912
+ const response = await this.http.post("/v1/pay", request);
1913
+ return response.data;
1914
+ }
1915
+ /**
1916
+ * Reverse a payment completely
1917
+ * PUT /v1/pay/transactionid/:transactionId/reverse
1918
+ *
1919
+ * @param transactionId - Transaction ID to reverse
1920
+ * @returns Reversal confirmation
1921
+ */
1922
+ async reversePayment(transactionId) {
1923
+ await this.http.put(`/v1/pay/transactionid/${transactionId}/reverse`);
1924
+ }
1925
+ /**
1926
+ * Partially reverse a payment
1927
+ * PUT /v1/pay/transactionid/:transactionId/partial-reverse
1928
+ *
1929
+ * @param transactionId - Transaction ID to partially reverse
1930
+ * @param amountToReverse - Amount to reverse
1931
+ * @returns Partial reversal confirmation
1932
+ */
1933
+ async partiallyReversePayment(transactionId, amountToReverse) {
1934
+ await this.http.put(`/v1/pay/transactionid/${transactionId}/partial-reverse`, {
1935
+ amountToReverse
1936
+ });
1937
+ }
1938
+ /**
1939
+ * Get payment limits for a currency
1940
+ * GET /v1/pay/limits
1941
+ *
1942
+ * @param currency - Currency code (e.g., "BTC", "ZAR")
1943
+ * @returns Payment limits for the specified currency
1944
+ */
1945
+ async getPaymentLimits(currency) {
1946
+ const response = await this.http.get("/v1/pay/limits", {
1947
+ params: { currency }
1948
+ });
1906
1949
  return response.data;
1907
1950
  }
1908
- async getPaymentStatus(paymentId) {
1909
- const response = await this.http.get(`/v1/pay/payment/${paymentId}`);
1951
+ /**
1952
+ * Get your Pay ID (unique identifier for receiving payments)
1953
+ * GET /v1/pay/payid
1954
+ *
1955
+ * @returns Your Pay ID
1956
+ */
1957
+ async getPayId() {
1958
+ const response = await this.http.get("/v1/pay/payid");
1959
+ return response.data;
1960
+ }
1961
+ /**
1962
+ * Get payment history (sent and received payments)
1963
+ * GET /v1/pay/history
1964
+ *
1965
+ * @returns Array of payment history items
1966
+ */
1967
+ async getPaymentHistory() {
1968
+ const response = await this.http.get("/v1/pay/history");
1969
+ return response.data;
1970
+ }
1971
+ /**
1972
+ * Get payment details by identifier
1973
+ * GET /v1/pay/identifier/:identifier
1974
+ *
1975
+ * @param identifier - Payment identifier
1976
+ * @returns Payment details
1977
+ */
1978
+ async getPaymentByIdentifier(identifier) {
1979
+ const response = await this.http.get(`/v1/pay/identifier/${identifier}`);
1980
+ return response.data;
1981
+ }
1982
+ /**
1983
+ * Get payment status by transaction ID
1984
+ * GET /v1/pay/transactionid/:transactionId
1985
+ *
1986
+ * @param transactionId - Transaction ID
1987
+ * @returns Payment status
1988
+ */
1989
+ async getPaymentStatus(transactionId) {
1990
+ const response = await this.http.get(`/v1/pay/transactionid/${transactionId}`);
1910
1991
  return response.data;
1911
1992
  }
1912
1993
  };