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.
- 📋 Documentation
- 📦 Installation
- 💻 Usage
- 📚 Tutorials
- 📝 Contributing
- ⚖️ License
Check out Holograph Docs for more details on how to use Holograph SDK.
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
To deploy your first contract, use the following code snippet:
- 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,
});
- 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.
- Deploying Contracts: https://docs.holograph.xyz/developer/sdk/deploying-contracts
- Minting Tokens: https://docs.holograph.xyz/developer/sdk/minting-tokens
- Bridging Tokens: https://docs.holograph.xyz/developer/sdk/bridging-tokens
Feel like contributing? That's awesome!
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT © Holograph