From 765c074d2521efc07ce4046f86128f03ecdd221e Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Mon, 6 Nov 2023 23:37:53 +0100 Subject: [PATCH 1/4] :arrow_up: Upgrade program id --- Anchor.toml | 10 +- Cargo.lock | 170 +- client/sdk/package.json | 2 +- client/sdk/src/constants.ts | 2 +- client/sdk/src/idl/soar.ts | 4574 ++++++++++++++++++----------------- client/sdk/src/idl/tens.ts | 580 ++--- crates/soar-cpi/Cargo.toml | 2 +- crates/soar-cpi/src/lib.rs | 2 +- examples/tens/src/lib.rs | 2 +- programs/soar/src/lib.rs | 2 +- readme.md | 2 +- 11 files changed, 2746 insertions(+), 2602 deletions(-) diff --git a/Anchor.toml b/Anchor.toml index af37bb2..cf671ef 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -3,15 +3,15 @@ seeds = false skip-lint = false [programs.localnet] -soar = "SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU" -tens = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS" +soar = "SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk" +tens = "Tensgwm3DY3UJ8nhF7xnD2Wo65VcnLTXjjoyEvs6Zyk" [programs.devnet] -soar = "SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU" -tens = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS" +soar = "SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk" +tens = "Tensgwm3DY3UJ8nhF7xnD2Wo65VcnLTXjjoyEvs6Zyk" [programs.mainnet] -soar = "SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU" +soar = "SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk" [registry] url = "https://api.apr.dev" diff --git a/Cargo.lock b/Cargo.lock index 21c5e0a..64f5231 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,20 +71,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "anchor-attribute-access-control" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa5be5b72abea167f87c868379ba3c2be356bfca9e6f474fd055fa0f7eeb4f2" -dependencies = [ - "anchor-syn 0.28.0", - "anyhow", - "proc-macro2", - "quote", - "regex", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-access-control" version = "0.29.0" @@ -97,21 +83,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-account" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f468970344c7c9f9d03b4da854fd7c54f21305059f53789d0045c1dd803f0018" -dependencies = [ - "anchor-syn 0.28.0", - "anyhow", - "bs58 0.5.0", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-account" version = "0.29.0" @@ -125,17 +96,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-constant" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59948e7f9ef8144c2aefb3f32a40c5fce2798baeec765ba038389e82301017ef" -dependencies = [ - "anchor-syn 0.28.0", - "proc-macro2", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-constant" version = "0.29.0" @@ -147,18 +107,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-error" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc753c9d1c7981cb8948cf7e162fb0f64558999c0413058e2d43df1df5448086" -dependencies = [ - "anchor-syn 0.28.0", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-error" version = "0.29.0" @@ -170,19 +118,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-event" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38b4e172ba1b52078f53fdc9f11e3dc0668ad27997838a0aad2d148afac8c97" -dependencies = [ - "anchor-syn 0.28.0", - "anyhow", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-event" version = "0.29.0" @@ -195,19 +130,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-attribute-program" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eebd21543606ab61e2d83d9da37d24d3886a49f390f9c43a1964735e8c0f0d5" -dependencies = [ - "anchor-syn 0.28.0", - "anyhow", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-attribute-program" version = "0.29.0" @@ -219,19 +141,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-derive-accounts" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4720d899b3686396cced9508f23dab420f1308344456ec78ef76f98fda42af" -dependencies = [ - "anchor-syn 0.28.0", - "anyhow", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-derive-accounts" version = "0.29.0" @@ -256,17 +165,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-derive-space" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f495e85480bd96ddeb77b71d499247c7d4e8b501e75ecb234e9ef7ae7bd6552a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "anchor-derive-space" version = "0.29.0" @@ -278,45 +176,21 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-lang" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d4b20100f1310a774aba3471ef268e5c4ba4d5c28c0bbe663c2658acbc414" -dependencies = [ - "anchor-attribute-access-control 0.28.0", - "anchor-attribute-account 0.28.0", - "anchor-attribute-constant 0.28.0", - "anchor-attribute-error 0.28.0", - "anchor-attribute-event 0.28.0", - "anchor-attribute-program 0.28.0", - "anchor-derive-accounts 0.28.0", - "anchor-derive-space 0.28.0", - "arrayref", - "base64 0.13.1", - "bincode", - "borsh 0.10.3", - "bytemuck", - "getrandom 0.2.10", - "solana-program", - "thiserror", -] - [[package]] name = "anchor-lang" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ - "anchor-attribute-access-control 0.29.0", - "anchor-attribute-account 0.29.0", - "anchor-attribute-constant 0.29.0", - "anchor-attribute-error 0.29.0", - "anchor-attribute-event 0.29.0", - "anchor-attribute-program 0.29.0", - "anchor-derive-accounts 0.29.0", + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-program", + "anchor-derive-accounts", "anchor-derive-serde", - "anchor-derive-space 0.29.0", + "anchor-derive-space", "arrayref", "base64 0.13.1", "bincode", @@ -333,7 +207,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ - "anchor-lang 0.29.0", + "anchor-lang", "solana-program", "spl-associated-token-account", "spl-token 4.0.0", @@ -358,24 +232,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "anchor-syn" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a125e4b0cc046cfec58f5aa25038e34cf440151d58f0db3afc55308251fe936d" -dependencies = [ - "anyhow", - "bs58 0.5.0", - "heck 0.3.3", - "proc-macro2", - "quote", - "serde", - "serde_json", - "sha2 0.10.8", - "syn 1.0.109", - "thiserror", -] - [[package]] name = "anchor-syn" version = "0.29.0" @@ -2155,7 +2011,7 @@ checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" name = "soar" version = "0.1.0" dependencies = [ - "anchor-lang 0.29.0", + "anchor-lang", "anchor-spl", "mpl-token-metadata", "solana-security-txt", @@ -2164,9 +2020,9 @@ dependencies = [ [[package]] name = "soar-cpi" -version = "0.1.2" +version = "0.1.3" dependencies = [ - "anchor-lang 0.28.0", + "anchor-lang", "clockwork-anchor-gen", ] @@ -2654,7 +2510,7 @@ dependencies = [ name = "tens" version = "0.1.0" dependencies = [ - "anchor-lang 0.29.0", + "anchor-lang", "soar", ] diff --git a/client/sdk/package.json b/client/sdk/package.json index 0588451..47285e5 100644 --- a/client/sdk/package.json +++ b/client/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@magicblock-labs/soar-sdk", - "version": "0.1.19", + "version": "0.1.20", "description": "Sdk bindings for the SOAR smart contract.", "repository": { "type": "git", diff --git a/client/sdk/src/constants.ts b/client/sdk/src/constants.ts index a94b484..e2a2d39 100644 --- a/client/sdk/src/constants.ts +++ b/client/sdk/src/constants.ts @@ -1,6 +1,6 @@ import { PublicKey } from "@solana/web3.js"; -export const PROGRAM_ADDRESS = "SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU"; +export const PROGRAM_ADDRESS = "SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk"; export const PROGRAM_ID = new PublicKey(PROGRAM_ADDRESS); export const TOKEN_METADATA_PROGRAM_ID = new PublicKey( diff --git a/client/sdk/src/idl/soar.ts b/client/sdk/src/idl/soar.ts index c7765ba..df8bf9c 100644 --- a/client/sdk/src/idl/soar.ts +++ b/client/sdk/src/idl/soar.ts @@ -1,513 +1,525 @@ export type Soar = { - version: "0.1.0"; - name: "soar"; - constants: [ - { - name: "MAX_TITLE_LEN"; - type: { - defined: "usize"; - }; - value: "30"; - }, - { - name: "MAX_DESCRIPTION_LEN"; - type: { - defined: "usize"; - }; - value: "200"; + "version": "0.1.0", + "name": "soar", + "constants": [ + { + "name": "MAX_TITLE_LEN", + "type": { + "defined": "usize" + }, + "value": "30" + }, + { + "name": "MAX_DESCRIPTION_LEN", + "type": { + "defined": "usize" + }, + "value": "200" } - ]; - instructions: [ + ], + "instructions": [ { - name: "initializeGame"; - docs: ["Initialize a new [Game] and register its [LeaderBoard]."]; - accounts: [ + "name": "initializeGame", + "docs": [ + "Initialize a new [Game] and register its [LeaderBoard]." + ], + "accounts": [ { - name: "creator"; - isMut: true; - isSigner: true; + "name": "creator", + "isMut": true, + "isSigner": true }, { - name: "game"; - isMut: true; - isSigner: true; + "name": "game", + "isMut": true, + "isSigner": true }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "gameMeta"; - type: { - defined: "GameAttributes"; - }; + "name": "gameMeta", + "type": { + "defined": "GameAttributes" + } }, { - name: "gameAuth"; - type: { - vec: "publicKey"; - }; + "name": "gameAuth", + "type": { + "vec": "publicKey" + } } - ]; + ] }, { - name: "updateGame"; - docs: ["Update a [Game]'s meta-information or authority list."]; - accounts: [ + "name": "updateGame", + "docs": [ + "Update a [Game]'s meta-information or authority list." + ], + "accounts": [ { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game"; - isMut: true; - isSigner: false; + "name": "game", + "isMut": true, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ - { - name: "newMeta"; - type: { - option: { - defined: "GameAttributes"; - }; - }; - }, - { - name: "newAuth"; - type: { - option: { - vec: "publicKey"; - }; - }; + ], + "args": [ + { + "name": "newMeta", + "type": { + "option": { + "defined": "GameAttributes" + } + } + }, + { + "name": "newAuth", + "type": { + "option": { + "vec": "publicKey" + } + } } - ]; + ] }, { - name: "addAchievement"; - docs: [ + "name": "addAchievement", + "docs": [ "Add a new [Achievement] that can be attained for a particular [Game]." - ]; - accounts: [ + ], + "accounts": [ { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game"; - isMut: true; - isSigner: false; + "name": "game", + "isMut": true, + "isSigner": false }, { - name: "newAchievement"; - isMut: true; - isSigner: false; + "name": "newAchievement", + "isMut": true, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "title"; - type: "string"; + "name": "title", + "type": "string" }, { - name: "description"; - type: "string"; + "name": "description", + "type": "string" }, { - name: "nftMeta"; - type: "publicKey"; + "name": "nftMeta", + "type": "publicKey" } - ]; + ] }, { - name: "updateAchievement"; - docs: ["Update an [Achievement]'s meta information."]; - accounts: [ + "name": "updateAchievement", + "docs": [ + "Update an [Achievement]'s meta information." + ], + "accounts": [ { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement"; - isMut: true; - isSigner: false; + "name": "achievement", + "isMut": true, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "newTitle"; - type: { - option: "string"; - }; + "name": "newTitle", + "type": { + "option": "string" + } }, { - name: "newDescription"; - type: { - option: "string"; - }; + "name": "newDescription", + "type": { + "option": "string" + } }, { - name: "nftMeta"; - type: { - option: "publicKey"; - }; + "name": "nftMeta", + "type": { + "option": "publicKey" + } } - ]; + ] }, { - name: "addLeaderboard"; - docs: ["Overwrite the active [LeaderBoard] and set a newly created one."]; - accounts: [ + "name": "addLeaderboard", + "docs": [ + "Overwrite the active [LeaderBoard] and set a newly created one." + ], + "accounts": [ { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game"; - isMut: true; - isSigner: false; + "name": "game", + "isMut": true, + "isSigner": false }, { - name: "leaderboard"; - isMut: true; - isSigner: false; + "name": "leaderboard", + "isMut": true, + "isSigner": false }, { - name: "topEntries"; - isMut: true; - isSigner: false; - isOptional: true; + "name": "topEntries", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "input"; - type: { - defined: "RegisterLeaderBoardInput"; - }; + "name": "input", + "type": { + "defined": "RegisterLeaderBoardInput" + } } - ]; + ] }, { - name: "updateLeaderboard"; - docs: [ + "name": "updateLeaderboard", + "docs": [ "Update's a leaderboard's description and nft metadata information." - ]; - accounts: [ + ], + "accounts": [ { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "leaderboard"; - isMut: true; - isSigner: false; + "name": "leaderboard", + "isMut": true, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "newDescription"; - type: { - option: "string"; - }; + "name": "newDescription", + "type": { + "option": "string" + } }, { - name: "newNftMeta"; - type: { - option: "publicKey"; - }; + "name": "newNftMeta", + "type": { + "option": "publicKey" + } } - ]; + ] }, { - name: "initializePlayer"; - docs: ["Create a [Player] account for a particular user."]; - accounts: [ + "name": "initializePlayer", + "docs": [ + "Create a [Player] account for a particular user." + ], + "accounts": [ { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "user"; - isMut: false; - isSigner: true; + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount"; - isMut: true; - isSigner: false; + "name": "playerAccount", + "isMut": true, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "username"; - type: "string"; + "name": "username", + "type": "string" }, { - name: "nftMeta"; - type: "publicKey"; + "name": "nftMeta", + "type": "publicKey" } - ]; + ] }, { - name: "updatePlayer"; - docs: ["Update the username or nft_meta for a [Player] account."]; - accounts: [ + "name": "updatePlayer", + "docs": [ + "Update the username or nft_meta for a [Player] account." + ], + "accounts": [ { - name: "user"; - isMut: false; - isSigner: true; + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount"; - isMut: true; - isSigner: false; + "name": "playerAccount", + "isMut": true, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "username"; - type: { - option: "string"; - }; + "name": "username", + "type": { + "option": "string" + } }, { - name: "nftMeta"; - type: { - option: "publicKey"; - }; + "name": "nftMeta", + "type": { + "option": "publicKey" + } } - ]; + ] }, { - name: "registerPlayer"; - docs: [ + "name": "registerPlayer", + "docs": [ "Register a [Player] for a particular [Leaderboard], resulting in a newly-", "created [PlayerEntryList] account." - ]; - accounts: [ + ], + "accounts": [ { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "user"; - isMut: false; - isSigner: true; + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount"; - isMut: false; - isSigner: false; + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "leaderboard"; - isMut: false; - isSigner: false; + "name": "leaderboard", + "isMut": false, + "isSigner": false }, { - name: "newList"; - isMut: true; - isSigner: false; + "name": "newList", + "isMut": true, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: []; + ], + "args": [] }, { - name: "submitScore"; - docs: [ + "name": "submitScore", + "docs": [ "Submit a score for a player and have it timestamped and added to the [PlayerEntryList].", "Optionally increase the player's rank if needed.", "", "This instruction automatically resizes the [PlayerScoresList] account if needed." - ]; - accounts: [ + ], + "accounts": [ { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "playerAccount"; - isMut: false; - isSigner: false; + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "leaderboard"; - isMut: false; - isSigner: false; + "name": "leaderboard", + "isMut": false, + "isSigner": false }, { - name: "playerScores"; - isMut: true; - isSigner: false; + "name": "playerScores", + "isMut": true, + "isSigner": false }, { - name: "topEntries"; - isMut: true; - isSigner: false; - isOptional: true; + "name": "topEntries", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "score"; - type: "u64"; + "name": "score", + "type": "u64" } - ]; + ] }, { - name: "initiateMerge"; - docs: [ + "name": "initiateMerge", + "docs": [ "Initialize a new merge account and await approval from the verified users of all the", "specified [Player] accounts.", "", "A merge is complete when all the users of the [Player] account keys referenced in it", "have signed to set their approval to `true`." - ]; - accounts: [ + ], + "accounts": [ { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "user"; - isMut: false; - isSigner: true; + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount"; - isMut: false; - isSigner: false; + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "mergeAccount"; - isMut: true; - isSigner: true; + "name": "mergeAccount", + "isMut": true, + "isSigner": true }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "keys"; - type: { - vec: "publicKey"; - }; + "name": "keys", + "type": { + "vec": "publicKey" + } } - ]; + ] }, { - name: "approveMerge"; - docs: [ + "name": "approveMerge", + "docs": [ "Register merge confirmation for a particular [Player] account included in a [Merged]." - ]; - accounts: [ + ], + "accounts": [ { - name: "user"; - isMut: false; - isSigner: true; + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount"; - isMut: false; - isSigner: false; + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "mergeAccount"; - isMut: true; - isSigner: false; + "name": "mergeAccount", + "isMut": true, + "isSigner": false } - ]; - args: []; + ], + "args": [] }, { - name: "unlockPlayerAchievement"; - docs: [ + "name": "unlockPlayerAchievement", + "docs": [ "Unlock a [PlayerAchievement] account without minting a reward.", "", "Used `ONLY` for custom rewards mechanism to setup a [PlayerAchievement] account that", @@ -516,1707 +528,1839 @@ export type Soar = { "Since claim instructions like [claim_ft_reward] and [claim_nft_reward] for reward types", "defined by this program try to initialize this account and will fail if it already exists,", "calling this means opting out of using these functions." - ]; - accounts: [ + ], + "accounts": [ { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "playerAccount"; - isMut: false; - isSigner: false; + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement"; - isMut: false; - isSigner: false; + "name": "achievement", + "isMut": false, + "isSigner": false }, { - name: "playerAchievement"; - isMut: true; - isSigner: false; + "name": "playerAchievement", + "isMut": true, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: []; + ], + "args": [] }, { - name: "addFtReward"; - docs: [ + "name": "addFtReward", + "docs": [ "Add a fungible token [Reward] to an [Achievement] to mint to users on unlock.", "", "Overwrites the current reward if one exists." - ]; - accounts: [ + ], + "accounts": [ { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement"; - isMut: true; - isSigner: false; + "name": "achievement", + "isMut": true, + "isSigner": false }, { - name: "newReward"; - isMut: true; - isSigner: true; + "name": "newReward", + "isMut": true, + "isSigner": true }, { - name: "rewardTokenMint"; - isMut: false; - isSigner: false; + "name": "rewardTokenMint", + "isMut": false, + "isSigner": false }, { - name: "delegateFromTokenAccount"; - isMut: true; - isSigner: false; + "name": "delegateFromTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "tokenAccountOwner"; - isMut: false; - isSigner: true; + "name": "tokenAccountOwner", + "isMut": false, + "isSigner": true }, { - name: "tokenProgram"; - isMut: false; - isSigner: false; + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "input"; - type: { - defined: "AddNewRewardInput"; - }; + "name": "input", + "type": { + "defined": "AddNewRewardInput" + } } - ]; + ] }, { - name: "addNftReward"; - docs: [ + "name": "addNftReward", + "docs": [ "Add a nft [Reward] to an [Achievement] to mint to users on unlock.", "", "Overwrites the current reward if one exists." - ]; - accounts: [ + ], + "accounts": [ { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement"; - isMut: true; - isSigner: false; + "name": "achievement", + "isMut": true, + "isSigner": false }, { - name: "newReward"; - isMut: true; - isSigner: true; + "name": "newReward", + "isMut": true, + "isSigner": true }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: "rewardCollectionMint"; - isMut: false; - isSigner: false; - isOptional: true; + "name": "rewardCollectionMint", + "isMut": false, + "isSigner": false, + "isOptional": true }, { - name: "collectionUpdateAuth"; - isMut: false; - isSigner: true; - isOptional: true; + "name": "collectionUpdateAuth", + "isMut": false, + "isSigner": true, + "isOptional": true }, { - name: "collectionMetadata"; - isMut: true; - isSigner: false; - isOptional: true; + "name": "collectionMetadata", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - name: "tokenMetadataProgram"; - isMut: false; - isSigner: false; - isOptional: true; + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false, + "isOptional": true } - ]; - args: [ + ], + "args": [ { - name: "input"; - type: { - defined: "AddNewRewardInput"; - }; + "name": "input", + "type": { + "defined": "AddNewRewardInput" + } } - ]; + ] }, { - name: "claimFtReward"; - docs: [ + "name": "claimFtReward", + "docs": [ "Mint an NFT reward for unlocking a [PlayerAchievement] account.", "", "This will attempt to create a [PlayerAchievement] account and fail if it already exists.", "", "Relevant `ONLY` if an FT reward is specified for that achievement." - ]; - accounts: [ + ], + "accounts": [ { - name: "user"; - isMut: false; - isSigner: false; + "name": "user", + "isMut": false, + "isSigner": false }, { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement"; - isMut: false; - isSigner: false; + "name": "achievement", + "isMut": false, + "isSigner": false }, { - name: "reward"; - isMut: true; - isSigner: false; + "name": "reward", + "isMut": true, + "isSigner": false }, { - name: "playerAccount"; - isMut: false; - isSigner: false; + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "playerAchievement"; - isMut: true; - isSigner: false; + "name": "playerAchievement", + "isMut": true, + "isSigner": false }, { - name: "sourceTokenAccount"; - isMut: true; - isSigner: false; + "name": "sourceTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "userTokenAccount"; - isMut: true; - isSigner: false; + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "tokenProgram"; - isMut: false; - isSigner: false; + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: []; + ], + "args": [] }, { - name: "claimNftReward"; - docs: [ + "name": "claimNftReward", + "docs": [ "Mint an NFT reward for unlocking a [PlayerAchievement] account.", "", "This will attempt to create a [PlayerAchievement] account and fail if it already exists.", "", "Relevant `ONLY` if an NFT reward is specified for that achievement." - ]; - accounts: [ + ], + "accounts": [ { - name: "user"; - isMut: false; - isSigner: false; + "name": "user", + "isMut": false, + "isSigner": false }, { - name: "authority"; - isMut: false; - isSigner: true; + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "achievement"; - isMut: false; - isSigner: false; + "name": "achievement", + "isMut": false, + "isSigner": false }, { - name: "reward"; - isMut: true; - isSigner: false; + "name": "reward", + "isMut": true, + "isSigner": false }, { - name: "playerAccount"; - isMut: false; - isSigner: false; + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "playerAchievement"; - isMut: true; - isSigner: false; + "name": "playerAchievement", + "isMut": true, + "isSigner": false }, { - name: "claim"; - isMut: true; - isSigner: false; + "name": "claim", + "isMut": true, + "isSigner": false }, { - name: "newMint"; - isMut: true; - isSigner: true; + "name": "newMint", + "isMut": true, + "isSigner": true }, { - name: "newMetadata"; - isMut: true; - isSigner: false; + "name": "newMetadata", + "isMut": true, + "isSigner": false }, { - name: "newMasterEdition"; - isMut: true; - isSigner: false; + "name": "newMasterEdition", + "isMut": true, + "isSigner": false }, { - name: "mintTo"; - isMut: true; - isSigner: false; + "name": "mintTo", + "isMut": true, + "isSigner": false }, { - name: "tokenMetadataProgram"; - isMut: false; - isSigner: false; + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false }, { - name: "associatedTokenProgram"; - isMut: false; - isSigner: false; + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: "tokenProgram"; - isMut: false; - isSigner: false; + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: "rent"; - isMut: false; - isSigner: false; + "name": "rent", + "isMut": false, + "isSigner": false } - ]; - args: []; + ], + "args": [] }, { - name: "verifyNftReward"; - docs: [ + "name": "verifyNftReward", + "docs": [ "Verify NFT reward as belonging to a particular collection.", "", "Optional: Only relevant if an NFT reward is specified and the reward's", "`collection_mint` is Some(...)" - ]; - accounts: [ + ], + "accounts": [ { - name: "payer"; - isMut: true; - isSigner: true; + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game"; - isMut: false; - isSigner: false; + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement"; - isMut: false; - isSigner: false; + "name": "achievement", + "isMut": false, + "isSigner": false }, { - name: "reward"; - isMut: false; - isSigner: false; + "name": "reward", + "isMut": false, + "isSigner": false }, { - name: "user"; - isMut: false; - isSigner: true; + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount"; - isMut: false; - isSigner: false; + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "claim"; - isMut: false; - isSigner: false; + "name": "claim", + "isMut": false, + "isSigner": false }, { - name: "playerAchievement"; - isMut: false; - isSigner: false; + "name": "playerAchievement", + "isMut": false, + "isSigner": false }, { - name: "mint"; - isMut: false; - isSigner: false; + "name": "mint", + "isMut": false, + "isSigner": false }, { - name: "metadataToVerify"; - isMut: true; - isSigner: false; + "name": "metadataToVerify", + "isMut": true, + "isSigner": false }, { - name: "collectionMint"; - isMut: false; - isSigner: false; + "name": "collectionMint", + "isMut": false, + "isSigner": false }, { - name: "collectionMetadata"; - isMut: true; - isSigner: false; + "name": "collectionMetadata", + "isMut": true, + "isSigner": false }, { - name: "collectionEdition"; - isMut: false; - isSigner: false; + "name": "collectionEdition", + "isMut": false, + "isSigner": false }, { - name: "tokenMetadataProgram"; - isMut: false; - isSigner: false; + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false } - ]; - args: []; + ], + "args": [] } - ]; - accounts: [ + ], + "accounts": [ { - name: "achievement"; - docs: [ + "name": "achievement", + "docs": [ "Represents an achievement(with optional rewards) for this game", "that can be attained by players.", "", - 'PDA with seeds = `[b"achievement", game.key().as_ref(), &id.to_le_bytes()]`', + "PDA with seeds = `[b\"achievement\", game.key().as_ref(), &id.to_le_bytes()]`", "", "`id` is an incrementing index stored in the game account." - ]; - type: { - kind: "struct"; - fields: [ + ], + "type": { + "kind": "struct", + "fields": [ { - name: "game"; - docs: [ + "name": "game", + "docs": [ "Public key of the game account this achievement is derived from." - ]; - type: "publicKey"; + ], + "type": "publicKey" }, { - name: "id"; - docs: [ + "name": "id", + "docs": [ "The achievement_count of the game account when this account was", "created, also used as a seed for its PDA." - ]; - type: "u64"; + ], + "type": "u64" }, { - name: "title"; - docs: ["Achievement title."]; - type: "string"; + "name": "title", + "docs": [ + "Achievement title." + ], + "type": "string" }, { - name: "description"; - docs: ["Achievement description."]; - type: "string"; + "name": "description", + "docs": [ + "Achievement description." + ], + "type": "string" }, { - name: "nftMeta"; - docs: [ + "name": "nftMeta", + "docs": [ "Public key of a nft metadata account describing this achievement." - ]; - type: "publicKey"; + ], + "type": "publicKey" }, { - name: "reward"; - docs: [ + "name": "reward", + "docs": [ "Optional: Specify a reward to players for unlocking this achievement." - ]; - type: { - option: "publicKey"; - }; + ], + "type": { + "option": "publicKey" + } } - ]; - }; + ] + } }, { - name: "game"; - docs: ["An account representing a single game."]; - type: { - kind: "struct"; - fields: [ + "name": "game", + "docs": [ + "An account representing a single game." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "meta"; - docs: ["Game meta-information."]; - type: { - defined: "GameAttributes"; - }; + "name": "meta", + "docs": [ + "Game meta-information." + ], + "type": { + "defined": "GameAttributes" + } }, { - name: "leaderboardCount"; - docs: [ + "name": "leaderboardCount", + "docs": [ "Number of leaderboards this game has created. Used both", "in determining the most recent leaderboard address, and", "as a seed for the next leaderboard." - ]; - type: "u64"; + ], + "type": "u64" }, { - name: "achievementCount"; - docs: [ + "name": "achievementCount", + "docs": [ "Number of achievements that exist for this game. Also", "used to determine the u64 seed for the next achievement." - ]; - type: "u64"; + ], + "type": "u64" }, { - name: "auth"; - docs: [ + "name": "auth", + "docs": [ "A collection of pubkeys which each represent a valid", "authority for this game." - ]; - type: { - vec: "publicKey"; - }; + ], + "type": { + "vec": "publicKey" + } } - ]; - }; + ] + } }, { - name: "leaderBoard"; - docs: [ + "name": "leaderBoard", + "docs": [ "Represents a [Game][super::Game]'s leaderboard.", "", - 'Seeds: `[b"leaderboard", game.key().as_ref(), &id.to_le_bytes()]`' - ]; - type: { - kind: "struct"; - fields: [ - { - name: "id"; - docs: [ + "Seeds: `[b\"leaderboard\", game.key().as_ref(), &id.to_le_bytes()]`" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "id", + "docs": [ "The leaderboard's id, used in deriving its address from the game." - ]; - type: "u64"; + ], + "type": "u64" }, { - name: "game"; - docs: ["The game this leaderboard belongs to and is derived from."]; - type: "publicKey"; + "name": "game", + "docs": [ + "The game this leaderboard belongs to and is derived from." + ], + "type": "publicKey" }, { - name: "description"; - docs: ["Leaderboard description."]; - type: "string"; + "name": "description", + "docs": [ + "Leaderboard description." + ], + "type": "string" }, { - name: "nftMeta"; - docs: [ + "name": "nftMeta", + "docs": [ "Pubkey of an nft metadata account that describes this leaderboard." - ]; - type: "publicKey"; + ], + "type": "publicKey" }, { - name: "decimals"; - docs: ["Used to contextualize scores for this leaderboard."]; - type: "u8"; + "name": "decimals", + "docs": [ + "Used to contextualize scores for this leaderboard." + ], + "type": "u8" }, { - name: "minScore"; - docs: ["Minimum possible score for this leaderboard."]; - type: "u64"; + "name": "minScore", + "docs": [ + "Minimum possible score for this leaderboard." + ], + "type": "u64" }, { - name: "maxScore"; - docs: ["Maximum possible score for this leaderboard."]; - type: "u64"; + "name": "maxScore", + "docs": [ + "Maximum possible score for this leaderboard." + ], + "type": "u64" }, { - name: "topEntries"; - docs: ["Top [entries](ScoreEntry) for a leaderboard."]; - type: { - option: "publicKey"; - }; + "name": "topEntries", + "docs": [ + "Top [entries](ScoreEntry) for a leaderboard." + ], + "type": { + "option": "publicKey" + } } - ]; - }; + ] + } }, { - name: "merged"; - docs: [ + "name": "merged", + "docs": [ "An account that represents a single user's ownership of", "multiple [Player][super::Player] accounts." - ]; - type: { - kind: "struct"; - fields: [ + ], + "type": { + "kind": "struct", + "fields": [ { - name: "initiator"; - docs: ["The user that initialized this merge."]; - type: "publicKey"; + "name": "initiator", + "docs": [ + "The user that initialized this merge." + ], + "type": "publicKey" }, { - name: "approvals"; - docs: [ + "name": "approvals", + "docs": [ "Details of all the player accounts to be merged with the main_user's." - ]; - type: { - vec: { - defined: "MergeApproval"; - }; - }; + ], + "type": { + "vec": { + "defined": "MergeApproval" + } + } }, { - name: "mergeComplete"; - docs: [ + "name": "mergeComplete", + "docs": [ "Set to true when every user in `others` has registered their approval." - ]; - type: "bool"; + ], + "type": "bool" } - ]; - }; + ] + } }, { - name: "playerAchievement"; - docs: [ + "name": "playerAchievement", + "docs": [ "Represents a player's status for a particular [Achievement](super::Achievement).", "", - 'Seeds = `[b"player-achievement", player.key().as_ref(), achievement.key().as_ref()]`.' - ]; - type: { - kind: "struct"; - fields: [ + "Seeds = `[b\"player-achievement\", player.key().as_ref(), achievement.key().as_ref()]`." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "playerAccount"; - docs: ["The user's [player][super::Player] account."]; - type: "publicKey"; + "name": "playerAccount", + "docs": [ + "The user's [player][super::Player] account." + ], + "type": "publicKey" }, { - name: "achievement"; - docs: ["The key of the achievement unlocked for this player."]; - type: "publicKey"; + "name": "achievement", + "docs": [ + "The key of the achievement unlocked for this player." + ], + "type": "publicKey" }, { - name: "timestamp"; - docs: ["Timestamp showing when this achievement was unlocked."]; - type: "i64"; + "name": "timestamp", + "docs": [ + "Timestamp showing when this achievement was unlocked." + ], + "type": "i64" }, { - name: "unlocked"; - docs: ["A player's unlock status for this achievement."]; - type: "bool"; + "name": "unlocked", + "docs": [ + "A player's unlock status for this achievement." + ], + "type": "bool" }, { - name: "claimed"; - docs: ["Whether or not this player has claimed their reward."]; - type: "bool"; + "name": "claimed", + "docs": [ + "Whether or not this player has claimed their reward." + ], + "type": "bool" } - ]; - }; + ] + } }, { - name: "playerScoresList"; - docs: [ + "name": "playerScoresList", + "docs": [ "Holds a list of a [player][super::Player]'s [scores][ScoreEntry])", "for a particular [LeaderBoard].", "", - 'Seeds: `[b"player-scores-list", player_account.key().as_ref(), leaderboard.key().as_ref()]`' - ]; - type: { - kind: "struct"; - fields: [ - { - name: "playerAccount"; - docs: [ + "Seeds: `[b\"player-scores-list\", player_account.key().as_ref(), leaderboard.key().as_ref()]`" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "playerAccount", + "docs": [ "The player[super::Player] account this entry is derived from" - ]; - type: "publicKey"; + ], + "type": "publicKey" }, { - name: "leaderboard"; - docs: ["The id of the specific leaderboard."]; - type: "publicKey"; + "name": "leaderboard", + "docs": [ + "The id of the specific leaderboard." + ], + "type": "publicKey" }, { - name: "allocCount"; - docs: [ + "name": "allocCount", + "docs": [ "Max number of [scores][ScoreEntry] the current space allocation supports." - ]; - type: "u16"; + ], + "type": "u16" }, { - name: "scores"; - docs: ["Collection of [scores][ScoreEntry]."]; - type: { - vec: { - defined: "ScoreEntry"; - }; - }; + "name": "scores", + "docs": [ + "Collection of [scores][ScoreEntry]." + ], + "type": { + "vec": { + "defined": "ScoreEntry" + } + } } - ]; - }; + ] + } }, { - name: "player"; - docs: [ + "name": "player", + "docs": [ "An account representing a player.", "", - 'Seeds: `[b"player", user.key().as_ref()]`' - ]; - type: { - kind: "struct"; - fields: [ + "Seeds: `[b\"player\", user.key().as_ref()]`" + ], + "type": { + "kind": "struct", + "fields": [ { - name: "user"; - docs: ["The wallet that owns this player-info account"]; - type: "publicKey"; + "name": "user", + "docs": [ + "The wallet that owns this player-info account" + ], + "type": "publicKey" }, { - name: "username"; - docs: ["The player's username."]; - type: "string"; + "name": "username", + "docs": [ + "The player's username." + ], + "type": "string" }, { - name: "nftMeta"; - docs: ["Metadata to represent this player."]; - type: "publicKey"; + "name": "nftMeta", + "docs": [ + "Metadata to represent this player." + ], + "type": "publicKey" } - ]; - }; + ] + } }, { - name: "nftClaim"; - type: { - kind: "struct"; - fields: []; - }; + "name": "nftClaim", + "type": { + "kind": "struct", + "fields": [] + } }, { - name: "reward"; - docs: ["An account representing a reward for a given achievement."]; - type: { - kind: "struct"; - fields: [ + "name": "reward", + "docs": [ + "An account representing a reward for a given achievement." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "achievement"; - docs: ["The achievement this reward is given for."]; - type: "publicKey"; + "name": "achievement", + "docs": [ + "The achievement this reward is given for." + ], + "type": "publicKey" }, { - name: "availableSpots"; - docs: ["Number of available reward spots."]; - type: "u64"; + "name": "availableSpots", + "docs": [ + "Number of available reward spots." + ], + "type": "u64" }, { - name: "reward"; - docs: [ + "name": "reward", + "docs": [ "The reward kind. Current supports Nft and Ft rewards only." - ]; - type: { - defined: "RewardKind"; - }; + ], + "type": { + "defined": "RewardKind" + } } - ]; - }; + ] + } }, { - name: "leaderTopEntries"; - docs: [ + "name": "leaderTopEntries", + "docs": [ "Keeps track of a sorted list of top scores for a leaderboard.", "", - 'Seeds = [b"top-scores", leaderboard.key().as_ref()]' - ]; - type: { - kind: "struct"; - fields: [ - { - name: "isAscending"; - docs: ["Arrangement order."]; - type: "bool"; - }, - { - name: "topScores"; - docs: ["Top scores."]; - type: { - vec: { - defined: "LeaderBoardScore"; - }; - }; - } - ]; - }; + "Seeds = [b\"top-scores\", leaderboard.key().as_ref()]" + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "isAscending", + "docs": [ + "Arrangement order." + ], + "type": "bool" + }, + { + "name": "topScores", + "docs": [ + "Top scores." + ], + "type": { + "vec": { + "defined": "LeaderBoardScore" + } + } + } + ] + } } - ]; - types: [ + ], + "types": [ { - name: "GameAttributes"; - docs: ["A type that represents game-specific information."]; - type: { - kind: "struct"; - fields: [ + "name": "GameAttributes", + "docs": [ + "A type that represents game-specific information." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "title"; - docs: ["The title of the game, max length = 30 bytes."]; - type: "string"; + "name": "title", + "docs": [ + "The title of the game, max length = 30 bytes." + ], + "type": "string" }, { - name: "description"; - docs: ["The game description, max length = 200 bytes."]; - type: "string"; + "name": "description", + "docs": [ + "The game description, max length = 200 bytes." + ], + "type": "string" }, { - name: "genre"; - docs: ["The game's [genre](super::Genre), as a u8."]; - type: "u8"; + "name": "genre", + "docs": [ + "The game's [genre](super::Genre), as a u8." + ], + "type": "u8" }, { - name: "gameType"; - docs: ["The game's [type](super::GameType), as a u8."]; - type: "u8"; + "name": "gameType", + "docs": [ + "The game's [type](super::GameType), as a u8." + ], + "type": "u8" }, { - name: "nftMeta"; - docs: ["An nft metadata account describing the game."]; - type: "publicKey"; + "name": "nftMeta", + "docs": [ + "An nft metadata account describing the game." + ], + "type": "publicKey" } - ]; - }; + ] + } }, { - name: "ScoreEntry"; - docs: ["A single score entry for a player."]; - type: { - kind: "struct"; - fields: [ + "name": "ScoreEntry", + "docs": [ + "A single score entry for a player." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "score"; - docs: ["The player's score."]; - type: "u64"; + "name": "score", + "docs": [ + "The player's score." + ], + "type": "u64" }, { - name: "timestamp"; - docs: ["When this entry was made."]; - type: "i64"; + "name": "timestamp", + "docs": [ + "When this entry was made." + ], + "type": "i64" } - ]; - }; + ] + } }, { - name: "MergeApproval"; - docs: [ + "name": "MergeApproval", + "docs": [ "Represents a [Player][super::Player] account involved in a merge", "and if that account's user/authority has granted approval." - ]; - type: { - kind: "struct"; - fields: [ + ], + "type": { + "kind": "struct", + "fields": [ { - name: "key"; - docs: ["The player_account pubkey."]; - type: "publicKey"; + "name": "key", + "docs": [ + "The player_account pubkey." + ], + "type": "publicKey" }, { - name: "approved"; - docs: ["User's approval status."]; - type: "bool"; + "name": "approved", + "docs": [ + "User's approval status." + ], + "type": "bool" } - ]; - }; + ] + } }, { - name: "LeaderBoardScore"; - docs: ["An single entry to a [LeaderTopEntries]."]; - type: { - kind: "struct"; - fields: [ + "name": "LeaderBoardScore", + "docs": [ + "An single entry to a [LeaderTopEntries]." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "player"; - docs: ["The player"]; - type: "publicKey"; + "name": "player", + "docs": [ + "The player" + ], + "type": "publicKey" }, { - name: "entry"; - docs: ["The user's [score][super::ScoreEntry]."]; - type: { - defined: "ScoreEntry"; - }; + "name": "entry", + "docs": [ + "The user's [score][super::ScoreEntry]." + ], + "type": { + "defined": "ScoreEntry" + } } - ]; - }; + ] + } }, { - name: "RegisterLeaderBoardInput"; - docs: ["Parameters needed when registering a leaderboard."]; - type: { - kind: "struct"; - fields: [ + "name": "RegisterLeaderBoardInput", + "docs": [ + "Parameters needed when registering a leaderboard." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "description"; - docs: ["Leaderboard description."]; - type: "string"; + "name": "description", + "docs": [ + "Leaderboard description." + ], + "type": "string" }, { - name: "nftMeta"; - docs: ["Nft metadata representing the leaderboard."]; - type: "publicKey"; + "name": "nftMeta", + "docs": [ + "Nft metadata representing the leaderboard." + ], + "type": "publicKey" }, { - name: "decimals"; - docs: [ + "name": "decimals", + "docs": [ "Specify the decimals score values are represented in. Defaults to `0` if [None]." - ]; - type: { - option: "u8"; - }; + ], + "type": { + "option": "u8" + } }, { - name: "minScore"; - docs: [ + "name": "minScore", + "docs": [ "Specifies minimum allowed score. Defaults to `u64::MIN` if [None]." - ]; - type: { - option: "u64"; - }; + ], + "type": { + "option": "u64" + } }, { - name: "maxScore"; - docs: [ + "name": "maxScore", + "docs": [ "Specifies maximum allowed score. Defaults to `u64::MAX` if [None]." - ]; - type: { - option: "u64"; - }; + ], + "type": { + "option": "u64" + } }, { - name: "scoresToRetain"; - docs: ["Number of top scores to store on-chain."]; - type: "u8"; + "name": "scoresToRetain", + "docs": [ + "Number of top scores to store on-chain." + ], + "type": "u8" }, { - name: "scoresOrder"; - docs: [ + "name": "scoresOrder", + "docs": [ "Order by which scores are stored. `true` for ascending, `false` for descending." - ]; - type: "bool"; + ], + "type": "bool" } - ]; - }; + ] + } }, { - name: "AddNewRewardInput"; - docs: ["Input to add a new reward for an achievement."]; - type: { - kind: "struct"; - fields: [ + "name": "AddNewRewardInput", + "docs": [ + "Input to add a new reward for an achievement." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "availableSpots"; - docs: ["Number of rewards to be given out."]; - type: "u64"; + "name": "availableSpots", + "docs": [ + "Number of rewards to be given out." + ], + "type": "u64" }, { - name: "kind"; - docs: ["Specific reward kind."]; - type: { - defined: "RewardKindInput"; - }; + "name": "kind", + "docs": [ + "Specific reward kind." + ], + "type": { + "defined": "RewardKindInput" + } } - ]; - }; + ] + } }, { - name: "GameType"; - type: { - kind: "enum"; - variants: [ + "name": "GameType", + "type": { + "kind": "enum", + "variants": [ { - name: "Mobile"; + "name": "Mobile" }, { - name: "Desktop"; + "name": "Desktop" }, { - name: "Web"; + "name": "Web" }, { - name: "Unspecified"; + "name": "Unspecified" } - ]; - }; + ] + } }, { - name: "Genre"; - type: { - kind: "enum"; - variants: [ + "name": "Genre", + "type": { + "kind": "enum", + "variants": [ { - name: "Rpg"; + "name": "Rpg" }, { - name: "Mmo"; + "name": "Mmo" }, { - name: "Action"; + "name": "Action" }, { - name: "Adventure"; + "name": "Adventure" }, { - name: "Puzzle"; + "name": "Puzzle" }, { - name: "Casual"; + "name": "Casual" }, { - name: "Unspecified"; + "name": "Unspecified" } - ]; - }; + ] + } }, { - name: "RewardKind"; - docs: ["The kind of reward to be given out."]; - type: { - kind: "enum"; - variants: [ + "name": "RewardKind", + "docs": [ + "The kind of reward to be given out." + ], + "type": { + "kind": "enum", + "variants": [ { - name: "FungibleToken"; - fields: [ + "name": "FungibleToken", + "fields": [ { - name: "mint"; - docs: ["The mint of the token to be given out."]; - type: "publicKey"; + "name": "mint", + "docs": [ + "The mint of the token to be given out." + ], + "type": "publicKey" }, { - name: "account"; - docs: ["The token account to withdraw from."]; - type: "publicKey"; + "name": "account", + "docs": [ + "The token account to withdraw from." + ], + "type": "publicKey" }, { - name: "amount"; - docs: ["Reward amount per user."]; - type: "u64"; + "name": "amount", + "docs": [ + "Reward amount per user." + ], + "type": "u64" } - ]; + ] }, { - name: "NonFungibleToken"; - fields: [ + "name": "NonFungibleToken", + "fields": [ { - name: "uri"; - docs: ["URI of the NFT to be minted."]; - type: "string"; + "name": "uri", + "docs": [ + "URI of the NFT to be minted." + ], + "type": "string" }, { - name: "name"; - docs: ["Name of the NFT to be minted."]; - type: "string"; + "name": "name", + "docs": [ + "Name of the NFT to be minted." + ], + "type": "string" }, { - name: "symbol"; - docs: ["Symbol of the NFT to be minted."]; - type: "string"; + "name": "symbol", + "docs": [ + "Symbol of the NFT to be minted." + ], + "type": "string" }, { - name: "minted"; - docs: ["Total NFTs minted so far."]; - type: "u64"; + "name": "minted", + "docs": [ + "Total NFTs minted so far." + ], + "type": "u64" }, { - name: "collection"; - docs: [ + "name": "collection", + "docs": [ "Optional field for a collection mint used for", "verifying minted rewards." - ]; - type: { - option: "publicKey"; - }; + ], + "type": { + "option": "publicKey" + } } - ]; + ] } - ]; - }; + ] + } }, { - name: "RewardKindInput"; - docs: ["Specific variant of [AddNewRewardInput]."]; - type: { - kind: "enum"; - variants: [ + "name": "RewardKindInput", + "docs": [ + "Specific variant of [AddNewRewardInput]." + ], + "type": { + "kind": "enum", + "variants": [ { - name: "Ft"; - fields: [ + "name": "Ft", + "fields": [ { - name: "deposit"; - docs: [ + "name": "deposit", + "docs": [ "Amount to be delegated to this program's PDA", "so it can spend for reward claims." - ]; - type: "u64"; + ], + "type": "u64" }, { - name: "amount"; - docs: ["Amount given to a single user."]; - type: "u64"; + "name": "amount", + "docs": [ + "Amount given to a single user." + ], + "type": "u64" } - ]; + ] }, { - name: "Nft"; - fields: [ + "name": "Nft", + "fields": [ { - name: "uri"; - docs: ["Uri of the minted nft."]; - type: "string"; + "name": "uri", + "docs": [ + "Uri of the minted nft." + ], + "type": "string" }, { - name: "name"; - docs: ["Name of the minted nft."]; - type: "string"; + "name": "name", + "docs": [ + "Name of the minted nft." + ], + "type": "string" }, { - name: "symbol"; - docs: ["Symbol of the minted nft."]; - type: "string"; + "name": "symbol", + "docs": [ + "Symbol of the minted nft." + ], + "type": "string" } - ]; + ] } - ]; - }; + ] + } } - ]; - errors: [ + ], + "errors": [ { - code: 6000; - name: "InvalidFieldLength"; - msg: "Exceeded max length for field."; + "code": 6000, + "name": "InvalidFieldLength", + "msg": "Exceeded max length for field." }, { - code: 6001; - name: "InvalidAuthority"; - msg: "Invalid authority for instruction"; + "code": 6001, + "name": "InvalidAuthority", + "msg": "Invalid authority for instruction" }, { - code: 6002; - name: "MissingSignature"; - msg: "An expected signature isn't present"; + "code": 6002, + "name": "MissingSignature", + "msg": "An expected signature isn't present" }, { - code: 6003; - name: "NoRewardForAchievement"; - msg: "Reward not specified for this achievement"; + "code": 6003, + "name": "NoRewardForAchievement", + "msg": "Reward not specified for this achievement" }, { - code: 6004; - name: "AccountNotPartOfMerge"; - msg: "The merge account does not include this player account"; + "code": 6004, + "name": "AccountNotPartOfMerge", + "msg": "The merge account does not include this player account" }, { - code: 6005; - name: "ScoreNotWithinBounds"; - msg: "Tried to input score that is below the minimum or above the maximum"; + "code": 6005, + "name": "ScoreNotWithinBounds", + "msg": "Tried to input score that is below the minimum or above the maximum" }, { - code: 6006; - name: "MissingExpectedAccount"; - msg: "An optional but expected account is missing"; + "code": 6006, + "name": "MissingExpectedAccount", + "msg": "An optional but expected account is missing" }, { - code: 6007; - name: "InvalidRewardKind"; - msg: "Invalid reward kind for this instruction"; + "code": 6007, + "name": "InvalidRewardKind", + "msg": "Invalid reward kind for this instruction" }, { - code: 6008; - name: "NoAvailableRewards"; - msg: "No more rewards are being given out for this game"; + "code": 6008, + "name": "NoAvailableRewards", + "msg": "No more rewards are being given out for this game" } - ]; + ] }; export const IDL: Soar = { - version: "0.1.0", - name: "soar", - constants: [ + "version": "0.1.0", + "name": "soar", + "constants": [ { - name: "MAX_TITLE_LEN", - type: { - defined: "usize", + "name": "MAX_TITLE_LEN", + "type": { + "defined": "usize" }, - value: "30", + "value": "30" }, { - name: "MAX_DESCRIPTION_LEN", - type: { - defined: "usize", + "name": "MAX_DESCRIPTION_LEN", + "type": { + "defined": "usize" }, - value: "200", - }, + "value": "200" + } ], - instructions: [ + "instructions": [ { - name: "initializeGame", - docs: ["Initialize a new [Game] and register its [LeaderBoard]."], - accounts: [ + "name": "initializeGame", + "docs": [ + "Initialize a new [Game] and register its [LeaderBoard]." + ], + "accounts": [ { - name: "creator", - isMut: true, - isSigner: true, + "name": "creator", + "isMut": true, + "isSigner": true }, { - name: "game", - isMut: true, - isSigner: true, + "name": "game", + "isMut": true, + "isSigner": true }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "gameMeta", - type: { - defined: "GameAttributes", - }, + "name": "gameMeta", + "type": { + "defined": "GameAttributes" + } }, { - name: "gameAuth", - type: { - vec: "publicKey", - }, - }, - ], + "name": "gameAuth", + "type": { + "vec": "publicKey" + } + } + ] }, { - name: "updateGame", - docs: ["Update a [Game]'s meta-information or authority list."], - accounts: [ + "name": "updateGame", + "docs": [ + "Update a [Game]'s meta-information or authority list." + ], + "accounts": [ { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game", - isMut: true, - isSigner: false, + "name": "game", + "isMut": true, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "newMeta", - type: { - option: { - defined: "GameAttributes", - }, - }, + "name": "newMeta", + "type": { + "option": { + "defined": "GameAttributes" + } + } }, { - name: "newAuth", - type: { - option: { - vec: "publicKey", - }, - }, - }, - ], + "name": "newAuth", + "type": { + "option": { + "vec": "publicKey" + } + } + } + ] }, { - name: "addAchievement", - docs: [ - "Add a new [Achievement] that can be attained for a particular [Game].", + "name": "addAchievement", + "docs": [ + "Add a new [Achievement] that can be attained for a particular [Game]." ], - accounts: [ + "accounts": [ { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game", - isMut: true, - isSigner: false, + "name": "game", + "isMut": true, + "isSigner": false }, { - name: "newAchievement", - isMut: true, - isSigner: false, + "name": "newAchievement", + "isMut": true, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "title", - type: "string", + "name": "title", + "type": "string" }, { - name: "description", - type: "string", + "name": "description", + "type": "string" }, { - name: "nftMeta", - type: "publicKey", - }, - ], + "name": "nftMeta", + "type": "publicKey" + } + ] }, { - name: "updateAchievement", - docs: ["Update an [Achievement]'s meta information."], - accounts: [ + "name": "updateAchievement", + "docs": [ + "Update an [Achievement]'s meta information." + ], + "accounts": [ { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement", - isMut: true, - isSigner: false, - }, + "name": "achievement", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: "newTitle", - type: { - option: "string", - }, + "name": "newTitle", + "type": { + "option": "string" + } }, { - name: "newDescription", - type: { - option: "string", - }, + "name": "newDescription", + "type": { + "option": "string" + } }, { - name: "nftMeta", - type: { - option: "publicKey", - }, - }, - ], + "name": "nftMeta", + "type": { + "option": "publicKey" + } + } + ] }, { - name: "addLeaderboard", - docs: ["Overwrite the active [LeaderBoard] and set a newly created one."], - accounts: [ + "name": "addLeaderboard", + "docs": [ + "Overwrite the active [LeaderBoard] and set a newly created one." + ], + "accounts": [ { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game", - isMut: true, - isSigner: false, + "name": "game", + "isMut": true, + "isSigner": false }, { - name: "leaderboard", - isMut: true, - isSigner: false, + "name": "leaderboard", + "isMut": true, + "isSigner": false }, { - name: "topEntries", - isMut: true, - isSigner: false, - isOptional: true, + "name": "topEntries", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "input", - type: { - defined: "RegisterLeaderBoardInput", - }, - }, - ], + "name": "input", + "type": { + "defined": "RegisterLeaderBoardInput" + } + } + ] }, { - name: "updateLeaderboard", - docs: [ - "Update's a leaderboard's description and nft metadata information.", + "name": "updateLeaderboard", + "docs": [ + "Update's a leaderboard's description and nft metadata information." ], - accounts: [ + "accounts": [ { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "leaderboard", - isMut: true, - isSigner: false, - }, + "name": "leaderboard", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: "newDescription", - type: { - option: "string", - }, + "name": "newDescription", + "type": { + "option": "string" + } }, { - name: "newNftMeta", - type: { - option: "publicKey", - }, - }, - ], + "name": "newNftMeta", + "type": { + "option": "publicKey" + } + } + ] }, { - name: "initializePlayer", - docs: ["Create a [Player] account for a particular user."], - accounts: [ + "name": "initializePlayer", + "docs": [ + "Create a [Player] account for a particular user." + ], + "accounts": [ { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "user", - isMut: false, - isSigner: true, + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount", - isMut: true, - isSigner: false, + "name": "playerAccount", + "isMut": true, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "username", - type: "string", + "name": "username", + "type": "string" }, { - name: "nftMeta", - type: "publicKey", - }, - ], + "name": "nftMeta", + "type": "publicKey" + } + ] }, { - name: "updatePlayer", - docs: ["Update the username or nft_meta for a [Player] account."], - accounts: [ + "name": "updatePlayer", + "docs": [ + "Update the username or nft_meta for a [Player] account." + ], + "accounts": [ { - name: "user", - isMut: false, - isSigner: true, + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount", - isMut: true, - isSigner: false, - }, + "name": "playerAccount", + "isMut": true, + "isSigner": false + } ], - args: [ + "args": [ { - name: "username", - type: { - option: "string", - }, + "name": "username", + "type": { + "option": "string" + } }, { - name: "nftMeta", - type: { - option: "publicKey", - }, - }, - ], + "name": "nftMeta", + "type": { + "option": "publicKey" + } + } + ] }, { - name: "registerPlayer", - docs: [ + "name": "registerPlayer", + "docs": [ "Register a [Player] for a particular [Leaderboard], resulting in a newly-", - "created [PlayerEntryList] account.", + "created [PlayerEntryList] account." ], - accounts: [ + "accounts": [ { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "user", - isMut: false, - isSigner: true, + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount", - isMut: false, - isSigner: false, + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "leaderboard", - isMut: false, - isSigner: false, + "name": "leaderboard", + "isMut": false, + "isSigner": false }, { - name: "newList", - isMut: true, - isSigner: false, + "name": "newList", + "isMut": true, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: "submitScore", - docs: [ + "name": "submitScore", + "docs": [ "Submit a score for a player and have it timestamped and added to the [PlayerEntryList].", "Optionally increase the player's rank if needed.", "", - "This instruction automatically resizes the [PlayerScoresList] account if needed.", + "This instruction automatically resizes the [PlayerScoresList] account if needed." ], - accounts: [ + "accounts": [ { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "playerAccount", - isMut: false, - isSigner: false, + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "leaderboard", - isMut: false, - isSigner: false, + "name": "leaderboard", + "isMut": false, + "isSigner": false }, { - name: "playerScores", - isMut: true, - isSigner: false, + "name": "playerScores", + "isMut": true, + "isSigner": false }, { - name: "topEntries", - isMut: true, - isSigner: false, - isOptional: true, + "name": "topEntries", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "score", - type: "u64", - }, - ], + "name": "score", + "type": "u64" + } + ] }, { - name: "initiateMerge", - docs: [ + "name": "initiateMerge", + "docs": [ "Initialize a new merge account and await approval from the verified users of all the", "specified [Player] accounts.", "", "A merge is complete when all the users of the [Player] account keys referenced in it", - "have signed to set their approval to `true`.", + "have signed to set their approval to `true`." ], - accounts: [ + "accounts": [ { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "user", - isMut: false, - isSigner: true, + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount", - isMut: false, - isSigner: false, + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "mergeAccount", - isMut: true, - isSigner: true, + "name": "mergeAccount", + "isMut": true, + "isSigner": true }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "keys", - type: { - vec: "publicKey", - }, - }, - ], + "name": "keys", + "type": { + "vec": "publicKey" + } + } + ] }, { - name: "approveMerge", - docs: [ - "Register merge confirmation for a particular [Player] account included in a [Merged].", + "name": "approveMerge", + "docs": [ + "Register merge confirmation for a particular [Player] account included in a [Merged]." ], - accounts: [ + "accounts": [ { - name: "user", - isMut: false, - isSigner: true, + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount", - isMut: false, - isSigner: false, + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "mergeAccount", - isMut: true, - isSigner: false, - }, + "name": "mergeAccount", + "isMut": true, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: "unlockPlayerAchievement", - docs: [ + "name": "unlockPlayerAchievement", + "docs": [ "Unlock a [PlayerAchievement] account without minting a reward.", "", "Used `ONLY` for custom rewards mechanism to setup a [PlayerAchievement] account that", @@ -2224,1194 +2368,1314 @@ export const IDL: Soar = { "", "Since claim instructions like [claim_ft_reward] and [claim_nft_reward] for reward types", "defined by this program try to initialize this account and will fail if it already exists,", - "calling this means opting out of using these functions.", + "calling this means opting out of using these functions." ], - accounts: [ + "accounts": [ { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "playerAccount", - isMut: false, - isSigner: false, + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement", - isMut: false, - isSigner: false, + "name": "achievement", + "isMut": false, + "isSigner": false }, { - name: "playerAchievement", - isMut: true, - isSigner: false, + "name": "playerAchievement", + "isMut": true, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: "addFtReward", - docs: [ + "name": "addFtReward", + "docs": [ "Add a fungible token [Reward] to an [Achievement] to mint to users on unlock.", "", - "Overwrites the current reward if one exists.", + "Overwrites the current reward if one exists." ], - accounts: [ + "accounts": [ { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement", - isMut: true, - isSigner: false, + "name": "achievement", + "isMut": true, + "isSigner": false }, { - name: "newReward", - isMut: true, - isSigner: true, + "name": "newReward", + "isMut": true, + "isSigner": true }, { - name: "rewardTokenMint", - isMut: false, - isSigner: false, + "name": "rewardTokenMint", + "isMut": false, + "isSigner": false }, { - name: "delegateFromTokenAccount", - isMut: true, - isSigner: false, + "name": "delegateFromTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "tokenAccountOwner", - isMut: false, - isSigner: true, + "name": "tokenAccountOwner", + "isMut": false, + "isSigner": true }, { - name: "tokenProgram", - isMut: false, - isSigner: false, + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "input", - type: { - defined: "AddNewRewardInput", - }, - }, - ], + "name": "input", + "type": { + "defined": "AddNewRewardInput" + } + } + ] }, { - name: "addNftReward", - docs: [ + "name": "addNftReward", + "docs": [ "Add a nft [Reward] to an [Achievement] to mint to users on unlock.", "", - "Overwrites the current reward if one exists.", + "Overwrites the current reward if one exists." ], - accounts: [ + "accounts": [ { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement", - isMut: true, - isSigner: false, + "name": "achievement", + "isMut": true, + "isSigner": false }, { - name: "newReward", - isMut: true, - isSigner: true, + "name": "newReward", + "isMut": true, + "isSigner": true }, { - name: "systemProgram", - isMut: false, - isSigner: false, + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: "rewardCollectionMint", - isMut: false, - isSigner: false, - isOptional: true, + "name": "rewardCollectionMint", + "isMut": false, + "isSigner": false, + "isOptional": true }, { - name: "collectionUpdateAuth", - isMut: false, - isSigner: true, - isOptional: true, + "name": "collectionUpdateAuth", + "isMut": false, + "isSigner": true, + "isOptional": true }, { - name: "collectionMetadata", - isMut: true, - isSigner: false, - isOptional: true, + "name": "collectionMetadata", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - name: "tokenMetadataProgram", - isMut: false, - isSigner: false, - isOptional: true, - }, + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false, + "isOptional": true + } ], - args: [ + "args": [ { - name: "input", - type: { - defined: "AddNewRewardInput", - }, - }, - ], + "name": "input", + "type": { + "defined": "AddNewRewardInput" + } + } + ] }, { - name: "claimFtReward", - docs: [ + "name": "claimFtReward", + "docs": [ "Mint an NFT reward for unlocking a [PlayerAchievement] account.", "", "This will attempt to create a [PlayerAchievement] account and fail if it already exists.", "", - "Relevant `ONLY` if an FT reward is specified for that achievement.", + "Relevant `ONLY` if an FT reward is specified for that achievement." ], - accounts: [ + "accounts": [ { - name: "user", - isMut: false, - isSigner: false, + "name": "user", + "isMut": false, + "isSigner": false }, { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement", - isMut: false, - isSigner: false, + "name": "achievement", + "isMut": false, + "isSigner": false }, { - name: "reward", - isMut: true, - isSigner: false, + "name": "reward", + "isMut": true, + "isSigner": false }, { - name: "playerAccount", - isMut: false, - isSigner: false, + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "playerAchievement", - isMut: true, - isSigner: false, + "name": "playerAchievement", + "isMut": true, + "isSigner": false }, { - name: "sourceTokenAccount", - isMut: true, - isSigner: false, + "name": "sourceTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "userTokenAccount", - isMut: true, - isSigner: false, + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "tokenProgram", - isMut: false, - isSigner: false, + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: "claimNftReward", - docs: [ + "name": "claimNftReward", + "docs": [ "Mint an NFT reward for unlocking a [PlayerAchievement] account.", "", "This will attempt to create a [PlayerAchievement] account and fail if it already exists.", "", - "Relevant `ONLY` if an NFT reward is specified for that achievement.", + "Relevant `ONLY` if an NFT reward is specified for that achievement." ], - accounts: [ + "accounts": [ { - name: "user", - isMut: false, - isSigner: false, + "name": "user", + "isMut": false, + "isSigner": false }, { - name: "authority", - isMut: false, - isSigner: true, + "name": "authority", + "isMut": false, + "isSigner": true }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "achievement", - isMut: false, - isSigner: false, + "name": "achievement", + "isMut": false, + "isSigner": false }, { - name: "reward", - isMut: true, - isSigner: false, + "name": "reward", + "isMut": true, + "isSigner": false }, { - name: "playerAccount", - isMut: false, - isSigner: false, + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "playerAchievement", - isMut: true, - isSigner: false, + "name": "playerAchievement", + "isMut": true, + "isSigner": false }, { - name: "claim", - isMut: true, - isSigner: false, + "name": "claim", + "isMut": true, + "isSigner": false }, { - name: "newMint", - isMut: true, - isSigner: true, + "name": "newMint", + "isMut": true, + "isSigner": true }, { - name: "newMetadata", - isMut: true, - isSigner: false, + "name": "newMetadata", + "isMut": true, + "isSigner": false }, { - name: "newMasterEdition", - isMut: true, - isSigner: false, + "name": "newMasterEdition", + "isMut": true, + "isSigner": false }, { - name: "mintTo", - isMut: true, - isSigner: false, + "name": "mintTo", + "isMut": true, + "isSigner": false }, { - name: "tokenMetadataProgram", - isMut: false, - isSigner: false, + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false }, { - name: "associatedTokenProgram", - isMut: false, - isSigner: false, + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: "tokenProgram", - isMut: false, - isSigner: false, + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: "rent", - isMut: false, - isSigner: false, - }, + "name": "rent", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: "verifyNftReward", - docs: [ + "name": "verifyNftReward", + "docs": [ "Verify NFT reward as belonging to a particular collection.", "", "Optional: Only relevant if an NFT reward is specified and the reward's", - "`collection_mint` is Some(...)", + "`collection_mint` is Some(...)" ], - accounts: [ + "accounts": [ { - name: "payer", - isMut: true, - isSigner: true, + "name": "payer", + "isMut": true, + "isSigner": true }, { - name: "game", - isMut: false, - isSigner: false, + "name": "game", + "isMut": false, + "isSigner": false }, { - name: "achievement", - isMut: false, - isSigner: false, + "name": "achievement", + "isMut": false, + "isSigner": false }, { - name: "reward", - isMut: false, - isSigner: false, + "name": "reward", + "isMut": false, + "isSigner": false }, { - name: "user", - isMut: false, - isSigner: true, + "name": "user", + "isMut": false, + "isSigner": true }, { - name: "playerAccount", - isMut: false, - isSigner: false, + "name": "playerAccount", + "isMut": false, + "isSigner": false }, { - name: "claim", - isMut: false, - isSigner: false, + "name": "claim", + "isMut": false, + "isSigner": false }, { - name: "playerAchievement", - isMut: false, - isSigner: false, + "name": "playerAchievement", + "isMut": false, + "isSigner": false }, { - name: "mint", - isMut: false, - isSigner: false, + "name": "mint", + "isMut": false, + "isSigner": false }, { - name: "metadataToVerify", - isMut: true, - isSigner: false, + "name": "metadataToVerify", + "isMut": true, + "isSigner": false }, { - name: "collectionMint", - isMut: false, - isSigner: false, + "name": "collectionMint", + "isMut": false, + "isSigner": false }, { - name: "collectionMetadata", - isMut: true, - isSigner: false, + "name": "collectionMetadata", + "isMut": true, + "isSigner": false }, { - name: "collectionEdition", - isMut: false, - isSigner: false, + "name": "collectionEdition", + "isMut": false, + "isSigner": false }, { - name: "tokenMetadataProgram", - isMut: false, - isSigner: false, - }, + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false + } ], - args: [], - }, + "args": [] + } ], - accounts: [ + "accounts": [ { - name: "achievement", - docs: [ + "name": "achievement", + "docs": [ "Represents an achievement(with optional rewards) for this game", "that can be attained by players.", "", - 'PDA with seeds = `[b"achievement", game.key().as_ref(), &id.to_le_bytes()]`', + "PDA with seeds = `[b\"achievement\", game.key().as_ref(), &id.to_le_bytes()]`", "", - "`id` is an incrementing index stored in the game account.", + "`id` is an incrementing index stored in the game account." ], - type: { - kind: "struct", - fields: [ + "type": { + "kind": "struct", + "fields": [ { - name: "game", - docs: [ - "Public key of the game account this achievement is derived from.", + "name": "game", + "docs": [ + "Public key of the game account this achievement is derived from." ], - type: "publicKey", + "type": "publicKey" }, { - name: "id", - docs: [ + "name": "id", + "docs": [ "The achievement_count of the game account when this account was", - "created, also used as a seed for its PDA.", + "created, also used as a seed for its PDA." ], - type: "u64", + "type": "u64" }, { - name: "title", - docs: ["Achievement title."], - type: "string", + "name": "title", + "docs": [ + "Achievement title." + ], + "type": "string" }, { - name: "description", - docs: ["Achievement description."], - type: "string", + "name": "description", + "docs": [ + "Achievement description." + ], + "type": "string" }, { - name: "nftMeta", - docs: [ - "Public key of a nft metadata account describing this achievement.", + "name": "nftMeta", + "docs": [ + "Public key of a nft metadata account describing this achievement." ], - type: "publicKey", + "type": "publicKey" }, { - name: "reward", - docs: [ - "Optional: Specify a reward to players for unlocking this achievement.", + "name": "reward", + "docs": [ + "Optional: Specify a reward to players for unlocking this achievement." ], - type: { - option: "publicKey", - }, - }, - ], - }, + "type": { + "option": "publicKey" + } + } + ] + } }, { - name: "game", - docs: ["An account representing a single game."], - type: { - kind: "struct", - fields: [ + "name": "game", + "docs": [ + "An account representing a single game." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "meta", - docs: ["Game meta-information."], - type: { - defined: "GameAttributes", - }, + "name": "meta", + "docs": [ + "Game meta-information." + ], + "type": { + "defined": "GameAttributes" + } }, { - name: "leaderboardCount", - docs: [ + "name": "leaderboardCount", + "docs": [ "Number of leaderboards this game has created. Used both", "in determining the most recent leaderboard address, and", - "as a seed for the next leaderboard.", + "as a seed for the next leaderboard." ], - type: "u64", + "type": "u64" }, { - name: "achievementCount", - docs: [ + "name": "achievementCount", + "docs": [ "Number of achievements that exist for this game. Also", - "used to determine the u64 seed for the next achievement.", + "used to determine the u64 seed for the next achievement." ], - type: "u64", + "type": "u64" }, { - name: "auth", - docs: [ + "name": "auth", + "docs": [ "A collection of pubkeys which each represent a valid", - "authority for this game.", + "authority for this game." ], - type: { - vec: "publicKey", - }, - }, - ], - }, + "type": { + "vec": "publicKey" + } + } + ] + } }, { - name: "leaderBoard", - docs: [ + "name": "leaderBoard", + "docs": [ "Represents a [Game][super::Game]'s leaderboard.", "", - 'Seeds: `[b"leaderboard", game.key().as_ref(), &id.to_le_bytes()]`', + "Seeds: `[b\"leaderboard\", game.key().as_ref(), &id.to_le_bytes()]`" ], - type: { - kind: "struct", - fields: [ + "type": { + "kind": "struct", + "fields": [ { - name: "id", - docs: [ - "The leaderboard's id, used in deriving its address from the game.", + "name": "id", + "docs": [ + "The leaderboard's id, used in deriving its address from the game." ], - type: "u64", + "type": "u64" }, { - name: "game", - docs: ["The game this leaderboard belongs to and is derived from."], - type: "publicKey", + "name": "game", + "docs": [ + "The game this leaderboard belongs to and is derived from." + ], + "type": "publicKey" }, { - name: "description", - docs: ["Leaderboard description."], - type: "string", + "name": "description", + "docs": [ + "Leaderboard description." + ], + "type": "string" }, { - name: "nftMeta", - docs: [ - "Pubkey of an nft metadata account that describes this leaderboard.", + "name": "nftMeta", + "docs": [ + "Pubkey of an nft metadata account that describes this leaderboard." ], - type: "publicKey", + "type": "publicKey" }, { - name: "decimals", - docs: ["Used to contextualize scores for this leaderboard."], - type: "u8", + "name": "decimals", + "docs": [ + "Used to contextualize scores for this leaderboard." + ], + "type": "u8" }, { - name: "minScore", - docs: ["Minimum possible score for this leaderboard."], - type: "u64", + "name": "minScore", + "docs": [ + "Minimum possible score for this leaderboard." + ], + "type": "u64" }, { - name: "maxScore", - docs: ["Maximum possible score for this leaderboard."], - type: "u64", + "name": "maxScore", + "docs": [ + "Maximum possible score for this leaderboard." + ], + "type": "u64" }, { - name: "topEntries", - docs: ["Top [entries](ScoreEntry) for a leaderboard."], - type: { - option: "publicKey", - }, - }, - ], - }, + "name": "topEntries", + "docs": [ + "Top [entries](ScoreEntry) for a leaderboard." + ], + "type": { + "option": "publicKey" + } + } + ] + } }, { - name: "merged", - docs: [ + "name": "merged", + "docs": [ "An account that represents a single user's ownership of", - "multiple [Player][super::Player] accounts.", + "multiple [Player][super::Player] accounts." ], - type: { - kind: "struct", - fields: [ + "type": { + "kind": "struct", + "fields": [ { - name: "initiator", - docs: ["The user that initialized this merge."], - type: "publicKey", + "name": "initiator", + "docs": [ + "The user that initialized this merge." + ], + "type": "publicKey" }, { - name: "approvals", - docs: [ - "Details of all the player accounts to be merged with the main_user's.", + "name": "approvals", + "docs": [ + "Details of all the player accounts to be merged with the main_user's." ], - type: { - vec: { - defined: "MergeApproval", - }, - }, + "type": { + "vec": { + "defined": "MergeApproval" + } + } }, { - name: "mergeComplete", - docs: [ - "Set to true when every user in `others` has registered their approval.", + "name": "mergeComplete", + "docs": [ + "Set to true when every user in `others` has registered their approval." ], - type: "bool", - }, - ], - }, + "type": "bool" + } + ] + } }, { - name: "playerAchievement", - docs: [ + "name": "playerAchievement", + "docs": [ "Represents a player's status for a particular [Achievement](super::Achievement).", "", - 'Seeds = `[b"player-achievement", player.key().as_ref(), achievement.key().as_ref()]`.', + "Seeds = `[b\"player-achievement\", player.key().as_ref(), achievement.key().as_ref()]`." ], - type: { - kind: "struct", - fields: [ + "type": { + "kind": "struct", + "fields": [ { - name: "playerAccount", - docs: ["The user's [player][super::Player] account."], - type: "publicKey", + "name": "playerAccount", + "docs": [ + "The user's [player][super::Player] account." + ], + "type": "publicKey" }, { - name: "achievement", - docs: ["The key of the achievement unlocked for this player."], - type: "publicKey", + "name": "achievement", + "docs": [ + "The key of the achievement unlocked for this player." + ], + "type": "publicKey" }, { - name: "timestamp", - docs: ["Timestamp showing when this achievement was unlocked."], - type: "i64", + "name": "timestamp", + "docs": [ + "Timestamp showing when this achievement was unlocked." + ], + "type": "i64" }, { - name: "unlocked", - docs: ["A player's unlock status for this achievement."], - type: "bool", + "name": "unlocked", + "docs": [ + "A player's unlock status for this achievement." + ], + "type": "bool" }, { - name: "claimed", - docs: ["Whether or not this player has claimed their reward."], - type: "bool", - }, - ], - }, + "name": "claimed", + "docs": [ + "Whether or not this player has claimed their reward." + ], + "type": "bool" + } + ] + } }, { - name: "playerScoresList", - docs: [ + "name": "playerScoresList", + "docs": [ "Holds a list of a [player][super::Player]'s [scores][ScoreEntry])", "for a particular [LeaderBoard].", "", - 'Seeds: `[b"player-scores-list", player_account.key().as_ref(), leaderboard.key().as_ref()]`', + "Seeds: `[b\"player-scores-list\", player_account.key().as_ref(), leaderboard.key().as_ref()]`" ], - type: { - kind: "struct", - fields: [ + "type": { + "kind": "struct", + "fields": [ { - name: "playerAccount", - docs: [ - "The player[super::Player] account this entry is derived from", + "name": "playerAccount", + "docs": [ + "The player[super::Player] account this entry is derived from" ], - type: "publicKey", + "type": "publicKey" }, { - name: "leaderboard", - docs: ["The id of the specific leaderboard."], - type: "publicKey", + "name": "leaderboard", + "docs": [ + "The id of the specific leaderboard." + ], + "type": "publicKey" }, { - name: "allocCount", - docs: [ - "Max number of [scores][ScoreEntry] the current space allocation supports.", + "name": "allocCount", + "docs": [ + "Max number of [scores][ScoreEntry] the current space allocation supports." ], - type: "u16", + "type": "u16" }, { - name: "scores", - docs: ["Collection of [scores][ScoreEntry]."], - type: { - vec: { - defined: "ScoreEntry", - }, - }, - }, - ], - }, + "name": "scores", + "docs": [ + "Collection of [scores][ScoreEntry]." + ], + "type": { + "vec": { + "defined": "ScoreEntry" + } + } + } + ] + } }, { - name: "player", - docs: [ + "name": "player", + "docs": [ "An account representing a player.", "", - 'Seeds: `[b"player", user.key().as_ref()]`', + "Seeds: `[b\"player\", user.key().as_ref()]`" ], - type: { - kind: "struct", - fields: [ + "type": { + "kind": "struct", + "fields": [ { - name: "user", - docs: ["The wallet that owns this player-info account"], - type: "publicKey", + "name": "user", + "docs": [ + "The wallet that owns this player-info account" + ], + "type": "publicKey" }, { - name: "username", - docs: ["The player's username."], - type: "string", + "name": "username", + "docs": [ + "The player's username." + ], + "type": "string" }, { - name: "nftMeta", - docs: ["Metadata to represent this player."], - type: "publicKey", - }, - ], - }, + "name": "nftMeta", + "docs": [ + "Metadata to represent this player." + ], + "type": "publicKey" + } + ] + } }, { - name: "nftClaim", - type: { - kind: "struct", - fields: [], - }, + "name": "nftClaim", + "type": { + "kind": "struct", + "fields": [] + } }, { - name: "reward", - docs: ["An account representing a reward for a given achievement."], - type: { - kind: "struct", - fields: [ + "name": "reward", + "docs": [ + "An account representing a reward for a given achievement." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "achievement", - docs: ["The achievement this reward is given for."], - type: "publicKey", + "name": "achievement", + "docs": [ + "The achievement this reward is given for." + ], + "type": "publicKey" }, { - name: "availableSpots", - docs: ["Number of available reward spots."], - type: "u64", + "name": "availableSpots", + "docs": [ + "Number of available reward spots." + ], + "type": "u64" }, { - name: "reward", - docs: [ - "The reward kind. Current supports Nft and Ft rewards only.", + "name": "reward", + "docs": [ + "The reward kind. Current supports Nft and Ft rewards only." ], - type: { - defined: "RewardKind", - }, - }, - ], - }, + "type": { + "defined": "RewardKind" + } + } + ] + } }, { - name: "leaderTopEntries", - docs: [ + "name": "leaderTopEntries", + "docs": [ "Keeps track of a sorted list of top scores for a leaderboard.", "", - 'Seeds = [b"top-scores", leaderboard.key().as_ref()]', + "Seeds = [b\"top-scores\", leaderboard.key().as_ref()]" ], - type: { - kind: "struct", - fields: [ + "type": { + "kind": "struct", + "fields": [ { - name: "isAscending", - docs: ["Arrangement order."], - type: "bool", + "name": "isAscending", + "docs": [ + "Arrangement order." + ], + "type": "bool" }, { - name: "topScores", - docs: ["Top scores."], - type: { - vec: { - defined: "LeaderBoardScore", - }, - }, - }, - ], - }, - }, + "name": "topScores", + "docs": [ + "Top scores." + ], + "type": { + "vec": { + "defined": "LeaderBoardScore" + } + } + } + ] + } + } ], - types: [ + "types": [ { - name: "GameAttributes", - docs: ["A type that represents game-specific information."], - type: { - kind: "struct", - fields: [ + "name": "GameAttributes", + "docs": [ + "A type that represents game-specific information." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "title", - docs: ["The title of the game, max length = 30 bytes."], - type: "string", + "name": "title", + "docs": [ + "The title of the game, max length = 30 bytes." + ], + "type": "string" }, { - name: "description", - docs: ["The game description, max length = 200 bytes."], - type: "string", + "name": "description", + "docs": [ + "The game description, max length = 200 bytes." + ], + "type": "string" }, { - name: "genre", - docs: ["The game's [genre](super::Genre), as a u8."], - type: "u8", + "name": "genre", + "docs": [ + "The game's [genre](super::Genre), as a u8." + ], + "type": "u8" }, { - name: "gameType", - docs: ["The game's [type](super::GameType), as a u8."], - type: "u8", + "name": "gameType", + "docs": [ + "The game's [type](super::GameType), as a u8." + ], + "type": "u8" }, { - name: "nftMeta", - docs: ["An nft metadata account describing the game."], - type: "publicKey", - }, - ], - }, + "name": "nftMeta", + "docs": [ + "An nft metadata account describing the game." + ], + "type": "publicKey" + } + ] + } }, { - name: "ScoreEntry", - docs: ["A single score entry for a player."], - type: { - kind: "struct", - fields: [ + "name": "ScoreEntry", + "docs": [ + "A single score entry for a player." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "score", - docs: ["The player's score."], - type: "u64", + "name": "score", + "docs": [ + "The player's score." + ], + "type": "u64" }, { - name: "timestamp", - docs: ["When this entry was made."], - type: "i64", - }, - ], - }, + "name": "timestamp", + "docs": [ + "When this entry was made." + ], + "type": "i64" + } + ] + } }, { - name: "MergeApproval", - docs: [ + "name": "MergeApproval", + "docs": [ "Represents a [Player][super::Player] account involved in a merge", - "and if that account's user/authority has granted approval.", + "and if that account's user/authority has granted approval." ], - type: { - kind: "struct", - fields: [ + "type": { + "kind": "struct", + "fields": [ { - name: "key", - docs: ["The player_account pubkey."], - type: "publicKey", + "name": "key", + "docs": [ + "The player_account pubkey." + ], + "type": "publicKey" }, { - name: "approved", - docs: ["User's approval status."], - type: "bool", - }, - ], - }, + "name": "approved", + "docs": [ + "User's approval status." + ], + "type": "bool" + } + ] + } }, { - name: "LeaderBoardScore", - docs: ["An single entry to a [LeaderTopEntries]."], - type: { - kind: "struct", - fields: [ + "name": "LeaderBoardScore", + "docs": [ + "An single entry to a [LeaderTopEntries]." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "player", - docs: ["The player"], - type: "publicKey", + "name": "player", + "docs": [ + "The player" + ], + "type": "publicKey" }, { - name: "entry", - docs: ["The user's [score][super::ScoreEntry]."], - type: { - defined: "ScoreEntry", - }, - }, - ], - }, + "name": "entry", + "docs": [ + "The user's [score][super::ScoreEntry]." + ], + "type": { + "defined": "ScoreEntry" + } + } + ] + } }, { - name: "RegisterLeaderBoardInput", - docs: ["Parameters needed when registering a leaderboard."], - type: { - kind: "struct", - fields: [ + "name": "RegisterLeaderBoardInput", + "docs": [ + "Parameters needed when registering a leaderboard." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "description", - docs: ["Leaderboard description."], - type: "string", + "name": "description", + "docs": [ + "Leaderboard description." + ], + "type": "string" }, { - name: "nftMeta", - docs: ["Nft metadata representing the leaderboard."], - type: "publicKey", + "name": "nftMeta", + "docs": [ + "Nft metadata representing the leaderboard." + ], + "type": "publicKey" }, { - name: "decimals", - docs: [ - "Specify the decimals score values are represented in. Defaults to `0` if [None].", + "name": "decimals", + "docs": [ + "Specify the decimals score values are represented in. Defaults to `0` if [None]." ], - type: { - option: "u8", - }, + "type": { + "option": "u8" + } }, { - name: "minScore", - docs: [ - "Specifies minimum allowed score. Defaults to `u64::MIN` if [None].", + "name": "minScore", + "docs": [ + "Specifies minimum allowed score. Defaults to `u64::MIN` if [None]." ], - type: { - option: "u64", - }, + "type": { + "option": "u64" + } }, { - name: "maxScore", - docs: [ - "Specifies maximum allowed score. Defaults to `u64::MAX` if [None].", + "name": "maxScore", + "docs": [ + "Specifies maximum allowed score. Defaults to `u64::MAX` if [None]." ], - type: { - option: "u64", - }, + "type": { + "option": "u64" + } }, { - name: "scoresToRetain", - docs: ["Number of top scores to store on-chain."], - type: "u8", + "name": "scoresToRetain", + "docs": [ + "Number of top scores to store on-chain." + ], + "type": "u8" }, { - name: "scoresOrder", - docs: [ - "Order by which scores are stored. `true` for ascending, `false` for descending.", + "name": "scoresOrder", + "docs": [ + "Order by which scores are stored. `true` for ascending, `false` for descending." ], - type: "bool", - }, - ], - }, + "type": "bool" + } + ] + } }, { - name: "AddNewRewardInput", - docs: ["Input to add a new reward for an achievement."], - type: { - kind: "struct", - fields: [ + "name": "AddNewRewardInput", + "docs": [ + "Input to add a new reward for an achievement." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "availableSpots", - docs: ["Number of rewards to be given out."], - type: "u64", + "name": "availableSpots", + "docs": [ + "Number of rewards to be given out." + ], + "type": "u64" }, { - name: "kind", - docs: ["Specific reward kind."], - type: { - defined: "RewardKindInput", - }, - }, - ], - }, + "name": "kind", + "docs": [ + "Specific reward kind." + ], + "type": { + "defined": "RewardKindInput" + } + } + ] + } }, { - name: "GameType", - type: { - kind: "enum", - variants: [ + "name": "GameType", + "type": { + "kind": "enum", + "variants": [ { - name: "Mobile", + "name": "Mobile" }, { - name: "Desktop", + "name": "Desktop" }, { - name: "Web", + "name": "Web" }, { - name: "Unspecified", - }, - ], - }, + "name": "Unspecified" + } + ] + } }, { - name: "Genre", - type: { - kind: "enum", - variants: [ + "name": "Genre", + "type": { + "kind": "enum", + "variants": [ { - name: "Rpg", + "name": "Rpg" }, { - name: "Mmo", + "name": "Mmo" }, { - name: "Action", + "name": "Action" }, { - name: "Adventure", + "name": "Adventure" }, { - name: "Puzzle", + "name": "Puzzle" }, { - name: "Casual", + "name": "Casual" }, { - name: "Unspecified", - }, - ], - }, + "name": "Unspecified" + } + ] + } }, { - name: "RewardKind", - docs: ["The kind of reward to be given out."], - type: { - kind: "enum", - variants: [ + "name": "RewardKind", + "docs": [ + "The kind of reward to be given out." + ], + "type": { + "kind": "enum", + "variants": [ { - name: "FungibleToken", - fields: [ + "name": "FungibleToken", + "fields": [ { - name: "mint", - docs: ["The mint of the token to be given out."], - type: "publicKey", + "name": "mint", + "docs": [ + "The mint of the token to be given out." + ], + "type": "publicKey" }, { - name: "account", - docs: ["The token account to withdraw from."], - type: "publicKey", + "name": "account", + "docs": [ + "The token account to withdraw from." + ], + "type": "publicKey" }, { - name: "amount", - docs: ["Reward amount per user."], - type: "u64", - }, - ], + "name": "amount", + "docs": [ + "Reward amount per user." + ], + "type": "u64" + } + ] }, { - name: "NonFungibleToken", - fields: [ + "name": "NonFungibleToken", + "fields": [ { - name: "uri", - docs: ["URI of the NFT to be minted."], - type: "string", + "name": "uri", + "docs": [ + "URI of the NFT to be minted." + ], + "type": "string" }, { - name: "name", - docs: ["Name of the NFT to be minted."], - type: "string", + "name": "name", + "docs": [ + "Name of the NFT to be minted." + ], + "type": "string" }, { - name: "symbol", - docs: ["Symbol of the NFT to be minted."], - type: "string", + "name": "symbol", + "docs": [ + "Symbol of the NFT to be minted." + ], + "type": "string" }, { - name: "minted", - docs: ["Total NFTs minted so far."], - type: "u64", + "name": "minted", + "docs": [ + "Total NFTs minted so far." + ], + "type": "u64" }, { - name: "collection", - docs: [ + "name": "collection", + "docs": [ "Optional field for a collection mint used for", - "verifying minted rewards.", + "verifying minted rewards." ], - type: { - option: "publicKey", - }, - }, - ], - }, - ], - }, + "type": { + "option": "publicKey" + } + } + ] + } + ] + } }, { - name: "RewardKindInput", - docs: ["Specific variant of [AddNewRewardInput]."], - type: { - kind: "enum", - variants: [ + "name": "RewardKindInput", + "docs": [ + "Specific variant of [AddNewRewardInput]." + ], + "type": { + "kind": "enum", + "variants": [ { - name: "Ft", - fields: [ + "name": "Ft", + "fields": [ { - name: "deposit", - docs: [ + "name": "deposit", + "docs": [ "Amount to be delegated to this program's PDA", - "so it can spend for reward claims.", + "so it can spend for reward claims." ], - type: "u64", + "type": "u64" }, { - name: "amount", - docs: ["Amount given to a single user."], - type: "u64", - }, - ], + "name": "amount", + "docs": [ + "Amount given to a single user." + ], + "type": "u64" + } + ] }, { - name: "Nft", - fields: [ + "name": "Nft", + "fields": [ { - name: "uri", - docs: ["Uri of the minted nft."], - type: "string", + "name": "uri", + "docs": [ + "Uri of the minted nft." + ], + "type": "string" }, { - name: "name", - docs: ["Name of the minted nft."], - type: "string", + "name": "name", + "docs": [ + "Name of the minted nft." + ], + "type": "string" }, { - name: "symbol", - docs: ["Symbol of the minted nft."], - type: "string", - }, - ], - }, - ], - }, - }, + "name": "symbol", + "docs": [ + "Symbol of the minted nft." + ], + "type": "string" + } + ] + } + ] + } + } ], - errors: [ + "errors": [ { - code: 6000, - name: "InvalidFieldLength", - msg: "Exceeded max length for field.", + "code": 6000, + "name": "InvalidFieldLength", + "msg": "Exceeded max length for field." }, { - code: 6001, - name: "InvalidAuthority", - msg: "Invalid authority for instruction", + "code": 6001, + "name": "InvalidAuthority", + "msg": "Invalid authority for instruction" }, { - code: 6002, - name: "MissingSignature", - msg: "An expected signature isn't present", + "code": 6002, + "name": "MissingSignature", + "msg": "An expected signature isn't present" }, { - code: 6003, - name: "NoRewardForAchievement", - msg: "Reward not specified for this achievement", + "code": 6003, + "name": "NoRewardForAchievement", + "msg": "Reward not specified for this achievement" }, { - code: 6004, - name: "AccountNotPartOfMerge", - msg: "The merge account does not include this player account", + "code": 6004, + "name": "AccountNotPartOfMerge", + "msg": "The merge account does not include this player account" }, { - code: 6005, - name: "ScoreNotWithinBounds", - msg: "Tried to input score that is below the minimum or above the maximum", + "code": 6005, + "name": "ScoreNotWithinBounds", + "msg": "Tried to input score that is below the minimum or above the maximum" }, { - code: 6006, - name: "MissingExpectedAccount", - msg: "An optional but expected account is missing", + "code": 6006, + "name": "MissingExpectedAccount", + "msg": "An optional but expected account is missing" }, { - code: 6007, - name: "InvalidRewardKind", - msg: "Invalid reward kind for this instruction", + "code": 6007, + "name": "InvalidRewardKind", + "msg": "Invalid reward kind for this instruction" }, { - code: 6008, - name: "NoAvailableRewards", - msg: "No more rewards are being given out for this game", - }, - ], + "code": 6008, + "name": "NoAvailableRewards", + "msg": "No more rewards are being given out for this game" + } + ] }; diff --git a/client/sdk/src/idl/tens.ts b/client/sdk/src/idl/tens.ts index 58bd267..b3ce2a1 100644 --- a/client/sdk/src/idl/tens.ts +++ b/client/sdk/src/idl/tens.ts @@ -1,433 +1,457 @@ -export interface Tens { - version: "0.1.0"; - name: "tens"; - instructions: [ +export type Tens = { + "version": "0.1.0", + "name": "tens", + "instructions": [ { - name: "register"; - accounts: [ + "name": "register", + "accounts": [ { - name: "signer"; - isMut: true; - isSigner: true; + "name": "signer", + "isMut": true, + "isSigner": true }, { - name: "tensState"; - isMut: true; - isSigner: false; + "name": "tensState", + "isMut": true, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: [ + ], + "args": [ { - name: "soarState"; - type: "publicKey"; + "name": "soarState", + "type": "publicKey" }, { - name: "soarLeaderboard"; - type: "publicKey"; + "name": "soarLeaderboard", + "type": "publicKey" }, { - name: "soarLeaderboardTopEntries"; - type: "publicKey"; + "name": "soarLeaderboardTopEntries", + "type": "publicKey" } - ]; + ] }, { - name: "makeMove"; - accounts: [ + "name": "makeMove", + "accounts": [ { - name: "user"; - isMut: true; - isSigner: true; + "name": "user", + "isMut": true, + "isSigner": true }, { - name: "tensState"; - isMut: true; - isSigner: false; + "name": "tensState", + "isMut": true, + "isSigner": false }, { - name: "soarState"; - isMut: false; - isSigner: false; + "name": "soarState", + "isMut": false, + "isSigner": false }, { - name: "soarLeaderboard"; - isMut: false; - isSigner: false; + "name": "soarLeaderboard", + "isMut": false, + "isSigner": false }, { - name: "soarPlayerAccount"; - isMut: false; - isSigner: false; + "name": "soarPlayerAccount", + "isMut": false, + "isSigner": false }, { - name: "soarPlayerScores"; - isMut: true; - isSigner: false; + "name": "soarPlayerScores", + "isMut": true, + "isSigner": false }, { - name: "soarTopEntries"; - isMut: true; - isSigner: false; - isOptional: true; + "name": "soarTopEntries", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - name: "soarProgram"; - isMut: false; - isSigner: false; + "name": "soarProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false } - ]; - args: []; + ], + "args": [] }, { - name: "claimReward"; - accounts: [ + "name": "claimReward", + "accounts": [ { - name: "user"; - isMut: true; - isSigner: true; + "name": "user", + "isMut": true, + "isSigner": true }, { - name: "tensState"; - isMut: true; - isSigner: false; + "name": "tensState", + "isMut": true, + "isSigner": false }, { - name: "playerAccount"; - isMut: true; - isSigner: false; + "name": "playerAccount", + "isMut": true, + "isSigner": false }, { - name: "soarPlayerScores"; - isMut: false; - isSigner: false; + "name": "soarPlayerScores", + "isMut": false, + "isSigner": false }, { - name: "soarTopEntries"; - isMut: false; - isSigner: false; + "name": "soarTopEntries", + "isMut": false, + "isSigner": false }, { - name: "soarState"; - isMut: false; - isSigner: false; + "name": "soarState", + "isMut": false, + "isSigner": false }, { - name: "soarAchievement"; - isMut: false; - isSigner: false; + "name": "soarAchievement", + "isMut": false, + "isSigner": false }, { - name: "soarReward"; - isMut: true; - isSigner: false; + "name": "soarReward", + "isMut": true, + "isSigner": false }, { - name: "soarPlayerAchievement"; - isMut: true; - isSigner: false; + "name": "soarPlayerAchievement", + "isMut": true, + "isSigner": false }, { - name: "sourceTokenAccount"; - isMut: true; - isSigner: false; + "name": "sourceTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "userTokenAccount"; - isMut: true; - isSigner: false; + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "tokenProgram"; - isMut: false; - isSigner: false; + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram"; - isMut: false; - isSigner: false; + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: "soarProgram"; - isMut: false; - isSigner: false; + "name": "soarProgram", + "isMut": false, + "isSigner": false } - ]; - args: []; + ], + "args": [] } - ]; - accounts: [ + ], + "accounts": [ { - name: "tens"; - docs: ["A simple game."]; - type: { - kind: "struct"; - fields: [ + "name": "tens", + "docs": [ + "A simple game." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "counter"; - docs: ["The game counter."]; - type: "u64"; + "name": "counter", + "docs": [ + "The game counter." + ], + "type": "u64" }, { - name: "soar"; - docs: ["The SOAR keys for this program."]; - type: { - defined: "SoarKeysStorage"; - }; + "name": "soar", + "docs": [ + "The SOAR keys for this program." + ], + "type": { + "defined": "SoarKeysStorage" + } } - ]; - }; + ] + } } - ]; - types: [ + ], + "types": [ { - name: "SoarKeysStorage"; - type: { - kind: "struct"; - fields: [ + "name": "SoarKeysStorage", + "type": { + "kind": "struct", + "fields": [ { - name: "state"; - docs: ["The soar state for this game."]; - type: "publicKey"; + "name": "state", + "docs": [ + "The soar state for this game." + ], + "type": "publicKey" }, { - name: "leaderboard"; - docs: ["The soar leaderboard for this game."]; - type: "publicKey"; + "name": "leaderboard", + "docs": [ + "The soar leaderboard for this game." + ], + "type": "publicKey" }, { - name: "topEntries"; - docs: ["The soar top-entries account for this game."]; - type: "publicKey"; + "name": "topEntries", + "docs": [ + "The soar top-entries account for this game." + ], + "type": "publicKey" } - ]; - }; + ] + } } - ]; -} + ] +}; export const IDL: Tens = { - version: "0.1.0", - name: "tens", - instructions: [ + "version": "0.1.0", + "name": "tens", + "instructions": [ { - name: "register", - accounts: [ + "name": "register", + "accounts": [ { - name: "signer", - isMut: true, - isSigner: true, + "name": "signer", + "isMut": true, + "isSigner": true }, { - name: "tensState", - isMut: true, - isSigner: false, + "name": "tensState", + "isMut": true, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [ + "args": [ { - name: "soarState", - type: "publicKey", + "name": "soarState", + "type": "publicKey" }, { - name: "soarLeaderboard", - type: "publicKey", + "name": "soarLeaderboard", + "type": "publicKey" }, { - name: "soarLeaderboardTopEntries", - type: "publicKey", - }, - ], + "name": "soarLeaderboardTopEntries", + "type": "publicKey" + } + ] }, { - name: "makeMove", - accounts: [ + "name": "makeMove", + "accounts": [ { - name: "user", - isMut: true, - isSigner: true, + "name": "user", + "isMut": true, + "isSigner": true }, { - name: "tensState", - isMut: true, - isSigner: false, + "name": "tensState", + "isMut": true, + "isSigner": false }, { - name: "soarState", - isMut: false, - isSigner: false, + "name": "soarState", + "isMut": false, + "isSigner": false }, { - name: "soarLeaderboard", - isMut: false, - isSigner: false, + "name": "soarLeaderboard", + "isMut": false, + "isSigner": false }, { - name: "soarPlayerAccount", - isMut: false, - isSigner: false, + "name": "soarPlayerAccount", + "isMut": false, + "isSigner": false }, { - name: "soarPlayerScores", - isMut: true, - isSigner: false, + "name": "soarPlayerScores", + "isMut": true, + "isSigner": false }, { - name: "soarTopEntries", - isMut: true, - isSigner: false, - isOptional: true, + "name": "soarTopEntries", + "isMut": true, + "isSigner": false, + "isOptional": true }, { - name: "soarProgram", - isMut: false, - isSigner: false, + "name": "soarProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, - }, + "name": "systemProgram", + "isMut": false, + "isSigner": false + } ], - args: [], + "args": [] }, { - name: "claimReward", - accounts: [ + "name": "claimReward", + "accounts": [ { - name: "user", - isMut: true, - isSigner: true, + "name": "user", + "isMut": true, + "isSigner": true }, { - name: "tensState", - isMut: true, - isSigner: false, + "name": "tensState", + "isMut": true, + "isSigner": false }, { - name: "playerAccount", - isMut: true, - isSigner: false, + "name": "playerAccount", + "isMut": true, + "isSigner": false }, { - name: "soarPlayerScores", - isMut: false, - isSigner: false, + "name": "soarPlayerScores", + "isMut": false, + "isSigner": false }, { - name: "soarTopEntries", - isMut: false, - isSigner: false, + "name": "soarTopEntries", + "isMut": false, + "isSigner": false }, { - name: "soarState", - isMut: false, - isSigner: false, + "name": "soarState", + "isMut": false, + "isSigner": false }, { - name: "soarAchievement", - isMut: false, - isSigner: false, + "name": "soarAchievement", + "isMut": false, + "isSigner": false }, { - name: "soarReward", - isMut: true, - isSigner: false, + "name": "soarReward", + "isMut": true, + "isSigner": false }, { - name: "soarPlayerAchievement", - isMut: true, - isSigner: false, + "name": "soarPlayerAchievement", + "isMut": true, + "isSigner": false }, { - name: "sourceTokenAccount", - isMut: true, - isSigner: false, + "name": "sourceTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "userTokenAccount", - isMut: true, - isSigner: false, + "name": "userTokenAccount", + "isMut": true, + "isSigner": false }, { - name: "tokenProgram", - isMut: false, - isSigner: false, + "name": "tokenProgram", + "isMut": false, + "isSigner": false }, { - name: "systemProgram", - isMut: false, - isSigner: false, + "name": "systemProgram", + "isMut": false, + "isSigner": false }, { - name: "soarProgram", - isMut: false, - isSigner: false, - }, + "name": "soarProgram", + "isMut": false, + "isSigner": false + } ], - args: [], - }, + "args": [] + } ], - accounts: [ + "accounts": [ { - name: "tens", - docs: ["A simple game."], - type: { - kind: "struct", - fields: [ + "name": "tens", + "docs": [ + "A simple game." + ], + "type": { + "kind": "struct", + "fields": [ { - name: "counter", - docs: ["The game counter."], - type: "u64", + "name": "counter", + "docs": [ + "The game counter." + ], + "type": "u64" }, { - name: "soar", - docs: ["The SOAR keys for this program."], - type: { - defined: "SoarKeysStorage", - }, - }, - ], - }, - }, + "name": "soar", + "docs": [ + "The SOAR keys for this program." + ], + "type": { + "defined": "SoarKeysStorage" + } + } + ] + } + } ], - types: [ + "types": [ { - name: "SoarKeysStorage", - type: { - kind: "struct", - fields: [ + "name": "SoarKeysStorage", + "type": { + "kind": "struct", + "fields": [ { - name: "state", - docs: ["The soar state for this game."], - type: "publicKey", + "name": "state", + "docs": [ + "The soar state for this game." + ], + "type": "publicKey" }, { - name: "leaderboard", - docs: ["The soar leaderboard for this game."], - type: "publicKey", + "name": "leaderboard", + "docs": [ + "The soar leaderboard for this game." + ], + "type": "publicKey" }, { - name: "topEntries", - docs: ["The soar top-entries account for this game."], - type: "publicKey", - }, - ], - }, - }, - ], + "name": "topEntries", + "docs": [ + "The soar top-entries account for this game." + ], + "type": "publicKey" + } + ] + } + } + ] }; diff --git a/crates/soar-cpi/Cargo.toml b/crates/soar-cpi/Cargo.toml index 5b16e1c..eaf078a 100644 --- a/crates/soar-cpi/Cargo.toml +++ b/crates/soar-cpi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soar-cpi" -version = "0.1.3" +version = "0.1.4" edition = "2021" include = ["src/**/*", "idl.json"] description = "CPI helpers for the SOAR program" diff --git a/crates/soar-cpi/src/lib.rs b/crates/soar-cpi/src/lib.rs index 6898723..a2be6ef 100644 --- a/crates/soar-cpi/src/lib.rs +++ b/crates/soar-cpi/src/lib.rs @@ -2,4 +2,4 @@ use anchor_lang::declare_id; use clockwork_anchor_gen::generate_cpi_interface; generate_cpi_interface!(idl_path = "idl.json"); -declare_id!("SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU"); +declare_id!("SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk"); diff --git a/examples/tens/src/lib.rs b/examples/tens/src/lib.rs index d06bb48..d347d60 100644 --- a/examples/tens/src/lib.rs +++ b/examples/tens/src/lib.rs @@ -5,7 +5,7 @@ use soar::cpi::accounts::{ClaimFtReward, SubmitScore}; use soar::cpi::{self}; use soar::{LeaderTopEntries, PlayerScoresList}; -declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); +declare_id!("Tensgwm3DY3UJ8nhF7xnD2Wo65VcnLTXjjoyEvs6Zyk"); #[program] mod tens { diff --git a/programs/soar/src/lib.rs b/programs/soar/src/lib.rs index 7b1a847..aef1de3 100644 --- a/programs/soar/src/lib.rs +++ b/programs/soar/src/lib.rs @@ -7,7 +7,7 @@ use anchor_spl::token::{Mint, Token, TokenAccount}; #[cfg(not(feature = "no-entrypoint"))] use solana_security_txt::security_txt; -declare_id!("SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU"); +declare_id!("SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk"); mod error; mod instructions; diff --git a/readme.md b/readme.md index 13847e5..daaad62 100644 --- a/readme.md +++ b/readme.md @@ -56,7 +56,7 @@ For detailed usage instructions, API reference, and examples, refer to the SOAR ## :floppy_disk: Program -The program is available at [SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU](https://solscan.io/account/SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU#anchorProgramIDL) +The program is available at [SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk](https://solscan.io/account/SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk#anchorProgramIDL) ## 🤝 Contributing Contributions to SOAR are welcome! To contribute, please follow the guidelines outlined in [CONTRIBUTING.md](https://github.com/magicblock-labs/Solana.Unity-SDK/blob/main/CONTRIBUTING.md). From 7fa2830fe8ef5424c6b3ad6da5046d2e557e1b8d Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Mon, 6 Nov 2023 23:42:52 +0100 Subject: [PATCH 2/4] :recycle: Code Refactor --- client/sdk/src/idl/soar.ts | 4574 +++++++++++++++++------------------- client/sdk/src/idl/tens.ts | 580 +++-- 2 files changed, 2433 insertions(+), 2721 deletions(-) diff --git a/client/sdk/src/idl/soar.ts b/client/sdk/src/idl/soar.ts index df8bf9c..c7765ba 100644 --- a/client/sdk/src/idl/soar.ts +++ b/client/sdk/src/idl/soar.ts @@ -1,525 +1,513 @@ export type Soar = { - "version": "0.1.0", - "name": "soar", - "constants": [ - { - "name": "MAX_TITLE_LEN", - "type": { - "defined": "usize" - }, - "value": "30" - }, - { - "name": "MAX_DESCRIPTION_LEN", - "type": { - "defined": "usize" - }, - "value": "200" + version: "0.1.0"; + name: "soar"; + constants: [ + { + name: "MAX_TITLE_LEN"; + type: { + defined: "usize"; + }; + value: "30"; + }, + { + name: "MAX_DESCRIPTION_LEN"; + type: { + defined: "usize"; + }; + value: "200"; } - ], - "instructions": [ + ]; + instructions: [ { - "name": "initializeGame", - "docs": [ - "Initialize a new [Game] and register its [LeaderBoard]." - ], - "accounts": [ + name: "initializeGame"; + docs: ["Initialize a new [Game] and register its [LeaderBoard]."]; + accounts: [ { - "name": "creator", - "isMut": true, - "isSigner": true + name: "creator"; + isMut: true; + isSigner: true; }, { - "name": "game", - "isMut": true, - "isSigner": true + name: "game"; + isMut: true; + isSigner: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "gameMeta", - "type": { - "defined": "GameAttributes" - } + name: "gameMeta"; + type: { + defined: "GameAttributes"; + }; }, { - "name": "gameAuth", - "type": { - "vec": "publicKey" - } + name: "gameAuth"; + type: { + vec: "publicKey"; + }; } - ] + ]; }, { - "name": "updateGame", - "docs": [ - "Update a [Game]'s meta-information or authority list." - ], - "accounts": [ + name: "updateGame"; + docs: ["Update a [Game]'s meta-information or authority list."]; + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "game", - "isMut": true, - "isSigner": false + name: "game"; + isMut: true; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ - { - "name": "newMeta", - "type": { - "option": { - "defined": "GameAttributes" - } - } - }, - { - "name": "newAuth", - "type": { - "option": { - "vec": "publicKey" - } - } + ]; + args: [ + { + name: "newMeta"; + type: { + option: { + defined: "GameAttributes"; + }; + }; + }, + { + name: "newAuth"; + type: { + option: { + vec: "publicKey"; + }; + }; } - ] + ]; }, { - "name": "addAchievement", - "docs": [ + name: "addAchievement"; + docs: [ "Add a new [Achievement] that can be attained for a particular [Game]." - ], - "accounts": [ + ]; + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "game", - "isMut": true, - "isSigner": false + name: "game"; + isMut: true; + isSigner: false; }, { - "name": "newAchievement", - "isMut": true, - "isSigner": false + name: "newAchievement"; + isMut: true; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "title", - "type": "string" + name: "title"; + type: "string"; }, { - "name": "description", - "type": "string" + name: "description"; + type: "string"; }, { - "name": "nftMeta", - "type": "publicKey" + name: "nftMeta"; + type: "publicKey"; } - ] + ]; }, { - "name": "updateAchievement", - "docs": [ - "Update an [Achievement]'s meta information." - ], - "accounts": [ + name: "updateAchievement"; + docs: ["Update an [Achievement]'s meta information."]; + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "achievement", - "isMut": true, - "isSigner": false + name: "achievement"; + isMut: true; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "newTitle", - "type": { - "option": "string" - } + name: "newTitle"; + type: { + option: "string"; + }; }, { - "name": "newDescription", - "type": { - "option": "string" - } + name: "newDescription"; + type: { + option: "string"; + }; }, { - "name": "nftMeta", - "type": { - "option": "publicKey" - } + name: "nftMeta"; + type: { + option: "publicKey"; + }; } - ] + ]; }, { - "name": "addLeaderboard", - "docs": [ - "Overwrite the active [LeaderBoard] and set a newly created one." - ], - "accounts": [ + name: "addLeaderboard"; + docs: ["Overwrite the active [LeaderBoard] and set a newly created one."]; + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "game", - "isMut": true, - "isSigner": false + name: "game"; + isMut: true; + isSigner: false; }, { - "name": "leaderboard", - "isMut": true, - "isSigner": false + name: "leaderboard"; + isMut: true; + isSigner: false; }, { - "name": "topEntries", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "topEntries"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "input", - "type": { - "defined": "RegisterLeaderBoardInput" - } + name: "input"; + type: { + defined: "RegisterLeaderBoardInput"; + }; } - ] + ]; }, { - "name": "updateLeaderboard", - "docs": [ + name: "updateLeaderboard"; + docs: [ "Update's a leaderboard's description and nft metadata information." - ], - "accounts": [ + ]; + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "leaderboard", - "isMut": true, - "isSigner": false + name: "leaderboard"; + isMut: true; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "newDescription", - "type": { - "option": "string" - } + name: "newDescription"; + type: { + option: "string"; + }; }, { - "name": "newNftMeta", - "type": { - "option": "publicKey" - } + name: "newNftMeta"; + type: { + option: "publicKey"; + }; } - ] + ]; }, { - "name": "initializePlayer", - "docs": [ - "Create a [Player] account for a particular user." - ], - "accounts": [ + name: "initializePlayer"; + docs: ["Create a [Player] account for a particular user."]; + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "playerAccount", - "isMut": true, - "isSigner": false + name: "playerAccount"; + isMut: true; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "username", - "type": "string" + name: "username"; + type: "string"; }, { - "name": "nftMeta", - "type": "publicKey" + name: "nftMeta"; + type: "publicKey"; } - ] + ]; }, { - "name": "updatePlayer", - "docs": [ - "Update the username or nft_meta for a [Player] account." - ], - "accounts": [ + name: "updatePlayer"; + docs: ["Update the username or nft_meta for a [Player] account."]; + accounts: [ { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "playerAccount", - "isMut": true, - "isSigner": false + name: "playerAccount"; + isMut: true; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "username", - "type": { - "option": "string" - } + name: "username"; + type: { + option: "string"; + }; }, { - "name": "nftMeta", - "type": { - "option": "publicKey" - } + name: "nftMeta"; + type: { + option: "publicKey"; + }; } - ] + ]; }, { - "name": "registerPlayer", - "docs": [ + name: "registerPlayer"; + docs: [ "Register a [Player] for a particular [Leaderboard], resulting in a newly-", "created [PlayerEntryList] account." - ], - "accounts": [ + ]; + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount"; + isMut: false; + isSigner: false; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "leaderboard", - "isMut": false, - "isSigner": false + name: "leaderboard"; + isMut: false; + isSigner: false; }, { - "name": "newList", - "isMut": true, - "isSigner": false + name: "newList"; + isMut: true; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "submitScore", - "docs": [ + name: "submitScore"; + docs: [ "Submit a score for a player and have it timestamped and added to the [PlayerEntryList].", "Optionally increase the player's rank if needed.", "", "This instruction automatically resizes the [PlayerScoresList] account if needed." - ], - "accounts": [ + ]; + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount"; + isMut: false; + isSigner: false; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "leaderboard", - "isMut": false, - "isSigner": false + name: "leaderboard"; + isMut: false; + isSigner: false; }, { - "name": "playerScores", - "isMut": true, - "isSigner": false + name: "playerScores"; + isMut: true; + isSigner: false; }, { - "name": "topEntries", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "topEntries"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "score", - "type": "u64" + name: "score"; + type: "u64"; } - ] + ]; }, { - "name": "initiateMerge", - "docs": [ + name: "initiateMerge"; + docs: [ "Initialize a new merge account and await approval from the verified users of all the", "specified [Player] accounts.", "", "A merge is complete when all the users of the [Player] account keys referenced in it", "have signed to set their approval to `true`." - ], - "accounts": [ + ]; + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount"; + isMut: false; + isSigner: false; }, { - "name": "mergeAccount", - "isMut": true, - "isSigner": true + name: "mergeAccount"; + isMut: true; + isSigner: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "keys", - "type": { - "vec": "publicKey" - } + name: "keys"; + type: { + vec: "publicKey"; + }; } - ] + ]; }, { - "name": "approveMerge", - "docs": [ + name: "approveMerge"; + docs: [ "Register merge confirmation for a particular [Player] account included in a [Merged]." - ], - "accounts": [ + ]; + accounts: [ { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount"; + isMut: false; + isSigner: false; }, { - "name": "mergeAccount", - "isMut": true, - "isSigner": false + name: "mergeAccount"; + isMut: true; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "unlockPlayerAchievement", - "docs": [ + name: "unlockPlayerAchievement"; + docs: [ "Unlock a [PlayerAchievement] account without minting a reward.", "", "Used `ONLY` for custom rewards mechanism to setup a [PlayerAchievement] account that", @@ -528,1839 +516,1707 @@ export type Soar = { "Since claim instructions like [claim_ft_reward] and [claim_nft_reward] for reward types", "defined by this program try to initialize this account and will fail if it already exists,", "calling this means opting out of using these functions." - ], - "accounts": [ + ]; + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount"; + isMut: false; + isSigner: false; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "achievement", - "isMut": false, - "isSigner": false + name: "achievement"; + isMut: false; + isSigner: false; }, { - "name": "playerAchievement", - "isMut": true, - "isSigner": false + name: "playerAchievement"; + isMut: true; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "addFtReward", - "docs": [ + name: "addFtReward"; + docs: [ "Add a fungible token [Reward] to an [Achievement] to mint to users on unlock.", "", "Overwrites the current reward if one exists." - ], - "accounts": [ + ]; + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "achievement", - "isMut": true, - "isSigner": false + name: "achievement"; + isMut: true; + isSigner: false; }, { - "name": "newReward", - "isMut": true, - "isSigner": true + name: "newReward"; + isMut: true; + isSigner: true; }, { - "name": "rewardTokenMint", - "isMut": false, - "isSigner": false + name: "rewardTokenMint"; + isMut: false; + isSigner: false; }, { - "name": "delegateFromTokenAccount", - "isMut": true, - "isSigner": false + name: "delegateFromTokenAccount"; + isMut: true; + isSigner: false; }, { - "name": "tokenAccountOwner", - "isMut": false, - "isSigner": true + name: "tokenAccountOwner"; + isMut: false; + isSigner: true; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "input", - "type": { - "defined": "AddNewRewardInput" - } + name: "input"; + type: { + defined: "AddNewRewardInput"; + }; } - ] + ]; }, { - "name": "addNftReward", - "docs": [ + name: "addNftReward"; + docs: [ "Add a nft [Reward] to an [Achievement] to mint to users on unlock.", "", "Overwrites the current reward if one exists." - ], - "accounts": [ + ]; + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "achievement", - "isMut": true, - "isSigner": false + name: "achievement"; + isMut: true; + isSigner: false; }, { - "name": "newReward", - "isMut": true, - "isSigner": true + name: "newReward"; + isMut: true; + isSigner: true; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "rewardCollectionMint", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "rewardCollectionMint"; + isMut: false; + isSigner: false; + isOptional: true; }, { - "name": "collectionUpdateAuth", - "isMut": false, - "isSigner": true, - "isOptional": true + name: "collectionUpdateAuth"; + isMut: false; + isSigner: true; + isOptional: true; }, { - "name": "collectionMetadata", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "collectionMetadata"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "tokenMetadataProgram", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "tokenMetadataProgram"; + isMut: false; + isSigner: false; + isOptional: true; } - ], - "args": [ + ]; + args: [ { - "name": "input", - "type": { - "defined": "AddNewRewardInput" - } + name: "input"; + type: { + defined: "AddNewRewardInput"; + }; } - ] + ]; }, { - "name": "claimFtReward", - "docs": [ + name: "claimFtReward"; + docs: [ "Mint an NFT reward for unlocking a [PlayerAchievement] account.", "", "This will attempt to create a [PlayerAchievement] account and fail if it already exists.", "", "Relevant `ONLY` if an FT reward is specified for that achievement." - ], - "accounts": [ + ]; + accounts: [ { - "name": "user", - "isMut": false, - "isSigner": false + name: "user"; + isMut: false; + isSigner: false; }, { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "achievement", - "isMut": false, - "isSigner": false + name: "achievement"; + isMut: false; + isSigner: false; }, { - "name": "reward", - "isMut": true, - "isSigner": false + name: "reward"; + isMut: true; + isSigner: false; }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount"; + isMut: false; + isSigner: false; }, { - "name": "playerAchievement", - "isMut": true, - "isSigner": false + name: "playerAchievement"; + isMut: true; + isSigner: false; }, { - "name": "sourceTokenAccount", - "isMut": true, - "isSigner": false + name: "sourceTokenAccount"; + isMut: true; + isSigner: false; }, { - "name": "userTokenAccount", - "isMut": true, - "isSigner": false + name: "userTokenAccount"; + isMut: true; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "claimNftReward", - "docs": [ + name: "claimNftReward"; + docs: [ "Mint an NFT reward for unlocking a [PlayerAchievement] account.", "", "This will attempt to create a [PlayerAchievement] account and fail if it already exists.", "", "Relevant `ONLY` if an NFT reward is specified for that achievement." - ], - "accounts": [ + ]; + accounts: [ { - "name": "user", - "isMut": false, - "isSigner": false + name: "user"; + isMut: false; + isSigner: false; }, { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority"; + isMut: false; + isSigner: true; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "achievement", - "isMut": false, - "isSigner": false + name: "achievement"; + isMut: false; + isSigner: false; }, { - "name": "reward", - "isMut": true, - "isSigner": false + name: "reward"; + isMut: true; + isSigner: false; }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount"; + isMut: false; + isSigner: false; }, { - "name": "playerAchievement", - "isMut": true, - "isSigner": false + name: "playerAchievement"; + isMut: true; + isSigner: false; }, { - "name": "claim", - "isMut": true, - "isSigner": false + name: "claim"; + isMut: true; + isSigner: false; }, { - "name": "newMint", - "isMut": true, - "isSigner": true + name: "newMint"; + isMut: true; + isSigner: true; }, { - "name": "newMetadata", - "isMut": true, - "isSigner": false + name: "newMetadata"; + isMut: true; + isSigner: false; }, { - "name": "newMasterEdition", - "isMut": true, - "isSigner": false + name: "newMasterEdition"; + isMut: true; + isSigner: false; }, { - "name": "mintTo", - "isMut": true, - "isSigner": false + name: "mintTo"; + isMut: true; + isSigner: false; }, { - "name": "tokenMetadataProgram", - "isMut": false, - "isSigner": false + name: "tokenMetadataProgram"; + isMut: false; + isSigner: false; }, { - "name": "associatedTokenProgram", - "isMut": false, - "isSigner": false + name: "associatedTokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "rent", - "isMut": false, - "isSigner": false + name: "rent"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "verifyNftReward", - "docs": [ + name: "verifyNftReward"; + docs: [ "Verify NFT reward as belonging to a particular collection.", "", "Optional: Only relevant if an NFT reward is specified and the reward's", "`collection_mint` is Some(...)" - ], - "accounts": [ + ]; + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer"; + isMut: true; + isSigner: true; }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game"; + isMut: false; + isSigner: false; }, { - "name": "achievement", - "isMut": false, - "isSigner": false + name: "achievement"; + isMut: false; + isSigner: false; }, { - "name": "reward", - "isMut": false, - "isSigner": false + name: "reward"; + isMut: false; + isSigner: false; }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user"; + isMut: false; + isSigner: true; }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount"; + isMut: false; + isSigner: false; }, { - "name": "claim", - "isMut": false, - "isSigner": false + name: "claim"; + isMut: false; + isSigner: false; }, { - "name": "playerAchievement", - "isMut": false, - "isSigner": false + name: "playerAchievement"; + isMut: false; + isSigner: false; }, { - "name": "mint", - "isMut": false, - "isSigner": false + name: "mint"; + isMut: false; + isSigner: false; }, { - "name": "metadataToVerify", - "isMut": true, - "isSigner": false + name: "metadataToVerify"; + isMut: true; + isSigner: false; }, { - "name": "collectionMint", - "isMut": false, - "isSigner": false + name: "collectionMint"; + isMut: false; + isSigner: false; }, { - "name": "collectionMetadata", - "isMut": true, - "isSigner": false + name: "collectionMetadata"; + isMut: true; + isSigner: false; }, { - "name": "collectionEdition", - "isMut": false, - "isSigner": false + name: "collectionEdition"; + isMut: false; + isSigner: false; }, { - "name": "tokenMetadataProgram", - "isMut": false, - "isSigner": false + name: "tokenMetadataProgram"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; } - ], - "accounts": [ + ]; + accounts: [ { - "name": "achievement", - "docs": [ + name: "achievement"; + docs: [ "Represents an achievement(with optional rewards) for this game", "that can be attained by players.", "", - "PDA with seeds = `[b\"achievement\", game.key().as_ref(), &id.to_le_bytes()]`", + 'PDA with seeds = `[b"achievement", game.key().as_ref(), &id.to_le_bytes()]`', "", "`id` is an incrementing index stored in the game account." - ], - "type": { - "kind": "struct", - "fields": [ + ]; + type: { + kind: "struct"; + fields: [ { - "name": "game", - "docs": [ + name: "game"; + docs: [ "Public key of the game account this achievement is derived from." - ], - "type": "publicKey" + ]; + type: "publicKey"; }, { - "name": "id", - "docs": [ + name: "id"; + docs: [ "The achievement_count of the game account when this account was", "created, also used as a seed for its PDA." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "title", - "docs": [ - "Achievement title." - ], - "type": "string" + name: "title"; + docs: ["Achievement title."]; + type: "string"; }, { - "name": "description", - "docs": [ - "Achievement description." - ], - "type": "string" + name: "description"; + docs: ["Achievement description."]; + type: "string"; }, { - "name": "nftMeta", - "docs": [ + name: "nftMeta"; + docs: [ "Public key of a nft metadata account describing this achievement." - ], - "type": "publicKey" + ]; + type: "publicKey"; }, { - "name": "reward", - "docs": [ + name: "reward"; + docs: [ "Optional: Specify a reward to players for unlocking this achievement." - ], - "type": { - "option": "publicKey" - } + ]; + type: { + option: "publicKey"; + }; } - ] - } + ]; + }; }, { - "name": "game", - "docs": [ - "An account representing a single game." - ], - "type": { - "kind": "struct", - "fields": [ + name: "game"; + docs: ["An account representing a single game."]; + type: { + kind: "struct"; + fields: [ { - "name": "meta", - "docs": [ - "Game meta-information." - ], - "type": { - "defined": "GameAttributes" - } + name: "meta"; + docs: ["Game meta-information."]; + type: { + defined: "GameAttributes"; + }; }, { - "name": "leaderboardCount", - "docs": [ + name: "leaderboardCount"; + docs: [ "Number of leaderboards this game has created. Used both", "in determining the most recent leaderboard address, and", "as a seed for the next leaderboard." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "achievementCount", - "docs": [ + name: "achievementCount"; + docs: [ "Number of achievements that exist for this game. Also", "used to determine the u64 seed for the next achievement." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "auth", - "docs": [ + name: "auth"; + docs: [ "A collection of pubkeys which each represent a valid", "authority for this game." - ], - "type": { - "vec": "publicKey" - } + ]; + type: { + vec: "publicKey"; + }; } - ] - } + ]; + }; }, { - "name": "leaderBoard", - "docs": [ + name: "leaderBoard"; + docs: [ "Represents a [Game][super::Game]'s leaderboard.", "", - "Seeds: `[b\"leaderboard\", game.key().as_ref(), &id.to_le_bytes()]`" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "id", - "docs": [ + 'Seeds: `[b"leaderboard", game.key().as_ref(), &id.to_le_bytes()]`' + ]; + type: { + kind: "struct"; + fields: [ + { + name: "id"; + docs: [ "The leaderboard's id, used in deriving its address from the game." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "game", - "docs": [ - "The game this leaderboard belongs to and is derived from." - ], - "type": "publicKey" + name: "game"; + docs: ["The game this leaderboard belongs to and is derived from."]; + type: "publicKey"; }, { - "name": "description", - "docs": [ - "Leaderboard description." - ], - "type": "string" + name: "description"; + docs: ["Leaderboard description."]; + type: "string"; }, { - "name": "nftMeta", - "docs": [ + name: "nftMeta"; + docs: [ "Pubkey of an nft metadata account that describes this leaderboard." - ], - "type": "publicKey" + ]; + type: "publicKey"; }, { - "name": "decimals", - "docs": [ - "Used to contextualize scores for this leaderboard." - ], - "type": "u8" + name: "decimals"; + docs: ["Used to contextualize scores for this leaderboard."]; + type: "u8"; }, { - "name": "minScore", - "docs": [ - "Minimum possible score for this leaderboard." - ], - "type": "u64" + name: "minScore"; + docs: ["Minimum possible score for this leaderboard."]; + type: "u64"; }, { - "name": "maxScore", - "docs": [ - "Maximum possible score for this leaderboard." - ], - "type": "u64" + name: "maxScore"; + docs: ["Maximum possible score for this leaderboard."]; + type: "u64"; }, { - "name": "topEntries", - "docs": [ - "Top [entries](ScoreEntry) for a leaderboard." - ], - "type": { - "option": "publicKey" - } + name: "topEntries"; + docs: ["Top [entries](ScoreEntry) for a leaderboard."]; + type: { + option: "publicKey"; + }; } - ] - } + ]; + }; }, { - "name": "merged", - "docs": [ + name: "merged"; + docs: [ "An account that represents a single user's ownership of", "multiple [Player][super::Player] accounts." - ], - "type": { - "kind": "struct", - "fields": [ + ]; + type: { + kind: "struct"; + fields: [ { - "name": "initiator", - "docs": [ - "The user that initialized this merge." - ], - "type": "publicKey" + name: "initiator"; + docs: ["The user that initialized this merge."]; + type: "publicKey"; }, { - "name": "approvals", - "docs": [ + name: "approvals"; + docs: [ "Details of all the player accounts to be merged with the main_user's." - ], - "type": { - "vec": { - "defined": "MergeApproval" - } - } + ]; + type: { + vec: { + defined: "MergeApproval"; + }; + }; }, { - "name": "mergeComplete", - "docs": [ + name: "mergeComplete"; + docs: [ "Set to true when every user in `others` has registered their approval." - ], - "type": "bool" + ]; + type: "bool"; } - ] - } + ]; + }; }, { - "name": "playerAchievement", - "docs": [ + name: "playerAchievement"; + docs: [ "Represents a player's status for a particular [Achievement](super::Achievement).", "", - "Seeds = `[b\"player-achievement\", player.key().as_ref(), achievement.key().as_ref()]`." - ], - "type": { - "kind": "struct", - "fields": [ + 'Seeds = `[b"player-achievement", player.key().as_ref(), achievement.key().as_ref()]`.' + ]; + type: { + kind: "struct"; + fields: [ { - "name": "playerAccount", - "docs": [ - "The user's [player][super::Player] account." - ], - "type": "publicKey" + name: "playerAccount"; + docs: ["The user's [player][super::Player] account."]; + type: "publicKey"; }, { - "name": "achievement", - "docs": [ - "The key of the achievement unlocked for this player." - ], - "type": "publicKey" + name: "achievement"; + docs: ["The key of the achievement unlocked for this player."]; + type: "publicKey"; }, { - "name": "timestamp", - "docs": [ - "Timestamp showing when this achievement was unlocked." - ], - "type": "i64" + name: "timestamp"; + docs: ["Timestamp showing when this achievement was unlocked."]; + type: "i64"; }, { - "name": "unlocked", - "docs": [ - "A player's unlock status for this achievement." - ], - "type": "bool" + name: "unlocked"; + docs: ["A player's unlock status for this achievement."]; + type: "bool"; }, { - "name": "claimed", - "docs": [ - "Whether or not this player has claimed their reward." - ], - "type": "bool" + name: "claimed"; + docs: ["Whether or not this player has claimed their reward."]; + type: "bool"; } - ] - } + ]; + }; }, { - "name": "playerScoresList", - "docs": [ + name: "playerScoresList"; + docs: [ "Holds a list of a [player][super::Player]'s [scores][ScoreEntry])", "for a particular [LeaderBoard].", "", - "Seeds: `[b\"player-scores-list\", player_account.key().as_ref(), leaderboard.key().as_ref()]`" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "playerAccount", - "docs": [ + 'Seeds: `[b"player-scores-list", player_account.key().as_ref(), leaderboard.key().as_ref()]`' + ]; + type: { + kind: "struct"; + fields: [ + { + name: "playerAccount"; + docs: [ "The player[super::Player] account this entry is derived from" - ], - "type": "publicKey" + ]; + type: "publicKey"; }, { - "name": "leaderboard", - "docs": [ - "The id of the specific leaderboard." - ], - "type": "publicKey" + name: "leaderboard"; + docs: ["The id of the specific leaderboard."]; + type: "publicKey"; }, { - "name": "allocCount", - "docs": [ + name: "allocCount"; + docs: [ "Max number of [scores][ScoreEntry] the current space allocation supports." - ], - "type": "u16" + ]; + type: "u16"; }, { - "name": "scores", - "docs": [ - "Collection of [scores][ScoreEntry]." - ], - "type": { - "vec": { - "defined": "ScoreEntry" - } - } + name: "scores"; + docs: ["Collection of [scores][ScoreEntry]."]; + type: { + vec: { + defined: "ScoreEntry"; + }; + }; } - ] - } + ]; + }; }, { - "name": "player", - "docs": [ + name: "player"; + docs: [ "An account representing a player.", "", - "Seeds: `[b\"player\", user.key().as_ref()]`" - ], - "type": { - "kind": "struct", - "fields": [ + 'Seeds: `[b"player", user.key().as_ref()]`' + ]; + type: { + kind: "struct"; + fields: [ { - "name": "user", - "docs": [ - "The wallet that owns this player-info account" - ], - "type": "publicKey" + name: "user"; + docs: ["The wallet that owns this player-info account"]; + type: "publicKey"; }, { - "name": "username", - "docs": [ - "The player's username." - ], - "type": "string" + name: "username"; + docs: ["The player's username."]; + type: "string"; }, { - "name": "nftMeta", - "docs": [ - "Metadata to represent this player." - ], - "type": "publicKey" + name: "nftMeta"; + docs: ["Metadata to represent this player."]; + type: "publicKey"; } - ] - } + ]; + }; }, { - "name": "nftClaim", - "type": { - "kind": "struct", - "fields": [] - } + name: "nftClaim"; + type: { + kind: "struct"; + fields: []; + }; }, { - "name": "reward", - "docs": [ - "An account representing a reward for a given achievement." - ], - "type": { - "kind": "struct", - "fields": [ + name: "reward"; + docs: ["An account representing a reward for a given achievement."]; + type: { + kind: "struct"; + fields: [ { - "name": "achievement", - "docs": [ - "The achievement this reward is given for." - ], - "type": "publicKey" + name: "achievement"; + docs: ["The achievement this reward is given for."]; + type: "publicKey"; }, { - "name": "availableSpots", - "docs": [ - "Number of available reward spots." - ], - "type": "u64" + name: "availableSpots"; + docs: ["Number of available reward spots."]; + type: "u64"; }, { - "name": "reward", - "docs": [ + name: "reward"; + docs: [ "The reward kind. Current supports Nft and Ft rewards only." - ], - "type": { - "defined": "RewardKind" - } + ]; + type: { + defined: "RewardKind"; + }; } - ] - } + ]; + }; }, { - "name": "leaderTopEntries", - "docs": [ + name: "leaderTopEntries"; + docs: [ "Keeps track of a sorted list of top scores for a leaderboard.", "", - "Seeds = [b\"top-scores\", leaderboard.key().as_ref()]" - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "isAscending", - "docs": [ - "Arrangement order." - ], - "type": "bool" - }, - { - "name": "topScores", - "docs": [ - "Top scores." - ], - "type": { - "vec": { - "defined": "LeaderBoardScore" - } - } - } - ] - } + 'Seeds = [b"top-scores", leaderboard.key().as_ref()]' + ]; + type: { + kind: "struct"; + fields: [ + { + name: "isAscending"; + docs: ["Arrangement order."]; + type: "bool"; + }, + { + name: "topScores"; + docs: ["Top scores."]; + type: { + vec: { + defined: "LeaderBoardScore"; + }; + }; + } + ]; + }; } - ], - "types": [ + ]; + types: [ { - "name": "GameAttributes", - "docs": [ - "A type that represents game-specific information." - ], - "type": { - "kind": "struct", - "fields": [ + name: "GameAttributes"; + docs: ["A type that represents game-specific information."]; + type: { + kind: "struct"; + fields: [ { - "name": "title", - "docs": [ - "The title of the game, max length = 30 bytes." - ], - "type": "string" + name: "title"; + docs: ["The title of the game, max length = 30 bytes."]; + type: "string"; }, { - "name": "description", - "docs": [ - "The game description, max length = 200 bytes." - ], - "type": "string" + name: "description"; + docs: ["The game description, max length = 200 bytes."]; + type: "string"; }, { - "name": "genre", - "docs": [ - "The game's [genre](super::Genre), as a u8." - ], - "type": "u8" + name: "genre"; + docs: ["The game's [genre](super::Genre), as a u8."]; + type: "u8"; }, { - "name": "gameType", - "docs": [ - "The game's [type](super::GameType), as a u8." - ], - "type": "u8" + name: "gameType"; + docs: ["The game's [type](super::GameType), as a u8."]; + type: "u8"; }, { - "name": "nftMeta", - "docs": [ - "An nft metadata account describing the game." - ], - "type": "publicKey" + name: "nftMeta"; + docs: ["An nft metadata account describing the game."]; + type: "publicKey"; } - ] - } + ]; + }; }, { - "name": "ScoreEntry", - "docs": [ - "A single score entry for a player." - ], - "type": { - "kind": "struct", - "fields": [ + name: "ScoreEntry"; + docs: ["A single score entry for a player."]; + type: { + kind: "struct"; + fields: [ { - "name": "score", - "docs": [ - "The player's score." - ], - "type": "u64" + name: "score"; + docs: ["The player's score."]; + type: "u64"; }, { - "name": "timestamp", - "docs": [ - "When this entry was made." - ], - "type": "i64" + name: "timestamp"; + docs: ["When this entry was made."]; + type: "i64"; } - ] - } + ]; + }; }, { - "name": "MergeApproval", - "docs": [ + name: "MergeApproval"; + docs: [ "Represents a [Player][super::Player] account involved in a merge", "and if that account's user/authority has granted approval." - ], - "type": { - "kind": "struct", - "fields": [ + ]; + type: { + kind: "struct"; + fields: [ { - "name": "key", - "docs": [ - "The player_account pubkey." - ], - "type": "publicKey" + name: "key"; + docs: ["The player_account pubkey."]; + type: "publicKey"; }, { - "name": "approved", - "docs": [ - "User's approval status." - ], - "type": "bool" + name: "approved"; + docs: ["User's approval status."]; + type: "bool"; } - ] - } + ]; + }; }, { - "name": "LeaderBoardScore", - "docs": [ - "An single entry to a [LeaderTopEntries]." - ], - "type": { - "kind": "struct", - "fields": [ + name: "LeaderBoardScore"; + docs: ["An single entry to a [LeaderTopEntries]."]; + type: { + kind: "struct"; + fields: [ { - "name": "player", - "docs": [ - "The player" - ], - "type": "publicKey" + name: "player"; + docs: ["The player"]; + type: "publicKey"; }, { - "name": "entry", - "docs": [ - "The user's [score][super::ScoreEntry]." - ], - "type": { - "defined": "ScoreEntry" - } + name: "entry"; + docs: ["The user's [score][super::ScoreEntry]."]; + type: { + defined: "ScoreEntry"; + }; } - ] - } + ]; + }; }, { - "name": "RegisterLeaderBoardInput", - "docs": [ - "Parameters needed when registering a leaderboard." - ], - "type": { - "kind": "struct", - "fields": [ + name: "RegisterLeaderBoardInput"; + docs: ["Parameters needed when registering a leaderboard."]; + type: { + kind: "struct"; + fields: [ { - "name": "description", - "docs": [ - "Leaderboard description." - ], - "type": "string" + name: "description"; + docs: ["Leaderboard description."]; + type: "string"; }, { - "name": "nftMeta", - "docs": [ - "Nft metadata representing the leaderboard." - ], - "type": "publicKey" + name: "nftMeta"; + docs: ["Nft metadata representing the leaderboard."]; + type: "publicKey"; }, { - "name": "decimals", - "docs": [ + name: "decimals"; + docs: [ "Specify the decimals score values are represented in. Defaults to `0` if [None]." - ], - "type": { - "option": "u8" - } + ]; + type: { + option: "u8"; + }; }, { - "name": "minScore", - "docs": [ + name: "minScore"; + docs: [ "Specifies minimum allowed score. Defaults to `u64::MIN` if [None]." - ], - "type": { - "option": "u64" - } + ]; + type: { + option: "u64"; + }; }, { - "name": "maxScore", - "docs": [ + name: "maxScore"; + docs: [ "Specifies maximum allowed score. Defaults to `u64::MAX` if [None]." - ], - "type": { - "option": "u64" - } + ]; + type: { + option: "u64"; + }; }, { - "name": "scoresToRetain", - "docs": [ - "Number of top scores to store on-chain." - ], - "type": "u8" + name: "scoresToRetain"; + docs: ["Number of top scores to store on-chain."]; + type: "u8"; }, { - "name": "scoresOrder", - "docs": [ + name: "scoresOrder"; + docs: [ "Order by which scores are stored. `true` for ascending, `false` for descending." - ], - "type": "bool" + ]; + type: "bool"; } - ] - } + ]; + }; }, { - "name": "AddNewRewardInput", - "docs": [ - "Input to add a new reward for an achievement." - ], - "type": { - "kind": "struct", - "fields": [ + name: "AddNewRewardInput"; + docs: ["Input to add a new reward for an achievement."]; + type: { + kind: "struct"; + fields: [ { - "name": "availableSpots", - "docs": [ - "Number of rewards to be given out." - ], - "type": "u64" + name: "availableSpots"; + docs: ["Number of rewards to be given out."]; + type: "u64"; }, { - "name": "kind", - "docs": [ - "Specific reward kind." - ], - "type": { - "defined": "RewardKindInput" - } + name: "kind"; + docs: ["Specific reward kind."]; + type: { + defined: "RewardKindInput"; + }; } - ] - } + ]; + }; }, { - "name": "GameType", - "type": { - "kind": "enum", - "variants": [ + name: "GameType"; + type: { + kind: "enum"; + variants: [ { - "name": "Mobile" + name: "Mobile"; }, { - "name": "Desktop" + name: "Desktop"; }, { - "name": "Web" + name: "Web"; }, { - "name": "Unspecified" + name: "Unspecified"; } - ] - } + ]; + }; }, { - "name": "Genre", - "type": { - "kind": "enum", - "variants": [ + name: "Genre"; + type: { + kind: "enum"; + variants: [ { - "name": "Rpg" + name: "Rpg"; }, { - "name": "Mmo" + name: "Mmo"; }, { - "name": "Action" + name: "Action"; }, { - "name": "Adventure" + name: "Adventure"; }, { - "name": "Puzzle" + name: "Puzzle"; }, { - "name": "Casual" + name: "Casual"; }, { - "name": "Unspecified" + name: "Unspecified"; } - ] - } + ]; + }; }, { - "name": "RewardKind", - "docs": [ - "The kind of reward to be given out." - ], - "type": { - "kind": "enum", - "variants": [ + name: "RewardKind"; + docs: ["The kind of reward to be given out."]; + type: { + kind: "enum"; + variants: [ { - "name": "FungibleToken", - "fields": [ + name: "FungibleToken"; + fields: [ { - "name": "mint", - "docs": [ - "The mint of the token to be given out." - ], - "type": "publicKey" + name: "mint"; + docs: ["The mint of the token to be given out."]; + type: "publicKey"; }, { - "name": "account", - "docs": [ - "The token account to withdraw from." - ], - "type": "publicKey" + name: "account"; + docs: ["The token account to withdraw from."]; + type: "publicKey"; }, { - "name": "amount", - "docs": [ - "Reward amount per user." - ], - "type": "u64" + name: "amount"; + docs: ["Reward amount per user."]; + type: "u64"; } - ] + ]; }, { - "name": "NonFungibleToken", - "fields": [ + name: "NonFungibleToken"; + fields: [ { - "name": "uri", - "docs": [ - "URI of the NFT to be minted." - ], - "type": "string" + name: "uri"; + docs: ["URI of the NFT to be minted."]; + type: "string"; }, { - "name": "name", - "docs": [ - "Name of the NFT to be minted." - ], - "type": "string" + name: "name"; + docs: ["Name of the NFT to be minted."]; + type: "string"; }, { - "name": "symbol", - "docs": [ - "Symbol of the NFT to be minted." - ], - "type": "string" + name: "symbol"; + docs: ["Symbol of the NFT to be minted."]; + type: "string"; }, { - "name": "minted", - "docs": [ - "Total NFTs minted so far." - ], - "type": "u64" + name: "minted"; + docs: ["Total NFTs minted so far."]; + type: "u64"; }, { - "name": "collection", - "docs": [ + name: "collection"; + docs: [ "Optional field for a collection mint used for", "verifying minted rewards." - ], - "type": { - "option": "publicKey" - } + ]; + type: { + option: "publicKey"; + }; } - ] + ]; } - ] - } + ]; + }; }, { - "name": "RewardKindInput", - "docs": [ - "Specific variant of [AddNewRewardInput]." - ], - "type": { - "kind": "enum", - "variants": [ + name: "RewardKindInput"; + docs: ["Specific variant of [AddNewRewardInput]."]; + type: { + kind: "enum"; + variants: [ { - "name": "Ft", - "fields": [ + name: "Ft"; + fields: [ { - "name": "deposit", - "docs": [ + name: "deposit"; + docs: [ "Amount to be delegated to this program's PDA", "so it can spend for reward claims." - ], - "type": "u64" + ]; + type: "u64"; }, { - "name": "amount", - "docs": [ - "Amount given to a single user." - ], - "type": "u64" + name: "amount"; + docs: ["Amount given to a single user."]; + type: "u64"; } - ] + ]; }, { - "name": "Nft", - "fields": [ + name: "Nft"; + fields: [ { - "name": "uri", - "docs": [ - "Uri of the minted nft." - ], - "type": "string" + name: "uri"; + docs: ["Uri of the minted nft."]; + type: "string"; }, { - "name": "name", - "docs": [ - "Name of the minted nft." - ], - "type": "string" + name: "name"; + docs: ["Name of the minted nft."]; + type: "string"; }, { - "name": "symbol", - "docs": [ - "Symbol of the minted nft." - ], - "type": "string" + name: "symbol"; + docs: ["Symbol of the minted nft."]; + type: "string"; } - ] + ]; } - ] - } + ]; + }; } - ], - "errors": [ + ]; + errors: [ { - "code": 6000, - "name": "InvalidFieldLength", - "msg": "Exceeded max length for field." + code: 6000; + name: "InvalidFieldLength"; + msg: "Exceeded max length for field."; }, { - "code": 6001, - "name": "InvalidAuthority", - "msg": "Invalid authority for instruction" + code: 6001; + name: "InvalidAuthority"; + msg: "Invalid authority for instruction"; }, { - "code": 6002, - "name": "MissingSignature", - "msg": "An expected signature isn't present" + code: 6002; + name: "MissingSignature"; + msg: "An expected signature isn't present"; }, { - "code": 6003, - "name": "NoRewardForAchievement", - "msg": "Reward not specified for this achievement" + code: 6003; + name: "NoRewardForAchievement"; + msg: "Reward not specified for this achievement"; }, { - "code": 6004, - "name": "AccountNotPartOfMerge", - "msg": "The merge account does not include this player account" + code: 6004; + name: "AccountNotPartOfMerge"; + msg: "The merge account does not include this player account"; }, { - "code": 6005, - "name": "ScoreNotWithinBounds", - "msg": "Tried to input score that is below the minimum or above the maximum" + code: 6005; + name: "ScoreNotWithinBounds"; + msg: "Tried to input score that is below the minimum or above the maximum"; }, { - "code": 6006, - "name": "MissingExpectedAccount", - "msg": "An optional but expected account is missing" + code: 6006; + name: "MissingExpectedAccount"; + msg: "An optional but expected account is missing"; }, { - "code": 6007, - "name": "InvalidRewardKind", - "msg": "Invalid reward kind for this instruction" + code: 6007; + name: "InvalidRewardKind"; + msg: "Invalid reward kind for this instruction"; }, { - "code": 6008, - "name": "NoAvailableRewards", - "msg": "No more rewards are being given out for this game" + code: 6008; + name: "NoAvailableRewards"; + msg: "No more rewards are being given out for this game"; } - ] + ]; }; export const IDL: Soar = { - "version": "0.1.0", - "name": "soar", - "constants": [ + version: "0.1.0", + name: "soar", + constants: [ { - "name": "MAX_TITLE_LEN", - "type": { - "defined": "usize" + name: "MAX_TITLE_LEN", + type: { + defined: "usize", }, - "value": "30" + value: "30", }, { - "name": "MAX_DESCRIPTION_LEN", - "type": { - "defined": "usize" + name: "MAX_DESCRIPTION_LEN", + type: { + defined: "usize", }, - "value": "200" - } + value: "200", + }, ], - "instructions": [ + instructions: [ { - "name": "initializeGame", - "docs": [ - "Initialize a new [Game] and register its [LeaderBoard]." - ], - "accounts": [ + name: "initializeGame", + docs: ["Initialize a new [Game] and register its [LeaderBoard]."], + accounts: [ { - "name": "creator", - "isMut": true, - "isSigner": true + name: "creator", + isMut: true, + isSigner: true, }, { - "name": "game", - "isMut": true, - "isSigner": true + name: "game", + isMut: true, + isSigner: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "gameMeta", - "type": { - "defined": "GameAttributes" - } + name: "gameMeta", + type: { + defined: "GameAttributes", + }, }, { - "name": "gameAuth", - "type": { - "vec": "publicKey" - } - } - ] + name: "gameAuth", + type: { + vec: "publicKey", + }, + }, + ], }, { - "name": "updateGame", - "docs": [ - "Update a [Game]'s meta-information or authority list." - ], - "accounts": [ + name: "updateGame", + docs: ["Update a [Game]'s meta-information or authority list."], + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "game", - "isMut": true, - "isSigner": false + name: "game", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "newMeta", - "type": { - "option": { - "defined": "GameAttributes" - } - } + name: "newMeta", + type: { + option: { + defined: "GameAttributes", + }, + }, }, { - "name": "newAuth", - "type": { - "option": { - "vec": "publicKey" - } - } - } - ] + name: "newAuth", + type: { + option: { + vec: "publicKey", + }, + }, + }, + ], }, { - "name": "addAchievement", - "docs": [ - "Add a new [Achievement] that can be attained for a particular [Game]." + name: "addAchievement", + docs: [ + "Add a new [Achievement] that can be attained for a particular [Game].", ], - "accounts": [ + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "game", - "isMut": true, - "isSigner": false + name: "game", + isMut: true, + isSigner: false, }, { - "name": "newAchievement", - "isMut": true, - "isSigner": false + name: "newAchievement", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "title", - "type": "string" + name: "title", + type: "string", }, { - "name": "description", - "type": "string" + name: "description", + type: "string", }, { - "name": "nftMeta", - "type": "publicKey" - } - ] + name: "nftMeta", + type: "publicKey", + }, + ], }, { - "name": "updateAchievement", - "docs": [ - "Update an [Achievement]'s meta information." - ], - "accounts": [ + name: "updateAchievement", + docs: ["Update an [Achievement]'s meta information."], + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "achievement", - "isMut": true, - "isSigner": false - } + name: "achievement", + isMut: true, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "newTitle", - "type": { - "option": "string" - } + name: "newTitle", + type: { + option: "string", + }, }, { - "name": "newDescription", - "type": { - "option": "string" - } + name: "newDescription", + type: { + option: "string", + }, }, { - "name": "nftMeta", - "type": { - "option": "publicKey" - } - } - ] + name: "nftMeta", + type: { + option: "publicKey", + }, + }, + ], }, { - "name": "addLeaderboard", - "docs": [ - "Overwrite the active [LeaderBoard] and set a newly created one." - ], - "accounts": [ + name: "addLeaderboard", + docs: ["Overwrite the active [LeaderBoard] and set a newly created one."], + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "game", - "isMut": true, - "isSigner": false + name: "game", + isMut: true, + isSigner: false, }, { - "name": "leaderboard", - "isMut": true, - "isSigner": false + name: "leaderboard", + isMut: true, + isSigner: false, }, { - "name": "topEntries", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "topEntries", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "input", - "type": { - "defined": "RegisterLeaderBoardInput" - } - } - ] + name: "input", + type: { + defined: "RegisterLeaderBoardInput", + }, + }, + ], }, { - "name": "updateLeaderboard", - "docs": [ - "Update's a leaderboard's description and nft metadata information." + name: "updateLeaderboard", + docs: [ + "Update's a leaderboard's description and nft metadata information.", ], - "accounts": [ + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "leaderboard", - "isMut": true, - "isSigner": false - } + name: "leaderboard", + isMut: true, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "newDescription", - "type": { - "option": "string" - } + name: "newDescription", + type: { + option: "string", + }, }, { - "name": "newNftMeta", - "type": { - "option": "publicKey" - } - } - ] + name: "newNftMeta", + type: { + option: "publicKey", + }, + }, + ], }, { - "name": "initializePlayer", - "docs": [ - "Create a [Player] account for a particular user." - ], - "accounts": [ + name: "initializePlayer", + docs: ["Create a [Player] account for a particular user."], + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user", + isMut: false, + isSigner: true, }, { - "name": "playerAccount", - "isMut": true, - "isSigner": false + name: "playerAccount", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "username", - "type": "string" + name: "username", + type: "string", }, { - "name": "nftMeta", - "type": "publicKey" - } - ] + name: "nftMeta", + type: "publicKey", + }, + ], }, { - "name": "updatePlayer", - "docs": [ - "Update the username or nft_meta for a [Player] account." - ], - "accounts": [ + name: "updatePlayer", + docs: ["Update the username or nft_meta for a [Player] account."], + accounts: [ { - "name": "user", - "isMut": false, - "isSigner": true + name: "user", + isMut: false, + isSigner: true, }, { - "name": "playerAccount", - "isMut": true, - "isSigner": false - } + name: "playerAccount", + isMut: true, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "username", - "type": { - "option": "string" - } + name: "username", + type: { + option: "string", + }, }, { - "name": "nftMeta", - "type": { - "option": "publicKey" - } - } - ] + name: "nftMeta", + type: { + option: "publicKey", + }, + }, + ], }, { - "name": "registerPlayer", - "docs": [ + name: "registerPlayer", + docs: [ "Register a [Player] for a particular [Leaderboard], resulting in a newly-", - "created [PlayerEntryList] account." + "created [PlayerEntryList] account.", ], - "accounts": [ + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user", + isMut: false, + isSigner: true, }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount", + isMut: false, + isSigner: false, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "leaderboard", - "isMut": false, - "isSigner": false + name: "leaderboard", + isMut: false, + isSigner: false, }, { - "name": "newList", - "isMut": true, - "isSigner": false + name: "newList", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [] + args: [], }, { - "name": "submitScore", - "docs": [ + name: "submitScore", + docs: [ "Submit a score for a player and have it timestamped and added to the [PlayerEntryList].", "Optionally increase the player's rank if needed.", "", - "This instruction automatically resizes the [PlayerScoresList] account if needed." + "This instruction automatically resizes the [PlayerScoresList] account if needed.", ], - "accounts": [ + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount", + isMut: false, + isSigner: false, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "leaderboard", - "isMut": false, - "isSigner": false + name: "leaderboard", + isMut: false, + isSigner: false, }, { - "name": "playerScores", - "isMut": true, - "isSigner": false + name: "playerScores", + isMut: true, + isSigner: false, }, { - "name": "topEntries", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "topEntries", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "score", - "type": "u64" - } - ] + name: "score", + type: "u64", + }, + ], }, { - "name": "initiateMerge", - "docs": [ + name: "initiateMerge", + docs: [ "Initialize a new merge account and await approval from the verified users of all the", "specified [Player] accounts.", "", "A merge is complete when all the users of the [Player] account keys referenced in it", - "have signed to set their approval to `true`." + "have signed to set their approval to `true`.", ], - "accounts": [ + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user", + isMut: false, + isSigner: true, }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount", + isMut: false, + isSigner: false, }, { - "name": "mergeAccount", - "isMut": true, - "isSigner": true + name: "mergeAccount", + isMut: true, + isSigner: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "keys", - "type": { - "vec": "publicKey" - } - } - ] + name: "keys", + type: { + vec: "publicKey", + }, + }, + ], }, { - "name": "approveMerge", - "docs": [ - "Register merge confirmation for a particular [Player] account included in a [Merged]." + name: "approveMerge", + docs: [ + "Register merge confirmation for a particular [Player] account included in a [Merged].", ], - "accounts": [ + accounts: [ { - "name": "user", - "isMut": false, - "isSigner": true + name: "user", + isMut: false, + isSigner: true, }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount", + isMut: false, + isSigner: false, }, { - "name": "mergeAccount", - "isMut": true, - "isSigner": false - } + name: "mergeAccount", + isMut: true, + isSigner: false, + }, ], - "args": [] + args: [], }, { - "name": "unlockPlayerAchievement", - "docs": [ + name: "unlockPlayerAchievement", + docs: [ "Unlock a [PlayerAchievement] account without minting a reward.", "", "Used `ONLY` for custom rewards mechanism to setup a [PlayerAchievement] account that", @@ -2368,1314 +2224,1194 @@ export const IDL: Soar = { "", "Since claim instructions like [claim_ft_reward] and [claim_nft_reward] for reward types", "defined by this program try to initialize this account and will fail if it already exists,", - "calling this means opting out of using these functions." + "calling this means opting out of using these functions.", ], - "accounts": [ + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount", + isMut: false, + isSigner: false, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "achievement", - "isMut": false, - "isSigner": false + name: "achievement", + isMut: false, + isSigner: false, }, { - "name": "playerAchievement", - "isMut": true, - "isSigner": false + name: "playerAchievement", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [] + args: [], }, { - "name": "addFtReward", - "docs": [ + name: "addFtReward", + docs: [ "Add a fungible token [Reward] to an [Achievement] to mint to users on unlock.", "", - "Overwrites the current reward if one exists." + "Overwrites the current reward if one exists.", ], - "accounts": [ + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "achievement", - "isMut": true, - "isSigner": false + name: "achievement", + isMut: true, + isSigner: false, }, { - "name": "newReward", - "isMut": true, - "isSigner": true + name: "newReward", + isMut: true, + isSigner: true, }, { - "name": "rewardTokenMint", - "isMut": false, - "isSigner": false + name: "rewardTokenMint", + isMut: false, + isSigner: false, }, { - "name": "delegateFromTokenAccount", - "isMut": true, - "isSigner": false + name: "delegateFromTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "tokenAccountOwner", - "isMut": false, - "isSigner": true + name: "tokenAccountOwner", + isMut: false, + isSigner: true, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "input", - "type": { - "defined": "AddNewRewardInput" - } - } - ] + name: "input", + type: { + defined: "AddNewRewardInput", + }, + }, + ], }, { - "name": "addNftReward", - "docs": [ + name: "addNftReward", + docs: [ "Add a nft [Reward] to an [Achievement] to mint to users on unlock.", "", - "Overwrites the current reward if one exists." + "Overwrites the current reward if one exists.", ], - "accounts": [ + accounts: [ { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "achievement", - "isMut": true, - "isSigner": false + name: "achievement", + isMut: true, + isSigner: false, }, { - "name": "newReward", - "isMut": true, - "isSigner": true + name: "newReward", + isMut: true, + isSigner: true, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram", + isMut: false, + isSigner: false, }, { - "name": "rewardCollectionMint", - "isMut": false, - "isSigner": false, - "isOptional": true + name: "rewardCollectionMint", + isMut: false, + isSigner: false, + isOptional: true, }, { - "name": "collectionUpdateAuth", - "isMut": false, - "isSigner": true, - "isOptional": true + name: "collectionUpdateAuth", + isMut: false, + isSigner: true, + isOptional: true, }, { - "name": "collectionMetadata", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "collectionMetadata", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "tokenMetadataProgram", - "isMut": false, - "isSigner": false, - "isOptional": true - } + name: "tokenMetadataProgram", + isMut: false, + isSigner: false, + isOptional: true, + }, ], - "args": [ + args: [ { - "name": "input", - "type": { - "defined": "AddNewRewardInput" - } - } - ] + name: "input", + type: { + defined: "AddNewRewardInput", + }, + }, + ], }, { - "name": "claimFtReward", - "docs": [ + name: "claimFtReward", + docs: [ "Mint an NFT reward for unlocking a [PlayerAchievement] account.", "", "This will attempt to create a [PlayerAchievement] account and fail if it already exists.", "", - "Relevant `ONLY` if an FT reward is specified for that achievement." + "Relevant `ONLY` if an FT reward is specified for that achievement.", ], - "accounts": [ + accounts: [ { - "name": "user", - "isMut": false, - "isSigner": false + name: "user", + isMut: false, + isSigner: false, }, { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "achievement", - "isMut": false, - "isSigner": false + name: "achievement", + isMut: false, + isSigner: false, }, { - "name": "reward", - "isMut": true, - "isSigner": false + name: "reward", + isMut: true, + isSigner: false, }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount", + isMut: false, + isSigner: false, }, { - "name": "playerAchievement", - "isMut": true, - "isSigner": false + name: "playerAchievement", + isMut: true, + isSigner: false, }, { - "name": "sourceTokenAccount", - "isMut": true, - "isSigner": false + name: "sourceTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "userTokenAccount", - "isMut": true, - "isSigner": false + name: "userTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [] + args: [], }, { - "name": "claimNftReward", - "docs": [ + name: "claimNftReward", + docs: [ "Mint an NFT reward for unlocking a [PlayerAchievement] account.", "", "This will attempt to create a [PlayerAchievement] account and fail if it already exists.", "", - "Relevant `ONLY` if an NFT reward is specified for that achievement." + "Relevant `ONLY` if an NFT reward is specified for that achievement.", ], - "accounts": [ + accounts: [ { - "name": "user", - "isMut": false, - "isSigner": false + name: "user", + isMut: false, + isSigner: false, }, { - "name": "authority", - "isMut": false, - "isSigner": true + name: "authority", + isMut: false, + isSigner: true, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "achievement", - "isMut": false, - "isSigner": false + name: "achievement", + isMut: false, + isSigner: false, }, { - "name": "reward", - "isMut": true, - "isSigner": false + name: "reward", + isMut: true, + isSigner: false, }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount", + isMut: false, + isSigner: false, }, { - "name": "playerAchievement", - "isMut": true, - "isSigner": false + name: "playerAchievement", + isMut: true, + isSigner: false, }, { - "name": "claim", - "isMut": true, - "isSigner": false + name: "claim", + isMut: true, + isSigner: false, }, { - "name": "newMint", - "isMut": true, - "isSigner": true + name: "newMint", + isMut: true, + isSigner: true, }, { - "name": "newMetadata", - "isMut": true, - "isSigner": false + name: "newMetadata", + isMut: true, + isSigner: false, }, { - "name": "newMasterEdition", - "isMut": true, - "isSigner": false + name: "newMasterEdition", + isMut: true, + isSigner: false, }, { - "name": "mintTo", - "isMut": true, - "isSigner": false + name: "mintTo", + isMut: true, + isSigner: false, }, { - "name": "tokenMetadataProgram", - "isMut": false, - "isSigner": false + name: "tokenMetadataProgram", + isMut: false, + isSigner: false, }, { - "name": "associatedTokenProgram", - "isMut": false, - "isSigner": false + name: "associatedTokenProgram", + isMut: false, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram", + isMut: false, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "rent", - "isMut": false, - "isSigner": false - } + name: "rent", + isMut: false, + isSigner: false, + }, ], - "args": [] + args: [], }, { - "name": "verifyNftReward", - "docs": [ + name: "verifyNftReward", + docs: [ "Verify NFT reward as belonging to a particular collection.", "", "Optional: Only relevant if an NFT reward is specified and the reward's", - "`collection_mint` is Some(...)" + "`collection_mint` is Some(...)", ], - "accounts": [ + accounts: [ { - "name": "payer", - "isMut": true, - "isSigner": true + name: "payer", + isMut: true, + isSigner: true, }, { - "name": "game", - "isMut": false, - "isSigner": false + name: "game", + isMut: false, + isSigner: false, }, { - "name": "achievement", - "isMut": false, - "isSigner": false + name: "achievement", + isMut: false, + isSigner: false, }, { - "name": "reward", - "isMut": false, - "isSigner": false + name: "reward", + isMut: false, + isSigner: false, }, { - "name": "user", - "isMut": false, - "isSigner": true + name: "user", + isMut: false, + isSigner: true, }, { - "name": "playerAccount", - "isMut": false, - "isSigner": false + name: "playerAccount", + isMut: false, + isSigner: false, }, { - "name": "claim", - "isMut": false, - "isSigner": false + name: "claim", + isMut: false, + isSigner: false, }, { - "name": "playerAchievement", - "isMut": false, - "isSigner": false + name: "playerAchievement", + isMut: false, + isSigner: false, }, { - "name": "mint", - "isMut": false, - "isSigner": false + name: "mint", + isMut: false, + isSigner: false, }, { - "name": "metadataToVerify", - "isMut": true, - "isSigner": false + name: "metadataToVerify", + isMut: true, + isSigner: false, }, { - "name": "collectionMint", - "isMut": false, - "isSigner": false + name: "collectionMint", + isMut: false, + isSigner: false, }, { - "name": "collectionMetadata", - "isMut": true, - "isSigner": false + name: "collectionMetadata", + isMut: true, + isSigner: false, }, { - "name": "collectionEdition", - "isMut": false, - "isSigner": false + name: "collectionEdition", + isMut: false, + isSigner: false, }, { - "name": "tokenMetadataProgram", - "isMut": false, - "isSigner": false - } + name: "tokenMetadataProgram", + isMut: false, + isSigner: false, + }, ], - "args": [] - } + args: [], + }, ], - "accounts": [ + accounts: [ { - "name": "achievement", - "docs": [ + name: "achievement", + docs: [ "Represents an achievement(with optional rewards) for this game", "that can be attained by players.", "", - "PDA with seeds = `[b\"achievement\", game.key().as_ref(), &id.to_le_bytes()]`", + 'PDA with seeds = `[b"achievement", game.key().as_ref(), &id.to_le_bytes()]`', "", - "`id` is an incrementing index stored in the game account." + "`id` is an incrementing index stored in the game account.", ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "game", - "docs": [ - "Public key of the game account this achievement is derived from." + name: "game", + docs: [ + "Public key of the game account this achievement is derived from.", ], - "type": "publicKey" + type: "publicKey", }, { - "name": "id", - "docs": [ + name: "id", + docs: [ "The achievement_count of the game account when this account was", - "created, also used as a seed for its PDA." + "created, also used as a seed for its PDA.", ], - "type": "u64" + type: "u64", }, { - "name": "title", - "docs": [ - "Achievement title." - ], - "type": "string" + name: "title", + docs: ["Achievement title."], + type: "string", }, { - "name": "description", - "docs": [ - "Achievement description." - ], - "type": "string" + name: "description", + docs: ["Achievement description."], + type: "string", }, { - "name": "nftMeta", - "docs": [ - "Public key of a nft metadata account describing this achievement." + name: "nftMeta", + docs: [ + "Public key of a nft metadata account describing this achievement.", ], - "type": "publicKey" + type: "publicKey", }, { - "name": "reward", - "docs": [ - "Optional: Specify a reward to players for unlocking this achievement." + name: "reward", + docs: [ + "Optional: Specify a reward to players for unlocking this achievement.", ], - "type": { - "option": "publicKey" - } - } - ] - } + type: { + option: "publicKey", + }, + }, + ], + }, }, { - "name": "game", - "docs": [ - "An account representing a single game." - ], - "type": { - "kind": "struct", - "fields": [ + name: "game", + docs: ["An account representing a single game."], + type: { + kind: "struct", + fields: [ { - "name": "meta", - "docs": [ - "Game meta-information." - ], - "type": { - "defined": "GameAttributes" - } + name: "meta", + docs: ["Game meta-information."], + type: { + defined: "GameAttributes", + }, }, { - "name": "leaderboardCount", - "docs": [ + name: "leaderboardCount", + docs: [ "Number of leaderboards this game has created. Used both", "in determining the most recent leaderboard address, and", - "as a seed for the next leaderboard." + "as a seed for the next leaderboard.", ], - "type": "u64" + type: "u64", }, { - "name": "achievementCount", - "docs": [ + name: "achievementCount", + docs: [ "Number of achievements that exist for this game. Also", - "used to determine the u64 seed for the next achievement." + "used to determine the u64 seed for the next achievement.", ], - "type": "u64" + type: "u64", }, { - "name": "auth", - "docs": [ + name: "auth", + docs: [ "A collection of pubkeys which each represent a valid", - "authority for this game." + "authority for this game.", ], - "type": { - "vec": "publicKey" - } - } - ] - } + type: { + vec: "publicKey", + }, + }, + ], + }, }, { - "name": "leaderBoard", - "docs": [ + name: "leaderBoard", + docs: [ "Represents a [Game][super::Game]'s leaderboard.", "", - "Seeds: `[b\"leaderboard\", game.key().as_ref(), &id.to_le_bytes()]`" + 'Seeds: `[b"leaderboard", game.key().as_ref(), &id.to_le_bytes()]`', ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "id", - "docs": [ - "The leaderboard's id, used in deriving its address from the game." + name: "id", + docs: [ + "The leaderboard's id, used in deriving its address from the game.", ], - "type": "u64" + type: "u64", }, { - "name": "game", - "docs": [ - "The game this leaderboard belongs to and is derived from." - ], - "type": "publicKey" + name: "game", + docs: ["The game this leaderboard belongs to and is derived from."], + type: "publicKey", }, { - "name": "description", - "docs": [ - "Leaderboard description." - ], - "type": "string" + name: "description", + docs: ["Leaderboard description."], + type: "string", }, { - "name": "nftMeta", - "docs": [ - "Pubkey of an nft metadata account that describes this leaderboard." + name: "nftMeta", + docs: [ + "Pubkey of an nft metadata account that describes this leaderboard.", ], - "type": "publicKey" + type: "publicKey", }, { - "name": "decimals", - "docs": [ - "Used to contextualize scores for this leaderboard." - ], - "type": "u8" + name: "decimals", + docs: ["Used to contextualize scores for this leaderboard."], + type: "u8", }, { - "name": "minScore", - "docs": [ - "Minimum possible score for this leaderboard." - ], - "type": "u64" + name: "minScore", + docs: ["Minimum possible score for this leaderboard."], + type: "u64", }, { - "name": "maxScore", - "docs": [ - "Maximum possible score for this leaderboard." - ], - "type": "u64" + name: "maxScore", + docs: ["Maximum possible score for this leaderboard."], + type: "u64", }, { - "name": "topEntries", - "docs": [ - "Top [entries](ScoreEntry) for a leaderboard." - ], - "type": { - "option": "publicKey" - } - } - ] - } + name: "topEntries", + docs: ["Top [entries](ScoreEntry) for a leaderboard."], + type: { + option: "publicKey", + }, + }, + ], + }, }, { - "name": "merged", - "docs": [ + name: "merged", + docs: [ "An account that represents a single user's ownership of", - "multiple [Player][super::Player] accounts." + "multiple [Player][super::Player] accounts.", ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "initiator", - "docs": [ - "The user that initialized this merge." - ], - "type": "publicKey" + name: "initiator", + docs: ["The user that initialized this merge."], + type: "publicKey", }, { - "name": "approvals", - "docs": [ - "Details of all the player accounts to be merged with the main_user's." + name: "approvals", + docs: [ + "Details of all the player accounts to be merged with the main_user's.", ], - "type": { - "vec": { - "defined": "MergeApproval" - } - } + type: { + vec: { + defined: "MergeApproval", + }, + }, }, { - "name": "mergeComplete", - "docs": [ - "Set to true when every user in `others` has registered their approval." + name: "mergeComplete", + docs: [ + "Set to true when every user in `others` has registered their approval.", ], - "type": "bool" - } - ] - } + type: "bool", + }, + ], + }, }, { - "name": "playerAchievement", - "docs": [ + name: "playerAchievement", + docs: [ "Represents a player's status for a particular [Achievement](super::Achievement).", "", - "Seeds = `[b\"player-achievement\", player.key().as_ref(), achievement.key().as_ref()]`." + 'Seeds = `[b"player-achievement", player.key().as_ref(), achievement.key().as_ref()]`.', ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "playerAccount", - "docs": [ - "The user's [player][super::Player] account." - ], - "type": "publicKey" + name: "playerAccount", + docs: ["The user's [player][super::Player] account."], + type: "publicKey", }, { - "name": "achievement", - "docs": [ - "The key of the achievement unlocked for this player." - ], - "type": "publicKey" + name: "achievement", + docs: ["The key of the achievement unlocked for this player."], + type: "publicKey", }, { - "name": "timestamp", - "docs": [ - "Timestamp showing when this achievement was unlocked." - ], - "type": "i64" + name: "timestamp", + docs: ["Timestamp showing when this achievement was unlocked."], + type: "i64", }, { - "name": "unlocked", - "docs": [ - "A player's unlock status for this achievement." - ], - "type": "bool" + name: "unlocked", + docs: ["A player's unlock status for this achievement."], + type: "bool", }, { - "name": "claimed", - "docs": [ - "Whether or not this player has claimed their reward." - ], - "type": "bool" - } - ] - } + name: "claimed", + docs: ["Whether or not this player has claimed their reward."], + type: "bool", + }, + ], + }, }, { - "name": "playerScoresList", - "docs": [ + name: "playerScoresList", + docs: [ "Holds a list of a [player][super::Player]'s [scores][ScoreEntry])", "for a particular [LeaderBoard].", "", - "Seeds: `[b\"player-scores-list\", player_account.key().as_ref(), leaderboard.key().as_ref()]`" + 'Seeds: `[b"player-scores-list", player_account.key().as_ref(), leaderboard.key().as_ref()]`', ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "playerAccount", - "docs": [ - "The player[super::Player] account this entry is derived from" + name: "playerAccount", + docs: [ + "The player[super::Player] account this entry is derived from", ], - "type": "publicKey" + type: "publicKey", }, { - "name": "leaderboard", - "docs": [ - "The id of the specific leaderboard." - ], - "type": "publicKey" + name: "leaderboard", + docs: ["The id of the specific leaderboard."], + type: "publicKey", }, { - "name": "allocCount", - "docs": [ - "Max number of [scores][ScoreEntry] the current space allocation supports." + name: "allocCount", + docs: [ + "Max number of [scores][ScoreEntry] the current space allocation supports.", ], - "type": "u16" + type: "u16", }, { - "name": "scores", - "docs": [ - "Collection of [scores][ScoreEntry]." - ], - "type": { - "vec": { - "defined": "ScoreEntry" - } - } - } - ] - } + name: "scores", + docs: ["Collection of [scores][ScoreEntry]."], + type: { + vec: { + defined: "ScoreEntry", + }, + }, + }, + ], + }, }, { - "name": "player", - "docs": [ + name: "player", + docs: [ "An account representing a player.", "", - "Seeds: `[b\"player\", user.key().as_ref()]`" + 'Seeds: `[b"player", user.key().as_ref()]`', ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "user", - "docs": [ - "The wallet that owns this player-info account" - ], - "type": "publicKey" + name: "user", + docs: ["The wallet that owns this player-info account"], + type: "publicKey", }, { - "name": "username", - "docs": [ - "The player's username." - ], - "type": "string" + name: "username", + docs: ["The player's username."], + type: "string", }, { - "name": "nftMeta", - "docs": [ - "Metadata to represent this player." - ], - "type": "publicKey" - } - ] - } + name: "nftMeta", + docs: ["Metadata to represent this player."], + type: "publicKey", + }, + ], + }, }, { - "name": "nftClaim", - "type": { - "kind": "struct", - "fields": [] - } + name: "nftClaim", + type: { + kind: "struct", + fields: [], + }, }, { - "name": "reward", - "docs": [ - "An account representing a reward for a given achievement." - ], - "type": { - "kind": "struct", - "fields": [ + name: "reward", + docs: ["An account representing a reward for a given achievement."], + type: { + kind: "struct", + fields: [ { - "name": "achievement", - "docs": [ - "The achievement this reward is given for." - ], - "type": "publicKey" + name: "achievement", + docs: ["The achievement this reward is given for."], + type: "publicKey", }, { - "name": "availableSpots", - "docs": [ - "Number of available reward spots." - ], - "type": "u64" + name: "availableSpots", + docs: ["Number of available reward spots."], + type: "u64", }, { - "name": "reward", - "docs": [ - "The reward kind. Current supports Nft and Ft rewards only." + name: "reward", + docs: [ + "The reward kind. Current supports Nft and Ft rewards only.", ], - "type": { - "defined": "RewardKind" - } - } - ] - } + type: { + defined: "RewardKind", + }, + }, + ], + }, }, { - "name": "leaderTopEntries", - "docs": [ + name: "leaderTopEntries", + docs: [ "Keeps track of a sorted list of top scores for a leaderboard.", "", - "Seeds = [b\"top-scores\", leaderboard.key().as_ref()]" + 'Seeds = [b"top-scores", leaderboard.key().as_ref()]', ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "isAscending", - "docs": [ - "Arrangement order." - ], - "type": "bool" + name: "isAscending", + docs: ["Arrangement order."], + type: "bool", }, { - "name": "topScores", - "docs": [ - "Top scores." - ], - "type": { - "vec": { - "defined": "LeaderBoardScore" - } - } - } - ] - } - } + name: "topScores", + docs: ["Top scores."], + type: { + vec: { + defined: "LeaderBoardScore", + }, + }, + }, + ], + }, + }, ], - "types": [ + types: [ { - "name": "GameAttributes", - "docs": [ - "A type that represents game-specific information." - ], - "type": { - "kind": "struct", - "fields": [ + name: "GameAttributes", + docs: ["A type that represents game-specific information."], + type: { + kind: "struct", + fields: [ { - "name": "title", - "docs": [ - "The title of the game, max length = 30 bytes." - ], - "type": "string" + name: "title", + docs: ["The title of the game, max length = 30 bytes."], + type: "string", }, { - "name": "description", - "docs": [ - "The game description, max length = 200 bytes." - ], - "type": "string" + name: "description", + docs: ["The game description, max length = 200 bytes."], + type: "string", }, { - "name": "genre", - "docs": [ - "The game's [genre](super::Genre), as a u8." - ], - "type": "u8" + name: "genre", + docs: ["The game's [genre](super::Genre), as a u8."], + type: "u8", }, { - "name": "gameType", - "docs": [ - "The game's [type](super::GameType), as a u8." - ], - "type": "u8" + name: "gameType", + docs: ["The game's [type](super::GameType), as a u8."], + type: "u8", }, { - "name": "nftMeta", - "docs": [ - "An nft metadata account describing the game." - ], - "type": "publicKey" - } - ] - } + name: "nftMeta", + docs: ["An nft metadata account describing the game."], + type: "publicKey", + }, + ], + }, }, { - "name": "ScoreEntry", - "docs": [ - "A single score entry for a player." - ], - "type": { - "kind": "struct", - "fields": [ + name: "ScoreEntry", + docs: ["A single score entry for a player."], + type: { + kind: "struct", + fields: [ { - "name": "score", - "docs": [ - "The player's score." - ], - "type": "u64" + name: "score", + docs: ["The player's score."], + type: "u64", }, { - "name": "timestamp", - "docs": [ - "When this entry was made." - ], - "type": "i64" - } - ] - } + name: "timestamp", + docs: ["When this entry was made."], + type: "i64", + }, + ], + }, }, { - "name": "MergeApproval", - "docs": [ + name: "MergeApproval", + docs: [ "Represents a [Player][super::Player] account involved in a merge", - "and if that account's user/authority has granted approval." + "and if that account's user/authority has granted approval.", ], - "type": { - "kind": "struct", - "fields": [ + type: { + kind: "struct", + fields: [ { - "name": "key", - "docs": [ - "The player_account pubkey." - ], - "type": "publicKey" + name: "key", + docs: ["The player_account pubkey."], + type: "publicKey", }, { - "name": "approved", - "docs": [ - "User's approval status." - ], - "type": "bool" - } - ] - } + name: "approved", + docs: ["User's approval status."], + type: "bool", + }, + ], + }, }, { - "name": "LeaderBoardScore", - "docs": [ - "An single entry to a [LeaderTopEntries]." - ], - "type": { - "kind": "struct", - "fields": [ + name: "LeaderBoardScore", + docs: ["An single entry to a [LeaderTopEntries]."], + type: { + kind: "struct", + fields: [ { - "name": "player", - "docs": [ - "The player" - ], - "type": "publicKey" + name: "player", + docs: ["The player"], + type: "publicKey", }, { - "name": "entry", - "docs": [ - "The user's [score][super::ScoreEntry]." - ], - "type": { - "defined": "ScoreEntry" - } - } - ] - } + name: "entry", + docs: ["The user's [score][super::ScoreEntry]."], + type: { + defined: "ScoreEntry", + }, + }, + ], + }, }, { - "name": "RegisterLeaderBoardInput", - "docs": [ - "Parameters needed when registering a leaderboard." - ], - "type": { - "kind": "struct", - "fields": [ + name: "RegisterLeaderBoardInput", + docs: ["Parameters needed when registering a leaderboard."], + type: { + kind: "struct", + fields: [ { - "name": "description", - "docs": [ - "Leaderboard description." - ], - "type": "string" + name: "description", + docs: ["Leaderboard description."], + type: "string", }, { - "name": "nftMeta", - "docs": [ - "Nft metadata representing the leaderboard." - ], - "type": "publicKey" + name: "nftMeta", + docs: ["Nft metadata representing the leaderboard."], + type: "publicKey", }, { - "name": "decimals", - "docs": [ - "Specify the decimals score values are represented in. Defaults to `0` if [None]." + name: "decimals", + docs: [ + "Specify the decimals score values are represented in. Defaults to `0` if [None].", ], - "type": { - "option": "u8" - } + type: { + option: "u8", + }, }, { - "name": "minScore", - "docs": [ - "Specifies minimum allowed score. Defaults to `u64::MIN` if [None]." + name: "minScore", + docs: [ + "Specifies minimum allowed score. Defaults to `u64::MIN` if [None].", ], - "type": { - "option": "u64" - } + type: { + option: "u64", + }, }, { - "name": "maxScore", - "docs": [ - "Specifies maximum allowed score. Defaults to `u64::MAX` if [None]." + name: "maxScore", + docs: [ + "Specifies maximum allowed score. Defaults to `u64::MAX` if [None].", ], - "type": { - "option": "u64" - } + type: { + option: "u64", + }, }, { - "name": "scoresToRetain", - "docs": [ - "Number of top scores to store on-chain." - ], - "type": "u8" + name: "scoresToRetain", + docs: ["Number of top scores to store on-chain."], + type: "u8", }, { - "name": "scoresOrder", - "docs": [ - "Order by which scores are stored. `true` for ascending, `false` for descending." + name: "scoresOrder", + docs: [ + "Order by which scores are stored. `true` for ascending, `false` for descending.", ], - "type": "bool" - } - ] - } + type: "bool", + }, + ], + }, }, { - "name": "AddNewRewardInput", - "docs": [ - "Input to add a new reward for an achievement." - ], - "type": { - "kind": "struct", - "fields": [ + name: "AddNewRewardInput", + docs: ["Input to add a new reward for an achievement."], + type: { + kind: "struct", + fields: [ { - "name": "availableSpots", - "docs": [ - "Number of rewards to be given out." - ], - "type": "u64" + name: "availableSpots", + docs: ["Number of rewards to be given out."], + type: "u64", }, { - "name": "kind", - "docs": [ - "Specific reward kind." - ], - "type": { - "defined": "RewardKindInput" - } - } - ] - } + name: "kind", + docs: ["Specific reward kind."], + type: { + defined: "RewardKindInput", + }, + }, + ], + }, }, { - "name": "GameType", - "type": { - "kind": "enum", - "variants": [ + name: "GameType", + type: { + kind: "enum", + variants: [ { - "name": "Mobile" + name: "Mobile", }, { - "name": "Desktop" + name: "Desktop", }, { - "name": "Web" + name: "Web", }, { - "name": "Unspecified" - } - ] - } + name: "Unspecified", + }, + ], + }, }, { - "name": "Genre", - "type": { - "kind": "enum", - "variants": [ + name: "Genre", + type: { + kind: "enum", + variants: [ { - "name": "Rpg" + name: "Rpg", }, { - "name": "Mmo" + name: "Mmo", }, { - "name": "Action" + name: "Action", }, { - "name": "Adventure" + name: "Adventure", }, { - "name": "Puzzle" + name: "Puzzle", }, { - "name": "Casual" + name: "Casual", }, { - "name": "Unspecified" - } - ] - } + name: "Unspecified", + }, + ], + }, }, { - "name": "RewardKind", - "docs": [ - "The kind of reward to be given out." - ], - "type": { - "kind": "enum", - "variants": [ + name: "RewardKind", + docs: ["The kind of reward to be given out."], + type: { + kind: "enum", + variants: [ { - "name": "FungibleToken", - "fields": [ + name: "FungibleToken", + fields: [ { - "name": "mint", - "docs": [ - "The mint of the token to be given out." - ], - "type": "publicKey" + name: "mint", + docs: ["The mint of the token to be given out."], + type: "publicKey", }, { - "name": "account", - "docs": [ - "The token account to withdraw from." - ], - "type": "publicKey" + name: "account", + docs: ["The token account to withdraw from."], + type: "publicKey", }, { - "name": "amount", - "docs": [ - "Reward amount per user." - ], - "type": "u64" - } - ] + name: "amount", + docs: ["Reward amount per user."], + type: "u64", + }, + ], }, { - "name": "NonFungibleToken", - "fields": [ + name: "NonFungibleToken", + fields: [ { - "name": "uri", - "docs": [ - "URI of the NFT to be minted." - ], - "type": "string" + name: "uri", + docs: ["URI of the NFT to be minted."], + type: "string", }, { - "name": "name", - "docs": [ - "Name of the NFT to be minted." - ], - "type": "string" + name: "name", + docs: ["Name of the NFT to be minted."], + type: "string", }, { - "name": "symbol", - "docs": [ - "Symbol of the NFT to be minted." - ], - "type": "string" + name: "symbol", + docs: ["Symbol of the NFT to be minted."], + type: "string", }, { - "name": "minted", - "docs": [ - "Total NFTs minted so far." - ], - "type": "u64" + name: "minted", + docs: ["Total NFTs minted so far."], + type: "u64", }, { - "name": "collection", - "docs": [ + name: "collection", + docs: [ "Optional field for a collection mint used for", - "verifying minted rewards." + "verifying minted rewards.", ], - "type": { - "option": "publicKey" - } - } - ] - } - ] - } + type: { + option: "publicKey", + }, + }, + ], + }, + ], + }, }, { - "name": "RewardKindInput", - "docs": [ - "Specific variant of [AddNewRewardInput]." - ], - "type": { - "kind": "enum", - "variants": [ + name: "RewardKindInput", + docs: ["Specific variant of [AddNewRewardInput]."], + type: { + kind: "enum", + variants: [ { - "name": "Ft", - "fields": [ + name: "Ft", + fields: [ { - "name": "deposit", - "docs": [ + name: "deposit", + docs: [ "Amount to be delegated to this program's PDA", - "so it can spend for reward claims." + "so it can spend for reward claims.", ], - "type": "u64" + type: "u64", }, { - "name": "amount", - "docs": [ - "Amount given to a single user." - ], - "type": "u64" - } - ] + name: "amount", + docs: ["Amount given to a single user."], + type: "u64", + }, + ], }, { - "name": "Nft", - "fields": [ + name: "Nft", + fields: [ { - "name": "uri", - "docs": [ - "Uri of the minted nft." - ], - "type": "string" + name: "uri", + docs: ["Uri of the minted nft."], + type: "string", }, { - "name": "name", - "docs": [ - "Name of the minted nft." - ], - "type": "string" + name: "name", + docs: ["Name of the minted nft."], + type: "string", }, { - "name": "symbol", - "docs": [ - "Symbol of the minted nft." - ], - "type": "string" - } - ] - } - ] - } - } + name: "symbol", + docs: ["Symbol of the minted nft."], + type: "string", + }, + ], + }, + ], + }, + }, ], - "errors": [ + errors: [ { - "code": 6000, - "name": "InvalidFieldLength", - "msg": "Exceeded max length for field." + code: 6000, + name: "InvalidFieldLength", + msg: "Exceeded max length for field.", }, { - "code": 6001, - "name": "InvalidAuthority", - "msg": "Invalid authority for instruction" + code: 6001, + name: "InvalidAuthority", + msg: "Invalid authority for instruction", }, { - "code": 6002, - "name": "MissingSignature", - "msg": "An expected signature isn't present" + code: 6002, + name: "MissingSignature", + msg: "An expected signature isn't present", }, { - "code": 6003, - "name": "NoRewardForAchievement", - "msg": "Reward not specified for this achievement" + code: 6003, + name: "NoRewardForAchievement", + msg: "Reward not specified for this achievement", }, { - "code": 6004, - "name": "AccountNotPartOfMerge", - "msg": "The merge account does not include this player account" + code: 6004, + name: "AccountNotPartOfMerge", + msg: "The merge account does not include this player account", }, { - "code": 6005, - "name": "ScoreNotWithinBounds", - "msg": "Tried to input score that is below the minimum or above the maximum" + code: 6005, + name: "ScoreNotWithinBounds", + msg: "Tried to input score that is below the minimum or above the maximum", }, { - "code": 6006, - "name": "MissingExpectedAccount", - "msg": "An optional but expected account is missing" + code: 6006, + name: "MissingExpectedAccount", + msg: "An optional but expected account is missing", }, { - "code": 6007, - "name": "InvalidRewardKind", - "msg": "Invalid reward kind for this instruction" + code: 6007, + name: "InvalidRewardKind", + msg: "Invalid reward kind for this instruction", }, { - "code": 6008, - "name": "NoAvailableRewards", - "msg": "No more rewards are being given out for this game" - } - ] + code: 6008, + name: "NoAvailableRewards", + msg: "No more rewards are being given out for this game", + }, + ], }; diff --git a/client/sdk/src/idl/tens.ts b/client/sdk/src/idl/tens.ts index b3ce2a1..58bd267 100644 --- a/client/sdk/src/idl/tens.ts +++ b/client/sdk/src/idl/tens.ts @@ -1,457 +1,433 @@ -export type Tens = { - "version": "0.1.0", - "name": "tens", - "instructions": [ +export interface Tens { + version: "0.1.0"; + name: "tens"; + instructions: [ { - "name": "register", - "accounts": [ + name: "register"; + accounts: [ { - "name": "signer", - "isMut": true, - "isSigner": true + name: "signer"; + isMut: true; + isSigner: true; }, { - "name": "tensState", - "isMut": true, - "isSigner": false + name: "tensState"; + isMut: true; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [ + ]; + args: [ { - "name": "soarState", - "type": "publicKey" + name: "soarState"; + type: "publicKey"; }, { - "name": "soarLeaderboard", - "type": "publicKey" + name: "soarLeaderboard"; + type: "publicKey"; }, { - "name": "soarLeaderboardTopEntries", - "type": "publicKey" + name: "soarLeaderboardTopEntries"; + type: "publicKey"; } - ] + ]; }, { - "name": "makeMove", - "accounts": [ + name: "makeMove"; + accounts: [ { - "name": "user", - "isMut": true, - "isSigner": true + name: "user"; + isMut: true; + isSigner: true; }, { - "name": "tensState", - "isMut": true, - "isSigner": false + name: "tensState"; + isMut: true; + isSigner: false; }, { - "name": "soarState", - "isMut": false, - "isSigner": false + name: "soarState"; + isMut: false; + isSigner: false; }, { - "name": "soarLeaderboard", - "isMut": false, - "isSigner": false + name: "soarLeaderboard"; + isMut: false; + isSigner: false; }, { - "name": "soarPlayerAccount", - "isMut": false, - "isSigner": false + name: "soarPlayerAccount"; + isMut: false; + isSigner: false; }, { - "name": "soarPlayerScores", - "isMut": true, - "isSigner": false + name: "soarPlayerScores"; + isMut: true; + isSigner: false; }, { - "name": "soarTopEntries", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "soarTopEntries"; + isMut: true; + isSigner: false; + isOptional: true; }, { - "name": "soarProgram", - "isMut": false, - "isSigner": false + name: "soarProgram"; + isMut: false; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; }, { - "name": "claimReward", - "accounts": [ + name: "claimReward"; + accounts: [ { - "name": "user", - "isMut": true, - "isSigner": true + name: "user"; + isMut: true; + isSigner: true; }, { - "name": "tensState", - "isMut": true, - "isSigner": false + name: "tensState"; + isMut: true; + isSigner: false; }, { - "name": "playerAccount", - "isMut": true, - "isSigner": false + name: "playerAccount"; + isMut: true; + isSigner: false; }, { - "name": "soarPlayerScores", - "isMut": false, - "isSigner": false + name: "soarPlayerScores"; + isMut: false; + isSigner: false; }, { - "name": "soarTopEntries", - "isMut": false, - "isSigner": false + name: "soarTopEntries"; + isMut: false; + isSigner: false; }, { - "name": "soarState", - "isMut": false, - "isSigner": false + name: "soarState"; + isMut: false; + isSigner: false; }, { - "name": "soarAchievement", - "isMut": false, - "isSigner": false + name: "soarAchievement"; + isMut: false; + isSigner: false; }, { - "name": "soarReward", - "isMut": true, - "isSigner": false + name: "soarReward"; + isMut: true; + isSigner: false; }, { - "name": "soarPlayerAchievement", - "isMut": true, - "isSigner": false + name: "soarPlayerAchievement"; + isMut: true; + isSigner: false; }, { - "name": "sourceTokenAccount", - "isMut": true, - "isSigner": false + name: "sourceTokenAccount"; + isMut: true; + isSigner: false; }, { - "name": "userTokenAccount", - "isMut": true, - "isSigner": false + name: "userTokenAccount"; + isMut: true; + isSigner: false; }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram"; + isMut: false; + isSigner: false; }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram"; + isMut: false; + isSigner: false; }, { - "name": "soarProgram", - "isMut": false, - "isSigner": false + name: "soarProgram"; + isMut: false; + isSigner: false; } - ], - "args": [] + ]; + args: []; } - ], - "accounts": [ + ]; + accounts: [ { - "name": "tens", - "docs": [ - "A simple game." - ], - "type": { - "kind": "struct", - "fields": [ + name: "tens"; + docs: ["A simple game."]; + type: { + kind: "struct"; + fields: [ { - "name": "counter", - "docs": [ - "The game counter." - ], - "type": "u64" + name: "counter"; + docs: ["The game counter."]; + type: "u64"; }, { - "name": "soar", - "docs": [ - "The SOAR keys for this program." - ], - "type": { - "defined": "SoarKeysStorage" - } + name: "soar"; + docs: ["The SOAR keys for this program."]; + type: { + defined: "SoarKeysStorage"; + }; } - ] - } + ]; + }; } - ], - "types": [ + ]; + types: [ { - "name": "SoarKeysStorage", - "type": { - "kind": "struct", - "fields": [ + name: "SoarKeysStorage"; + type: { + kind: "struct"; + fields: [ { - "name": "state", - "docs": [ - "The soar state for this game." - ], - "type": "publicKey" + name: "state"; + docs: ["The soar state for this game."]; + type: "publicKey"; }, { - "name": "leaderboard", - "docs": [ - "The soar leaderboard for this game." - ], - "type": "publicKey" + name: "leaderboard"; + docs: ["The soar leaderboard for this game."]; + type: "publicKey"; }, { - "name": "topEntries", - "docs": [ - "The soar top-entries account for this game." - ], - "type": "publicKey" + name: "topEntries"; + docs: ["The soar top-entries account for this game."]; + type: "publicKey"; } - ] - } + ]; + }; } - ] -}; + ]; +} export const IDL: Tens = { - "version": "0.1.0", - "name": "tens", - "instructions": [ + version: "0.1.0", + name: "tens", + instructions: [ { - "name": "register", - "accounts": [ + name: "register", + accounts: [ { - "name": "signer", - "isMut": true, - "isSigner": true + name: "signer", + isMut: true, + isSigner: true, }, { - "name": "tensState", - "isMut": true, - "isSigner": false + name: "tensState", + isMut: true, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [ + args: [ { - "name": "soarState", - "type": "publicKey" + name: "soarState", + type: "publicKey", }, { - "name": "soarLeaderboard", - "type": "publicKey" + name: "soarLeaderboard", + type: "publicKey", }, { - "name": "soarLeaderboardTopEntries", - "type": "publicKey" - } - ] + name: "soarLeaderboardTopEntries", + type: "publicKey", + }, + ], }, { - "name": "makeMove", - "accounts": [ + name: "makeMove", + accounts: [ { - "name": "user", - "isMut": true, - "isSigner": true + name: "user", + isMut: true, + isSigner: true, }, { - "name": "tensState", - "isMut": true, - "isSigner": false + name: "tensState", + isMut: true, + isSigner: false, }, { - "name": "soarState", - "isMut": false, - "isSigner": false + name: "soarState", + isMut: false, + isSigner: false, }, { - "name": "soarLeaderboard", - "isMut": false, - "isSigner": false + name: "soarLeaderboard", + isMut: false, + isSigner: false, }, { - "name": "soarPlayerAccount", - "isMut": false, - "isSigner": false + name: "soarPlayerAccount", + isMut: false, + isSigner: false, }, { - "name": "soarPlayerScores", - "isMut": true, - "isSigner": false + name: "soarPlayerScores", + isMut: true, + isSigner: false, }, { - "name": "soarTopEntries", - "isMut": true, - "isSigner": false, - "isOptional": true + name: "soarTopEntries", + isMut: true, + isSigner: false, + isOptional: true, }, { - "name": "soarProgram", - "isMut": false, - "isSigner": false + name: "soarProgram", + isMut: false, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } + name: "systemProgram", + isMut: false, + isSigner: false, + }, ], - "args": [] + args: [], }, { - "name": "claimReward", - "accounts": [ + name: "claimReward", + accounts: [ { - "name": "user", - "isMut": true, - "isSigner": true + name: "user", + isMut: true, + isSigner: true, }, { - "name": "tensState", - "isMut": true, - "isSigner": false + name: "tensState", + isMut: true, + isSigner: false, }, { - "name": "playerAccount", - "isMut": true, - "isSigner": false + name: "playerAccount", + isMut: true, + isSigner: false, }, { - "name": "soarPlayerScores", - "isMut": false, - "isSigner": false + name: "soarPlayerScores", + isMut: false, + isSigner: false, }, { - "name": "soarTopEntries", - "isMut": false, - "isSigner": false + name: "soarTopEntries", + isMut: false, + isSigner: false, }, { - "name": "soarState", - "isMut": false, - "isSigner": false + name: "soarState", + isMut: false, + isSigner: false, }, { - "name": "soarAchievement", - "isMut": false, - "isSigner": false + name: "soarAchievement", + isMut: false, + isSigner: false, }, { - "name": "soarReward", - "isMut": true, - "isSigner": false + name: "soarReward", + isMut: true, + isSigner: false, }, { - "name": "soarPlayerAchievement", - "isMut": true, - "isSigner": false + name: "soarPlayerAchievement", + isMut: true, + isSigner: false, }, { - "name": "sourceTokenAccount", - "isMut": true, - "isSigner": false + name: "sourceTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "userTokenAccount", - "isMut": true, - "isSigner": false + name: "userTokenAccount", + isMut: true, + isSigner: false, }, { - "name": "tokenProgram", - "isMut": false, - "isSigner": false + name: "tokenProgram", + isMut: false, + isSigner: false, }, { - "name": "systemProgram", - "isMut": false, - "isSigner": false + name: "systemProgram", + isMut: false, + isSigner: false, }, { - "name": "soarProgram", - "isMut": false, - "isSigner": false - } + name: "soarProgram", + isMut: false, + isSigner: false, + }, ], - "args": [] - } + args: [], + }, ], - "accounts": [ + accounts: [ { - "name": "tens", - "docs": [ - "A simple game." - ], - "type": { - "kind": "struct", - "fields": [ + name: "tens", + docs: ["A simple game."], + type: { + kind: "struct", + fields: [ { - "name": "counter", - "docs": [ - "The game counter." - ], - "type": "u64" + name: "counter", + docs: ["The game counter."], + type: "u64", }, { - "name": "soar", - "docs": [ - "The SOAR keys for this program." - ], - "type": { - "defined": "SoarKeysStorage" - } - } - ] - } - } + name: "soar", + docs: ["The SOAR keys for this program."], + type: { + defined: "SoarKeysStorage", + }, + }, + ], + }, + }, ], - "types": [ + types: [ { - "name": "SoarKeysStorage", - "type": { - "kind": "struct", - "fields": [ + name: "SoarKeysStorage", + type: { + kind: "struct", + fields: [ { - "name": "state", - "docs": [ - "The soar state for this game." - ], - "type": "publicKey" + name: "state", + docs: ["The soar state for this game."], + type: "publicKey", }, { - "name": "leaderboard", - "docs": [ - "The soar leaderboard for this game." - ], - "type": "publicKey" + name: "leaderboard", + docs: ["The soar leaderboard for this game."], + type: "publicKey", }, { - "name": "topEntries", - "docs": [ - "The soar top-entries account for this game." - ], - "type": "publicKey" - } - ] - } - } - ] + name: "topEntries", + docs: ["The soar top-entries account for this game."], + type: "publicKey", + }, + ], + }, + }, + ], }; From 9d45ebf2dedcab5afac4543bc112d711f29c3527 Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Mon, 6 Nov 2023 23:55:16 +0100 Subject: [PATCH 3/4] :green_heart: Fix CI --- client/tests/tens.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/tests/tens.ts b/client/tests/tens.ts index 2e679c3..7c0e54e 100644 --- a/client/tests/tens.ts +++ b/client/tests/tens.ts @@ -11,7 +11,7 @@ describe("tens", () => { anchor.setProvider(provider); const tensProgramId = new PublicKey( - "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS" + "Tensgwm3DY3UJ8nhF7xnD2Wo65VcnLTXjjoyEvs6Zyk" ); const tensProgram = new Program(IDL, tensProgramId, provider); From b26bb405383c6ed6c1520e6b2a84b08adac1be4b Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Tue, 7 Nov 2023 00:03:25 +0100 Subject: [PATCH 4/4] :recycle: Code Refactor --- Cargo.lock | 2 +- crates/soar-cpi/idl.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64f5231..95e986d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2020,7 +2020,7 @@ dependencies = [ [[package]] name = "soar-cpi" -version = "0.1.3" +version = "0.1.4" dependencies = [ "anchor-lang", "clockwork-anchor-gen", diff --git a/crates/soar-cpi/idl.json b/crates/soar-cpi/idl.json index 0cbecfb..48557da 100644 --- a/crates/soar-cpi/idl.json +++ b/crates/soar-cpi/idl.json @@ -1838,6 +1838,6 @@ } ], "metadata": { - "address": "SoarmxsvnGcQzLGaiue8mVTko7uuEfTY5zwdKKCnQDU" + "address": "SoarNNzwQHMwcfdkdLc6kvbkoMSxcHy89gTHrjhJYkk" } } \ No newline at end of file