Klaytn API Service (KAS)

Klaytn API Service (KAS) is the service that enables you to use Klaytn blockchain platform via API (Application Programming Interface). It offers more accessible, simpler, and faster development of blockchain applications on Klaytn.

Klaytn API Service

In general, a blockchain application is used to send transactions to a blockchain platform. An enterprise environment has to prepare and operate expensive and high-performance nodes, as well as create several accounts and individually manage private-public key pairs, to send transactions to Klaytn or Ethereum.

However, KAS runs operations for sending transactions with REST (REpresentational State Transfer) API or SDK (Software Development Kit) without installing and operating nodes or managing the account keys. Blockchain accounts can also be grouped and organized by use, and data can easily be anchored to the main chain with APIs if a service chain is operated.

The inquiry function provides information on tokens that were issued with token contracts (KIP-7, KIP-17, ERC-20, and ERC-721) and transaction history to check if these tokens were sent to other accounts. KAS presents its users with the following advantages:

1. Reduced blockchain node operation and management costs

2. Improved development agility and convenience

  • Sending all transaction types in Klaytn through API calls
  • Supporting KLAY, KIP-7, KIP-17, ERC-20, and ERC-721 tokens
  • Providing various methods for reading token contract information and token transaction records

3. Safe Klaytn account key management

  • Secured structure of private keys for Klaytn accounts
  • Easy development of unique Klaytn wallet
  • Support for multisig keys

4. Easy data anchoring

  • Anchoring service chain data to Klaytn's main chain, Cypress, through simple settings and API calls
  • Improving the integrity of service chain data with data anchoring
  • Applicable to other private chains

Benefits of Klaytn API Service

API

Klaytn Node API

Klaytn Node API enables you to connect to Klaytn node directly and to call Klaytn JSON-RPC API.

info

KAS currently supports only part of Klaytn JSON-RPC API. Please visit here for the JSON-RPC API list that KAS supports.

You can perform the following tasks with Klaytn Node API:

  • Look up or configure Klaytn accounts, blocks, transactions, filters, and network information
  • Configure the Klaytn node

For more details on using Klaytn Node API, please refer to this Tutorial. For inquires about this document or KAS in general, please visit KAS Developers Forum.

Wallet API

Wallet API provides features to manage Klaytn accounts and to send various types of transactions to Klaytn. You can perform the following tasks using Wallet API:

  • Manage Klaytn accounts
  • Update AccountKey of the Klaytn account
  • Send transactions

For more details on using Wallet API, please refer to this Tutorial. For inquires about this document or KAS in general, please visit KAS Developers Forum.

Token History API

Token History API provides features to search the information and transaction histories of KLAY, KIP-7, KIP-17, ERC-20, and ERC-721 tokens. You can perform the following tasks using Token History API:

  • View tokens owned by a specific Klaytn account
  • View the transaction history of KLAY
  • View the transaction history of fungible tokens
  • View the transaction history of non-fungible tokens

For more details on using Token History API, please refer to this Tutorial. For inquires about this document or KAS in general, please visit KAS Developers Forum.

Anchor API

Anchor API provides features to anchor service chain or private chain data onto the Klaytn main chain.

For more details on using Anchor API, please refer to this Tutorial. For inquires about this document or KAS in general, please visit KAS Developers Forum.

KIP-17 API

KIP-17 API provides various features related to contracts and tokens of the KIP-17 standard, which is Klaytn's standard for non-fungible tokens (NFTs). You can perform the following tasks using KIP-17 API:

  • Deploy/query/pause/resume contracts
  • Mint/transfer/burn/query tokens
  • Grant/cancel authorization for token transfers
  • View ownership change

For more details on using KIP-17 API, please refer to this Tutorial. For inquires about this document or KAS in general, please visit KAS Developers Forum.

KIP-7 API

KIP-7 API provides various features related to contracts and tokens of the KIP-7 standard, which is Klaytn's standard for fungible tokens. You can perform the following tasks using KIP-7 API:

  • Deploy/query/pause/resume contracts
  • Mint/transfer/burn/query tokens
  • Grant/cancel authorization for token transfers

For more details on using KIP-7 API, please refer to this Tutorial. For inquires about this document or KAS in general, please visit KAS Developers Forum.

KIP-37 API

KIP-37 API provides various features related to contracts and tokens of the KIP-7 standard, which is Klaytn's standard for fungible tokens. You can perform the following tasks using KIP-37 API:

  • Deploy/query/pause/resume contracts
  • Mint/transfer/burn/query tokens
  • Query token list

For more details on using KIP-37 API, please refer to this Tutorial. For inquires about this document or KAS in general, please visit KAS Developers Forum.

KAS Console

KAS Console is a web application for using and managing KAS APIs. With this, different operations, such as creating API authentication keys for calling KAS APIs as described below, setting API call privileges, and storing and managing Klaytn accounts for APIs, can be performed.

For inquires about this document or KAS, please visit KAS Developers Forum.

KAS SDK

KAS SDK (Software Development Kit) is a development tool provided to easily use KAS in various development environments. KAS SDK is an extension library of Caver and supports JavaScript and Java environment like Caver. If you develop BApp with KAS SDK, you can use both KAS function and existing Caver function through a single library.

KAS SDK(caver-js extension) and KAS SDK(caver-java extension) are the extended libraries ofcaver-js and caver-java respectively. You can use the existing caver-js/caver-java features, as well as the Node API, TokenHistory API, Wallet API, Anchor API, KIP-17 API, KIP-7 API and KIP-37 API of KAS.

KAS SDK Prerequisites

KAS SDK (caver-js extension)

To use KAS SDK (caver-js extension) you need the following packages.

KAS SDK (caver-js extension) works in the Node.js version below.

KAS SDK (caver-java extension)

To use KAS SDK (caver-java extension) you need Java 8 or higher version to be pre-installed. For inquires about this document or KAS, please visit KAS Developers Forum.

How to install KAS SDK

KAS SDK (caver-js extension)

KAS SDK (caver-js extension) can be installed using the command below.

Copy
Copied
npm install caver-js-ext-kas

If you want to install a specific version of KAS SDK (caver-js extension), use the command below.

Copy
Copied
npm install caver-js-ext-kas@X.X.X

KAS SDK (caver-java extension)

KAS SDK (caver-java extension) requires Java 8 or higher, and can be installed by the following environment.

maven

In maven project, you can installed KAS SDK(caver-java extension) by writing as follow.

Copy
Copied
 <repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>xyz.groundx.caver</groupId>
        <artifactId>caver-java-ext-kas</artifactId>
        <version>X.X.X</version>
    </dependency>
</dependencies>

In maven project, you can installed Anroid KAS SDK(caver-java extension) by writing as follow.

Copy
Copied
 <repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>xyz.groundx.caver</groupId>
        <artifactId>caver-java-ext-kas</artifactId>
        <version>X.X.X-android</version>
    </dependency>
</dependencies>

gradle

Copy
Copied
implementation 'xyz.groundx.caver:caver-java-ext-kas:X.X.X

In gradle project, you can installed Android KAS SDK(caver-java extension) by writing as follow.

Copy
Copied
implementation 'xyz.groundx.caver:caver-java-ext-kas:X.X.X-android

You can find the latest KAS SDK (caver-java extension) in Release Page.

For more information about caver-js, refer to here. For more information about caver-java, refer to here. For inquires about this document or KAS, please visit KAS Developers Forum.