Cord.Js Overview
Cord.Js provides a collection of classes and methods to interact with the CORD network.
This section should provide you with all the information needed to install the @cord.network/sdk package, understand the structure of the interfaces and allow you to start using it.
We are basing all our examples on the demo-scripts.
What this is not
This is not line-by-line documentation of all the existing function calls available. (the examples do refer to the CORD Chain). There will be some things in the SDK that are probably not covered, which brings us to the next point…
Help us help others
If you spot gaps in the information provided, or are uncertain about any specific area, please do log an issue or if you are that way inclined, make a pull-request. We really want to have good documentation in these areas and allow people to be productive right from the start.
Installation
Yes, it really is as simple as installing from npm, so we are not going to waste too much time with the bare basics, just install the SDK via
npm
npm install @cord.network/sdk
yarn
yarn add @cord.network/sdk
pnpm
pnpm add @cord.network/sdk
And it will be added and ready for use. The above will always install the latest stable release, which should allow you to connect to test networks and local nodes that are tracking versioned releases for CORD.Js and CORD Blockchain.
Other dependencies
In most cases, you don’t need to do anything else apart from just installing @cord.network/sdk
above. It has dependencies such as @cord.network/type-definitions
which are installed automatically alongside. When using yarn
the dependencies are installed, flattened, available for use and you will never run into issues with mismatched versions.
This means that by simply installing @cord.network/sdk
,
you will have access to utilities (crypto and normal), types, providers
and even higher-order (derived) SDK functions. (We will get to all of
these in follow-up sections)
If you do however decide to explicitly install other packages (even though they are dependencies), please make sure that the versions inside the api package always match with your versions.