准备与配置

安装

npm install @tigeropenapi/tigeropen

配置

createClientConfig(options?: ClientConfigOptions): ClientConfig 要求最终解析出 tigerIdprivateKey。优先级为环境变量 > 代码参数 > properties 文件 > 默认值。默认搜索 ./tiger_openapi_config.properties~/.tigeropen/tiger_openapi_config.properties

字段类型默认值/约束
tigerId, privateKeystring必填;环境变量为 TIGEROPEN_TIGER_IDTIGEROPEN_PRIVATE_KEY
account, secretKeystring交易账户;secretKey 仅机构账户需要
languagestringzh_CN
timeoutnumber15 秒
tokenstringTBHK 等需要 Token 的牌照使用
serverUrl, quoteServerUrlstring可显式固定;否则默认动态解析
enableDynamicDomainbooleantrue
tiger_id=your_tiger_id
private_key=your_rsa_private_key
account=your_account
secret_key=your_institution_secret
license=TBUS

不要把私钥、Token 或 secretKey 提交到版本库。权限开通见快速入门,账户限制见账户类型


Did this page help you?