Token Contract

This page introduces how to get FT and NFT contract information with Token History API.

Before Getting Started

  • API introduced in here should only be used with HTTP Request.

  • The x-chain-id value for calling the API is 8217 (Cypress) or 1001 (Baobab).

  • Essential parameters for calling APIs are described in individual examples.

Values that a user needs to enter for calling APIs will be represented with one pair of braces ({}). A user must enter the following values.

Item

Description

Note

chain-id

8217 or 1001

Cypress(Klaytn mainnet) or Baobab(Klaytn testnet

access-key-id

Auth ID

accessKeyId obtained from KAS Console - Security - Credential

secret-access-key

Auth Password

secretAccessKey obtained from KAS Console - Security - Credential

krn

(optional) ID of Account Pool

Unnecessary when using Default Account Pool

A KAS API Authentication Key (API Auth Key) provides access to all KAS services and all the rights to a Klaytn account which was created by calling Wallet API via this API Auth Key. The rights here include accessing and transferring all the assets (KLAY, etc.) of or sending a transaction from a Klaytn account. If you shared your API Auth Key with any unauthorized personnel, your Klaytn account could be compromised and might cause unwanted transaction execution.

DO NOT share your API Auth Key (Secret AccessKey or Authorization) with any unauthorized personnel. DO PUT efforts necessary to keep your API Auth Key safe for the security of your KAS/Klaytn account.

Get List of FT Contract

Search the list of labeled FT contracts.

FT contract is a type of smart contract deployed to Klaytn that allows users to issue, delete, and send Fungible Token (Fungible Token, FT).

Label is a marker put on a specific token contract by KAS for tracking its information. KAS only tracks labeled token contracts. This API requests for the list of labeled FT contracts. For details about labeling, please visit here.

Query Parameter

You can search for the list of FT contracts by specifying the labeling status and contract type. Also, you can receive API response values with Cursor-based Pagination.

Parameter

Description

Example

Required or Not

status

Labeling status ["completed", "processing", "failed", "cancelled"]

status=completed

False

type

Type of contract (KIP standard: "kip", ERC standard: "erc", else: "")

type=kip

False

size

the number of items in the API response (min=1, max=1000, default=100)

size=100

False

cursor

the cursor required to get the next batch of response items

cursor=J9Ag...VM6z

False

API Request

Search for the list of labeled FT contracts as follows.

curl --location --request GET "https://th-api.klaytnapi.com/v2/contract/ft?status=completed&type=kip&size=100&cursor=J9Ag...VM6z" \
    --header "x-chain-id: {chain-id}" \
    -u {access-key-id}:{secret-access-key}

API Response

The list of FT contracts will be received as a response as follows if the request is successful.

{
    "items": [
        {
            "address": "0x275f942985503d8ce9558f8377cc526a3aba3566",
            "decimals": 18,
            "link": {
                "icon": "",
                "website": ""
            },
            "name": "ProjectWITH",
            "symbol": "WIKEN",
            "totalSupply": "0x36afb02a36d33e82de40000",
            "status": "completed",
            "type": "erc",
            "createdAt": 1593355639,
            "updatedAt": 1593355639,
            "deletedAt": 0
        },
        {
            "address": "0x46f307b58bf05ff089ba23799fae0e518557f87c",
            "decimals": 18,
            "link": {
                "icon": "",
                "website": ""
            },
            "name": "Airbloc",
            "symbol": "ABL",
            "totalSupply": "0x134b7e13729b9d839f00000",
            "status": "completed",
            "type": "erc",
            "createdAt": 1593355615,
            "updatedAt": 1593355615,
            "deletedAt": 0
        },
        ...,
        {
            "address": "0xb1a7abe0c5a9e06cc7585a435e74976d2dee07f3",
            "decimals": 2,
            "link": {
                "icon": "",
                "website": ""
            },
            "name": "BlockchainPetToken",
            "symbol": "BPT",
            "totalSupply": "0x30141cb58",
            "status": "completed",
            "type": "kip",
            "createdAt": 1593353416,
            "updatedAt": 1593353416,
            "deletedAt": 0
        }
    ],
    "cursor": ""
}

For details about this API, please visit here. For inquires about this document or KAS, please visit KAS Developer forum.

Get FT Contract Information

Search for specific FT contract information.

FT contract is a type of smart contract deployed to Klaytn that allows users to issue, delete, and send Fungible Token (Fungible Token, FT).

API Request

The following request searches for the information of an FT contract in the “0xbe7377db700664331beb28023cfbd46de079efac” address.

curl --location --request GET "https://th-api.klaytnapi.com/v2/contract/ft/0xbe7377db700664331beb28023cfbd46de079efac" \
    --header "x-chain-id: {chain-id}" \
    -u {access-key-id}:{secret-access-key}
  • The ft-address (0xbe7377db700664331beb2...) is a required value that stands for the address of an FT contract to be searched.

API Response

The following response will be received if the request was successful.

{
    "address": "0xbe7377db700664331beb28023cfbd46de079efac",
    "decimals": 18,
    "link": {
        "icon": "",
        "website": ""
    },
    "name": "Att",
    "symbol": "att",
    "totalSupply": "0x2863c1f5cdae42f9540000000",
    "status": "completed",
    "type": "erc",
    "createdAt": 1593355554,
    "updatedAt": 1593355554,
    "deletedAt": 0
}

For details about this API, please visit here. For inquires about this document or KAS, please visit KAS Developer forum.

Get List of NFT Contract

Search the list of labeled NFT contracts.

NFT contract is a type of smart contract deployed to Klaytn that allows users to issue, delete, and send Non-fungible Token (Non-Fungible Token, NFT).

Label is a marker put on a specific token contract by KAS for tracking its information. KAS only tracks labeled token contracts. This API requests for the list of labeled FT contracts. For details about labeling, please visit here.

Query Parameter

You can search for the list of FT contracts by specifying the labeling status and contract type. Also, you can receive API response values with Cursor-based Pagination.

Parameter

Description

Example

Required or Not

status

Labeling Status ["completed", "processing", "failed", "cancelled"]

status=completed

False

type

Type of contract (KIP standard: "kip", ERC standard: "erc", else: "")

type=kip

False

size

the number of items in the API response (min=1, max=1000, default=100)

size=100

False

cursor

the cursor required to get the next batch of response items

cursor=J9Ag...VM6z

False

API Request

Search the list of labeled NFT contracts as follows.

curl --location --request GET "https://th-api.klaytnapi.com/v2/contract/nft?status=completed&type=kip&size=100&cursor=J9Ag...VM6z" \
    --header "x-chain-id: {chain-id}" \
    -u {access-key-id}:{secret-access-key}

API Response

The list of NFT contracts will be received as a response as follows if the request is successful.

{
    "items": [
        {
            "address": "0xc60e442725d3fe651cfab999e045409f94db9416",
            "name": "MineralNFT",
            "symbol": "FSI",
            "totalSupply": "0x0",
            "status": "completed",
            "type": "kip",
            "createdAt": 1598650844,
            "updatedAt": 1598650844,
            "deletedAt": 0
        },
        ...,
        {
            "address": "0x1f49e1d2a4691e4514ae91bc3040767cf344ad82",
            "name": "Klaytn Champ",
            "symbol": "CHAMP",
            "totalSupply": "0x49",
            "status": "completed",
            "type": "kip",
            "createdAt": 1593353198,
            "updatedAt": 1593353198,
            "deletedAt": 0
        }
    ],
    "cursor": "MBX6wNrK2QdWJp0xqG1XJp8zWxPwqVGLO0bYaAorYo3DgvpM0xVk5BwL9Zl1emRNqyJdObWzAQq46PaNGE287rXKgZQdM2K4Dmke7E93B56NlvLg9zbDZeVv7o1POlAa"
}

For details about this API, please visit here. For inquires about this document or KAS, please visit KAS Developer forum.

Get NFT Contract Information

Search for specific NFT contract information.

NFT contract is a type of smart contract deployed to Klaytn that allows users to issue, delete, and send Non-fungible Token (Non-Fungible Token, NFT).

API Request

The following request searches for the information of the NFT contract in the “0x90d535c434e967ec6e9accb0de5dcb34010865e0” address

curl --location --request GET "https://th-api.klaytnapi.com/v2/contract/nft/0x90d535c434e967ec6e9accb0de5dcb34010865e0" \
    --header "x-chain-id: {chain-id}" \
    -u {access-key-id}:{secret-access-key}
  • nft-address (0x90d535c434e967ec6e9acc...) is a required input value that stands for an address of the NFT contract to be searched.

API Response

The following response will be received if the request was successful.

{
    "address": "0x90d535c434e967ec6e9accb0de5dcb34010865e0",
    "name": "GET TICKET NFT V01",
    "symbol": "GETticket NFT",
    "totalSupply": "0x7",
    "status": "completed",
    "type": "kip",
    "createdAt": 1597743588,
    "updatedAt": 1597743588,
    "deletedAt": 0
}

For details about this API, please visit here. For inquires about this document or KAS, please visit KAS Developer forum.

Last updated