npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ontology-ts-sdk

v2.0.3

Published

Comprehensive TypeScript library for the Ontology blockchain.

Downloads

3,061

Readme

Overview

This is the official Ontology TypeScript SDK - a comprehensive library for developing with the Ontology blockchain in both TypeScript and JavaScript. It currently supports management of wallets, digital identities and digital assets - as well as the deployment and invocation of smart contracts.

Getting Started

Installation

Download Through npm/Yarn

npm install 'ontology-ts-sdk' --save

or

yarn add 'ontology-ts-sdk'

Build from Source Code

Downloading

git clone 'https://github.com/ontio/ontology-ts-sdk.git'

Then install the dependencies with:

yarn

Compiling

Compile the project with the:

yarn build:dev // or yarn build:prod

This will create a compiled version of the SDK in the lib directory.

Testing

The tests can be found in the test directory. They are distinguished into three categories stored in separate subfolders:

  • unit: unit tests that can be run without external or network dependencies
  • integration: integration tests that require access to one or more Blockchain nodes and test the actual interaction with the Blockchain
  • example: pure sample code without test assertations that can be used for explorative testing or documentation purposes

To run the tests, use one of:

# unit tests
npm run test:unit
# integration tests
npm run test:integration
# examples
npm run test:example
# all
npm run test

or

yarn run test:unit
# integration tests
yarn run test:integration
# examples
yarn run test:example
# all
yarn test

The integration tests use several accounts on the testnet that require funding of ONG tokens in order to pay for the transactions. If there are any test failures with error messages like "insufficient funds" or similar, make sure the following accounts are properly funded:

  • APT4wZG9sFQfjhyfGALPXQj5UyrQ3ZCVkY
  • ANH5bHrrt111XwNEnuPZj6u95Dd6u7G4D6
  • AXK2KtCfcJnSMyRzSwTuwTKgNrtx5aXfFX
  • AVXf5w8WD2y6jV1Lzi36oSKYNif1C7Surc
  • AdLUBSSHUuFaak9j169hiamXUmPuCTnaRz
  • AJkkLbouowk6teTaxz1F2DYKfJh24PVk3r
  • ATk57i8rMXFSBpHAdX3UQ4TNe48BBrfCoc
  • AU9TioM24rXk5E3tUGrv8jwgBA1aZVVKDW
  • AHTdWzj4jYBzbU48YBCfovvouTMc45M6iP
  • AJym8dF7wZLjtoiY8C3mmYt8f2tZDxq5iz

Use in Project

Import

Using import to include the modules from 'ontology-ts-sdk':

import {Wallet} from 'ontology-ts-sdk';
var wallet = Wallet.create('test');

Require

Using require to include the modules from 'ontology-ts-sdk':

var Ont = require('ontology-ts-sdk');
var wallet = Ont.Wallet.create('test');

In the Browser

To use in the browser you must use the compiled version (as listed above). The browser.js file is located in the lib directory. Include it into the project with a <script> tag:

<script src="./lib/browser.js"></script>

Everything will be available under the Ont variable, just like in the require example above.

var wallet = Ont.Wallet.create('test');

Contributing

Contributors are welcome to the ontology-ts-sdk. Before beginning, please take a look at our contributing guidelines. You can open an issue by clicking here.

If you have any issues getting setup, open an issue or reach out in the Ontology Discord.

License

The Ontology TypeScript SDK is availabl under the LGPL-3.0 License.