Skip to content

Commit d27a064

Browse files
author
石石
committed
feat: 支持 hk 语言
1 parent 577503d commit d27a064

106 files changed

Lines changed: 9958 additions & 76 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
},
2424
"peerDependencies": {
2525
"typescript": "^5"
26-
}
26+
},
27+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
2728
}

packages/docs/.vitepress/theme/utils/http-client.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ async function generateSignature(
9090
const signStr = `HMAC-SHA256|${canonicalHashHex}`
9191

9292
// 确保密钥是有效的字符串格式
93-
const normalizedSecret = secret.trim()
94-
if (!normalizedSecret) {
95-
throw new Error('App Secret 不能为空')
96-
}
93+
const normalizedSecret = secret?.trim() || 'unknown'
9794

9895
const secretKey = await crypto.subtle.importKey(
9996
'raw',

packages/docs/en/docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: Changelog
44
slug: changelog
55
sidebar_position: 7
66
---
7+
## 2025-06-17
8+
9+
- Update the interface for Get Account Balance
10+
- `GET /v1/asset/account` Add response field (frozen_transaction_fees)
711

812
## 2024-10-09
913

packages/docs/en/docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ yarn install longport
6969

7070
```toml
7171
[dependencies]
72-
longport = "1.0.0"
72+
longport = "3.0.5"
7373
tokio = { version = "1", features = "rt-multi-thread" }
7474
```
7575

@@ -118,7 +118,7 @@ Please pay attention to protect your **Access Token** information, anyone who ge
118118
:::
119119

120120
| 环境变量 | 说明 | 值范围 |
121-
| --------------------------- | ------------------------------------------------------------------ | --------------- |
121+
|-----------------------------|--------------------------------------------------------------------|-----------------|
122122
| `LONGPORT_APP_KEY` | App Key get from developer center | |
123123
| `LONGPORT_APP_SECRET` | App Secret get from developer center | |
124124
| `LONGPORT_ACCESS_TOKEN` | Access Token get from developer center | |

packages/docs/en/docs/qa/general.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ A: If a customer holds multiple securities accounts, such as intraday financing
3434
## Q7: Are there additional charges for trading operations through LongPort OpenAPI?
3535

3636
A: We do not charge additional fees for accessing market queries, trading, etc., via OpenAPI. For account-related fees such as trading commissions, platform fees, and market permissions, please refer to the information provided by the app and the official website.
37+
38+
## Q8: How to disable the permission table output in the console after the SDK connects to the server?
39+
40+
A: You can set the environment variable `LONGPORT_PRINT_QUOTE_PACKAGES` to `false`, or set `enable_print_quote_packages` to `false` when creating the `Config` object in the code to disable the permission table output in the console.

packages/docs/en/docs/quote/pull/candlestick.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ Note: This interface can only retrieve the last 1000 candlesticks. To obtain lon
2323

2424
### Parameters
2525

26-
| Name | Type | Required | Description |
27-
| ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------- |
28-
| symbol | string | Yes | Security code, in `ticker.region` format, for example:`700.HK` |
29-
| period | int32 | Yes | Candlestick period, for example: `1000`, see [Period](../objects#period---candlestick-period) |
30-
| count | int32 | Yes | Count of cancdlestick, for example: `100`<br /><br />**Check rules:** <br />maximum count is `1000` |
31-
| adjust_type | int32 | Yes | Adjustment type, for example: `0`, see [AdjustType](../objects#adjusttype---candlestick-adjustment-type) |
26+
| Name | Type | Required | Description |
27+
|---------------|--------|----------|----------------------------------------------------------------------------------------------------------|
28+
| symbol | string | Yes | Security code, in `ticker.region` format, for example:`700.HK` |
29+
| period | int32 | Yes | Candlestick period, for example: `1000`, see [Period](../objects#period---candlestick-period) |
30+
| count | int32 | Yes | Count of cancdlestick, for example: `100`<br /><br />**Check rules:** <br />maximum count is `1000` |
31+
| adjust_type | int32 | Yes | Adjustment type, for example: `0`, see [AdjustType](../objects#adjusttype---candlestick-adjustment-type) |
32+
| trade_session | int32 | No | Trading session, 0: intraday, 100: All (pre, intraday, post, overnight) |
3233

3334
### Protobuf
3435

@@ -38,6 +39,7 @@ message SecurityCandlestickRequest {
3839
Period period = 2;
3940
int32 count = 3;
4041
AdjustType adjust_type = 4;
42+
int32 trade_session = 5;
4143
}
4244
```
4345

@@ -48,30 +50,35 @@ message SecurityCandlestickRequest {
4850
# https://open.longportapp.com/docs/quote/pull/candlestick
4951
# Before running, please visit the "Developers to ensure that the account has the correct quotes authority.
5052
# If you do not have the quotes authority, you can enter "Me - My Quotes - Store" to purchase the authority through the "LongPort" mobile app.
51-
from longport.openapi import QuoteContext, Config, Period, AdjustType
53+
from longport.openapi import QuoteContext, Config, Period, AdjustType, TradeSessions
5254

5355
config = Config.from_env()
5456
ctx = QuoteContext(config)
5557

58+
# Get intraday candlestick data for 700.HK
5659
resp = ctx.candlesticks("700.HK", Period.Day, 10, AdjustType.NoAdjust)
5760
print(resp)
61+
62+
# Get all candlestick data for 700.HK
63+
resp = ctx.candlesticks("700.HK", Period.Day, 10, AdjustType.NoAdjust, trade_session=TradeSessions.All)
5864
```
5965

6066
## Response
6167

6268
### Response Properties
6369

64-
| Name | Type | Description |
65-
| ------------ | -------- | ------------------------------------- |
66-
| symbol | string | Security code, for example: `AAPL.US` |
67-
| candlesticks | object[] | Candlestick data |
68-
| ∟ close | string | Close price |
69-
| ∟ open | string | Open price |
70-
| ∟ low | string | Low price |
71-
| ∟ high | string | High price |
72-
| ∟ volume | int64 | Volume |
73-
| ∟ turnover | string | Turnover |
74-
| ∟ timestamp | int64 | Timestamp |
70+
| Name | Type | Description |
71+
|-----------------|----------|------------------------------------------------------------------------------|
72+
| symbol | string | Security code, for example: `AAPL.US` |
73+
| candlesticks | object[] | Candlestick data |
74+
| ∟ close | string | Close price |
75+
| ∟ open | string | Open price |
76+
| ∟ low | string | Low price |
77+
| ∟ high | string | High price |
78+
| ∟ volume | int64 | Volume |
79+
| ∟ turnover | string | Turnover |
80+
| ∟ timestamp | int64 | Timestamp |
81+
| ∟ trade_session | int32 | Trade session, see [TradeSession](../objects#tradesession---trading-session) |
7582

7683
### Protobuf
7784

@@ -150,7 +157,7 @@ message Candlestick {
150157
## Error Code
151158

152159
| Protocol Error Code | Business Error Code | Description | Troubleshooting Suggestions |
153-
| ------------------- | ------------------- | ------------------------------ | ------------------------------------------------------------------------------ |
160+
|---------------------|---------------------|--------------------------------|--------------------------------------------------------------------------------|
154161
| 3 | 301600 | Invalid request | Invalid request parameters or unpacking request failed |
155162
| 3 | 301606 | Request rate limit | Reduce the frequency of requests |
156163
| 7 | 301602 | Server error | Please try again or contact a technician to resolve the issue |

0 commit comments

Comments
 (0)