valr-typescript-client 1.0.5 → 1.0.7

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/dist/index.d.mts CHANGED
@@ -1035,145 +1035,299 @@ interface DepositAddress {
1035
1035
  /** Currency code */
1036
1036
  currency: CurrencyCode;
1037
1037
  /** Deposit address */
1038
- address: CryptoAddress;
1039
- /** Network type */
1038
+ address: string;
1039
+ /** Network type (e.g., "Ethereum", "Bitcoin") */
1040
1040
  networkType?: NetworkType;
1041
- /** Additional deposit info (e.g., memo, tag) */
1042
- additionalInfo?: {
1043
- paymentReference?: string;
1044
- memo?: string;
1045
- destinationTag?: string;
1041
+ /** Additional network-specific data */
1042
+ metadata?: {
1043
+ /** Destination tag for XRP, memo for Stellar, etc. */
1044
+ tag?: string;
1046
1045
  };
1047
1046
  }
1047
+ /**
1048
+ * Crypto deposit history params
1049
+ */
1050
+ interface CryptoDepositHistoryParams {
1051
+ /** Number of records to skip */
1052
+ skip?: number;
1053
+ /** Maximum number of records to return */
1054
+ limit?: number;
1055
+ /** Start time (ISO 8601) */
1056
+ startTime?: ISOTimestamp;
1057
+ /** End time (ISO 8601) */
1058
+ endTime?: ISOTimestamp;
1059
+ /** Filter by currency code */
1060
+ currency?: CurrencyCode;
1061
+ }
1062
+ /**
1063
+ * Crypto deposit history item
1064
+ */
1065
+ interface CryptoDepositHistoryItem {
1066
+ /** Currency code */
1067
+ currencyCode: CurrencyCode;
1068
+ /** Receiving address */
1069
+ receiveAddress: string;
1070
+ /** Transaction hash */
1071
+ transactionHash: string;
1072
+ /** Deposit amount */
1073
+ amount: string;
1074
+ /** When deposit was created */
1075
+ createdAt: ISOTimestamp;
1076
+ /** Number of confirmations */
1077
+ confirmations: number;
1078
+ /** Whether deposit is confirmed */
1079
+ confirmed: boolean;
1080
+ /** When deposit was confirmed */
1081
+ confirmedAt?: ISOTimestamp;
1082
+ }
1083
+ /**
1084
+ * Whitelisted withdrawal address
1085
+ */
1086
+ interface WhitelistedAddress {
1087
+ /** Address ID */
1088
+ id: string;
1089
+ /** User-friendly label */
1090
+ label: string;
1091
+ /** Currency code */
1092
+ currency: CurrencyCode;
1093
+ /** Withdrawal address */
1094
+ address: string;
1095
+ /** Network type */
1096
+ networkType: string;
1097
+ /** When address was created */
1098
+ createdAt: ISOTimestamp;
1099
+ /** Beneficiary name */
1100
+ beneficiaryName?: string;
1101
+ /** Whether beneficiary is a corporate entity */
1102
+ isCorporate?: boolean;
1103
+ /** Whether address is self-hosted */
1104
+ isSelfHosted?: boolean;
1105
+ /** Service provider name if applicable */
1106
+ serviceProviderName?: string;
1107
+ }
1108
+ /**
1109
+ * Withdrawal configuration info
1110
+ */
1111
+ interface WithdrawalConfigInfo {
1112
+ /** Currency code */
1113
+ currency: CurrencyCode;
1114
+ /** Whether withdrawals are active */
1115
+ isActive: boolean;
1116
+ /** Minimum withdrawal amount */
1117
+ minimumWithdrawAmount: string;
1118
+ /** Network type */
1119
+ networkType: string;
1120
+ /** Whether payment reference is supported */
1121
+ supportsPaymentReference: boolean;
1122
+ /** Withdrawal cost/fee */
1123
+ withdrawCost: string;
1124
+ /** Withdrawal decimal places */
1125
+ withdrawalDecimalPlaces: number;
1126
+ }
1048
1127
  /**
1049
1128
  * Crypto withdrawal request
1050
1129
  */
1051
1130
  interface CryptoWithdrawalRequest {
1052
- /** Currency to withdraw */
1131
+ /** Currency code (not in body, used in path) */
1053
1132
  currency: CurrencyCode;
1054
- /** Amount to withdraw */
1055
- amount: string;
1056
1133
  /** Destination address */
1057
- address: CryptoAddress;
1058
- /** Network type (optional) */
1134
+ address: string;
1135
+ /** Withdrawal amount */
1136
+ amount: string;
1137
+ /** Network type */
1059
1138
  networkType?: NetworkType;
1060
- /** Payment reference/memo/tag (optional) */
1139
+ /** Payment reference/memo (optional) */
1061
1140
  paymentReference?: string;
1141
+ /** Allow borrowing to fulfill withdrawal */
1142
+ allowBorrow?: boolean;
1143
+ /** Beneficiary name (Travel Rule requirement) */
1144
+ beneficiaryName?: string;
1145
+ /** Whether beneficiary is a corporate entity (Travel Rule) */
1146
+ isCorporate?: boolean;
1147
+ /** Whether address is self-hosted (Travel Rule) */
1148
+ isSelfHosted?: boolean;
1149
+ /** Service provider ID */
1150
+ serviceProviderId?: string;
1062
1151
  }
1063
1152
  /**
1064
1153
  * Crypto withdrawal response
1065
1154
  */
1066
1155
  interface CryptoWithdrawalResponse {
1067
- /** Withdrawal ID */
1156
+ /** Unique withdrawal ID */
1068
1157
  id: string;
1069
- /** Currency */
1158
+ }
1159
+ /**
1160
+ * Crypto withdrawal status
1161
+ */
1162
+ interface CryptoWithdrawalStatus {
1163
+ /** Unique withdrawal ID */
1164
+ uniqueId: string;
1165
+ /** Currency code */
1070
1166
  currency: CurrencyCode;
1071
- /** Amount */
1072
- amount: string;
1073
- /** Fee */
1074
- fee: string;
1075
1167
  /** Destination address */
1076
- address: CryptoAddress;
1077
- /** Transaction hash (once broadcast) */
1168
+ address: string;
1169
+ /** Withdrawal amount */
1170
+ amount: string;
1171
+ /** Fee amount */
1172
+ feeAmount: string;
1173
+ /** Transaction hash (if available) */
1078
1174
  transactionHash?: string;
1079
- /** Confirmations */
1080
- confirmations?: number;
1081
- /** Status */
1082
- status: 'PENDING' | 'PROCESSING' | 'CONFIRMED' | 'FAILED' | 'CANCELLED';
1083
- /** Created timestamp */
1175
+ /** Number of confirmations */
1176
+ confirmations: number;
1177
+ /** When last confirmation occurred */
1178
+ lastConfirmationAt?: ISOTimestamp;
1179
+ /** When withdrawal was created */
1084
1180
  createdAt: ISOTimestamp;
1181
+ /** Whether withdrawal is verified */
1182
+ verified: boolean;
1183
+ /** Withdrawal status */
1184
+ status: 'Pending' | 'Processing' | 'Complete' | 'Failed' | 'Cancelled';
1185
+ /** Network type */
1186
+ networkType?: string;
1085
1187
  }
1086
1188
  /**
1087
- * Crypto withdrawal status
1189
+ * Service provider information
1088
1190
  */
1089
- interface CryptoWithdrawalStatus extends CryptoWithdrawalResponse {
1191
+ interface ServiceProvider {
1192
+ /** Service provider ID */
1193
+ id: string;
1194
+ /** Provider name */
1195
+ name: string;
1090
1196
  }
1091
1197
  /**
1092
- * Crypto withdrawal history parameters
1198
+ * Crypto withdrawal history params
1093
1199
  */
1094
- interface CryptoWithdrawalHistoryParams extends PaginationParams {
1095
- /** Filter by currency */
1200
+ interface CryptoWithdrawalHistoryParams {
1201
+ /** Number of records to skip */
1202
+ skip?: number;
1203
+ /** Maximum number of records to return */
1204
+ limit?: number;
1205
+ /** Filter by currency code */
1096
1206
  currency?: CurrencyCode;
1207
+ /** Start time (ISO 8601) */
1208
+ startTime?: ISOTimestamp;
1209
+ /** End time (ISO 8601) */
1210
+ endTime?: ISOTimestamp;
1097
1211
  }
1098
1212
  /**
1099
- * Fiat bank account
1213
+ * Crypto withdrawal history item
1214
+ */
1215
+ interface CryptoWithdrawalHistoryItem {
1216
+ /** Currency code */
1217
+ currency: CurrencyCode;
1218
+ /** Destination address */
1219
+ address: string;
1220
+ /** Withdrawal amount */
1221
+ amount: string;
1222
+ /** Fee amount */
1223
+ feeAmount: string;
1224
+ /** Transaction hash (if available) */
1225
+ transactionHash?: string;
1226
+ /** Number of confirmations */
1227
+ confirmations: number;
1228
+ /** When last confirmation occurred */
1229
+ lastConfirmationAt?: ISOTimestamp;
1230
+ /** Unique withdrawal ID */
1231
+ uniqueId: string;
1232
+ /** When withdrawal was created */
1233
+ createdAt: ISOTimestamp;
1234
+ /** Whether withdrawal is verified */
1235
+ verified: boolean;
1236
+ /** Withdrawal status */
1237
+ status: string;
1238
+ /** Network type */
1239
+ networkType: string;
1240
+ }
1241
+ /**
1242
+ * Bank information
1243
+ */
1244
+ interface Bank {
1245
+ /** Bank code */
1246
+ code: string;
1247
+ /** Display name */
1248
+ displayName: string;
1249
+ /** Default branch code */
1250
+ defaultBranchCode: string;
1251
+ /** Whether bank participates in RTC (Real-Time Clearing) */
1252
+ rtcParticipant: boolean;
1253
+ /** Whether bank participates in RTGS (Real-Time Gross Settlement) */
1254
+ rtgsParticipant: boolean;
1255
+ /** Country code */
1256
+ countryCode: string;
1257
+ }
1258
+ /**
1259
+ * Bank account
1100
1260
  */
1101
1261
  interface BankAccount {
1102
- /** Bank account ID */
1262
+ /** Account ID */
1103
1263
  id: string;
1104
1264
  /** Bank name */
1105
1265
  bank: string;
1106
1266
  /** Account holder name */
1107
1267
  accountHolder: string;
1108
- /** Account number (masked) */
1268
+ /** Account number */
1109
1269
  accountNumber: string;
1110
1270
  /** Branch code */
1111
- branchCode?: string;
1271
+ branchCode: string;
1112
1272
  /** Account type */
1113
- accountType?: string;
1114
- /** Verified status */
1115
- verified: boolean;
1273
+ accountType: string;
1274
+ /** When account was linked */
1275
+ createdAt: ISOTimestamp;
1276
+ /** Country code */
1277
+ country: string;
1116
1278
  }
1117
1279
  /**
1118
1280
  * Link bank account request
1119
1281
  */
1120
1282
  interface LinkBankAccountRequest {
1121
- /** Bank name */
1283
+ /** Bank code */
1122
1284
  bank: string;
1123
1285
  /** Account holder name */
1124
1286
  accountHolder: string;
1125
1287
  /** Account number */
1126
1288
  accountNumber: string;
1127
1289
  /** Branch code */
1128
- branchCode?: string;
1290
+ branchCode: string;
1129
1291
  /** Account type */
1130
- accountType?: string;
1292
+ accountType: string;
1293
+ /** Country code */
1294
+ country: string;
1295
+ }
1296
+ /**
1297
+ * Fiat deposit reference
1298
+ */
1299
+ interface FiatDepositReference {
1300
+ /** Reference code to use when depositing */
1301
+ reference: string;
1302
+ }
1303
+ /**
1304
+ * Auto-buy deposit reference
1305
+ */
1306
+ interface AutoBuyDepositReference {
1307
+ /** Reference code to use when depositing */
1308
+ reference: string;
1131
1309
  }
1132
1310
  /**
1133
1311
  * Fiat withdrawal request
1134
1312
  */
1135
1313
  interface FiatWithdrawalRequest {
1136
- /** Currency (e.g., ZAR) */
1314
+ /** Currency code */
1137
1315
  currency: CurrencyCode;
1138
- /** Amount to withdraw */
1316
+ /** Withdrawal amount */
1139
1317
  amount: string;
1140
- /** Bank account ID (from linked accounts) */
1141
- beneficiaryId: string;
1142
- /** Whether this is a fast withdrawal */
1318
+ /** Linked bank account ID */
1319
+ linkedBankAccountId: string;
1320
+ /** Whether withdrawal is fast */
1143
1321
  fast?: boolean;
1322
+ /** Allow borrowing to fulfill withdrawal */
1323
+ allowBorrow?: boolean;
1144
1324
  }
1145
1325
  /**
1146
1326
  * Fiat withdrawal response
1147
1327
  */
1148
1328
  interface FiatWithdrawalResponse {
1149
- /** Withdrawal ID */
1329
+ /** Unique withdrawal ID */
1150
1330
  id: string;
1151
- /** Currency */
1152
- currency: CurrencyCode;
1153
- /** Amount */
1154
- amount: string;
1155
- /** Fee */
1156
- fee: string;
1157
- /** Bank account ID */
1158
- beneficiaryId: string;
1159
- /** Status */
1160
- status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
1161
- /** Created timestamp */
1162
- createdAt: ISOTimestamp;
1163
- }
1164
- /**
1165
- * Fiat deposit reference
1166
- */
1167
- interface FiatDepositReference {
1168
- /** Unique payment reference */
1169
- paymentReference: string;
1170
- /** Bank account details for deposit */
1171
- bankAccountDetails: {
1172
- bank: string;
1173
- accountHolder: string;
1174
- accountNumber: string;
1175
- branchCode?: string;
1176
- };
1177
1331
  }
1178
1332
 
1179
1333
  /**
@@ -1792,18 +1946,60 @@ interface OrderStatusUpdate extends BaseWebSocketMessage {
1792
1946
  customerOrderId?: CustomerOrderId;
1793
1947
  }
1794
1948
  /**
1795
- * Balance update (WebSocket)
1949
+ * Currency info in balance update
1796
1950
  */
1797
- interface BalanceUpdate extends BaseWebSocketMessage {
1798
- type: 'BALANCE_UPDATE';
1799
- /** Currency */
1800
- currency: string;
1951
+ interface BalanceCurrency {
1952
+ /** Currency symbol */
1953
+ symbol: string;
1954
+ /** Decimal places */
1955
+ decimalPlaces: number;
1956
+ /** Whether currency is active */
1957
+ isActive: boolean;
1958
+ /** Short name */
1959
+ shortName: string;
1960
+ /** Long name */
1961
+ longName: string;
1962
+ /** Supported withdraw decimal places */
1963
+ supportedWithdrawDecimalPlaces: number;
1964
+ /** Whether currency can be used as collateral */
1965
+ collateral: boolean;
1966
+ /** Collateral weight */
1967
+ collateralWeight: string;
1968
+ }
1969
+ /**
1970
+ * Balance update data
1971
+ */
1972
+ interface BalanceUpdateData {
1973
+ /** Currency info */
1974
+ currency: BalanceCurrency;
1801
1975
  /** Available balance */
1802
1976
  available: string;
1803
1977
  /** Reserved balance */
1804
1978
  reserved: string;
1805
1979
  /** Total balance */
1806
1980
  total: string;
1981
+ /** When balance was updated */
1982
+ updatedAt: ISOTimestamp;
1983
+ /** Lend reserved amount */
1984
+ lendReserved: string;
1985
+ /** Borrow collateral reserved */
1986
+ borrowCollateralReserved: string;
1987
+ /** Borrowed amount */
1988
+ borrowedAmount: string;
1989
+ /** Total in reference currency */
1990
+ totalInReference: string;
1991
+ /** Total in reference currency weighted */
1992
+ totalInReferenceWeighted: string;
1993
+ /** Reference currency */
1994
+ referenceCurrency: string;
1995
+ }
1996
+ /**
1997
+ * Balance update (WebSocket)
1998
+ */
1999
+ interface BalanceUpdate extends BaseWebSocketMessage {
2000
+ type: 'BALANCE_UPDATE';
2001
+ /** Balance data */
2002
+ data: BalanceUpdateData;
1807
2003
  }
1808
2004
  /**
1809
2005
  * Account trade (WebSocket)
@@ -2359,17 +2555,275 @@ declare class TradingAPI {
2359
2555
 
2360
2556
  /**
2361
2557
  * Wallets API methods (requires authentication)
2558
+ *
2559
+ * Provides methods for managing crypto and fiat wallets,
2560
+ * including deposits, withdrawals, and account management.
2362
2561
  */
2363
2562
  declare class WalletsAPI {
2364
2563
  private http;
2365
2564
  constructor(http: HttpClient);
2366
- getCryptoDepositAddress(currency: CurrencyCode, networkType?: string): Promise<DepositAddress>;
2565
+ /**
2566
+ * Get deposit address for a currency
2567
+ *
2568
+ * @param currencyCode - Currency code
2569
+ * @param networkType - Optional network type
2570
+ * @returns Promise resolving to deposit address
2571
+ *
2572
+ * @example
2573
+ * ```typescript
2574
+ * const address = await client.wallets.getCryptoDepositAddress('BTC');
2575
+ * console.log('Deposit to:', address.address);
2576
+ * ```
2577
+ */
2578
+ getCryptoDepositAddress(currencyCode: CurrencyCode, networkType?: string): Promise<DepositAddress>;
2579
+ /**
2580
+ * Get crypto deposit history
2581
+ *
2582
+ * @param params - Optional query parameters for filtering
2583
+ * @returns Promise resolving to array of deposit history items
2584
+ *
2585
+ * @example
2586
+ * ```typescript
2587
+ * const deposits = await client.wallets.getCryptoDepositHistory({
2588
+ * skip: 0,
2589
+ * limit: 100,
2590
+ * currency: 'BTC',
2591
+ * startTime: '2025-01-01T00:00:00Z',
2592
+ * endTime: '2025-01-31T23:59:59Z'
2593
+ * });
2594
+ * ```
2595
+ */
2596
+ getCryptoDepositHistory(params?: CryptoDepositHistoryParams): Promise<CryptoDepositHistoryItem[]>;
2597
+ /**
2598
+ * Get whitelisted withdrawal address book
2599
+ *
2600
+ * @returns Promise resolving to array of whitelisted addresses
2601
+ *
2602
+ * @example
2603
+ * ```typescript
2604
+ * const addresses = await client.wallets.getWhitelistedAddresses();
2605
+ * ```
2606
+ */
2607
+ getWhitelistedAddresses(): Promise<WhitelistedAddress[]>;
2608
+ /**
2609
+ * Get whitelisted withdrawal addresses for a specific currency
2610
+ *
2611
+ * @param currencyCode - Currency code
2612
+ * @returns Promise resolving to array of whitelisted addresses for that currency
2613
+ *
2614
+ * @example
2615
+ * ```typescript
2616
+ * const btcAddresses = await client.wallets.getWhitelistedAddressesByCurrency('BTC');
2617
+ * ```
2618
+ */
2619
+ getWhitelistedAddressesByCurrency(currencyCode: CurrencyCode): Promise<WhitelistedAddress[]>;
2620
+ /**
2621
+ * Get withdrawal configuration info for a currency
2622
+ *
2623
+ * Returns withdrawal limits and fees.
2624
+ *
2625
+ * @param currencyCode - Currency code
2626
+ * @returns Promise resolving to withdrawal config info
2627
+ *
2628
+ * @example
2629
+ * ```typescript
2630
+ * const config = await client.wallets.getCryptoWithdrawalInfo('ETH');
2631
+ * console.log('Fee:', config.withdrawalFee);
2632
+ * ```
2633
+ */
2634
+ getCryptoWithdrawalInfo(currencyCode: CurrencyCode): Promise<WithdrawalConfigInfo>;
2635
+ /**
2636
+ * Withdraw cryptocurrency
2637
+ *
2638
+ * @param request - Withdrawal request parameters
2639
+ * @returns Promise resolving to withdrawal response
2640
+ *
2641
+ * @example
2642
+ * ```typescript
2643
+ * const withdrawal = await client.wallets.withdrawCrypto({
2644
+ * currency: 'BTC',
2645
+ * amount: '0.1',
2646
+ * address: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'
2647
+ * });
2648
+ * ```
2649
+ */
2367
2650
  withdrawCrypto(request: CryptoWithdrawalRequest): Promise<CryptoWithdrawalResponse>;
2368
- getCryptoWithdrawalStatus(currency: CurrencyCode, withdrawalId: string): Promise<CryptoWithdrawalStatus>;
2369
- getBankAccounts(currency: CurrencyCode): Promise<BankAccount[]>;
2370
- linkBankAccount(currency: CurrencyCode, request: LinkBankAccountRequest): Promise<BankAccount>;
2651
+ /**
2652
+ * Get withdrawal status
2653
+ *
2654
+ * @param currencyCode - Currency code
2655
+ * @param withdrawId - Withdrawal ID
2656
+ * @returns Promise resolving to withdrawal status
2657
+ *
2658
+ * @example
2659
+ * ```typescript
2660
+ * const status = await client.wallets.getCryptoWithdrawalStatus('BTC', 'withdraw-id-123');
2661
+ * console.log('Status:', status.status);
2662
+ * ```
2663
+ */
2664
+ getCryptoWithdrawalStatus(currencyCode: CurrencyCode, withdrawId: string): Promise<CryptoWithdrawalStatus>;
2665
+ /**
2666
+ * Get supported service providers
2667
+ *
2668
+ * Returns list of supported crypto service providers.
2669
+ *
2670
+ * @returns Promise resolving to array of service providers
2671
+ *
2672
+ * @example
2673
+ * ```typescript
2674
+ * const providers = await client.wallets.getServiceProviders();
2675
+ * ```
2676
+ */
2677
+ getServiceProviders(): Promise<ServiceProvider[]>;
2678
+ /**
2679
+ * Get crypto withdrawal history
2680
+ *
2681
+ * @param params - Optional query parameters
2682
+ * @returns Promise resolving to array of withdrawal history items
2683
+ *
2684
+ * @example
2685
+ * ```typescript
2686
+ * const history = await client.wallets.getCryptoWithdrawalHistory({ skip: 0, limit: 100 });
2687
+ * ```
2688
+ */
2689
+ getCryptoWithdrawalHistory(params?: CryptoWithdrawalHistoryParams): Promise<CryptoWithdrawalHistoryItem[]>;
2690
+ /**
2691
+ * Add/link a bank account
2692
+ *
2693
+ * @param currencyCode - Currency code (e.g., 'ZAR')
2694
+ * @param request - Bank account details
2695
+ * @returns Promise resolving to created bank account
2696
+ *
2697
+ * @example
2698
+ * ```typescript
2699
+ * const account = await client.wallets.addBankAccount('ZAR', {
2700
+ * bank: 'FNB',
2701
+ * accountHolder: 'John Doe',
2702
+ * accountNumber: '62792461544',
2703
+ * branchCode: '250655',
2704
+ * accountType: 'Current/Cheque'
2705
+ * });
2706
+ * ```
2707
+ */
2708
+ addBankAccount(currencyCode: CurrencyCode, request: LinkBankAccountRequest): Promise<BankAccount>;
2709
+ /**
2710
+ * Get bank account details
2711
+ *
2712
+ * @param currencyCode - Currency code
2713
+ * @param accountId - Bank account ID
2714
+ * @returns Promise resolving to bank account details
2715
+ *
2716
+ * @example
2717
+ * ```typescript
2718
+ * const account = await client.wallets.getBankAccount('ZAR', 'account-id-123');
2719
+ * ```
2720
+ */
2721
+ getBankAccount(currencyCode: CurrencyCode, accountId: string): Promise<BankAccount>;
2722
+ /**
2723
+ * Get all linked bank accounts
2724
+ *
2725
+ * @param currencyCode - Currency code
2726
+ * @returns Promise resolving to array of bank accounts
2727
+ *
2728
+ * @example
2729
+ * ```typescript
2730
+ * const accounts = await client.wallets.getBankAccounts('ZAR');
2731
+ * ```
2732
+ */
2733
+ getBankAccounts(currencyCode: CurrencyCode): Promise<BankAccount[]>;
2734
+ /**
2735
+ * Delete a bank account
2736
+ *
2737
+ * @param currencyCode - Currency code
2738
+ * @param accountId - Bank account ID
2739
+ * @returns Promise that resolves when account is deleted
2740
+ *
2741
+ * @example
2742
+ * ```typescript
2743
+ * await client.wallets.deleteBankAccount('ZAR', 'account-id-123');
2744
+ * ```
2745
+ */
2746
+ deleteBankAccount(currencyCode: CurrencyCode, accountId: string): Promise<void>;
2747
+ /**
2748
+ * Get list of supported banks for a currency
2749
+ *
2750
+ * @param currencyCode - Currency code
2751
+ * @returns Promise resolving to array of banks
2752
+ *
2753
+ * @example
2754
+ * ```typescript
2755
+ * const banks = await client.wallets.getBanks('ZAR');
2756
+ * banks.forEach(bank => {
2757
+ * console.log(`${bank.displayName} (${bank.code})`);
2758
+ * });
2759
+ * ```
2760
+ */
2761
+ getBanks(currencyCode: CurrencyCode): Promise<Bank[]>;
2762
+ /**
2763
+ * Get fiat deposit reference
2764
+ *
2765
+ * Returns your unique deposit reference for depositing fiat currency.
2766
+ *
2767
+ * @param currencyCode - Currency code
2768
+ * @returns Promise resolving to deposit reference
2769
+ *
2770
+ * @example
2771
+ * ```typescript
2772
+ * const ref = await client.wallets.getFiatDepositReference('ZAR');
2773
+ * console.log('Use reference:', ref.reference);
2774
+ * ```
2775
+ */
2776
+ getFiatDepositReference(currencyCode: CurrencyCode): Promise<FiatDepositReference>;
2777
+ /**
2778
+ * Get auto-buy deposit reference
2779
+ *
2780
+ * Returns a deposit reference that will automatically convert fiat to crypto.
2781
+ *
2782
+ * @param currencyCode - Fiat currency code (e.g., 'ZAR')
2783
+ * @param buyCurrencySymbol - Crypto currency to auto-buy (e.g., 'BTC')
2784
+ * @returns Promise resolving to auto-buy deposit reference
2785
+ *
2786
+ * @example
2787
+ * ```typescript
2788
+ * const ref = await client.wallets.getAutoBuyDepositReference('ZAR', 'BTC');
2789
+ * console.log('Deposit ZAR with this reference to auto-buy BTC:', ref.reference);
2790
+ * ```
2791
+ */
2792
+ getAutoBuyDepositReference(currencyCode: CurrencyCode, buyCurrencySymbol: CurrencyCode): Promise<AutoBuyDepositReference>;
2793
+ /**
2794
+ * Get supported auto-buy currencies
2795
+ *
2796
+ * Returns which crypto currencies can be auto-bought with the specified fiat currency.
2797
+ *
2798
+ * @param currencyCode - Fiat currency code
2799
+ * @returns Promise resolving to array of supported currency codes
2800
+ *
2801
+ * @example
2802
+ * ```typescript
2803
+ * const currencies = await client.wallets.getAutoBuyCurrencies('ZAR');
2804
+ * currencies.forEach(code => {
2805
+ * console.log(`Supports auto-buy for: ${code}`);
2806
+ * });
2807
+ * ```
2808
+ */
2809
+ getAutoBuyCurrencies(currencyCode: CurrencyCode): Promise<CurrencyCode[]>;
2810
+ /**
2811
+ * Withdraw fiat currency
2812
+ *
2813
+ * @param request - Withdrawal request parameters
2814
+ * @returns Promise resolving to withdrawal response
2815
+ *
2816
+ * @example
2817
+ * ```typescript
2818
+ * const withdrawal = await client.wallets.withdrawFiat({
2819
+ * currency: 'ZAR',
2820
+ * amount: '1000',
2821
+ * linkedBankAccountId: 'account-id-123',
2822
+ * fast: true
2823
+ * });
2824
+ * ```
2825
+ */
2371
2826
  withdrawFiat(request: FiatWithdrawalRequest): Promise<FiatWithdrawalResponse>;
2372
- getFiatDepositReference(currency: CurrencyCode): Promise<FiatDepositReference>;
2373
2827
  }
2374
2828
 
2375
2829
  /**
@@ -2856,6 +3310,8 @@ interface WebSocketClientConfig {
2856
3310
  reconnectDelay?: number;
2857
3311
  /** Maximum reconnect attempts (default: Infinity) */
2858
3312
  maxReconnectAttempts?: number;
3313
+ /** Base URL for WS (defaults to wss://api.valr.com) */
3314
+ baseURL?: string;
2859
3315
  }
2860
3316
  /**
2861
3317
  * WebSocket event types
@@ -2875,13 +3331,14 @@ interface WebSocketEvents {
2875
3331
  declare abstract class ValrWebSocketClient<TEvents extends WebSocketEvents = WebSocketEvents> extends EventEmitter<TEvents> {
2876
3332
  protected ws?: WebSocket;
2877
3333
  protected url: string;
3334
+ protected path: string;
2878
3335
  protected config: Required<WebSocketClientConfig>;
2879
3336
  protected reconnectAttempts: number;
2880
3337
  protected reconnectTimer?: NodeJS.Timeout;
2881
3338
  protected isIntentionalClose: boolean;
2882
3339
  protected isConnected: boolean;
2883
3340
  protected isAuthenticated: boolean;
2884
- constructor(url: string, config?: WebSocketClientConfig);
3341
+ constructor(path: string, config?: WebSocketClientConfig);
2885
3342
  /**
2886
3343
  * Connect to WebSocket
2887
3344
  */
@@ -2902,10 +3359,6 @@ declare abstract class ValrWebSocketClient<TEvents extends WebSocketEvents = Web
2902
3359
  * Handle WebSocket open event
2903
3360
  */
2904
3361
  protected handleOpen(): void;
2905
- /**
2906
- * Authenticate WebSocket connection
2907
- */
2908
- protected authenticate(): void;
2909
3362
  /**
2910
3363
  * Handle incoming WebSocket message
2911
3364
  */
@@ -3212,11 +3665,12 @@ declare class RequestSigner {
3212
3665
  * Base URL for VALR API
3213
3666
  */
3214
3667
  declare const API_BASE_URL = "https://api.valr.com";
3668
+ declare const WS_BASE_URL = "wss://api.valr.com";
3215
3669
  /**
3216
3670
  * WebSocket URLs
3217
3671
  */
3218
- declare const WS_ACCOUNT_URL = "wss://api.valr.com/ws/account";
3219
- declare const WS_TRADE_URL = "wss://api.valr.com/ws/trade";
3672
+ declare const WS_ACCOUNT_URL_PATH = "/ws/account";
3673
+ declare const WS_TRADE_URL_PATH = "/ws/trade";
3220
3674
  /**
3221
3675
  * API rate limits
3222
3676
  */
@@ -3253,4 +3707,4 @@ declare const HEADERS: {
3253
3707
  readonly RATE_LIMITED: "x-valr-ratelimited";
3254
3708
  };
3255
3709
 
3256
- export { API_BASE_URL, AccountAPI, type AccountTrade$1 as AccountTrade, AccountWebSocket, type ApiKey, type Balance, type BalanceUpdate, type BalancesParams, 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 CryptoWithdrawalHistoryParams, type CryptoWithdrawalRequest, type CryptoWithdrawalResponse, type CryptoWithdrawalStatus, type Currency, type CurrencyCode, type CurrencyLeverageSettings, 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 MarginStatus, 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 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, WS_TRADE_URL, WalletsAPI, type AccountTrade as WebSocketAccountTrade, type WebSocketClientConfig, type WebSocketMessage, type WebSocketMessageType };
3710
+ export { API_BASE_URL, AccountAPI, 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 CurrencyLeverageSettings, 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 MarginStatus, 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 };