1

Installation

npm install @openformat/sdk ethers@^5
2

Create an App

The functions in this code snippet require gas. You can obtain gas from a faucet, or we can provide a small amount of testnet tokens on Discord to get you started.

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());
3

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 reward XP or create badges to reward your users.