Skip to content

ianpetrarca/hicetnunc_api_guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

hic et nunc API Guide

Build websites and Node.js scripts with hic et nunc data

hic et nunc is a decentralized NFT marketplace built on the Tezos blockchain. This Github repo is a guide for using Tezos APIs to build rich web experiences with Hic et nunc data.

Code Examples

Big Picture

Every single OBJKT in hic et nunc has its metadata and IPFS link publicly available for download via a Tezos blockchain explorer API. The goal of this guide is to help developers integrate hic et nunc content into their applications and websites. Use these tools to build the future of distributed creative content.

Table of Contents

Roadmap

  1. Release initial Better Call Dev Nodejs examples, Web Metadata Generator and Github Readme
  2. Implement rate-limiting to outgoing messages using Bottleneck library
  3. Add TZKT.IO API and compare against Better Call Dev for performance
  4. Create a Node.js CLI for developers to quickly get OBJKT/tz data
  5. Convert example code snippets into full NPM library i.e: npm install hen-tools

Hic et nunc Resources

Tezos Resources

hic et nunc

here and now

What is Hic Et Nunc?

Hic et nunc is a decentralized NFT marketplace built on the Tezos blockchain. It enables users to create, sell and interact with Tezos NFTs called OBJKTS. Each OBJKT holds a single artwork containing a 3d model, image, video, html snippet, glsl shader, etc. Hic et nunc lets creators limit how many digital versions of their work are in existence.

When a user uploads their content to hic et nunc, the actual file is uploaded to IPFS, a decentralized storage network. The other metadata is stored in the Tezos blockchain.

In order to fully appreciate hic et nunc, a basic knowledge of decentralized systems, cryptocurrency and blockchains is useful, check out the General Information section.

IPFS Link

The Tezos API returns a link to an OBJKTs IPFS file in a hash-format. In order to download the asset you must append the cloudflare IPFS cdn string:

 'https://cloudflare-ipfs.com/ipfs/'

The Tezos API will give you an IPFS Hash that looks like:

 'ipfs://QmNrhZHUaEqxhyLfqoq1mtHSipkWHeT31LNHb1QEbDHgnc'

Combine the Cloudflare CDN base URL with the IPFS hash:

 'https://cloudflare-ipfs.com/ipfs/QmNrhZHUaEqxhyLfqoq1mtHSipkWHeT31LNHb1QEbDHgnc'

Tezos API

In order to get metadata on a Tezos Wallet Address or hic et nunc OBJKT ID, you must interact with a Tezos blockchain explorer API. This guide focuses on the two most popular Tezos Blockchain Explorer APIS:

To get data from the above APIs we must send a REST message to their public API endpoint URLs. This can be done using Node.js and the Axios library.

Here is an example of using Node.js to request an OBJKT's data using Node.js:

Check out more Node.js examples here

async function getTokenInfo(id){
    try {
        const res = await axios.get('https://api.better-call.dev/v1/tokens/mainnet/metadata?token_id=' + id.toString())
        return res.data[0]
    } catch (error) {
        return null
    }
}

getTokenInfo(36899)

Response:

image

Code Examples

View more in depth documentation inside of each example's folder:

General Information

Decentralized System

A decentralized system is one where a single entity does not have full control over the decision making, additions and upgrades of the system. A decentralized system is inherently communal, serving groups of interconnected relevant parties that want to transact with trust. In many cases decentralization is impossible to reach, a best attempt.

Explainer Video on Decentralization

Blockchain

A blockchain is a database that is built specifically to run on a decentralized p2p network and requires a set of 'checks and balances' to read, write and interact with it. Depending on the implementation, a blockchain can be either decentralized or centralized. Decentralization lends itself to certain ideas and for now the most common implementation of a decentralized blockchain is a cryptocurrency.

Cryptocurrency

A cryptocurrency is a digital medium to transact value on network not owned by a single entity or nation-state. Please refer to the Bitcoin White Paper and Dr. Daniel Kim's video on monetary policy, inflation, central banking, encryption, Bitcoin and Monero.

NFT

An NFT stands for 'non-fungible-token' and was originally created as one of many smart contract types to use on the Ethereum network. Unlike a currency, an NFT is a receipt that uses a private key to verify your assocation to certain files, items and events that happen on the blockchain. NFTs are collected in wallets, which act as your digital backpack to collect moments and digital blockchain goods.

Contact

Created by @ianpetrarca - tz1LobSdhfUqYpMojXWHQLJPhFLEzUEd9JAn

About

Add hic et nunc data into your websites and Node.js scripts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published