Skip to content

holographxyz/holograph

Repository files navigation

Holograph logo

Holograph SDK: Omnichain Tokenization


X NPM Downloads Version Github Stars Bundle Size MIT License

Holograph offers developers the flexibility to create a wide variety of tokens, including standard fungible and non-fungible tokens, as well as custom tokens for specialized use cases. It also allows for the seamless expansion of tokens across multiple chains. Using Holograph SDK, developers can efficiently create, deploy, mint, and bridge omnichain tokens, making it easy to integrate these capabilities into any application.

Table of contents

Documentation

Check out Holograph Docs for more details on how to use Holograph SDK.

Installation

To use Holograph SDK, install the @holographxyz/sdk package and its peer dependencies:

# with pnpm
$ pnpm add @holographxyz/sdk @holographxyz/networks @holographxyz/environment

# with npm
$ npm i @holographxyz/sdk @holographxyz/networks @holographxyz/environment

# with Yarn
$ yarn add @holographxyz/sdk @holographxyz/networks @holographxyz/environment

# with Bun
$ bun add @holographxyz/sdk @holographxyz/networks @holographxyz/environment

Usage

To deploy your first contract, use the following code snippet:

  1. Set up your Holograph SDK configuration:
import { Config, HolographAccountFactory } from "@holographxyz/sdk";
import { Environment } from "@holographxyz/environment";

const defaultAccount = HolographAccountFactory.createAccountUsingPrivateKey(
  process.env.PRIVATE_KEY
);

const holographConfig = Config.getInstance({
  networks: {
    ethereum: "https://your-ethereum-rpc-url.com",
    polygon: "https://your-polygon-rpc-url.com",
    avalanche: "https://your-avalanche-rpc-url.com",
  },
  environment: Environment.mainnet,
  accounts: {
    default: defaultAccount,
  },
});

export const wallet = new HolographWallet({
  account: defaultAccount,
});
  1. Deploy your very first contract:
import { HolographERC721Contract } from "@holographxyz/sdk";
import { networks } from "@holographxyz/networks";

import { wallet } from "./config";

const myContract = new HolographERC721Contract({
  contractInfo: {
    name: "Holograph",
    symbol: "HOLO",
  },
  primaryChainId: networks.polygon.chain,
});

const signatureData = await myContract.signDeploy(wallet);
const { contractAddress, txHash } = await myContract.deploy(signatureData);

// Deploying on other chains
const avalancheSignatureData = await myContract.signDeploy(
  wallet,
  networks.avalanche.chain
);
await myContract.deploy(avalancheSignatureData);

Go here for more guides on how to get started.

Tutorials

Contributing

Feel like contributing? That's awesome!

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © Holograph

About

Holograph is an omnichain tokenization protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •