The JavaScript SDK for interacting with Hedera Hashgraph: the official distributed consensus platform built using the hashgraph consensus algorithm for fast, fair and secure transactions. Hedera enables and empowers developers to build an entirely new class of decentralized applications.
NOTE: v1 of the SDK is deprecated and support will be discontinued after October 2021. Please install the latest version 2.x or migrate from v1 to the latest 2.x version. You can reference the migration documentation.
# with NPM
$ npm install --save @hashgraph/sdk
# with Yarn
$ yarn add @hashgraph/sdk
# with PNPM
$ pnpm add @hashgraph/sdk
The Hedera JavaScript SDK supports the following:
- React Native with Expo on Android devices and Android emulators
The Hedera JavaScript SDK does not currently support the following:
- React Native Bare
See examples.
The Exodus fork publishes as @exodus/hashgraph-sdk to npm. There is no CI release pipeline — it's a manual npm publish from the repo root.
The prepare script (compile + tsc) currently can't run end-to-end because of pre-existing type errors, so publishing requires --ignore-scripts and the lib/ must be compiled manually first.
- Bump
versioninpackage.json(e.g.2.6.0-exodus.17→2.6.0-exodus.18). - Compile
lib/from a clean state (so stale outputs from renamed/deletedsrc/files don't ship):rm -rf lib && yarn compile:js - (Optional) Inspect what will ship vs the currently-published artifact:
npm pack --ignore-scripts --pack-destination=/tmp npm pack @exodus/hashgraph-sdk@<previous-version> --pack-destination=/tmp # extract both and diff - Commit using the bare version as the message (matches existing history):
git commit -am "2.6.0-exodus.18" - Publish:
npm publish --ignore-scripts --tag latest--tag latestis required for prerelease versions (the-exodus.Nsuffix). Add--otp=<code>if your account has 2FA. - Tag and push:
git tag 2.6.0-exodus.18 git push --follow-tags
You need read-write access on the @exodus/hashgraph-sdk package: npm access list collaborators @exodus/hashgraph-sdk.
We welcome participation from all developers! For instructions on how to contribute to this repo, please review the Contributing Guide.
Licensed under Apache License, Version 2.0 – see LICENSE in this repo or apache.org/licenses/LICENSE-2.0.