LogoLogo
  • Horizon Network
    • What is Horizon Network?
    • API Document
      • Horizon Network API
      • Quick Start
      • API Reference
        • Assets
        • Collections
        • Orders
        • Offers
        • Events
        • Statistics
        • Categories
        • Chains
        • Request an API key
    • SDKs Document
      • SDKs overview
      • NODE SDK
        • Installation
        • Initialization
        • Basic Example
          • Assets Management
          • Marketplace
        • Reference
          • Assets
          • Collections
          • Offers
          • Orders
          • Categories
          • Events
          • Statistics
          • Blockchain and Layer 2
      • JAVASCRIPT SDK
        • Overview
        • Installation
        • Quickstart
        • Reference
    • Launching NFT Collection
      • Launch A Collection
        • Overview
        • Part 1: Register as a user
        • Part 2: Deploy a smart contract
        • Part 3: Set creator earnings
        • Horizon Example Repository
      • Creating Your NFT Smart Contract
        • Overview
        • Getting Started
        • Setting a basic project
        • Minting from your new contract
        • Add your own NFT contract to Horizon Network
    • Horizon Network's Layer 2 Solution
      • Why Horizon Network?
      • Horizon Network's layer 2 Solutions
      • Basic Concepts
  • Horizon Land Metaverse
    • Feature
      • LAND in the metaverse
      • NFT Avatar
      • Horizon Center
      • Game Center
      • Shopping Center
      • Music Center
      • Play to Earn
      • Social Activities
      • Finance Center
      • Marketplace
      • Experience Mode
      • Zon Token
    • Stake Holder
      • Players
      • Creators
      • Land Owners
      • Partners
      • Investors
    • Economy
      • Revenue Stream
  • Technology
    • Blockchain
    • Product
    • System
    • Wallet
    • Security
    • Token
  • Tokenomic
  • Investor & Partner
  • Roadmap
  • Contact
  • Conclusion
  • Recommendation
  • FAQs
    • Policy
    • Terms of Use
Powered by GitBook
On this page
  • Create a Collection
  • Get a Collection
  • Get list Collections
  • Update a Collection
  1. Horizon Network
  2. SDKs Document
  3. NODE SDK
  4. Reference

Collections

A collection on Horizon Network is a group of Asset that are created by a single creator, artist, or organization. Collections can be thought of as a "virtual gallery" that showcases a particular set of digital assets, such as artwork, music, or video games. Each collection has a unique name, description, and set of attributes that define the theme and style of the assets within it. Collections can also be organized into categories, such as "rare", "limited edition", or "popular", to help users discover new and interesting Asset.

Create a Collection

const collection = {
  "externalUrl" : "https://horizonland.app",
  "fees" : [{
    "address" : "0x0dD768A47eA2395bbE5574E3252505fe1202C4A8",
    "type" : "creator_fee",
    "basis_points" : 250
  }],
  "chainId" : "56",
  "categoryId" : "e304962a-b76a-11ed-afa1-0242ac120002",
  "totalSupply" : 10000,
  "imageUrl" : "image_url",
  "telegramUrl" : "telegram_url",
  "name" : "Test Collection",
  "twitterUsername" : "twitter_username",
  "description" : "Test Description",
  "contractAddress" : "contract_address",
  "discordUrl" : "discord_url",
  "instagramUsername" : "instagram_username"
}

const result = await client.createCollection(collection);

Get a Collection

const contractAddress = "0x88Ef499ab1688DE727c21f1b72fAaEe1A3F455AD"; // {String} Address of the ERC721 contract

const result = await client.getCollection(contractAddress);

Get list Collections

var opts = {
  'chainId': "56", // {String} Chain ID
  'categoryId': "e304962a-b76a-11ed-afa1-0242ac120002", // {String} Category ID
  'ownerAddress': "0x0dD768A47eA2395bbE5574E3252505fe1202C4A8", // {String} Owner address
  'status': "active", // {String} Status of these asset
  'limit': 10, // {Integer} Limit
  'page': 1, // {Integer} Current page number
  'orderBy': "created_at", // {String} Property to sort by
  'direction': "desc" // {String} Direction to sort
};

const result = await client.getCollections(opts);

Update a Collection

  const data = {
    "externalUrl" : "external_url",
    "imageUrl" : "image_url",
    "telegramUrl" : "telegram_url",
    "name" : "collection name",
    "twitterUsername" : "twitter_username",
    "description" : "",
    "discordUrl" : "discord_url",
    "instagramUsername" : "instagram_username"
  }
  const contractAddress = "0x88Ef499ab1688DE727c21f1b72fAaEe1A3F455AD"; // {String} Address of the ERC721 contract
  
  const result = await client.updateCollection(contractAddress, data);
PreviousAssetsNextOffers

Last updated 2 years ago