LogoLogo
Manifold for Developers
Manifold for Developers
  • Introduction
  • Shopify Merch Bridge
    • Overview
    • Tutorial
      • Step 1: Product Gate Setup
        • 1.1: Configure the Product
        • 1.2: Install Manifold Merch Bridge
        • 1.2: Create a New Product Gate
        • 1.3: Link a Product to the Gate
        • 1.4: Add Rules
      • Step 2: Store Theme Setup
        • 2.1 The Theme Editor
        • 2.2 Product Page Setup
        • 2.3 Cart Page Setup
    • Advanced Configuration
    • FAQ / Error Help
    • Reference
      • Product and Gate Configuration
        • Shopify Products
        • Product Gates
          • Gate Products
          • Rules
      • Custom Themes
      • Updating to the Latest Version
      • UI Configuration Options
      • Advanced Usage
      • Common Issues
  • Guides
    • Getting Started
    • HTML
    • React
    • NextJS
    • Vue
    • Wix
    • Squarespace
      • Simple Squarespace Site
      • Customised Squarespace Template
  • Resources
    • Apps
      • Grant Types
    • Widgets
      • Directory
      • Manifold CSS Variables
        • Scheme Utility Classes
        • List of Manifold CSS Variables
      • Connect Widget
        • Blockchain Interaction
        • Wallet Authentication
        • Data Client
          • NFT Information Retrieval
            • getNFT
            • getNFTsOfOwner
            • ownerHasNFT
            • getCollectors
          • Data Storage and Retrieval
        • Advanced Configuration
        • Customization & Styling
        • Automatic Error Handling
      • Campaign Widget
        • Campaign Creation
          • Questionnaire
        • Campaign Progress
        • Customization & Styling
      • Curation Widget
      • Marketplace Widgets
        • Widgets
          • Data Attributes
          • Layout Widgets
          • Card Widgets
          • Listing Widgets
        • Window Events
        • Troubleshooting
        • Customization & Styling
        • Version Change Notes
          • 3.2.1 - CSS Selector Changes
          • 3.1.1 - CSS Selector Changes
      • Claim Widgets
        • Widgets
          • Data Attributes
          • Complete Claim Widget
          • Buy Button Only Widget
          • Mint Count Widget
        • Troubleshooting
        • Customization & Styling
        • Version Change Notes
          • 1.7.0, 1.7.1 - CSS Selector Changes
      • Restricted Token Widget
        • Customization & Styling
      • Wallet Identity Widget
        • Customization & Styling
      • Subscription Widget
      • 6551 Display Widget
    • Manifold Ethereum Provider
  • Tools and APIs
    • Merkle Tree Tool
    • Snapshot Tool
    • Discord Tools
    • Server-Side Session Authentication
      • Signature Grant
      • Authorization Code Grant
  • Smart Contracts
    • Manifold Creator
      • Contracts
        • Creator Core
          • Common Functions
          • ERC721 Functions
          • ERC1155 Functions
        • Extensions
          • Extensions Functions
          • Extensions Examples
          • Extensions Deployment Guide
            • Dynamic NFT Extension
            • Lazy Mint Extension ERC1155
            • Lazy Mint Extension ERC721
        • Mint Permissions
          • Mint Permissions Functions
      • Prior Versions
        • 1.0.x
          • Creator Core
            • Common Functions
            • ERC721 Functions
            • ERC1155 Functions
          • Extensions
            • Extensions Functions
            • Extensions Examples
            • Extensions Deployment Guide
              • Dynamic NFT Extension
              • Lazy Mint Extension ERC1155
              • Lazy Mint Extension ERC721
          • Mint Permissions
            • Mint Permissions Functions
        • 2.0.x
          • Creator Core
            • Common Functions
            • ERC721 Functions
            • ERC1155 Functions
          • Extensions
            • Extensions Functions
            • Extensions Examples
            • Extensions Deployment Guide
              • Dynamic NFT Extension
              • Lazy Mint Extension ERC1155
              • Lazy Mint Extension ERC721
          • Mint Permissions
            • Mint Permissions Functions
    • Marketplace
      • Identity Verifier
    • Royalty Registry
  • Contact Us
Powered by GitBook
On this page
  • Current Version
  • ERC 6551 Specification
  • Configuration
  • Optional Parameters
  • Layout
  • Tranferrable
  • Query Filters
  • On Populate Callback
  • Call To Action Callback and UX Text
  • CSS Theme'ing and Overriding

Was this helpful?

  1. Resources
  2. Widgets

6551 Display Widget

Display ERC6551 NFTs that own other NFTs anytime anywhere

Last updated 1 year ago

Was this helpful?

Current Version

0.0.1

Javascript Library

Base CSS Library

Additional CSS Themes

The examples below show how to reskin this Widget by using a CSS overrides. We've created an example light and dark mode skin for you.

ERC 6551 Specification

Configuration

Required Properties

  • data-widget: "m-6551-display-widget"

  • data-network: 1 or 5

  • data-token-id: any token id

  • data-token-contract: any NFT contract address

Optional Properties

  • data-layout: see Layout

  • data-query-filters: see Query Filters

  • data-on-populate: see On Populate Callback

  • data-on-call-to-action: see Call To Action Callback and UX Text

  • data-only-owner-can-call-to-action: see Call To Action Callback and UX Text

  • data-call-to-action-text: see Call To Action Callback and UX Text

Minimum Viable Example


<script src="https://connect.manifoldxyz.dev/2.2.7/connect.umd.min.js"></script>
<script src="https://6551display.manifoldxyz.dev/0.0.1/6551-display-widget.umd.js"></script>
<link rel="stylesheet" href="https://6551display.manifoldxyz.dev/0.0.1/6551-display-widget.css">
<div
    data-widget="m-6551-display-widget"
    data-network="5"
    data-token-id="261"
    data-token-contract="0x7a77F2cFB02546F217d39157471d5B5914DD7644"
    data-implementation="0x2d25602551487c3f3354dd80d76d54383a243358"
    data-salt="0"
/>

Maximum Viable Example


<script src="https://connect.manifoldxyz.dev/2.2.7/connect.umd.min.js"></script>
<script src="https://6551display.manifoldxyz.dev/0.0.1/6551-display-widget.umd.min.js"></script>
<link rel="stylesheet" href="https://6551display.manifoldxyz.dev/0.0.1/6551-display-widget.css">
<link rel="stylesheet" href="https://6551display.manifoldxyz.dev/0.0.1/main.dark.css">
<div
    data-widget="m-6551-display-widget"
    data-fallback-provider="https://...someprc"
    data-transferrable="true"
    data-network="5"
    data-layout="backpack"
    data-token-id="261"
    data-token-contract="0x7a77F2cFB02546F217d39157471d5B5914DD7644"
    data-implementation="0x2d25602551487c3f3354dd80d76d54383a243358"
    data-salt="0"
    data-query-filters=exampleQueryFilter
    data-on-populate=exampleOnPopulate
    data-on-call-to-action=exampleOnCallToAction
    data-only-owner-can-call-to-action="true"
    data-call-to-action-text="Dress Up"
  />

Optional Parameters

Layout

type: String, // 'backpack' or 'photoalbum'
default: 'backpack'
// ex
data-layout="photoalbum"

Allows for changing of the overall UX of the widget. Default is photoalbum, and backpack is another option. We may have more layouts soon.

Tranferrable

type: Boolean,
default: false
// ex
data-transferrable="true"

When set to true, the widget will display a Connect Widget to login with, and then a transfer button next to every NFT your ERC6551 NFT owns.

Once logged in, the user will be able to transfer NFTs in and out of their 6551 Account as long as they are the owner of the original ERC6551 NFT.

Query Filters

export interface TokenFilter {
    contractAddress: string;
    tokenId?: string;
    tokenIds?: Array<string>;
    minTokenId?: string;
    maxTokenId?: string;
    attributes?: Array<TokenAttribute>;
}

export interface TokenAttribute {
    traitType?: string;
    value: string;
}
type: (): TokenFilter[],
default: (): TokenFilter[] => [],
// ex
function yourQueryFilterFunction (...) {...}
data-query-filters=yourQueryFilterFunction

Allows for filtering of the initial request for all NFTs owned by the ERC6551 NFT in its 6551 Account. Set this to a function reference.

On Populate Callback

export type DataClientNFT = {
  contractAddress: string;
  tokenId: string;
  ownerAddress: string;
  name: string;
  image: string;
  spec: string;
  count: string;
  assets?: {
    nfts: DataClientNFT[];
  }
  metadata: {
    image?: string;
    image_url?: string;
    animation_url?: string;
  }
}

type Groups = {
  [key:string]: GroupDefinition
}

type GroupDefinition {
  items: DataClientNFT[],
  selectable?: boolean
  selectableLimit?: number
  selectedIndices?: number[]
}
type: (nft: DataClientNFT, groups: Groups): { nft: DataClientNFT, groups: Groups },
default: (nft: DataClientNFT, groups: Groups): Groups  => {
  // these assets are what will display next to the `nft`
  // feel free to sort them, or split them into new Groups
  return { nft,  groups };
}
// ex
function yourOnPopulateFunction (...) {...}
data-on-populate=yourOnPopulateFunction

Allows for sorting of the assets returned by the Data Client into specified groups, and allows for inspection of the core ERC6551 NFT as nft.

The assets can be returned as is, or modified in order to sort and regroup the NFTs.

You may also customize whether the NFTs in each group are selectable and the max selectableLimit of each group.

This data is updated as the user interacts with the widget, and returned into the on-call-to-action callback for your usage.

The backpack layout will automatically create a headline for each of the returnedGroups and break up the grid into sections based on said headline.

You may optional give selectedIndices an initial value in order to have the widget preselect those NFTs on initial render.

Call To Action Callback and UX Text

export type DataClientNFT = {
  contractAddress: string;
  tokenId: string;
  ownerAddress: string;
  name: string;
  image: string;
  spec: string;
  count: string;
  assets?: {
    nfts: DataClientNFT[];
  }
  metadata: {
    image?: string;
    image_url?: string;
    animation_url?: string;
  }
}

type Groups = {
  [key:string]: GroupDefinition
}

type GroupDefinition {
  items: DataClientNFT[],
  selectable?: boolean
  selectableLimit?: number
  selectedIndices?: number[]
}
type: (nft: DataClientNFT, groups: Groups): Promise<void | {
  nft: DataClientNFT,
  groups: Groups
}>
default: (nft: DataClientNFT, groups: Groups): Promise<void | {
  nft: DataClientNFT,
  groups: Groups
}> => {
  return;
}
// ex
function yourOnCallToActionFunction (...) {...}
data-on-call-to-action=yourOnCallToActionFunction
type: String
default: ''
// ex
data-call-to-action-text="Dress Up"
type: Boolean
default: true
// ex
data-only-owner-can-call-to-action="false"

When both data-on-call-to-action and data-call-to-action-textare defined, a call to action button will appear in the top right of the UX with your specifed text inside of it.

When clicked, it will perform you call to action callback. The UX will disable while your callback executes asynchronously.

The data-only-owner-can-call-to-action option will cause a Connect Widget to appear, and cause the CTA button to disable unless the user is the owner of the ERC6551 NFT.

One example usage for this would be PFPs and 3D Avatars that could potentially execute a "Dress Up" call to action whenever the owner is done selecting NFTs from each Group to "wear", you can then modify the nft data before passing it back in order to show the updates!

CSS Theme'ing and Overriding

Manifold CSS Vars Overriding

--manifold-theme--color--primary
--manifold-element--color--background
--manifold-page--color--background
--manifold-text--color--muted
--manifold-element--color-blurry
--manifold-theme--color--info
--manifold-theme--color--success
--manifold-theme--color--error
--manifold-text--color--body
--manifold-text--font-family--body
--manifold-text--font-size--body
--manifold-text--font-size--header
--manifold-text--font-size--info
--manifold-theme--border
--manifold-theme--border-radius

Toastify CSS

/*!
 * Toastify js 1.12.0
 * https://github.com/apvarun/toastify-js
 * @license MIT licensed
 *
 * Copyright (C) 2018 Varun A P
 */

// Here are the defaults so you know what's already defined and what you might 
// want to override.

// These are the little toast that show up in the top right during transefr tx.

.toastify {
    padding: 12px 20px;
    color: #ffffff;
    display: inline-block;
    box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);

    position: fixed;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    max-width: calc(50% - 20px);
    z-index: 2147483647;
}

.toast-close {
    background: transparent;
    border: 0;
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
    opacity: 0.4;
    padding: 0 5px;
}

.toastify-rounded {
    border-radius: 25px;
}

data-implementation:

data-salt:

https://6551display.manifoldxyz.dev/0.0.1/6551-display-widget.umd.js
https://6551display.manifoldxyz.dev/0.0.1/6551-display-widget.css
https://6551display.manifoldxyz.dev/0.0.1/main.dark.css
https://6551display.manifoldxyz.dev/0.0.1/main.light.css
https://docs.tokenbound.org/
https://eips.ethereum.org/EIPS/eip-6551
see ERC6551 spec
see ERC6551 spec
See filtering information here
photoalbum example
backpack layout
The connect button shows when data-transferrable or only-owner-can-call-to-action is true
A "selected" asset when selectable is true for its Group
When selected, we give a basic skinnable UX to signify which ones are selected. We disable the rest once the maxSelectableLimit for the group is reached.
An example where the data-call-to-action-text is Dress Up and data-only-owner-can-call-to-action is set to true