The T-REX SDK

The T-REX SDK is a JavaScript/ECMA6 library that provides developers with a way to manipulate and explore the blockchain and ensures the standards defined by T-REX.

Installation

The T-REX SDK is available via GitHub packages.

First, you need to authenticate with the GitHub registry. To do this, you will need to run the following command.

npm login --registry=https://npm.pkg.github.com --scope=@tokenyico

Important Note To be able to download the package, you need to be have read access to the repository of the TREX SDK.

Additional info here https://help.github.com/en/articles/configuring-npm-for-use-with-github-package-registry#authenticating-to-github-package-registry

It will prompt you for the GitHub username and password which is, in fact, an personal access token.

The password is an access token which you must create here https://github.com/settings/tokens it requires the permissions write:packages and read:packages

After having authenticated with GitHub, you can install the library.

npm install @tokenyico/trex-sdk
Or if you would prefer to use yarn
npm add @tokenyico/trex-sdk

You can then import the library into your project using require()

const TREX = require('@tokenyico/trex-sdk');

Or as an ES6 import:

import TREX from "@tokenyico/trex-sdk";

Info

The SDK comes with type definitions if you wish to use TypeScript in your project