This project includes the following crates:
play-cpp-sdk
: the cpp sdk wrapperdefi-wallet-core-rs
: a dependency of play-cpp-sdkextra-cpp-bindings
: a dependency of play-cpp-sdkwallet-connect
: wallet connect implementationNo security audits of this project have ever been performed yet.
The project is still in development and is alpha quality.
USE AT YOUR OWN RISK!
Please download the archive file based on your OS release: https://github.com/cronos-labs/play-cpp-sdk/releases
play_cpp_sdk_Windows_x86_64.zip
play_cpp_sdk_Darwin_x86_64.tar.gz
play_cpp_sdk_libstdc++_Linux_x86_64.tar.gz
or play_cpp_sdk_libc++_Linux_x86_64.tar.gz
play_cpp_sdk_$(TARGET)-$(NDK_VERSION).tar.gz
play_cpp_sdk_aarch64-apple-ios.tar.gz
Start with a C++ project with .sln
and .vcxproj
files:
git clone https://github.com/cronos-labs/play-cpp-sdk.git
demo
folder, and replace the original sdk
folderdemo.sln
which includes two projects: demo
(dynamic build) and demostatic
(static
build). If you use Visual Studio 2022, retarget project, and upgrade PlatformToolset to
v143.Release
profile.demo
or demostatic
project, click Build
or Rebuild
to build the projectBuild modern, cross-platform C++ apps that don't depend on .sln
or .vcxproj
files:
File
> Open
>
Folder...
in the menu), locate the demo
folder and open itx64-Release
in the tool barBuild
> Build All
or Rebuild All
to build the projectgit clone https://github.com/cronos-labs/play-cpp-sdk.git
demo
folder, and replace the original sdk
folderdemo
folder and build the demo
project with g++, clang++ or default compiler
make CXX=g++ # Compile with g++
make CXX=clang++ # Compile with clang++
make # Compile with default compiler
git clone https://github.com/cronos-labs/play-cpp-sdk.git
demo
folder, and replace the original sdk
folderdemo
folder and build the demo
project with g++, clang++ or default compiler
make CXX=g++ # Compile with g++
make CXX=clang++ # Compile with clang++
make # Compile with default compiler
Unzip the archive file into the root folder of your project, you should see a folder named sdk
and its subdirectories/files.
- sdk
- CMakeLists.txt
- include: c++ source files and header files
- lib: static and dynamic libraries
- CHANGELOG.md
- LICENSE
Include the following headers and use the namespaces in your source codes based on your need
#include "sdk/include/defi-wallet-core-cpp/src/contract.rs.h" // erc20, erc721, erc1155 supports
#include "sdk/include/defi-wallet-core-cpp/src/lib.rs.h" // wallet, EIP4361, query, signing, broadcast etc, on crypto.org and cronos
#include "sdk/include/defi-wallet-core-cpp/src/nft.rs.h" // crypto.org chain nft support
#include "sdk/include/defi-wallet-core-cpp/src/uint.rs.h" // uint256 type support
#include "sdk/include/defi-wallet-core-cpp/src/ethereum.rs.h" // dynamic contract support
#include "sdk/include/extra-cpp-bindings/src/lib.rs.h" // etherscan/cronoscan, crypto.com pay, wallet connect support
#include "sdk/include/rust/cxx.h" // the important data types, e.g., rust::String, rust::str, etc
using namespace rust;
using namespace org::defi_wallet_core;
using namespace com::crypto::game_sdk;
Link the play_cpp_sdk
static or dynamic library, cxxbridge1
static library, and sources
(*.cc) into your build system (Visual Studio solution, CMake or Makefile). For more details,
check out Cronos Play Docs.
If the Pre-built release does not support your platform, you can build the binaries and bindings on your own.
windows_build.bat
in x64 Native Tools Command Prompt for VS 2019. It will clone
necessary submodules, build play-cpp-sdk
crate, finally setup and build the demo project.~/.cargo/git/checkouts
if cxx fails to build, then run windows_build.bat
again.windows_install.bat
, libraries and bindings will be copied into a new created folder:
install
demo.sln
. If you use Visual Studio 2022, retarget project, and upgrade
PlatformToolset to v143
before running windows_build.bat
make
make install
, libraries and bindings will be copied into a new created folder: install
make
make install
, libraries and bindings will be copied into a new created folder: install
NDK_VERSION=23.0.7599858 make armv7-linux-androideabi
NDK_VERSION=23.0.7599858 make aarch64-linux-android
NDK_VERSION=23.0.7599858 make i686-linux-android
NDK_VERSION=23.0.7599858 make x86_64-linux-android
make install
, libraries and bindings will be copied into a new created folder: install
make aarch64-apple-ios
make install
, libraries and bindings will be copied into a new created folder: install
If you are a game developer, please visit Cronos Play or fill this Contact Form for more information.