feat(v3.1.5): Add Loan endpoints for UTA - #135
Merged
Merged
Conversation
- Bumped version in package.json and package-lock.json to 3.1.5. - Added new loan-related API endpoints: getLoanCoins, getLoanInterest, loanBorrow, getLoanBorrowOngoing, getLoanBorrowHistory, loanRepay, getLoanRepayHistory, loanRevisePledge, getLoanPledgeRateHistory, getLoanDebts, and getLoanReduces. - Introduced corresponding TypeScript interfaces for request and response types. - Updated websocket client to handle service upgrade notifications. - Added example scripts for new loan API endpoints in the documentation.
- Modified the handling of service upgrade notifications from Bitget to log the event and allow automatic reconnection instead of proactively closing the connection. - Updated log message to provide clearer context regarding potential connection drops.
tiagosiebler
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release notes
WebSocket (V3)
Auto-reconnect on service upgrade (Feb 4, 2026)
On error code 30033 ("Service upgrade in progress. Connection reset imminent. Please reconnect."), the client closes the connection so the normal reconnect flow runs.
Reconnect and resubscribe happen without extra client changes.
REST – Unified Account Staking & Lending (/api/v3/loan/*)
New endpoints (Feb 5, 2026)
Method HTTP Endpoint
getLoanCoins() GET /api/v3/loan/coins
getLoanInterest() GET /api/v3/loan/interest
loanBorrow() POST /api/v3/loan/borrow
getLoanBorrowOngoing() GET /api/v3/loan/borrow-ongoing
getLoanBorrowHistory() GET /api/v3/loan/borrow-history
loanRepay() POST /api/v3/loan/repay
getLoanRepayHistory() GET /api/v3/loan/repay-history
loanRevisePledge() POST /api/v3/loan/revise-pledge
getLoanPledgeRateHistory() GET /api/v3/loan/pledge-rate-history
getLoanDebts() GET /api/v3/loan/debts
getLoanReduces() GET /api/v3/loan/reduces
REST – Institution Loan margin coin info
Tiered Discount Rate Model (Feb 5, 2026)
CoinInfoV3 extended with optional convertRatioList (items with ladder and convertRatio).
New type ConvertRatioListItemV3 for tiered conversion rates.
REST – Market Maker Fee Rate APIs (Mar 3, 2026)
New endpoints
Method HTTP Endpoint
getMarketFeeGroup() GET /api/v3/market/fee-group
getMarketScoreWeights() GET /api/v3/market/score-weights
getMarketFeeGroup() returns fee tiers (MM1–MM5) and label groups.
getMarketScoreWeights() returns score weights per symbol.
REST – Transfer and instruments (Feb 8, 2026)
Transfer
Added allowBorrow?: 'yes' | 'no' to TransferRequestV3 and SubAccountTransferRequestV3.
Enables automatic margin borrowing when balance is insufficient.
Instruments
InstrumentV3 extended with launchTime?: string | null (Unix millisecond timestamp).
Used for listing launch time of trading pairs.
Files changed
src/types/request/v3/account.ts
src/types/request/v3/loan.ts
src/types/request/v3/public.ts
src/types/response/v3/loan.ts
src/types/response/v3/public.ts
src/rest-client-v3.ts
src/websocket-client-v3.ts