Search…
Getting Started
Holograph Protocol is currently in testnet beta. We'll be deploying to multiple EVM mainnets in Q4 2022.
Our documentation is a work in progress. If you're a developer looking to leverage Holograph Protocol, please reach out to us here.
Holograph has developed a set of simple API for omnichain interactions within our ecosystem of smart contracts. Our Libraries and SDKs will also provide a handful of non-web3 API interactions that will speed up specific features. As a developer, you will be able to choose if you want to make direct web3 calls or HTTP calls to our protocol. We recommend usage of direct Web3 calls for a majority of actions, but as a developer, you will be able to choose how to interact.
The high-level interactions are outlined as follows:
  • Getting an Admin API key with your Ethereum Wallet
  • Installing our NPM Package + Configure
  • Creating a Collection
  • Creating an NFT
  • Reading Data
  • Bridging an NFT

Getting an Admin API key with your Ethereum Wallet

In development; not currently available.
To get an Admin API Key, log in here and create an account. Under your profile page (located in the top right dropdown), select Admin Tools. Under Admin Keys, enter the name of the key and click Generate Admin Key. Metamask will open and ask you to sign a unique payload. We only use this signature to validate ownership of the address. Upon success, the new key name is created and shown. Please keep this key secret because it will have read and write access to collection and NFT drafts. This key will be used as part of the registration in any Holograph Library or SDK moving forward.

Install our NPM Package + Configure

In development; not currently available.
To interact with our API, the Admin Key is required for all off-chain calls. It is not required for web3 actions. Once the library is registered, you are ready to start Holographing NFTs. We require Node 16 and higher.
  1. 1.
    npm installl holograph-node
  2. 2.
    const HLL = new Holograph({ adminAPIKey: '<admin API key>' })

Configuration

We provide a default configuration that handles the full support of our API with the best results.
  1. 1.
    adminAPIKey -- Required
  2. 2.
    networks -- Array of supported networks ['rinkeby', 'mumbai', 'fuji'] (*additional networks coming soon*)
  3. 3.
    primaryNetwork -- If no network is provided to a call, this network will be used
  4. 4.
    prioritizeWeb3 -- Boolean - if set to True, the library will make fewer API calls
The default configuration is:
{
"adminAPIKey": "",
"networks": ["rinkeby", "mumbai", "fuji"],
"primaryNetwork": "",
"prioritizeWeb3": false
}

Creating a Collection

Holograph Protocol works by creating drafts of collections that are stored in our DB. Once a draft is created, it can then be deployed to the desired network or primaryNetwork if the parameter is not provided. If a provider object is given, then we will use the network of the provider over any other value. The network key in Collection.deploy() is required if we are submitting the tx for you on the blockchain.
const collection = HLL.collection.generate({ name, symbol, royaltiesPercent })
const result = await collection.deploy({ provider, wallet, network })
/*
{
"id": "<id>",
"contractAddress": "<address>",
"name" : "<name>",
"symbol": "<symbol>",
"royaltiesPercent": "<royaltiesPercent>",
"chainId": <chainId>, // Primary chain the colleciton was deployed on
"chainIds": "<chainIds[]>,
"owner": "<address>",
"tx": "<tx>",
"status": "<DRAFT | MINTED | BRIDGING>"
}
*/

Creating an NFT

Once a collection has been created, we can add draft NFTs to it. To create a draft, an NFT image must be uploaded to our servers. We take care of replicating the data to IPFS for you. After an IPFS object has been saved, you can provide the other NFT details and submit that as a draft. Once you are ready to mint the NFT, simply call the mint function. No tokenId value is required because of the API.
const ipfsData = HLL.images.generate({ collectionId, nftId, file: '<bytes>' })
const nft = HLL.nft.generate({ collectionId, creatorName, name, description, ipfs: ipfsData })
const result = nft.mint({ provider, wallet, network })
/*
{
"id": "<id>",
"collectionId": "<collectionId>",
"name": "<name>",
"description": "<description>",
"creatorName": "<creatorName>",
"chainId": "<chainId>", // Can only live on ONE chain at a time
"owner": "<address>",
"tx": "<tx>",
"status": "<DRAFT | MINTED | BRIDGING>",
"images": {
"ipfs": {
"https": "<https url>",
"proxy": "<proxy url>",
}
}
}
*/

Reading Data

To read data about a given NFT or collection, you must provide the ID for easy read access. For direct web3 calls, you can provide the collection address and token to get data.
// Get data easily
const collection = await HLL.collection.get({ id })
const nft = await HLL.nft.get({ id, tokenId })
// Get data from web3 (slow + lower resolution)
const collection = await HLL.collection.get({ address })
const nft = await HLL.nft.get({ collectionAddress, tokenId })
/* Collection (lower resolution)
{
"address": "<address>",
"name": "<name>",
"symbol": "<symbol>",
"royaltiesPercent": "<royaltiesPercent>",
"chainIds": "<chainId[]>",
}
*/
/* NFT (lower resolution)
{
"contractAddress": "<address>",
"name": "<name>",
"description": "<description>",
"chainId": "<chainId>",
"image": "<imgURL>"
}
*/

Bridging an NFT

Before an NFT can be bridged, it must exist on the destination blockchain. After that, you can call Bridge NFT and it will beam to the new chain.
const collection = await HLL.collection.get({ address })
const bridgeCollectionPayload = await HLL.bridge.collection({ collection, isPreview: true })
const result = await HLL.bridge.collection.send({ provider, wallet, payload: bridgeCollectionPayload })
const nft = await HLL.nft.get({ contractAddress, tokenId })
const bridgeNFTPayload = await HLL.bridge.nft({ collection, from, to, toChain, isPreview: true })
const result = await HLL.bridge.nft.send({ provider, wallet, payload: bridgeNFTPayload })
Copy link
On this page
Getting an Admin API key with your Ethereum Wallet
Install our NPM Package + Configure
Configuration
Creating a Collection
Creating an NFT
Reading Data
Bridging an NFT