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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ryukato79/link-developers-sdk

v1.0.9

Published

developers-sdk for javascript

Downloads

6

Readme

LINE Blockchain Developers SDK for JavaScript

This is a library to help developers to easily use the LINE Blockchain Developers API. As it's written by Typescript, it supports both Typescript and JavaScript.

It's a subproject of LINE Blockchain Developers SDK, see README for an overview of the SDK.

How to use

Installation

Before getting started, you need to install the library to your project. To make installation easy, use package managers as the follows:

npm

npm install @ryukato79/link-developers-sdk

yarn

yarn add @ryukato79/link-developers-sdk

Instead of using package managers, you can clone this repository as well. See download and build for the details.

Key objects and usage

HttpClient

This class represents an HTTP client to connect and interact with the LINE Blockchain Developers API server. It provides functions to call the endpoints of the API with mandatory and optional parameters. It's an entry point for this library, every dApp for LINE Blockchain Developers should have an instance of HttpClient.

Create an instance with your connection and authentication information as follows:

import { HttpClient } from './lib/http-client-base';
const httpClient = new HttpClient(baseUrl, apiKey, apiSecret);
  • baseUrl is the address of API server. Find one for the chain your service runs on in API guide.
  • apiKey is your service's API key.
  • apiSecret is your service's API secret. Never use the secret hard-coded in the source code.

Now, you can call any endpoints via the functions of the instance. A simple example is to get the server time:

(async() => {
  const response = await httpClient.time();
  console.log(response['statusCode']);
})();

Remember that you must handle it in an asynchronous way.

Request and response

When requesting, you can use predefined request data classes in lib/request.ts. Try to send a memo save request for example as follows:

import { MemoRequest } from './lib/request';

(async() => {
  const request = new MemoRequest('my first memo', walletAddress, walletSecret);
  const response = await httpClient.createMemo(request);
})();

When you need to parse a JSON-formatted responseData in a response, find and use the proper response data class in lib/response.ts. To get the txhash or the above request for example:

import { GenericResponse, TxResultResponse } from './lib/response';

(async() => {
  const request = new MemoRequest('my first memo', walletAddress, walletSecret);
  let response: GenericResponse<TxResultResponse> = await httpClient.createMemo(servcieId);
  console.log(response.responseData.txhash);
})();

SignatureGenerator

This class provides a functionality to generate signatures for a request.

All API requests, except for the endpoint to retrieve the server time, must pass authentication information and be signed. Signing is a bit annoying, but never mind, fortunately, HttpClient itself will import this and generate signatures before sending a request.

If you do want to study how LINE Blockchain signature created, it's okay to dive into the source code.

How to contribute

Download and build

If you're interested in contributing to this repository, download the source code and then build it using the following commands.

npm

npm install
npm run build

yarn

yarn
yarn run build

Once a build succeed, you're ready to implement your ideas.

Test

After any modification, you must test the library to check whether to work correctly. We provide scripts for unit tests and integration test.

Unit tests

Run the following command to run all unit tests.

yarn run test

Integration tests

To run integration tests, integration-test.env is required with following properties.

HOST_URL=[api-url]
SERVICE_ID=[your service-id]
SERVICE_API_KEY=[your service-api-key]
SERVICE_API_SECRET=[your service-api-secret]
OWNER_ADDRESS=[your service wallet address]
OWNER_SECRET=[your service wallet secret]
OWNER_ADDRESS2=[your another service wallet address]
SERVICE_TOKEN_CONTRACT_ID=[your service-token contract-id]
ITEM_TOKEN_CONTRACT_ID=[your item-token contract-id]
LINE_USER_ID=[your line user id]
LINE_USER_WALLET_ADDRESS=[BitMax wallet address of the user]

If you have integration-test.env ready, then run an integration test by the following command.

yarn run test:integration