clang-formatif you are unsure.
upstreamto your local repo and delete
docsfolder contains documentation.
srcfolder contains the C++ implementation of the core functionality.
includefolder contains the public C header files used to expose a cross-platform interface.
codegenfolder contains the code and templates used to generate code for different platforms and languages.
jnifolder contains the generated JNI interface and Java classes.
androidfolder contains the Android Studio project and integration tests.
swiftfolder contains the generated Swift code and Xcode project.
testsfolder contains unit tests.
toolsfolder contains scripts to automate common tasks.
samplesfolder contains sample applications.
make -C build tests && build/tests/tests teststo run all the C++ unit tests. To run integration tests on each platform run the respective script in the tools folder:
androidfolder to Android Studio
swiftfolder and open
include/TrustWalletCodefolder and start with the
TWprefix followed by the class or sturct name. Inside each header file there needs to be exactly one class or struct defition.
TW_EXPORT_CLASSmacro followed by a forward-declared struct. For example:
TW_EXPORT_STRUCTmacro followed by an inline-declared struct. For example:
TW_EXPORT_PROPERTYrespectively. Each method or property name needs to start with the type name. For instance
TWPublicKeyIsValidgets translated to the
isValidproperty in the
TWString, and any defined classses, structs or enums.
registry.json, the generated code will be located at
src/Generated/Coins.cpp. See the documentation of the fields here: https://github.com/trustwallet/wallet-core/blob/master/docs/registry-fields.md.
src/protofolder. These models can then be used in the C interface by using the proto model name with underscores. For instance
tools/generate-filesscript when you modify the
clang-formatto ensure a consistent code sytle. Do not reformat files that you didn't modify, or the header files in the
includefolder. You can install a clang-format extension for your IDE.