The SDK provides builds for different environments:
- Node.js
- Web Worker (Browser)
web-worker/
folder contains a webpack based build to run in a browser environment. It can be built with yarn build:worker
.
src/
folder contains shared and node-js code.
lib/
folder contains the NTRU and pedersen builds.
@tixl/tixl-sdk-js/redux
@tixl/tixl-sdk-js/web-worker
@tixl/tixl-sdk-js/node-js
Include the SDK in your TypeScript project as usual: npm install @tixl/tixl-types @tixl/tixl-sdk-js
Setup an env variable for the gateway. Only the test gateway can currently be used: REACT_APP_GATEWAY=https://gateway.tixl.dev
All crypto-related functions are platform dependent and need a suiting implementation. The interface for our crypto
requirements are defined in the tixl-types repository.
We created a basic node.js implementation that you can use. Have a look at the src/node-js/crypto
module for a factory-function. Many of the workflow functions have crypto as a required parameter.
The web-worker implementation exists for browser environments.
Everything you can do to interact with the Tixl network is located in the workfows folder (src/workflows
). The first thing you would probably want to generate is a keyset and the account chain.
Most of the workflows generate BlockTx or BlockchainTx objects, that hold the Transactions that must be sent to the gateway.
From there it is exploring the workflows and lower-level API functions. All functions are written in TypeScript and self-explaining.
If you want to use redux, we created redux-modules, reducers and actions to help with that.
yarn build
creates a dist/
folder which contains the package to publish to a registry. The package has its own package.json, that is copied over at build time.
To publish a new version, cd
into dist
and run yarn publish from there.