1

Installation

npm install @openformat/sdk ethers@^5
2

Create a web3 account (Optional)

If you’re new to web3, you’ll need an account to use our SDK. You can easily create one with this simple script:

import { ethers } from "ethers";

function createWallet() {
  const wallet = ethers.Wallet.createRandom();
  console.log(`Wallet Address: ${wallet.address}`);
  console.log(`Private Key: ${wallet.privateKey}`);
}

createWallet();
3

Create an App

import { Chains, OpenFormatSDK } from "@openformat/sdk";

const sdk = new OpenFormatSDK({
  network: Chains.arbitrumSepolia,
  signer: process.env.PRIVATE_KEY, // Your wallet's private key
});

// Create App
const app = await sdk.factory.createApp({
  name: "APP_NAME",
});

// Create XP Token
const xp = await sdk.App.createToken({
  name: "XP",
  symbol: "XP",
  supply: 0,
});

console.log("APP_ID", app.id);
console.log("XP_ADDRESS", xp.address());
4

Instantiate SDK with your App

import { OpenFormatSDK, Chains } from "@openformat/sdk";

const sdk = new OpenFormatSDK({
  network: Chains.arbitrumSepolia,
  signer: process.env.PRIVATE_KEY, // Your wallet's private key
  appId: "INSERT_APP_ID",
});

Now that you have generated an APP_ID and an XP_ADDRESS, you can either continue with our SDK or use our API to start rewarding your users.