Preparation

Environment Requirements

  • Supported OS:
    • Windows
    • MacOS
    • Linux
    • Solaris
  • C++ 11

Install C++

Mac

There are several options for configuring a C++ development environment on MacOS:

  • Install Xcode: Xcode is a development environment designed for macOS that includes a C++ compiler. You can install Xcode from the App Store. Once installed, you can use command-line tools to compile and run C++ programs.
  • Install a standalone C++ compiler: There are a number of C++ compilers available for the Mac, including GCC and Clang, which you can download and install from the Internet.
  • Use a package manager: Package managers like Homebrew or MacPorts make it easy to install open source software, including C++ compilers.

Using Homebrew as an example:

brew install gcc

Linux

There are several options for configuring a C++ development environment on Linux:

  • Install GCC: GCC is a popular C++ compiler that is installed in most Linux distributions. You can check if GCC is installed by using the following command:
g++ --version

If it is not installed, you can use the following command to install it:

sudo apt-get install build-essential  # use in Debian/Ubuntu 
  • Install Clang: Clang is another popular C++ compiler that can replace GCC. Youcan install Clang using the following command:
sudo apt-get install clang # use in Debian/Ubuntu

Windows

There are several options for configuring a C++ development environment on Windows:

  • Install Visual Studio: Visual Studio is a development environment designed by Microsoft for Windows that includes a C++ compiler. You can download and install Visual Studio from the Microsoft website.
  • Install MinGW: MinGW is an open source C++ compiler for Windows. You can download and install it from the MinGW website.
  • Install Cygwin: Cygwin is a Unix-like environment for Windows that includes a C++ compiler. You can download and install it from the Cygwin website
  • Use WSL2 (Windows Subsystem for Linux)

Install TradeUP OpenAPI C++ SDK

Linux/Mac

Install Boost

Source Code Installation

  1. Download the source code to any path: https://www.boost.org/users/history/version_1_81_0.md
    Using /usr/local/ as an example:
cd /usr/local/
wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2/
  1. Decompression:
tar --bzip2 -xf boost_1_81_0.tar.bz2
  1. Compile:
cd /usr/local/boost_1_81_0
./bootstrap.sh
./b2 headers
./b2
  1. Compile and install cpprestsdk:
cd /tmp  # select the directory where you want to store the source code
git clone https://github.com/microsoft/cpprestsdk.git
cd cpprestsdk
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
make -j 8
make install

Description

CppRestSDK Reference Documents

The cpprestsdk installed directly through package management software may not be the latest version. It may also have unknown issues.

Compile and install SDK

Source Code: openapi-cpp-sdk

If you are using a compiled sdk, this step can be skipped
Preparation: Adjust the path to CMakeLists.txt according to your system environment

  1. cd YOUR SOURCE DIRECTORY
  2. Create build directory
mkdir build
cd build
  1. Build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
make -j 6
make install
  1. Install SDK
    Put the header file in the header file path, eg. /usr/local/include.
    Put the header file in the lib path, eg. /usr/local/lib/

Windows

Dependencies: Visual StudioC++ Development Environment https://visualstudio.microsoft.com/
Download and install Visual Studio Installer, make sure to check the box, "Desktop development using C++".

Compile API SDK

Upon compiling the OpenAPI SDK, you may add the outputted .dll or .lib file to your own project in order to directly call SDK functions in your code.

Install IDE

We recommend using CLion or Visual Studio.

Additional Configurations (Optional)

TitleDescription
IP WhitelistOnly IP addresses in the white list can access TradeUP API, use “;” to divide multiple IPs
Callback URLCustomized callback URL of users's program, used to receive messages for updates on order and account status, user can also use the callback function provided in the SDK to receive callback messages

Developer Registration Information

In order to access OpenAPI, you will need to open and fund your TradeUP account, and then apply for OpenAPI permissions. See detailed instructions for Individual Investors and Institutional Investors.

RSA Keys

OpenAPI uses RSA encryption for authentication. The RSA bidirectional signature authentication mechanism is used to prevent interface requests from being maliciously tampered with. Users must save their private keys locally.

❗️

Please​ store your private key in a local and secure place to prevent unauthorized exposure or loss of personal information.

Your private key will not be stored on TradeUP’s server and will disappear automatically when the page is refreshed. If you fail to save your private key, it may be replaced by clicking the ​​re-generate​ button.​

⚠️

Attention:

The Python SDK private key format is different from that used by the Java SDK. The Python private key uses PKCS#1. Please ensure your private key is in the correct format.




Did this page help you?