Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cursor Rules for LongPort OpenAPI Documentation Project
# Cursor Rules for Longbridge OpenAPI Documentation Project

You are assisting with the development of the LongPort OpenAPI documentation website, which uses the following tech stack:
You are assisting with the development of the Longbridge OpenAPI documentation website, which uses the following tech stack:

## Tech Stack
- VitePress 2.0.0-alpha.5 (Vue-based static site generator)
Expand Down Expand Up @@ -46,4 +46,4 @@ You are assisting with the development of the LongPort OpenAPI documentation web
4. Introduce unnecessary dependencies
5. Use features not supported by VitePress

This project is a documentation website for LongPort's API services, so maintain a professional, clear, and technical writing style while ensuring content is well-organized and accessible to developers.
This project is a documentation website for Longbridge's API services, so maintain a professional, clear, and technical writing style while ensuring content is well-organized and accessible to developers.
6 changes: 3 additions & 3 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:

- name: Upload to Aliyun OSS
run: |
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/canary/open.longportapp.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --exclude "*.html" --exclude "*.md" --meta=Cache-Control:max-age=31536000
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/canary/open.longportapp.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.md" --meta "Cache-Control:no-cache#Content-type:text/markdown;charset=utf-8"
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/canary/open.longportapp.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.html" --meta "Cache-Control:no-cache#Content-type:text/html;charset=utf-8"
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/canary/open.longbridge.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --exclude "*.html" --exclude "*.md" --meta=Cache-Control:max-age=31536000
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/canary/open.longbridge.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.md" --meta "Cache-Control:no-cache#Content-type:text/markdown;charset=utf-8"
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/canary/open.longbridge.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.html" --meta "Cache-Control:no-cache#Content-type:text/html;charset=utf-8"
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- main
- release
- feat/lb

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -40,7 +41,7 @@ jobs:

- name: Upload to Aliyun OSS
run: |
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist/ oss://lb-assets/github/release/open.longportapp.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --exclude "*.html" --exclude "*.md" --exclude "*.txt" --meta=Cache-Control:max-age=31536000
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/release/open.longportapp.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.md" --meta "Cache-Control:no-cache#Content-type:text/markdown;charset=utf-8"
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/release/open.longportapp.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.txt" --meta "Cache-Control:no-cache#Content-type:text/plain;charset=utf-8"
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist/ oss://lb-assets/github/release/open.longportapp.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.html" --meta "Cache-Control:no-cache#Content-type:text/html;charset=utf-8"
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist/ oss://lb-assets/github/release/open.longbridge.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --exclude "*.html" --exclude "*.md" --exclude "*.txt" --meta=Cache-Control:max-age=31536000
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/release/open.longbridge.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.md" --meta "Cache-Control:no-cache#Content-type:text/markdown;charset=utf-8"
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist oss://lb-assets/github/release/open.longbridge.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.txt" --meta "Cache-Control:no-cache#Content-type:text/plain;charset=utf-8"
${{github.workspace}}/ossutil cp ./docs/.vitepress/dist/ oss://lb-assets/github/release/open.longbridge.com/new-docs/raw/ -u -r -j 10 -e oss-cn-hangzhou.aliyuncs.com -i ${{ secrets.FE_LB_ASSET_ACCESS_KEY_ID }} -k ${{ secrets.FE_LB_ASSET_ACCESS_KEY_SECRET }} --include "*.html" --meta "Cache-Control:no-cache#Content-type:text/html;charset=utf-8"
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Editing documentation

Thank you for your interest in the LongPort OpenAPI documentation! We appreciate your feedback, edits, and additions to our content. This page covers the basic steps for editing our documentation.
Thank you for your interest in the Longbridge OpenAPI documentation! We appreciate your feedback, edits, and additions to our content. This page covers the basic steps for editing our documentation.

## Editing documents in GitHub

We've tried to make editing an existing, public file as simple as possible.

### To edit a documentation

1. Browse to the [LongPort OpenAPI Docs](https://open.longportapp.com/docs) article that you want to update.
1. Browse to the [Longbridge OpenAPI Docs](https://open.longbridge.com/docs) article that you want to update.

1. Then click the **Edit this page** or **Edit page** link.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LongPort OpenAPI Documentation
Longbridge OpenAPI Documentation

https://open.longportapp.com
https://open.longbridge.com

## CONTRIBUTING

Expand Down
28 changes: 21 additions & 7 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const insertScript = (html: string) => {

export default defineConfig(
withMermaid({
title: 'LongPort OpenAPI',
title: 'Longbridge OpenAPI',
appearance: true,
lastUpdated: true,
cleanUrls: true,
Expand All @@ -34,29 +34,43 @@ export default defineConfig(
transformHtml(code) {
return insertScript(code)
},
transformHead(context) {
const { page } = context
let localePathname = page.replace(/\.md$/, '')
if (localePathname.includes('index')) {
localePathname = localePathname.replace('index', '')
}
const pathname = localePathname.replace('zh-CN/', '').replace('zh-HK/', '')
return [
['link', { rel: 'canonical', href: `https://open.longbridge.com/${localePathname}` }],
['link', { rel: 'alternate', hreflang: 'en', href: `https://open.longbridge.com/${pathname}` }],
['link', { rel: 'alternate', hreflang: 'zh-Hans', href: `https://open.longbridge.com/zh-CN/${pathname}` }],
['link', { rel: 'alternate', hreflang: 'zh-Hant', href: `https://open.longbridge.com/zh-HK/${pathname}` }],
]
},

sitemap: {
hostname: 'https://open.longportapp.com',
hostname: 'https://open.longbridge.com',
transformItems(items) {
return items.filter((item) => !item.url.includes('migration'))
},
},

/* prettier-ignore */
head: [
['link', { rel: 'shortcut icon', type: 'image/x-icon', href: 'https://assets.lbkrs.com/uploads/770073a2-c505-4d41-99f4-93cb75abe257/longport_favicon.png' }],
['link', { rel: 'shortcut icon', type: 'image/x-icon', href: 'https://pub.lbkrs.com/files/202107/35tULHe3n4Pp4EtA/logo.png' }],
['meta', { name: 'theme-color', content: '#5f67ee' }],
['meta', { name: 'twitter:card', content: 'summary' }],
['meta', { name: 'twitter:site', content: 'https://open.longportapp.com' }],
['meta', { name: 'twitter:site', content: 'https://open.longbridge.com' }],
['meta', { name: 'robots', content: 'index,follow' }],
['meta', { name: 'googlebot', content: 'index,follow' }],
['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-JNRX7GS04Y' }],
['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-P81Y8BDYYS' }],
['script', {}, `window.dataLayer = window.dataLayer||[];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-JNRX7GS04Y');`],
gtag('config', 'G-P81Y8BDYYS');`],
['script', { defer: '', src: 'https://assets.lbkrs.com/pkg/sensorsdata/1.21.13.min.js' }],
['script', { async: '', src: 'https://at.alicdn.com/t/c/font_2621450_y740y72ffjq.js' }],
],
Expand All @@ -67,7 +81,7 @@ export default defineConfig(
},
},
logo: {
src: 'https://pub.pbkrs.com/files/202211/TNosrY77nCxm6rtU/logo-without-title.svg',
src: 'https://assets.lbkrs.com/uploads/f029efba-486b-4c32-8b05-1a87b0fb61f8/logo-without-title-lb.svg',
width: 48,
height: 48,
},
Expand Down
24 changes: 12 additions & 12 deletions docs/.vitepress/locales/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@ import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress'
import { nav } from './nav'
import { search } from './search'
import { sidebar } from './sidebar'
import { logoLink } from '../../theme/utils/link'
export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
head: [
['meta', { property: 'og:url', content: 'https://open.longportapp.com' }],
['meta', { property: 'og:url', content: 'https://open.longbridge.com' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: 'LongPort OpenAPI: Flexible Support for Programmatic Trading' }],
['meta', { property: 'og:title', content: 'Longbridge OpenAPI: Flexible Support for Programmatic Trading' }],
[
'meta',
{
property: 'og:description',
content:
'Access LongPort OpenAPI for diversified and flexible support tailored to your programmatic trading needs. Enhance your trading strategies with ease.',
'Access Longbridge OpenAPI for diversified and flexible support tailored to your programmatic trading needs. Enhance your trading strategies with ease.',
},
],
[
'meta',
{ property: 'og:image', content: 'https://pub.pbkrs.com/files/202211/sJswdGqSX1xDqrES/lonport-seo-img.png' },
{
property: 'og:image',
content: 'https://assets.lbkrs.com/uploads/48641e8e-a157-4b0f-a58e-bd3998d10d54/group427321346.webp',
},
],
['meta', { property: 'og:locale', content: 'en' }],
['meta', { property: 'og:site_name', content: 'OpenAPI | LongPort' }],
['link', { rel: 'canonical', href: 'https://open.longportapp.com/' }],
['meta', { property: 'og:site_name', content: 'OpenAPI | Longbridge' }],
],
title: 'LongPort OpenAPI',
title: 'Longbridge OpenAPI',
description:
'Access LongPort OpenAPI for diversified and flexible support tailored to your programmatic trading needs. Enhance your trading strategies with ease.',
'Access Longbridge OpenAPI for diversified and flexible support tailored to your programmatic trading needs. Enhance your trading strategies with ease.',
themeConfig: {
logoLink: {
link: '/',
target: '_self',
},
logoLink: logoLink(),
nav: nav(),
sidebar: sidebar,
search: {
Expand Down
24 changes: 12 additions & 12 deletions docs/.vitepress/locales/zh-CN/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@ import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress'
import { nav } from './nav'
import { search } from './search'
import { sidebar } from './sidebar'
import { logoLink } from '../../theme/utils/link'
export const zhCNConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
head: [
['meta', { property: 'og:url', content: 'https://open.longportapp.com' }],
['meta', { property: 'og:url', content: 'https://open.longbridge.com' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: 'LongPort OpenAPI:灵活支持程序化交易' }],
['meta', { property: 'og:title', content: 'Longbridge OpenAPI:灵活支持程序化交易' }],
[
'meta',
{
property: 'og:description',
content: 'LongPort OpenAPI 为您提供灵活多样的接入服务,满足您的量化交易需求,快速构建您的交易策略。',
content: 'Longbridge OpenAPI 为您提供灵活多样的接入服务,满足您的量化交易需求,快速构建您的交易策略。',
},
],
[
'meta',
{ property: 'og:image', content: 'https://pub.pbkrs.com/files/202211/sJswdGqSX1xDqrES/lonport-seo-img.png' },
{
property: 'og:image',
content: 'https://assets.lbkrs.com/uploads/48641e8e-a157-4b0f-a58e-bd3998d10d54/group427321346.webp',
},
],
['meta', { property: 'og:locale', content: 'zh-CN' }],
['meta', { property: 'og:site_name', content: 'OpenAPI | LongPort 开放平台' }],
['link', { rel: 'canonical', href: 'https://open.longportapp.com/zh-CN/' }],
['meta', { property: 'og:site_name', content: 'OpenAPI | Longbridge 开放平台' }],
],
title: 'LongPort API 文档',
description: 'LongPort OpenAPI 为您提供灵活多样的接入服务,满足您的量化交易需求,快速构建您的交易策略。',
title: 'Longbridge API 文档',
description: 'Longbridge OpenAPI 为您提供灵活多样的接入服务,满足您的量化交易需求,快速构建您的交易策略。',
themeConfig: {
logoLink: {
link: '/zh-CN',
target: '_self',
},
logoLink: logoLink(),
nav: nav('zh-CN'),
sidebar: sidebar,
search: {
Expand Down
24 changes: 12 additions & 12 deletions docs/.vitepress/locales/zh-HK/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress'
import { nav } from './nav'
import { search } from './search'
import { sidebar } from './sidebar'
import { logoLink } from '../../theme/utils/link'
export const zhHKConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
head: [
['meta', { property: 'og:url', content: 'https://open.longportapp.com' }],
['meta', { property: 'og:url', content: 'https://open.longbridge.com' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: 'LongPort OpenAPI:靈活支持程序化交易' }],
['meta', { property: 'og:title', content: 'Longbridge OpenAPI:靈活支持程序化交易' }],
[
'meta',
{
property: 'og:description',
content: 'LongPort OpenAPI 為您提供靈活多樣的接入服務,滿足您的量化交易需求,快速構建您的交易策略。',
content: 'Longbridge OpenAPI 為您提供靈活多樣的接入服務,滿足您的量化交易需求,快速構建您的交易策略。',
},
],
[
'meta',
{ property: 'og:image', content: 'https://pub.pbkrs.com/files/202211/sJswdGqSX1xDqrES/lonport-seo-img.png' },
{
property: 'og:image',
content: 'https://assets.lbkrs.com/uploads/48641e8e-a157-4b0f-a58e-bd3998d10d54/group427321346.webp',
},
],
['meta', { property: 'og:locale', content: 'zh-HK' }],
['meta', { property: 'og:site_name', content: 'OpenAPI | LongPort 開放平臺' }],
['link', { rel: 'canonical', href: 'https://open.longportapp.com/zh-HK/' }],
['meta', { property: 'og:site_name', content: 'OpenAPI | Longbridge 開放平臺' }],
],
title: 'LongPort API 文檔',
description: 'LongPort OpenAPI 為您提供靈活多樣的接入服務,滿足您的量化交易需求,快速構建您的交易策略。',
title: 'Longbridge API 文檔',
description: 'Longbridge OpenAPI 為您提供靈活多樣的接入服務,滿足您的量化交易需求,快速構建您的交易策略。',

themeConfig: {
logoLink: {
link: '/zh-HK',
target: '_self',
},
logoLink: logoLink(),
nav: nav('zh-HK'),
sidebar: sidebar,
search: {
Expand Down
8 changes: 8 additions & 0 deletions docs/.vitepress/theme/utils/link.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { isServer } from './i18n'

export const logoLink = () => {
return {
link: `https://longbridge.${!isServer() && location.host.includes('cn') ? 'cn' : 'com'}`,
target: '_self',
}
}
6 changes: 3 additions & 3 deletions docs/en/docs/api-reference/how-to-access-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ slug: /how-to-access-api
sidebar_position: 1
---

This section mainly introduces the basic information of LongPort OpenAPI, including how to access the API, how to use the API, how to obtain the API interface document, etc., the content is relatively primitive.
This section mainly introduces the basic information of Longbridge OpenAPI, including how to access the API, how to use the API, how to obtain the API interface document, etc., the content is relatively primitive.

:::success Tip
It is recommended to directly use the SDK to access the API, the SDK has encapsulated the API call method, which is more convenient to use.

https://open.longportapp.com/sdk
https://open.longbridge.com/sdk
:::

## Notes
Expand Down Expand Up @@ -72,7 +72,7 @@ Refer to [Introduction to OpenAPI](../docs#how-to-enable) to enable the correspo

### 2. Get App Key and Access Token information

Get **Access Token**, **App Key** and **App Secret** on the [Developer Website](https://open.longportapp.com/account).
Get **Access Token**, **App Key** and **App Secret** on the [Developer Website](https://open.longbridge.com/account).

**Access Token** will expires in three months. Token can be reset in Developer Website after expiration. Also token can be refresh through invoking [Refresh Token](./refresh-token-api) API before token expired.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/api-reference/socket/diff-ws-tcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ slug: /socket/diff_ws_tcp
sidebar_position: 6
---

LongPort support `WebSocket` and `TCP` feed, the differences:
Longbridge support `WebSocket` and `TCP` feed, the differences:

- Data of `TCP` is streaming, so coding client is hard than `WebSocket`.
- `WebSocket` using URL Query to [Handshake](./protocol/handshake#websocket-how-to-handshake)
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/api-reference/socket/hosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ slug: /socket/hosts
sidebar_position: 5
---

LongPort split Market Quote and Trading real-time pushing endpoints.
Longbridge split Market Quote and Trading real-time pushing endpoints.

## Market Quote

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 1
:::success NOTE
Our OpenAPI SDK has fully implemented the function of subscribing to quotes, and you can use the SDK directly.

https://open.longportapp.com/sdk
https://open.longbridge.com/sdk

The documentation in this chapter provides API details for your reference.
:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We use binary format data for communication, protocol support both `WebSocket` a
Endianness is `BigEndian`
:::

If your are familiar with `Python` or `C++`, we provider [SDK](https://open.longportapp.com/en/sdk) for you.
If your are familiar with `Python` or `C++`, we provider [SDK](https://open.longbridge.com/en/sdk) for you.

If you want parse protocol by self, you can check our [Go Implemetation](https://github.com/longportapp/openapi-protocol/tree/main/go).

Expand Down
Loading