import { SoarProgram, GameType, Genre } from "@magicblock-labs/soar-sdk";
// Create a Soar client using the '@solana/web3.js' active Connection and a defaultPayer
const client = SoarProgram.getFromConnection(connection, defaultPayer);
let game = Keypair.generate();
let title = "Game1";
let description = "Description";
let genre = Genre.Action;
let gameType = GameType.Web;
let nftMeta = Keypair.generate().publicKey;
let _auths = auths.map((keypair) => keypair.publicKey);
// Retrieve the bundled transaction.
let { newGame, transaction } = await client.initializeNewGame(
game.publicKey,
title,
description,
genre,
gameType,
nftMeta,
_auths
);
// Send and confirm the transaction with the game keypair as signer.
await web3.sendAndConfirmTransaction(connection, transaction);