资金划转
示例上下文
import { createClientConfig, TradeClient } from '@tigeropenapi/tigeropen';
const config = createClientConfig();
const tradeClient = TradeClient.fromConfig(config, config.account, config.secretKey);外汇下单
签名
async placeForexOrder(req: ForexOrderRequest): Promise<ForexOrderResult | undefined>用途
提交 forex order 请求。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | ForexOrderRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.segType | string | undefined | 否 | 无 | — |
req.sourceCurrency | string | 是 | 无 | — |
req.targetCurrency | string | 是 | 无 | — |
req.sourceAmount | number | undefined | 否 | 无 | — |
req.targetAmount | number | undefined | 否 | 无 | — |
req.orderType | string | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<ForexOrderResult | undefined>
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | 订单 ID |
| status | string | 交易状态 |
| sourceCurrency | string | 源币种 |
| targetCurrency | string | 目标币种 |
| sourceAmount | number | 源金额 |
| targetAmount | number | 目标金额 |
| rate | number | 汇率 |
| submitTime | number | 提交时间 |
示例
const result = await tradeClient.placeForexOrder({ sourceCurrency: 'USD', targetCurrency: 'HKD' });
console.log(result);返回示例
{
"id": "string",
"status": "string",
"sourceCurrency": "string",
"targetCurrency": "string",
"sourceAmount": 0,
"targetAmount": 0,
"rate": 0,
"submitTime": 0
}获取可划转资金
签名
async getSegmentFundAvailable(req: SegmentFundRequest): Promise<SegmentFundAvailableItem[]>用途
查询 segment fund available。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | SegmentFundRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.id | string | undefined | 否 | 无 | — |
req.fromSegment | string | undefined | 否 | 无 | — |
req.toSegment | string | undefined | 否 | 无 | — |
req.currency | string | undefined | 否 | 无 | — |
req.amount | number | undefined | 否 | 无 | — |
req.limit | number | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<SegmentFundAvailableItem[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| fromSegment | string | 源分区 |
| currency | string | 币种 |
| amount | number | 成交额 |
示例
const result = await tradeClient.getSegmentFundAvailable({ fromSegment: 'SEC', toSegment: 'FUT', currency: 'USD' });
console.log(result);返回示例
[
{
"fromSegment": "string",
"currency": "string",
"amount": 0
}
]获取划转记录
签名
async getSegmentFundHistory(req: SegmentFundRequest): Promise<SegmentFundHistoryItem[]>用途
查询 segment fund history。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | SegmentFundRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.id | string | undefined | 否 | 无 | — |
req.fromSegment | string | undefined | 否 | 无 | — |
req.toSegment | string | undefined | 否 | 无 | — |
req.currency | string | undefined | 否 | 无 | — |
req.amount | number | undefined | 否 | 无 | — |
req.limit | number | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<SegmentFundHistoryItem[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| id | number | 订单 ID |
| fromSegment | string | 源分区 |
| toSegment | string | 目标分区 |
| currency | string | 币种 |
| amount | number | 成交额 |
| status | string | 交易状态 |
| statusDesc | string | 状态描述 |
| settledAt | number | 结算时间 |
| createdAt | number | 创建时间 |
| updatedAt | number | 更新时间 |
示例
const result = await tradeClient.getSegmentFundHistory({ limit: 10 });
console.log(result);返回示例
[
{
"id": 10234,
"fromSegment": "S1",
"toSegment": "S2",
"currency": "USD",
"amount": 5000.0,
"status": "SUCCESS",
"statusDesc": "转账成功",
"settledAt": 1719216000000,
"createdAt": 1719212400000,
"updatedAt": 1719216000000
}
]划转分部资金
签名
async transferSegmentFund(req: SegmentFundRequest): Promise<SegmentFund | undefined>用途
执行 segment fund。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | SegmentFundRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.id | string | undefined | 否 | 无 | — |
req.fromSegment | string | undefined | 否 | 无 | — |
req.toSegment | string | undefined | 否 | 无 | — |
req.currency | string | undefined | 否 | 无 | — |
req.amount | number | undefined | 否 | 无 | — |
req.limit | number | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<SegmentFund | undefined>
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | number |
| fromSegment | string | 源分区 |
| toSegment | string | 目标分区 |
| currency | string | 币种 |
| amount | number | 成交额 |
| status | string | 交易状态 |
| statusDesc | string | 状态描述 |
| message | string | 消息 |
| settledAt | number | 结算时间 |
| createdAt | number | 创建时间 |
| updatedAt | number | 更新时间 |
示例
const result = await tradeClient.transferSegmentFund({ fromSegment: 'SEC', toSegment: 'FUT', currency: 'USD', amount: 100 });
console.log(result);返回示例
{
"id": "string | number",
"fromSegment": "string",
"toSegment": "string",
"currency": "string",
"amount": 0,
"status": "string",
"statusDesc": "string",
"message": "string",
"settledAt": 0,
"createdAt": 0,
"updatedAt": 0
}取消划转
签名
async cancelSegmentFund(req: SegmentFundRequest): Promise<SegmentFund | undefined>用途
取消 segment fund。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | SegmentFundRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.id | string | undefined | 否 | 无 | — |
req.fromSegment | string | undefined | 否 | 无 | — |
req.toSegment | string | undefined | 否 | 无 | — |
req.currency | string | undefined | 否 | 无 | — |
req.amount | number | undefined | 否 | 无 | — |
req.limit | number | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<SegmentFund | undefined>
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | number |
| fromSegment | string | 源分区 |
| toSegment | string | 目标分区 |
| currency | string | 币种 |
| amount | number | 成交额 |
| status | string | 交易状态 |
| statusDesc | string | 状态描述 |
| message | string | 消息 |
| settledAt | number | 结算时间 |
| createdAt | number | 创建时间 |
| updatedAt | number | 更新时间 |
示例
const result = await tradeClient.cancelSegmentFund({ id: 'TX123' });
console.log(result);返回示例
{
"id": "string | number",
"fromSegment": "string",
"toSegment": "string",
"currency": "string",
"amount": 0,
"status": "string",
"statusDesc": "string",
"message": "string",
"settledAt": 0,
"createdAt": 0,
"updatedAt": 0
}获取资金明细
签名
async getFundDetails(req: FundDetailsRequest): Promise<FundDetails[]>用途
查询 fund details。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FundDetailsRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.segTypes | string[] | undefined | 否 | 无 | — |
req.fundType | string | undefined | 否 | 无 | — |
req.currency | string | undefined | 否 | 无 | — |
req.startDate | number | undefined | 否 | 无 | 毫秒时间戳 |
req.endDate | number | undefined | 否 | 无 | 毫秒时间戳 |
req.limit | number | undefined | 否 | 无 | — |
req.pageToken | string | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FundDetails[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | number |
| account | string | 账户 |
| segType | string | 分区类型 |
| fundType | string | 基金类型 |
| currency | string | 币种 |
| amount | number | 成交额 |
| balance | number | 余额 |
| occurTime | number | 发生时间 |
| remark | string | 备注 |
| externalId | string | 外部 ID |
示例
const result = await tradeClient.getFundDetails({ segTypes: ['SEC'], currency: 'USD', startDate: Date.UTC(2026, 0, 1), endDate: Date.UTC(2026, 0, 31), limit: 100 });
console.log(result);返回示例
[
{
"id": "string | number",
"account": "string",
"segType": "string",
"fundType": "string",
"currency": "string",
"amount": 0,
"balance": 0,
"occurTime": 0,
"remark": "string",
"externalId": "string"
}
]获取资金历史
签名
async getFundingHistory(req: FundingHistoryRequest): Promise<FundingHistoryItem[]>用途
查询 funding history。
参数、默认值与约束
| 参数 | 类型 | 必填 | SDK 默认值 | 约束 |
|---|---|---|---|---|
req | FundingHistoryRequest | 是 | None | — |
req.account | string | undefined | 否 | TradeClient account when empty (client) | — |
req.secretKey | string | undefined | 否 | 无 | Institution account secret key. Overrides the default set in ClientConfig; omit to use the config default. |
req.segType | string | undefined | 否 | 无 | — |
req.currency | string | undefined | 否 | 无 | — |
req.startDate | number | undefined | 否 | 无 | 毫秒时间戳 |
req.endDate | number | undefined | 否 | 无 | 毫秒时间戳 |
req.limit | number | undefined | 否 | 无 | — |
req.lang | string | undefined | 否 | 无 | — |
返回
Promise<FundingHistoryItem[]>
| 字段 | 类型 | 说明 |
|---|---|---|
| id | number | 订单 ID |
| refId | string | 参考 ID |
| type | number | 合约类型 |
| typeDesc | string | 类型描述 |
| currency | string | 币种 |
| amount | number | 成交额 |
| businessDate | string | 业务日期 |
| status | string | 交易状态 |
| statusDesc | string | 状态描述 |
| completedStatus | boolean | 完成状态 |
| createdAt | number | 创建时间 |
| updatedAt | number | 更新时间 |
示例
const result = await tradeClient.getFundingHistory({ segType: 'SEC', currency: 'USD', startDate: Date.UTC(2026, 0, 1), endDate: Date.UTC(2026, 0, 31), limit: 100 });
console.log(result);返回示例
[
{
"id": 20345,
"refId": "FD20250624001",
"type": 1,
"typeDesc": "入金",
"currency": "USD",
"amount": 10000.0,
"businessDate": "2025-06-24",
"status": "COMPLETED",
"statusDesc": "已完成",
"completedStatus": true,
"createdAt": 1719216000000,
"updatedAt": 1719219600000
}
]Updated 9 days ago
Did this page help you?
