All pages
Powered by GitBook
1 of 8

LikeCoin NFT

NFT can be an email, an image, an identity, or a book. LikeCoin NFT is designed especially for text-based content creation. This section of the doc describe the technical details on the LikeNFT module. It targets DApp developer to develop decenteralize publishing on top on LikeCoin chain.

Loading...

Metadata best practice

NFT class and instance metadata reference

No metadata standard is explicitly enforced for LikeCoin NFT. Users and dapp developers can take reference of the OpenSea standard: https://docs.opensea.io/docs/metadata-standards

NFT Meta Collection for classes

In some use cases, multiple NFT classes might belong to a larger collection. i.e. classes are created and organized to form a collection, We would call these meta collections, please define these metadata fields in the related NFT classes.

Key
Description

nft_meta_collection_id

An ID representing a meta collection , no uniqueness is enforced on chain

nft_meta_collection_name

Human readable name for the meta collection

nft_meta_collection_descrption

Human readable description meta collection

Note that these field are merely used as a standardize and convenient way to tag classes. Chain logic does not enforce any uniqueness and validity check for these fields, so it is up to the users and develop to verify if any class tagged with a same nft_meta_collection_id actually belongs to any creator or collections.

Sample

Please refer to Writing NFT Spec

Writing NFT Spec

Based on Metadata best practice

Background

The Writing NFT introduced by Liker Land is designed especially for a single piece of article or post. The idea is similar to the traditional book publishing flow as an analogy, but the solution, however, tackles some specific issues for a single piece of writing.

Read more about Writing NFT here

NFT Class metadata

Each writing NFT class represent a creative work registered on an ISCN. To allow easier search and collection of all Writing NFTs created by a same creator, nft_meta_collection fields would be used. A dynamic API is used as uri to provide dynamic metadata according to mint purchase status.

key
value
description

name

Writing NFT - {ISCN name}

Name of ISCN prefix with Writing NFT

symbol

WRITING

WRITING is used as symbol

uri

https://api.like.co/likernft/metadata?iscn_id={iscn_id}

Dynamic API from api.like.co, query by ISCN ID

metadata

metadata.nft_meta_collection_id

likerland_writing_nft

ID of the Writing NFT meta collection

metadata.nft_meta_collection_name

Writing NFT

Name of Writing NFT meta collection

metadata.nft_meta_collection_descrption

Writing NFT by Liker Land

Description of Writing NFT

NFT Instance metadata

In Writing NFT, every instance of NFT in a same class should be homogeneous. A randomized ID is used to prevent user from distinguishing the minting order. A dynamic API is also used as image to provide dynamic image according to mint purchase status.

key
value
description

id

writing-{uuid}

Randomized uuid v4 prefixed with writing

uri

https://api.like.co/likernft/metadata?class_id={class_id}&nft_id={id}

Dynamic API from api.like.co, query by class id and nft id

metadata

metadata.name

Writing NFT - {ISCN name}

ID of the Writing NFT meta collection

metadata.image

https://api.like.co/likernft//image/class_${classId}.png

Name of Writing NFT meta collection

Registering via api.like.co

To allow the display of Writing NFT on LikeCoin button/NFT widget and related api.like.co APIs, users should call the like.co NFT API to register their NFT after minting.

Please view api.like.co documentation for details

NFT Book Spec

Based on Metadata best practice

Background

The NFT Book introduced by Liker Land is designed for publishing ebooks as NFT on LikeCoin chain. Unlike Writing NFT which can be used for content of any length, NFT Book are intended for more traditional ebook, with proper cover and editing.

ISCN metadata

key
value
description

contentMetadata

contentMetadata.url

{URL for "View content"}

The main URL that prepresent the NFT Book. This URL would be used for "View content" button in LikerLand

contentMetadata.type

Book

Book is used as type

contentMetadata.sameAs

["https://url/book.epub", "https://url/book.pdf"]

Array of other URL representations of the NFT Book. If the URL ends with .epub or .pdf a special button for viewing would appear in Liker Land

NFT Class metadata

Each writing NFT class represent a creative work registered on an ISCN. To allow easier search and collection of all Writing NFTs created by a same creator, nft_meta_collection fields would be used. A dynamic API is used as uri to provide dynamic metadata according to mint purchase status.

key
value
description

name

{name of book}

Name of the book

symbol

BOOK

BOOK is used as symbol

uri

content hash or URL

If a JSON URL is provided, its content is fetched and used as metadata (merge)

metadata

metadata.nft_meta_collection_id

nft_book

ID of the NFT Book meta collection

metadata.nft_meta_collection_name

NFT Book

Name of NFT Book meta collection

metadata.nft_meta_collection_descrption

NFT Book

Description of Writing NFT

Registering via command line

A command line tool and sample is provided for easy minting of NFTs

Please view the repository for details

NFT Portal

Mint Writing NFT via friendly web UI in app.like.co

https://app.like.co/nft/

NFT Portal Reference

NFT Portal technical reference

URL Portal

Allows inputting https URL or ISCN ID to prepare minting of Writing NFT

Base URL

Input Params

Query String
Description

url

(optional) Prefill target URL

iscn_id

(optional) Prefill target ISCN ID

liker_id

(optional) Enforce Liker ID checking on user, an error would be prompted if target Liker ID is not used

Other query strings are passed below to the ISCN page.

ISCN Page

Mints an ISCN into Writing NFT

Base URL

Input Params

nft_prefix

(optional) Override NFT name prefix, default is Writing NFT

class_id

(optional) Existing NFT Class ID to resume minting process from

redirect_uri

(optional) Act as a whitelist host for postMessage, actual redirect is not implemented, please use with opener below

opener

(optional) default false. If set, would fire a postMessage back to window.opener with redirect_uri host as target, then close current window

PostMessage Event Format

window.opener.postMessage(JSON.stringify({
  action: 'NFT_MINT_DATA',
  data: {
    iscnId,
    classId,
    nftCount,
    sellerWallet,
  },
}), this.redirectOrigin)

API Reference

Base URL

Production: https://mainnet-node.like.co

Testnet: https://node.testnet.like.co

LCD API

Balance

queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721

/cosmos/nft/v1beta1/balance/{owner}/{class_id}

Owner

queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 /cosmos/nft/v1beta1/owner/{class_id}/{id}

Supply

queries the number of NFTs from the given class, same as totalSupply of ERC721. /cosmos/nft/v1beta1/supply/{class_id}

NFTs

queries all NFTs of a given class or owner, choose at least one of the two, similar to tokenByIndex in ERC721Enumerable

/cosmos/nft/v1beta1/nfts

NFT

queries an NFT based on its class and id.

/cosmos/nft/v1beta1/nfts/{class_id}/{id}

Class

queries an NFT class based on its id

/cosmos/nft/v1beta1/classes/{class_id}

Classes

queries all NFT classes

/cosmos/nft/v1beta1/classes

Indexer API

Pagination params:

Param
Example
Description

key

Key of the last item of previous response for pagination, should not be used with offset

limit

The size limit of response. Default & max: 100

reverse

Sorting order

offset

Offset of response, should not be used with key

Class API

/likechain/likenft/v1/class

Param
Example
Description

iscn_id_prefix

ISCN prefix of NFT class (if minted via ISCN)

account

Account of NFT class (if minted via account)

iscn_owner

Query classes owned via ISCN by an address

expand

expand NFT info

NFT API

/likechain/likenft/v1/nft

Param
Example
Description

owner

Owner address

expand_classes

Expand class information

Owner API

/likechain/likenft/v1/owner

Param
Example
Description

class_id

NFT Class ID

Event API

/likechain/likenft/v1/event

Param
Example
Description

class_id

NFT Class ID

nft_id

NFT ID

iscn_id_prefix

ISCN ID Prefix (if minted via ISCN)

verbose

Expand events

action_type

/cosmos.nft.v1beta1.MsgSend

Filter event by action

sender

Get all events sent by an address

receiver

Get all events received by an address

creator

Get all events of NFT Classes created (ISCN owner) by an address

involver

Get all events involving an address (sender OR receiver OR creator)

ignore_from_list

Ignore events sent from address

ignore_to_list

Ignore events sent to address

Ranking API

/likechain/likenft/v1/ranking

Request Params

Param
Example
Description

creator

like13f4glvg80zvfrrs7utft5p68pct4mcq7t5atf6

The current owner of the ISCN

collector

like1vymrc5dxlfwff30m03prwlu08ql4vudn4lue8u

The current owner of NFT

type

CreativeWork

The contentMetadata.@type field in ISCN

stakeholder_id

did:like:1w6es6du93xmhms60gwwtczr2p2h4cdm8r7kc0f

The stakeholders.entity.@id field in ISCN

stakeholder_name

kin

The stakeholders.entity.name field in ISCN

created_after

1659283200

Get NFT class created after this UNIX second timestamp

created_before

1659801600

Get NFT class created before this UNIX second timestamp

sold_after

1659283200

Rank NFT class base on sales after this UNIX second timestamp

sold_before

1659801600

Rank NFT class base on sales before this UNIX second timestamp

include_owner

true

Whether to include owner of ISCN when counting sold_count

ignore_list

like17m4vwrnhjmd20uu7tst7nv0kap6ee7js69jfrs

The addresses to ignore when counting sold count

order_by

total_sold_value/sold_count

Result is order by the number of NFTs not owned by creator nor ignore_list

Example Response

/likechain/likenft/v1/ranking?ignore_list=like17m4vwrnhjmd20uu7tst7nv0kap6ee7js69jfrs&limit=1

{
  "classes": [
    {
      "id": "likenft1yhsps5l8tmeuy9y7k0rjpx97cl67cjkjnzkycecw5xrvjjp6c5yqz0ttmc",
      "name": "Writing NFT - 分散式出版 DePub 的發展路徑,NFT 從移民到原住民",
      "description": "...",
      "symbol": "WRITING",
      "uri": "https://api.like.co/likernft/metadata?iscn_id=iscn%3A%2F%2Flikecoin-chain%2FIKI9PueuJiOsYvhN6z9jPJIm3UGMh17BQ3tEwEzslQo%2F3",
      "uri_hash": "",
      "config": {
        "burnable": false,
        "max_supply": "0",
        "blind_box_config": null
      },
      "metadata": {
        "url": "https://ckxpress.com/nft-immigrant-to-native/",
        "name": "分散式出版 DePub 的發展路徑,NFT 從移民到原住民",
        "@type": "Article",
        "image": "ar://_GJD1gNuIqXicYNWce__4B8Qqg5tN8FBRSUCXR8kuJE",
        "version": 1,
        "@context": "http://schema.org/",
        "keywords": "DePub,LikeCoin,nft,Numbers",
        "usageInfo": "",
        "description": "...",
        "nft_meta_collection_id": "likerland_writing_nft",
        "nft_meta_collection_name": "Writing NFT",
        "nft_meta_collection_description": "Writing NFT by Liker Land"
      },
      "parent": {
        "type": "ISCN",
        "iscn_id_prefix": "iscn://likecoin-chain/IKI9PueuJiOsYvhN6z9jPJIm3UGMh17BQ3tEwEzslQo",
        "account": ""
      },
      "price": 0,
      "created_at": "2022-08-01T06:33:21Z",
      "sold_count": 171
    }
  ],
  "pagination": {
    "count": 1
  }
}

Note: Currently only like.co API can report the latest price. price in the response is always 0. Please refer to like.co API documentation for price information


Social Graph API

Get Collectors

/likechain/likenft/v1/collector

Param
Example
Description

creator

like13f4glvg80zvfrrs7utft5p68pct4mcq7t5atf6

Required. Account address of ISCN owner

ignore_list

The addresses to ignore

include_owner

Whether to include owner of ISCN

price_by

class/nft

order_by

price/count

Get Creators

/likechain/likenft/v1/creator

Param
Example
Description

collector

like13f4glvg80zvfrrs7utft5p68pct4mcq7t5atf6

Required. Account address of NFT owner

ignore_list

The addresses to ignore

include_owner

Whether to include owner of ISCN

price_by

class/nft

order_by

price/count

Result is order by count of NFT collections.

Example Response

/likechain/likenft/v1/collector?creator=like13f4glvg80zvfrrs7utft5p68pct4mcq7t5atf6

{
  "collectors": [
    {
      "account": "like17m4vwrnhjmd20uu7tst7nv0kap6ee7js69jfrs",             // The like.co NFT sales API wallet
      "count": 2928,
      "collections": [
        {
          "iscn_id_prefix": "iscn://likecoin-chain/IKI9PueuJiOsYvhN6z9jPJIm3UGMh17BQ3tEwEzslQo",
          "class_id": "likenft1yhsps5l8tmeuy9y7k0rjpx97cl67cjkjnzkycecw5xrvjjp6c5yqz0ttmc",
          "count": 443
        },
        {
          "iscn_id_prefix": "iscn://likecoin-chain/IKI9PueuJiOsYvhN6z9jPJIm3UGMh17BQ3tEwEzslQo",
          "class_id": "likenft1yzdfkf4fjjekqjmxen0czy5eyufapfrx5y3nd6d7wd6hmyy6zt3sk7ak4z",
          "count": 500
        },
        {
          "iscn_id_prefix": "iscn://likecoin-chain/OImbeoC6JTlEJrjVOJXAj4rF5uS04vuRGbittFGyQbc",
          "class_id": "likenft1h9efvdvj5m275w8sr2u0jsme2xlmpfexjp802ckda3fvuncw95tsnq2c7u",
          "count": 492
        },
        {
          "iscn_id_prefix": "iscn://likecoin-chain/Tz4l66fBAgEMk5IyEJ4_N0FBj2NjLCse3Uqnm8VxR-8",
          "class_id": "likenft1g0652jc6fns73r5ru6pwp6djp99975em576px88wxau7hrmn2d5qf06zs4",
          "count": 500
        },
        {
          "iscn_id_prefix": "iscn://likecoin-chain/Tz4l66fBAgEMk5IyEJ4_N0FBj2NjLCse3Uqnm8VxR-8",
          "class_id": "likenft1yhxut65wavj2jykq07xtm66dnmn75dm5y0tgq8f49azs3lff7ngqrw7kv6",
          "count": 500
        },
        {
          "iscn_id_prefix": "iscn://likecoin-chain/Tz4l66fBAgEMk5IyEJ4_N0FBj2NjLCse3Uqnm8VxR-8",
          "class_id": "likenft1ztyc5usfn36r2uuza86waa7xn9j7r8xjzagtpcesj3p2t7mmj9kssqlxwe",
          "count": 493
        }
      ]
    },
    {
      "account": "like126qel5qhcxnxy2nd0s43pjp2aqujnp60jeg27l",
      "count": 3,
      "collections": [
        {
          "iscn_id_prefix": "iscn://likecoin-chain/IKI9PueuJiOsYvhN6z9jPJIm3UGMh17BQ3tEwEzslQo",
          "class_id": "likenft1yhsps5l8tmeuy9y7k0rjpx97cl67cjkjnzkycecw5xrvjjp6c5yqz0ttmc",
          "count": 1
        },
        {
          "iscn_id_prefix": "iscn://likecoin-chain/OImbeoC6JTlEJrjVOJXAj4rF5uS04vuRGbittFGyQbc",
          "class_id": "likenft1h9efvdvj5m275w8sr2u0jsme2xlmpfexjp802ckda3fvuncw95tsnq2c7u",
          "count": 1
        },
        {
          "iscn_id_prefix": "iscn://likecoin-chain/Tz4l66fBAgEMk5IyEJ4_N0FBj2NjLCse3Uqnm8VxR-8",
          "class_id": "likenft1ztyc5usfn36r2uuza86waa7xn9j7r8xjzagtpcesj3p2t7mmj9kssqlxwe",
          "count": 1
        }
      ]
    },
    {
      "account": "like18q3dzavq7c6njw92344rf8ejpyqxqwzvhz9th5",
      "count": 3,
      "collections": [
        {
          "iscn_id_prefix": "iscn://likecoin-chain/IKI9PueuJiOsYvhN6z9jPJIm3UGMh17BQ3tEwEzslQo",
          "class_id": "likenft1yhsps5l8tmeuy9y7k0rjpx97cl67cjkjnzkycecw5xrvjjp6c5yqz0ttmc",
          "count": 3
        }
      ]
    }
  ],
  "pagination": {
    "count": 3
  }
}

Example UI

https://likecoin.github.io/likecoin-nft-dashboard/

\