From ae24f61676749292363a565949b08a6b2368499e Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Tue, 24 Oct 2023 16:14:28 +0200 Subject: [PATCH] :arrow_up: Upgrade to anchor 0.29.0 --- .github/workflows/publish-sdk.yml | 4 +- .github/workflows/run-tests.yml | 4 +- Cargo.lock | 327 +- client/sdk/src/idl/soar.ts | 4574 +++++++++-------- client/sdk/src/idl/tens.ts | 580 ++- crates/soar-cpi/Cargo.toml | 4 +- examples/tens/Cargo.toml | 2 +- examples/tens/src/lib.rs | 4 +- programs/soar/Cargo.toml | 4 +- .../soar/src/instructions/claim_reward.rs | 4 +- .../soar/src/instructions/verify_reward.rs | 2 +- 11 files changed, 2975 insertions(+), 2534 deletions(-) diff --git a/.github/workflows/publish-sdk.yml b/.github/workflows/publish-sdk.yml index c8443ca..46c20be 100644 --- a/.github/workflows/publish-sdk.yml +++ b/.github/workflows/publish-sdk.yml @@ -5,8 +5,8 @@ on: workflow_dispatch: env: - solana_version: v1.16.16 - anchor_version: 0.28.0 + solana_version: v1.17.0 + anchor_version: 0.29.0 jobs: install: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ff24d40..9e1495e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -4,8 +4,8 @@ on: pull_request: env: - solana_version: v1.16.16 - anchor_version: 0.28.0 + solana_version: v1.17.0 + anchor_version: 0.29.0 jobs: install: diff --git a/Cargo.lock b/Cargo.lock index 3603fe2..21c5e0a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ "getrandom 0.2.10", "once_cell", @@ -51,14 +51,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" dependencies = [ "cfg-if", "getrandom 0.2.10", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -84,6 +85,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-access-control" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +dependencies = [ + "anchor-syn 0.29.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-account" version = "0.28.0" @@ -99,6 +112,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-account" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +dependencies = [ + "anchor-syn 0.29.0", + "bs58 0.5.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-constant" version = "0.28.0" @@ -110,6 +136,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-constant" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +dependencies = [ + "anchor-syn 0.29.0", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-error" version = "0.28.0" @@ -122,6 +159,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-error" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +dependencies = [ + "anchor-syn 0.29.0", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-event" version = "0.28.0" @@ -135,6 +183,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-event" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +dependencies = [ + "anchor-syn 0.29.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-attribute-program" version = "0.28.0" @@ -148,6 +208,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-attribute-program" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +dependencies = [ + "anchor-syn 0.29.0", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-derive-accounts" version = "0.28.0" @@ -161,6 +232,30 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-derive-accounts" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +dependencies = [ + "anchor-syn 0.29.0", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +dependencies = [ + "anchor-syn 0.29.0", + "borsh-derive-internal 0.10.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "anchor-derive-space" version = "0.28.0" @@ -172,20 +267,56 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-derive-space" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +dependencies = [ + "proc-macro2", + "quote", + "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", - "anchor-attribute-account", - "anchor-attribute-constant", - "anchor-attribute-error", - "anchor-attribute-event", - "anchor-attribute-program", - "anchor-derive-accounts", - "anchor-derive-space", + "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-derive-serde", + "anchor-derive-space 0.29.0", "arrayref", "base64 0.13.1", "bincode", @@ -198,15 +329,15 @@ dependencies = [ [[package]] name = "anchor-spl" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f860599da1c2354e7234c768783049eb42e2f54509ecfc942d2e0076a2da7b" +checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ - "anchor-lang", + "anchor-lang 0.29.0", "solana-program", - "spl-associated-token-account 1.1.3", - "spl-token 3.5.0", - "spl-token-2022 0.6.1", + "spl-associated-token-account", + "spl-token 4.0.0", + "spl-token-2022 0.9.0", ] [[package]] @@ -245,6 +376,24 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-syn" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +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 = "anyhow" version = "1.0.75" @@ -423,9 +572,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bincode" @@ -751,9 +900,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" dependencies = [ "libc", ] @@ -1062,7 +1211,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.7", ] [[package]] @@ -1071,14 +1220,14 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.5", ] [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "heck" @@ -1169,7 +1318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.2", ] [[package]] @@ -1276,9 +1425,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1360,7 +1509,7 @@ dependencies = [ "num-traits", "shank", "solana-program", - "spl-associated-token-account 2.2.0", + "spl-associated-token-account", "spl-token 4.0.0", "thiserror", ] @@ -1535,9 +1684,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", @@ -1741,18 +1890,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.10.0" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", @@ -1762,9 +1911,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -1773,9 +1922,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3cbb081b9784b07cceb8824c8583f86db4814d172ab043f3c23f7dc600bf83d" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rmp" @@ -1840,9 +1989,9 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] @@ -1858,9 +2007,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", @@ -2006,7 +2155,7 @@ checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" name = "soar" version = "0.1.0" dependencies = [ - "anchor-lang", + "anchor-lang 0.29.0", "anchor-spl", "mpl-token-metadata", "solana-security-txt", @@ -2017,17 +2166,17 @@ dependencies = [ name = "soar-cpi" version = "0.1.2" dependencies = [ - "anchor-lang", + "anchor-lang 0.28.0", "clockwork-anchor-gen", ] [[package]] name = "solana-frozen-abi" -version = "1.16.16" +version = "1.16.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02eb4f0ed3eade20f4abdcc0031167344237cd6e16808bd0f33945f9db7861fe" +checksum = "8a63aebf4beac713a1949216ae180355c044df9cc3db9a58ca153bb10bb5843b" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.5", "blake3", "block-buffer 0.10.4", "bs58 0.4.0", @@ -2056,9 +2205,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.16" +version = "1.16.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28514761a285944cbad5b3d7930546369b80a713ba37d84bcf6ed2753611765" +checksum = "bced1b3c0421605312fd7eae7ceb6850d3b1d2e939da349c928e6d46a945c829" dependencies = [ "proc-macro2", "quote", @@ -2068,9 +2217,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.16.16" +version = "1.16.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c310c6749435ce1ea25a9ae3edfb2fd2c2aed2aa4d4f7e0487a8077a0b1ee30" +checksum = "c95311f23906f0fa4a6d995f3c39593db18e4d943e4d3fbf082a510d0881d7af" dependencies = [ "env_logger", "lazy_static", @@ -2079,16 +2228,16 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.16" +version = "1.16.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff2aa5434a77413e9d43e971ceb47bdb003f2e8bbc0365a25b684aca2605c25" +checksum = "e1f5c12cb15108734adae20be5e922c2db09d9623099541dcc61790703c6271c" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", "array-bytes", - "base64 0.21.4", + "base64 0.21.5", "bincode", "bitflags", "blake3", @@ -2134,12 +2283,12 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.16.16" +version = "1.16.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1002048941cedbd7dd6a96fdaa3dc5238b998aaa70b81946b1e3ec108cc2be" +checksum = "051b93dc7737a7fb530c1e74f135a652bb69f5554c8804b2ebf55d6fb6a30f26" dependencies = [ "assert_matches", - "base64 0.21.4", + "base64 0.21.5", "bincode", "bitflags", "borsh 0.10.3", @@ -2187,9 +2336,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.16" +version = "1.16.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b41b63b2da4a37ce323aba108db21f4c7bfa638dd1bf58fdc870f83bdce48ba" +checksum = "a1fae2d1f62d655f88280a39711db401973d1bbe54fec9f795be80b9d76837ae" dependencies = [ "bs58 0.4.0", "proc-macro2", @@ -2206,12 +2355,12 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-zk-token-sdk" -version = "1.16.16" +version = "1.16.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1fe77918563768a65fd5d6cd2fa06cf0aeb11e529a1ef8c230b0fe018600e3" +checksum = "ad3cc2b931a39510b1c90dc876a93ae315b9712a8338296e4b60519d09e57be9" dependencies = [ "aes-gcm-siv", - "base64 0.21.4", + "base64 0.21.5", "bincode", "bytemuck", "byteorder", @@ -2233,22 +2382,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "spl-associated-token-account" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4" -dependencies = [ - "assert_matches", - "borsh 0.9.3", - "num-derive 0.3.3", - "num-traits", - "solana-program", - "spl-token 3.5.0", - "spl-token-2022 0.6.1", - "thiserror", -] - [[package]] name = "spl-associated-token-account" version = "2.2.0" @@ -2521,7 +2654,7 @@ dependencies = [ name = "tens" version = "0.1.0" dependencies = [ - "anchor-lang", + "anchor-lang 0.29.0", "soar", ] @@ -2536,18 +2669,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", @@ -2599,9 +2732,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" @@ -2840,6 +2973,26 @@ dependencies = [ "memchr", ] +[[package]] +name = "zerocopy" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c19fae0c8a9efc6a8281f2e623db8af1db9e57852e04cde3e754dd2dc29340f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc56589e9ddd1f1c28d4b4b5c773ce232910a6bb67a70133d61c9e347585efe9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "zeroize" version = "1.3.0" 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 933fb0b..5b16e1c 100644 --- a/crates/soar-cpi/Cargo.toml +++ b/crates/soar-cpi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soar-cpi" -version = "0.1.2" +version = "0.1.3" edition = "2021" include = ["src/**/*", "idl.json"] description = "CPI helpers for the SOAR program" @@ -19,4 +19,4 @@ cpi = ["no-entrypoint"] [dependencies] clockwork-anchor-gen = "0.3.2" -anchor-lang = "0.28.0" +anchor-lang = "0.29.0" diff --git a/examples/tens/Cargo.toml b/examples/tens/Cargo.toml index 82137e6..e4d4687 100644 --- a/examples/tens/Cargo.toml +++ b/examples/tens/Cargo.toml @@ -16,5 +16,5 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = "0.28.0" +anchor-lang = "0.29.0" soar = { path = "../../programs/soar", features = ["cpi"] } diff --git a/examples/tens/src/lib.rs b/examples/tens/src/lib.rs index 7ad98ba..d06bb48 100644 --- a/examples/tens/src/lib.rs +++ b/examples/tens/src/lib.rs @@ -53,7 +53,7 @@ mod tens { system_program: ctx.accounts.system_program.to_account_info(), }; - let state_bump = *ctx.bumps.get("tens_state").unwrap(); + let state_bump = ctx.bumps.tens_state; let seeds = &[b"tens".as_ref(), &[state_bump]]; let signer = &[&seeds[..]]; @@ -92,7 +92,7 @@ mod tens { system_program: ctx.accounts.system_program.to_account_info(), }; - let state_bump = *ctx.bumps.get("tens_state").unwrap(); + let state_bump = ctx.bumps.tens_state; let seeds = &[b"tens".as_ref(), &[state_bump]]; let signer = &[&seeds[..]]; diff --git a/programs/soar/Cargo.toml b/programs/soar/Cargo.toml index 33aaadc..d383f8f 100644 --- a/programs/soar/Cargo.toml +++ b/programs/soar/Cargo.toml @@ -16,8 +16,8 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = { version = "0.28.0", features = ["init-if-needed"] } -anchor-spl = "0.28.0" +anchor-lang = { version = "0.29.0", features = ["init-if-needed"] } +anchor-spl = "0.29.0" mpl-token-metadata = { version="1.13.2", features = ["no-entrypoint"] } winnow = "=0.5.15" solana-security-txt = "1.1.1" diff --git a/programs/soar/src/instructions/claim_reward.rs b/programs/soar/src/instructions/claim_reward.rs index bb9a8f0..764ae72 100644 --- a/programs/soar/src/instructions/claim_reward.rs +++ b/programs/soar/src/instructions/claim_reward.rs @@ -18,7 +18,7 @@ pub mod ft { let achievement_account = &ctx.accounts.achievement; let game_key = &ctx.accounts.game.key(); - let achievement_bump = *ctx.bumps.get("achievement").unwrap(); + let achievement_bump = ctx.bumps.achievement; let id = ctx.accounts.achievement.id; let achievement_seeds = &[ crate::seeds::ACHIEVEMENT, @@ -86,7 +86,7 @@ pub mod nft { let achievement_account = &ctx.accounts.achievement; let game_key = &ctx.accounts.game.key(); - let achievement_bump = *ctx.bumps.get("achievement").unwrap(); + let achievement_bump = ctx.bumps.achievement; let id = ctx.accounts.achievement.id; let achievement_seeds = &[ crate::seeds::ACHIEVEMENT, diff --git a/programs/soar/src/instructions/verify_reward.rs b/programs/soar/src/instructions/verify_reward.rs index ca53fd4..adf8884 100644 --- a/programs/soar/src/instructions/verify_reward.rs +++ b/programs/soar/src/instructions/verify_reward.rs @@ -10,7 +10,7 @@ pub fn handler(ctx: Context) -> Result<()> { require_keys_eq!(decoded.mint, mint.key()); let game_key = &ctx.accounts.game.key(); - let achievement_bump = *ctx.bumps.get("achievement").unwrap(); + let achievement_bump = ctx.bumps.achievement; let id = ctx.accounts.achievement.id; let achievement_seeds = &[ seeds::ACHIEVEMENT,